From 1dc32d2bb628e4442dcf857aa835ef7bbcb81f07 Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Sat, 13 Jul 2024 12:36:10 +0200 Subject: [PATCH] Allow direct execution of the installation --- scripts/Arch/OS/setup.fish | 4 ++++ scripts/Common/OS/setup.fish | 13 +++++++++++++ 2 files changed, 17 insertions(+) diff --git a/scripts/Arch/OS/setup.fish b/scripts/Arch/OS/setup.fish index 17acce76..188bd5fc 100644 --- a/scripts/Arch/OS/setup.fish +++ b/scripts/Arch/OS/setup.fish @@ -112,5 +112,9 @@ begin end | arch-chroot "$mountDir" tee "$file" > /dev/null end + function getInstallerScript -S + echo "$dir/install.fish" + end + source "$dir/../../Common/OS/setup.fish" end diff --git a/scripts/Common/OS/setup.fish b/scripts/Common/OS/setup.fish index d1618fcf..7e2e1b43 100644 --- a/scripts/Common/OS/setup.fish +++ b/scripts/Common/OS/setup.fish @@ -10,6 +10,12 @@ begin set -l PROJECT_CLONE_ROOT "/opt/$(basename "$projectName")" set -l script (mktemp) + function getCloneFile -S -a path + set -l relativeDir (realpath --relative-to "$projectRoot" "$dir") + set -l relativePath (realpath --relative-to "$dir" "$path") + echo "$PROJECT_CLONE_ROOT/$relativeDir/$relativePath" + end + getConfig valhalla.partition.script > "$script" bash "$script" and source "$dir/../../copy-repo.fish" "$mountDir$PROJECT_CLONE_ROOT" @@ -35,6 +41,13 @@ begin end | chroot "$mountDir" tee "/etc/sudoers.d/PortValhalla" > /dev/null and runHook autologin || true + + and begin + printf %s\n \ + "export CONFIG_MODULE=$(string escape (getCloneFile "$CONFIG_MODULE"))" \ + (string escape (getCloneFile (getInstallerScript))) + end | chroot "$mountDir" tee /root/.bash_profile > /dev/null + and echo "Setup finished!" and echo "Please reboot your machine" end