flasher: allow more customization in maker script
[pandora-misc.git] / flasher / doit.sh
index e73b7e8..0fd8c89 100755 (executable)
@@ -12,6 +12,7 @@ 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`
@@ -46,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
@@ -56,10 +61,13 @@ 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