From c9c4b492e4614515701ea160327b49adf0217711 Mon Sep 17 00:00:00 2001 From: Clayton Craft Date: Wed, 11 Oct 2023 16:57:00 -0700 Subject: [PATCH] main/postmarketos-initramfs: show OS version on splash screen (MR 4470) This shows the OS version (from /etc/os-release), e.g. "edge", on the splash screen. os-release is a tiny text file, adding it to the initramfs doesn't seem too bad, and having this information on the splash screen can be helpful. Note that this uses "VERSION" and not "PRETTY_NAME" from the os-release file, since the splash already shows "postmarketOS" (and the pretty name includes that too), it seemed redundant and took up valuable display space. [ci:skip-build]: already built successfully in CI --- main/postmarketos-initramfs/APKBUILD | 6 +++--- main/postmarketos-initramfs/init.sh | 3 +++ main/postmarketos-initramfs/init_functions.sh | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/main/postmarketos-initramfs/APKBUILD b/main/postmarketos-initramfs/APKBUILD index 39f8ca9a2..8bcaa3e2c 100644 --- a/main/postmarketos-initramfs/APKBUILD +++ b/main/postmarketos-initramfs/APKBUILD @@ -1,7 +1,7 @@ # Maintainer: Oliver Smith # Co-Maintainer: Clayton Craft pkgname=postmarketos-initramfs -pkgver=2.1.0 +pkgver=2.1.1 pkgrel=0 pkgdesc="Base files for the postmarketOS initramfs / initramfs-extra" url="https://postmarketos.org" @@ -79,8 +79,8 @@ bed319179bcd0b894d6267c7e73f2890db07bc07df71542936947dfb3bdb17fade8a7b4e7b577f27 5b364300f31c91fd0591eb0715f67cbf5383f45246a5fb9f34b79f7cb2e3b15768b2130e5f32f816cc169950f988c1beabc879ba31645c58ce131a288dbc071d 00-initramfs-base.dirs ab41b45b0613f25a61114ed8c8b92bc53c60838f6e2e0ba18c76e5369b2984e6023a0661887692673aca3f647f268c468a468f6b1ac424cfee609017a89481dd 00-initramfs-base.files 8a4adad3785af474b36a09a05f6a3b2c4b4f43aac331a53b903abfa51ea12be1e3d1d807b7a6e66a1346815f3b0044daf8cd62e21e2dc75d2db13ee265a72985 00-initramfs-extra-base.files -0db45596accd92712498da1a3fcc6a6a006444446bdf3444c3925bf00acf14ee020a71b9c0931a7031812c98f87ee640d054a0394b44b76fa8200e6b21519cb1 init.sh -182e15e979adbab9a4964831174f01989e828557300c60232df2d42d6730d5b14b901d01148ea5f332fe0a69354f9840bed8d6d7bd12864499944dad5f91d018 init_functions.sh +f2dc71d88964a8c2e8cd2f84965184ef7eb9e28899df2c2621a590463a37216ca8550a5109d96d067c0a40c766f96fc76eea38f386b0948c2e93817dd2ef39b6 init.sh +a1033084cb53d862f1952273ccdb9c3865c1b8eaa8c04a44ec176966df931fab5765a36ef13d794d9fadfb8fab61e27b2628693ae7f51b1f13d55983a683e590 init_functions.sh ba3275a9af788c7c782322a22a0f144d5e50e3498ea6886486a29331f23ae89cd32d500a3635cfa7cab369afba92edc18aeca64ccbf0cd589061cce23d15b46c unudhcpd.conf 675e7d5bee39b2df7d322117f8dcaccc274d61beaf4d50ead19bbf2109446d64b1c0aa0c5b4f9846eb6c1c403418f28f6364eff4537ba41120fbfcbc484b7da7 mdev.conf " diff --git a/main/postmarketos-initramfs/init.sh b/main/postmarketos-initramfs/init.sh index c176127da..c06ea5909 100644 --- a/main/postmarketos-initramfs/init.sh +++ b/main/postmarketos-initramfs/init.sh @@ -10,6 +10,9 @@ IN_CI="false" [ -e /etc/unudhcpd.conf ] && . /etc/unudhcpd.conf . ./init_functions.sh . /usr/share/misc/source_deviceinfo +[ -e /etc/os-release ] && . /etc/os-release +# provide a default for os-release's VERSION in case the file doesn't exist +VERSION="${VERSION:-unknown}" export PATH=/usr/bin:/bin:/usr/sbin:/sbin /bin/busybox --install -s diff --git a/main/postmarketos-initramfs/init_functions.sh b/main/postmarketos-initramfs/init_functions.sh index cc01fe328..95ae011f7 100644 --- a/main/postmarketos-initramfs/init_functions.sh +++ b/main/postmarketos-initramfs/init_functions.sh @@ -686,7 +686,7 @@ show_splash() { # shellcheck disable=SC2154,SC2059 /usr/bin/pbsplash -s /usr/share/pbsplash/pmos-logo-text.svg \ - -b "Linux $(uname -r) | $deviceinfo_codename" \ + -b "$VERSION | Linux $(uname -r) | $deviceinfo_codename" \ -m "$(printf "$1")" >/dev/null & }