From 52fe3a910e19356c5ba30c85c2f68d5296a2525f Mon Sep 17 00:00:00 2001 From: The_miro Date: Fri, 26 Jun 2026 10:48:45 +0200 Subject: [PATCH] feat(plymouth+resources): bundle bg-skull.svg in repo and archiso MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Move the splash logo into resources/bg-skull.svg so it's tracked in git and always available alongside the dotfiles. build.sh now copies resources/ into /root/installer/resources/ on the ISO. The Plymouth module resolves the SVG from the repo copy first, ISO copy second — no user intervention or ~/Pictures setup required. Co-Authored-By: Claude Sonnet 4.6 Claude-Session: https://claude.ai/code/session_01SyBNiWy3wpawrWb9ryVk7p --- resources/bg-skull.svg | 63 ++++++++++++++++++++++ setup/archiso/build.sh | 7 +++ setup/modules/optional-Modules/plymouth.sh | 26 +++++++-- 3 files changed, 91 insertions(+), 5 deletions(-) create mode 100644 resources/bg-skull.svg diff --git a/resources/bg-skull.svg b/resources/bg-skull.svg new file mode 100644 index 0000000..230d044 --- /dev/null +++ b/resources/bg-skull.svg @@ -0,0 +1,63 @@ + + + + diff --git a/setup/archiso/build.sh b/setup/archiso/build.sh index 1f44e2a..cb09a24 100755 --- a/setup/archiso/build.sh +++ b/setup/archiso/build.sh @@ -176,6 +176,13 @@ cp "$DOTFILES_DIR/setup/arch-autoinstall.sh" "$PROFILE/airootfs/root/in # Reset script — wipes and reinstalls the system while preserving /home. cp "$DOTFILES_DIR/setup/reset-arch.sh" "$PROFILE/airootfs/root/installer/" +echo "Embedding resources (branding assets used by post-install modules)..." +# resources/ contains shared assets (SVGs, etc.) referenced by installer modules +# such as the Plymouth splash logo. Embedding them here means the ISO carries +# everything needed so post-install steps never require the user to supply files. +mkdir -p "$PROFILE/airootfs/root/installer/resources" +cp -r "$DOTFILES_DIR/resources/." "$PROFILE/airootfs/root/installer/resources/" + # Make all scripts executable. The archiso tool preserves these bits in the # squashfs, so they will be executable on the live system too. chmod 755 \ diff --git a/setup/modules/optional-Modules/plymouth.sh b/setup/modules/optional-Modules/plymouth.sh index e287f66..3d64638 100644 --- a/setup/modules/optional-Modules/plymouth.sh +++ b/setup/modules/optional-Modules/plymouth.sh @@ -9,10 +9,14 @@ # even commented "png file loader". bg-skull.svg must be converted to PNG with # rsvg-convert (higher fidelity than ImageMagick for SVG) before deployment. # +# Logo resolution order (no user intervention required): +# 1. $DOTFILES_DIR/resources/bg-skull.svg — repo copy, always present +# 2. /root/installer/resources/bg-skull.svg — archiso embedded copy +# # Steps: # 1. Install plymouth (extra repo) # 2. Install librsvg (rsvg-convert) + imagemagick if absent -# 3. Convert ~/Pictures/bg-skull.svg → logo.png (300 px wide) +# 3. Convert bg-skull.svg → logo.png (300 px wide) # 4. Generate a 10×10 magenta dot.png for the spinner # 5. Write the m-archy theme (.plymouth descriptor + .script animation) # 6. Register with plymouth-set-default-theme @@ -24,7 +28,20 @@ set -euo pipefail source "$(dirname "${BASH_SOURCE[0]}")/../lib/logging.sh" THEME_DIR="/usr/share/plymouth/themes/m-archy" -LOGO_SVG="$HOME/Pictures/bg-skull.svg" +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +DOTFILES_DIR="$(cd "$SCRIPT_DIR/../../.." && pwd)" + +# Resolve logo SVG — repo copy first, ISO embedded copy as fallback +LOGO_SVG="" +for _candidate in \ + "$DOTFILES_DIR/resources/bg-skull.svg" \ + "/root/installer/resources/bg-skull.svg" +do + if [[ -f "$_candidate" ]]; then + LOGO_SVG="$_candidate" + break + fi +done # ── Install Plymouth ────────────────────────────────────────────────────────── log "Installing Plymouth..." @@ -46,12 +63,11 @@ TMP_LOGO="$(mktemp /tmp/plymouth-logo.XXXXXX.png)" TMP_DOT="/tmp/plymouth-dot.png" trap 'rm -f "$TMP_LOGO" "$TMP_DOT"' EXIT -if [[ -f "$LOGO_SVG" ]]; then +if [[ -n "$LOGO_SVG" ]]; then log "Converting $LOGO_SVG → PNG (300 px wide)..." rsvg-convert -w 300 "$LOGO_SVG" -o "$TMP_LOGO" else - warn "$LOGO_SVG not found — using transparent placeholder." - warn "Place bg-skull.svg in ~/Pictures and re-run this module to update the logo." + warn "bg-skull.svg not found in repo resources or ISO — using transparent placeholder." convert -size 300x300 xc:transparent "$TMP_LOGO" fi