custom_blfs_packages/blfsSetup.sh

29 lines
661 B
Bash
Raw Permalink Normal View History

2024-11-21 22:41:55 +08:00
#!/bin/bash
_build_blfs()
{
# First include the needed external script files
local current_dir="$(dirname "$0")"
source $current_dir/libs/func_general.sh
# Run lfsSetup
2024-11-28 03:12:44 +08:00
./lfsSetup.sh "$1" "$2"
if [[ $? -gt 0 ]] ; then
echo "Failed building LFS system." >&2
return 1
fi
# Setup autologin
local dir_lfs="$(realpath "$1")"
_setup_autologin "$dir_lfs" || return 1
# Create autologin script to run blfs build after reboot
_create_blfs_builder_script "$dir_lfs" || return 1
# Reboot system
2024-11-21 22:41:55 +08:00
sudo systemctl reboot
}
# Shutdown on failure
2024-12-04 15:51:37 +08:00
_build_blfs "$1" "$2" || sudo shutdown --poweroff +5