The plan
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To produce Debian ISO images and jigdo files by the software provided 
by the libburnia-project.org, an alternative to cdrkit and cdrtools.


An overview
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In order to completely verify that xorriso could be used as a drop-in 
replacement of genisoimage we would need the help of debian-cd team
to perform image production tests for us as they do it with genisoimage.

The image generator xorriso -as mkisofs (or xorrisofs, the symlink) 
is intended to behave like mkisofs (genisoimage, resp.), wrt the upper
level callers, like debian-cd scripts. If some options need to be adapted 
or enhanced we would like to know about it.

A convenient test tarball of GNU xorriso with all necessary libraries 
embedded can be downloaded from:

http://www.gnu.org/software/xorriso/xorriso-x.y.z.tar.gz

Build by:
tar xzf ..../xorriso-x.y.z.tar.gz && cd xorriso-x.y.z
./configure --prefix=/usr/local && make

Install as superuser:
make install

Or run without installation as:
./xorriso/xorriso

Note, that libburn, libisofs, and libisoburn from:
http://libburnia-project.org/wiki/Releases
are actually the items uploaded to Debian proper.


Tasks to be completed
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
As put by Thomas Schmitt <scdbackup@gmx.net>:

Steve wanted
= these old genisoimage features:
 - [DONE] jigdo production 
   (successfully created first Debian images with GNU xorriso timestamp:  2010.11.24.101056)
   libjte library is now merged into jigit package upstream 1.17. 
   Resp. libisofs and libisoburn have been uploaded with libjte support.
 - booting code for powerpc, which involves HFS support too. Remains to be
   investigated whether it would be appropriate to link with hfsutils:

   Request for splitting a library package:
   http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=437226

   The rest of architecture-specific image booting code is there:

   http://lists.debian.org/debian-cd/2011/05/msg00020.html

Joey Hess wanted these non-genisoimage features:
  (http://lists.debian.org/debian-cd/2010/09/msg00013.html)
 - [DONE] isohybrid MBR for USB stick booting. (well tested by me with RIPLinux)
   Debian needs to supply the MBR template file from the SYSLINUX
   installation that is used with making the image El Torito bootable.
   According to hpa: mbr/isohdp[fp]x*.bin , e.g. mbr/isohdppx.bin.

 - [DONE] FAT filesystem in MBR partition 2 after ISO image as partition 1.
   Both are mutally exclusive to mips, mipsel, sparc because the
   MBR occupies the same address as the exotic boot blocks.

Thomas Schmitt:
 - [DONE] Partition offset by 32 kB (is well tested by me)
   This will make the ISO image mountable as /dev/sdb and as
   /dev/sdb1 alike. Users of USB sticks are accustomed to mounting
   /dev/sdb[1-4]. But booting via ISOLINUX and GRUB2 needs the
   ISO image at /dev/sdb. ISOLINUX has /dev/sdb = /dev/sdb1.
   But that leaves no "embedded partition" before the start of
   partition 1. GRUB2 has such an "embedded partition" of 512
   bytes. But that makes /dev/sdb1 unmountable.
   My compromise is to have an "embedded partition" of 32 kB
   and two directory trees at two mount points. See:

     http://libburnia-project.org/wiki/PartitionOffset

   Since a Debian image only has few files, the overhead by the
   twin directory tree will be quite small.)

 - HFS support (link with hfsutils?) - TBD and eventually completed.
   http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=437226
   http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=570187

General common ideas and experiments:
 - [WIP] medistimator - fast prototyping of media estimation task in perl.
   the idea is to fork a slave xorriso process and talk to it via stdin+stdout in 
   order to achieve image size prediction and optionally production on the fly.
   maturity level - prove of concept, estimation algorithm not completed yet.
   Currently hosted at:
   http://git.debian.org/?p=users/danchev/medistimator.git;a=summary


Tests made by Thomas Schmitt
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The files of the bootable system are provided by a mounted isohybrid enabled
ISO image after grabbing its MBR. (RIPLinux = Rescue Is Possible Linux.)

RIPLinux-9.3-non-X.iso is a small rescue Linux image that boots via
ISOLINUX from CD/DVD/BD and from USB Stick. I used its components to
build an own image with similar capabilities together with the
jigdo files. One of the components is the MBR which is needed to
make the image bootable from USB stick. The RIPLinux image once
got it from SYSLINUX script isohybrid.pl.

  $ dd if=RIPLinux-9.3-non-X.iso bs=1K count=32 of=RIPLinux-9.3-non-X.sysarea

  # mount -o loop RIPLinux-9.3-non-X.iso /mnt

A FAT image was made as shown by Joey Hess.

  $ /sbin/mkfs.msdos -n Bla -C test.fat 8192

I made an .md5 file of the mounted RIPLinux-9.3-non-X.iso

  $ ./libjte/jigdo-gen-md5-list /mnt >riplinux-9.3-non-X.md5"

Then I ran this beauty of a command. It has a general part, 
an isohybrid partition part, and a jigdo part:

  $ xorriso -as mkisofs \
   -o riplinux-9.3-non-X.iso \
   -R -V 'RIPLinux_9_3' \
   -J -joliet-long -cache-inodes \
   \
   -b boot/isolinux/isolinux.bin -c boot/boot.cat \ 
   -no-emul-boot -boot-load-size 4 -boot-info-table \
   -isohybrid-mbr RIPLinux-9.3-non-X.sysarea \
   -partition_offset 16 \
   -append_partition 2 0x01 test.fat \
   \
   -jigdo-template-compress gzip \
   -checksum_algorithm_iso md5,sha1,sha256,sha512 \
   -checksum_algorithm_template md5,sha512 \
   -jigdo-jigdo riplinux-9.3-non-X.jigdo \
   -jigdo-template riplinux-9.3-non-X.template \
   -jigdo-map Debian=/mnt/ \
   -jigdo-exclude boot/syslinux \
   -md5-list riplinux-9.3-non-X.md5 \
   -jigdo-min-file-size 0 \
   \
   /mnt

The result looks like this
  
   69687296 2010-10-18 18:58 riplinux-9.3-non-X.iso
       9477 2010-10-18 18:58 riplinux-9.3-non-X.jigdo
     154297 2010-10-18 18:58 riplinux-9.3-non-X.template

md5sum and sha512sum of .iso and .template agree with the "# Template"
checksums in .jigdo.

USB stick and CD boot on amd64. USB stick partition 2 is mountable and
takes files. It complains about attempts to cp -r symbolic links onto it.
So it seems to be FAT, indeed.

Next i copied the files onto Debian lenny, mounted the bootable CD and
rebuilt the ISO image from .template , .jigdo and /mnt :

  # mount /dev/hda /mnt

Install the jigit package.

  $ jigit-mkimage \
     -t riplinux-9.3-non-X.template \
     -j riplinux-9.3-non-X.jigdo \
     -m Debian=/mnt/ \
     -o riplinux-9.3-non-X.rebuilt
  Adding match entry Debian:/mnt/
  $


The result looks good:
  
  $ diff riplinux-9.3-non-X.iso riplinux-9.3-non-X.rebuilt



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
George Danchev <danchev@spnet.net> Wed May 11 17:43:05 EEST 2011
