From 7716ba810f6953729a44339ab2f193b8fcd8ca3c Mon Sep 17 00:00:00 2001 From: Filip Suchy Date: Sun, 11 Oct 2026 03:08:27 +0200 Subject: [PATCH] feat: drop bootstrap.sh into the installed home --- install.sh | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/install.sh b/install.sh index 2726f01..e7f3685 100755 --- a/install.sh +++ b/install.sh @@ -16,7 +16,7 @@ # bash install.sh # # Flow: checks -> questions -> partition -> LUKS -> BTRFS -> pacstrap -> -# fstab -> chroot setup -> GRUB -> reboot +# fstab -> chroot setup -> GRUB -> bootstrap.sh -> reboot # set -euo pipefail @@ -77,6 +77,7 @@ readonly PACSTRAP_PACKAGES=( wpa_supplicant wget neovim tmux ) readonly HOOKS_ENCRYPTED="base systemd autodetect microcode modconf kms keyboard sd-vconsole block sd-encrypt filesystems fsck" +readonly RAW_BASE="https://gitea.nevim42.cz/nevim42/engram-boot/raw/branch/main" # Filled in by ask_questions. TARGET_DISK="" @@ -354,6 +355,30 @@ CHROOT rm -f /mnt/root/engram-setup.sh } +# --------------------------------------------------------------------------- +# bootstrap.sh - drop it into the new home, so the next step is one command. +# --------------------------------------------------------------------------- + +fetch() { + if command -v curl >/dev/null; then + curl -fsSL "$1" + else + wget -qO- "$1" + fi +} + +place_bootstrap() { + step "Dropping bootstrap.sh into /home/${USER_NAME}" + + fetch "$RAW_BASE/bootstrap.sh" > "/mnt/home/${USER_NAME}/bootstrap.sh" \ + || die "Could not fetch bootstrap.sh from $RAW_BASE" + + # A fresh system has exactly one user, so uid/gid 1000 is safe. + chown 1000:1000 "/mnt/home/${USER_NAME}/bootstrap.sh" + chmod +x "/mnt/home/${USER_NAME}/bootstrap.sh" + info "Waiting in the new home - no download needed after reboot." +} + # --------------------------------------------------------------------------- # The exit - summary and reboot. # --------------------------------------------------------------------------- @@ -368,7 +393,7 @@ finish() { encrypted : ${ENCRYPTED} SUMMARY - info "Reboot, log in as ${USER_NAME} and run the bootstrap - your engram is waiting." + info "Reboot and log in as ${USER_NAME} - run ~/bootstrap.sh, your engram is waiting." local answer read -rp " Reboot now? [y/N]: " answer @@ -405,6 +430,7 @@ main() { pacstrap_base generate_fstab configure_system + place_bootstrap finish }