[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: manipulate initrd from Debian installer

Mark Allums wrote:
Denny Schierz wrote:

i have to recompile a kernel ( to get some hardware working,
for example network cards and 3ware SCSI SATA controller from the
installer (debian-testing-amd64-netinst.iso). But I'm unable to create a
valid kernel and/or initrd.

i did something like:

# mount loop .iso
# copy the contents into a directory
# compile kernel and copy them to cd/install.amd/vmlinuz
# unpack initrd.gz
# copy the modules to lib/modules
# recompress with cpio and gzip
(cd ramdisk/ ; find . -depth -print | cpio -oc > ../newinitrd ; cd .. ;
gzip newinitrd)
# copy the new initrd.gz to cd/install.amd/initrd.gz
# create mkisofs
# starting ...

But,  however. I get

a)  tried reiserfs,ext3,ext2,cramfs .... "Kernel panic - Unable to mount

b) or if i do mkcramfs ramdisk/ new.cramfs and copy them to
cd/install.amd/initrd.gz, i get "Unable to mount root fs on

and he lists some partitions from ram0 till ram15. He said, i tried to
boot from <NULL> as root=

so, what i have to do. Most pages and Howtos are old. I want to change
only the kernel with his modules, nothing more.

cu denn

Where to start... well, I don't know your level of sophistication with the kernel, but did you compile the kernel the "Debian way" or the standard way? Did you use a Debian kernel (looks like not) or a vanilla kernel? Did you use make oldconfig? If you did it the Debian way, did you,

$ cp /boot/config<your old version>
$ make gconfig           <---- if using gnome, otherwise some variant
$ make-kpkhg clean
$ make-kpkg --initrd kernel_image modules_image
$ cd ..
$ dpkg -i linux-image*.deb

If you used a non-Debian kernel, did you,

$ make mrproper
$ make oldconfig
. . .

or maybe

$ make mrproper
$ cp /boot/config<your old version>

as a starting point?  And then, possibly,

$ make gconfig
$ make
$ make modules
$ make modules_install
$ depmod -a
$ update-initramfs -c -k <yourversion>
$ make install

or some variation on the above? (Some of the steps above may be redundant.)

Do you have all the build tools installed? For Debian way, you need packages build-essential, init-ramfs-tools, kernel-package, module-assistant, devscripts, and of course the kernel package, and the dependencies. You might need git-core, or fakeroot, depending on you setup. ncurses is needed for some of the config tools, and maybe other things (you also need ncurses-dev).

A typo up there, should be make-kpkg clean.

Also, this all assumes that you are working from the standard directory


These are just some hints or guidelines, you should read the kernel docs:


And other stuff. Plenty of stuff on the web, with some diligence searching. (In English, the kernel does not use the masculine pronoun. It is usually referred to as an 'it', not a 'he'.)

Mark Allums

Reply to: