DreamPlug

Disk partitions
The existing disk partitions are as follows:


 * /dev/sda is the internal SD card and separated so sda1 is a ~100 MiB FAT16 partition with kernel uImages and sda2 is a ~4 GiB ext3 partition carrying the stock (in my case Debian) OS.
 * /dev/sdb seems to be the external SD card slot (I don’t use it)
 * /dev/sdc is the first external disk via USB or eSATA
 * …the rest follows in the same logic.

U-boot
A clean u-boot environment that first boots from the external USB and has an option to boot from the internal SD (check yours with printenv).

To swich just change the bootcmd to include either gentoo_bootcmd (for USB) or stock_bootcmd (for internal SD).

bootdelay=3 baudrate=115200 ethact=egiga0 ethaddr=F0:AD:4E:00:B0:8E eth1addr=F0:AD:4E:00:B0:8F clear_kernel_in_mem=echo Purging kernel in memory; mw 0x6400000 0x0 0x300000 ipaddr=192.168.1.103 serverip=192.168.1.111 x_bootcmd_usb=usb start x_bootcmd_ethernet=192.168.1.1 stock_bootargs=root=/dev/sda2 rootdelay=10 console=ttyS0,115200 gentoo_bootargs=root=/dev/sdc2 rootdelay=10 console=ttyS0,115200 stock_load_kernel=fatload usb 0 0x6400000 uImage stock_bootcmd=usb start; fatload usb 0 0x6400000 uImage; setenv bootargs root=/dev/sda2 rootdelay=10 console=ttyS0,115200; bootm 0x6400000; gentoo_bootcmd=usb start; fatload usb 0 0x6400000 uImage; setenv bootargs root=/dev/sdc2 rootdelay=10 console=ttyS0,115200; bootm 0x6400000; bootcmd=clear_kernel_in_mem; run gentoo_bootcmd stdin=serial stdout=serial stderr=serial

Environment size: 838/4092 bytes

Don’t forget to `saveenv` if you want to keep the environment after the reboot.

Note: you have to escape ; with \ if you want to use it in setenv. Note: if you want to remove a setenv line, just call setenv with the variable, but no definition (e.g. `setenv x_boot_lala` will delete the line that defines x_boot_lala).

Option 1: Updating u-boot
(At least in theory) since 3.4 the vanilla kernel (and therefore gentoo-sources) should support DreamPlug, but you need to use dev-embedded/u-boot-tools-2012.10 or newer to create the uImage.

First, we need the following packages for compiling our own kernel:

Option 2: Without updating u-boot
Apparently this is an easier alternative.


 * 1) build the kernel with CONFIG_ARM_APPENDED_DTB enabled
 * 2) after the kernel is built, run make kirkwood-dreamplug.dtb
 * 3) cat  >> arm/boot/dts/kirkwood-dreamplug.dtb arch/arm/boot/bzImage
 * 4) make uImage

Option 3: Pre-built kernel images
You can still use a pre-built kernel image, like the ones available on PlugComputer Forums …but then again, what’s the fun in that? ;)