diff --git a/debian-live-config/config/includes.binary/boot/grub/splash.png b/debian-live-config/config/includes.binary/boot/grub/splash.png index 3b25242b..3ae7016c 100644 Binary files a/debian-live-config/config/includes.binary/boot/grub/splash.png and b/debian-live-config/config/includes.binary/boot/grub/splash.png differ diff --git a/debian-live-config/config/includes.binary/isolinux/splash.png b/debian-live-config/config/includes.binary/isolinux/splash.png index 8a03773d..1a4ae130 100644 Binary files a/debian-live-config/config/includes.binary/isolinux/splash.png and b/debian-live-config/config/includes.binary/isolinux/splash.png differ diff --git a/debian-live-config/config/includes.chroot/etc/xdg/autostart/wrolpi-firstboot-notify.desktop b/debian-live-config/config/includes.chroot/etc/xdg/autostart/wrolpi-firstboot-notify.desktop new file mode 100644 index 00000000..ddb432ce --- /dev/null +++ b/debian-live-config/config/includes.chroot/etc/xdg/autostart/wrolpi-firstboot-notify.desktop @@ -0,0 +1,7 @@ +[Desktop Entry] +Type=Application +Name=WROLPi First-Boot Notification +Comment=Show a summary of what WROLPi bootstrap did on first boot +Exec=/usr/local/bin/wrolpi-firstboot-notify +StartupNotify=false +NoDisplay=true diff --git a/debian-live-config/config/includes.chroot/usr/local/bin/wrolpi-firstboot-notify b/debian-live-config/config/includes.chroot/usr/local/bin/wrolpi-firstboot-notify new file mode 100755 index 00000000..0d56199e --- /dev/null +++ b/debian-live-config/config/includes.chroot/usr/local/bin/wrolpi-firstboot-notify @@ -0,0 +1,23 @@ +#!/bin/sh +# Surface the first-boot bootstrap summary as a zenity dialog once the +# XFCE session is up. +# +# wrolpi-bootstrap.service writes /tmp/wrolpi-firstboot-summary.txt when +# it does notable work (creates the persistence partition, initialises +# the Postgres cluster, runs the DB schema migration). This script — +# autostarted via /etc/xdg/autostart/wrolpi-firstboot-notify.desktop — +# reads it, shows the contents to the user, and removes the file. +# +# /tmp is tmpfs, so the file is naturally per-boot. Uneventful boots +# (where bootstrap was a no-op) leave nothing to display. + +F=/tmp/wrolpi-firstboot-summary.txt +[ -f "$F" ] || exit 0 + +if command -v zenity >/dev/null 2>&1; then + zenity --info --width=520 --title="Welcome to WROLPi" --text="$(cat "$F")" +elif command -v notify-send >/dev/null 2>&1; then + notify-send -t 30000 "WROLPi setup complete" "$(cat "$F")" +fi + +rm -f "$F" diff --git a/debian-live-config/config/includes.chroot/usr/local/sbin/wrolpi-bootstrap.sh b/debian-live-config/config/includes.chroot/usr/local/sbin/wrolpi-bootstrap.sh index 4c8c7b6b..29df4f81 100644 --- a/debian-live-config/config/includes.chroot/usr/local/sbin/wrolpi-bootstrap.sh +++ b/debian-live-config/config/includes.chroot/usr/local/sbin/wrolpi-bootstrap.sh @@ -36,6 +36,17 @@ progress() { log "$1" } +# Accumulate human-readable notes about anything non-trivial we did this +# boot. If anything ends up in $SUMMARY by end-of-run we write it to a +# file under /tmp/ that the wrolpi user's XFCE autostart picks up to show +# a zenity dialog (see /usr/local/bin/wrolpi-firstboot-notify). /tmp is +# tmpfs so the file is naturally per-boot; subsequent uneventful boots +# show no dialog. +SUMMARY="" +SUMMARY_FILE=/tmp/wrolpi-firstboot-summary.txt +note_action() { SUMMARY="${SUMMARY}- $1 +"; } + progress "Preparing WROLPi..." # --- Detect Live vs Installed ------------------------------------------- @@ -105,6 +116,8 @@ if [ -n "$BOOT_DRIVE" ]; then fi progress "Formatting $PERSIST_PART as ext4..." mkfs.ext4 -L persistence -F "$PERSIST_PART" + PERSIST_SIZE=$(lsblk -bno SIZE "$PERSIST_PART" 2>/dev/null | numfmt --to=iec --suffix=B || echo "?") + note_action "Created persistence partition ${PERSIST_PART} (${PERSIST_SIZE}) on ${BOOT_DRIVE}" fi # Mount the persistence partition + lay out the on-disk structure. @@ -183,6 +196,7 @@ fi if ! pg_lsclusters -h | awk '{print $1,$2}' | grep -q "^${PG_VERSION} main$"; then progress "Setting up Postgres cluster..." pg_createcluster "${PG_VERSION}" main + note_action "Set up PostgreSQL ${PG_VERSION} cluster at /media/wrolpi/config/postgresql/" fi progress "Starting Postgres..." systemctl start "postgresql@${PG_VERSION}-main.service" @@ -192,6 +206,7 @@ systemctl start "postgresql@${PG_VERSION}-main.service" if ! sudo -iu postgres psql -lqt | cut -d \| -f 1 | grep -qw wrolpi; then progress "Initializing WROLPi database (this can take a minute)..." /opt/wrolpi/scripts/initialize_api_db.sh + note_action "Initialized the WROLPi database" fi # --- Certificates ------------------------------------------------------- @@ -227,5 +242,19 @@ progress "Starting WROLPi services..." systemctl enable wrolpi-api.service wrolpi-app.service wrolpi-kiwix.service systemctl start --no-block wrolpi-api.service wrolpi-app.service wrolpi-kiwix.service +# If we did anything notable, leave a summary for the XFCE autostart to +# show as a zenity dialog once the user lands on the desktop. +if [ -n "$SUMMARY" ]; then + cat > "$SUMMARY_FILE" <