From: Grazvydas Ignotas Date: Tue, 9 Oct 2012 17:08:58 +0000 (+0300) Subject: flasher: revise autoboot handling X-Git-Tag: sz_152~2 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9ae7849857e7ab35895467e275e1c24fcb47c712;p=pandora-misc.git flasher: revise autoboot handling --- diff --git a/flasher/doit.sh b/flasher/doit.sh index 0fd8c89..14c1024 100755 --- a/flasher/doit.sh +++ b/flasher/doit.sh @@ -20,7 +20,7 @@ mkimage="tmp/mkimage" zipfile="pandora_flasher_v.zip" if test '!' '(' -d $rd_input -a -f ${sysf_in}x-load.bin.ift -a -f ${sysf_in}u-boot.bin \ - -a -f ${sysf_in}uImage -a -f ${sysf_in}uImage_updater ')' + -a -f ${sysf_in}uImage -a -f ${sysf_in}uImage_updater -a -f ${sysf_in}bootmenu.txt ')' then echo "missing input files" exit 1 @@ -37,7 +37,9 @@ cp ${sysf_in}u-boot.bin_updater ${out_opt_dir}u-boot.bin # bootf.tgz cd $sysf_in -tar czvf $bootf u-boot.bin uImage +bootf_files=`echo u-boot.bin uImage uImage-* bootmenu.txt` +test -e autoboot.txt && bootf_files="$bootf_files autoboot.txt" +tar czvf $bootf $bootf_files cd .. mv -f ${sysf_in}${bootf} ${out_dir} diff --git a/flasher/rootfs/etc/updater.sh b/flasher/rootfs/etc/updater.sh index 202f045..124c283 100755 --- a/flasher/rootfs/etc/updater.sh +++ b/flasher/rootfs/etc/updater.sh @@ -25,19 +25,6 @@ cleanup() fi } -wait_for_file() -{ - for a in `seq 10` - do - if test -e "$1" - then - return 0 - fi - sleep .5 - done - return 1 -} - mkdir /mnt/ubifs 2> /dev/null || true @@ -155,10 +142,6 @@ handle_kernels() return 0 fi - # presence of uImage* is a sign that we can wipe whole boot partition, - # but first get rid of potentially bad autoboot.txt - rm -f /mnt/ubifs/autoboot.txt - for kernel in $kernels do if ! cmp $kernel /mnt/ubifs/$kernel 2> /dev/null @@ -180,6 +163,17 @@ handle_kernels() cp -a bootmenu.txt /mnt/ubifs/bootmenu.txt || return 1 fi fi + if [ -e autoboot.txt ] + then + if ! cmp autoboot.txt /mnt/ubifs/autoboot.txt 2> /dev/null + then + log "updating autoboot.txt" + cp -a autoboot.txt /mnt/ubifs/autoboot.txt || return 1 + fi + else + # get rid of potentially bad autoboot.txt + rm -f /mnt/ubifs/autoboot.txt + fi } ubiattach /dev/ubi_ctrl -m 3 || true diff --git a/flasher/rootfs/etc/updater_funcs.sh b/flasher/rootfs/etc/updater_funcs.sh index ab2c3a3..551b8bf 100644 --- a/flasher/rootfs/etc/updater_funcs.sh +++ b/flasher/rootfs/etc/updater_funcs.sh @@ -18,3 +18,16 @@ log_err() echo -en "\033[0m" > $LOG_DEVICE } +wait_for_file() +{ + for a in `seq 10` + do + if test -e "$1" + then + return 0 + fi + sleep .5 + done + return 1 +} +