developing a dual firmware from usb...
NOTE: it is removable... so when you unplug... 99.9% vanishes and normal router operations are not effected.
There are some really cool benefits like;
- developing lowlevel scripts on removable media...
- switching releases by switching drives...
- massive reduction on router wear and tear
- oem flash dumps and restores made easy
starting out with arm / uboot with ext2load...
Deal with now;
Gather other device usb bootcmds and related info
# none known
# make a post with your info if you know / have tested it... or just the fw_printenv ( minus macs or serials ) -> ipq806x for now unless someone gifted is super keen on that end...
i.e.;
To support a board:
Much of this info is available online but to be sure... serial access would be prefferable.
all boards)
-ext2load or what your uboot supports
-check whether enabling bootloader ATAG passing will break boot ( may need serial or alternate recovery skills and methods )
-your bootloader loadaddr/bootcmd/defaults ( info re: limits on kernels over 5~MB - memory availablity overlap )
-your bootloader usb init command/s
-does / can your bootloader auto reset its environment
-does any of its other functions ( disk init ) interfere with device labels or initialisation ( nousb3,mmc2 etc )
ipq806x) stop here
-buildroot ATAG/bootloader cmdline kernel option/s ( can help with this )
Partition layout... what is optimal?
this is what I currently have
1 -> ext2 "boot"
2 -> ext2 "scratchbackup/restore.tar.gz archive etc"
3 -> rootfs (now ext4)
4 -> swap (optional)
Rootfs format issue re: squashfs/overlays/etc
( ext4 for now... but would like to support others with pure extroot... no /overlay )... i'm wondering if a spare partition or two for "dynamic/per-install overlay" functionality might be wise...
PARTUUID and not LABEL....?
i'd possibly contribute to LABEL "upstream" code as it would greatly simplify ubootvar<>bootcmd's.... the LABELs are used within my buildroot / pc scripts to mount / format / copy / interact with the USBstick... they are
1 wrtboot
2 wrtsnapback
3 wrtrootfs
Deal with later
- uboot variable names ( bootalt=0/1 usbrootfsalt=/dev/sda3 etc. etc. )
- kernel name: kernel1+kernel2 / kernel+kernelalt etc
- Should it flash the alternate partition always? Would a switch to specify current or alt be of use?
Naming samples... ( all oem? )
target/linux/ramips/mt7621/.../platform.sh alfa-network,quad-e4g) dual_image -> "1" bootactive 1|2"
( will likely be scalable to other "loadcmds" / rootfs formats )