Refactor first-boot rotation setup to use kernel command line for persistent display rotation. Update documentation to clarify the new method of setting screen orientation (90° clockwise) via cmdline.txt, eliminating the need for one-shot scripts. Enhance logging and user guidance for rotation and wallpaper configuration during first boot.

This commit is contained in:
nearxos
2026-02-20 20:05:23 +02:00
parent 90296498f5
commit 2777811b32
6 changed files with 88 additions and 22 deletions

View File

@@ -26,11 +26,18 @@ if [[ -f /etc/plymouth/plymouthd.conf ]]; then
fi
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 "=== Rotation (persistent via kernel cmdline) ==="
CMDLINE_PATH="/boot/firmware/cmdline.txt"
[[ -f "$CMDLINE_PATH" ]] || CMDLINE_PATH="/boot/cmdline.txt"
if [[ -f "$CMDLINE_PATH" ]] && ! grep -q 'video=DSI-1:rotate=' "$CMDLINE_PATH"; then
sed -i 's/$/ video=DSI-1:rotate=90/' "$CMDLINE_PATH"
echo "Added video=DSI-1:rotate=90 to $CMDLINE_PATH (90° clockwise). Reboot to apply."
else
echo "Rotation already set in cmdline or file missing. Current: $(grep -o 'video=DSI-1:rotate=[^ ]*' "$CMDLINE_PATH" 2>/dev/null || true)"
fi
echo ""
echo "=== Wallpaper (in labwc session, as $PI_USER) ==="
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 ==="
echo "=== Reboot to apply splash, initramfs and rotation ==="
echo " sudo reboot"