Homepage: http://linux.50webs.org/
Forums: (No Registration Necessary)


 Remixing those 14 Debian CDs as 2 DVDs. 


A few months back I downloaded the fourteen i386 Debian Sarge CDs. I burnt them all to CD. On installing Debian (and subsequent installation of software) I found myself doing the "CD shuffle" and figured that having all the software on just two DVDs, would make life a lot easier. Thus, I was introduced to Richard Atterer's program Jigdo, a program that pieces together CDs and DVDs from .deb packages it finds on the internet, CDs, or your hard drive. I ran the jigdo-lite script (included in the Jigdo package) and it flawlessly preformed the conversion of the CDs to DVDs. In this case, I built the DVDs from the CDs, but it was clear that I could also have built the DVDs from the CD iso-images (which I had not deleted from my hard drive).

At this point, I decided to build the DVDs from the CD iso-images and record the process so that I could share my experience with all you Linux users out there. This is the result.

The guide should also work, without alteration, for the amd64 and ia64 editions (but has not been tested on them).

The Jigdo homepage can be found at http://atterer.net/jigdo/
The Jigdo program was written by Richard Atterer.
There is also a Debian Jigdo mini-HOWTO.


 Download the program Jigdo and a set of .jigdo
 and template files for your architecture:


jigdo-bin-0.7.2.tar.bz2

For the i386 architecture CD iso-images, use the following files:

debian-31r0a-i386-binary-1.jigdo 192K
debian-31r0a-i386-binary-2.jigdo 258K
debian-31r0a-i386-binary-1.template 9.8M
debian-31r0a-i386-binary-2.template 8.3M

For the AMD-64 architecture CD iso-images, use the following files:

debian-31r0a-amd64-binary-1.jigdo 213K
debian-31r0a-amd64-binary-2.jigdo 215K
debian-31r0a-amd64-binary-1.template 6.5M
debian-31r0a-amd64-binary-2.template 4.5M

For the IA64 architecture (Intel Itanium CPUs) CD iso-images, use the following files:

debian-31r0a-ia64-binary-1.jigdo 178K
debian-31r0a-ia64-binary-2.jigdo 243K
debian-31r0a-ia64-binary-3.jigdo 11K
debian-31r0a-ia64-binary-1.template 23M
debian-31r0a-ia64-binary-2.template 5.2M
debian-31r0a-ia64-binary-3.template 279K

Do not save the downloaded files in the same directory as the CD iso-images.

This is because the DVD iso-images that you will create, have the same names as some of the CD iso-images.


 Things to do after downloading the necessary packages/files.


First, go to the directory that you have downloaded the files to and unpackage the tar archive jigdo-bin-0.7.2.tar.bz2.

 tar jxf jigdo-bin-0.7.2.tar.bz2

The .jigdo files are gzipped, so we will have to unzip them.

 for a in *.jigdo; do mv $a $a.gz; done; gunzip *.gz

We will be running the script jigdo-bin-0.7.2/jigdo-lite. In order to cycle through the script without it stopping for more input, we will disable the function selectServers() and exit the script whenever this function is called. We do this by changing the line

selectServers() { to selectServers() { exit;

You can either edit the file manually or execute the following two commands.

 cp jigdo-bin-0.7.2/jigdo-lite jigdo-bin-0.7.2/jigdo-lite.old
 awk '{print gensub(/selectServers\(\) \{/,"selectServers() { exit;",1)}' jigdo-bin-0.7.2/jigdo-lite.old > jigdo-bin-0.7.2/jigdo-lite

We now need to create a small script to cycle through the CD iso-images.

To do this, copy the blue text to a file called make-dvd and make it executable.

#! /bin/bash
mkdir z
for a in $(ls -v $2/debian-31r0a*.iso)
do
mount -t iso9660 -o loop $a z
jigdo-bin-0.7.2/jigdo-lite --scan z $1
if [ $? -eq 0 ]; then umount z; exit; fi
umount z
done


Alternatively, you can create the script by cutting, pasting and executing the following command.

 echo -e "#! /bin/bash\nmkdir z\nfor a in \$(ls -v \$2/debian-31r0a*.iso)\ndo\nmount -t iso9660 -o loop \$a z\njigdo-bin-0.7.2/jigdo-lite --scan z \$1\nif [ \$? -eq 0 ]; then umount z; exit; fi\numount z\ndone" > make-dvd; chmod +x make-dvd

Because you need to mount and umount the iso-images, you must run this script as root.

You also need to provide the script with two parameters.

The first, is the .jigdo file corresponding to the DVD you wish to construct.
The second, is the path to the directory containing your CD iso-images.

For example, if you wish to create the DVD associated with the .jigdo file debian-31r0a-i386-binary-1.jigdo and your iso-images are in the directory /this/way/to/my/iso-images/, then you would run the script with the command:

 ./make-dvd debian-31r0a-i386-binary-1.jigdo /this/way/to/my/iso-images

If you have your iso-images in 2 or more different directories, just rerun the script as many times as necessary, changing the path parameter to the new directory, each time.

Running the script will produce output something like this:

Jigsaw Download "lite"
Copyright (C) 2001-2005 | jigdo@
Richard Atterer | atterer.net

-----------------------------------------------------------------
Images offered by `debian-31r0a-i386-binary-1.jigdo':
1: 'Debian GNU/Linux 3.1 r0a "Sarge" - Official i386 Binary-1' (debian-31r0a-i386-binary-1.iso)

Further information about `debian-31r0a-i386-binary-1.iso':
Generated on Tue, 07 Jun 2005 23:41:17 +0200
Path to scan: z

Not downloading .template file - `debian-31r0a-i386-binary-1.template' already present
Found 1192 of the 6728 files required by the template
Copied input files to temporary file `debian-31r0a-i386-binary-1.iso.tmp' - repeat command and supply more files to continue

Jigsaw Download "lite"
Copyright (C) 2001-2005 | jigdo@
Richard Atterer | atterer.net

-----------------------------------------------------------------
Images offered by `debian-31r0a-i386-binary-1.jigdo':
1: 'Debian GNU/Linux 3.1 r0a "Sarge" - Official i386 Binary-1' (debian-31r0a-i386-binary-1.iso)

Further information about `debian-31r0a-i386-binary-1.iso':
Generated on Tue, 07 Jun 2005 23:41:17 +0200
Path to scan: z

Not downloading .template file - `debian-31r0a-i386-binary-1.template' already present
Found 436 of the 5536 files required by the template
17% 111873k/649816k writing image


The output continues like this until all the CD iso-images have been scanned.

Now, go grab a cup of coffee, and when you return your first DVD iso-image should be ready.

To create the 2nd DVD iso-image, repeat with the 2nd .jigdo file, that is, enter a command like:

 ./make-dvd debian-31r0a-i386-binary-2.jigdo /this/way/to/my/iso-images

Now burn your iso-images to DVD and you are done.