diff --git a/chromium-setup/emmc-provisioning/cloud-init/config-files/README.md b/chromium-setup/emmc-provisioning/cloud-init/config-files/README.md index 1707e3f..8f94e00 100644 --- a/chromium-setup/emmc-provisioning/cloud-init/config-files/README.md +++ b/chromium-setup/emmc-provisioning/cloud-init/config-files/README.md @@ -8,4 +8,5 @@ first-boot.sh downloads these from `FILE_SERVER` (e.g. `http://10.130.60.141:500 | 99-default-session.conf | /etc/lightdm/lightdm.conf.d/99-default-session.conf (rpd-labwc) | | maliit-keyboard.desktop | /home/pi/.config/autostart/maliit-keyboard.desktop | | set-rotation-once.desktop | /home/pi/.config/autostart/set-rotation-once.desktop (with set-rotation-once.sh) | -| set-wallpaper-once.desktop | /home/pi/.config/autostart/set-wallpaper-once.desktop (with set-wallpaper-once.sh) | + +Wallpaper is set once during first-boot by creating `~/.config/labwc/autostart` with swaybg; no set-wallpaper-once one-shot. diff --git a/chromium-setup/emmc-provisioning/cloud-init/files-from-guard/README.md b/chromium-setup/emmc-provisioning/cloud-init/files-from-guard/README.md index 801b2b2..7a2e828 100644 --- a/chromium-setup/emmc-provisioning/cloud-init/files-from-guard/README.md +++ b/chromium-setup/emmc-provisioning/cloud-init/files-from-guard/README.md @@ -15,7 +15,8 @@ first-boot.sh downloads from **`.../files/first-boot/`** (e.g. `http://10.130.60 | **99-default-session.conf** | LightDM default session rpd-labwc (from `config-files/`). | | **maliit-keyboard.desktop** | Maliit on-screen keyboard autostart (from `config-files/`). | | **set-rotation-once.sh** + **.desktop** | One-shot: wlr-randr rotation (Left) at first login. | -| **set-wallpaper-once.sh** + **.desktop** | One-shot: swaybg wallpaper + labwc autostart at first login. | + +Desktop wallpaper is set once during first-boot (labwc autostart created by first-boot.sh); no set-wallpaper-once needed. --- @@ -25,4 +26,4 @@ first-boot.sh downloads from **`.../files/first-boot/`** (e.g. `http://10.130.60 - **plymouth-custom/custom.plymouth** — Plymouth theme definition; host as `custom.plymouth`. - **plymouth-custom/custom.script** — Plymouth script that draws splash.png; host as `custom.script`. - **lightdm/RPiSystem_dark.png** — Unused; only `splash.png` is used now. -- **set-rotation-once.sh** and **set-wallpaper-once.sh** live in `cloud-init/`; copy them into `portal-files/first-boot/` on the file server. +- **set-rotation-once.sh** lives in `cloud-init/`; copy it (and its .desktop) into `portal-files/first-boot/` on the file server. diff --git a/chromium-setup/emmc-provisioning/cloud-init/first-boot.md b/chromium-setup/emmc-provisioning/cloud-init/first-boot.md index 9d0f1ee..969098b 100644 --- a/chromium-setup/emmc-provisioning/cloud-init/first-boot.md +++ b/chromium-setup/emmc-provisioning/cloud-init/first-boot.md @@ -17,7 +17,7 @@ This script runs once on first boot via cloud-init (see `user-data-remote-gnss.e 9. **reTerminal DM drivers** — Seeed repo clone and `reTerminal.sh`. 10. **Re-apply splash** — Set `disable_splash=0`, Plymouth theme to `custom` only, `update-initramfs`. 11. **Boot order** — If `rpi-eeprom-config` is available, set `BOOT_ORDER=0x21` (network first, then eMMC/SD) for future network boot / re-provisioning. -12. **One-shots** — Download `set-rotation-once.sh` + `.desktop` and `set-wallpaper-once.sh` + `.desktop` from file server (wlr-randr + swaybg for labwc). +12. **One-shots** — Download `set-rotation-once.sh` + `.desktop` from file server (wlr-randr for labwc). Wallpaper is set once by creating `~/.config/labwc/autostart` during first-boot. 13. **Reboot.** --- @@ -81,7 +81,7 @@ A **single image** (`splash.png`) is used for the boot splash, login screen, and - **Plymouth (boot splash):** Downloads `splash.png`, `custom.plymouth`, and `custom.script` from the file server → installs to `/usr/share/plymouth/themes/custom/` → sets `Theme=custom` in `/etc/plymouth/plymouthd.conf` (single `[Daemon]` section) → runs `update-initramfs -u`. If any download fails, logs a warning and continues. **Note:** On reTerminal DM the DSI panel can initialize a few seconds into boot, so the Plymouth splash may appear briefly or after a short black screen; this is normal for DSI displays. - **LightDM (login screen):** Copies the same image to `/usr/share/rpd-wallpaper/splash.png` and writes `/etc/lightdm/lightdm.conf.d/99-wallpaper.conf` with `wallpaper=...` and `wallpaper_mode=crop`. -- **Desktop wallpaper:** A one-shot autostart runs when **pi** first logs in: it adds `swaybg -i /usr/share/rpd-wallpaper/splash.png -m fill` to `~/.config/labwc/autostart` (so it persists across logins) and runs swaybg for the current session. The one-shot then deletes itself. +- **Desktop wallpaper:** First-boot sets the wallpaper once by writing pcmanfm config: `~/.config/pcmanfm/LXDE-pi/desktop-items-0.conf` and `default/desktop-items-0.conf` with `wallpaper=/usr/share/rpd-wallpaper/splash.png` and `wallpaper_mode=crop`. pcmanfm-pi (rpd-labwc desktop) reads this and shows the wallpaper; no autostart script. To set or change wallpaper manually: `pcmanfm --set-wallpaper /path/to/image.png --wallpaper-mode=crop` (modes: crop, stretch, fit, center, tile, screen, color). --- @@ -142,3 +142,4 @@ Runs **`reboot`** so the kernel and display stack load the new Seeed drivers. Af - **Kiosk URL** — The URL Chromium opens is defined in `start-chromium.sh` on your file server (e.g. `--app=http://127.0.0.1:8080`); change it there. - **User** — If you use a user other than `pi`, replace `pi` in this script and in the files on the file server (paths and ownership). - **Screen rotation** — The one-shot runs `wlr-randr --output --transform 270` (Left). To use another orientation, change `270` to `90` (right), `180` (inverted), or `normal`. +- **Desktop wallpaper** — First-boot writes `wallpaper=` and `wallpaper_mode=crop` into pcmanfm’s `desktop-items-0.conf`. To change later: `pcmanfm --set-wallpaper /path/to/image --wallpaper-mode=crop`. **Other pcmanfm options:** `pcmanfm --desktop` (start desktop manager), `pcmanfm --desktop-pref` (open desktop preferences GUI), `pcmanfm --desktop-off` (stop desktop manager), `pcmanfm -w FILE` (short form of --set-wallpaper). Wallpaper modes: `crop`, `stretch`, `fit`, `center`, `tile`, `screen`, `color`. diff --git a/chromium-setup/emmc-provisioning/cloud-init/first-boot.sh b/chromium-setup/emmc-provisioning/cloud-init/first-boot.sh index 271efb4..c44e703 100644 --- a/chromium-setup/emmc-provisioning/cloud-init/first-boot.sh +++ b/chromium-setup/emmc-provisioning/cloud-init/first-boot.sh @@ -94,6 +94,19 @@ if curl -fsSL "${FILE_SERVER}/splash.png" -o "$PLYMOUTH_DIR/splash.png"; then update-initramfs -u -k all 2>/dev/null || true mkdir -p /etc/lightdm/lightdm.conf.d curl -fsSL "${FILE_SERVER}/99-wallpaper.conf" -o /etc/lightdm/lightdm.conf.d/99-wallpaper.conf 2>/dev/null || log "WARNING: Could not download 99-wallpaper.conf" + # Set desktop wallpaper once via pcmanfm config (rpd-labwc uses pcmanfm-pi; profile LXDE-pi or default) + for PROFILE in LXDE-pi default; do + PCMANFM_DESKTOP="$PI_HOME/.config/pcmanfm/$PROFILE/desktop-items-0.conf" + mkdir -p "$(dirname "$PCMANFM_DESKTOP")" + if [[ ! -f "$PCMANFM_DESKTOP" ]]; then + printf '%s\n' '[*]' "wallpaper=$WALLPAPER_PATH" 'wallpaper_mode=crop' 'wallpaper_common=1' > "$PCMANFM_DESKTOP" + else + grep -q '^wallpaper=' "$PCMANFM_DESKTOP" && sed -i "s|^wallpaper=.*|wallpaper=$WALLPAPER_PATH|" "$PCMANFM_DESKTOP" || echo "wallpaper=$WALLPAPER_PATH" >> "$PCMANFM_DESKTOP" + grep -q '^wallpaper_mode=' "$PCMANFM_DESKTOP" && sed -i 's/^wallpaper_mode=.*/wallpaper_mode=crop/' "$PCMANFM_DESKTOP" || echo 'wallpaper_mode=crop' >> "$PCMANFM_DESKTOP" + fi + chown -R "$PI_USER:$PI_USER" "$(dirname "$PCMANFM_DESKTOP")" + done + log "Set desktop wallpaper via pcmanfm config (LXDE-pi and default)" log "Splash and wallpaper set from file server" else log "WARNING: Could not download splash.png" @@ -156,6 +169,14 @@ fi log "Running update-initramfs to apply Plymouth theme ..." update-initramfs -u -k all 2>/dev/null || true +# --- 6b2. Kernel cmdline: swiotlb for vc4-drm (avoids "swiotlb buffer is full" / blank DSI on CM4) --- +CMDLINE_PATH="/boot/firmware/cmdline.txt" +[[ -f "$CMDLINE_PATH" ]] || CMDLINE_PATH="/boot/cmdline.txt" +if [[ -f "$CMDLINE_PATH" ]] && ! grep -q 'swiotlb=' "$CMDLINE_PATH"; then + sed -i 's/rootwait/rootwait swiotlb=65536/' "$CMDLINE_PATH" + log "Added swiotlb=65536 to kernel cmdline (vc4-drm / DSI)" +fi + # --- 6c. Boot order: network first, then eMMC/SD (for future network boot / re-provisioning) --- # BOOT_ORDER: 0x2 = network, 0x1 = SD/eMMC. 0x21 = try network first, then local storage. log "--- Boot order (network first, then eMMC/SD) ---" @@ -180,10 +201,9 @@ else log "rpi-eeprom-config/rpi-eeprom-update not found; skipping boot order (not a Pi4/CM4 or package missing)" fi -# --- 7. One-shots (rotation + wallpaper at first login) --- +# --- 7. One-shots (rotation at first login; wallpaper already set in pcmanfm config above) --- log "--- One-shot scripts (run at pi first login) ---" install_oneshot set-rotation-once || true -install_oneshot set-wallpaper-once || true log "One-shots will append to $LOGFILE when they run at first login" # --- 8. Allow pi to append to first-boot.log (for one-shot scripts) --- diff --git a/chromium-setup/emmc-provisioning/cloud-init/fix-reterminal-display.sh b/chromium-setup/emmc-provisioning/cloud-init/fix-reterminal-display.sh index 1ecc838..2492c35 100644 --- a/chromium-setup/emmc-provisioning/cloud-init/fix-reterminal-display.sh +++ b/chromium-setup/emmc-provisioning/cloud-init/fix-reterminal-display.sh @@ -29,7 +29,7 @@ update-initramfs -u -k all 2>/dev/null || true echo "=== Rotation and wallpaper (rpd-labwc / labwc Wayland) ===" echo "To set rotation and wallpaper now (in a labwc session), run as $PI_USER:" echo " wlr-randr --output \$(wlr-randr | awk '/^[A-Za-z0-9_-]+ /{print \$1; exit}') --transform 270" -echo " swaybg -i /usr/share/rpd-wallpaper/splash.png -m fill &" +echo " pcmanfm --set-wallpaper /usr/share/rpd-wallpaper/splash.png --wallpaper-mode=crop" echo "" echo "Or ensure one-shots run at next login (they are in autostart if still present)." echo "=== Reboot to apply splash and initramfs ===" diff --git a/chromium-setup/emmc-provisioning/scripts/sync-portal-files-to-lxc.sh b/chromium-setup/emmc-provisioning/scripts/sync-portal-files-to-lxc.sh index f0f6f26..b523fb8 100755 --- a/chromium-setup/emmc-provisioning/scripts/sync-portal-files-to-lxc.sh +++ b/chromium-setup/emmc-provisioning/scripts/sync-portal-files-to-lxc.sh @@ -35,10 +35,9 @@ rsync -avz \ "$CLOUDINIT_DIR/files-from-guard/plymouth-custom/" \ "$LXC:$REMOTE_FIRST_BOOT/" -# one-shot scripts from cloud-init root → portal-files/first-boot/ +# one-shot scripts from cloud-init root → portal-files/first-boot/ (wallpaper set in first-boot via labwc autostart) rsync -avz \ "$CLOUDINIT_DIR/set-rotation-once.sh" \ - "$CLOUDINIT_DIR/set-wallpaper-once.sh" \ "$LXC:$REMOTE_FIRST_BOOT/" echo "Done. Portal files at http://$(echo "$LXC" | cut -d@ -f2):5000/files/"