diff --git a/setup/archiso/build.sh b/setup/archiso/build.sh index 9e7bdba..badae14 100644 --- a/setup/archiso/build.sh +++ b/setup/archiso/build.sh @@ -88,6 +88,7 @@ cp "$DOTFILES_DIR/setup/arch-autoinstall.sh" "$PROFILE/airootfs/root/in chmod 755 \ "$PROFILE/airootfs/root/launch.sh" \ + "$PROFILE/airootfs/root/.automated_script.sh" \ "$PROFILE/airootfs/usr/local/bin/install-arch" \ "$PROFILE/airootfs/root/installer/"*.sh @@ -106,4 +107,6 @@ ls -lh "$OUT_DIR/"*.iso 2>/dev/null || true if [[ -n "$PRECONF_FILE" ]]; then echo "Answerfile embedded — automated install will activate on boot." +else + echo "No answerfile — guided (manual) installer will start automatically on boot." fi diff --git a/setup/archiso/overlay/airootfs/etc/mkinitcpio.conf.d/archiso.conf b/setup/archiso/overlay/airootfs/etc/mkinitcpio.conf.d/archiso.conf new file mode 100644 index 0000000..333eb07 --- /dev/null +++ b/setup/archiso/overlay/airootfs/etc/mkinitcpio.conf.d/archiso.conf @@ -0,0 +1,6 @@ +# Modules explicitly included because mkinitcpio's autodetection runs on the +# build host and won't pick up filesystem/storage drivers needed at live boot. +MODULES=(squashfs overlay iso9660 loop dm_mod xhci_pci xhci_hcd ehci_pci ehci_hcd usb_storage uas) +HOOKS=(base udev microcode modconf kms memdisk archiso archiso_loop_mnt archiso_pxe_common archiso_pxe_nbd archiso_pxe_http archiso_pxe_nfs block filesystems keyboard) +COMPRESSION="zstd" +COMPRESSION_OPTIONS=(-9 --long) diff --git a/setup/archiso/overlay/airootfs/etc/motd b/setup/archiso/overlay/airootfs/etc/motd index 6fe2ae6..ffe7d1b 100644 --- a/setup/archiso/overlay/airootfs/etc/motd +++ b/setup/archiso/overlay/airootfs/etc/motd @@ -4,9 +4,10 @@ | by The_miro | +-----------------------------------------------------+ - Commands: - install-arch guided installer (recommended) - install-arch auto automated installer (no prompts) + The installer starts automatically on login. + To re-run manually: + install-arch guided installer (manual mode) + install-arch auto automated installer (requires answerfile) Scripts are also at: ~/installer/ diff --git a/setup/archiso/overlay/airootfs/root/.automated_script.sh b/setup/archiso/overlay/airootfs/root/.automated_script.sh new file mode 100644 index 0000000..a558549 --- /dev/null +++ b/setup/archiso/overlay/airootfs/root/.automated_script.sh @@ -0,0 +1,10 @@ +#!/usr/bin/env bash +set -euo pipefail + +ANSWERFILE="/answerfile.json" + +if [[ -f "$ANSWERFILE" ]]; then + exec /root/launch.sh auto "$ANSWERFILE" +else + exec /root/launch.sh guided +fi diff --git a/setup/archiso/overlay/airootfs/root/.zlogin b/setup/archiso/overlay/airootfs/root/.zlogin new file mode 100644 index 0000000..3471e05 --- /dev/null +++ b/setup/archiso/overlay/airootfs/root/.zlogin @@ -0,0 +1 @@ +exec /root/.automated_script.sh diff --git a/setup/archiso/overlay/airootfs/root/launch.sh b/setup/archiso/overlay/airootfs/root/launch.sh index f7eadeb..a502418 100644 --- a/setup/archiso/overlay/airootfs/root/launch.sh +++ b/setup/archiso/overlay/airootfs/root/launch.sh @@ -2,7 +2,7 @@ set -euo pipefail INSTALLER_DIR="$HOME/installer" case "${1:-guided}" in - auto) exec bash "$INSTALLER_DIR/arch-autoinstall.sh" ;; + auto) exec bash "$INSTALLER_DIR/arch-autoinstall.sh" "${@:2}" ;; guided) exec bash "$INSTALLER_DIR/archbaseos-guided-install.sh" ;; *) exec bash "$INSTALLER_DIR/archbaseos-guided-install.sh" ;; esac diff --git a/setup/archiso/overlay/profiledef.sh b/setup/archiso/overlay/profiledef.sh index a274d53..c2f9df7 100644 --- a/setup/archiso/overlay/profiledef.sh +++ b/setup/archiso/overlay/profiledef.sh @@ -15,8 +15,10 @@ airootfs_image_tool_options=('-comp' 'zstd' '-Xcompression-level' '15') bootstrap_tarball_compression=('zstd' '-c' '-T0' '--auto-threads=logical' '--long' '-19') file_permissions=( ["/etc/shadow"]="0:0:400" + ["/etc/mkinitcpio.conf.d/archiso.conf"]="0:0:644" ["/root"]="0:0:750" ["/root/.automated_script.sh"]="0:0:755" + ["/root/.zlogin"]="0:0:644" ["/root/launch.sh"]="0:0:755" ["/root/installer/archbaseos-guided-install.sh"]="0:0:755" ["/root/installer/arch-autoinstall.sh"]="0:0:755"