Allow direct execution of the installation

This commit is contained in:
Manuel Thalmann 2024-07-13 12:36:10 +02:00
parent 8f4e2c184d
commit 1dc32d2bb6
2 changed files with 17 additions and 0 deletions

View file

@ -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

View file

@ -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