No, a little different than that.
Early on in the kernel boot process (very, very early, actually), it looks at the kernel command line and any overrides built into the kernel. Based on that, it tries to mount root. Typically, for an OpenWrt system, it mounts root first as the ROM, then the “overlay” file system on top of it. The overlay is like tracing paper; if there is a file with the name you’re looking for, you see that, If not, you see what is in the ROM beneath.
“extroot” is really something else, another step beyond that. Once the ROM is mounted as root, with the overlay from the flash, a second overlay is mounted, often from a USB stick.
The AR750S will boot a kernel from NOR flash, then either
- Mount ROM and overlay from NOR
- Mount ROM and overlay from NAND
The way the kernel can “tell” which to mount is based on the flash layout compiled into the kernel. Here’s the flash-detect and how the kernel decided to interpret it (there’s no GPT, MBR, or the like on the flash, just what is in the kernel)
[ 0.409401] m25p80 spi0.0: w25q128 (16384 Kbytes)
[ 0.414306] 6 fixed-partitions partitions found on MTD device spi0.0
[ 0.420889] Creating 6 MTD partitions on "spi0.0":
[ 0.425852] 0x000000000000-0x000000040000 : "u-boot"
[ 0.431736] 0x000000040000-0x000000050000 : "u-boot-env"
[ 0.437900] 0x000000050000-0x000000060000 : "art"
[ 0.443510] 0x000000060000-0x000001000000 : "nor_firmware"
[ 0.449948] 0x000000060000-0x000000260000 : "kernel"
[ 0.455733] 0x000000260000-0x000001000000 : "nor_reserved"
[ 0.466244] spi-nand spi0.1: GigaDevice SPI NAND was found.
[ 0.472058] spi-nand spi0.1: 128 MiB, block size: 128 KiB, page size: 2048, OOB size: 128
[ 0.480690] 1 fixed-partitions partitions found on MTD device spi0.1
[ 0.487253] Creating 1 MTD partitions on "spi0.1":
[ 0.492240] 0x000000000000-0x000008000000 : "ubi"
“ubi” has special meaning to the OpenWrt kernel, so that is what was selected (on NAND). Had the NOR section been called “firmware”, it would have been selected instead (assuming the other wasn’t named “ubi”).
You can see how the names are defined in the kernel definition for NOR root file system (there’s a lot of magic – but at least here you can see the nodes for the different partitions being named or removed, as appropriate)
/delete-node/ &nor_kernel;
/delete-node/ &nor_reserved;
&nor_firmware {
compatible = "denx,uimage";
label = "firmware";
};
whereas for the NAND root file system
&nor_kernel {
label = "kernel";
};
&nand_ubi {
label = "ubi";
};