diff --git a/scripts/Arch/OS/setup.sh b/scripts/Arch/OS/setup.sh index 9fc87122..97127b9d 100755 --- a/scripts/Arch/OS/setup.sh +++ b/scripts/Arch/OS/setup.sh @@ -9,6 +9,13 @@ ARCH_LANG="en_US.UTF-8"; ARCH_KEYMAP="de_CH-latin1"; LOCALE_PATTERN="\(de_CH\|en_US\)"; +projectRoot="$(realpath ../../..)"; +projectName="$(basename "$projectRoot")"; +relativeDir="$(realpath --relative-to "$projectRoot" "$(pwd)")"; +tempRoot="/root/$(basename "$projectName")"; +cp -r "$projectRoot"; "${ARCH_MOUNT_ROOT}$tempRoot"; +tempDir="$tempRoot/$relativeDir"; + loadkeys "$ARCH_KEYMAP"; timedatectl set-timezone "$ARCH_TIMEZONE"; . "./partition.sh"; @@ -29,11 +36,7 @@ arch-chroot "$ARCH_MOUNT_ROOT" mkinitcpio -P; echo "Please choose a password for the user \`root\`"; arch-chroot "$ARCH_MOUNT_ROOT" passwd; -dir="$(realpath ../../..)"; -scriptRoot="$(realpath --relative-to "$dir" "$(pwd)")"; -tempDir="/root/$(basename "$dir")"; -cp -r "$dir" "$ARCH_MOUNT_ROOT/root/"; -arch-chroot "$ARCH_MOUNT_ROOT" bash "$tempDir/$scriptRoot/../Software/GRUB/install.sh"; -arch-chroot "$ARCH_MOUNT_ROOT" rm -rf "$tempDir"; +arch-chroot "$ARCH_MOUNT_ROOT" bash "$tempDir/../Software/GRUB/install.sh"; +arch-chroot "$ARCH_MOUNT_ROOT" rm -rf "$tempRoot"; popd > /dev/null;