想必您已经阅读了上一节,并按照说明操作,将新创建的 ISO 文件刻录到 CD 上,并感到满意。迟早,一些软件包会得到更新,现在您想将旧 CD 捐赠给当地 LUG 安装节上的新手,并为自己刻录一套更新后的 CD。既然您已经快要成为 jigdo 大师了,我们就不会像上一节那样详细地介绍。
第一步是再次下载您想要更新的镜像的 .jigdo 和 .template 文件。您可能想知道为什么需要第二次下载它们。原因是您想要下载的更新后的镜像已经更改。文件可能已被添加或删除,但即使没有,任何更新的软件包或文件都将具有与您首次下载镜像时使用的 .jigdo 和 .template 文件中列出的校验和不同的校验和。
此时,您手中要么拿着过时的 Debian CD,要么硬盘驱动器上有 CD 的过时 ISO 镜像。让我们逐步了解如何获取更新后的 ISO 文件。如果您有 CD,请将其放入 CD 驱动器并挂载它
$ mount /cdrom |
另一方面,如果您有想要更新的 ISO 文件,请将其作为环回设备挂载(您可能需要 root 权限才能执行此操作)。以 Woody 为例
# mount -o loop woody-i386-1.iso /mnt |
现在运行 jigdo-lite,并将.jigdo文件作为参数。
$ 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 正在要求我们提供您挂载的 CD(如果您正在更新 CD)或环回挂载的 ISO 文件(如果您正在使用 ISO 文件)的位置。我正在使用环回挂载在/mnt上的 ISO 文件,所以我将输入/mnt。如果您正在更新 CD,请输入您的 CD 的挂载目录,很可能是/cdrom。在任何一种情况下,jigdo-lite 都会扫描您挂载的媒体的目录,确定哪些文件需要更新,并重用不需要更新的文件。另请参阅第 7.2 节,“关于扫描源的更多信息”。
您可能会看到类似这样的内容
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. |
发生了什么?实际上,我想向您展示这个是因为您迟早会遇到它。我正在更新 ISO 文件,但过时的镜像文件与我正在工作的目录位于同一目录中。Jigdo-lite 想要生成一个名为woody-i386-1.iso的文件,但当前目录中已经有一个同名的文件(过时的镜像)。Jigdo-lite 不想破坏该文件,因此它中止并让我知道我可以删除该文件或使用--force来覆盖该文件。您也可以重命名或移动该文件,但我猜 jigdo-lite 认为我们已经知道这一点。:-)
不要因为镜像文件是环回挂载的就害怕移动或重命名它。文件系统在底层使用 inode,即使您移动或重命名文件,inode 仍然保持不变。您不会损坏挂载在/mnt下的文件系统。至于删除 ISO 文件,也不会损坏挂载的文件系统。只有当 inode 的引用计数降至零时,文件的 inode 才会被释放。挂载 ISO 镜像会增加引用计数,因此只有在您使用 rm 删除文件并且卸载环回设备后,文件才会被真正删除。所有正在更新 CD 的人都不必担心这些。:-)
我将 ISO 文件重命名为woody-i386-1.iso.old并再次运行 jigdo-lite。让我们再试一次
$ 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 记得我想扫描/mnt,并告诉我我可以键入1来扫描该目录,或者再次键入目录名称。因为我是一个有点怪癖的人,所以我再次键入目录名称。
省略号表示一些快速变化的文本。第一个省略号是 jigdo-lite 正在扫描的文件的动态列表。第二个省略号表示写入woody-i386-1.iso.tmp的进度。一旦 jigdo-lite 完成扫描文件并写入临时 ISO 文件,它会打印
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: |
由于您通常没有其他文件扫描源,除了环回挂载的 ISO 文件(或您的 CD),请按 ENTER。然后,Jigdo-lite 将询问您要使用的镜像站点,就像您第一次下载 ISO 时一样。您之前已经回答过这些问题,但如果您真的不记得了,您可能需要重新阅读第 4.4 节。
此时,您将看到 jigdo-lite 正在施展它的魔力。现在这不是很简单吗?