feat(archiso): auto-start guided installer on boot, use answerfile for unattended mode

.zlogin execs .automated_script.sh on login, which checks for /answerfile.json;
if present it runs the auto installer (passing the path), otherwise launches the
guided installer directly — no manual invocation needed.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
main
The_miro 2026-05-19 22:20:30 +02:00
parent 33934f633d
commit 278ffb4a5a
7 changed files with 27 additions and 4 deletions

View File

@ -88,6 +88,7 @@ cp "$DOTFILES_DIR/setup/arch-autoinstall.sh" "$PROFILE/airootfs/root/in
chmod 755 \ chmod 755 \
"$PROFILE/airootfs/root/launch.sh" \ "$PROFILE/airootfs/root/launch.sh" \
"$PROFILE/airootfs/root/.automated_script.sh" \
"$PROFILE/airootfs/usr/local/bin/install-arch" \ "$PROFILE/airootfs/usr/local/bin/install-arch" \
"$PROFILE/airootfs/root/installer/"*.sh "$PROFILE/airootfs/root/installer/"*.sh
@ -106,4 +107,6 @@ ls -lh "$OUT_DIR/"*.iso 2>/dev/null || true
if [[ -n "$PRECONF_FILE" ]]; then if [[ -n "$PRECONF_FILE" ]]; then
echo "Answerfile embedded — automated install will activate on boot." echo "Answerfile embedded — automated install will activate on boot."
else
echo "No answerfile — guided (manual) installer will start automatically on boot."
fi fi

View File

@ -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)

View File

@ -4,9 +4,10 @@
| by The_miro | | by The_miro |
+-----------------------------------------------------+ +-----------------------------------------------------+
Commands: The installer starts automatically on login.
install-arch guided installer (recommended) To re-run manually:
install-arch auto automated installer (no prompts) install-arch guided installer (manual mode)
install-arch auto automated installer (requires answerfile)
Scripts are also at: ~/installer/ Scripts are also at: ~/installer/

View File

@ -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

View File

@ -0,0 +1 @@
exec /root/.automated_script.sh

View File

@ -2,7 +2,7 @@
set -euo pipefail set -euo pipefail
INSTALLER_DIR="$HOME/installer" INSTALLER_DIR="$HOME/installer"
case "${1:-guided}" in 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" ;; guided) exec bash "$INSTALLER_DIR/archbaseos-guided-install.sh" ;;
*) exec bash "$INSTALLER_DIR/archbaseos-guided-install.sh" ;; *) exec bash "$INSTALLER_DIR/archbaseos-guided-install.sh" ;;
esac esac

View File

@ -15,8 +15,10 @@ airootfs_image_tool_options=('-comp' 'zstd' '-Xcompression-level' '15')
bootstrap_tarball_compression=('zstd' '-c' '-T0' '--auto-threads=logical' '--long' '-19') bootstrap_tarball_compression=('zstd' '-c' '-T0' '--auto-threads=logical' '--long' '-19')
file_permissions=( file_permissions=(
["/etc/shadow"]="0:0:400" ["/etc/shadow"]="0:0:400"
["/etc/mkinitcpio.conf.d/archiso.conf"]="0:0:644"
["/root"]="0:0:750" ["/root"]="0:0:750"
["/root/.automated_script.sh"]="0:0:755" ["/root/.automated_script.sh"]="0:0:755"
["/root/.zlogin"]="0:0:644"
["/root/launch.sh"]="0:0:755" ["/root/launch.sh"]="0:0:755"
["/root/installer/archbaseos-guided-install.sh"]="0:0:755" ["/root/installer/archbaseos-guided-install.sh"]="0:0:755"
["/root/installer/arch-autoinstall.sh"]="0:0:755" ["/root/installer/arch-autoinstall.sh"]="0:0:755"