I'm struggling to get OpenWRT 21.02.0-rc3 to boot on an x86_64 machine that uses an NVIDIA SATA controller.
With the stock image, at boot time, the kernel fails to recognize the root partition and waits indefinitely. I've verified the kmod-ata-nvidia-sata driver works with this setup: if I boot from USB and then install that driver via opkg, the same HDD and its partitions get recognized instantly, and their contents are all readable.
However, when I try to build from source and include the same driver (and ata-core) in the kernel, I still get the same result when I flash the freshly-compiled image to the HDD and try to boot: the root partition is never found.
Am I missing some other dependency in the build process that would make this system bootable directly from SATA?
When I load kmod-ata-nvidia-sata after a USB boot with the stock image, the only listed dependency (other than the kernel) is ata-core...so I'm pretty stumped as to what else could be missing.
I assume you are selecting the packages as "built in" (they show a * in the make menuconfig interface)
Because that's not integrated in kernel, but preinstalled in root filesystem and part of filesystem image you build. That's still a module, not integrated in kernel.
And obviously when booting the kernel cannot find the root filesystem, because the module it needs to see it is in the root filesystem (that it cannot see).
so you should add
CONFIG_ATA=y
CONFIG_SATA_NV=y
anywhere in the file I said, and then recompile the firmware
I don't see why you need to install OpenWrt on Sata anyway, you can just keep OpenWrt on the USB drive (by default it does not write anything in the root filesystem unless you are changing configuration or installing packages so it will not just wear out the USB flash like most other operating systems will do) and use the Sata as a pure data drive, which also makes upgrades and maintenance much more convenient.
That's why Sata for most devices is a module/package and is not built-in the kernel, even on x86 targets. The "expected" and "recommended" way is to keep OpenWrt root system on a USB drive.
Thanks very much for this. You're exactly right -- I had wrongly believed that "*" in make menuconfig was designed to build the module into the kernel rather than merely adding it to the root fs. Your method -- editing the proper kernel config file -- worked perfectly.
Thanks again for the detailed explanation. Next it seems I need to study up a bit on the (intended) structure of the Openwrt filesystem.