On the X750 can I boot from SD card?

I’d like to put the rootfs on the SD card and boot from that. I believe it is a matter of setting the right parameters in u-boot environment settings.

Is this possible? Has it been done? If so, how may I do it as well?

So far I am:
I am building my own images for the x750 from openwrt.

I can build a rootfs.tar.gz image and untar it to an ext4 formatted SD card.

Now I need to set up u-boot to run the rootfs on the SD card.

How?

Without modifying code and building from source, the easiest approach might be to use “extroot” configuration. Extroot boots normally, then adds an additional overlay using “external” storage, such as an SD card. It has a drawback in that upgrades are more complicated as the sysupgrade process assumes that the internal flash is the proper place to put the saved config for restore once the system reboots the first time.

https://openwrt.org/playground/richb/extroot

I am aware of extroot and have successfully implemented it. The limitations you mentioned, where updates and upgrades are concerned have led me to look into directly booting from the SD card.

Right now I am building from sources via openwrt. I assume I may need to make modifications to u-boot among other things. Can you outline what I need to do to implement booting from the SD card?

Thanks.

I don’t know the X750 under ath79 as well as ipq40xx, but my first thoughts would be not to modify U-Boot and its environment unless you absolutely have to. Leaving it alone means you can always flash “stock” firmware and get something running again. Modifying the U-Boot environment can be dicey as I’ve seen U-Boot rewrite its environment to some in-built default, which could leave you soft-bricked. I also know that the public source for the GL-AR750S U-Boot is not current.

Looking at target/linux/ath79/dts/qca9531_glinet_gl-x750.dts shows that there is plenty of space for a kernel there, at least up to what U-Boot can load and decompress.

You can change the kernel command line and the root device with DTS, at least on the ipq40xx target.

Some targets have a “munge” or full override possible also. I haven’t looked into this on the ath79 target.

From target/linux/ipq40xx/files-4.19/arch/arm/boot/dts/qcom-ipq4019-linksys_ea8300.dts, the following code overrides the U-Boot command argument (early init effectively takes the “last” value for a command-line argument):

        //
        // OEM U-Boot provides either
        // init=/sbin/init rootfstype=ubifs ubi.mtd=11,2048 \
        //                 root=ubi0:ubifs rootwait rw
        // or the same with ubi.mtd=13,2048
        //

        chosen {
                bootargs-append = " root=/dev/ubiblock0_0 rootfstype=squashfs ro";
        };

Assuming that your kernel has the proper drivers for the SD card and its file system built in, you should be able to mount root directly off of it. I’m guessing that it would be the USB drivers, mass-storage access, and either ext4 or perhaps UBIFS. (I’ve read that F2FS has some reliability problems.)

This is good information. I’ll give it a try.

Thank you for your quick replies.

1 Like

hmmm… working from Master - X750 is covered under both ar7xxx/ar9xxx, and there is work on ath79.

OP is asking how to redirect boot - and x750 is nominally a NOR based target - so it’s uboot that would have to do the switch there, but how to decide to boot from NOR or wait for SDCard (mmcblock) without breaking everything.

Can be done - see the AR300M-NAND target, and there it’s uboot to decide.

For general purposes, probably out of scope to modify uboot for the use-case that OP wants, as someone would have to maintain u-boot there.

@jeffsf - not sure where ipq40xx comes in, and there, it’s even more complication - b1300 being NOR, and S1300 being eMMC - sometimes I wonder if we’re both looking at ath79 a bit too hard :smiley:

sfx

Just an example of how to get the command line you need to the kernel so you can mount root from a completely different place than U-Boot suggests (without modifying U-Boot or its environment).

I did the extroot new my 5g wifi is gone any suggestions

You may need to give logs to check this problem.