diff --git a/helpers/DATA/finish-install/09trisquel-uefi-splash b/helpers/DATA/finish-install/09trisquel-uefi-splash new file mode 100755 index 0000000..d575c0a --- /dev/null +++ b/helpers/DATA/finish-install/09trisquel-uefi-splash @@ -0,0 +1,50 @@ +#!/bin/sh +# Enable 'splash' only on UEFI desktop installs, and only if Plymouth is present. +# Runs before 10update-initramfs, so we only call update-grub here. +# + +set -e + +# UEFI only +[ -d /sys/firmware/efi ] || exit 0 + +# Check for desktop environmtn task selected +SELECTION="$(debconf-get tasksel/first 2>/dev/null || true)" +echo "$SELECTION" | grep -Eq '\b(trisquel-(desktop|gnome|mini)|triskel)\b' || exit 0 + +# Check for plymouth installed in target +in-target dpkg -s plymouth >/dev/null 2>&1 || exit 0 + +# Debconf-first approach inside target; fallback to minimal edit if needed. +in-target sh -s <<'INCHROOT' +set -e +. /usr/share/debconf/confmodule + +# Read current value; default to "quiet" if empty +db_get grub2/linux_cmdline_default || true +CURRENT_CMDLINE="${RET:-quiet}" + +# If 'splash' already present, nothing to do +echo "$CURRENT_CMDLINE" | grep -qw splash && exit 0 + +# Set debconf value to include splash +db_set grub2/linux_cmdline_default "$CURRENT_CMDLINE splash" || true + +# Reconfigure grub2-common (may or may not rewrite the conffile in d-i flows) +dpkg-reconfigure -f noninteractive grub2-common || true + +# Fallback: minimally ensure GRUB_CMDLINE_LINUX_DEFAULT contains 'splash' +CFG="/etc/default/grub" +if ! grep -q '^GRUB_CMDLINE_LINUX_DEFAULT=' "$CFG"; then + printf 'GRUB_CMDLINE_LINUX_DEFAULT="%s"\n' "quiet splash" >> "$CFG" +else + GRUB_CMDLINE_VALUE="$(sed -n 's/^GRUB_CMDLINE_LINUX_DEFAULT="\{0,1\}\(.*\)"\{0,1\}$/\1/p' "$CFG" | head -n1)" + echo "$GRUB_CMDLINE_VALUE" | grep -qw splash || \ + sed -i -E 's|^(GRUB_CMDLINE_LINUX_DEFAULT="[^"]*)(".*)?$|\1 splash"\2|; t; s|^(GRUB_CMDLINE_LINUX_DEFAULT=)(.*)$|\1"quiet splash"|' "$CFG" +fi + +# Regenerate grub.cfg now; initramfs will be refreshed by 10update-initramfs next +update-grub || true +INCHROOT + +exit 0 diff --git a/helpers/make-finish-install b/helpers/make-finish-install index b6d37ca..f5b9917 100644 --- a/helpers/make-finish-install +++ b/helpers/make-finish-install @@ -1,6 +1,6 @@ #!/bin/sh # -# Copyright (C) 2022 Luis Guzmán +# Copyright (C) 2025 Luis Guzmán # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -23,13 +23,16 @@ # such packages from Debian in order to build the required udeb packages. ## -VERSION=1 +VERSION=2 EXTERNAL='deb-src http://ftp.debian.org/debian trixie main' -REPOKEY=0E98404D386FA1D9 +REPOKEY=6ED0E7B82643E131 NETINST=true . ./config apply_patch_changes +# Add splash to desktop environments installations +cp $DATA/09trisquel-uefi-splash finish-install.d/ + changelog "Fetch and build as udeb dependency for debian-installer." package