Creating a custom initrd.img

Posted by stuporglue on Mar 14, 2010 in Computers
Subscribe to posts by category...
Computers

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
cd

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.

Tell Your Friends
  • Digg
  • Facebook
  • Google Bookmarks
  • RSS
  • StumbleUpon
  • Twitter

Tags: , , ,

Leave a Reply

XHTML: You can use these tags:' <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Please note: Comment moderation is enabled and may delay your comment. There is no need to resubmit your comment.

Original content on this page is under the Creative Commons Attribution-ShareAlike 3.0 License unless otherwise noted.

If you found this page particularly helpful, I'd love to hear from you. A link to this page from your blog or website would also be appreciated.

I'm the real Michael Moore