HOW TO - add modules to initramfs - Printable Version +- PINE64 (https://forum.pine64.org) +-- Forum: ROCKPRO64 (https://forum.pine64.org/forumdisplay.php?fid=98) +--- Forum: RockPro64 Projects, Ideas and Tutorials (https://forum.pine64.org/forumdisplay.php?fid=104) +--- Thread: HOW TO - add modules to initramfs (/showthread.php?tid=6410) |
HOW TO - add modules to initramfs - dukla2000 - 08-15-2018 Perhaps the harder part of this is to explain WHY you would want to do this. And HOW to identify the modules. In my life this all started trying to put rootfs on my NVMe with 4.18.0-rc8 kernel. I could boot 4.18 from an SDcard and see the NVMe after boot. But the PCIe and NVMe initialisation were after rootfs was mounted during boot. And so any attempt to define the NVMe as rootfs caused a hang in the boot sequence as it was not available when required. I was pretty unsuccesful trying to identify which modules were loaded during initramfs time and which were loaded after rootfs. lsmod showed the same results whether I had the PCIe card plugged in or not. So I got lucky and decided to try with the "likely candidates", pcie_rockchip_host and phy_rockchip_pcie. The initramfs can be tweaked using the 3 text files in /etc/initramfs-tools/ I made no changes to initramfs.conf I added the 2 modules to modules, now looks like Code: # List of modules that you want to include in your initramfs. I changed update-initramfs.conf to give me a backup, so now looks like Code: # At which stage a quick Code: sudo update-initramfs -u -k $(uname -r) gave me a new /boot/initrd.img-4.18.0-rc8-1060-ayufan-g45828c4db727 as well as a .bak. (Note - this all assumes you are running the target OS from an SDcard) And then copy the altered bits of /boot to the NVMe, adjust the kernel command line to pickup the NVMe for root and everything was great. RE: HOW TO - add modules to initramfs - Luke - 08-16-2018 Many thanks for this! RE: HOW TO - add modules to initramfs - Bullet64 - 08-16-2018 @dukla2000: THANK YOU!! Works!! RE: HOW TO - add modules to initramfs - jzhang18 - 08-16-2018 Thanks for the update RE: HOW TO - add modules to initramfs - Bullet64 - 09-30-2018 With Kernel Code: Linux rockpro64v2_0 4.19.0-rc4-1065-ayufan-g72e04c7b3e06 #1 SMP PREEMPT Sat Sep 29 21:27:52 UTC 2018 aarch64 aarch64 aarch64 GNU/Linux i don't need this Code: rock64@rockpro64v2_0:~$ df -h iozone Code: rock64@rockpro64v2_0:~$ sudo iozone -e -I -a -s 100M -r 4k -r 16k -r 512k -r 1024k -r 16384k -i 0 -i 1 -i 2 RE: HOW TO - add modules to initramfs - dukla2000 - 10-01-2018 (09-30-2018, 03:17 AM)Bullet64 Wrote: With KernelI think it is just persistent since you previously edited /etc/initramfs-tools/modules On my system I have re-installed and have a standard (effectively null) modules. When I installed 4.19.0-rc4 my NVMe failed to initialise at all. Indeed even when I swapped rootfs back to the SDcard it did not initialise so I have not played any more with 4.19. |