Burning a RedHat CD mini-HOWTO <author> Morten Kjeldgaard , <tt/mok@imsb.au.dk/<newline> and<newline> Peter von der Ahé , <tt/pahe+rhcd@daimi.au.dk/ </author> <date>v1.18, 27 December 1998 <trans>中宿 昌彦 , <tt/masahiko@iname.com/ <tdate>15 Mar 1999 <abstract> <!-- This document describes how to make your own CDs from the Red Hat Linux distribution equivalent to the ones commercially available from Red Hat. The structure of the distribution is described, as well as the procedure needed to include updated RPMS into the distribution. Prerequisites are a good network connection, and a CD-writer. --> このドキュメントには RedHat 社から購入して得ることのできるものと同等の、 あなただけの Red Hat Linux CD を作る方法について、ディストリビューション の構造、および、最新の RPM を含めるための手順が 書かれています。 まず先に 必要な物は 高速なネットワークへの接続と CD ライターです。 <newline> (訳者注)<newline> この文書に書かれている作業を応用すれば、Vine Linux beta 1や Linux Mandrake など いくつかの RedHat Linux ベースのディストリビューションの CD を焼くことも可能ですが、 その場合 この文書中のスクリプトなどを適宜 編集する必要があります。 </abstract> <toc> <!-- <sect>Introduction --> <sect>はじめに<p> <!-- There may be several reasons for making your own CD. Perhaps you're a cheapskate and want to save the $50 cost of the <url url="http://www.redhat.com/" name="Red Hat distribution">. Or, perhaps you want a distribution CD containing the latest distribution with all current updates. This is highly relevant, because after each major release of the Red Hat distribution, there have been loads of updates, several of which are security related. Just take a look at the <url url="ftp://ftp.redhat.com/pub/redhat/redhat-5.1/updates/00README.errata" name="updates/00README.errata"> file. A specific errata sheet also exists for each supported platform. See for example <url url="ftp://ftp.redhat.com/pub/redhat/updates/5.1/i386/00README.errata" name="the Intel errata sheet"> --> オリジナルの CD を作りたい理由はいくつかあるでしょう。例えば、 あなたはケチン坊で <url url="http://www.redhat.com/" name="Red Hat Linux"> に払う $50 が惜しいとか、あるいは、現在できるすべてのアップデートが なされた 最新版の CD が欲しいとか・・・。こう思うのはもっともなことです。なぜなら 個々のリリースの後には必ずと言っていいほど、セキュリティーがらみの物を含む 修正がなされているからです。 <url url="ftp://ftp.redhat.com/pub/redhat/redhat-5.2/updates/00README.errata" name="updates/00README.errata"> をご覧ください。 プラットフォーム別の 修正点(エラッタ, errata)の一覧もあります。参考までに、Intel アーキテクチャ用 の <url url="ftp://ftp.redhat.com/pub/redhat/updates/5.2/i386/00README.errata" name="the Intel errata sheet"> をご覧ください。 <!-- <sect>Anatomy of the Red Hat FTP site<p> --> <sect>Red Hat FTP サイトの構造<p> <!-- In the spirit of the Linux community, Red Hat Software has made available their Linux distributions for several platforms on their FTP site. These are all available from the top distribution directory. --> Red Hat Software は Linux コミュニティの精神に基づき、いくつかの プラットフォーム向けの Linux ディストリビューションを FTP サイトから 利用できるようにしており、すべて、トップディレクトリから たどることができます。 <!-- <sect1>The top level directory<p> --> <sect1>トップレベルディレクトリ<p> <!-- The toplevel directory for RedHat Linux release 5.1 ( <url url="ftp://ftp.redhat.com/pub/redhat/redhat-5.1/" name="pub/redhat/redhat-5.1"> ) contains distributions for the different platforms, and a directory containing updates and corrections to program packages that have been published since the release. --> RedHat Linux リリース 5.2 のトップディレクトリ (<url url="ftp://ftp.redhat.com/pub/redhat/redhat-5.2/" name="pub/redhat/redhat-5.2">) には、それぞれのアーキテクチャ(intel、alpha、sparc)向けのディストリビューション、ソースパッケージ、アップデート、が入ったディレクトリがあります。 <tscreen><verb> SRPMS/ alpha/ i386/ sparc/ updates/ </verb></tscreen> <!-- In this document, we use the i386 distribution as an example. The procedure given in this document is likely to work on all platforms supported by Red Hat (Alpha, SPARC, ppc, etc.), but we have only tested it on the i386 platform (the authors would be most interested in additional information). The root of the i386 directory looks like this: --> このドキュメントでは例として i386 ディストリビューションを使用します。 ここに書かれた手順は RedHatによってサポートされたすべての プラットフォーム (Alpha, SPARC, ppcなど)で通用するかもしれませんが、私たちは i386 プラットフォーム でしかテストしていません。(追加情報をお待ちしております) i386ディレクトリの内容は次のようになります。 - <tscreen><verb> -rw-r--r-- 8 ftpuser ftpusers 19686 May 27 1997 COPYING -rw-r--r-- 1 ftpuser ftpusers 3023 May 7 09:58 README -rw-r--r-- 10 ftpuser ftpusers 2751 Sep 18 1997 RPM-PGP-KEY drwxr-xr-x 5 ftpuser ftpusers 96 Jul 15 08:34 RedHat/ drwxr-xr-x 5 ftpuser ftpusers 8192 Jul 15 08:35 doc/ drwxr-xr-x 5 ftpuser ftpusers 8192 Jul 15 08:35 dosutils/ drwxr-xr-x 5 ftpuser ftpusers 8192 Jul 15 08:33 gnome/ drwxr-xr-x 2 ftpuser ftpusers 96 Jun 7 02:47 images/ drwxr-xr-x 4 ftpuser ftpusers 96 Jun 5 12:24 misc/ </verb></tscreen> <!-- The directory contains an abundance of information. Most importantly, the RedHat installation manual can be found in HTML format in the directory <url url="ftp://ftp.redhat.com/pub/redhat/redhat-5.1/i386/doc/rhmanual/manual/doc000.htm" name="doc/rhmanual/manual/">. Next, there is a number of FAQs, and finally, the entire collection of HOWTOs and mini-HOWTOs. --> <tt/doc/ ディレクトリにはたくさんの情報がつまっています。最も重要なものでは、 HTML形式のRedHat インストールマニュアルが <url url="ftp://ftp.redhat.com/pub/redhat/redhat-5.2/i386/doc/rhmanual/manual/doc000.htm" name="doc/rhmanual/manual/"> ディレクトリに あります。 そのほかに、たくさんのFAQ、そして、HOWTO とmini-HOWTO がすべて入っています。 <!-- The <tt /images/ directory contains boot floppy images that must be copied to a diskette. In the most recent distribution (5.1), there are two disk images available. The boot image is called <tt/boot.img/, which is required when installation is performed directly from a CD-ROM. If installation from a local hard disk, NFS mounted disk or FTP is required, the supplementary disk image <tt/supp.img/ might be needed. See section <ref id="sec-install" name="Installing from the CD"> and references therein for details. The <tt/misc/ directory contains source and executables of a number of programs needed for the installation. --> <tt /images/ ディレクトリには 起動 フロッピーのディスクイメージが入っており、 これらは、フロッピーディスクにコピーして使います。最も新しい ディストリビューション(5.2)では 2つのディスクイメージが利用可能になっています。 <p> boot イメージは <tt/boot.img/ と名付けられています。このディスクはCD-ROMから 直接インストールを実行する場合に必要です。ローカルハードディスクや、NFS経由、 またはFTPから インストールを行う場合、 supplementaryディスク(ファイル名: <tt/supp.img/)も、必要になります。 詳細は 「<ref id="sec-install" name="CDからのインストール">」の項を参照してください。 <tt/misc/ ディレクトリにはインストールに必要な、多くのプログラムのソースと 実行形式ファイルが含まれています。 <!-- <sect1>The "RedHat" directory - the core of the distribution<p> --> <sect1>"RedHat" ディレクトリ - ディストリビューションの核<p> <!-- The most important part of the directory tree is rooted in the <tt/RedHat/ directory: --> ツリーの中で 最も重要な部分は <tt/RedHat/ディレクトリに含まれています。- <tscreen><verb> drwxr-xr-x 2 ftpuser ftpusers 24576 Jul 15 08:35 RPMS/ drwxr-xr-x 2 ftpuser ftpusers 8192 Jul 15 08:32 base/ -rw-rw-rw- 59 ftpuser ftpusers 0 Aug 15 14:21 i386 drwxr-xr-x 4 ftpuser ftpusers 96 Jun 5 12:24 instimage/ </verb></tscreen> <!-- The <tt/RPMS/ directory contains the major part of the Red Hat distribution consisting of a set of RPM (Redhat Package Manager) files. An RPM package typically contains binary executables, along with relevant configuration files and documentation. See the section <ref id=sec-rpm name="RPM packages"> for more information. --> <tt/RPMS/ ディレクトリには、Red Hat ディストリビューションの主要部分が 多くの RPM (Redhat Package Manager)パッケージのセットという形で 含まれています。典型的な RPM パッケージには、バイナリ実行形式ファイルが 適切な設定ファイル、および ドキュメントとともに納められています。詳しくは 「<ref id=sec-rpm name="RPM パッケージ">」の項を参照してください。 <!-- The <tt/base/ directory holds different book-keeping files needed during the installation process, e.g. the <tt/comps/ file, which defines the <em/components/ (groups of packages) used during the "Choose packages to install" phase. Another important file in the <tt/base/ directory is the <tt/hdlist/ file containing most of the header fields from all the RPMs in the <tt/RPMS/ directory. --> <tt/base/ ディレクトリには <tt/comps/(パッケージのグループを定義する ファイルで,インストールするパッケージの選択時に使用)や、<tt/hdlist/ (<tt/RPMS/ディレクトリ内の 全RPMファイルのヘッダ部分を含むファイル) といった、インストールの過程で必要になる いくつかのデータベースが 納められています。 <!-- This means that all the interdependencies among RPM packages can be determined just by reading <tt/hdlist/ without having to read all the RPM packages which is quite convenient especially during FTP installs. --> <tt/hdlist/ ファイルを読むだけで、全てのRPMファイルを読むこと無しに パッケージ間の 依存関係を知ることができます。これは、FTPからの インストール時に非常に便利です。 <!-- Another use of <tt/hdlist/ is mapping package names to file name, eg. <tt/perl/ to <tt/perl-5.004-6.i386.rpm/. This means that if you want to incorporate updates from RedHat (see section <ref id="sec-updates" name="Incorporating the updates">) or add your own packages to the <tt/RPMS/ directory, you need to update <tt/hdlist/. This is descriped later in <ref id="sec-new-hdlist" name="Generating a new hdlist file">. --> <tt/hdlist/ のもう一つの役割はパッケージ名をファイル名に割り当てることです。 (たとえばパッケージ名 <tt/perl/ :ファイル名 <tt/perl-5.004-6.i386.rpm/)。 これは、更新されたファイルを組み込んだり (「<ref id="sec-updates" name="更新されたRPMと置き換える">」参照)、 独自のパッケージを 組み込んだりする際には <tt/hdlist/ を書き換えなければならないことを示します。後述 の 「<ref id="sec-new-hdlist" name="新しいhdlist ファイルの生成">」参照。 <!-- The <tt/instimage/ directory contains a bare-bones live file system with a number of programs and shared libraries needed during the installation procedure. --> <tt/instimage/ ディレクトリには、インストール手続きに必要な多くのファイルと 共有ライブラリを備えた、ライブ ファイルシステムの骨組みが入っています。 <!-- <sect>RPM packages<label id=sec-rpm><p> --> <sect>RPM パッケージ<label id=sec-rpm><p> <!-- The major part of the Red Hat distribution consists of a set of RPM (Redhat Package Manager) files. An RPM package typically contains binary executables, along with relevant configuration files and documentation. The <tt><url url="http://www.rpm.org" name=rpm></tt> program is a powerful package manager, which can be used to install, query, verify, update, erase and build software packages in the RPM format. <tt/Rpm/ convieniently maintains a database of all the software packages it has installed, so information on the installed software is available at any time. --> Red Hat ディストリビューションの主な部分は RPMファイルのセットから 成り立っています。典型的なRPMパッケージには、バイナリ実行形式ファイルが 適切な設定ファイル、およびドキュメントとともに納め られています。 <tt><url url="http://www.rpm.org" name=rpm></tt> は強力な パッケージ管理 プログラムです。RPM フォーマットに納められたソフトウェアを、install (導入)、 query (調査)、verify (照会)、update (更新)、erase (削除)、そして build (作成)する事ができます。<tt/Rpm/ は、導入されている すべての ソフトウェア・パッケージの情報を データベースに保持しており、 それらは、 いつでも参照することができます。 <!-- The binary RPM files in the distribution have been built on a system running the distribution itself. This is important, because most of the programs in the packages rely on shared libraries. From RedHat version 5.0, the new version 2 of the GNU standard C library (which is 64-bit clean) has been used. This version of the library is commonly referred to as <tt/glibc/ or in Linux: <tt/libc 6/. All executables in the distribution have been linked against this library. If you attempt to install binary files from a different distribution, chances are that they will not work, unless you install the libc5 package for backwards compability. --> バイナリ RPM パッケージは、特定のディストリビューションにおいて動作 するように 作成されています。多くのプログラムは 共有ライブラリに依存していますから、これは重要なことです RedHatでは version 5.0 から (クリーンな64bitコードの) GNU standard Cライブラリが 導入されています。このバージョンのライブラリは、一般に <tt/glibc/ (Linuxにおいては<tt/libc 6/)と呼ばれ、ディストリビューションの中の 実行ファイルは 、全てこのライブラリにリンクされています。そのため、異なる ディストリビューションから持ってきたバイナリファイルをインストールしても、 libc5 パッケージをインストールしない限り動かないでしょう。 <!-- The names of the RPM packages contain the suffix .<em>arch</em>.<tt/rpm/, where <em/arch/ is the architechture, having the value <tt/i386/ for Intel platform binaries. The packages you install must match the versions of the shared libraries available on the machine. The <tt><url url="http://www.rpm.org" name=rpm></tt> program is usually quite good at ensuring that this is indeed the case, however, there are ways around this check, and you should be sure that you know what you are doing if you force installation of packages this way. However, using the RedHat installation boot disk, it is ensured that the correct set of RPM packages are installed on the machine. --> RPM パッケージの名前の末尾には .<em>arch</em>.<tt/rpm/, がつきます。 <em/arch/ はアーキテクチャー名で、Intel プラットフォーム用バイナリには <tt/i386/が 使われます。インストールするパッケージに必要な共有ライブラリ と マシンで 利用可能なライブラリが、適合している必要があります。たいていの 場合、 <tt><url url="http://www.rpm.org" name=rpm></tt>プログラムは 適合している事を保証してくれるのですが、このチェックをかわす いくつかのオプションがありますが、これらを使って依存関係を無視したインストールの 強行を行う場合には、よく考えてから行うようにしてください。ただし、RedHatの インストール起動ディスクを使っているならば、パッケージの間の適合は 完全に保証されます。 <!-- If you discover an RPM package that was not installed on your system during the installation process, don't despair. At any time, you may (as root) install RPM packages, for example: --> インストールの過程で、インストールしなかったRPMパッケージを発見しても がっかりしないでください。あとから、いつでもインストールすることができます。 たとえば(rootになって) - <tscreen><verb> rpm --install WindowMaker-0.18-1b.i386.rpm </verb></tscreen> <!-- You can even install directly from the Internet, if you know the URL of an RPM package: --> RPM パッケージ の URL を知っていれば、インターネットから直接インストールする こともできます。こんな風に - <tscreen><verb> rpm --install ftp://rufus.w3.org/redhat-contrib/noarch/mirror-2.9-2.noarch.rpm </verb></tscreen> <!-- Another version of the RPM packages contain the original sources used to build the binaries. These packages have the suffix <tt>.src.rpm</tt> and are situated in the <tt/SRPMS/ directory. These packages are not needed on the installation CD, and in fact, there is not even enough disk space on an 74 minute burnable CD to accomodate them. Of course, you can make a separate CD with the SRPMS. --> RPM パッケージのもう一つの形態(SRPM)には、バイナリーを作るための オリジナルのソースが入っています。これらのパッケージの名前の末尾は <tt>.src.rpm</tt> のようになっており、それらは <tt/SRPMS/ ディレクトリに 入っています。SRPM は、インストール用CD の中に入っている必要はありません。 実際、74分のCDには それらを格納するスペースはありませんから、SRPM 用に 別のCDを作ってもかまいません。 <!-- <sect>Obtaining your local copy of the distribution<p> --> <sect>ローカルにディストリビューションのコピーを作成する<p> <!-- You need a copy of the distribution on a writable disk which is accessible from the computer having the CD writer (duh!). If you want to incorporate the latest updates, this directory should (also) be accessible from from a Linux machine, either from a local disk, an NFS mounted disk on a different computer, or a JAZ disk. --> CDライターがついたコンピュータから、アクセス可能なコンピュータの 書き込み可能なディスクに、ディストリビューションのコピーを作成しましょう。 更新された ファイルを組み込みたいならば、このディレクトリはLinuxマシンから 書き込み可能でなければなりません。(ローカルディスクや、NFSマウントされた ほかのコンピュータのディスク、またはJAZディスクなど) <!-- You could copy the distribution from a RedHat CD, or you could get it via FTP. If you choose to use FTP, the best way to get a correct copy of the distribution is to use the <tt /mirror/ package. --> RedHat CD 、または FTP の どちらかからディストリビューションをコピーします。 FTP を利用する場合、正確なコピーを作成するために <tt /mirror/ パッケージを 使用するのが最適です。 <!-- Mirror is a sophisticated perl script that compares the content of a directory on a remote site with a local directory. It will use FTP to fetch the files that are on the remote site but not the local site, and delete files on the local site that are not on the remote site. The mirror program is configured with a configuration file. The mirror package is available as an RPM from <url url="http://rufus.w3.org/linux/RPM/mirror.html" name="rufus.w3.org">. <!- or as a tarball from xxxxxxxxxxxxxx.-> --> Mirror はローカルとリモートのディレクトリ内容を比較する精巧な perlスクリプトです。ローカルにあってリモートにないファイルは削除し、 リモートにあってローカルにないファイルは FTPを使用して取ってきます。 mirror プログラムは設定ファイルによって調整できます。 mirror パッケージは RPM形式で <url url="http://rufus.w3.org/linux/RPM/mirror.html" name="rufus.w3.org"> 等から 入手できます。 <!-- Make your local copy <tt/mirror.redhat/ of the mirror configuration file, and edit the relevant fields at the top of the file. After the default section, define these packages: --> mirror の設定ファイルのコピーを <tt/mirror.redhat/ という名前で ローカルディスクに作成します。ファイル上部の 適切な部分を編集してください。 default セクションの後に つぎのように "package" を定義してください。 - <tscreen><verb> package=updates site=ftp.sunsite.auc.dk exclude_patt=(alpha/|sparc/) remote_dir=/disk1/ftp.redhat.com/pub/redhat/redhat-5.2/updates local_dir=/jaz/redhat-5.2/updates package=dist site=ftp.sunsite.auc.dk exclude_patt=(alpha/|sparc/) remote_dir=/disk1/ftp.redhat.com/pub/redhat/redhat-5.2/i386 local_dir=/jaz/redhat-5.2/i386 </verb></tscreen> <!-- The following command will download a copy of the entire RedHat tree on your local disk. <em/*Think*/ before you do this, you are about to transfer approximately 350Mb of data. --> 次のコマンドを実行するとRedHat ツリーのコピーを、ローカルディスク上に 作成します。 <em/(注意)/始める前に・・・よく考えてください。これによって 350Mb以上の データが転送されます。 <tscreen><verb> mirror -pdist mirror.redhat </verb></tscreen> <!-- This will mirror the Red Hat FTP site on your local disk. The content of a Red Hat distribution does not change between releases, so you only need to download this package <em/ONCE/. All changes to the distribution are in the <tt /updates/ directory. Thus, if you want to keep an up-to-date mirror of the Red Hat distribution, you only need to keep the <tt/updates/ directory current. This is done using the command --> こうすることで RedHat FTP サイトをローカルディスクにミラーすることができます。RedHat ディストリビューションの内容は次のリリースまで変わることがないので、ダウンロードは <em/一度/ で OK です。ディストリビューションに対する更新は全て <tt/updates/ ディレクトリで行われます。つまり、Red Hat ディストリビューションを 最新に保つには <tt/updates/ ディレクトリのコピーを最新に保っておけばいい ということです。 この作業は次のコマンドで行えます。 <tscreen><verb> mirror -pupdates mirror.redhat </verb></tscreen> <!-- You can run this regularly, say, once a week, through a cron script. The RedHat distribution is available on a great number of FTP servers around the world, which are updated daily from the master site at <url url="ftp://ftp.redhat.com/pub">. You should choose an FTP site close to you, see the <url name="RedHat FAQ" url="http://www.redhat.com/support/docs/rhl/RedHat-FAQ/RedHat-FAQ-12.html#ss12.1"> --> cron スクリプトを用いることで、この作業を定期的に行うことができます。 RedHat ディストリビューションは世界中の膨大な数の FTPサーバーから 入手可能です。それらのサイトは、マスターサイト <url url="ftp://ftp.redhat.com/pub">をもとに、日々、更新されています。 できるだけ近くのFTPサイトを選ぶようにしましょう。 <url name="RedHat FAQ" url="http://www.redhat.com/support/docs/rhl/RedHat-FAQ/RedHat-FAQ-12.html#ss12.1"> 参照。 <!-- <sect>Incorporating the updates<label id=sec-updates><p> --> <sect>最新版を組み込む<label id=sec-updates><p> <!-- To incorporate the updates, you need write access to the distribution directory from a Linux machine, with a working version of <url url="http://www.rpm.org" name=rpm> installed. There are three steps involved: --> 最新版を組み込むには、<url url="http://www.rpm.org" name=rpm> コマンド の動作するLinuxマシンから、ディストリビューションのあるディレクトリへの 書き込み権が必要です。 次の3つのステップを踏んでいきます - <enum> <!-- <item>Correct the file protection modes. <item>Replace updated RPMs. <item>Generate the hdlist file --> <item>パーミッションの修正 <item>更新されたRPM と置き換える <item>新しいhdlist ファイルの生成 </enum> <!-- If you maintain a mirror of the <tt/updates/ directory, you can at any time produce a CD including the current updates by repeating these steps. --> <tt/updates/ ディレクトリのミラーを維持しているなら、このステップを 踏むことで いつでも最新版を含んだ CDを作成することが可能です。 <!-- <sect1>Correcting the file protection modes<p> --> <sect1>パーミッションの修正<p> <!-- During the installation process, some programs are run directly off the CD. Unfortunately, the FTP program does not always preserve the protection modes of the files and directories that are copied. Therefore, it is necessary to make sure that execute permission is given to programs, shell scripts and shared libraries, before the directory is burned on the CD. This is done by running the <tt/updatePerm/ script on your local copy of the distribution: --> 不幸にも、FTPプログラムは ファイルやディレクトリのパーミッションを そのままにしてくれない場合があります。インストール作業中、いくつかの プログラムは CD 上で直接実行されるため、CD を焼くまえに プログラム、シェルスクリプト、そして 共有ライブラリにきちんと実行許可が 与えられていることを 確認する必要があります。この作業には 次のような <tt/updatePerm/ スクリプト を使います。- <code> #!/bin/bash RHVERSION=5.2 LIST=/tmp/er3hd3w25 CDDIR=/jaz/redhat-${RHVERSION} # Find all directories, and make sure they have +x permission find $CDDIR -type d -exec chmod -c 755 {} \; # Find all files that are executables, shell or perl scripts find $CDDIR -type f | file -f - | grep -v RPM \ | egrep -i 'executable|perl|bourne|shell' | cut -f1 -d: > $LIST # Find shared libraries find $CDDIR -name \*.so >> $LIST # Make them executable while read file do if [ ! -x $file ] ; then chmod -c 755 $file fi done < $LIST /bin/rm $LIST exit 0 </code> <!-- <sect1>Replacing the updated RPMS<label id=sec-updates><p> --> <sect1>更新されたRPM と置き換える<label id=sec-updates><p> <!-- The following script called <tt/updateCD/ copies all files from the update directory to the RPMS directory. The script uses some nifty rpm tricks to determine what packages in the updates directory are more recent. Older packages are moved to the <tt/${OLD}/ directory. --> 次の <tt/updateCD/ というスクリプトは updates ディレクトリの全ての ファイルを RPMS ディレクトリにコピーします。このスクリプトは rpm の いくつかのカラクリを使って、updates ディレクトリの中のより新しい ファイルを推定します。古くなったファイルは <tt/${OLD}/ ディレクトリに 移されます。 <code> #! /bin/bash # This script updates rpms in a RedHat distribution found in $RPMDIR. # The old rpms will be placed in $OLDDIR. # The new rpms should be located in $UPDDIR. # The architechture is $ARCH. RHVERSION=5.2 ARCH=i386 CDDIR=/jaz/redhat-${RHVERSION} RPMDIR=${CDDIR}/${ARCH}/RedHat/RPMS UPDDIR=${CDDIR}/updates/${ARCH} OLDDIR=${CDDIR}/old if [ ! -d $OLDDIR ] ; then echo making directory $OLDDIR mkdir $OLDDIR fi allow_null_glob_expansion=1 for rpm in ${UPDDIR}/*.rpm ; do NAME=`rpm --queryformat "%{NAME}" -qp $rpm` unset OLDNAME for oldrpm in ${RPMDIR}/${NAME}*.rpm ; do if [ `rpm --queryformat "%{NAME}" -qp $oldrpm` = "$NAME" ]; then OLDNAME=$oldrpm; break fi done if [ -z "$OLDNAME" ]; then echo $NAME is new cp -pv $rpm $RPMDIR else if [ `basename $rpm` != `basename $OLDNAME` ]; then mv $OLDNAME $OLDDIR cp -pv $rpm $RPMDIR fi fi done # Copy new boot image files to the right place... for newfile in ${UPDDIR}/images/* ; do file=${CDDIR}$/${ARCH}/images/$(basename ${newfile}) if [ $newfile -nt $file ] ; then cp -pv $newfile $file fi done exit 0 </code> <!-- <sect1>Generating a new hdlist file<label id=sec-new-hdlist><p> --> <sect1>新しいhdlist ファイルの生成<label id=sec-new-hdlist><p> <!-- When installing from the CD, the installation program on the CD relies on the file <tt><file>RedHat/base/hdlist</file></tt> describing what RPM packages are available on the CD. The <tt>hdlist</tt> file can be generated by the program <tt><file>misc/src/install/genhdlist</file></tt>. This program must be run with the root name of the distribution as the only argument. Here is the <tt/updateHdlist/ script which calls that program: --> CD からインストールする際、CD 上の インストールプログラムは CD 上にある <tt>RedHat/base/hdlist</tt> という RPM パッケージの情報を記述したファイルを参照します。この <tt>hdlist</tt> は <tt>misc/src/install/genhdlist</tt> というプログラムに よって 新たに生成する事ができます。次にあげるのが genhdlistを呼び出す <tt/updateHdlist/ スクリプトです。*このスクリプトは、root で 実行しなければいけません。- <code> #!/bin/bash RHVERSION=5.2 ARCH=i386 echo generating hdlist... CDDIR=/jaz/redhat-${RHVERSION} GENHDDIR=${CDDIR}/${ARCH}/misc/src/install chmod u+x ${GENHDDIR}/genhdlist chmod 644 ${CDDIR}/${ARCH}/RedHat/base/hdlist ${GENHDDIR}/genhdlist ${CDDIR}/${ARCH} || echo "*** GENHDLIST FAILED ***" exit 0 </code> <!-- NOTE: After having incorporated the updates in the main <tt>RedHat/RPMS</tt> directory, your copy of the distribution is no longer a mirror of the Red Hat distribution site. Actually, it is more up-to-date! Therefore, if you attempt to mirror the distribution, older versions of the RPM's that have been updated will be downloaded once more, and the updates deleted. --> 注意:メインディレクトリ(<tt>RedHat/RPMS</tt>)に更新された ファイルを組み込んでしまえば、あなたのディストリビューションはもはや Red Hat FTP サイトのミラーではありません。(より新しいものになっています) したがって、ここで間違えて、再び(mirrorコマンドで)ディストリビューションの ミラーを 実行してしまうと、もともとの古いバージョンのRPM が ダウンロードし直され、せっかく置き換えた新しいRPMは消されてしまいます。 <!-- <sect2>Important note for RedHat 5.2<p> --> <sect2>重要:RedHat5.2に関して<p> <!-- As distributed with RedHat version 5.2 and earlier, <tt>genhdlist</tt> CRASHES if there are files in the <tt>RedHat/RPMS</tt> directory which are <em>not</em> RPM files! This causes problems, because in the 5.2 distribution, there are a couple of non-RPM files named <tt/ls-lR/ and <tt/ls-lR.gz/ in <tt>RedHat/RPMS</tt>. Therefore, you must remove all non-RPM files from the directory. Alternatively, you can apply the following patch to <tt><file>misc/src/install/genhdlist.c</file></tt> and do a make. The patch will cause <tt/genhdlist/ to ignore any non-RPM files. --> RedHat バージョン 5.2 以前のものに付属する <tt>genhdlist</tt> は、 <tt>RedHat/RPMS</tt> ディレクトリに RPMファイル <em>以外</em> のファイルが含まれていると クラッシュします。 RedHat 5.2の <tt>RedHat/RPMS</tt> には、2つのRPMではないファイル (<tt/ls-lR/ と <tt/ls-lR.gz/ ) が含まれているため、問題が起こります。対策として、 このディレクトリからRPM以外のファイルを全て削除するか、 <tt>misc/src/install/genhdlist.c</tt> に次のパッチを 当てて make する必要があります。 このパッチを当てることで <tt/genhdlist/ は RPM 以外のファイルを無視するようになります。 <verb> *** genhdlist.c.orig Fri Nov 27 12:08:13 1998 --- genhdlist.c Fri Nov 27 12:08:20 1998 *************** *** 12,23 **** --- 12,26 ---- #define FILENAME_TAG 1000000 + /* Not used apparently... + int tags[] = { RPMTAG_NAME, RPMTAG_VERSION, RPMTAG_RELEASE, RPMTAG_SERIAL, RPMTAG_FILENAMES, RPMTAG_FILESIZES, RPMTAG_GROUP, RPMTAG_REQUIREFLAGS, RPMTAG_REQUIRENAME, RPMTAG_REQUIREVERSION, RPMTAG_DESCRIPTION, RPMTAG_SUMMARY, RPMTAG_PROVIDES, RPMTAG_SIZE, RPMTAG_OBSOLETES }; int numTags = sizeof(tags) / sizeof(int); + */ int main(int argc, char ** argv) { char buf[300]; *************** *** 26,34 **** --- 29,39 ---- struct dirent * ent; int fd, rc, isSource; Header h; + /* not used int count, type; int i; void * ptr; + */ if (argc != 2) { fprintf(stderr, "usage: genhdlist <dir>\n"); *************** *** 74,79 **** --- 79,85 ---- rc = rpmReadPackageHeader(fd, &ero;h, &ero;isSource, NULL, NULL); + if (!rc) { headerRemoveEntry(h, RPMTAG_POSTIN); headerRemoveEntry(h, RPMTAG_POSTUN); headerRemoveEntry(h, RPMTAG_PREIN); *************** *** 110,115 **** --- 116,122 ---- headerWrite(outfd, h, HEADER_MAGIC_YES); headerFree(h); close(fd); + } } errno = 0; </verb> <!-- <sect>At last: burning the CD<p> --> <sect>最後に: CDを焼く<p> <!-- As we assume that you have a working CD-writer on your system, and you know how to use it, we wont go into much detail about burning the CD. If you are burning your CD on a Linux system, you can install the excellent <url url="http://www.fh-muenchen.de/rz/xcdroast" name="XCDroast"> package. In XCDRoast, switch on the Rock Ridge extensions, and the creation of a TRANS.TBL file. --> 察するところ、お持ちのシステムには CD ライターが付いていて、 使い方もご存じだと思いますので、CDを焼く作業については立ち入りません。 が、Linux システム上で CDを焼いておられるならば、すばらしいソフト、 <url url="http://www.fh-muenchen.de/rz/xcdroast" name="XCDroast"> をお試しになって 見てはいかがでしょうか。 XCDRoastは Rock Ridge エクステンションや TRANS.TBL ファイル の生成を サポートしています。 <!-- Make sure the <em>top</em> directory of the CD contains at least the following files and directories: --> CD の<em>トップディレクトリ</em>に 次のファイルとディレクトリが 含まれている事を 確認してください。- <tscreen><verb> COPYING RPM-PGP-KEY README RedHat/ </verb></tscreen> <!-- The following directories might come in handy: --> 次のディレクトリも役に立ちます。- <tscreen><verb> doc/ gnome/ misc/ dosutils/ images/ </verb></tscreen> <!-- <sect1>Creating a bootable CD<p> --> <sect1>ブータブルCDの作成<p> <!-- (This section, thanks to Dawn Endico dawn@math.wayne.edu). Since XCDroast doesn't support creation of bootable disks you'll need to use other tools, for example <tt><url url="ftp://tsx-11.mit.edu/pub/linux/packages/mkisofs/" name="mkisofs"></tt> and <tt><url url="http://www.fokus.gmd.de/research/cc/glone/employees/joerg.schilling/private/cdrecord.html" name="cdrecord"></tt>. Get the latest RPMs for these packages from <url url="ftp://contrib.redhat.com">. You'll need to create an image file which will be written to the CD. This file will be 500Mb or more so find a partition with enough free space and change the path for <tt/redhat.img/ in the following commands if necessary. You may need to be root to use <tt/mount/ and <tt/cdrecord/. --> (このセクションを書いてくれた Dawn Endico さん dawn@math.wayne.edu に感謝!)<newline> XCDroast はブータブルディスクの 作成をサポートしていないため、 その他のツールを使う必要があります。例として <tt><url url="ftp://tsx-11.mit.edu/pub/linux/packages/mkisofs/" name="mkisofs"></tt> や <tt><url url="http://www.fokus.gmd.de/research/cc/glone/employees/joerg.schilling/private/cdrecord.html" name="cdrecord"></tt>を使います。 これらのパッケージの最新版の RPMを <url url="ftp://contrib.redhat.com"> から入手しましょう。そうして CD に焼き付けるイメージファイルを 作成します。このファイルは500Mb以上に なりますから、十分な空きのあるパーティションを 見つけておきましょう。 ここであげるコマンドの例では、このイメージファイルのパスを <tt/redhat.img/ としています。* <tt/mount/ 、<tt/cdrecord/. といった コマンドを使用するには root になる必要があります。 <p> <bf/(訳者注)/ <p> 実は、XCDroast のパッケージには mkisofs および cdrecord が含まれています。 現在(1999/2/28) 最新のバージョンである xcdroast-0.96e パッケージ をインストールすると /usr/lib/xcdroast-0.96e/bin ディレクトリに それぞれ mymkisofs-1.12b4、cdrecord-1.6.1 という名前でインストールされます。 <p> <!-- <sect2>Create disk image<p> --> <sect2>ディスクイメージの作成<p> <!-- Change directory to the place in your mirror that will be the root directory of the cd. For instance, redhat-5.2/i386. --> カレントディレクトリを あなたがミラーしたディレクトリの CDの ルートディレクトリになる位置 (ここでは redhat-5.2/i386 ) に 移動して次のように実行します。 <tscreen><verb> mkisofs -v -r -T -J -V "Red Hat 5.2" -b images/boot.img -c misc/boot/boot.cat -o /tmp/redhat.img . </verb></tscreen> <p> <descrip> <tag/(訳者注 - オプションの説明)/<newline> -v ・・・ 状況とエラーメッセージを表示します。<newline> -r ・・・ RockRidge エクステンション のセット<newline> -T ・・・ TRANS.TBLの生成<newline> -J ・・・ Joliet エクステンションのセット<newline> -V ・・・ ボリューム ID の指定<newline> -b ・・・ ブート イメージの指定<newline> -c ・・・ ブート カタログの指定<newline> -o ・・・ 作成するイメージファイルの名前を指定<newline> </descrip> <p> <!-- <sect2>Test the image<p> --> <sect2>ディスクイメージのテスト<p> <!-- If you're paranoid you can test your new disk image by mounting it. If you forgot to fix the file permissions or set the rock ridge extensions then the error will be obvious here since the file names and directory structure will be wrong. --> 疑り深い人は、イメージをマウントして、チェックしてみてください。 パーミッションの修正や Rock Ridge エクステンションのセットを忘れていたら、 ファイル名やディレクトリ構成が不正なため、エラーが出るでしょう。 <tscreen><verb> mount -t iso9660 -o ro,loop=/dev/loop0 /tmp/redhat.img /mnt/cdrom </verb></tscreen> <!-- When you're done, don't forget to unmount it. --> チェックが終わったらマウントを解除するのを忘れずに・・・ <tscreen><verb> umount /mnt/cdrom </verb></tscreen> <!-- <sect2>Burn the disk<p> --> <sect2>ディスクに焼きつける<p> <!-- Be sure to set the correct speed for your device. This command is for a 4X CDR. You may have a 1X or 2X drive. --> お使いの機器に合った 転送速度を指定してください。この例は 4倍速CDRのものです。 あなたのドライブは 標準速や 2倍速かもしれません。 <tscreen><verb> cdrecord -v speed=4 dev=0,0 /tmp/redhat.img </verb></tscreen> <p> (訳者注) <p> XCDroast は ブータブルCDイメージの <bf>作成</bf>をサポートしていないだけなので mkisofs で作成したブータブルCDイメージを XCDroast を使って焼き付けることは できます。 <p> <!-- <sect>Installing from the CD<label id="sec-install"><p> --> <sect>CD からのインストール<label id="sec-install"><p> <!-- When installing from the new CD, you first need to create a bootable installation diskette. IMPORTANT: use a NEW, freshly MS-DOS formatted diskette! Using an old, worn-out, faulty diskette can result in strange problems during the installation! --> CDからインストールするには、まず、インストール起動ディスクを 作成する 必要があります。<newline> <bf/重要/ - <newline> 新しくて、元気な MS-DOS フォーマット されたディスクを使ってください。古い、くたびれたディスクは インストール中に 思わぬトラブルを引き起こすかもしれません。 <!-- On a Linux system, you can create the diskette using the <tt/dd/ command: --> Linux システム上なら、 <tt/dd/ コマンドを用いて、起動ディスクを作成できます。- <tscreen><verb> dd if=/mnt/cdrom/images/boot.img of=/dev/fd0 bs=1440k </verb></tscreen> <!-- On a system running DOS or Windows-9x, you need to use the <tt/RAWRITE.EXE/ program, which is found on the CD in the <tt/dosutils/ directory. --> DOS やWindows-9x 上で 起動ディスクを作成するには、<tt/RAWRITE.EXE/ というプログラムが必要です。このプログラムは、CD の <tt/dosutils/ ディレクトリに入っています。 <!-- Shut down the machine you want to install (or do a system upgrade) on, insert the boot diskette and your freshly burned CD, and let the machine boot from the diskette. For more information on the installation process, se the documents and the Installation-HOWTO or the Bootdisk-HOWTO which are on the CD in the <tt>doc/HOWTO</tt> directory. --> インストール(またはアップグレード)するマシンをシャットダウンし、 boot ディスクと あなたの 焼いたCD を挿入して、マシンを FD から 起動してください。インストール作業について、より詳細は CD 上の <tt>doc/HOWTO</tt> ディレクトリなどにある Installation-HOWTO 、 bootdisk-HOWTO などのドキュメントを参照してください。 <!-- <sect>This document...<p> --> <sect>このドキュメントについて<p> <!-- The SGML source of the most recent version of this document can be retrieved from <url url="http://imsb.au.dk/~mok/linux/doc/RedHat-CD.sgml">. --> このドキュメントの最新版のSGMLソースは <url url="http://imsb.au.dk/~mok/linux/doc/RedHat-CD.sgml"> から入手できます。 <!-- <sect1>Related documentation<p> --> <sect1>関連するドキュメント<p> <!-- Ed Schlunder <zilym@asu.edu> has written a utility called <tt/fix-rhcd/ to let you check your Red Hat Linux distribution mirror for matching file sizes, names, permissions, and symlinks against an "ls -lNR" listing from the offical Red Hat ftp site. Any permissions that are wrong are changed to match the ls listing. See the <url url="http://www.ajusd.org/~edward/fix-rhcd/" name="fix-rhcd homepage">. --> Ed Schlunder 氏 (zilym@asu.edu) は ローカルディスク上に 作成した Red Hat Linux ディストリビューションのミラーの ファイルサイズ、 ファイル名、パーミッション、シンボリックリンクと 、 RedHat 公式 FTP での "ls -lNR" の結果との整合をチェックする <tt/fix-rhcd/ というツールを 開発しました。どんな些細な パーミッションの不整合があっても、ls の結果に従って 修正されます。 <url url="http://www.ajusd.org/~edward/fix-rhcd/" name="fix-rhcd のホームページ"> をご覧ください。 <!-- <sect1>Acknowledgements<p> --> <sect1>謝辞<p> <!-- Thanks to the following people for valuable input: --> 貴重な情報をくださった次の人々に感謝します - <itemize> <item>Lars Christensen <larsch@cs.auc.dk> <item>Thomas Duffy <tbd@cs.brown.edu> <item>Dawn Endico <dawn@math.wayne.edu> <item>Seva <seva@null.cc.uic.edu> </itemize> <!-- <sect>DISCLAIMER<label id="sec-disclaimer"><p> --> <sect>免責事項<label id="sec-disclaimer"><p> <bf> While the given information in this document is believed to be correct, the authors assume no responsibility whatsoever for any damage to hardware and/or software, or any loss of data resulting from the procedures outlined in this document. </bf> <p> <bf> この文書の中の情報は正確なものと思っていますが、ここに記載された 作業に起因する、ソフトウェア/ハードウェアに対するいかなる損害、 およびデータの損失について、著者たちはいっさいの責任を負いません。 </bf> <sect>付録 - 用語集<p> <descrip> <tag/RockRidge エクステンション/ ISO 9660 の拡張仕様で、 8+3 文字を越えた長いファイル名、 シンボリックリンクなどを記録することができる。 ほとんどの UNIX システムで サポートされている。 <tag/Joliet エクステンション/ Microsoft が提唱するISO 9660 拡張仕様。64文字までの長いファイル名をサポート。 Windows95 および NT4.0以降で読み込むことができる。 <tag/TRANS.TBL ファイル/ RockRidge エクステンションに対応していないシステム(Windows,DOS等)上でも 元のファイル名を知ることができるよう、長いファイル名と元のファイル名との 対応が書かれているファイル。 </descrip> </article> <!-- Local Variables: --> <!-- mode: sgml --> <!-- mode: font-lock --> <!-- fill-column: 75 --> <!-- End: -->