refactor(post-install): remove post-boot setup logic from snapper script
- commit
- 388e7efc31ed62684ec180e7374589854d698853
- author
- bnema · · 2025-10-21 06:14 UTC
- parent
- 602b11c
- signature
- unsigned
1 file · +5 -15
M install/post-install/snapper.sh +5 -15
| @@ -1,21 +1,11 @@ | |||
| 1 | 1 | #!/bin/bash | |
| 2 | 2 | # Configure Snapper and Limine integration for btrfs snapshots | |
| 3 | 3 | ||
| 4 | - | gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "Configuring btrfs snapshots..." | |
| 5 | - | ||
| 6 | - | arch-chroot /mnt pacman -S --noconfirm --needed limine-snapper-sync >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1 | |
| 7 | - | ||
| 8 | - | mkdir -p /mnt/usr/local/share/archup/post-boot | |
| 9 | - | ||
| 10 | - | cp "$ARCHUP_INSTALL/post-boot/all.sh" /mnt/usr/local/share/archup/post-boot/ | |
| 11 | - | cp "$ARCHUP_INSTALL/post-boot/snapper.sh" /mnt/usr/local/share/archup/post-boot/ | |
| 12 | - | cp "$ARCHUP_INSTALL/post-boot/ssh-keygen.sh" /mnt/usr/local/share/archup/post-boot/ | |
| 13 | - | chmod +x /mnt/usr/local/share/archup/post-boot/*.sh | |
| 14 | - | ||
| 15 | - | sed "s|__ARCHUP_EMAIL__|$(config_get "ARCHUP_EMAIL")|g; s|__ARCHUP_USERNAME__|$(config_get "ARCHUP_USERNAME")|g" \ | |
| 16 | - | "$ARCHUP_INSTALL/post-boot/archup-first-boot.service" > /mnt/etc/systemd/system/archup-first-boot.service | |
| 17 | - | ||
| 18 | - | arch-chroot /mnt systemctl enable archup-first-boot.service >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1 | |
| 4 | + | # Install limine-snapper-sync package | |
| 5 | + | if ! run_with_spinner "Installing limine-snapper-sync..." "arch-chroot /mnt pacman -S --noconfirm --needed limine-snapper-sync"; then | |
| 6 | + | gum style --foreground 1 --padding "1 0 1 $PADDING_LEFT" "[ERROR] Failed to install limine-snapper-sync" | |
| 7 | + | return 1 | |
| 8 | + | fi | |
| 19 | 9 | ||
| 20 | 10 | LIMINE_CONFIG="/mnt/boot/EFI/limine/limine.conf" | |
| 21 | 11 | CMDLINE=$(grep "^[[:space:]]*cmdline:" "$LIMINE_CONFIG" | head -1 | sed 's/^[[:space:]]*cmdline:[[:space:]]*//') | |
| @@ -1,21 +1,11 @@ | |||||
| 1 | #!/bin/bash | 1 | #!/bin/bash | ||
| 2 | # Configure Snapper and Limine integration for btrfs snapshots | 2 | # Configure Snapper and Limine integration for btrfs snapshots | ||
| 3 | 3 | ||||
| 4 | - | gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "Configuring btrfs snapshots..." | 4 | + | # Install limine-snapper-sync package |
| 5 | - | 5 | + | if ! run_with_spinner "Installing limine-snapper-sync..." "arch-chroot /mnt pacman -S --noconfirm --needed limine-snapper-sync"; then | |
| 6 | - | arch-chroot /mnt pacman -S --noconfirm --needed limine-snapper-sync >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1 | 6 | + | gum style --foreground 1 --padding "1 0 1 $PADDING_LEFT" "[ERROR] Failed to install limine-snapper-sync" |
| 7 | - | 7 | + | return 1 | |
| 8 | - | mkdir -p /mnt/usr/local/share/archup/post-boot | 8 | + | fi |
| 9 | - | ||||
| 10 | - | cp "$ARCHUP_INSTALL/post-boot/all.sh" /mnt/usr/local/share/archup/post-boot/ | |||
| 11 | - | cp "$ARCHUP_INSTALL/post-boot/snapper.sh" /mnt/usr/local/share/archup/post-boot/ | |||
| 12 | - | cp "$ARCHUP_INSTALL/post-boot/ssh-keygen.sh" /mnt/usr/local/share/archup/post-boot/ | |||
| 13 | - | chmod +x /mnt/usr/local/share/archup/post-boot/*.sh | |||
| 14 | - | ||||
| 15 | - | sed "s|__ARCHUP_EMAIL__|$(config_get "ARCHUP_EMAIL")|g; s|__ARCHUP_USERNAME__|$(config_get "ARCHUP_USERNAME")|g" \ | |||
| 16 | - | "$ARCHUP_INSTALL/post-boot/archup-first-boot.service" > /mnt/etc/systemd/system/archup-first-boot.service | |||
| 17 | - | ||||
| 18 | - | arch-chroot /mnt systemctl enable archup-first-boot.service >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1 | |||
| 19 | 9 | ||||
| 20 | LIMINE_CONFIG="/mnt/boot/EFI/limine/limine.conf" | 10 | LIMINE_CONFIG="/mnt/boot/EFI/limine/limine.conf" | ||
| 21 | CMDLINE=$(grep "^[[:space:]]*cmdline:" "$LIMINE_CONFIG" | head -1 | sed 's/^[[:space:]]*cmdline:[[:space:]]*//') | 11 | CMDLINE=$(grep "^[[:space:]]*cmdline:" "$LIMINE_CONFIG" | head -1 | sed 's/^[[:space:]]*cmdline:[[:space:]]*//') | ||