Creating a custom initrd.img

If Ubuntu installed, tries to boot, but fails, you probably are missing some important driver. To have a driver available at boot time, you’ll need to rebuild initrd.img. It’s a gzipped cpio file now, and this is how to build it on Ubuntu. Any tutorial that you find using ramfs or cramfs doesn’t apply to the Ubuntu initrd!

This page is OLD and probably contains errors, out of date information, security flaws or other problems. I am keeping it around because it might be helpful to someone.

This assumes your boot failed, and you landed in busbox. Busybox is a mini all-in-one shell. It’s good enough for our purposes. 1) From the busybox shell, check if the device you can’t access shows up in /dev. If it doesn’t, this tutorial is what you’re looking for. Figgure out what modules you need to load.¬†Alternate between modprobing and starting udev again until the devices show up.

For OldWorld Macs, try these modules: mesh, mace, sd_mod, mac53c94.

# modprobe mesh
# modprobe sd_mod
# udevstart
# ls /dev

2) mount the root partition and chroot to it

mkdir /mount
mount -t ext3 /dev/YourRootPartition /mount
mount -o bind /dev /mount/dev
chroot /mount /bin/bash

3) Edit the text file /etc/mkinitrd/modules and enter the names of the modules you had to probe to get the devices to show up.

4) Run “dpkg-reconfigure linux-image-`uname -r`

If you don’t have an OldWorld Mac, exit the chroot, exit busybox and reboot.

Good luck!

The rest is OldWorld Mac specific!

5) Mount the MacOS partition.
modprobe hfs
mkdir /mnt/hfs
mount -t hfs /dev/MacOSPartition /mnt/hfs

6) Copy /boot/initrd.img-kernel-name to /mnt/hfs and put it in the Linux Kernels folder.

7) Unmount the hfs partition
umount /mnt/hfs

8) Reboot into MacOS and try with the new initrd.

This entry was posted in Computers and tagged , , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *