From: Grazvydas Ignotas Date: Thu, 28 Mar 2013 21:47:22 +0000 (+0200) Subject: updater: update to SZ 1.54 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8f98d06ad424937adbe25f0b0db9649c75dd2b4d;p=pandora-misc.git updater: update to SZ 1.54 --- diff --git a/hotfix_updater/superzaxxon/PXML.xml b/hotfix_updater/superzaxxon/PXML.xml index 44459d2..ea52710 100644 --- a/hotfix_updater/superzaxxon/PXML.xml +++ b/hotfix_updater/superzaxxon/PXML.xml @@ -3,29 +3,29 @@ - Pandora SuperZaxxon updater + SuperZaxxon 1.54 offline updater - + - Pandora SuperZaxxon updater + SuperZaxxon 1.54 offline updater - Pandora SuperZaxxon updater + SuperZaxxon 1.54 offline updater - SuperZaxxon firmware updater. + Updates from SuperZaxxon 1.5x to SuperZaxxon 1.54 without need of Internet connection. - + diff --git a/hotfix_updater/superzaxxon/doit.sh b/hotfix_updater/superzaxxon/doit.sh new file mode 100755 index 0000000..8f44424 --- /dev/null +++ b/hotfix_updater/superzaxxon/doit.sh @@ -0,0 +1,53 @@ +#!/bin/sh -x + +set -e + +PND=updater.pnd + +if [ $USER != notaz ] +then + echo "you are not notaz" + exit 1 +fi + +rm -rf out $PND +mkdir out +mkdir out/feeds/ +mkdir out/feeds/armv7a/ +mkdir out/feeds/omap3-pandora/ +mkdir out/feeds/all/ + +cd out +# tar xvf $HOME/oe_rootfs_extra.tar.bz2 +cp ../in/* . +cp ../../oe_make_bootf/autoboot.txt . + +tpath=`pwd` + +cd $HOME/oe/tmp/angstrom.5/deploy/glibc/ipk/ +find . -name '*.ipk' \ + -newer $tpath/../tools/ref.ipk \! -name '*-dev_*' \! -name '*-dbg_*' \ + \! -name '*-doc_*' \! -name '*-static_*' \! -name 'libgles-omap3-*' \ + -exec cp -a {} $tpath/feeds/{} \; + +cd $tpath +set +x + +# clean unneeded ipks that are not in latest installed-packages.txt +listf=`find $HOME/oe/tmp/angstrom.5/deploy/glibc/images/omap3-pandora/ \ + -name installed-packages.txt | grep -v nowifi | sort | tail -n 1` +for f in feeds/armv7a/* feeds/omap3-pandora/* feeds/all/*; do + b=`basename $f` + bb=`echo $b | awk -F- '{print $1}'` + if ! grep -q "\<$bb\>" $listf; then + rm -f $f + fi +done + +set -x +cd $HOME/oe/tmp/angstrom.5/deploy/glibc/ipk/ + +find . -name 'Packages*' -exec cp -a {} $tpath/feeds/{} \; +cd $tpath + +../tools/pnd_make.sh -p ../$PND -d . -x PXML.xml -i updater.png -c diff --git a/hotfix_updater/superzaxxon/index.html b/hotfix_updater/superzaxxon/index.html index d6947a9..a8af1f3 100644 --- a/hotfix_updater/superzaxxon/index.html +++ b/hotfix_updater/superzaxxon/index.html @@ -1,113 +1,10 @@ - Updater for SuperZaxxon + Offline updater for SuperZaxxon -

Information

This file will update your Pandora OS. Simply run it as any normal PND. After installation, you can delete it.
This pack is intended for SuperZaxxon firmware line, it will not work properly if applied on older firmwares. - +

Information

This file will update your Pandora OS. Simply run it as any normal PND. After installation, you can delete it.
This pack is intended for SuperZaxxon firmware line, it will not work properly if applied on older firmwares.

+For more information, please visit OS section of OpenPandora Boards. diff --git a/hotfix_updater/superzaxxon/updater.sh b/hotfix_updater/superzaxxon/updater.sh index 9e72b9b..808e87e 100755 --- a/hotfix_updater/superzaxxon/updater.sh +++ b/hotfix_updater/superzaxxon/updater.sh @@ -1,29 +1,42 @@ #!/bin/sh logfile=/tmp/updater.log -oldkernel=/boot/uImage-3 -newkernel=boot/uImage-3 - -if ! grep -q '[[:blank:]]/[[:blank:]]*ubifs' /proc/mounts; then - # prefer alternative locations when running from SD - test -e /media/PANDORABOOT/uImage && oldkernel=/media/PANDORABOOT/uImage - test -e /media/PANDORABOOT/uImage-3 && oldkernel=/media/PANDORABOOT/uImage-3 - test -e /media/BOOT/uImage && oldkernel=/media/BOOT/uImage - test -e /media/BOOT/uImage-3 && oldkernel=/media/BOOT/uImage-3 -fi +oconffile=/tmp/updater.conf +kernel_path=/boot/uImage-3 +rootdir=`pwd` + +log() +{ + echo -en "\033[0;32m" + echo "$@" + echo -en "\033[0m" + + echo "$@" >> $logfile +} + +error() +{ + echo -en "\033[0;33m" + echo "$@" + echo -en "\033[0m" -if ! test -e $oldkernel; then + echo "$@" >> $logfile +} + +if ! test -e $kernel_path && ! test -e /lib/boot/uImage; then zenity --error --text "SuperZaxxon Final firmware required, sorry." exit 1 fi -if ! test -e $newkernel || ! test -d lib || ! test -d ipk; then +if ! test -e feeds/Packages; then zenity --error --text "Required files are missing, perhaps this .pnd got corrupted." exit 1 fi root_free=`df | grep '/$' | sed -e '2~1d' | awk '{print $4}'` -if [ "$root_free" -lt 2000 ]; then +root_need=20000 +if [ "$root_free" -lt $root_need ]; then + error "Only $(($root_free / 1024))MB available, need at least $(($root_need / 1024))MB" zenity --error --text "There is not enough space left in root partition. This usually means your NAND is almost full. @@ -36,111 +49,69 @@ if [ "`id -u`" != "0" ]; then exit 1 fi -get_ver() -{ - dd if=$1 bs=32 skip=1 count=1 2> /dev/null \ - | strings | sed -e 's/.*\([0-9]\.[0-9]\.[0-9]*\).*/\1/' -} - -get_vercode() -{ - ver1=`echo $1 | awk -F. '{printf $1}'` - ver2=`echo $1 | awk -F. '{printf $2}'` - ver3=`echo $1 | awk -F. '{printf $3}'` - echo $((($ver1 << 16) + ($ver2 << 8) + $ver3)) -} - -log() -{ - echo -en "\033[0;32m" - echo "$@" - echo -en "\033[0m" - - echo "$@" >> $logfile -} - +cd /tmp/ echo > $logfile -kernel_failed_detect=true -kernel_ask_newer=false -kernel_do_update=false -kernel_reboot_needed=false - -oldver=`get_ver $oldkernel` -newver=`get_ver $newkernel` -oldvcode=`get_vercode $oldver` -newvcode=`get_vercode $newver` - -# echo $oldver $newver $oldvcode $newvcode +# generate config +echo -n > $oconffile +for feed in all armv7a omap3-pandora; do + echo "src/gz pandora-${feed} file://$rootdir/feeds/${feed}" >> $oconffile +done -if [ -n "$oldver" -a -n "$newver" -a -n "$oldvcode" -a -n "$newvcode" ]; then - if [ "$oldvcode" -lt "$(((3 << 16) + (2 << 8) + 21))" ]; then - # a version before SZ-Final - zenity --error --text "SuperZaxxon Final firmware required, sorry." - exit 1 - fi +log "installing packages..." +kernelmd5_old=`md5sum $kernel_path` +rm -f /tmp/upgrade_ok - if [ "$oldvcode" -eq "$newvcode" ]; then - oldtime=`stat -c %Y $oldkernel` - newtime=`stat -c %Y $newkernel` - if [ "$oldtime" -gt "$newtime" ]; then - kernel_ask_newer=true - else - kernel_failed_detect=false - kernel_do_update=true - fi - elif [ "$oldvcode" -gt "$newvcode" ]; then - kernel_ask_newer=true - else - kernel_failed_detect=false - kernel_do_update=true - fi +# check for old feeds config, if it's old try to fix up with feed package +if cat /etc/opkg/*.conf | awk -F# '{printf $1}' | grep -q www.angstrom-distribution.org; then + opkg install $rootdir/feeds/omap3-pandora/angstrom-feed-configs* fi -if $kernel_ask_newer; then - if zenity --question --text "It seems you have newer kernel already installed, -overwrite it?"; then - kernel_do_update=true - fi -elif $kernel_failed_detect; then - if zenity --question --text "Could not determine what kernel is installed on your system, -so have to ask, do you want to overwrite your current kernel?"; then - kernel_do_update=true - fi -fi +# - must start with pandora-scripts, as some files were moved out of it to separate +# packages, installing those first results in dupe file errors. +# - have to run upgrade twice because of other dupe errors (only resolved on later updates) +# - tee doesn't properly exit without kill (hangs), no idea why.. +( set -e + opkg -f $oconffile update 2>&1 + echo "Checking for updated packages (above errors can be ignored)..." + opkg -f $oconffile install pandora-scripts 2>&1 + echo "Checking for updated packages (above errors can be ignored)..." + opkg -f $oconffile upgrade 2>&1 + echo "Checking for updated packages (above errors can be ignored)..." + opkg -f $oconffile upgrade 2>&1 + touch /tmp/upgrade_ok + sync; killall -PIPE tee ) | tee -a $logfile -if $kernel_do_update; then - if ! cmp $newkernel $oldkernel > /dev/null; then - log "updating kernel at $oldkernel from $oldver to $newver ..." - cp -a $newkernel $oldkernel - sync - kernel_reboot_needed=true - fi +# since uninstall script of gtk-touchscreen-mode-enable is broken, edit this out manually +sudo sed -i -e 's/^\(gtk-touchscreen-mode = 1\)/#\1/' /etc/gtk-2.0/gtkrc - log "updating modules for $newver ..." - if [ -n "$oldver" -a -d "/lib/modules/$oldver" ]; then - rm -rf /lib/modules/$oldver - fi - cp -a lib / - sync - if ! $kernel_reboot_needed; then - # we can depmod now - depmod -a - sync - fi +kernelmd5_new=`md5sum $kernel_path` + +# fixup autoboot.txt, if needed +if [ "$kernelmd5_old" != "$kernelmd5_new" ] \ + && grep -q '/lib/boot/uImage' /boot/autoboot.txt 2> /dev/null +then + cp $rootdir/autoboot.txt /boot/autoboot.txt + cd /boot/ + ln -fs uImage-3 uImage + cd - fi -log "installing packages..." -opkg install ipk/* | tee -a $logfile sync -# since uninstall script of gtk-touchscreen-mode-enable is broken, edit this out manually -sudo sed -i -e 's/^\(gtk-touchscreen-mode = 1\)/#\1/' /etc/gtk-2.0/gtkrc - -log "all done. You can find logfile at $logfile" -if $kernel_reboot_needed; then - zenity --question --text "Reboot required to start the new kernel. -Reboot now?" && reboot +if test -e /tmp/upgrade_ok; then + rm -f /tmp/upgrade_ok + log "All done. You can find logfile at $logfile" + 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 + else + zenity --info --text "Update complete." + fi else - zenity --info --text "Update complete." + error "Errors detected. You can find logfile at $logfile" + zenity --error --title="Errors detected" \ + --text "Errors detected.\n\nSome errors can be resolved by re-running the update." fi