Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I want to install (L)ubuntu on a hard disk via an SATA controller which is by default (not yet) supported by the standard ubuntu kernel (OCZ revodrive 3 x2). However, I was able to patch the Kernel and then access the hard disk that way.

Now I am stuck as I do not know how to get an (L)Ubuntu boot CD with this patched Kernel.

Ideas I had no success with until now:

  • Installing Lubuntu on another hard disk and copying its root partition content to the new disk, then setting up a new bootloader -> system did not show any messages and did not boot

  • Running the ubiquity installer from within the ubuntu installation on another hard disk (but with the patched kernel)

Is there a way to generate a CD with a custom kernel?

share|improve this question

1 Answer 1

up vote 6 down vote accepted

"Easy" is a relative term. It would not be too difficult, the basics are on this page


In your case, the changes are fairly minimal.

Extract the iso and filesystem.squashfs (as outlined in the above link)

Copy your new kernel to casper/vmlinux (over write the old kernel).

# Assuming you are following the above link
cp your_kernel ~/extract-cd/casper/vmlinuz

Copy your kernel modules to the extracted squashfs , to lib/modules (you can delete the old modules).

# Assuming you are following the above link
cp -R /lib/modules/your_custom_kernel ~/edit/lib/modules

Extract the old initramfs, here I will use ~/initrd as a build directory

mkdir ~/initrd
cd ~/initrd
lzma -dc -S .lz casper/initrd.lz | cpio -imvd --no-absolute-filenames

Copy your lib/modules to the initrd lib/modules (you can delete the old modules)

cp -R /lib/modules/your_custom_kernel ~/initrd/lib/modules

Package the initrd

find . | cpio --quiet --dereference -o -H newc | lzma -7 > ../cusotm.initrd.lz

Over-write the old initrd

cp ~/cusotm.initrd.lz ~/extract-cd/casper/initrd.lz

Now re-package the iso


share|improve this answer
Thank you,why didnt I find this link.I already extracted the iso image once,but had no clue about the folder structure on the Live CD. –  Michael K Jan 10 '12 at 8:09
Hello, when I issuethe last command in the following, I get some premature end of arhive error. Do i need to run this in chroot ? mkdir ~/initrd cd ~/initrd lzma -dc -S .lz casper/initrd.lz | cpio -imvd --no-absolute-filenames –  Roshan George Jul 27 '12 at 14:43

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.