2 work_script_path="/usr/pandora/scripts/op_osupgrade_work.sh"
3 kernel_path="/boot/uImage-3"
5 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
8 root_free=`df | grep '/$' | sed -e '2~1d' | awk '{print $4}'`
9 if [ "$root_free" -lt 20000 ]; then
10 zenity --error --text "There is not enough free space left in root partition
11 (at least 20MB is required).
12 This usually means your NAND is almost full.
14 Delete some files and try again. Alternatively you can do a full reflash."
18 # check for default angstrom feeds
19 if cat /etc/opkg/*.conf | awk -F# '{printf $1}' | grep -q www.angstrom-distribution.org; then
20 zenity --error --text "There seem to be Angstrom feeds in your opkg configs, \
21 upgraging from them is known to make the system unbootable.
26 rm -f /tmp/upgrade_ok /tmp/upgrade_script_updated
27 kernelmd5_old=`md5sum $kernel_path`
29 # reminder: don't use '&&' '||' ... after tee, it breaks set -e, no idea why
31 "( $work_script_path || ( echo && echo "Retrying.." && $work_script_path ) ) 2>&1 \
32 | tee /tmp/upgrade.log; \
33 test -e /tmp/upgrade_ok || sleep 3"
35 kernelmd5_new=`md5sum $kernel_path`
37 if test -e /tmp/upgrade_ok; then
39 zenity --info --title="Upgrade complete" \
40 --text "All operations have been finished.\n\nYou can find a log file at /tmp/upgrade.log"
41 if [ "$kernelmd5_old" != "$kernelmd5_new" ]; then
42 zenity --question --title="Kernel updated" \
43 --text "The kernel has been updated,\nreboot is needed to start it.\n\nReboot now?" \
44 --ok-label="Yes" --cancel-label="No, do it later" \
48 zenity --error --title="Errors detected" \
49 --text "Errors detected during update. Please check your Internet connection and try again.
51 If long update process was interrupted, it is recommended to run the update again before a reboot.
53 You can find a log file at /tmp/upgrade.log"