Add support for custom scripts

This commit is contained in:
Dennis ten Hoove 2024-02-21 11:33:09 +01:00
parent 3196c808e6
commit e9080c9962

View file

@ -131,6 +131,12 @@ if [[ $type == 'archlinux' ]]; then
cp -rv $configs_dir/$variant/overlay/* $workdir/ cp -rv $configs_dir/$variant/overlay/* $workdir/
fi fi
# Run post-bootstrap script if exists
if [[ -f $configs_dir/$variant/scripts/post-bootstrap.sh ]]; then
printf '\e[1;34m-->\e[0m\e[1m Running post-boostrap script\e[0m\n'
source $configs_dir/$variant/scripts/post-bootstrap.sh
fi
# Read package list and install secondary system components, skip if not used # Read package list and install secondary system components, skip if not used
if [[ -e $configs_dir/$variant/package.list ]]; then if [[ -e $configs_dir/$variant/package.list ]]; then
printf '\e[1;34m-->\e[0m\e[1m Installing secondary packages\e[0m\n' printf '\e[1;34m-->\e[0m\e[1m Installing secondary packages\e[0m\n'
@ -138,6 +144,12 @@ if [[ $type == 'archlinux' ]]; then
arch-chroot $workdir pacman -S --noconfirm ${packages[*]} || cleanup_and_quit 'Failed to install base packages' arch-chroot $workdir pacman -S --noconfirm ${packages[*]} || cleanup_and_quit 'Failed to install base packages'
fi fi
# Run post-install script if exists
if [[ -f $configs_dir/$variant/scripts/post-install.sh ]]; then
printf '\e[1;34m-->\e[0m\e[1m Running post-install script\e[0m\n'
source $configs_dir/$variant/scripts/post-install.sh
fi
# Clear pacman cache # Clear pacman cache
printf '\e[1;34m-->\e[0m\e[1m Clearing pacman cache\e[0m\n' printf '\e[1;34m-->\e[0m\e[1m Clearing pacman cache\e[0m\n'
arch-chroot $workdir pacman -Scc <<< Y <<< Y arch-chroot $workdir pacman -Scc <<< Y <<< Y