I’ll start with a small DSL linux image. It’s only 50 meg, but it’s a pretty useful little distribution.
-rw-r–r– 1 ninja ninja 50M 2009-08-28 13:11 dsl-4.4.10.iso
Mount the original iso image you want to modify
Copy the everything that you just mounted to another temporary place.
sending incremental file list
./
index.html
KNOPPIX/
KNOPPIX/KNOPPIX
boot/
boot/isolinux/
boot/isolinux/boot.cat
boot/isolinux/boot.msg
boot/isolinux/f2
boot/isolinux/f3
boot/isolinux/german.kbd
boot/isolinux/isolinux.bin
boot/isolinux/isolinux.cfg
boot/isolinux/linux24
boot/isolinux/logo.16
boot/isolinux/minirt24.gz
lost+found/
Now add whatever files you want under /mnt/source. Once you’re done, you’re ready to make an iso image from that.
If you just want to make an iso image, and it’s not going to be bootable, this first option will work just fine. If you want it bootable, use the 2nd option below:
I: -input-charset not specified, using utf-8 (detected in locale settings)
0.95% done, estimate finish Fri Aug 28 13:21:27 2009
1.90% done, estimate finish Fri Aug 28 13:21:27 2009
2.85% done, estimate finish Fri Aug 28 13:21:27 2009
…
97.91% done, estimate finish Fri Aug 28 13:22:08 2009
98.86% done, estimate finish Fri Aug 28 13:22:08 2009
99.81% done, estimate finish Fri Aug 28 13:22:08 2009
Total translation table size: 0
Total rockridge attributes bytes: 2071
Total directory bytes: 8192
Path table size(bytes): 70
Max brk space used 23000
526012 extents written (1027 MB)
To make it bootable, you need to provide -c with the boot catalog and -b with a boot image that is exactly 1200 kB, 1440 kB, or 2880 kB used for creating the iso9660 file system. The path to these options is relative to the source path.
I: -input-charset not specified, using utf-8 (detected in locale settings)
0.95% done, estimate finish Fri Aug 28 13:21:27 2009
1.90% done, estimate finish Fri Aug 28 13:21:27 2009
2.85% done, estimate finish Fri Aug 28 13:21:27 2009
…
97.78% done, estimate finish Fri Aug 28 15:12:43 2009
98.73% done, estimate finish Fri Aug 28 15:12:44 2009
99.68% done, estimate finish Fri Aug 28 15:12:44 2009
Total translation table size: 2048
Total rockridge attributes bytes: 0
Total directory bytes: 8192
Path table size(bytes): 70
Max brk space used 23000
526685 extents written (1028 MB)
Your new image is the size of the original plus the files you just added. I added about a gig to the DSL linux image, so it’s now about 1.1 gig! So you can’t exactly add files in place, but this gets the job done with the same end result, as long as you have room to copy the image somewhere.
If you started with a bootable iso like dsl, knoppix, ubunutu live image, or whatever, then you should find those boot.img and boot.cat files somewhere. Some distributions may change the names, such as boot.catalog instead of boot.cat.