[English] [Japanese]

Linux CD-ROM Game System

 
  YAMAMORI Takenori <yamamori>

§ Preparations to burn a CD-R

Now, we are ready to burn a CD-R with contents of the current hard drive that we have tested. To create a CD-R, at first we make an image file of the CD-ROM by mkisofs command, and then we burn it into a CD-R by cdrecord command.

So we need to install cdrecord and mkisofs. We may install cdrecord and mkisofs on the current hard drive for the game system. I connected an external SCSI CD-R drive to the machine for the game system and used it. You may use just mkisofs to create the image file, and then transfer it to some other machine that has a CD-R drive, and burn it there.

A concrete installation method of cdrecord, mkisofs is in this column. In addition, there is a reference page (Japanese).


¶ Creating a CD-ROM image file with mkisofs

We create a CD-ROM image file with mkisofs as follows:

# cd /tmp
# TZ=UTC mkisofs -R -J -o CD.iso -b images/boot.img -x /tmp -x /proc /

The "-x" option added to mkisofs is an option to exclude a specified file or directory from a making image.

We add "-x /tmp" option to exclude /tmp because the result image file CD.iso is written under the /tmp directory. We don't need /tmp on the CD-ROM because the actual /tmp directory for the game system is in the initrd.

In the same way, we exclude /proc with "-x /proc" option because it is meaningless. In particular, /proc/kcore should be excluded because it is recognized as a big size file that cannot be stored into a CD-ROM.

And we add "-b images/boot.img" option to specify the image file of the floppy disk that we have made as an El Torito bootable image file.

To reproduce a UNIX file system, we have to use "-R option for the RockRidge extension.

In addition, this is not required, but we add "-J" option for the Joliet extension so that each file in the CD-ROM can be read from Windows as a long file name.

The reason why I add "TZ=UTC" for specifying an environment variable just before the mkisofs command is to record each file's time stamp as UTC. This is my custom to keep the compatibility of a time stamp between the OS's.

After the execution of mkisofs, if the size of CD.iso is less than 333000sectors × 2048 bytes = 681984000bytes, it can be written into a 650MB CD-R.


¶ Confirm it with a loopback mount

We had better confirm the image file CD.iso once with a loopback mount as follows: These files and directories that we see right now are to be written into a CD-R.

----
# mount -t iso9660 -r -o loop CD.iso /mnt/tmp
   ... confirm it ...
# umount /mnt/tmp              # umount after the confirmation
# /sbin/losetup -d /dev/loop0  # losetup is needed
			       # because /etc/mtab has been modified.
----

To "Linux CD-ROM Game System" index


This page has been rewritten for the web from a manuscript of TECH Linux Vol. 2 "CD-ROM Game System" ASCII Corporation.
To "SunOS 4.1.4 the mystery" Home
© 2000 YAMAMORI Takenori
yamamori