Linuxdoc Linux Questions
Click here to ask our community of linux experts!
Custom Search

5. Updating Your Image

Presumably, you've read the last section, followed the instructions, burned your newly created ISO files onto CD and are feeling warm and fuzzy. Sooner or later, some packages will get updated and now you want to donate your old CDs to some newbie at your local LUG's installfest and burn yourself a set of updated CDs. Since you're well on the way to becoming a jigdo-guru, we won't go into as much painful detail as we did in the last section.

The first step is to download the .jigdo and .template files, again, for the images you want to update. You may wonder why you need to download them a second time. The reason is because the updated image you want to download has changed. Files may have been added or deleted, but even if not, any updated packages or files will have a different checksum from the checksum listed in the .jigdo and .template files you used when you first downloaded the images.

At this point, you're either holding an outdated Debian CD in your hand or you have the CD's outdated ISO image on your hard drive. Let's go through the steps of getting an updated ISO file. If you have a CD, put it in your CD drive and mount it:

      $ mount /cdrom
        

On the other hand, if you have an ISO file you'd like to update, mount it as a loop device (you may need to be root to do this). Using Woody as an example:

      # mount -o loop woody-i386-1.iso /mnt
        

Now run jigdo-lite with the .jigdo file as an argument.

      $ jigdo-lite woody-i386-1.jigdo 
      
      -----------------------------------------------------------------
      Jigsaw Download "lite"
      Copyright 2001-2002 by Richard Atterer <jigdo@atterer.net>
      Loading settings from `/home/p/.jigdo-lite'
      
      -----------------------------------------------------------------
      Images offered by `woody-i386-1.jigdo':
        1: Debian GNU/Linux 3.0 r0 Woody
             - Official i386 Binary-1 CD (debian-30r0-i386-binary-1.iso)
      
      Further information about `debian-30r0-i386-binary-1.iso':
      Generated on Thu, 18 Jul 2002 14:34:12 +0100
      
      -----------------------------------------------------------------
      If you already have a previous version of the CD you are
      downloading, jigdo can re-use files on the old CD that are also
      present on the new image, and you do not need to download them
      again.  You found the secret message; you're a very careful
      reader.  Mount the old CD ROM and enter the path it is mounted
      under (e.g. `/mnt/cdrom'). Alternatively, just press enter if you
      want to start the download of any remaining files.
      
      You can also enter a single digit from the list below to
      select the respective entry for scanning:
        1: /mnt
      Files to scan:
        

jigdo-lite is asking us to give it the location of your mounted CD (if you're updating a CD) or your loop mounted ISO file (if you're using the ISO file). I'm using an ISO file loop mounted on /mnt, so I'll enter /mnt. If you're updating a CD, enter the mount directory of your CD, which is most likely /cdrom. In either case, jigdo-lite will scan the directory of your mounted media, determine which files need updating and re-use the files which don't need updating. See also Section 7.2, "More About Scan Sources".

You may see something like:

      Files to scan: /mnt/other
      
      Not downloading .template file - `woody-i386-1.template' already present
      jigdo-file: Output file `debian-30r0-i386-binary-1.iso' already exists - delete
      it or use --force
      jigdo-file failed with code 3 - aborting.
        

What happened? Actually, I wanted to show you this because you'll bump into it sooner or later. I'm updating an ISO file, but the outdated image file is in the same directory I'm working in. Jigdo-lite wants to generate a file called woody-i386-1.iso but there's already a file by that name in the current directory (the outdated image). Jigdo-lite doesn't want to destroy that file, so it bails and lets me know that I can either delete that file or use --force to overwrite the file. You could also rename or move the file too, but I guess jigdo-lite assumes we already know this.   :-)

Don't be timid about moving or renaming the image file just because it's loop mounted. The filesystem uses inodes under the hood, and even if you move or rename the file, the inode stays the same. You won't hurt the filesystem mounted under /mnt. As for deleting the ISO file, that won't hurt the mounted filesystem either. A file's inode gets deallocated only when the inode's reference count drops to zero. Mounting the ISO image bumps the reference count up, so the file really gets deleted only after you rm the file and umount the loop device. All you people who are updating the CD don't have to worry about any of this. :-)

I'll rename the ISO file to woody-i386-1.iso.old and run jigdo-lite again. Let's try again:

      $ jigdo-lite woody-i386-1.jigdo
      
      -----------------------------------------------------------------
      Jigsaw Download "lite"
      Copyright 2001-2002 by Richard Atterer <jigdo@atterer.net>
      Loading settings from `/home/p/.jigdo-lite'
      
      -----------------------------------------------------------------
      Images offered by `woody-i386-1.jigdo':
        1: Debian GNU/Linux 3.0 r0 Woody - Official i386 Binary-1 CD
             (debian-30r0-i386-binary-1.iso)

      Further information about `debian-30r0-i386-binary-1.iso':
      Generated on Thu, 18 Jul 2002 14:34:12 +0100
      
      -----------------------------------------------------------------
      If you already have a previous version of the image you are
      downloading, jigdo can re-use files on the old image that are also
      present on the new image, and you do not need to download them
      again. Mount the old CD ROM and enter the path it is mounted under
      (e.g. `/mnt/cdrom'). Alternatively, just press enter if you want
      to start the download of any remaining files.
      You can also enter a single digit from the list below to
      select the respective entry for scanning:
        1: /mnt
      Files to scan: /mnt
      Not downloading .template file - `woody-i386-1.template' already present
      ...
      Found 1200 of the 1224 files required by the template                          
      ...

jigdo-lite remembers that I wanted to scan /mnt and tells me I can either type 1 to scan that directory or type the directory in again. Since I'm a perverse person, I type the name of the directory again.

The ellipsis represent some text that changes rapidly. The first ellipsis is a dynamic list of what files jigdo-lite is scanning. The second ellipses denotes progress in writing woody-i386-1.iso.tmp. Once jigdo-lite finishes scanning the files and writing the temporary ISO file, it prints:

      Copied input files to temporary file `woody-i386-1.iso.tmp'
         - repeat command and supply more files to continue
      
      -----------------------------------------------------------------
      If you already have a previous version of the image you are
      downloading, jigdo can re-use files on the old image that are also
      present on the new image, and you do not need to download them
      again. Mount the old CD ROM and enter the path it is mounted under
      (e.g. `/mnt/cdrom'). Alternatively, just press enter if you want
      to start the download of any remaining files.
      You can also enter a single digit from the list below to
      select the respective entry for scanning:
        1: /mnt
      Files to scan: 
        

Since you normally don't have another source of files to scan other than your loop mounted ISO file (or your CD), press ENTER. Jigdo-lite will then ask you about which mirrors you want to use, just like it did when you downloaded your ISO for the first time. You've already answered these questions before, but if you truly don't remember, you might want to re-read Section 4.4.

At this point, you'll see jigdo-lite working its magic. Now wasn't that easy?