Topic: Flash Kernel/Rootfs on CC w/o screen

I have pulled off the touchscreen on an old Chumby Classic and I'm wondering if there's a way I can boot from the "alternate" root filesystem and flash a custom kernel/rootfs.

If that's not a possibility, is there a way to "dd" them to one of the mtd partitions safely from the running linux distro and simply reboot into them?  What about getting back?  Any gotchas?

Is there any sort of alternate bootloader so I can use the entire flash space for 1 larger rootfs instead of 2 smaller (normal and "update") filesystems?

I have serial console access, but there doesn't appear to be any break point to change the boot.

The only interesting bit I see at the bootloader portion is "MSP is cleared; flagging normal mode."  I'm guessing there's a bit I can set to signal an alternate boot?

Linux Guy - Occasional Chumby Hacker

Re: Flash Kernel/Rootfs on CC w/o screen

Bump.  Any way to safely write a new rootfs/kernel on a CC without a screen?

Linux Guy - Occasional Chumby Hacker

3 (edited by Ken 2011-06-09 13:17:51)

Re: Flash Kernel/Rootfs on CC w/o screen

On chumby classic, the mtd7 partition is treated as a "Mode Sense Page"

chumby:~# cat /proc/mtd 
dev:    size   erasesize  name
mtd0: 00100000 00004000 "Boot Loader"
mtd1: 00200000 00004000 "PSP"
mtd2: 00280000 00004000 "Kernel2"
mtd3: 00800000 00004000 "Root Disk2"
mtd4: 00300000 00004000 "Kernel1"
mtd5: 01600000 00004000 "Root Disk1"
mtd6: 01800000 00004000 "Cache"
mtd7: 00080000 00004000 "MSP"

The bootloader checks the MSP at boot.  If there are more 0xFF than 0x00 in that region, the bootloader will boot into the secondary kernel and root file system, at which point you can install an alternate USB image.

To set the MSP to all 0xFF and force boot into special options mode, do the following via serial:

flash_eraseall -q /dev/mtd7
nandwrite /dev/mtd7 /usr/chumby/msp_FF_64k_no_oob.bin 0x70000
reboot

Re: Flash Kernel/Rootfs on CC w/o screen

Awesome, thanks!  I saw the MSP logging from the bootloader, but I didn't know what that was for.  I dug through some of the update scripts and saw some of the nand writes, but without comments on some, it was hard to discern what was what.

So is there a way to change the flash map?  (i.e., offset the sizes of rfs1/rfs2 even more than they currently are?)

I want a bigger regular rootfs, and could probably make a smaller (working) update rootfs.

Linux Guy - Occasional Chumby Hacker

Re: Flash Kernel/Rootfs on CC w/o screen

While it's possible to change the partition table, you'd need to modify the boot loader, kernel and some of the update scripts to pull it off, and run a very good chance of bricking the device.  This is one of the *many* reasons we moved away from NAND in favor of MicroSD...  I'd recommend giving your hack a try on a chumby one smile

Re: Flash Kernel/Rootfs on CC w/o screen

I was afraid of that.  Is the boot loader source available?

Also, if I were to brick the update rfs and mtd partition 7 was filled with 0xFFs, is there a way to reset that and boot to the regular partition?

I'm scared of the scenario where I dd a rfs1, set the MSP to boot to rfs1, which is bork, and have no way to boot back to rfs2.

I agree that hacking on a C1 would be better, but I have my CC's set aside for dev and the C1s are used as chumbies.  One CC is ripped apart completely for hacking.

Linux Guy - Occasional Chumby Hacker

Re: Flash Kernel/Rootfs on CC w/o screen

Materdaddy wrote:

I was afraid of that.  Is the boot loader source available?

ironforge bootloader

Materdaddy wrote:

Also, if I were to brick the update rfs and mtd partition 7 was filled with 0xFFs, is there a way to reset that and boot to the regular partition?

I'm scared of the scenario where I dd a rfs1, set the MSP to boot to rfs1, which is bork, and have no way to boot back to rfs2.

If the MSP is set to 0xFF, you can tap the screen when powering on to force it to boot into RFS1.  Unfortunately, without a display attached to the chumby classic, there's really no way to signal the bootloader to change it's boot path decision.

Keep in mind that if you smoke the boot loader, it's game over unless you desolder the NAND and burn a new image with a ROM burner.