Mkisofs: Difference between revisions

From OSDev.wiki
Jump to navigation Jump to search
[unchecked revision][unchecked revision]
Content added Content deleted
Line 13: Line 13:
say:
say:


<source lang="bash">
mkisofs -U -D -floppy-boot -b boot.img -c boot.catalog -hide boot.img -hide boot.catalog \
mkisofs -U -D -floppy-boot -b boot.img -c boot.catalog -hide boot.img -hide boot.catalog \
-V "Your Name..." -iso-level 3 -L -o /tmp/youriso.iso /tmp/deploy
-V "Your Name..." -iso-level 3 -L -o /tmp/youriso.iso /tmp/deploy
</source>


boot.img,youriso.iso are the names of the boot floppy image and the iso image respectively. change them to your needs. the directories "/tmp/deploy" and "/tmp" you can replace with your own.
boot.img,youriso.iso are the names of the boot floppy image and the iso image respectively. change them to your needs. the directories "/tmp/deploy" and "/tmp" you can replace with your own.

Revision as of 13:42, 13 May 2009

mkisofs is an utility that creates an iso image from files on disk. From man page, "mkisofs is effectively a pre-mastering program to generate the iso9660 filesystem - it takes a snapshot of a given directory tree, and generates a binary image which will correspond to an iso9660 filesystem when written to a block device."

Using mkisofs

You want to create a bootable iso image?

First you need to build a bootable floppy image which holds f. ex. grub with your menu.lst and your kernel (and additional required modules.

Then, you put this boot floppy image in a temporary directory, say /tmp/deploy.

After that, you copy all your additional files (applications, images, texts, directories too) into the given directory (f. ex. /tmp/deploy).

finally, you are ready to do it:

say:

mkisofs -U -D -floppy-boot -b  boot.img -c boot.catalog -hide boot.img -hide boot.catalog \
                        -V "Your Name..." -iso-level 3 -L -o /tmp/youriso.iso /tmp/deploy

boot.img,youriso.iso are the names of the boot floppy image and the iso image respectively. change them to your needs. the directories "/tmp/deploy" and "/tmp" you can replace with your own.

The image of the boot floppy has to be in the same directory as the files you want to put into the iso image. you indicate the path relative to the path where your files to deploy to iso are located, that is for our example: the files to deploy are in /tmp/deploy. your boot floppy image is located under /tmp/deploy/boot.img. you tell mkisofs to use boot.img. Keep it relative to the directory the contents of which you want to put in the iso image. (Hope that sentence makes at least some sense)

Under windows

Windows version of mkisofs(through cdrtools) can be downloaded from ftp://ftp.berlios.de/pub/cdrecord/alpha/win32. The following command(inside cygwin) can be used to create bootable iso image without using floopy image.

mkdir -p $ISO_DIR/boot/grub
cp $GRUB_BIN/stage2_eltorito $ISO_DIR/boot/grub
cp menu.lst $ISO_DIR/boot/grub
cp your_kernel $ISO_DIR
 
mkisofs -R -b boot/grub/stage2_eltorito -no-emul-boot -boot-load-size 4 -boot-info-table -o bootcd.iso $ISO_DIR