[SOLVED] - Extroot - (expanding Turris package space)

No, i didn’t change the bootloader itself but the u-boot environment variables.

u-boot runs the variable bootcmd on boot. It reads the number of LEDs lid while in reset to the variable rescue and if it is zero it runs $mmcboot else $rescueboot.

bootcmd=i2c dev 1; i2c read 0x2a 0x9 1 0x00FFFFF0; setexpr.b rescue *0x00FFFFF0; if test $rescue -ge 1; then echo BOOT RESCUE; run rescueboot; else echo BOOT eMMC FS; run mmcboot; fi

!WARNING!

Do not do this without alternate means to get online and a mean to use the serial console to change things in the bootloader the hard way! I give no warranty as this is not exactly the environment i use.

I modified bootcmd and added ssdboot

bootcmd=i2c dev 1; i2c read 0x2a 0x9 1 0x00FFFFF0; setexpr.b rescue *0x00FFFFF0 ; if test $rescue -ge 1 ; then setexpr rescue $rescue - 1 ; if test $rescue -ge 1 ; then echo BOOT RESCUE ; run rescueboot ; else echo BOOT eMMC FS ; run mmcboot ; fi ; else echo BOOT SSD FS ; run ssdboot ; fi
ssdboot=scsi scan ; setenv bootargs earlyprintk console=ttyS0,115200 rootfstype=btrfs rootdelay=2 root=/dev/sda rootflags=subvol=@,commit=5 rw ; btrload scsi 0 0x01000000 boot/zImage @ ; btrload scsi 0 0x02000000 boot/dtb @ ; bootz 0x01000000 - 0x02000000

the setexpr rescue $rescue - 1 steals 1 LED count from the recovery mechanism so you have to light one more LED than normal.

2 Likes