Lighthouse logoReplacing a kernel module in initrd.xz

Initrd.xz (initial ram disk: initramfs) is an xz compressed cpio archive.

  1. To extract it, use ROX-Filer to find the location of initrd.xz (usually in the folder where you installed Lighthouse 64).

  2. Open a terminal session from the folder:
    • Make sure no files are selected.
    • Right-click
    • Choose "Window" menu, then then choose "Terminal Here"

  3. Copy and paste this into the terminal:  mkdir initrd-tree; cd initrd-tree/; xzcat ../initrd.xz | cpio -d -i -m

  4. It dumps the innards into a directory there named initrd-tree/. Close the terminal and open initrd-tree/ with ROX.

  5. Right-click on the file kernel-modules.sfs. -> Edit-SFS -> Choose desired block size (I usually use 1024K.) -> OK.

  6. You'll see a new filer window open to working_tree with just the folder lib, and a dialog 'You may now edit the contents...'

  7. Use ROX there to find lib/modules/3.7.10 folder. The version number (3.7.10) may be different for different version of Lighthouse.

  8. Copy the module you have created in the appropriate location inside the above folder.

  9. Now navigate in ROX way back up to until you see the folder working_tree and open a terminal as in step #2 from this filer window.

  10. From the terminal run this:  depmod -b $(pwd)/working_tree -a  which will rebuild the module depedency list.

  11. Close the terminal and click 'Build' in the Edit-SFS dialog that opened earlier.

  12. When mksquashfs finishes the build, Edit-SFS will present a window with the new kernel-modules.sfs. Copy it back over-writing the old sfs in the initrd-tree window.

  13. To rebuild the initrd, run these from inside the initrd-tree/ directory:
mv ../initrd.xz ../initrd.xz.`date +"%Y.%m.%d_%T"` # to save prior version
find . | cpio -o -H newc | xz --check=crc32 --x86 --lzma2=dict=512KiB > ../initrd.xz


Back to FAQs Index