From ce5a83b9788b914cfe41d7ad57f419dceb22b315 Mon Sep 17 00:00:00 2001 From: Marti Raudsepp Date: Sun, 5 Aug 2018 17:18:28 +0300 Subject: [PATCH] Add initramfs error message when charging-sdl fails to run There are devices where charging-sdl/directfb fails (osk-sdl#77). It's nicer to give an error message than display "Loading..." forever. --- main/postmarketos-mkinitfs/APKBUILD | 6 +++--- main/postmarketos-mkinitfs/init_functions.sh | 5 ++++- main/postmarketos-mkinitfs/mkinitfs.sh | 3 ++- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/main/postmarketos-mkinitfs/APKBUILD b/main/postmarketos-mkinitfs/APKBUILD index 9b302a7ba..bcb2effef 100644 --- a/main/postmarketos-mkinitfs/APKBUILD +++ b/main/postmarketos-mkinitfs/APKBUILD @@ -1,5 +1,5 @@ pkgname=postmarketos-mkinitfs -pkgver=0.6.7 +pkgver=0.6.8 pkgrel=0 pkgdesc="Tool to generate initramfs images for postmarketOS" url="https://postmarketos.org" @@ -24,5 +24,5 @@ package() { mkdir -p "$pkgdir/etc/postmarketos-mkinitfs/hooks/" } sha512sums="d5abfe9a1298069e6722555c6e16223b09b36af65d879feb64d540aa6cbc009a3aa7f00528bcf656370ec37cc64f925c72ebb77813961cd6ebf22107b57ea029 init.sh.in -3b029db5eea5f5f2ad486fdcd944340f5c8de04b0d46aaf63c69d181ba87c4d209e3e32d35c9a6f87f214a4303390bd61b5fe980cf533b17d479d42275a6f9ae init_functions.sh -e6bf0d326297c7061275156eb9ff354662e740ee5c1ef9e0aab3be80aa50fd32ca5fdaa33a2dfb0431fece3c98c5fea3c40a6f706237aac256b05e92100b8381 mkinitfs.sh" +4515bc6891110e9c8b1ed8d31a89818c7c222a364bdbdf90097d5d6bbdb97eb889d4dbaec78dc928aa5ff698a8e89a76338e7c63017bf8dfb93f44a293848ca0 init_functions.sh +f3dc19f6976a95f11ef15155a240574edb46fdaa6885733532abc942c22b43422f9be50b3ae93dc42f9b1a683a62f3246efdb85cd38dbb3abbfdff46bba96617 mkinitfs.sh" diff --git a/main/postmarketos-mkinitfs/init_functions.sh b/main/postmarketos-mkinitfs/init_functions.sh index f690d0362..a0c0db841 100644 --- a/main/postmarketos-mkinitfs/init_functions.sh +++ b/main/postmarketos-mkinitfs/init_functions.sh @@ -313,7 +313,10 @@ start_charging_mode(){ echo "KEY_POWER 1 pgrep -x charging-sdl || charging-sdl -pcf $fontpath" } >/etc/triggerhappy.conf # Start it once and then start triggerhappy - charging-sdl -pcf "$fontpath" & + ( + charging-sdl -pcf "$fontpath" \ + || show_splash /splash-charging-error.ppm.gz + ) & thd --deviceglob /dev/input/event* --triggers /etc/triggerhappy.conf } diff --git a/main/postmarketos-mkinitfs/mkinitfs.sh b/main/postmarketos-mkinitfs/mkinitfs.sh index d439328a9..4426a200f 100644 --- a/main/postmarketos-mkinitfs/mkinitfs.sh +++ b/main/postmarketos-mkinitfs/mkinitfs.sh @@ -302,7 +302,8 @@ generate_splash_screens() "splash-noinitramfsextra" "initramfs-extra not found\\nhttps://postmarketos.org/troubleshooting" "--center" \ "splash-norootfs" "rootfs not found\\nhttps://postmarketos.org/troubleshooting" "--center" \ "splash-mounterror" "unable to mount root partition\\nhttps://postmarketos.org/troubleshooting" "--center" \ - "splash-debug-shell" "WARNING\\ndebug-shell is active\\nhttps://postmarketos.org/debug-shell" "--center" + "splash-debug-shell" "WARNING\\ndebug-shell is active\\nhttps://postmarketos.org/debug-shell" "--center" \ + "splash-charging-error" "CHARGING MODE\\nerror starting charging-sdl\\nhttps://postmarketos.org/troubleshooting" "--center" # Ensure cache folder exists mkdir -p "${splash_cache_dir}"