Automate more things, begin work on post-chroot tasks

Such as another chroot
This commit is contained in:
Salt 2020-12-04 01:45:01 -06:00
parent 4a658c2669
commit 26baf4a1fa
1 changed files with 15 additions and 2 deletions

View File

@ -183,6 +183,9 @@ build-gentoo() {
popd
cp "$0" "$_optdest/gentoostrap.sh"
sudo systemd-nspawn --directory="$_optdest" /gentoostrap.sh -c
# The nspawn container sadly cannot manipulate the environment entirely, so we need to now do an ACTUAL chroot to install GRUB
}
build-gentoo-chroot() {
# Build Gentoo, but from within the chroot environment
@ -216,9 +219,17 @@ build-gentoo-chroot() {
# Extra packages
emerge --jobs --quiet-build y \
app-admin/sudo \
app-editors/vim \
sys-fs/{e2fs,xfs}progs \
sys-process/cronie
# Configure sudoers
cat <<-EOF >> "/etc/sudoers"
%wheel ALL=(ALL) ALL
ansible ALL=(ALL) NOPASSWD:ALL
EOF
# Unnghhh... COLONEL...
# Dude distribution kernels are awesome
emerge --jobs --quiet-build y sys-kernel/installkernel-gentoo sys-kernel/linux-firmware
@ -231,14 +242,16 @@ build-gentoo-chroot() {
mkdir -p /boot/efi
chmod 0700 /boot/efi
# Configure a new user, add him to sudoers
useradd salt -m -G wheel -s /bin/bash -u 1000 -U
passwd salt
# We've made it this far and now the user has to do just a liiiiiitle bit of configuration
clear
cat <<-EOF
Initial system configuration is complete. There are now just a few tasks left:
* Mount the ESP under /boot/efi
* Install and configure grub
* Set a root password
* Create a normal user
* Reboot and pray
Other things you may want to do: