2 kernel_path="/boot/uImage-3"
4 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
7 root_free=`df | grep '/$' | sed -e '2~1d' | awk '{print $4}'`
8 if [ "$root_free" -lt 20000 ]; then
9 zenity --error --text "There is not enough free space left in root partition
10 (at least 20MB is required).
11 This usually means your NAND is almost full.
13 Delete some files and try again. Alternatively you can do a full reflash."
17 # check for default angstrom feeds
18 if cat /etc/opkg/*.conf | awk -F# '{printf $1}' | grep -q www.angstrom-distribution.org; then
19 zenity --error --text "There seem to be Angstrom feeds in your opkg configs, \
20 upgraging from them is known to make the system unbootable.
25 kernelmd5_old=`md5sum $kernel_path`
28 'echo "Updating package lists..." && \
29 opkg update 2>&1 | tee /tmp/upgrade.log && test ${PIPESTATUS[0]} -eq 0 && \
30 echo "Checking for updated packages..." && \
31 opkg upgrade 2>&1 | tee -a /tmp/upgrade.log && test ${PIPESTATUS[0]} -eq 0 && \
32 touch /tmp/upgrade_ok || sleep 3'
36 kernelmd5_new=`md5sum $kernel_path`
38 if test -e /tmp/upgrade_ok; then
40 zenity --info --title="Upgrade complete" \
41 --text "All operations have been finished.\n\nYou can find a logfile at /tmp/upgrade.log"
42 if [ "$kernelmd5_old" != "$kernelmd5_new" ]; then
43 zenity --question --title="Kernel updated" \
44 --text "The kernel has been updated,\nreboot is needed to start it.\n\nReboot now?" \
45 --ok-label="Yes" --cancel-label="No, do it later" \
49 zenity --error --title="Errors detected" \
50 --text "Errors detected during update.\n\nYou can find a logfile at /tmp/upgrade.log"