From 3e01312c0e8293555e1ebc27b087ea9f7b403bea Mon Sep 17 00:00:00 2001 From: Thomas Schmitt Date: Wed, 23 Feb 2022 18:06:17 +0100 Subject: [PATCH] Fix #56: Gui will not be downloaded after cache partition was formatted (final attempt). --- debian/changelog | 8 ++++++++ linbofs/etc/linbo-version | 2 +- linbofs/init.sh | 15 +-------------- linbofs/linbo.sh | 3 +++ linbofs/usr/bin/linbo_cmd | 24 +++++++++++++++++++----- linbofs/usr/bin/linbo_update_gui | 6 ++++++ 6 files changed, 38 insertions(+), 20 deletions(-) diff --git a/debian/changelog b/debian/changelog index c224397..0486f13 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +linuxmuster-linbo7 (4.0.11-0) lmn71-testing; urgency=low + + * Fix #56: Gui will not be downloaded after cache partition was formatted (final attempt). + * Reverted commits for #54. + * Refactored gui_ctl. + + -- Thomas Schmitt Wed, 23 Feb 2022 16:22:00 +0100 + linuxmuster-linbo7 (4.0.10-0) lmn71-testing; urgency=low * Fix #56: Gui will not be downloaded after cache partition was formatted. diff --git a/linbofs/etc/linbo-version b/linbofs/etc/linbo-version index dc8f648..b9bca95 100644 --- a/linbofs/etc/linbo-version +++ b/linbofs/etc/linbo-version @@ -1 +1 @@ -LINBO 4.0.10-0: Subterranean Homesick Blues +LINBO 4.0.11-0: Subterranean Homesick Blues diff --git a/linbofs/init.sh b/linbofs/init.sh index beafbd6..82a961c 100755 --- a/linbofs/init.sh +++ b/linbofs/init.sh @@ -5,7 +5,7 @@ # License: GPL V2 # # thomas@linuxmuster.net -# 20220221 +# 20220223 # # If you don't have a "standalone shell" busybox, enable this: @@ -246,11 +246,6 @@ copytocache(){ echo "Saving start.conf in cache." cp -a /start.conf /cache fi - if [ -d /icons ]; then - echo "Saving icons in cache." - mkdir -p /cache/icons - rsync /icons/* /cache/icons - fi # save hostname for offline use if [ -s /tmp/network.ok ]; then source /tmp/network.ok @@ -626,14 +621,6 @@ network(){ # strip leading and trailing spaces and escapes export linbocmd="$(awk '{$1=$1}1' /linbocmd | sed -e 's|\\||g')" fi - # also look for other needed files - for i in "torrent-client.conf" "multicast.list"; do - rsync -L "$server::linbo/$i" "/$i" &> /dev/null - done - # and (optional) the GUI icons - for i in linbo_wallpaper.png $(grep -i ^iconname /start.conf | awk -F\= '{ print $2 }' | awk '{ print $1 }'); do - rsync -L "$server::linbo/icons/$i" /icons &> /dev/null - done # save downloaded stuff to cache copytocache fi diff --git a/linbofs/linbo.sh b/linbofs/linbo.sh index ae43b74..8c5c90a 100755 --- a/linbofs/linbo.sh +++ b/linbofs/linbo.sh @@ -26,6 +26,9 @@ if [ -x "/sbin/plymouthd" -a -n "$SPLASH" ]; then fi fi +# update & extract linbo_gui +linbo_update_gui + # DEBUG mode case "$CMDLINE" in *\ debug*) plymouth quit diff --git a/linbofs/usr/bin/linbo_cmd b/linbofs/usr/bin/linbo_cmd index 6aa91c3..1a9aba3 100755 --- a/linbofs/usr/bin/linbo_cmd +++ b/linbofs/usr/bin/linbo_cmd @@ -565,10 +565,12 @@ format(){ # install linbo and grub in cache local cachedev="$(cachedev)" if [ "$cachedev" = "$partition" ]; then + rm -f /tmp/.gui.done rm -f /tmp/.update.done rm -f /tmp/.grub-install rm -f /tmp/.prepare_grub update "$(serverip)" "$cachedev" + linbo_update_gui mk_boot if mountcache "$cachedev"; then echo "Saving start.conf in cache." @@ -887,6 +889,7 @@ partition(){ grep ^"$disk" "$table" | sort > "/tmp/$diskname" mk_parted "/tmp/$diskname" || RC="1" done + rm -f /tmp/.gui.done rm -f /tmp/.update.done rm -f /tmp/.grub-install rm -f /tmp/.prepare_grub @@ -2839,6 +2842,7 @@ syncr(){ [ "$RC" = "1" ] && return 1 # Also update LINBO, while we are here. update "$1" "$2" + linbo_update_gui fi shift syncl "$@" @@ -2929,8 +2933,18 @@ update(){ echo "LINBO is up-to-date." fi - # linbo_gui update - linbo_update_gui + # also look for other needed files + for i in "torrent-client.conf" "multicast.list"; do + echo "Downloading $i." + rsync -L "$server::linbo/$i" "/$i" &> /dev/null + done + + # GUI icons + for i in linbo_wallpaper.png $(grep -i ^iconname /start.conf | awk -F\= '{ print $2 }' | awk '{ print $1 }'); do + echo "Downloading $i." + rsync -L "$server::linbo/icons/$i" /icons &> /dev/null + done + rsync /icons/* /cache/icons # get ipxe files from server echo "Updating ipxe file." @@ -3073,10 +3087,10 @@ initcache(){ download_img_if_changed "$server" "$i" "$download_type" fi done - # obsolete, done in update() anyway - #sendlog - #cd / ; mountcache "$cachedev" -r + + # linbo & gui update update "$server" "$cachedev" + linbo_update_gui } ### Main ### diff --git a/linbofs/usr/bin/linbo_update_gui b/linbofs/usr/bin/linbo_update_gui index 2bc3f60..4570505 100755 --- a/linbofs/usr/bin/linbo_update_gui +++ b/linbofs/usr/bin/linbo_update_gui @@ -6,6 +6,10 @@ # 20220223 # +if [ -e /tmp/.gui.done ]; then + echo "linbo_gui is up-tp-date." + exit 0 +fi # is boot splash active? grep -qw splash /proc/cmdline && SPLASH="yes" @@ -42,6 +46,7 @@ if cat /proc/cmdline | grep -wq isoboot; then fi if [ -n "$isoboot" ]; then print_status "Successfully installed linbo_gui from removable media." | tee -a /cache/linbo.log + touch /tmp/.gui.done exit 0 fi done @@ -139,6 +144,7 @@ fi [ -z "$cache_mounted" ] && umount /cache if [ -s /usr/bin/linbo_gui ]; then print_status "Successfully installed linbo_gui from cache." + touch /tmp/.gui.done exit 0 else print_status "Failed to install linbo_gui from cache."