Fun with initramfs

Post questions about how to make a customized SystemRescueCd, and if you have problems to install new packages. Please read the handbook first.
Post Reply
Posts: 2
Joined: 30 Aug 2011, 19:24

Fun with initramfs

Post by mkblackwell » 30 Aug 2011, 19:41

I spent a fair amount of time trying to build a new SysRescCD with some custom kernel patches, and thought I'd share my findings to save others same hair pulling...

I started with the latest srcd 2.3.1, and the Linux kernel it uses, 2.6.38, following the instructions in the "Build a SystemRescueCD with your own kernel" chapter in the docs.

I ran into three sticking points following the instructions. Here they are, with the resolutions:

1. You need to edit the config and set CONFIG_INITRAMFS_SOURCE="" before building the kernel. (Also some of the SQUASHFS and AUFS config options are slightly different than the docs, but that's easy to figure out, and it you start with the srcd config they're already set correctly).

2. As of 2.6.38 the initramfs is compressed with xz, not lzma, so the command to extract the current one is:

Code: Select all

cat /mnt/cdrom/isolinux/initram.igz | xz -d | cpio -id
3. You can't use the default xz options to compress the new initramfs (this is what really hung me up). The correct options are:

Code: Select all

find . | cpio -H newc -o | xz --check=crc32 --x86 --lzma2 > /usr/src/initram.igz
After burning many coasters this is what worked for me.

I would still like to know how to properly create and embed the initramfs directly into the kernel, the way the stock srcd kernels are. I know it's a two pass process to build the kernel, but all of my attempts failed in various amusing ways. Some documentation here would be appreciated!

Site Admin
Posts: 2715
Joined: 17 Jul 2003, 09:44

Re: Fun with initramfs

Post by admin » 07 Nov 2011, 20:50

Thanks, have updated the documentation

Post Reply