Perform partitioning and repo-cloning in common setup

This commit is contained in:
Manuel Thalmann 2024-07-13 10:59:09 +02:00
parent f5bfc47f7a
commit 242b85d9c7
2 changed files with 10 additions and 12 deletions

View file

@ -6,7 +6,7 @@ begin
set -l mountDir (getConfig valhalla.partition.rootDir)
function setupOS -V dir -V CONFIG_MODULE -V mountDir
function setupOS -S -V dir -V CONFIG_MODULE -V mountDir
source "$dir/../../Common/Scripts/wait-network.fish"
source "$dir/../../Common/Scripts/hooks.fish"
@ -16,11 +16,8 @@ begin
waitNetwork
and begin
set -l projectRoot (realpath "$dir/../../..")
set -l projectName (basename "$projectRoot")
set -l relativeDir (realpath --relative-to "$projectRoot" "$dir")
set -l tempRoot "/opt/$(basename "$projectName")"
set -l tempDir "$tempRoot/$relativeDir"
set -l relativeDir (realpath --relative-to "$dir/../../.." "$dir")
set -l tempDir "$PROJECT_CLONE_ROOT/$relativeDir"
if set -l keyMap (getConfig valhalla.keyMap)
loadkeys "$keyMap"
@ -34,8 +31,6 @@ begin
true
end
and CONFIG_MODULE=$CONFIG_MODULE bash "$dir/../../Common/OS/partition.sh"
and pacman-key --init
and pacman-key --populate
@ -49,10 +44,7 @@ begin
texinfo
and runHook installDrivers "Installing drivers…" || true
and "$dir/../../copy-repo.fish" "$mountDir$tempRoot"
and genfstab -U "$mountDir" >> "$mountDir/etc/fstab"
and arch-chroot "$mountDir" systemctl enable NetworkManager
and if set -q timezone

View file

@ -5,7 +5,13 @@ begin
source "$dir/../Scripts/hooks.fish"
set -l name (getConfig valhalla.setupUser.name)
set -l mountDir (getConfig valhalla.partition.rootDir)
runHook setupOS || true
set -l projectRoot (realpath "$dir/../../..")
set -l projectName (basename "$projectRoot")
set -l PROJECT_CLONE_ROOT "/opt/$(basename "$projectName")"
CONFIG_MODULE=$CONFIG_MODULE bash "$dir/partition.sh"
and source "$dir/../../copy-repo.fish" "$mountDir$PROJECT_CLONE_ROOT"
and runHook setupOS || true
and runHook createUser || \
begin