X-Git-Url: https://git.openpandora.org/cgi-bin/gitweb.cgi?p=pandora-misc.git;a=blobdiff_plain;f=flasher%2Fdoit.sh;h=0fd8c89cdaf975289c388c26ef11f277558442b4;hp=a45cc95d61799247d1b19f25eeb9fe3cd3443fe9;hb=578e53a80afeff738509b61bbc75ded86fe5c260;hpb=09910da9d0cc61e6e7a4f7c078087896d7779557 diff --git a/flasher/doit.sh b/flasher/doit.sh index a45cc95..0fd8c89 100755 --- a/flasher/doit.sh +++ b/flasher/doit.sh @@ -9,11 +9,14 @@ out_dir="out/" out_opt_dir="out_opt/" sysf_in="in/" rd_input="rootfs" +bootf="bootf.tgz" rdfile=`mktemp` rdfile_out="tmp/rd-ext2.bin" +uboot_script=${uboot_script:-"script.txt"} boot_scr_tmp=`mktemp` boot_scr_tmp2=`mktemp` boot_scr_tmp_scr=`mktemp` +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 \ @@ -32,11 +35,11 @@ cp ${sysf_in}x-load.bin.ift ${out_opt_dir}MLO cp ${sysf_in}u-boot.bin_updater ${out_opt_dir}u-boot.bin -# sysf.tgz +# bootf.tgz cd $sysf_in -tar czvf sysf.tgz u-boot.bin uImage +tar czvf $bootf u-boot.bin uImage cd .. -mv -f ${sysf_in}sysf.tgz ${out_dir} +mv -f ${sysf_in}${bootf} ${out_dir} # rootfs @@ -44,6 +47,10 @@ dd if=/dev/zero of=$rdfile bs=1M count=8 mkfs.ext2 -F $rdfile sudo mount -o loop $rdfile /mnt/tmp sudo cp -r $rd_input/* /mnt/tmp/ +if [ -n "$more_rootfs_work" ] +then + $more_rootfs_work +fi sudo umount /mnt/tmp cat $rdfile | gzip -9 > $rdfile_out rm $rdfile @@ -54,22 +61,24 @@ dd if=/dev/zero of=$boot_scr_tmp_scr bs=1 count=4020 dd if=/dev/zero of=$boot_scr_tmp bs=4K count=800 # 000000 - 000fff: u-boot header, the script -dd if=script.txt of=$boot_scr_tmp_scr conv=notrunc bs=1 +dd if=$uboot_script of=$boot_scr_tmp_scr conv=notrunc bs=1 # 001000 - 020fff: x-load -dd if=$rd_input/usr/local/erasednandblk of=$boot_scr_tmp conv=notrunc bs=4K -dd if=${sysf_in}x-load.bin.ift of=$boot_scr_tmp conv=notrunc bs=4K +if [ "$no_xload" != "yes" ] +then + dd if=$rd_input/usr/local/erasednandblk of=$boot_scr_tmp conv=notrunc bs=4K + dd if=${sysf_in}x-load.bin.ift of=$boot_scr_tmp conv=notrunc bs=4K +fi # 021000 - 320fff: uImage dd if=${sysf_in}uImage_updater of=$boot_scr_tmp conv=notrunc bs=4K seek=32 # 321000 - end: ramdisk cat $boot_scr_tmp $rdfile_out > $boot_scr_tmp2 # adjust for u-boot header -#dd if=$boot_scr_tmp2 of=$boot_scr_tmp bs=72 skip=1 -tmp/mkimage -A arm -O linux -T script -C none -a 0 -e 0 -n "script" \ +$mkimage -A arm -O linux -T script -C none -a 0 -e 0 -n "script" \ -d $boot_scr_tmp_scr:$boot_scr_tmp2 ${out_dir}boot.scr rm $boot_scr_tmp $boot_scr_tmp2 $boot_scr_tmp_scr # release zip cd ${out_dir} -zip -9 $zipfile sysf.tgz boot.scr +zip -9 $zipfile $bootf boot.scr mv -f $zipfile ../tmp/ cd ..