litex-hub / linux-on-litex-vexriscv

Linux on LiteX-VexRiscv
BSD 2-Clause "Simplified" License
572 stars 174 forks source link

rootfs.cpio size vs initrd size #338

Open hoonchoi70 opened 1 year ago

hoonchoi70 commented 1 year ago

The rootfs.cpio size of the original given configuration is ~6MB and it worked well w/o any issue. To test ssh, I added openssh and ethtool and it made rootfs.cpio grwo to ~11MB. The initrd_start and initrd_end in .dts are 0x41000000 and 0x45000000. So, it has about 64MB of space that is large enough to have 11MB of rootfs.cpio. However, the booting process fails since it cannot find many files in the rootfs. I checked and found that /usr has only bin and lib, nothting else. If I remove ethtool, the size of rootfs.cpio becomes ~8.5MB but it still fails due to some of missing files in rootfs. When the rootfs.cpio is 6MB, I can see all the files in the rootfs (same to target in buildroot directory). What do I miss? Thanks for the help in advance.

jeremy-heath commented 1 year ago

If you have an SDHC Card, the rootfs.cpio can be unpacked onto that and EXT2 filesystem and you can have any size you want. You would have to adjust its location within the device-tree file. I found that SDHC cards work and regular SD (<=2GB) don't.

hoonchoi70 commented 1 year ago

Thanks for the suggestion. As you said, I built the rootfs on SDCard instead of initrd and it works pretty well! Thanks.