diff --git a/scripts/Arch/OS/setup.fish b/scripts/Arch/OS/setup.fish index f4a7a980..dc4d3a2d 100644 --- a/scripts/Arch/OS/setup.fish +++ b/scripts/Arch/OS/setup.fish @@ -102,5 +102,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