main/postmarketos-initramfs: replace pbsplash with plymouth

This also drops support for pmos.no-splash, since removing `splash` from
the kernel cmdline will effectively prevent Plymouth from showing the
splash screen.

Signed-off-by: Clayton Craft <craftyguy@postmarketos.org>

[ci:skip-vercheck]

Part-of: <https://gitlab.postmarketos.org/postmarketOS/pmaports/-/merge_requests/7482>
This commit is contained in:
Clayton Craft
2026-05-05 12:34:20 -07:00
parent 3f67ce725c
commit 084013fac5
6 changed files with 115 additions and 44 deletions
+5 -5
View File
@@ -1,7 +1,7 @@
# Co-Maintainer: Clayton Craft <clayton@craftyguy.net>
maintainer="Casey Connolly <kcxt@postmarketos.org>"
pkgname=postmarketos-initramfs
pkgver=3.9.6
pkgver=3.10.0
pkgrel=0
pkgdesc="Base files for the postmarketOS initramfs / initramfs-extra"
url="https://postmarketos.org"
@@ -119,10 +119,10 @@ ace852ba267b3408998970df6042603c8bec1d033066d1c30ed65f1be955fee8644b57882898f102
9c0e8f6f61d5da191e03a1aa9d5d0ceb5baf1eae6dbb9bfb0af59817783525119ac8394b135f303f7b6434a3eab0b49185fb90379e06823db847a4999c75ce33 00-initramfs-base.dirs
26e391a2c45e4317549153630d7398f01cf374d9a95e2587f0f7153017c50b6640950af60eab3b3fcadef2e8826295445ac1f45567716d3bd5d12e9c87df599b 00-initramfs-base.files
6d91270b96ce0c745391174201dde63b43a73ae6456c2e1138046beef3548580588fedbeae7cc914079162e99343b45d82c6e6a7ee1d03829aae7697ae52f575 00-initramfs-extra-base.files
e90596540805662211bd2a2e427ce7cc38f6a30023267f902e23f2bae136b6cd8f4f4716b8fb611be9d671a964edd2ecce03fa32bc8024e29b8375b0097fde0c init.sh
ba00a507e26976e438db3125edb016ecae63cff1829ba2b341b521f8678d89f6894f0be5b0964204857384bf1c17a49445ef16f91ed1535f4066ec7718e346cf init_functions.sh
55634e5388394acc86a7ba245c35f1f07aff6e352d6973df6a62483ac70485c5b889828c52ff4067049ec4f825174cf0073a77a373f8048c4e252d6811299756 init_2nd.sh
61acb470a163fb50ad46752781b5ccc5dba6db9170e4250b4dcdfc7572d0316a7a36bc5a383026887a7a59364ee30917790e429b3fce9de590543d1d8410589c init_functions_2nd.sh
bd72e8b6345a46ec13516c64d78d4fa1a9a18a8db9ab04aac605f9708629453dc65b6fbccd96b58eeb1ea68102ddbcae9dc6b369255c6c6c1fb18ce0bd43ec79 init.sh
9936105fd625722c3a33e20926131d7002fd48fb698cd502b88d801f5aff9a61eb66f4e966d4b9afea780bf770f47f8a7162da4e38e9cb506d2f98f6130d89d4 init_functions.sh
85005a36d8928872296983108d95b57ac34b77e4bd8e7595d395af1b03ac0d0d672b4e6ff8500e4ce828538b98391a7a36d1aaa76510e9e187733ddf9d62bf37 init_2nd.sh
4eca94327274511011967cde1f663b00b1a8182f7dddc3ba19d5c1f0ac094087a154a250c140ca70ac75a2e7c5bb70b03e94fa5eca63a5393efc4a23d025e1c3 init_functions_2nd.sh
675e7d5bee39b2df7d322117f8dcaccc274d61beaf4d50ead19bbf2109446d64b1c0aa0c5b4f9846eb6c1c403418f28f6364eff4537ba41120fbfcbc484b7da7 mdev.conf
ba3275a9af788c7c782322a22a0f144d5e50e3498ea6886486a29331f23ae89cd32d500a3635cfa7cab369afba92edc18aeca64ccbf0cd589061cce23d15b46c unudhcpd.conf
"
-1
View File
@@ -55,7 +55,6 @@ start_unudhcpd
if [ "$IN_CI" = "false" ]; then
setup_framebuffer
show_splash "Loading..."
fi
# Discover the partitions if they're "subpartitions"
+5 -4
View File
@@ -22,10 +22,11 @@ setup_udev
setup_usb_network
start_unudhcpd
# Splash is already running if we're loaded from initramfs-extra
if [ "$deviceinfo_create_initfs_extra" != "true" ] && [ "$IN_CI" = "false" ]; then
# Start splash
if [ "$nosplash" != "y" ] && [ "$IN_CI" = "false" ]; then
setup_framebuffer
show_splash "Loading..."
splash_start
splash_set_message "Loading"
fi
setup_dynamic_partitions "${deviceinfo_super_partitions:=}"
@@ -77,7 +78,7 @@ elif [ "$debug_shell" != "y" ]; then
fi
# Make it clear that we're at the end of the initramfs
show_splash "Starting..."
splash_set_message "Starting"
# Re-enable kmsg ratelimiting (might have been disabled for logging)
echo ratelimit > /proc/sys/kernel/printk_devkmsg
+78 -27
View File
@@ -21,6 +21,10 @@ deviceinfo_create_initfs_extra="${deviceinfo_create_initfs_extra:-}"
deviceinfo_no_framebuffer="${deviceinfo_no_framebuffer:-}"
deviceinfo_rootfs_image_sector_size="${deviceinfo_rootfs_image_sector_size:-}"
# Default to no splash unless set on the kernel cmdline. Plymouth will not
# display a splash if this param is missing from the cmdline
nosplash="${nosplash:-y}"
# Does word start with prefix?
startswith() {
local word="$1" prefix="$2"
@@ -75,8 +79,8 @@ parse_cmdline_item() {
# shellcheck disable=SC2034
force_partition_resize=y
;;
pmos.nosplash | PMOS_NOSPLASH)
nosplash=y
splash)
nosplash=n
;;
pmos.root | pmos_root)
root_path="$value"
@@ -196,7 +200,7 @@ parse_cmdline() {
}
# Redirect stdout/stderr to the log file, as well as to the kernel via
# syslog. Additionally, if pmos.nosplash is set and there are no active
# syslog. Additionally, if nosplash is set and there are no active
# consoles, try to be helpful by logging to tty0 and the devices serial
# port.
setup_log() {
@@ -220,7 +224,7 @@ setup_log() {
log_targets="$log_targets $console"
fi
# If pmos.nosplash is set but there's no active console, let's try to be helpful by at least
# If nosplash is set but there's no active console, let's try to be helpful by at least
# logging the initramfs output to the consoles we can find.
# TODO: This could be further improved by reading /dev/kmsg and outputting it as well which
# might help with debugging on bootloaders that do force console=null
@@ -577,13 +581,13 @@ check_filesystem() {
esac
if [ "$status" = "fail" ]; then
show_splash "WARNING: filesystem needs manual repair (fsck) ($partition)\\nhttps://postmarketos.org/troubleshooting\\n\\nBoot anyways by pressing Volume-Up or Left-Shift..."
splash_set_warning "Filesystem needs manual repair (fsck) ($partition)\nhttps://postmarketos.org/troubleshooting\n\nBoot anyways by pressing Volume-Up or Left-Shift..."
while ! iskey KEY_LEFTSHIFT KEY_VOLUMEUP ; do
:
done
fi
show_splash "Loading..."
splash_set_message "Loading"
}
# $1: path
@@ -638,7 +642,7 @@ extract_initramfs_extra() {
initramfs_extra="$1"
if [ ! -e "$initramfs_extra" ]; then
echo "ERROR: initramfs-extra not found!"
show_splash "ERROR: initramfs-extra not found\\nhttps://postmarketos.org/troubleshooting"
splash_set_error "initramfs-extra not found\nhttps://postmarketos.org/troubleshooting"
fail_halt_boot
fi
echo "Extract $initramfs_extra"
@@ -657,7 +661,7 @@ wait_partition() {
return
fi
show_splash "Waiting for $description partition..."
splash_set_message "Waiting for $description partition"
for _ in $(seq 1 30); do
sleep 1
$findfunc partition
@@ -667,7 +671,7 @@ wait_partition() {
check_keys ""
done
show_splash "ERROR: $description partition not found!\\nhttps://postmarketos.org/troubleshooting"
splash_set_error "$description partition not found!\nhttps://postmarketos.org/troubleshooting"
fail_halt_boot
}
@@ -724,7 +728,7 @@ mount_root_partition() {
;;
*)
echo "ERROR: Detected unsupported '$type' filesystem ($partition)."
show_splash "ERROR: unsupported '$type' filesystem ($partition)\\nhttps://postmarketos.org/troubleshooting"
splash_set_error "Unsupported '$type' filesystem ($partition)\nhttps://postmarketos.org/troubleshooting"
fail_halt_boot
;;
esac
@@ -740,7 +744,7 @@ mount_root_partition() {
if ! mount -t "$type" -o rw"$rootfsopts" "$partition" /sysroot; then
echo "ERROR: unable to mount root partition!"
show_splash "ERROR: unable to mount root partition\\nhttps://postmarketos.org/troubleshooting"
splash_set_error "Unable to mount root partition\nhttps://postmarketos.org/troubleshooting"
fail_halt_boot
fi
@@ -753,7 +757,7 @@ mount_root_partition() {
fi
if ! [ -e /sysroot/etc/os-release ]; then
show_splash "ERROR: root partition does not contain a root filesystem\\nhttps://postmarketos.org/troubleshooting"
splash_set_error "Root partition does not contain a root filesystem\nhttps://postmarketos.org/troubleshooting"
fail_halt_boot
fi
}
@@ -1046,6 +1050,7 @@ setup_usb_storage_configfs() {
}
debug_shell() {
splash_hide
echo "Entering debug shell"
# if we have a UDC it's already been configured for USB networking
local have_udc
@@ -1195,7 +1200,7 @@ debug_shell() {
rmdir "$CONFIGFS/g1/functions/$CONFIGFS_MASS_STORAGE_FUNCTION"
setup_usb_configfs_udc
show_splash "Loading..."
splash_set_message "Loading"
pkill -f buffyboard || true
}
@@ -1221,30 +1226,76 @@ check_keys() {
done
}
# $1: Message to show
show_splash() {
info "SPLASH: $1"
# Show the Plymouth splash screen
# Uses: nosplash
# Sets: (none)
# Returns: 0
splash_show() {
if [ "$nosplash" = "y" ]; then
return
fi
hide_splash
# shellcheck disable=SC2154,SC2059
/usr/bin/pbsplash -s /usr/share/pbsplash/pmos-logo-text.svg \
-b "$VERSION | Linux $(uname -r) | $deviceinfo_codename" \
-m "$(printf "$1")" >/dev/null &
if plymouth --ping 2>/dev/null; then
plymouth show-splash
fi
}
hide_splash() {
# Hide the Plymouth splash screen
# Uses: nosplash
# Sets: (none)
# Returns: 0
splash_hide() {
if [ "$nosplash" = "y" ]; then
return
fi
killall pbsplash 2>/dev/null
while pgrep pbsplash >/dev/null; do
sleep 0.01
done
if plymouth --ping 2>/dev/null; then
plymouth hide-splash
fi
}
# Set the Plymouth message
# Uses: (none)
# Sets: (none)
# $1: message text to display, may be multiline with \n
# Returns: 0
splash_set_message() {
info "SPLASH: $1"
splash_show
if plymouth --ping 2>/dev/null; then
# Use printf to convert \n to literal newlines for multiline messages
plymouth display-message --text "$(printf '%b' "$1")"
fi
}
# Set an error on the Plymouth splash
# Uses: (none)
# Sets: (none)
# $1: error text to display
# Returns: 0
splash_set_error() {
info "SPLASH ERROR: $1"
splash_show
if plymouth --ping 2>/dev/null; then
plymouth update --status="error"
# Use printf to convert \n to literal newlines for multiline messages
plymouth display-message --text "$(printf '%b' "$1")"
fi
}
# Set a warning on the Plymouth splash
# Uses: (none)
# Sets: (none)
# $1: warning text to display
# Returns: 0
splash_set_warning() {
info "SPLASH WARNING: $1"
splash_show
if plymouth --ping 2>/dev/null; then
plymouth update --status="warning"
# Use printf to convert \n to literal newlines for multiline messages
plymouth display-message --text "$(printf '%b' "$1")"
fi
}
set_framebuffer_mode() {
@@ -3,6 +3,28 @@
# Functions are notated with the reason they're only in
# initramfs-extra
# Start the Plymouth daemon
# Uses: (none)
# Sets: (none)
# Returns: 0
splash_start() {
if ! command -v plymouthd > /dev/null || ! command -v plymouth > /dev/null; then
echo "ERROR: plymouth not found!"
return
fi
plymouthd --mode=boot --attach-to-session
}
# Stop the Plymouth daemon
# Uses: (none)
# Sets: (none)
# Returns: 0
splash_stop() {
if plymouth --ping 2>/dev/null; then
plymouth quit
fi
}
# udevd is too big
setup_udev() {
if ! command -v udevd > /dev/null || ! command -v udevadm > /dev/null; then
@@ -76,16 +98,14 @@ resize_root_partition() {
unlock_root_partition() {
command -v cryptsetup >/dev/null || return
if cryptsetup isLuks "$PMOS_ROOT"; then
# Make sure the splash doesn't interfere
hide_splash
splash_hide
tried=0
until cryptsetup status root | grep -qwi active; do
fde-unlock "$PMOS_ROOT" "$tried"
tried=$((tried + 1))
done
PMOS_ROOT=/dev/mapper/root
# Show again the loading splashscreen
show_splash "Loading..."
splash_set_message "Loading"
fi
}
@@ -21,13 +21,13 @@ start_test "Ensure all boolean variables can be set"
# shellcheck disable=SC3001
parse_cmdline < <(echo \
pmos.bootchart2 pmos.debug-shell pmos.force-partition-resize \
pmos.nosplash pmos.stowaway rd.info \
splash pmos.stowaway rd.info \
)
assert_equal "bootchart2" "y"
assert_equal "debug_shell" "y"
assert_equal "force_partition_resize" "y"
assert_equal "nosplash" "y"
assert_equal "nosplash" "n"
assert_equal "log_info" "y"
end_test
@@ -55,7 +55,7 @@ assert_equal "rootfsopts" ",default"
test_info "Checking other variables are unset"
assert_unset debug_shell
assert_unset nosplash
assert_unset splash
assert_unset bootchart2
end_test