From 4a2a33c081196dc8824297afc1b57ac7984056df Mon Sep 17 00:00:00 2001 From: /rootzoll Date: Wed, 21 Dec 2022 14:50:52 +0100 Subject: [PATCH] Fix display settings recover for future lean build releases (#3558) * modify dev notes * display recover during lean-build --- FAQ.dev.md | 15 +++++++++-- build_sdcard.sh | 2 ++ home.admin/_bootstrap.sh | 8 ++++++ home.admin/config.scripts/blitz.display.sh | 30 +++++++++++++++++++--- 4 files changed, 49 insertions(+), 6 deletions(-) diff --git a/FAQ.dev.md b/FAQ.dev.md index 25ba53ca9..dbe805351 100644 --- a/FAQ.dev.md +++ b/FAQ.dev.md @@ -12,8 +12,7 @@ Work notes for the process of producing a new SD card image release: * From the browser `Show All Downloads` and from the context menu select `Open Containing Folder` * On that file manager open context (right click) on the white-space and select `Open in Terminal` * Compare the checksum with the one you just made note of, using `shasum -a 256 *.zip` -* Install curl if needed `sudo apt-get install -f curl net-tools` -* Check signature: `curl https://www.raspberrypi.org/raspberrypi_downloads.gpg.key | gpg --import && gpg --verify *.sig` +* Check signature: `wget https://www.raspberrypi.org/raspberrypi_downloads.gpg.key && gpg --import ./raspberrypi_downloads.gpg.key && gpg --verify *.sig` * The result should say "correct signature" and the fingerprint should end with `8738 CD6B 956F 460C` * Insert an NTFS formatted USB stick and use the file manager to move all files to the USB * If image is an ZIP file use in file manager context on NTFS USB stick `extract here` to unzip @@ -197,3 +196,15 @@ See article: https://tech.sycamore.garden/add-commit-push-contributor-branch-git Chery-picking patch PRs from dev to a release-branch like 'v1.8' (for example) is now a bit more complicated. Either an admin switches temorarly the branch protection "require a pull request before merging" setting off for the `git cherry-pick` OR we create a `p1.8` branch from `v1.8`, cherry-pick the squashed patch PR into that unprotected `p1.8` and then open a PR back to `v1.8`. But what we gain is that better branch protection and we can add more contributers to the project that are allowed to manage issues - like adding lables or closing. + +### How to run the automatic amd64 build on a VM on OSX? + +just notes so far: + +https://brew.sh +brew install qemu +https://github.com/rootzoll/raspiblitz/actions --> download amd64-lean image +double unzip until `qcow2` file +convert `qcow2` to `vdi: +qemu-img convert -f qcow2 raspiblitz-amd64-debian-lean.qcow2 -O vdi raspiblitz-amd64-debian-lean.vdi +https://www.virtualbox.org/wiki/Downloads diff --git a/build_sdcard.sh b/build_sdcard.sh index c704af40d..e9a47d599 100644 --- a/build_sdcard.sh +++ b/build_sdcard.sh @@ -856,6 +856,8 @@ echo -e "\nIMPORTANT IF WANT TO MAKE A RELEASE IMAGE FROM THIS BUILD:" echo "1. login fresh --> user:admin password:raspiblitz" echo -e "2. run --> release\n" +# make sure that at least the code is available (also if no internet) +sudo /home/admin/config.scripts/blitz.display.sh prepare-install # (do last - because might trigger reboot) if [ "${display}" != "headless" ] || [ "${baseimage}" = "raspios_arm64" ]; then echo "*** ADDITIONAL DISPLAY OPTIONS ***" diff --git a/home.admin/_bootstrap.sh b/home.admin/_bootstrap.sh index b33606603..053e16d12 100755 --- a/home.admin/_bootstrap.sh +++ b/home.admin/_bootstrap.sh @@ -898,6 +898,14 @@ if [ ${configWifiExists} -eq 1 ]; then cp /etc/wpa_supplicant/wpa_supplicant.conf /mnt/hdd/app-data/wpa_supplicant.conf fi +# always copy the latest display setting (maybe just in raspiblitz.info) to raspiblitz.conf +if [ "${displayClass}" != "" ]; then + /home/admin/config.scripts/blitz.conf.sh set displayClass ${displayClass} +fi +if [ "${displayType}" != "" ]; then + /home/admin/config.scripts/blitz.conf.sh set displayType ${displayType} +fi + # make sure users have latest credentials (if lnd is on) if [ "${lightning}" == "lnd" ] || [ "${lnd}" == "on" ]; then echo "running LND users credentials update" >> $logFile diff --git a/home.admin/config.scripts/blitz.display.sh b/home.admin/config.scripts/blitz.display.sh index 16bcf7899..d97b21f8a 100755 --- a/home.admin/config.scripts/blitz.display.sh +++ b/home.admin/config.scripts/blitz.display.sh @@ -13,6 +13,7 @@ if [ $# -eq 0 ] || [ "$1" = "-h" ] || [ "$1" = "-help" ]; then echo "# sudo blitz.display.sh rotate [on|off]" echo "# sudo blitz.display.sh test-lcd-connect" echo "# sudo blitz.display.sh set-display [hdmi|lcd|headless]" + echo "# sudo blitz.display.sh prepare-install" exit 1 fi @@ -196,6 +197,19 @@ if [ "${command}" == "test-lcd-connect" ]; then exit 0 fi +function prepareinstall() { + repoCloned=$(sudo -u admin ls /home/admin/wavesharelcd-64bit-rpi/README.md 2>/dev/null| grep -c README.md) + if [ ${repoCloned} -lt 1 ]; then + echo "# clone/download https://github.com/tux1c/wavesharelcd-64bit-rpi.git" + cd /home/admin/ + sudo -u admin git clone https://github.com/tux1c/wavesharelcd-64bit-rpi.git + sudo -u admin chmod -R 755 wavesharelcd-64bit-rpi + sudo -u admin chown -R admin:admin wavesharelcd-64bit-rpi + else + echo "# LCD repo already cloned/downloaded (${repoCloned})" + fi +} + ####################################### # DISPLAY TYPED INSTALLS & UN-INSTALLS # HDMI is the default - every added @@ -231,10 +245,7 @@ function install_lcd() { sudo apt-mark hold raspberrypi-bootloader # Downloading LCD Driver from Github - cd /home/admin/ - sudo -u admin git clone https://github.com/tux1c/wavesharelcd-64bit-rpi.git - sudo -u admin chmod -R 755 wavesharelcd-64bit-rpi - sudo -u admin chown -R admin:admin wavesharelcd-64bit-rpi + prepareinstall cd /home/admin/wavesharelcd-64bit-rpi sudo -u admin git reset --hard 5a206a7 || exit 1 sudo -u admin /home/admin/config.scripts/blitz.git-verify.sh \ @@ -404,6 +415,17 @@ function uninstall_headless() { fi } +################### +# PREPARE INSTALL +# make sure github +# repo is installed +################### + +if [ "${command}" == "prepare-install" ]; then + prepareinstall + exit 0 +fi + ################### # SET DISPLAY TYPE ###################