detached db9e0da

feat(post-install): add dedicated post-boot setup script

commit
db9e0da1f5166738d88be437003fd981160d06e4
author
bnema · · 2025-10-21 06:13 UTC
parent
361b44b
signature
unsigned
1 file · +30 -0
A install/post-install/post-boot-setup.sh +30 -0
@@ -0,0 +1,30 @@
1+#!/bin/bash
2+# Setup post-boot scripts and first-boot service
3+
4+gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "Setting up first-boot service..."
5+
6+# Create post-boot directory
7+mkdir -p /mnt/usr/local/share/archup/post-boot
8+
9+# Copy all post-boot scripts
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+cp "$ARCHUP_INSTALL/post-boot/archup-cli.sh" /mnt/usr/local/share/archup/post-boot/
14+
15+# Make all scripts executable
16+chmod +x /mnt/usr/local/share/archup/post-boot/*.sh
17+
18+# Install systemd service (substitute email and username)
19+sed "s|__ARCHUP_EMAIL__|$(config_get "ARCHUP_EMAIL")|g; s|__ARCHUP_USERNAME__|$(config_get "ARCHUP_USERNAME")|g" \
20+ "$ARCHUP_INSTALL/post-boot/archup-first-boot.service" > /mnt/etc/systemd/system/archup-first-boot.service
21+
22+# Enable the service
23+arch-chroot /mnt systemctl enable archup-first-boot.service >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1
24+
25+echo "First-boot service will run on first reboot to:" >> "$ARCHUP_INSTALL_LOG_FILE"
26+echo " - Configure snapper snapshots" >> "$ARCHUP_INSTALL_LOG_FILE"
27+echo " - Generate SSH keys" >> "$ARCHUP_INSTALL_LOG_FILE"
28+echo " - Build and install archup-cli from GitHub" >> "$ARCHUP_INSTALL_LOG_FILE"
29+
30+gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "[OK] First-boot service configured"
@@ -0,0 +1,30 @@
1+#!/bin/bash
2+# Setup post-boot scripts and first-boot service
3+
4+gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "Setting up first-boot service..."
5+
6+# Create post-boot directory
7+mkdir -p /mnt/usr/local/share/archup/post-boot
8+
9+# Copy all post-boot scripts
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+cp "$ARCHUP_INSTALL/post-boot/archup-cli.sh" /mnt/usr/local/share/archup/post-boot/
14+
15+# Make all scripts executable
16+chmod +x /mnt/usr/local/share/archup/post-boot/*.sh
17+
18+# Install systemd service (substitute email and username)
19+sed "s|__ARCHUP_EMAIL__|$(config_get "ARCHUP_EMAIL")|g; s|__ARCHUP_USERNAME__|$(config_get "ARCHUP_USERNAME")|g" \
20+ "$ARCHUP_INSTALL/post-boot/archup-first-boot.service" > /mnt/etc/systemd/system/archup-first-boot.service
21+
22+# Enable the service
23+arch-chroot /mnt systemctl enable archup-first-boot.service >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1
24+
25+echo "First-boot service will run on first reboot to:" >> "$ARCHUP_INSTALL_LOG_FILE"
26+echo " - Configure snapper snapshots" >> "$ARCHUP_INSTALL_LOG_FILE"
27+echo " - Generate SSH keys" >> "$ARCHUP_INSTALL_LOG_FILE"
28+echo " - Build and install archup-cli from GitHub" >> "$ARCHUP_INSTALL_LOG_FILE"
29+
30+gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "[OK] First-boot service configured"

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 1

Tags 0

    ↑↓ moveenter openesc close