I need to prepare a ALL-in-one CD for a VoIP training. What I will like to achieve is one single CD that installs Asterisk with the AsteriskGUI and that also includes all the training materials and some extra GPL software.

I took the AsteriskNOW (beta 6) as a base and I thought that it was going to be as simple as opening the ISO, adding content and creating a new ISO. Unfortunately, there are several interesting features that made this more difficult that I expected. During installation the installer rejects the new image with a message: “The rPath Linux CD was not found in any of your CD ROM Drives.” I image that you found this webpage while googling for this error. Welcome!

I spent a long evening looking into this and this is what I found out. I write it here so I do not forget and serves others :)

The AsteriskNOW CD uses rPath, rPath is a Linux distribution specially designed for appliances. rPath is heavily based on RedHat installer i.e. the anaconda installation system. Yes, the python one. I specially like those python errors that anaconda gave me back in 2000 during the creation of RedHat-based distro.

At first glance, it looks pretty much like a RedHat kickstart will work, this is something I remember from the times of building Flyinglinux, the very first Linux distro with native support for WiFi. rPath uses a package repository based on sqlite3 and conary.

Checking the ISO image we see:

# file asteriskNOW-beta6-x86.iso 
asteriskNOW-beta6-x86.iso: ISO 9660 CD-ROM filesystem data UDF filesystem data 
(unknown version, id 'NSR01') 'AsteriskNOW Disc 1             ' (bootable)

The CD is recorded in a UDF filesystem, The Universal Disk Format (UDF) is a format specification of a file system for storing files on optical media. It is an implementation of the ISO/IEC 13346.

Having a look to the code of file.c, the software package that checks the magic numbers of a file. I saw that the file is UDF NSR01, UDF 1.0

>38913   string   !NSR0      ISO 9660 CD-ROM filesystem data
>38913   string    NSR01     UDF filesystem data (version 1.0)
>38913   string    NSR02     UDF filesystem data (version 1.5)
>38913   string    NSR03     UDF filesystem data (version 2.0)
>38913   string    >NSR03    UDF filesystem data (unknown version,
>>38917  byte      x         id 'NSR0%c')
>38913   string    <NSR01    UDF filesystem data (unknown version,
>>38917  byte      x         id 'NSR0%c')

In order to make a ISO with NSR01/UDF format we need to add the UDF flag to the mkiso utility and the -V to create the right label. After mounting the ISO

#mount -o loop asteriskNOW-beta6-x86.iso /media/ISO/

I copied all the content of the read-only to another folder

#cp -a /media/ISO/ /usr/local/src/CD3/

It is important to notice here that there is a file that it will not get copied by issuing the cp -a command. The file starts with a ”.”. This file is very important without it, the new ISO will be rejected. I had to dig into the sources of anaconda to find out why the image was all the time rejected.

#/media/ISO# find . -name ".*"

The .discinfo file contains:


So make sure that file is in the new image

#cp /media/ISO/.discinfo /usr/local/src/CD2/

Now we can try to add content to the ISO and rebuild it using:

mkisofs -o /tmp/ISO.iso -UDF -b isolinux/isolinux.bin -c isolinux/boot.cat \
                -no-emul-boot -boot-load-size 4 -boot-info-table -l \
                -V "AsteriskNOW Disc 1" -R -r /usr/local/src/CD2

In my case I created a new folder inside of the CD to store documentation and tools. But the final touch is that the CD includes a MD5 integrity check.

The integrity check is implemented as part of anaconda but I discovered later that it can be retrieved as a debian package with the name isomd5sum

isomd5sum is a set of utilities for implanting a MD5 checksum in an ISO (or any block device), then verifying the checksum later. isomd5sum is part of Anaconda; when you boot a RH/Fedora installer and select “verify cd”, it's running isomd5sum.

I downloaded and compiled isomd5sum and compute and verify the new MD5 sum as follows:

echo "Creating ISO"
Setting input-charset to 'UTF-8' from locale.
Unknown file type (unallocated) /usr/local/src/CD2/.. - ignoring and continuing.
Size of boot image is 4 sectors -> No emulation
Total translation table size: 2048
Total rockridge attributes bytes: 1676
Total directory bytes: 2564
Path table size(bytes): 26
Max brk space used 0
3146 extents written (6 MB)
Inserting md5sum into iso image...
md5 = 528b515f53ea3215df5e69ea6100cebe
Inserting fragment md5sums into iso image...
fragmd5 = c726ca4968958d5ddf76166de7c92cf6744a4df1a466a9f1edc8972ac87b
frags = 20
Setting supported flag to 0
/tmp/ISO.iso:   528b515f53ea3215df5e69ea6100cebe
Fragment sums: c726ca4968958d5ddf76166de7c92cf6744a4df1a466a9f1edc8972ac87b
Fragment count: 20
Percent complete: 100.0%   Fragment[20/20] -> OK
The supported flag value is 0
The media check is complete, the result is: PASS.

So in a nutshell these are the steps:

Where is the MD5 stored?

Before adding the MD5 you will see:

MKI Tue Nov 27 11:34:55 2007
2.01.01a33 -o .../ISO.iso -UDF -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -l -V AsteriskNOW Disc 1 -R -r .../CD2
AsteriskNOW Disc 1

Checking the header of the CD we can see now:

# head -5 ISO.iso  | strings
LINUX                           AsteriskNOW Disc 1              
                                                                                                                                                                                                                                                                                                                                                                                                MKISOFS ISO 9660/HFS FILESYSTEM BUILDER & CDRECORD CD-R/DVD CREATOR (C) 1993 E.YOUNGDALE (C) 1997 J.PEARSON/J.SCHILLING                                                                                                                        2007112711255500
ISO MD5SUM = 528b515f53ea3215df5e69ea6100cebe;SKIPSECTORS = 15;RHLISOSTATUS=0;FRAGMENT SUMS = c726ca4968958d5ddf76166de7c92cf6744a4df1a466a9f1edc8972ac87b;FRAGMENT COUNT = 20;THIS IS NOT THE SAME AS RUNNING MD5SUM ON THIS ISO!!                     

A different between both images shows

--- /tmp/a      2007-11-27 11:37:57.000000000 +0100
+++ /tmp/b      2007-11-27 11:38:33.000000000 +0100
@@ -4,7 +4,7 @@
+ISO MD5SUM = 20784ea0ed427c0ce051e2925ea70f76;SKIPSECTORS = 15;RHLISOSTATUS=0;FRAGMENT SUMS = 6e97e74715f4b79537fbdffedbcee6f88adae8db6dee1b8dbbf93619f3ed;FRAGMENT COUNT = 20;THIS IS NOT THE SAME AS RUNNING MD5SUM ON THIS ISO!!                                                                                                                                                                                                                                                                                             

Enjoy your integrity checks!

myhacks/tunning_asterisknow_cd.txt · Last modified: 2009/03/28 14:09 (external edit)
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Noncommercial-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki