fix(pi-gen+rauc): stop purge from removing cage + fix boot

1. Desktop purge was using wildcard lx* which removed libwlroots
   and cage as dependency. Now uses specific package names +
   apt-mark manual cage to protect it from autoremove.
2. Per-user cursor theme for bfkiosk (~/.icons/default/index.theme).
3. Repartition disables auto_initramfs in config.txt (initramfs
   cant resolve LABEL= roots). Also handles root=/dev/* format
   in cmdline.txt sed replacement.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Mitchell R 2026-05-24 23:54:21 +02:00
parent 1ff0f9928c
commit 649c64728a
No known key found for this signature in database
2 changed files with 21 additions and 5 deletions

View file

@ -144,6 +144,13 @@ for name in ['default','left_ptr','arrow','watch','hand2','text','xterm',
# Set as system default cursor theme
update-alternatives --install /usr/share/icons/default/index.theme x-cursor-theme \
/usr/share/icons/betterframe-empty/cursor.theme 100 2>/dev/null || true
# Per-user cursor config for bfkiosk (cage reads user's icon theme)
install -d -o bfkiosk -g bfkiosk -m 755 /home/bfkiosk/.icons/default
cat > /home/bfkiosk/.icons/default/index.theme <<'CURSOR'
[Icon Theme]
Inherits=betterframe-empty
CURSOR
chown bfkiosk:bfkiosk /home/bfkiosk/.icons/default/index.theme
# --- Enable services, disable noise ---
systemctl enable seatd
@ -217,11 +224,14 @@ rm -f /etc/systemd/system/getty.target.wants/* 2>/dev/null || true
printf 'BetterFrame Kiosk\n\n' > /etc/issue
rm -f /etc/update-motd.d/* 2>/dev/null || true
# Nuke entire desktop environment if installed (stage3 leftovers).
# This is the nuclear option — piwiz can't run if there's no desktop.
apt-get -y purge 'lx*' 'labwc*' 'wayfire*' 'wf-*' lightdm gdm3 sddm \
xserver-xorg-core xwayland rpd-plym-splash pi-greeter \
desktop-base raspberrypi-ui-mods 2>/dev/null || true
# Remove desktop packages that could show setup wizards. Be specific —
# wildcard 'lx*' kills libwlroots which removes cage (our compositor).
apt-get -y purge piwiz userconf-pi rpi-first-boot-wizard pi-greeter \
rpd-plym-splash lightdm gdm3 sddm desktop-base \
raspberrypi-ui-mods lxde lxde-core lxpanel lxsession lxterminal \
labwc wayfire 2>/dev/null || true
# Mark cage as manually installed so autoremove won't touch it.
apt-mark manual cage 2>/dev/null || true
apt-get -y autoremove 2>/dev/null || true
# Force multi-user via kernel cmdline (overrides any default target)

View file

@ -96,7 +96,11 @@ cp "$WORK/bootfs.vfat" "$WORK/bootfs_A.vfat"
BOOT_A_LOOP="$(losetup -f --show "$WORK/bootfs_A.vfat")"
mkdir -p "$WORK/mnt-ba"
mount "$BOOT_A_LOOP" "$WORK/mnt-ba"
# Disable initramfs — it can't resolve LABEL= and we don't need it.
# Kernel mounts root directly with rootwait.
sed -i 's/^auto_initramfs=1/auto_initramfs=0/' "$WORK/mnt-ba/config.txt" 2>/dev/null || true
sed -i 's|root=PARTUUID=[^ ]*|root=LABEL=BF_ROOT_A|' "$WORK/mnt-ba/cmdline.txt" 2>/dev/null || true
sed -i 's|root=/dev/[^ ]*|root=LABEL=BF_ROOT_A|' "$WORK/mnt-ba/cmdline.txt" 2>/dev/null || true
# autoboot.txt: normal boot → partition 1 (this one), tryboot → partition 2
cat > "$WORK/mnt-ba/autoboot.txt" <<'AUTOBOOT'
[all]
@ -115,7 +119,9 @@ cp "$WORK/bootfs.vfat" "$WORK/bootfs_B.vfat"
BOOT_B_LOOP="$(losetup -f --show "$WORK/bootfs_B.vfat")"
mkdir -p "$WORK/mnt-bb"
mount "$BOOT_B_LOOP" "$WORK/mnt-bb"
sed -i 's/^auto_initramfs=1/auto_initramfs=0/' "$WORK/mnt-bb/config.txt" 2>/dev/null || true
sed -i 's|root=PARTUUID=[^ ]*|root=LABEL=BF_ROOT_B|' "$WORK/mnt-bb/cmdline.txt" 2>/dev/null || true
sed -i 's|root=/dev/[^ ]*|root=LABEL=BF_ROOT_B|' "$WORK/mnt-bb/cmdline.txt" 2>/dev/null || true
cat > "$WORK/mnt-bb/autoboot.txt" <<'AUTOBOOT'
[all]
tryboot_a_b=1