main/postmarketos-mkinitfs: switch to pbsplash (MR 2878)

This modifies to the postmarketOS ramdisk init to use the new pbsplash
tool for displaying splash messages, replacing the old fbsplash.

This also moves the show_splash call to run as soon as possible rather
than waiting for mount_subpartitions to run (which can take a while).
This commit is contained in:
Caleb Connolly 2022-01-24 00:33:28 +00:00
parent 702088baff
commit e97b61b023
3 changed files with 25 additions and 26 deletions

View file

@ -2,7 +2,7 @@
# Co-Maintainer: Clayton Craft <clayton@craftyguy.net>
pkgname=postmarketos-mkinitfs
pkgver=1.6.1
pkgrel=0
pkgrel=1
pkgdesc="Tool to generate initramfs images for postmarketOS"
url="https://postmarketos.org"
depends="
@ -67,6 +67,6 @@ check() {
sha512sums="
eb4af0fd9b5050e792c2ffb5d72e38899d19e623eda8f41e7cfeaa3d6dcae7e0342381cfc12f4969017d1e3b3b5d879614b0bbc3e4cf2d5fd01769e741bea17e postmarketos-mkinitfs-1.6.1.tar.gz
20f110337113e8de8999cf2a064a93fea36821d5c216bfa4ba46ec1f83825638262b92fd7be29eee0a85a54a108b7315a96cbe30da8ae4419f54c2ed53bb08c7 00-default.modules
f9a3ebf7f116df5f50c047d99d9353ea97965522d6d80a039d4f79316c5152f49499fab654f8b12b54dd247f1497957e5c3d957292b09c3d449f3d1fa7d43d9a init.sh
57ad4267c97153c9ca606c5422de887cc62ec44faafacaf24923fa524068e6103a2de9ad50b70320f75e105e8b82ab65cde7f5efac3c27f0155b3086bc4f3431 init_functions.sh
5f8e4acb19abee32b481f69b50be96ab06b1fea1b27448b9d08dfa13f0868d7808139b39c88d64bd35a3d6b2727e7b71797dbf0e99f6a92157e2755c89a34da4 init.sh
4c18c7d1078c0fd37623e53d0f6d5660df7d6e53f2340c2b24cf62129cf7c4c5a90856ed6d0254498c927a7e41431e9344c4a6eae236f986e9468f45a7c7f281 init_functions.sh
"

View file

@ -20,8 +20,9 @@ setup_firmware_path
setup_mdev
setup_dynamic_partitions "${deviceinfo_super_partitions:=}"
mount_subpartitions
setup_framebuffer
show_splash "Loading..."
mount_subpartitions
run_hooks /etc/postmarketos-mkinitfs/hooks
# Always run dhcp daemon/usb networking for now (later this should only
@ -31,7 +32,6 @@ setup_usb_network
start_unudhcpd
mount_boot_partition /boot
show_splash_loading
extract_initramfs_extra /boot/initramfs-extra
setup_udev
run_hooks /etc/postmarketos-mkinitfs/hooks-extra

View file

@ -241,7 +241,7 @@ mount_boot_partition() {
partition=$(find_boot_partition)
if [ -z "$partition" ]; then
echo "ERROR: boot partition not found!"
show_splash /splash-noboot.ppm.gz
show_splash "ERROR: Boot partition not found\\nhttps://postmarketos.org/troubleshooting"
loop_forever
fi
@ -278,7 +278,7 @@ extract_initramfs_extra() {
initramfs_extra="$1"
if [ ! -e "$initramfs_extra" ]; then
echo "ERROR: initramfs-extra not found!"
show_splash /splash-noinitramfsextra.ppm.gz
show_splash "ERROR: initramfs-extra not found\\nhttps://postmarketos.org/troubleshooting"
loop_forever
fi
echo "Extract $initramfs_extra"
@ -287,7 +287,7 @@ extract_initramfs_extra() {
wait_root_partition() {
while [ -z "$(find_root_partition)" ]; do
show_splash /splash-norootfs.ppm.gz
show_splash "ERROR: root partition not found\\nhttps://postmarketos.org/troubleshooting"
echo "Could not find the rootfs."
echo "Maybe you need to insert the sdcard, if your device has"
echo "any? Trying again in one second..."
@ -378,6 +378,8 @@ resize_root_partition() {
unlock_root_partition() {
partition="$(find_root_partition)"
if cryptsetup isLuks "$partition"; then
# Make sure the splash doesn't interfere
killall pbsplash 2>/dev/null
tried=0
until cryptsetup status root | grep -qwi active; do
fde-unlock "$partition" "$tried"
@ -385,13 +387,13 @@ unlock_root_partition() {
done
ROOT_PARTITION_UNLOCKED=1
# Show again the loading splashscreen
show_splash_loading
show_splash "Loading..."
fi
}
resize_root_filesystem() {
if [ "$ROOT_PARTITION_RESIZED" = 1 ]; then
show_splash /splash-resizefs.ppm.gz
show_splash "Resizing filesystem during initial boot..."
partition="$(find_root_partition)"
touch /etc/mtab # see https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=673323
type="$(get_partition_type "$partition")"
@ -417,7 +419,7 @@ resize_root_filesystem() {
;;
*) echo "WARNING: Can not resize '$type' filesystem ($partition)." ;;
esac
show_splash_loading
show_splash "Loading..."
fi
}
@ -445,7 +447,7 @@ mount_root_partition() {
esac
if ! [ -e /sysroot/usr ]; then
echo "ERROR: unable to mount root partition!"
show_splash /splash-mounterror.ppm.gz
show_splash "ERROR: unable to mount root partition\\nhttps://postmarketos.org/troubleshooting"
loop_forever
fi
}
@ -621,12 +623,12 @@ start_charging_mode() {
# Start it once and then start triggerhappy
(
charging-sdl -pcf "$fontpath" \
|| show_splash /splash-charging-error.ppm.gz
|| show_splash "Charging mode failed"
) &
thd --deviceglob /dev/input/event* --triggers /etc/triggerhappy.conf
}
# $1: path to ppm.gz file
# $1: Message to show
show_splash() {
# Skip for non-framebuffer devices
# shellcheck disable=SC2154
@ -634,23 +636,20 @@ show_splash() {
echo "NOTE: Skipping framebuffer splashscreen (deviceinfo_no_framebuffer)"
return
fi
# Disable splash
if grep -q PMOS_NOSPLASH /proc/cmdline; then
return
fi
echo "IMG_ALIGN=CM" >>/tmp/fbsplash.cfg
gzip -c -d "$1" >/tmp/splash.ppm
fbsplash -s /tmp/splash.ppm -i /tmp/fbsplash.cfg
}
show_splash_loading() {
# Allow overriding the default loading splash screen with a
# "splash.ppm.gz" file on the boot partition
if [ -e /boot/splash.ppm.gz ]; then
show_splash /boot/splash.ppm.gz
else
show_splash /splash-loading.ppm.gz
fi
killall pbsplash 2>/dev/null
while pgrep pbsplash >/dev/null; do
sleep 0.01
done
# shellcheck disable=SC2154
/usr/bin/pbsplash -s /usr/share/pbsplash/pmos-logo-text.svg -b "Linux $(uname -r) | $deviceinfo_codename" -m "$1 " &
}
set_framebuffer_mode() {