Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Adding firmware to Gentoo ISO image
View unanswered posts
View posts from last 24 hours

Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message

Joined: 23 May 2005
Posts: 9
Location: Georgia

PostPosted: Wed Jan 09, 2008 11:00 pm    Post subject: Adding firmware to Gentoo ISO image Reply with quote

This HowTo will detail what is involved with adding firmware to a bootable Gentoo ISO image, to allow the firmware to be available at boot time. This was brought about by needing a bootable CD for a server at work that included the QLogic firmware on the CD.

You will need the following software to work with the images and burn them.

emerge -av cdrtools qemu squashfs-tools

cdrtools will allow you to burn the ISO to cd once you are finished.
qemu is good for testing the ISO before you burn it, to make sure it is working without wasting a CD.
squashfs-tools is needed for working on the actual squashed image that the system mounts.

First, you need somewhere to work with at least 2GB of space available. In this example, I use /home/tmp to work from.

Download the minimal install CD from your favorite mirror, and copy it to your work directory

cp install-x86-minimal-2007.0-r1.iso /home/tmp

Once you have the ISO downloaded, you will need to create a few directories to work in:

cd /home/tmp
mkdir iso-original
mkdir iso-new
mkdir tmp

Mount the ISO image to iso-original:

mount -o loop install-x86-minimal-2007.0-r1.iso /home/tmp/iso-original

You will need to copy everything from the ISO to the new directory, since you can't modify the ISO directly:

cp -av iso-original/* iso-new/
umount /home/tmp/iso-original

Once everything is copied, you need to inflate the squashed file system, so it can be modified, and delete the original squashfs file.

unsquashfs iso-new/image.squashfs
rm iso-new/image.squashfs

This will create a directory in /home/tmp called squashfs-root. The firmware actually resides in a bzip2 file in squashfs-root/lib called firmware.tar.bz2. You will need to extract that file to another location and delete it, then add your firmware file into the directory and recreate the bzip2 file.

cd tmp/
tar -jxvf ../squashfs-root/lib/firmware.tar.bz2
rm ../squashfs-root/lib/firmware.tar.bz2
tar -cf - * |bzip2 > ../squashfs-root/lib/firmware.tar.bz2
cd ../

Now we need to recreate the squashed filesystem and put it back in place. Once that is complete, you will recreate the ISO.

mksquashfs squashfs-root/ iso-new/image.squashfs
cd iso-new
mkisofs -R -b isolinux/isolinux.bin -no-emul-boot -boot-load-size 4 -boot-info-table -iso-level 4 -hide-rr-moved -c isolinux/ -o /home/gentoo-custom.iso -x files ../iso-new/

You should now have an ISO named gentoo-custom.iso, residing in /home. File size should be about 57MB if you did everything correctly. Once you have the ISO, you can test it with qemu:

cd /home
qemu -cdrom gentoo-custom.iso -m 512

This will boot the ISO image into a DOS emulator. You can check to see if the firmware is showing up by looking in /lib/firmware.
Tygr Labs
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Page 1 of 1

Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum