From: Grazvydas Ignotas Date: Sat, 16 Mar 2013 15:49:40 +0000 (+0200) Subject: op_osupgrade: ask for reboot after kernel change X-Git-Tag: sz_154~34 X-Git-Url: https://git.openpandora.org/cgi-bin/gitweb.cgi?p=openpandora.oe.git;a=commitdiff_plain;h=ea5ac8b5276511d251908fbf84d73bae7b2ea63b;hp=9294f09df8bc070057bdc97c4c483019708df7ae op_osupgrade: ask for reboot after kernel change --- diff --git a/recipes/pandora-system/pandora-scripts.bb b/recipes/pandora-system/pandora-scripts.bb index ca552b9..da824ae 100644 --- a/recipes/pandora-system/pandora-scripts.bb +++ b/recipes/pandora-system/pandora-scripts.bb @@ -6,7 +6,7 @@ COMPATIBLE_MACHINE = "omap3-pandora" DEPENDS = "zenity dbus" RDEPENDS = "zenity dbus" -PR = "r135" +PR = "r136" SRC_URI = " \ file://op_paths.sh \ diff --git a/recipes/pandora-system/pandora-scripts/op_osupgrade.sh b/recipes/pandora-system/pandora-scripts/op_osupgrade.sh index 3c9475d..14cc71f 100644 --- a/recipes/pandora-system/pandora-scripts/op_osupgrade.sh +++ b/recipes/pandora-system/pandora-scripts/op_osupgrade.sh @@ -1,4 +1,6 @@ #!/bin/sh +kernel_path="/boot/uImage-3" + zenity --question --title="Update Firmware OS" --text="This little tool helps you to keep your firmware OS up-to-date with the latest tweaks.\n\nPlease note that this is in TESTING state and\nmight break parts of your system with unstable packages!\n\nMake sure your Pandora is connected to the internet and click the Upgrade-Button.\n\n" --ok-label="Upgrade OS" --cancel-label="Quit" || exit 0 # check free space @@ -20,6 +22,8 @@ Aborting." exit 1 fi +kernelmd5_old=`md5sum $kernel_path` + terminal -x bash -c \ 'echo "Updating package lists..." && \ opkg update 2>&1 | tee /tmp/upgrade.log && test ${PIPESTATUS[0]} -eq 0 && \ @@ -27,11 +31,21 @@ terminal -x bash -c \ opkg upgrade 2>&1 | tee -a /tmp/upgrade.log && test ${PIPESTATUS[0]} -eq 0 && \ touch /tmp/upgrade_ok || sleep 3' +sync + +kernelmd5_new=`md5sum $kernel_path` + if test -e /tmp/upgrade_ok; then + rm -f /tmp/upgrade_ok zenity --info --title="Upgrade complete" \ --text "All operations have been finished.\n\nYou can find a logfile at /tmp/upgrade.log" + if [ "$kernelmd5_old" != "$kernelmd5_new" ]; then + zenity --question --title="Kernel updated" \ + --text "The kernel has been updated,\nreboot is needed to start it.\n\nReboot now?" \ + --ok-label="Yes" --cancel-label="No, do it later" \ + && reboot + fi else zenity --error --title="Errors detected" \ --text "Errors detected during update.\n\nYou can find a logfile at /tmp/upgrade.log" fi -rm -f /tmp/upgrade_ok