diff --git a/home.admin/_bootstrap.sh b/home.admin/_bootstrap.sh index 00ccfbb39..bed3a65dd 100755 --- a/home.admin/_bootstrap.sh +++ b/home.admin/_bootstrap.sh @@ -177,8 +177,16 @@ fi # display 3 secs logo - try to kickstart LCD # see https://github.com/rootzoll/raspiblitz/issues/195#issuecomment-469918692 # see https://github.com/rootzoll/raspiblitz/issues/647 +# see https://github.com/rootzoll/raspiblitz/pull/1580 randnum=$(shuf -i 0-7 -n 1) -sudo fbi -a -T 1 -d /dev/fb1 --noverbose /home/admin/raspiblitz/pictures/startlogo${randnum}.png +lcdExists=$(sudo ls /dev/fb1 2>/dev/null | grep -c "/dev/fb1") +if [ ${lcdExists} -eq 1 ] ; then + # LCD + sudo fbi -a -T 1 -d /dev/fb1 --noverbose /home/admin/raspiblitz/pictures/startlogo${randnum}.png +else + # HDMI + sudo fbi -a -T 1 -d /dev/fb0 --noverbose /home/admin/raspiblitz/pictures/startlogo${randnum}.png +fi sleep 5 sudo killall -3 fbi diff --git a/home.admin/config.scripts/blitz.lcd.sh b/home.admin/config.scripts/blitz.lcd.sh index 97fb2531e..c8a4d62c0 100755 --- a/home.admin/config.scripts/blitz.lcd.sh +++ b/home.admin/config.scripts/blitz.lcd.sh @@ -32,6 +32,10 @@ command=$1 oldKernel=$(uname -srm | cut -d ' ' -f2 | cut -d '-' -f1 | grep -c '4.19.118') oldDrivers=$(sudo cat /home/admin/LCD-show/.git/config 2>/dev/null | grep -c 'github.com/goodtft/LCD') +# check if LCD (/dev/fb1) or HDMI (/dev/fb0) +# see https://github.com/rootzoll/raspiblitz/pull/1580 +lcdExists=$(sudo ls /dev/fb1 2>/dev/null | grep -c "/dev/fb1") + ################### # CHECK-REPAIR # make sure that LCD drivers match linux kernel @@ -172,7 +176,14 @@ if [ "${command}" == "image" ]; then fi fi - sudo fbi -a -T 1 -d /dev/fb1 --noverbose ${imagePath} 2> /dev/null + # see https://github.com/rootzoll/raspiblitz/pull/1580 + if [ ${lcdExists} -eq 1 ] ; then + # LCD + sudo fbi -a -T 1 -d /dev/fb1 --noverbose ${imagePath} 2> /dev/null + else + # HDMI + sudo fbi -a -T 1 -d /dev/fb0 --noverbose ${imagePath} 2> /dev/null + fi exit 0 fi @@ -190,7 +201,14 @@ if [ "${command}" == "qr" ]; then fi qrencode -l L -o /home/admin/qr.png "${datastring}" > /dev/null - sudo fbi -a -T 1 -d /dev/fb1 --noverbose /home/admin/qr.png 2> /dev/null + # see https://github.com/rootzoll/raspiblitz/pull/1580 + if [ ${lcdExists} -eq 1 ] ; then + # LCD + sudo fbi -a -T 1 -d /dev/fb1 --noverbose /home/admin/qr.png 2> /dev/null + else + # HDMI + sudo fbi -a -T 1 -d /dev/fb0 --noverbose /home/admin/qr.png 2> /dev/null + fi exit 0 fi