Topic: details on the novena recovery image (u-boot script)

I've just gone through the process of building a recent kernel, u-boot and debootstrap'd a system onto a new sdcard by following chunks of ...

http://www.kosagi.com/w/index.php?title … e#Linux_OS

however, I'm particularly interested in the details on the novena recovery image that xob's has linked at Debian jessie bootstrap page specifically this image novena-recovery-image.img.gz

It's probably some u-boot scripting magic that I'm not familar with, would it be possible to share some of the configs/notes on how that image was built?

Re: details on the novena recovery image (u-boot script)

The image was the result of working on a Novena kernel image while at someone's house, after getting it to a state where it didn't boot.  I had gotten the recovery image support working.  The magic in the U-Boot script involves calling the "kbd" command, which returns true if at least one key is pressed:

if kbd
then
    setenv rec .recovery
    setenv bootargs init=/lib/systemd/systemd root=/dev/mmcblk0p2 rootwait rw consoleblank=0 splash
else
    setenv bootargs init=/lib/systemd/systemd root=/dev/sda3 resume=/dev/sda2 rootwait rw consoleblank=0 splash ath9k.ps_enable=1
fi
fatload ${bootsrc} ${bootdev} 0x12000000 uImage${rec}
fatload ${bootsrc} ${bootdev} 0x11ff0000 uImage${rec}.dtb

If the button is held down, it will load uImage.recovery and uImage.recovery.dtb, otherwise it will load uImage and uImage.dtb.

The actual recovery image was built like the main image, using debootstrap.  I was using it as my primary development image while trying to recove the main kernel, so I put necessary files onto it: gcc, Xorg, Bluetooth, Pidgin, XChat, and Iceweasel.  It was decent enough that I could spend the whole weekend running in that environment, though it was slow and not that comfortable.  An important step is to run "apt-get clean", which removes leftover cached .deb files.

Re: details on the novena recovery image (u-boot script)

Thanks for sharing the script, I think this is the type of image is really useful. I'm going to build one now for development!

Re: details on the novena recovery image (u-boot script)

Just to be complete there is a recovery image here http://www.kosagi.com/w/index.php?title … ovena_PVT1

Any chance of posting the full script somewhere for reference.

Re: details on the novena recovery image (u-boot script)

The scripts are still somewhat bespoke, and are subject to change before release.  But here's the script from my board:

setenv bootsrc mmc
setenv bootdev 0
${bootsrc} dev ${bootdev}

if kbd
then
    setenv rec .recovery
    setenv bootargs init=/lib/systemd/systemd root=/dev/mmcblk0p2 rootwait rw consoleblank=0 splash
else
    setenv bootargs init=/lib/systemd/systemd root=/dev/sda3 resume=/dev/sda2 rootwait rw consoleblank=0 splash ath9k.ps_enable=1
fi

${bootsrc} dev ${bootdev}
fatload ${bootsrc} ${bootdev} 0x12000000 uImage${rec}
fatload ${bootsrc} ${bootdev} 0x11ff0000 uImage${rec}.dtb
fatload ${bootsrc} ${bootdev} 0x12a00000 uinitramfs${rec}

fdt addr 0x11ff0000; run prep_gbit; run prep_pcie; run prep_senoko; run prep_es8328; run prep_retina; run prep_pixelqi; run prep_hdmi

bootm 0x12000000 - 0x11ff0000