Add a function for initializing the OS

This commit is contained in:
Manuel Thalmann 2024-12-05 10:08:04 +01:00
parent 51ac9da58d
commit 289679e15c
2 changed files with 17 additions and 13 deletions

View file

@ -23,6 +23,21 @@ begin
echo "$dir/install.fish" echo "$dir/install.fish"
end end
function initOS
waitNetwork
and pacman-key --init
and pacman-key --populate
and pacstrap -K "$mountDir" \
base \
linux \
linux-firmware \
networkmanager \
man-db \
man-pages \
texinfo
end
function setupOS -S -V dir -S function setupOS -S -V dir -S
source "$dir/../../lib/hooks.fish" source "$dir/../../lib/hooks.fish"
source "$dir/../../lib/wait-network.fish" source "$dir/../../lib/wait-network.fish"
@ -40,18 +55,6 @@ begin
timedatectl set-timezone "$timezone" timedatectl set-timezone "$timezone"
end end
and pacman-key --init
and pacman-key --populate
and pacstrap -K "$mountDir" \
base \
linux \
linux-firmware \
networkmanager \
man-db \
man-pages \
texinfo
and genfstab -U "$mountDir" >>"$mountDir/etc/fstab" and genfstab -U "$mountDir" >>"$mountDir/etc/fstab"
and arch-chroot "$mountDir" systemctl enable NetworkManager and arch-chroot "$mountDir" systemctl enable NetworkManager

View file

@ -59,9 +59,10 @@ function runSetup
and echo "Cloning project..." and echo "Cloning project..."
and source "$dir/../../lib/copy-repo.fish" "$mountDir$PROJECT_CLONE_ROOT" and source "$dir/../../lib/copy-repo.fish" "$mountDir$PROJECT_CLONE_ROOT"
and runHook setupOS and runHook initOS "Please set up a function `initOS` for initializing the mounted OS"
and runChroot "$mountDir" git config --system --add safe.directory "$PROJECT_CLONE_ROOT" and runChroot "$mountDir" git config --system --add safe.directory "$PROJECT_CLONE_ROOT"
and runHook --force bootstrapSetup "Please set up a function `bootstrapSetup` for installing `fish` into the " and runHook --force bootstrapSetup "Please set up a function `bootstrapSetup` for installing `fish` into the "
and runHook setupOS
and echo "Preparing auto-login..." and echo "Preparing auto-login..."
and runHook --force autologin "Please set up a function `autologin` for setting up autologin for the `root` user" and runHook --force autologin "Please set up a function `autologin` for setting up autologin for the `root` user"