appended to u-boot.bin at 0x40000. NOLO will load the entire image into
(random) memory and execute u-boot, which saves hw revision, boot reason
and boot mode ATAGs set by NOLO. Then the bootscripts will attempt to load
-uImage or boot.scr from a fat, ext2/ext3 or ext4 filesystem in external
+uImage, zImage or boot.scr from a fat or ext2/3/4 filesystem on external
SD card or internal eMMC memory. If this fails or keyboard is closed then
the appended kernel image will be booted using some generated and some
stored ATAGs (see boot order).
-For generating combined image of u-boot and kernel there is a simple script
-called u-boot-gen-combined. It is available in following repository:
+For generating combined image of u-boot and kernel (either in uImage or zImage
+format) there is a simple script called u-boot-gen-combined. It is available in
+following repository:
https://github.com/pali/u-boot-maemo
* 1.
* 1.1 find boot.scr on first fat partition
* 1.2 find uImage on first fat partition
- * 1.3 same order for 2. - 4. fat partition
+ * 1.3 find zImage on first fat partition
+ * 1.4 same order for 2. - 4. fat partition
* 2. same as 1. but for ext2/3 partition
* 3. same as 1. but for ext4 partition
"scriptboot=echo Running ${mmcscriptfile} from mmc " \
"${mmcnum}:${mmcpart} ...; source ${scriptaddr}\0" \
"kernboot=echo Booting ${mmckernfile} from mmc " \
- "${mmcnum}:${mmcpart} ...; bootm ${kernaddr}\0" \
+ "${mmcnum}:${mmcpart} ...; bootm ${kernaddr} || " \
+ "bootz ${kernaddr}\0" \
"kerninitrdboot=echo Booting ${mmckernfile} ${mmcinitrdfile} from mmc "\
- "${mmcnum}:${mmcpart} ...; bootm ${kernaddr} ${initrdaddr}\0" \
+ "${mmcnum}:${mmcpart} ...; bootm ${kernaddr} ${initrdaddr} || " \
+ "bootz ${kernaddr} ${initrdaddr}\0" \
"attachboot=echo Booting attached kernel image ...;" \
"setenv setup_omap_atag 1;" \
- "bootm ${attkernaddr};" \
+ "bootm ${attkernaddr} || bootz ${attkernaddr};" \
"setenv setup_omap_atag\0" \
"trymmcscriptboot=if run switchmmc; then " \
"if run scriptload; then " \
"fi; " \
"fi\0" \
"trymmcpartboot=setenv mmcscriptfile boot.scr; run trymmcscriptboot;" \
- "setenv mmckernfile uImage; run trymmckernboot\0" \
+ "setenv mmckernfile uImage; run trymmckernboot;" \
+ "setenv mmckernfile zImage; run trymmckernboot\0" \
"trymmcallpartboot=setenv mmcpart 1; run trymmcpartboot;" \
"setenv mmcpart 2; run trymmcpartboot;" \
"setenv mmcpart 3; run trymmcpartboot;" \
EOF
./mkimage -A arm -O linux -T script -C none -a 0 -e 0 -n bootmenu_uboot -d bootmenu_uboot bootmenu_uboot.scr
-# Generate bootmenu for eMMC booting
+# Generate bootmenu for eMMC booting (uImage)
cat > bootmenu_emmc << EOF
setenv bootmenu_0 'uImage-2.6.28-omap1 from eMMC=setenv mmcnum 1; setenv mmcpart 1; setenv mmctype fat; setenv bootargs; setenv setup_omap_atag 1; setenv mmckernfile uImage-2.6.28-omap1; run trymmckernboot';
setenv bootmenu_1;
EOF
./mkimage -A arm -O linux -T script -C none -a 0 -e 0 -n bootmenu_emmc -d bootmenu_emmc bootmenu_emmc.scr
+# Generate bootmenu for eMMC booting (zImage)
+cat > bootmenu_emmc2 << EOF
+setenv bootmenu_0 'zImage-2.6.28-omap1 from eMMC=setenv mmcnum 1; setenv mmcpart 1; setenv mmctype fat; setenv bootargs; setenv setup_omap_atag 1; setenv mmckernfile zImage-2.6.28-omap1; run trymmckernboot';
+setenv bootmenu_1;
+setenv bootmenu_delay 1;
+setenv bootdelay 1;
+EOF
+./mkimage -A arm -O linux -T script -C none -a 0 -e 0 -n bootmenu_emmc2 -d bootmenu_emmc2 bootmenu_emmc2.scr
+
# Generate bootmenu for OneNAND booting
cat > bootmenu_nand << EOF
setenv bootmenu_0 'uImage-2.6.28-omap1 from OneNAND=mtd read initfs \${kernaddr}; setenv bootargs; setenv setup_omap_atag 1; bootm \${kernaddr}';
EOF
./mkimage -A arm -O linux -T script -C none -a 0 -e 0 -n bootmenu_nand -d bootmenu_nand bootmenu_nand.scr
+# Generate bootmenu for default booting
+cat > bootmenu_default << EOF
+setenv bootmenu_delay 1;
+setenv bootdelay 1;
+EOF
+./mkimage -A arm -O linux -T script -C none -a 0 -e 0 -n bootmenu_default -d bootmenu_default bootmenu_default.scr
+
# Generate combined image from u-boot and Maemo fiasco kernel
dd if=kernel_2.6.28/boot/zImage-2.6.28-20103103+0m5.fiasco of=zImage-2.6.28-omap1 skip=95 bs=1
+./u-boot-gen-combined u-boot.bin zImage-2.6.28-omap1 combined_zimage.bin
./mkimage -A arm -O linux -T kernel -C none -a 80008000 -e 80008000 -n zImage-2.6.28-omap1 -d zImage-2.6.28-omap1 uImage-2.6.28-omap1
-./u-boot-gen-combined u-boot.bin uImage-2.6.28-omap1 combined.bin
+./u-boot-gen-combined u-boot.bin uImage-2.6.28-omap1 combined_uimage.bin
# Generate combined hack image from u-boot and Maemo fiasco kernel (kernel starts at 2MB offset and qflasher puts 2kB header before supplied image)
cp u-boot.bin combined_hack.bin
mformat -m 0xf8 -F -h 4 -s 16 -c 1 -t $((50*1024*1024/(4*16*512))) :: -i emmc_uboot.img
mcopy bootmenu_uboot.scr ::/bootmenu.scr -i emmc_uboot.img
-# Generate FAT32 eMMC image for eMMC booting
+# Generate FAT32 eMMC image for eMMC booting (uImage)
truncate -s 50MiB emmc_emmc.img
mformat -m 0xf8 -F -h 4 -s 16 -c 1 -t $((50*1024*1024/(4*16*512))) :: -i emmc_emmc.img
mcopy uImage-2.6.28-omap1 ::/uImage-2.6.28-omap1 -i emmc_emmc.img
mcopy bootmenu_emmc.scr ::/bootmenu.scr -i emmc_emmc.img
+# Generate FAT32 eMMC image for eMMC booting (zImage)
+truncate -s 50MiB emmc_emmc2.img
+mformat -m 0xf8 -F -h 4 -s 16 -c 1 -t $((50*1024*1024/(4*16*512))) :: -i emmc_emmc2.img
+mcopy zImage-2.6.28-omap1 ::/zImage-2.6.28-omap1 -i emmc_emmc2.img
+mcopy bootmenu_emmc2.scr ::/bootmenu.scr -i emmc_emmc2.img
+
# Generate FAT32 eMMC image for OneNAND booting
truncate -s 50MiB emmc_nand.img
mformat -m 0xf8 -F -h 4 -s 16 -c 1 -t $((50*1024*1024/(4*16*512))) :: -i emmc_nand.img
mcopy bootmenu_nand.scr ::/bootmenu.scr -i emmc_nand.img
+# Generate FAT32 eMMC image for default booting
+truncate -s 50MiB emmc_default.img
+mformat -m 0xf8 -F -h 4 -s 16 -c 1 -t $((50*1024*1024/(4*16*512))) :: -i emmc_default.img
+mcopy bootmenu_default.scr ::/bootmenu.scr -i emmc_default.img
+
# Generate MTD image for U-Boot serial console testing
rm -f mtd_uboot.img
./qflasher -v -x xloader-qemu.bin -s secondary-qemu.bin -k u-boot.bin -m rx51 -o mtd_uboot.img
# Generate MTD image for RAM booting from bootloader nolo images, compiled image and rootfs image
rm -f mtd_ram.img
-./qflasher -v -x xloader-qemu.bin -s secondary-qemu.bin -k combined.bin -r ubi.img -m rx51 -o mtd_ram.img
+./qflasher -v -x xloader-qemu.bin -s secondary-qemu.bin -k combined_uimage.bin -r ubi.img -m rx51 -o mtd_ram.img
+rm -f mtd_ram2.img
+./qflasher -v -x xloader-qemu.bin -s secondary-qemu.bin -k combined_zimage.bin -r ubi.img -m rx51 -o mtd_ram2.img
# Generate MTD image for eMMC booting from bootloader nolo images, u-boot image and rootfs image
rm -f mtd_emmc.img
kill -9 $tail_pid $sleep_pid $qemu_pid 2>/dev/null || true
wait || true
-# Run MTD image in qemu and wait for 300s if kernel from RAM is correctly booted
+# Run MTD image in qemu and wait for 300s if uImage kernel from RAM is correctly booted
rm -f qemu_ram.log
./qemu-system-arm -M n900 -mtdblock mtd_ram.img -serial /dev/stdout -display none > qemu_ram.log &
qemu_pid=$!
kill -9 $tail_pid $sleep_pid $qemu_pid 2>/dev/null || true
wait || true
-# Run MTD image in qemu and wait for 300s if kernel from eMMC is correctly booted
+# Run MTD image in qemu and wait for 300s if zImage kernel from RAM is correctly booted
+rm -f qemu_ram2.log
+./qemu-system-arm -M n900 -mtdblock mtd_ram2.img -sd emmc_default.img -serial /dev/stdout -display none > qemu_ram2.log &
+qemu_pid=$!
+tail -F qemu_ram2.log &
+tail_pid=$!
+sleep 300 &
+sleep_pid=$!
+wait -n $sleep_pid $qemu_pid || true
+kill -9 $tail_pid $sleep_pid $qemu_pid 2>/dev/null || true
+wait || true
+
+# Run MTD image in qemu and wait for 300s if uImage kernel from eMMC is correctly booted
rm -f qemu_emmc.log
./qemu-system-arm -M n900 -mtdblock mtd_emmc.img -sd emmc_emmc.img -serial /dev/stdout -display none > qemu_emmc.log &
qemu_pid=$!
kill -9 $tail_pid $sleep_pid $qemu_pid 2>/dev/null || true
wait || true
+# Run MTD image in qemu and wait for 300s if zImage kernel from eMMC is correctly booted
+rm -f qemu_emmc2.log
+./qemu-system-arm -M n900 -mtdblock mtd_emmc.img -sd emmc_emmc2.img -serial /dev/stdout -display none > qemu_emmc2.log &
+qemu_pid=$!
+tail -F qemu_emmc2.log &
+tail_pid=$!
+sleep 300 &
+sleep_pid=$!
+wait -n $sleep_pid $qemu_pid || true
+kill -9 $tail_pid $sleep_pid $qemu_pid 2>/dev/null || true
+wait || true
+
# Run MTD image in qemu and wait for 300s if kernel from OneNAND is correctly booted
rm -f qemu_nand.log
./qemu-system-arm -M n900 -mtdblock mtd_nand.img -sd emmc_nand.img -serial /dev/stdout -display none > qemu_nand.log &
echo
if grep -q 'Successfully booted' qemu_uboot.log; then echo "U-Boot serial console is working"; else echo "U-Boot serial console test failed"; fi
-if grep -q 'Successfully booted' qemu_ram.log; then echo "Kernel was successfully booted from RAM"; else echo "Failed to boot kernel from RAM"; fi
-if grep -q 'Successfully booted' qemu_emmc.log; then echo "Kernel was successfully booted from eMMC"; else echo "Failed to boot kernel from eMMC"; fi
-if grep -q 'Successfully booted' qemu_nand.log; then echo "Kernel was successfully booted from OneNAND"; else echo "Failed to boot kernel from OneNAND"; fi
+if grep -q 'Successfully booted' qemu_ram.log; then echo "Kernel (uImage) was successfully booted from RAM"; else echo "Failed to boot kernel (uImage) from RAM"; fi
+if grep -q 'Successfully booted' qemu_ram2.log; then echo "Kernel (zImage) was successfully booted from RAM"; else echo "Failed to boot kernel (zImage) from RAM"; fi
+if grep -q 'Successfully booted' qemu_emmc.log; then echo "Kernel (uImage) was successfully booted from eMMC"; else echo "Failed to boot kernel (uImage) from eMMC"; fi
+if grep -q 'Successfully booted' qemu_emmc2.log; then echo "Kernel (zImage) was successfully booted from eMMC"; else echo "Failed to boot kernel (zImage) from eMMC"; fi
+if grep -q 'Successfully booted' qemu_nand.log; then echo "Kernel (uImage) was successfully booted from OneNAND"; else echo "Failed to boot kernel (uImage) from OneNAND"; fi
echo
-if grep -q 'Successfully booted' qemu_uboot.log && grep -q 'Successfully booted' qemu_ram.log && grep -q 'Successfully booted' qemu_emmc.log && grep -q 'Successfully booted' qemu_nand.log; then
+if grep -q 'Successfully booted' qemu_uboot.log && grep -q 'Successfully booted' qemu_ram.log && grep -q 'Successfully booted' qemu_ram2.log && grep -q 'Successfully booted' qemu_emmc.log && grep -q 'Successfully booted' qemu_emmc2.log && grep -q 'Successfully booted' qemu_nand.log; then
echo "All tests passed"
exit 0
else