Boot OpenWrt

On OpenWrt wiki a guide explain how to boot the DockStar with this embedded distribution. But that is not what I expected.

In fact, OpenWrt need a “2nd stage bootloader” to boot and thus slow down the boot process. U-Boot on DockStar has the features to directly boot on other devices (SD-Card, USB) if they are compiled with.

By default, U-boot do not permit to do it but Jeff Doozan integrated this in the bootloader.

U-Boot

I downloaded and installed this “new” U-Boot in the DockStar. But, I change some environnement values as Jeff Doozan boot by default on Debian, his default configuration reflecting his choice. I have cleaned part of the configuration to rewrite the configuration below:

printenv
ethact=egiga0
baudrate=115200
mainlineLinux=yes
console=ttyS0,115200
led_init=green blinking
led_exit=green off
led_error=orange blinking
mtdids=nand0=orion_nand
partition=nand0,2
usb_scan=usb_scan_done=0;for scan in $usb_scan_list; do run usb_scan_$scan; if test $usb_scan_done -eq 0 && ext2load usb $usb 0x800000 /boot/uImage 1; then usb_scan_done=1; echo "Found bootable drive on usb $usb"; setenv usb_device $usb; setenv usb_root /dev/$dev; fi; done
usb_scan_list=1 2 3 4
usb_scan_1=usb=0:1 dev=sda1
usb_scan_2=usb=1:1 dev=sdb1
usb_scan_3=usb=2:1 dev=sdc1
usb_scan_4=usb=3:1 dev=sdd1
usb_init=run usb_scan
usb_rootdelay=10
usb_bootcmd=run usb_init; run usb_set_bootargs; run usb_boot
usb_boot=mw 0x800000 0 1; ext2load usb $usb_device 0x800000 /boot/uImage; if ext2load usb $usb_device 0x1100000 /boot/uInitrd; then bootm 0x800000 0x1100000; else bootm 0x800000; fi
fileaddr=800000
mtdparts=mtdparts=orion_nand:1M(u-boot),4M@1M(uImage),10M@5M(rootfs),-(rootfs_data)
ethaddr=XX:XX:XX:XX:XX:XX
arcNumber=2998
bootcmd=usb start; run usb_bootcmd; usb stop; run openwrt_bootcmd; reset
filesize=1
usb_device=0:1
usb_root=/dev/sda1
openwrt_root=/dev/mtdblock2 ro
openwrt_rootfstype=jffs2
openwrt_set_bootargs=setenv bootargs console=$console root=$openwrt_root rootfstype=$openwrt_rootfstype $mtdparts $openwrt_custom_params
openwrt_boot=nand read.e 0x6400000 0x100000 0x400000; bootm 0x6400000
openwrt_bootcmd=run openwrt_set_bootargs; run openwrt_boot
usb_rootfstype=ext2
usb_set_bootargs=setenv bootargs console=$console root=$usb_root rootdelay=$usb_rootdelay rootfstype=$usb_rootfstype $usb_custom_params
ipaddr=192.168.1.2
serverip=192.168.1.11
if_netconsole=ping $serverip
start_netconsole=setenv ncip $serverip; setenv bootdelay 10; setenv stdin nc; setenv stdout nc; setenv stderr nc; version;
ncip=192.168.1.11
bootdelay=10
stdin=serial
stdout=serial
stderr=serial

Environment size: 1872/131068 bytes
Marvell>> 

This configuration allow to boot on a USB stick partitionned as below:

Device Flash USB USB
Partition mtd0 sda1 sda2
Size 1Mo - 256Mo
Content u-boot uImage+rootfs+data swap
File System ? ext2 swap

I have hesitated a long time to have a specific partition for uImage but it has been too restrictiv. I have preferred everything on one unique partition.

Later I will try to boot on a SD-Card and gain one more USB port but I have to realise the electronic part, Ajout SD-Card