Mkisofs: Difference between revisions

From OSDev.wiki
Jump to navigation Jump to search
[unchecked revision][unchecked revision]
Content added Content deleted
(Pointing to article "ISO 9660" and giving motivation for producing ISO filesystems)
(New section "Mkisofs, its Clone, and its Emulator")
Line 8: Line 8:


== Mkisofs, its Clone, and its Emulator ==
== Mkisofs, its Clone, and its Emulator ==
The program '''mkisofs''' is part of the
[http://cdrecord.berlios.de/private/cdrecord.html cdrtools project]
by Joerg Schilling.
<Source lang=bash>
prog="mkisofs"
</Source>

Some quarrels with the GNU/Linux community caused a fork of cdrtools,
named [http://www.cdrkit.org/ cdrkit]. The corresponding fork of mkisofs
is named '''genisoimage'''. You will find it installed as "mkisofs"
on many popular GNU/Linux distributions.
<Source lang=bash>
prog="genisoimage"
</Source>

An independent alternative to mkisofs is
[http://www.gnu.org/software/xorriso/ xorriso], which has an
emulation mode that understands the options which are used with
mkisofs for producing a bootable ISO 9660 image. Most distributions
have it either as package "xorriso" or as part of "libisoburn".
GRUB2 script grub-mkrescue depends on xorriso-0.5.6 or newer.
<Source lang=bash>
prog="xorriso -as mkisofs"
</Source>

== Options and input files ==


== Using mkisofs ==
== Using mkisofs ==

Revision as of 09:50, 20 October 2013

mkisofs is a utility that creates an ISO 9660 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."

Developers of operating systems will mainly be interested in creating ISO filesystems for bootable CD, DVD, or BD via El-Torito. Nevertheless, ISO filesystems may also be booted from hard disk or USB stick.

Mkisofs, its Clone, and its Emulator

The program mkisofs is part of the cdrtools project by Joerg Schilling.

prog="mkisofs"

Some quarrels with the GNU/Linux community caused a fork of cdrtools, named cdrkit. The corresponding fork of mkisofs is named genisoimage. You will find it installed as "mkisofs" on many popular GNU/Linux distributions.

prog="genisoimage"

An independent alternative to mkisofs is xorriso, which has an emulation mode that understands the options which are used with mkisofs for producing a bootable ISO 9660 image. Most distributions have it either as package "xorriso" or as part of "libisoburn". GRUB2 script grub-mkrescue depends on xorriso-0.5.6 or newer.

prog="xorriso -as mkisofs"

Options and input files

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


See Also

Articles

Forum