[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Any "JIGDO for dummies" guide?



On Mon, Jul 01, 2002 at 02:58:08PM +0700, Rahmat M. Samik-Ibrahim wrote:
> Well, the problem is that it is not so clear for me on what jigdo
> actually does or does not.

You're not alone - somehow, jigdo's concept seems difficult to explain
or understand at first, but once you've got the idea, it's really
simple.

A CD image is a big file with a certain format. At some offsets inside
the image, the files that are contained on the CD are stored. For
example, if the CD contains a 567 byte README file, the iso file might
contain the README data at offsets 20480000 to 20480567. You can
imagine an image like this:

   ___________________________________________________________
  |xxxx| README |xxxxx| foo.deb | bar.deb |x| baz.deb |xxxxxxx|
   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The "x" areas of the image contain things like directory information,
zero padding, disc name, boot block etc etc.

jigdo takes two things as input: The complete image and a couple of
files which might or might not be contained in the image:
   ___________________________________________________________
  |xxxx| README |xxxxx| foo.deb |x| bar.deb | baz.deb |xxxxxxx|
   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        ________       _________   _________                    __________
       | README |     | foo.deb | | bar.deb |                  |worble.deb|
        ~~~~~~~~       ~~~~~~~~~   ~~~~~~~~~                    ~~~~~~~~~~
Through pure magic, jigdo-file finds out which of the supplied
individual files are contained where in the iso. Its output looks like
this:

In the generated .template file:
   ____          _____           _           _________________
  |xxxx| md5#1  |xxxxx|  md5#2  |x|  md5#3  |xxxxxxxxxxxxxxxxx|
   ~~~~          ~~~~~           ~           ~~~~~~~~~~~~~~~~~
  It found README, foo.deb and bar.deb and removed those files' data
  from the template, the template only contains their md5 checksums. 
  The remaining "x" data (including that of baz.deb, which I didn't
  pass to jigdo-file along with README/foo.deb/bar.deb/worble.deb
  above) is compressed and written to the template.

In the generated .jigdo file, there's a mapping from md5 checksums to
URLs:

  md5#1=http://somemirror.org/README
  md5#2=http://somemirror.org/foo.deb
  md5#3=http://somemirror.org/bar.deb

With the information in these two files, jigdo-lite can later download
README, foo.deb and bar.deb and reassemble the image.


> 1. Suppose there is a ".../dists/myowndebs/" directory
>    How would be a script that:
>    - creates all the related Packages and Release files
>    - creates a "myowndebs.iso" file

I hope the explanation above makes it clear that jigdo works at a
lower level: You first generate the finished iso image (using
debian-cd, or plain mkisofs, or whatever), then pass the image and the
files it was generated from to jigdo-file.

> 2. Suppose the result of #1 above can be accessed through 
>      http://do.ma.in/myowndebs.iso     as well as 
>      http://do.ma.in/dists/myowndebs/
>    How could someone create an iso image by using jigdo?
>    How to create the related template and jigdo files?

This one is actually mentioned in the EXAMPLES section of the
jigdo-file manpage - the following is copy & paste from there, with
some strings replaced.

  You have created a CD image `myowndebs.iso' from some of the files
  stored in the directory `/var/www/dists/myowndebs' on your harddisc,
  which is also available online as `http://do.ma.in/dists/myowndebs'. 
  As you don't want to waste space by effectively hosting the same
  data twice (once as files on the HTTP server, once inside the
  image), and you are fed up with users' downloads aborting after
  200MB and their restarting the download dozens of times, you decide
  to use jigdo. How do you prepare the image for download?

  In fact, only one command is necessary:

  jigdo-file make-template --image=myowndebs.iso
    --jigdo=/var/www/dists/myowndebs/myowndebs.jigdo
    --template=/var/www/dists/myowndebs/myowndebs.template
    /var/www/dists/myowndebs//
    --label Mysite=/var/www/dists/myowndebs
    --uri Mysite=http://do.ma.in/dists/myowndebs/

  People can now point jigdo at
  `http://do.ma.in/dists/myowndebs/myowndebs.jigdo' to download your
  image. The template file needs to be accessible as
  `http://do.ma.in/dists/myowndebs/myowndebs.template'.

  Note that nothing prevents you from doing the same for an FTP server
  that isn't administrated by you - in that case, you only need to
  host the `.jigdo' and `.template' files on your own server/homepage.

> 3. Suppose, some debs are missing from the ".../dists/myowndebs/"
>    directory. How to add those debs manually?

If you first pass those debs to jigdo-file while generating the
jigdo/template files, and later remove them from the server, then
jigdo-lite will just break, because it can no longer download them. If
necessary, you can edit the jigdo file in a text editor to correct the
URLs.

If you don't pass those debs to jigdo-file in the first place, their
data will just end up in the template file.

In the case of Debian CDs, we can't guarantee that some file or other
will sooner or later disappear from the servers, so jigdo also
supports "fallback" or secondary servers, which can be specified in
the .jigdo file and which are tried if the selected primary mirror
doesn't hold one of the files.

HTH,

  Richard

-- 
  __   _
  |_) /|  Richard Atterer     |  CS student at the Technische  |  GnuPG key:
  | \/¯|  http://atterer.net  |  Universität München, Germany  |  0x888354F7
  ¯ '` ¯

Attachment: pgpWTdLfkTinc.pgp
Description: PGP signature


Reply to: