Bob's Notepad

Notes on projects I have done and things I have learned saved for my reference and for the world to share

Wednesday, November 10, 2010

Add files to an ISO using OSX

If you've ever wanted to create a linux CD or DVD with a kickstart file and you're on a Mac you've probably ran into this issue. You can use this method to add/edit/delete files from an ISO image (works as of OSX 10.6.4, despite using PPC binaries).

First, you need to grab a file:

http://homepage.mac.com/machiavel/Executables/cdrtools-OSXbin.tgz (or mirror
Thanks to Greg Nyquist

You'll want to extract the tgz file and then you'll want to copy ./sw/bin/* to /usr/bin/:
  • Open Terminal
  • cd "/cdrtools/cdrtools-2.00.3 (PPC binaries)/sw/bin"
  • sudo cp * /usr/bin
Create a folder for your new ISO compilation and then open the original ISO file by double clicking (it should mount as a disk image). Copy all of the contents on that disk image to the new folder and then add/edit/delete those files as needed. Once you've got the new "image" to your liking, you'll want to go ahead and create the new ISO image. In order to keep your CD/DVD bootable you will need to figure out what the boot image is for your CD. On Linux CDs you will likely find this here: ./isolinux/isolinux.bin
  • Open Terminal if not already
  • cd /newcdimage/
  • rm isolinux/boot.cat
  • mkisofs -b isolinux/isolinux.bin -no-emul-boot -boot-load-size 4 -c isolinux/boot.cat -iso-level 2 -J -joliet-long -v -o /outputdir/NewISO.iso .
  • If you get "Missing pathspec" then you missed the . at the end of the command line
A helpful note: If you're creating a bootable ISO that you want to automatically start installing based on a kickstart file, you can edit ./isolinux/isolinux.cfg on your new CD image folder to have it do so. Something like this should work for centos:
default ks   
prompt 1
timeout 15 
label linux
  kernel vmlinuz
  append initrd=initrd.img
label text
  kernel vmlinuz
  append initrd=initrd.img text
label ks
  kernel vmlinuz
  append ks initrd=initrd.img text

Note that you may have to do a "chmod +w isolinux.cfg" before editing

Labels:

Reference Link


1 Comments:

Anonymous Anonymous said...

If you use Macports, you can also run

sudo port install cdrtools

That installs intel binaries.

6/8/12 9:47 AM  

Post a Comment

Links to this post:

Create a Link

<< Home