RedHat Linux KickStart HOWTO <author>Martin Hamilton <tt/<martinh@gnu.org>/ <date>v0.2, 11 January 1999 <trans>藤原輝嘉 <tt/<fujiwara@linux.or.jp>/ <tdate>16 May 1999 <abstract> <!-- This HOWTO briefly describes how to use the RedHat Linux <em>KickStart</em> system to rapidly install large numbers of identical Linux boxes. For advanced users, we describe how to modify the KickStart installation procedure to do your own thing, and give a quick guide to building RPM packages of your own. --> 本 HOWTO ドキュメントは,RedHat Linux の <em>KickStart</em> システムを 使って同一の Linux マシンを素早く大量にインストールする方法を説明します. また上級ユーザ向けに,KickStart のインストール手続きを修正して独自の処 理をさせる方法と,独自 RPM パッケージの構築方法を簡単に説明します. </abstract> <toc> <!-- <sect>Copyright<p> --> <sect>著作権表示<p> Copyright (c) 1998 Martin Hamilton, All rights reserved. This is free documentware; you can redistribute it and/or modify it under the terms of version 2 or later of the <url name="GNU General Public License" url="http://www.gnu.org/copyleft/gpl.html">.<p> <!-- <sect>Homepage<p> --> <sect>ホームページ<p> <!-- If you got this document from a Linux HOWTO mirror site or a CD-ROM, you might want to check back to the <url name="KickStart HOWTO home page" url="http://wwwcache.ja.net/dev/kickstart/"> to see if there's a newer version around.<p> --> 本ドキュメントを Linux HOWTO ドキュメントのミラーサイトや CD-ROM から 入手した場合には,<url name="KickStart HOWTO ホームページ" url="http://wwwcache.ja.net/dev/kickstart/"> を見て,より新しい版が出 ていないかどうかを確認するとよいでしょう.<p> <sect>日本語訳について<p> <p> 日本語訳は Linux Japanese FAQ Project が行いました (藤原輝嘉 <fujiwara@linux.or.jp>(日本語訳), 中野武雄 <nakano@apm.seikei.ac.jp>(校正)). 日本語訳に関する誤りの指摘や,原文の作者にフィードバックをしたいけれど 英語は苦手だという方は JF プロジェクト(<JF@linux.or.jp>) までご連絡ください. <p> 原文のライセンスに従いまして,日本語訳の配布ライセンスは <url name="GNU General Public License" url="http://www.gnu.org/copyleft/gpl.html">(バージョン 2 以降)となりま す. <!-- <sect>Introduction<p> --> <sect>はじめに<p> <!-- RedHat Linux version 5 comes with a a little-known (and until now, not hugely documented) feature called <em>KickStart</em>. This lets you automate most/all of a RedHat Linux installation, including:<p> --> RedHat Linux のバージョン 5 には,<em>KickStart</em> と呼ばれる,あまり 知られていない(現時点ではドキュメントもあまりありません)機能が付いてい ます.この機能を用いると,RedHat Linux のインストール作業の大部分 (ある いは全て) を自動化することができます.自動化できる処理には以下のものがあ ります:<p> <itemize> <!-- <item> Language selection --> <item> 使用する言語の選択 <!-- <item> Network configuration and distribution source selection --> <item> ネットワークの設定およびディストリビューションのインストール元の選択 <!-- <item> Keyboard selection --> <item> キーボードの選択 <!-- <item> Boot loader installation (e.g. lilo) --> <item> (lilo 等の)ブートローダのインストール <!-- <item> Disk partitioning and filesystem creation --> <item> ディスクのパーティション設定とファイルシステムの作成 <!-- <item> Mouse selection --> <item> マウスの選択 <!-- <item> X Window system server configuration --> <item> X ウィンドウシステムのサーバの設定 <!-- <item> Timezone selection --> <item> タイムゾーンの選択 <!-- <item> Selection of an (initial) root password --> <item> root のパスワード(の初期値)の選択 <!-- <item> Which packages to install --> <item> インストールするパッケージの選択 </itemize><p> <!-- Eagle eyed RedHat users will probably have realised by now that these are essentially the main steps involved in the manual installation of a RedHat Linux system. KickStart makes it possible for you to script the regular installation process, by putting the information you would normally type at the keyboard into a configuration file.<p> --> 察しの良い RedHat ユーザであれば,これらは本質的に RedHat Linux システ ムを手動インストールする際の手順であることに気づいたかと思います. KickStart システムは通常のインストール手順をスクリプト記述することを可 能にします.これは,通常はキーボードから入力すべき情報を設定ファイルに 書くことによって行います.<p> <!-- <em>But wait - there's more :-)</em><p> --> <em>しかしお待ちください.話はまだあります :-)</em><p> <!-- Having finished the normal installation process, KickStart also lets you specify a list of shell level commands which you would like to be executed. This means that you can automatically install extra local software not distributed as part of RedHat Linux (yes, there are even more free software programs than the ones you get with the RedHat distribution. Some can't be distributed by RedHat on legal grounds, e.g. the <tt>ssh</tt> and <tt>PGP</tt> encryption systems) and carry out any tidying up you may need to do in order to get a fully operational system.<p> --> KickStart を使うと,通常のインストール処理を終えた後に,さらにシェ ルレベルのコマンド群を指定して実行させることができます.つまり, RedHat Linux の一部として配布されていないローカル向けのソフトウェアを 自動的に追加インストールして(フリーソフトウェアであっても,RedHat ディストリビューションに付いてこないものがあります.法的な理由により RedHat が配布できないものもあります.例えば <tt>ssh</tt> や暗号化シス テム <tt>PGP</tt> です),完全に使えるシステムにするために必要な仕上げ を行うことができるのです.<p> <!-- <sect>Prerequisites<p> --> <sect>必要なもの<p> <!-- There are two approaches to a KickStart install - one is to simply copy your KickStart configuration file to a RedHat boot floppy. The other is to use a regular boot floppy and get your KickStart config file off the network.<p> --> KickStart を使ったインストールには 2 つのアプローチがあります.1 つは 単に KickStart の設定ファイルを RedHat の起動フロッピーにコピーすると いうものです.もう 1 つの方法は,通常の起動フロッピーを用い,KickStart の設定ファイルはネットワーク経由で取り込むという方法です.<p> <!-- In both cases, you'll need: --> どちらの場合にも以下のものが必要です: <enum> <!-- <item> Intel (i386) class machines - KickStart appears to only work on these at the time of writing. --> <item> Intel (i386) 系のマシン - この文書を執筆している時点では, KickStart はこれらのマシンでなければ動作しないようです. <!-- <item> KickStart config file - we'll talk about this in the next section. --> <item> KickStart の設定ファイル - こちらについては次のセクションで説明 します. <!-- <item> RedHat boot disk - preferably from the <em>updates</em> directory, to take advantage of any fixes/driver updates. --> <item> RedHat の起動ディスク - 修正パッケージやドライバの更新パッケー ジを利用するため <em>updates</em> ディレクトリから入手することが望まし いでしょう. <!-- <item> DNS entries for the IP addresses you'll be using - optional, but will stop the installation from prompting you for your machine's domain name. --> <item> 使おうとしている IP アドレスの DNS エントリ - これは無くても構 いませんが,これを指定するとインストール時にマシンのドメイン名を入力せ ずに済みます. </enum><p> <!-- If you want to fetch your config file over the network, you'll need to export it via NFS - this is the only access method supported at the moment. The config file lets you specify a different NFS server to fetch the RedHat distribution itself from.<p> --> ネットワークを通して設定ファイルを取り込む場合には,設定ファイルを NFS 経由で エクスポートする必要があります.これは現在サポートされている唯一の アクセス方法です.設定ファイルの指定により,RedHat ディストリビューショ ン本体を別の NFS サーバから取り込むことができます.<p> <!-- You can configure a static IP address for your machine - e.g. a special one reserved for KickStart installations. Alternatively, if you don't want to hard code an IP address in the config file you can tell KickStart to use a BOOTP/DHCP server to fetch this. Some servers will allocate new addresses in a given range automatically, e.g. <url name="the CMU BOOTP server with dynamic addressing extensions" url="ftp://ftp.ntplx.net/pub/networking/bootp">.<p> --> 静的な IP アドレスをマシンに設定することもできます.例えば,KickStart によるインストールのために予約した特別なアドレスです.別の方法として, 設定ファイルに IP アドレスを直書きしたくなければ,BOOTP/DHCP サーバを 使って設定ファイルを取り込むように KickStart に指示することができます. これを用いると,何らかのサーバが指定の範囲内のアドレスを自動的に割り当 てます.このようなサーバとしては, <url name="動的アドレス割り当て拡張付きの CMU BOOTP サーバ" url="ftp://ftp.ntplx.net/pub/networking/bootp">等があります.<p> <!-- More information on NFS and BOOTP/DHCP is in Appendix A.<p> --> NFS や BOOTP/DHCP の詳しい説明については付録 A を参照してください.<p> <!-- <sect>Setting up a boot floppy<p> --> <sect>起動フロッピーの設定<p> <!-- Essentially, all you have to do is copy your KickStart config file to <em>/ks.cfg</em> on the RedHat boot floppy, e.g.<p> --> 本質的には,しなければならない作業は KickStart の設定ファイルを RadHat の起動フロッピーに <em>ks.cfg</em> という名前でコピーすることだけです. この操作は以下のように行います:<p> <tscreen><verb> mcopy ks.cfg a: </verb></tscreen><p> <!-- However - the RedHat boot floppy is pretty full, and you may find that you have to delete some of the other files to make room for the KickStart config file. I was able to make enough room for mine by deleting the various message files normally displayed by the <tt>SYSLINUX</tt> boot loader, e.g.<p> --> しかし RedHat の起動フロッピーには色々なファイルが詰め込んであるので, 他のファイルをいくつか消して空きを作ってやらないと KickStart の設定ファ イルをコピーできないかもしれません.筆者の場合には各種メッセージのファ イルを消せば何とかなりました.このメッセージは普通,ブートローダ <tt>SYSLINUX</tt> が表示するものです.この操作は以下のように行います:<p> <tscreen><verb> mdel a:\*.msg </verb></tscreen><p> <!-- Another approach would be to throw away the drivers for some of the hardware you don't have - see the section on modifying the boot floppy below.<p> --> 別の方法としては,持っていないハードウェアのドライバをいくつか捨ててし まうこともできるでしょう.後述の起動フロッピーの修正に関するセクション をご覧ください.<p> <!-- You may also want to edit <em>syslinux.cfg</em>, the <tt>SYSLINUX</tt> config file. This also lives in the top level directory of the RedHat boot floppy. For instance, the following <em>syslinux.cfg</em> will cause KickStart mode to be entered into automatically as the machine boots up, without the normal delay:<p> --> <tt>SYSLINUX</tt> の設定ファイルである <em>syslinux.cfg</em> も編集し たくなるかもしれません.このファイルも RedHat の起動フロッピーのトップ レベルディレクトリにあります.例えば以下のような <em>syslinux.cfg</em> を用いると,マシンの起動時に自動的に KickStart モードに入ります.通常 の入力待ちはありません:<p> <tscreen><verb> default ks prompt 0 label ks kernel vmlinuz append ks=floppy initrd=initrd.img </verb></tscreen><p> <!-- Note that you almost probably want to base your boot and supplementary floppies on the most recent disk images available in the <em>updates/i386</em> on your local RedHat mirror site. Older images may be buggy or have driver support for less hardware.<p> --> 独自の起動フロッピーや補助フロッピーを作る際には,お近くの RedHat のミ ラーサイトの <em>updates/i386</em> ディレクトリにある最新のディスクイ メージを元にするとよいでしょう.古いディスクイメージにはバグがあったり, 対応しているハードウェアが少ないことがあります.<p> <!-- <sect>The KickStart config file<p> --> <sect>KickStart の設定ファイル<p> <!-- There are three main sections to the config file:<p> --> 設定ファイルには 3 つの主なセクションがあります:<p> <enum> <!-- <item> System info, e.g. disk partitioning and network config --> <item> システム情報(ディスクのパーティション情報やネットワークの設定) <!-- <item> RedHat packages to install --> <item> インストールする RedHat のパッケージ <!-- <item> Post-installation shell commands to run --> <item> インストール後に実行するシェルのコマンド </enum<p> <!-- There are some other possibilities which we won't talk about here, but <bf>might</bf> work. For more information check out the sample KickStart config in <em>misc/src/install/ks.samp</em> and <em>doc/README.ks</em> under the top level <em>i386</em> RedHat distribution directory on your CD-ROM or local RedHat mirror site.<p> --> ここで説明しないものも他にいくつかありますが,それも動作すると <bf>思います</bf>.詳しい情報については, <em>misc/src/install/ks.samp</em> にある KickStart の設定例と <em>doc/README.ks</em> を見てください.これらのファイルは,CD-ROM また は RedHat のミラーサイト内の RedHat ディストリビューションのトップディ レクトリにある <em>i386</em> ディレクトリにあります.<p> <!-- <sect1>System info<p> --> <sect1>システム情報<p> <!-- The available directives which I've been using are:<p> --> 利用可能なディレクティブのうち,筆者が使っているものを以下に示します:<p> <descrip> <!-- <tag/lang/Language configuration, e.g. for English --> <tag/lang/ 言語の設定(英語など) <tscreen><verb> lang en </verb></tscreen> <!-- <tag/network/Network configuration, e.g. to use BOOTP/DHCP --> <tag/network/ネットワークの設定(BOOTP や DHCP の使用など) <tscreen><verb> network --bootp </verb></tscreen> <!-- <tag/nfs/NFS server and directory to install from, e.g. --> <tag/nfs/インストール元となる NFS サーバとディレクトリ.指定例は以下: <tscreen><verb> nfs --server chicken.swedish-chef.org /mnt/cdrom </verb></tscreen> <!-- to use the NFS server <em>chicken.swedish-chef.org</em> and try to mount the RedHat distribution from the directory <em>/mnt/cdrom</em>. --> NFS サーバ <em>chicken.swedish-chef.org</em> を使い,RedHat ディストリ ビューションを <em>/mnt/cdrom</em> ディレクトリからマウントします. <!-- <tag/keyboard/Select keyboard type, e.g. for UK keyboards --> <tag/keyboard/キーボードの種類の設定(例えばイギリス用キーボード等) <tscreen><verb> keyboard uk </verb></tscreen> <!-- <tag/zerombr/Clear the Master Boot Record - removes any existing operating system boot loader from your disk --> <tag/zerombr/MBR(Master Boot Record) を消去します.既存のオペレーティ ングシステムのブートローダをディスクから消去します. <!-- <tag/clearpart/Clear existing partitions - e.g. to remove all existing disk partitions prior to installation --> <tag/clearpart/既存のパーティションを消去します.例えば,インストール 前に既存のディスクパーティションを全て消す等の場合です. <tscreen><verb> clearpart --all </verb></tscreen> <!-- <tag/part/Partition the disk, e.g. to make a root filesystem of 500MB --> <tag/part/ディスクのパーティションを切ります.例えば,ルートファイルシステ ムに 500MB を割り当てます. <tscreen><verb> part / --size 500 </verb></tscreen> <!-- <tag/install/Make a fresh installation of RedHat Linux. --> <tag/install/RedHat Linux を新規インストールします. <!-- <tag/mouse/Set the mouse being used, e.g. for a PS/2 or compatible "bus mouse" --> <tag/mouse/使用するマウスを設定します.例えば,PS/2 または PS/2 互換の 「バスマウス」では以下のように設定します. <tscreen><verb> mouse ps/2 </verb></tscreen> <!-- <tag/timezone/Set the timezone, e.g. for local time in the UK --> <tag/timezone/タイムゾーンを設定します.例えば,イギリスのローカル時刻 は以下のように設定します. <tscreen><verb> timezone --utc Europe/London </verb></tscreen> <!-- <tag/rootpw/Set the initial root password, based on a previously derived encrypted password --> <tag/rootpw/root の初期パスワードを設定します.これには予め暗号化した パスワード文字列を与えます. <tscreen><verb> rootpw --iscrypted XaacoeGPmf/A. </verb></tscreen> <!-- <tag/lilo/Install the LILO boot loader, e.g. in the Master Boot Record --> <tag/lilo/ブートローダ LILO をインストールします.マスターブートレコー ド(Master Boot Record, MBR)にインストールするには以下のように指定しま す. <tscreen><verb> lilo --location mbr </verb></tscreen> <!-- <tag/%packages/Packages to install - see below. --> <tag/%packages/インストールするパッケージ.詳しくは後述します. <!-- <tag/%post/Post-installation shell commands - see below. --> <tag/%post/インストール後に実行するシェルのコマンド.詳しくは後述しま す. </descrip><p> <!-- Note that the directory where KickStart is looking for the RedHat distribution should have a subdirectory <em>RedHat</em>, which contains the RedHat distribution tree for the platform in question. In the above example, we should see something like the following files and directories:<p> --> KickStart が RedHat ディストリビューションを探すディレクトリには, <em>RedHat</em> という名前のサブディレクトリが必要だということに注意 してください.このディレクトリ内には,該当プラットフォーム用の RedHat ディストリビューションがあります.先に示した例では,以下のようなファイ ルとディレクトリがあるはずです:<p> <tscreen><verb> /mnt/cdrom/RedHat /mnt/cdrom/RedHat/base /mnt/cdrom/RedHat/contents /mnt/cdrom/RedHat/i386 /mnt/cdrom/RedHat/instimage /mnt/cdrom/RedHat/RPMS /mnt/cdrom/RPM-PGP-KEY </verb></tscreen><p> <!-- If you're installing off a CD-ROM rather than off the network, the contents should look something like this:<p> --> ネットワーク経由でなく CD-ROM からインストールしているなら,ディレクト リの内容は以下のようになるはずです:<p> <tscreen><verb> RedHat RedHat/base RedHat/contents RedHat/i386 RedHat/instimage RedHat/RPMS RPM-PGP-KEY </verb></tscreen><p> <!-- If you have the RedHat distribution for multiple architectures (e.g. on an NFS server - they're too big to fit more than one architecture's version onto a single CD-ROM), you'll notice that each distribution has the same files and directories under a subdirectory, e.g.<p> --> 複数アーキテクチャ用の RedHat ディストリビューションがある場合( NFS サーバ上などにあるはずです.複数アーキテクチャのディストリビューション は 1 枚の CD-ROM に収まりません)には,それぞれのディストリビューション には,以下のようなサブディレクトリの下に同じ名前のファイル群やディレク トリ群があると思います:<p> <tscreen><verb> alpha/RPM-PGP-KEY i386/RPM-PGP-KEY sparc/RPM-PGP-KEY </verb></tscreen><p> <!-- There should be a file <tt>architecture</tt>/Redhat/<tt>architecture</tt>, e.g. <em>i386/Redhat/i386</em>.<p> --> <tt>architecture</tt>/Redhat/<tt>architecture</tt> というファイルが存 在しなければなりません(例: <em>i386/Redhat/i386</em>).<p> <!-- If you want to create your own encrypted passwords, it's very easy using Perl, e.g.<p> --> 暗号化したパスワード文字列を作るのは,Perl を使えばとても簡単です.例 えば以下のように行います.<p> <tscreen><verb> % perl -e 'print crypt("schmurrdegurr", "Xa") . "\n";'p </verb></tscreen><p> <!-- Other options (or mooted options), which I've not tried:<p> --> その他のオプション(および実際には使われないオプション)を示します.筆者 は試していません:<p> <descrip> <!-- <tag/cdrom/Install off CD-ROM rather than network. --> <tag/cdrom/ネットワークではなく CD-ROM からインストールします. <!-- <tag/device/Explicitly declare device details, e.g. --> <tag/device/デバイスの詳細事項を明示的に宣言します.指定例を以下に示し ます. <tscreen><verb> device ethernet 3c509 --opts "io=0x330, irq=7" </verb></tscreen> <!-- Alternative values of <tt>device</tt> include <tt>scsi</tt> for SCSI controllers and <tt>cdrom</tt> for proprietary CD-ROM drives. --> <tt>device</tt> オプションに指定できる値は,SCSI コントローラ用の <tt>scsi</tt>, 独自 CD-ROM ドライブ用の <tt>cdrom</tt> です. <!-- <tag/upgrade/Upgrade an existing installation rather than make a fresh installation. --> <tag/upgrade/新規インストールではなく,既にインストールしているものを 更新します. <!-- <tag/xconfig/Configure X Window server, graphics card and monitor. e.g. --> <tag/xconfig/X ウィンドウのサーバ,グラフィックカード,モニタを設定し ます. <tscreen><verb> xconfig --server "Mach64" --monitor "tatung cm14uhe" </verb></tscreen> </descrip><p> <!-- I've not delved too deeply into this last one, because I'm not ever planning to run X on the console of any of my KickStarted machines. I'm told that running <tt>xconfig</tt> within KickStart itself is a bit flaky, but the same functionality is also available from the command line via <tt>Xconfigurator</tt> - so you might be best off leaving this to the post-installation script.<p> --> 最後のオプションについてはあまり詳しく調べていません.というのも,筆者 は KickStart でインストールしたマシンのコンソールで X を実行する予定が ないからです.筆者は KickStart 内で <tt>xconfig</tt> を実行すると動作 がちょっと変になると聞いていますが,同じ機能は <tt>Xconfigurator</tt> を使っ てコマンドラインから実現できます.したがって,X の設定はインストール後 のスクリプトに残しておくのが良いでしょう.<p> <!-- Here's how this first part of a KickStart config file looks when we put all the bits together:<p> --> KickStart の設定ファイルの最初の部分を示します.このファイルは,先程説 明したオプションを組み合わせて作ります:<p> <tscreen><verb> lang en network --static --ip 198.168.254.253 --netmask 255.255.255.0 --gateway 198.168.254.1 --nameserver 198.168.254.2 nfs --server chicken.swedish-chef.org /mnt/cdrom keyboard uk zerombr yes clearpart --all part / --size 500 part swap --size 120 install mouse ps/2 timezone --utc Europe/London rootpw --iscrypted XaacoeGPmf/A. lilo --location mbr </verb></tscreen><p> <!-- Note that some of the RedHat documentation refers to an invocation of the <tt>network</tt> directive which doesn't actually work in practice: <tt>network —option</tt>. The correct invocation is to put <tt>network</tt> followed by <tt>—static</tt>, <tt>—bootp</tt> or <tt>—dhcp</tt>. Be aware that the BOOTP and DHCP options are different - to the extent that they even use different code.<p> --> RedHat に関する書籍の一部には,実際には動作しない <tt>network</tt> ディ レクティブ(<tt>network --option</tt>)を呼び出すような記述を行っている ものがあるので注意してください.正しい呼び出し方は,<tt>network</tt> の後に <tt>--static</tt>, <tt>--bootp</tt>, <tt>--dhcp</tt> のいずれか を記述します.BOOTP オプションと DHCP オプションは別のものであることを 覚えておいてください.両者は別のコードで書かれているくらい違っています.<p> <!-- You can add the <tt>—grow</tt> parameter to a <tt>part</tt> directive to indicate that it's OK to grow the partition beyond the size you specify. It probably only makes sense to have one partition tagged with <tt>—grow</tt>.<p> --> <tt>part</tt> ディレクティブには引き数 <tt>--grow</tt> を追加すること ができます.この引き数は,指定したサイズよりもパーティションを大きくし てよいことを指示します.この指定が意味を持つのはパーティションが 1 つ あり,これに <tt>--grow</tt> というタグが付いている場合だけでしょう.<p> <!-- <sect1>Packages to install<p> --> <sect1>インストールするパッケージ<p> <!-- The start of the packages section of the KickStart config file is indicated by the presence of a <tt>%packages</tt> directive on a line of its own. This is followed by one or both of two types of package specifier - individual packages may be installed by giving the name of their RPM (excluding the version and platform information), and groups of packages may be installed by giving their group name.<p> --> KickStart の設定ファイルの packages セクションの先頭には, <tt>%packages</tt> ディレクティブだけを書いた行を置きます.この後には 2 つのタイプのうちの 1 つあるいは両方のパッケージ指定子を書きます. それぞれのパッケージは,RPM の名前(バージョンとプラットフォームの情報 は含めません)を指定することによってインストールすることができます.ま たパッケージのグループは,グループの名前を指定すればインストールできま す.<p> <!-- Here's a sample <tt>packages</tt> section for a KickStart config file: --> KickStart の設定ファイルの <tt>packages</tt> セクションの設定例を以下 に示します: <tscreen><verb> %packages @ Base netkit-base bind-utils ncftp rdate tcp_wrappers traceroute cmu-snmp </verb></tscreen><p> <!-- So, what are these groups ? Well, there are a number of groups defined by default in a file called <em>base/comps</em> under the RedHat distribution's top level directory. Here are the ones which were current at the time of writing:<p> --> さて,これらのグループは何でしょうか? たくさんのグループがデフォルトで 定義されていますね.これは RedHat ディストリビューションのトップレベル ディレクトリにある <em>base/comps</em> というファイルに書かれています. 本ドキュメントの執筆の時点におけるグループを示します:<p> <itemize> <item> Base <item> Printer Support <item> X Window System <item> Mail/WWW/News Tools <item> DOS/Windows Connectivity <item> File Managers <item> Graphics Manipulation <item> X Games <item> Console Games <item> X multimedia support <item> Console Multimedia <item> Print Server <item> Networked Workstation <item> Dialup Workstation <item> News Server <item> NFS Server <item> SMB (Samba) Connectivity <item> IPX/Netware(tm) Connectivity <item> Anonymous FTP/Gopher Server <item> Web Server <item> DNS Name Server <item> Postgres (SQL) Server <item> Network Management Workstation <item> TeX Document Formatting <item> Emacs <item> Emacs with X windows <item> C Development <item> Development Libraries <item> C++ Development <item> X Development <item> Extra Documentation </itemize><p> <!-- You'll notice that they correspond to the various configurations which you're prompted for during a manual installation. Note that some of the packages in a given package group are duplicated in other groups, and that you can install multiple groups of packages without this causing problems. Each group's entry in the <em>comps</em> listing looks similar to this:<p> --> このリストは手動インストールの時にユーザが尋ねられる各種設定に対応して いることにお気づきかと思います.一部のパッケージは複数のグループに含ま れていますが,それらのグループを同時にインストールしても問題はありませ ん.<em>comps</em> リスト中の各グループエントリは以下のようになってい ます:<p> <tscreen><verb> 0 Extra Documentation sag lpg howto faq man-pages end </verb></tscreen><p> <!-- It seems that groups with a <em>1</em> next to their name (the first line above) are selected for installation by default. You can customise the Linux installation process even further by creating your own groups or redefine existing ones by editing this file.<p> --> 名前(上のリストの最初の行)の隣が <em>1</em> であるグループは,デフォル トでインストールされるものとして選択されます.このファイルを編集して独 自のグループを作ることや,既存のグループを再定義することにより,Linux のインストール処理をさらにカスタマイズできます.<p> <!-- <sect1>Post-installation shell commands<p> --> <sect1>インストール後のシェルコマンド<p> <!-- This is probably the best feature of all, and something which there is no direct equivalent to in the manual installation process. What we can do here is specify a sequence of shell level commands which should be executed after the main installation (disk partitioning, package installation, and so on) is complete.<p> --> この機能が多分最も特筆すべきものであり,手動インストールにはこれ直接に 対応するものはありません.ここで行えることはシェルのコマンド列を指 定することであり,実行されるのはインストールの主要な部分(ディスクのパー ティション分割,パッケージインストール等)が終わった後になります.<p> <!-- The beginning of this section is signified by the <tt>%post</tt> directive in the KickStart config file. In what follows you can take advantage of all of the utilities which have been installed on your newly built Linux system, e.g.<p> --> KickStart の設定ファイル中において,このセクションの先頭の印は <tt>%post</tt> ディレクティブです.これ以降の部分では,新しく構築した Linux システムにインストールされているユーティリティを全て使用すること ができます.指定例を以下に示します:<p> <tscreen><verb> %post ln -s /etc/rc.d/init.d /etc/init.d ln -s /etc/rc.d/rc.local /etc/rc.local ln -s /usr/bin/md5sum /usr/bin/md5 ln -s /usr/bin/perl /usr/local/bin/perl chmod ug-s /bin/linuxconf mkdir /var/tmp/tmp perl -spi -e 's!image=/boot/vmlinuz-.*!image=/boot/vmlinuz!' /etc/lilo.conf rm /etc/rc.d/rc*.d/*sendmail </verb></tscreen><p> <!-- You can also use I/O redirection and here documents:<p> --> I/O リダイレクションやヒアドキュメントを使うこともできます:<p> <tscreen><verb> cat <<EOF >>/etc/passwd squid:*:102:3500:Squid Proxy:/usr/squid:/bin/bash EOF cat <<EOF >>/etc/group cache:x:3500: EOF </verb></tscreen><p> <!-- Modify the run-time startup scripts:<p> --> 以下に示す例は,システムの起動スクリプトを修正するものです:<p> <tscreen><verb> cat <<EOF >>/etc/rc.local echo 8192 > /proc/sys/kernel/file-max echo 32768 > /proc/sys/kernel/inode-max [ -x /usr/sbin/sshd ] && /usr/sbin/sshd [ -x /usr/sbin/cfd ] && /usr/sbin/cfd EOF </verb></tscreen><p> <!-- Set up <em>crontab</em> entries:<p> --> これは <em>crontab</em> のエントリの設定例です:<p> <tscreen><verb> cat <<EOF >/tmp/crontab.root # Keep the time up to date 0,15,30,45 * * * * /usr/sbin/ntpdate -s eggtimer 2>&1 >/dev/null # Recycle Exim log files 1 0 * * * /usr/exim/bin/exicyclog # Flush the Exim queue 0,15,30,45 * * * * /usr/exim/bin/exim -q EOF crontab /tmp/crontab.root rm /tmp/crontab.root </verb></tscreen><p> <!-- And even install other RPMs which you made yourself:<p> --> 独自に作った RPM をインストールすることもできます:<p> <tscreen><verb> rpm -i ftp://chicken.swedish-chef.org/rpms/squid.rpm rpm -i ftp://chicken.swedish-chef.org/rpms/ssh.rpm rpm -i ftp://chicken.swedish-chef.org/rpms/exim.rpm rpm -i ftp://chicken.swedish-chef.org/rpms/cfengine.rpm rpm -i ftp://chicken.swedish-chef.org/rpms/linux.rpm ssh-keygen -b 1024 -f /etc/ssh_host_key -N "" depmod -a </verb></tscreen><p> <!-- Note that you can achieve the same effect by making your own RPMs containing the commands you want executed - see below for more information. Give them a carefully chosen name and you can force them to be installed first (e.g. name starts with 'aaa') or last (e.g. name starts with 'zzz').<p> --> これと同じ効果は,実行したいコマンドを含む RPM パッケージを作ることに よっても実現できることを知っておいてください.詳しくは後で説明します. このような RPM パッケージに付ける名前は注意して決めてください.そうす ればこれを最初(例: 'aaa' で始まる名前を指定)や最後(例: 'zzz' で始まる 名前を指定)にインストールさせることができます.<p> <!-- Be aware that a less painful way of doing root crontab entries is to create them as files in one or more of the directories <em>/etc/cron.hourly</em>, <em>/etc/cron.daily</em>, <em>/etc/cron.weekly</em> and <em>/etc/cron.monthly</em>.<p> --> root の crontab エントリを設定で危険が比較的小さい方法は,エントリを <em>/etc/cron.hourly</em>, <em>/etc/cron.daily</em>, <em>/etc/cron.weekly</em>, <em>/etc/cron.monthly</em> にファイルとして作成することです.<p> <!-- More information about making your own RPMs is available in Appendix B.<p> --> 独自の RPM パッケージを作るための詳しい情報については付録 B をご覧くだ さい.<p> <!-- <sect>Installation itself<p> --> <sect>実際のインストール<p> <!-- Boot the to-be-installed machine off your RedHat boot floppy as usual, but instead of pressing <tt>RETURN</tt> at the <tt>SYSLINUX</tt> prompt, type <tt>linux ks</tt>.<p> --> インストールを行うマシンは RedHat の起動フロッピーを使って普通に起動し ますが,<tt>SYSLINUX</tt> では <tt>RETURN</tt> キーを押さないで, <tt>linux ks</tt> と入力します.<p> <!-- If you're lucky, this will be all you have to type!<p> --> 運が良ければ,これを入力するだけで終わりです!<p> <!-- If you customised your RedHat boot floppy as outlined above, you won't even need to do this bit :-)<p> --> 前に簡単に説明したように RedHat の起動フロッピーをカスタマイズしていれ ば,それすらも必要ないでしょう :-)<p> <!-- Since we're really just automating the normal steps involved in a RedHat installation, the normal dialogs may appear if/when KickStart gets confused about what to do next. The most likely case is that your network interface won't be detected automatically, and you'll be prompted for its IRQ and I/O address space. KickStart tends to need help for ISA bus cards, but detects PCI bus cards automatically.<p> --> RedHat のインストールに含まれる普通の手順を今まさに自動化したわけですから, 手動インストールのダイアログが現れるのは,KickStart が次の手順を見失っ た場合だけです.最もありそうなケースは,ネットワークインタフェースが自 動的に検出されず,インタフェースの IRQ や I/O アドレスの問い合わせが行 われる場合です.ISA バス用のカードの場合には KickStart が補助を必要と することもよくありますが,PCI バス用のカードの場合には自動的に処理され ます.<p> <!-- You can keep an eye on what KickStart is doing by by switching virtual consoles as usual:<p> --> 通常通りの操作で仮想コンソールを切替えることにより,KickStart が行って いる処理を監視することができます:<p> <!-- <itemize> <item> Alt-F1 - installation dialog <item> Alt-F2 - shell prompt <item> Alt-F3 - install log (messages from install program) <item> Alt-F4 - system log (messages from kernel, etc.) <item> Alt-F5 - other messages </itemize><p> --> <itemize> <item> Alt-F1 - インストールのダイアログ <item> Alt-F2 - シェルのプロンプト <item> Alt-F3 - インストールのログ(インストールプログラムからのメッセージ) <item> Alt-F4 - システムのログ(カーネル等からのメッセージ) <item> Alt-F5 - その他のメッセージ </itemize><p> <!-- <sect>Mounting the boot/supp disks<p> --> <sect>ブートディスク/補助ディスクのマウント<p> <!-- The RedHat boot disk <em>boot.img</em> is in MS-DOS format, using the <tt>SYSLINUX</tt> program to boot up. The supplementary disk <em>supp.img</em> is a Linux <tt>ext2</tt> filesystem. If you have support for the loopback filesystem in your Linux kernel, you can mount both of these files in your filesystem and hack at them:<p> --> RedHat の起動ディスク <em>boot.img</em> は MS-DOS フォーマットです.ま た,起動には <tt>SYSLINUX</tt> プログラムを使っています.補助ディスク は Linux の <tt>ext2</tt> ファイルシステムです.ループバックファイルシ ステムをサポートするように Linux カーネルを設定してあれば,これらを両 方ともファイルシステムにマウントし,ハックすることができます:<p> <tscreen><verb> # mkdir -p /mnt/boot /mnt/supp # mount -o loop -t msdos boot.img /mnt/boot # mount -o loop supp.img /mnt/supp </verb></tscreen><p> <!-- Now you should be able to see and manipulate the files on the boot and supplementary disk under <em>/mnt/boot</em> and <em>/mnt/supp</em> respectively. Phew! Note that older versions of <tt>mount</tt> may not be able to handle the <tt>-o loop</tt> option. In these cases you'll need to explicitly use <tt>losetup</tt> to configure the loopback device for each file, e.g.<p> --> マウントしてしまえば,起動ディスクと補助ディスクに含まれるファイルは それぞれ <em>/mnt/boot</em> と <em>/mnt/supp</em> にあるファイルとして 操作できるはずです. <!-- fujiwara: Phew! の訳を入れると何だかバカっぽくなる気がするので(^_^; と りあえず飛ばしてます. --> <tt>mount</tt> のバージョンが古いと <tt>-o loop</tt> オプションが使え ないかもしれないので気を付けてください.このような場合には,明示的に <tt>losetup</tt> コマンドを用いて,それぞれのファイルに対してループバッ クデバイスを設定してやる必要があります.操作例を以下に示します:<p> <tscreen><verb> # losetup /dev/loop0 boot.img # mount -t msdos /dev/loop0 /mnt/boot </verb></tscreen><p> <!-- You might also need to explicitly use the <tt>-t ext2</tt> option when mounting an <tt>ext2</tt> filesystem like the one on the supplementary disk. But, it looks like people with modern Linux distributions shouldn't have to worry about this.<p> --> 補助ディスク等の <tt>ext2</tt> ファイルシステムをマウントする際にも, <tt>-t ext2</tt> オプションを明示的に指定する必要があるかもしれません. しかし,最近の Linux ディストリビューションを使っているならば,このよ うな心配をする必要はないはずです.<p> <!-- Of course, if you don't want to mess around too much, you can cut a corner and manipulate actual floppy disks rather than these floppy disk images. If time is important, you'll probably prefer to use the loopback devices, since you can hack around with the disk images without incurring the latency associated with a genuine floppy disk read/write.<p> --> あまりいじり回すつもりがないのであれば,手を抜いてフロッピーのディスク イメージでなく実際のフロッピーディスクを操作してももちろん構いません. ですが時間をかけたくなければ,ループバックデバイスを使う方がよいでしょ う.というのも,本物のフロッピーディスクの読み書きは遅いのですが,ディ スクイメージを使えばこの問題を避けてハックすることができるからです.<p> <!-- <sect>Modifying the RedHat installer<p> --> <sect>RedHat のインストーラの修正<p> <!-- If you want to mess around with the installation procedure itself, the source code can be found on the RedHat CD-ROM or your local RedHat mirror site. It's in <em>misc/src/install</em> under the <em>i386</em> distribution top level directory.<p> --> インストールの手順自体をいじりたければ,RedHat の CD-ROM またはお近く の RedHat ミラーサイトから,インストーラのソースコードを入手してくださ い.これはディストリビューションのトップディレクトリにある <em>i386</em> ディレクトリの下の <em>misc/src/install</em> ディレクト リにあります.<p> <!-- If you examine the RedHat boot disk you'll see that, in addition to the Linux kernel <em>vmlinuz</em>, there's a large file <em>initrd.img</em>:<p> --> RedHat の起動ディスクを調べれば,Linux カーネルである <em>vmlinuz</em> に加え,大きなファイル <em>initrd.img</em> があることに気づくと思いま す:<p> <tscreen><verb> -rwxr-xr-x 1 root root 559 May 11 15:48 boot.msg -rwxr-xr-x 1 root root 668 May 11 15:48 expert.msg -rwxr-xr-x 1 root root 986 May 11 15:48 general.msg -rwxr-xr-x 1 root root 968842 May 11 15:48 initrd.img -rwxr-xr-x 1 root root 1120 May 11 15:48 kickit.msg -r-xr-xr-x 1 root root 5352 May 11 15:48 ldlinux.sys -rwxr-xr-x 1 root root 875 May 11 15:48 param.msg -rwxr-xr-x 1 root root 1239 May 11 15:48 rescue.msg -rwxr-xr-x 1 root root 402 May 11 15:48 syslinux.cfg -rwxr-xr-x 1 root root 444602 May 11 15:48 vmlinuz </verb></tscreen><p> <!-- You guessed it, this is another <tt>ext2</tt> filesystem saved as a file - but with a twist. It's actually compressed as well. You can uncompress it and then mount the result, e.g.<p> --> ご想像の通り,これはファイルとして格納されている別の <tt>ext2</tt> ファ イルシステムです.ただし少しひねりが入っています.実際には圧縮もされて いるのです.このファイルを展開して,その結果をマウントすることができます. 操作例を以下に示します:<p> <tscreen><verb> # gzip -dc /mnt/boot/initrd.img >/tmp/initrd.ext2 # mkdir /mnt/initrd # mount -o loop /tmp/initrd.ext2 /mnt/initrd </verb></tscreen><p> <!-- Probably the most important part of this filesystem is the collection of loadable kernel modules which are included with the boot disk. If you need to merge in a new version of a driver, you'll need to either replace <em>vmlinuz</em> with a new kernel which has this statically linked, or replace it in the modules collection. What's more, you may need to throw other modules away to make room.<p> --> このファイルシステムで最も重要な部分は,起動ディスクに入っているローダ ブルカーネルモジュール群でしょう.新しいバージョンのドライバをマージす る必要があるなら,これを静的にリンクした新しいカーネルで <em>vmlinuz</em> を置き換えるか,あるいはモジュール群を差し替える必要 があります.さらに,空きディスクを確保するために他のモジュールを捨てる 必要があるかもしれません. <!-- The modules collection is the file <em>modules/modules.cgz</em>. Wondering what that might be ? It's actually a compressed <tt>cpio</tt> archive, believe it or not! And you thought nobody used <tt>cpio</tt> any more... Actually RPM itself uses <tt>cpio</tt> internally, too. Here's how to hack around with it:<p> --> モジュール群は <em>modules/modules.cgz</em> ファイルです.これはどんな ファイルなのでしょうか? これは実際には圧縮した <tt>cpio</tt> ファイル です.読者の皆さんが信じるかどうかは分かりませんし,もう誰も <tt>cpio</tt> なんて使ってないと思われるかもしれませんが! 実際には RPM パッケージ自体も内部的には <tt>cpio</tt> を使っています.以下の手順は モジュール群のファイルをハックするための方法です:<p> <tscreen><verb> # gzip -dc /mnt/initrd/modules/modules.cgz >/tmp/modules.cpio # cpio -itv <modules.cpio >modules.listing # mkdir modules # cd modules # cpio -idumv <../modules.cpio </verb></tscreen><p> <!-- I don't believe that there is currently a way under Linux (at least in mainstream distributions) to transparently access compressed filesystems. Let me know if you know better!<p> --> 筆者が知る限りでは,現在の Linux(少なくとも主要ディストリビューション では)には圧縮されたファイルシステムを透過的に扱う方法は無いはずです. もっと良い方法があればお知らせください!<p> <!-- If you change anything, remember to:<p> --> 何らかの変更を行った場合には,以下の処理も忘れずに行ってください:<p> <enum> <!-- <item> Use <tt>cpio</tt> to recreate the archive. How to do this is left as an exercise for the reader... --> <item> <tt>cpio</tt> を使ってアーカイブを作り直します.作り直しの方法 は,読者の皆さんへの宿題としておきます…. <!-- <item> Use <tt>gzip</tt> to compress the resulting archive. --> <item> できたアーカイブを <tt>gzip</tt> を使って圧縮します. <!-- <item> Copy it to <em>/mnt/initrd</em>, or wherever you put the uncompressed <em>initrd.img</em> archive. --> <item> これを <em>/mnt/initrd</em> あるいは圧縮されていない <em>initrd.img</em> が置かれている場所にコピーします. <!-- <item> Unmount <em>/mnt/initrd</em> (or whatever you called it). --> <item> <em>/mnt/initrd</em> (あるいはマウントした場所)をアンマウントし ます. <!-- <item> Compress the new <em>initrd.img</em> using <tt>gzip</tt> again. --> <item> 新しい <em>initrd.img</em> を <tt>gzip</tt> を使って再び圧縮し ます. <!-- <item> Copy the resulting archive onto the boot disk image - <em>/mnt/boot/initrd.img</em> in our example. --> <item> できたアーカイブを起動ディスクイメージにコピーします.本ドキュ メントの例では <em>/mnt/boot/initrd.img</em> です. <!-- <item> Unmount the boot disk image, e.g. <em>/mnt/boot</em>. --> <item> 起動ディスクイメージ(例えば <em>/mnt/boot</em>)をアンマウントし ます. </enum><p> <!-- Finally, you can now create new boot floppies using this modified boot disk setup, e.g.<p> --> 最後に,このように修正した起動ディスクの設定を用いて新しい起動フロッピー を作成することができます.作成は例えば以下のように行います:<p> <tscreen><verb> # cat boot.img >/dev/fd0 </verb></tscreen><p> <!-- <sect>FAQs/Wish list<p> --> <sect>FAQ とお願いリスト<p> <!-- <bf>Q:</bf> After KickStart installation, my machine won't boot up. The BIOS complains with a message like <tt>Missing operating system</tt>.<p> --> <bf>Q:</bf> KickStart を使ったインストールの後,マシンが起動しません. BIOS が <tt>Missing operating system</tt> といったメッセージを吐きます.<p> <!-- <bf>A:</bf> Sounds like the partition with the root filesystem on isn't bootable. Use <tt>fdisk</tt> to toggle its bootable status.<p> --> <bf>A:</bf>ルートファイルシステムが置かれているパーティションが起動可 能でないようです.<tt>fdisk</tt> を使って,起動可能ステータスを 変えてください.<p> <!-- <bf>Q:</bf> After the floppy boots, I get the message: <tt>Error opening files for kickstart copy: File exists</tt>.<p> --> <bf>Q:</bf> フロッピーで起動した後に <tt>Error opening files for kickstart copy: File exists</tt> というメッセージが出ます.<p> <!-- <bf>A:</bf> Use a more recent version of <em>boot.img</em> and <em>supp.img</em> - look in the <em>updates</em> directory of your local RedHat mirror site. There was a bug in some older versions of these for RedHat 5.1.<p> --> <bf>A:</bf> もっと新しいバージョンの <em>boot.img</em> と <em>supp.img</em> を使ってください.このファイルはお近くの RedHat ミラー サイトの <em>updates</em> ディレクトリにあります.RedHat 5.1 では,古 いバージョンのディスクイメージの一部にバグがありました.<p> <!-- <bf>Q:</bf> Can you have all outstanding patches (update RPMs) applied automatically too ? How ?<p> --> <bf>Q:</bf> 重要なパッチ(更新 RPM パッケージ)も自動的に適用することが できるのでしょうか? できるとしたらどうやって適用するのでしょうか?<p> <!-- <bf>A1:</bf> Copy the RPMs you want installing to the RPMS directory from which the installation is going to take place, get rid of the older RPMs, and update the file <em>RedHat/base/hdlist</em> with the new RPM details. See Appendix C for a script from Eric Doutreleau to do this for you. If you do this yourself, remember to run <em>genhdlist</em> afterwards!<p> --> <bf>A1:</bf> インストールしたい RPM パッケージを,インストールに使う RPMS ディレクトリにコピーし,古い RPM パッケージを削除して, <em>RedHat/base/hdlist</em> ファイルを新しい RPM パッケージの詳細情報 に書き直します.これを行うために Eric Doutreleau さんが作成したスクリ プトを付録 C で紹介します.この作業を自分自身で行った場合は,その後忘れずに <em>genhdlist</em> を実行してください.<p> <!-- <bf>A2:</bf> Try this Perl script: <url name="patchup" url="http://wwwcache.ja.net/dev/patchup/">. This compares the RPMs your system has installed with those in a nominated directory and reports on the ones it thinks need updating. It can even install them for you if you trust it to.<p> --> <bf>A2:</bf> Perl スクリプト <url name="patchup" url="http://wwwcache.ja.net/dev/patchup/"> を試してください.このスク リプトは,システムにインストールされている RPM パッケージと候補ディレ クトリにある RPM パッケージを比較し,更新の必要があると思われるものを 報告します.スクリプトを信用して,そのまま RPM パッケージをインストー ルすることもできます.<p> <!-- <bf>A3:</bf> <url name="rpm2hml" url="http://rufus.w3.org/linux/rpm2html/"> has a much more powerful (12MB of C code vs. a page of Perl!) version of A2.<p> --> <bf>A3:</bf> <url name="rpm2hml" url="http://rufus.w3.org/linux/rpm2html/"> は A2 をずっと強力にしたバージョンです(12MB の C 言語のコードとたった 1 ページの Perl スクリプトを比べていますが!).<p> <!-- <bf>Q:</bf> A single config file on the install server for all of the clients, perhaps as a fallback after trying <em>IPADDR-kickstart</em> ?<p> --> <bf>Q:</bf> インストールサーバに一つだけ設定ファイルを置き、 それがすべてのクライアントによって (<em>IPADDR-kickstart</em> が無い時に) デフォルトで使われるようにするにはどうすればいいでしょう?<p> <!-- <bf>A1:</bf> Use the BOOTP/DHCP 'boot file' parameter <em>bf</em> to set the filename.<p> --> <bf>A1:</bf> BOOTP/DHCP 'boot file' のパラメータである <em>bf</em> を 使ってファイル名を設定してください.<p> <!-- <bf>A2:</bf> Add a a record <tt>bf=/kickstart/ks.cfg</tt> to the relevant entry in <em>/etc/bootptab</em>. --> <bf>A2:</bf> <em>/etc/bootptab</em> の該当項目にレコード <tt>bf=/kickstart/ks.cfg</tt> を追加してください.<p> <!-- <bf>Q:</bf> More flexibility when things go wrong - e.g. prompt for alternate locations if distribution not found on CD-ROM.<p> --> <bf>Q:</bf> うまく行かない時にもっと柔軟に動作するようにしたいです.例 えば,ディストリビューションが CD-ROM 上に無い時に別の場所を尋ねるといっ た動作です.<p> <!-- <bf>A:</bf> ?<p> --> <bf>A:</bf> ?<p> <!-- <bf>Q:</bf> Explicit exclusion of packages - e.g. everything apart from <em>sendmail</em>.<p> --> <bf>Q:</bf> 明示的に特定のパッケージを除外したいです.例えば, <em>sendmail</em> に関係するものだけを除外するような場合です.<p> <!-- <bf>A:</bf> Rebuild the <bf>BASE</bf> package without sendmail.<p> --> <bf>A:</bf> <bf>BASE</bf> を sendmail 抜きで再構築してください.<p> <!-- <bf>Q:</bf> Choose which services are started automatically on boot-up by the run-level scripts under <em>/etc/rc.d/</em>.<p> --> <bf>Q:</bf> <em>/etc/rc.d/</em> にあるランレベルスクリプトによって起動 時に自動的に開始されるサービスを選択する方法を教えてください.<p> <!-- <bf>A:</bf> The <em>chkconfig</em> utility lets you configure which services are run automatically on boot-up. You can run this in your post-installation script section, e.g. to run <em>ypbind</em> in run levels 3, 4 and 5:<p> --> <bf>A:</bf> <em>chkconfig</em> ユーティリティを使うと,起動時に自動的 に開始するサービスを設定することができます.これをインストール後に実行 するスクリプトのセクションで実行することもできます.ランレベル 3, 4, 5 で <em>ypbind</em> を起動するための設定例を以下に示します: <tscreen><verb> chkconfig --level 345 ypbind on </verb></tscreen><p> <!-- and it will start the ypbind level on the 345 level. --> これにより,レベル 3, 4, 5 で ypbind が起動されるようになります. <!-- <bf>Q:</bf> When executing the shell commands in the <tt>%post</tt> section, bring any output up in another virtual console rather than overwriting the main screen. <em>Could be done in the shell commands section using <tt>open</tt>?</em>.<p> --> <bf>Q:</bf> シェルのコマンドを <tt>%post</tt> セクションで実行する時, メイン画面を上書きしないで出力を別の仮想コンソールに出したいと思います. <em>これをシェルコマンドセクションで <tt>open</tt> を使って行えますか?</em><p> <!-- <bf>A:</bf> No problem - do something like this:<p> --> <bf>A:</bf> できます.以下のようにしてください:<p> <tscreen><verb> exec >/dev/tty5 </verb></tscreen><p> <!-- <bf>Q:</bf> Does the filesystem creation code check for bad blocks ?<p> --> <bf>Q:</bf> ファイルシステム生成のコードは不良ブロックのチェックを行い ますか?<p> <!-- <bf>A:</bf> If you switch to the virtual console where the filesystem creation output is being displayed, you won't see any mention of the 'read-only' test being performed. Looks like the answer is no.<p> --> <bf>A:</bf> ファイルシステム生成時の出力が表示される仮想コンソールに移 れば,「読み取り専用」テスト実行に関する出力が行われていないことがわか ると思います.したがって,答えは「いいえ」のようです.<p> <!-- <bf>Q:</bf> Can I arrange things so some of my machines are configured differently from others ?<p> --> <bf>Q:</bf> 一部のマシンだけを他のマシンと違う設定にすることはできますか?<p> <!-- <bf>A:</bf> You could move the host dependent stuff into the scripted section of the KickStart config - e.g. only install a given RPM if on a given machine. It would be useful to have a conditional installation feature in the packages section of the config file, e.g. switching on architecture, or hostname/domain name/IP address.<p> --> <bf>A:</bf> ホスト依存の設定を KickStart の設定ファイルのスクリプト記 述セクションに移せば大丈夫です.ここで指定したマシンの場合に限って指定 された RPM パッケージをインストールするようにします.設定ファイルのパッ ケージセクションに条件付きインストール機能(例: アーキテクチャ, ホスト名/ドメイン名,IP アドレスによる分岐)があれば便利だったのでしょ うが….<p> <!-- <bf>Q:</bf> Are there any changes between RedHat 5.1 and 5.2 ?<p> --> <bf>Q:</bf> RedHat 5.1 から 5.2 で変更された部分はありますか?<p> <!-- <bf>A1:</bf> Lots of changes in the installer, but mostly bug fixes or cosmetic improvements. No impact on KickStart as far as I can tell - from a <em>diff -rcs</em> of the two <em>misc/src/install</em> directories.<p> --> <bf>A1:</bf> インストーラへの変更点はたくさんありますが,そのほとんど はバグ修正と見栄えの改善です.筆者が言える限り(新旧の <em>misc/src/install</em> ディレクトリの <em>diff -rcs</em> を取った結 果)では,KickStart への影響はありません.<p> <!-- <bf>A2:</bf> RH5.2 now apparently includes the automatic IP allocation/DHCP patches to <tt>bootpd</tt>, but they have left out the documentation which tells you how to use it. --> <bf>A2:</bf> RedHat 5.2 では <tt>bootpd</tt> への自動 IP 割り当て/DHCP パッチが入ったようですが,その使い方の説明はドキュメントには入っていま せん.<p> <!-- <bf>Q:</bf> (How) can you clear a specific partition or partitions ? e.g. to leave <em>/home</em> but zap <em>/</em>.<p> --> <bf>Q:</bf> (<em>/home</em> を残したまま <em>/</em> を消す等のために) 特定のパーティション(1 つまたは複数)を消すことはできますか? できるなら ば,どのようにして行うのでしょうか?<p> <!-- <bf>A:</bf> You can't - yet!<p> --> <bf>A:</bf> できません.今のところは!<p> <!-- <bf>Q:</bf> Can you arrange to have your partitions created across multiple drives ? e.g. <em>/</em> on <tt>sda</tt>n and <em>/home</em> on <tt>sdb</tt>.<p> --> <bf>Q:</bf> 複数のドライブに分けてパーティションを割り当てることはでき ますか? 例えば,<em>/</em> を <tt>sda</tt> に置き,<em>/home</em> を <tt>sdb</tt> に置くといった具合です.<p> <!-- <bf>A:</bf> Don't think so - looks like you only get access to the first drive from the partitioning tool.<p> --> <bf>A:</bf> できません.パーティション操作ツールからアクセスできるのは 最初のドライブだけのようです.<p> <!-- <bf>Q:</bf> Is it possible to specify existing partitions to be included in the mount table, or is it only possible to specify the creation of new partitions that will then be included?<p> --> <bf>Q:</bf> 既に存在しているパーティションをマウントテーブルに入れるこ とはできますか? それとも,新しいパーティションを生成してこれをマウント テーブルに入れることしかできないのですか?<p> <!-- <bf>A:</bf> ?<p> --> <bf>A:</bf> ?<p> <!-- <bf>Q:</bf> After running <tt>mkkickstart</tt>, where is the file it creates?<p> --> <bf>Q:</bf> <tt>mkkickstart</tt> を実行した後,<tt>mkkickstart</tt> が 生成したファイルはどこに置かれるのですか?<p> <!-- <bf>A:</bf> It doesn't create a file - it dumps the KickStart config to <tt>stdout</tt>.<p> --> <bf>A:</bf> <tt>mkkickstart</tt> はファイルを作りません. <tt>mkkickstart</tt> は KickStart の設定を標準出力に出力します.<p> <!-- <bf>Q:</bf> In virtual console 4 (Alt-F4) I get <tt>Unable to load NLS charset cp437(nls_cp437)</tt>. What does this mean ? Should I be worried ?<p> --> <bf>Q:</bf> 仮想コンソール 4 (Alt-F4) に <tt>Unable to load NLS charset cp437(nls_cp437)</tt> というメッセージ が出ます.これはどういう意味でしょうか? 何か問題があるのでしょうか?<p> <!-- <bf>A:</bf> Sounds like you're trying to mount a CD-ROM burned with the Joliet (Unicode extensions to ISO 9660. In theory the filenames on the CD-ROM might get munched and not make it through to Linux correctly. In practice it doesn't seem to cause any problems - could be a spurious dependency ?<p> --> <bf>A:</bf> Joliet 拡張形式(ISO 9660 の Unicode 拡張)で焼いた CD-ROM をマウントしようとしているように見えます.理論的には CD-ROM 上のファイ ル名はおかしくなり,Linux では正しく読めません.実際には,問題になるこ とはまずないようです.実は関係ないのかもしれません.<p> <!-- <bf>Q:</bf> Why am i getting the X Window System installed ? I didn't put it in my list of packages.<p> --> <bf>Q:</bf> どうして X ウィンドウシステムがインストールされるのでしょ う? インストール対象のパッケージにはしていないのですが.<p> <!-- <bf>A:</bf> The <tt>XFree86-VGA16</tt> RPM is a 'base' component, and as such always gets installed - unless you change the definition of the base class.<p> --> <bf>A:</bf> <tt>XFree86-VGA16</tt> の RPM パッケージは 'base' コンポー ネントに入っているので必ずインストールされます.ただし base クラスの定 義を変えればその限りではありません. <!-- <bf>Q:</bf> In my post-installation script, can I use the packages which have been installed by now to do funky things not possible with the limited tools on the floppies ?<p> --> <bf>Q:</bf> インストール後に実行するスクリプト内で,それまでにインストー ルされたパッケージを使い,フロッピーに入っている限られたツールではでき ない面白いことができますか?<p> <!-- <bf>A:</bf> Yep - e.g. if you chose to install Perl when you put your KickStart config together, almost anything is possible in about five lines :-)<p> --> <bf>A:</bf> できます.Perl をインストールして KickStart の設定ファイル と組み合わせれば,5 行くらいのスクリプトで大抵のことができます :-)<p> <!-- <sect>Credits<p> --> <sect>クレジット<p> <!-- Thanks to Eric Doutreleau for the info about <em>chkconfig</em>, the <tt>SYSLINUX</tt> config file hack, and the Perl script for updating your distribution server's RPMs. Thanks to Robert Kaminsky for extensive investigations. Thanks to Piete Brooks, Flavia Regina Munhoz, Tom Toffoli, Bob Robbins, Charlie Brady and Ragen Herrington, for their comments and questions.<p> --> Eric Doutreleau さんには <em>chkconfig</em> に関する情報, <tt>SYSLINUX</tt> の設定ファイルのハック,お使いのディストリビューショ ンのサーバの RPM を更新するための Perl スクリプトについて教えていただ きました.Robert Kaminsky さんにはたくさんの調査を行っていただきました. Piete Brooks さん,Flavia Regina Munhoz さん,Tom Toffoli さん,Bob Robbins さん,Charlie Brady さん,Ragen Herrington さんにはコメントや 質問をいただきました.これらの皆さんに感謝します.<p> <!-- <sect>Appendix A - Configuring BOOTP/DHCP and NFS<p> --> <sect>付録 A - BOOTP/DHCP と NFS の設定<p> <!-- If you're wondering what on earth this BOOTP and DHCP stuff is, more information is available at <url name="the DHCP WWW site" url="http://www.dhcp.org/">. NFS is documented separately in detail in the NFS HOWTO, and there's a DHCP mini-HOWTO too. I've tried to provide enough details here to help you get started, whilst not treating the topics in depth - let me know if you think this is overkill.<p> --> BOOTP や DHCP が一体何のことだか分からなければ, <url name="DHCP の WWW サイト" url="http://www.dhcp.org/"> にある詳し い情報をご覧ください.NFS はこれとは別に NFS HOWTO で詳しく説明されて います.DHCP mini-HOWTO もあります.ここでは入門的なレベルの説明を行う つもりであり,それぞれの話題に関する突っ込んだ説明は行いません.話を簡 単にしすぎだと思われたら,筆者にお知らせください.<p> <!-- In the BOOTP/DHCP + NFS configuration we're discussing, the KickStart config file should be NFS mountable by the machine being installed from <em>/kickstart/IPADDR-kickstart</em> on the BOOTP/DHCP server, where <em>IPADDR</em> is the IP address of the new machine, e.g. <em>/kickstart/198.168.254.254-kickstart</em> for the machine <em>198.168.254.254</em>.<p> --> ここで説明する BOOTP/DHCP + NFS の構成を使ったインストールにおいては, KickStart の設定ファイルは BOOTP/DHCP サーバ上の <em>/kickstart/IPADDR-kickstart</em> からインストール対象のマシンに NFS でマウントできなければなりません.ここで <em>IPADDR</em> は新しい マシンの IP アドレスです.例えば, <em>/kickstart/198.168.254.254-kickstart</em> はマシン <em>198.168.254.254</em> 用の設定ファイルです.<p> <!-- You should be able to override this location by returning the <tt>bf</tt> parameter (boot file) in your BOOTP/DHCP response. It may even be possible to have this NFS mounted off another machine entirely.<p> --> BOOTP/DHCP の応答で <tt>bf</tt>(boot file)パラメータを返すことによって この位置を上書きすることができるはずです.このファイルは全く別のマシン から NFS マウントすることもできると思います.<p> <!-- To NFS export some directories from an existing Linux box, create the file <em>/etc/exports</em> with contents something like:<p> --> 既存の Linux マシンからディレクトリを NFS エクスポートするには,以下の ような内容のファイル <em>/etc/exports</em> を作成します:<p> <tscreen><verb> /kickstart *.swedish-chef.org(ro,no_root_squash) /mnt/cdrom *.swedish-chef.org(ro,no_root_squash) </verb></tscreen><p> <!-- Note that if you didn't register the IP addresses you're going to be using in the DNS, you may be told to get lost by the NFS server and/or the RPC portmapper. In this you can probably get away with putting IP address/netmask pairs in the config files, e.g.<p> --> 使う予定の IP を DNS に登録していない場合には,NFS サーバや RPC ポート マッパから見えないと言われるかもしれないので注意してください.このよう な場合には,IP アドレスとネットマスクの組を設定ファイルに書けばなんと かなります.記述例を以下に示します:<p> <tscreen><verb> /kickstart 198.168.254.0/255.255.255.0(ro,no_root_squash) </verb></tscreen><p> <!-- and in <em>/etc/hosts.allow</em>:<p> --> <em>/etc/hosts.allow</em> には以下の記述を行います:<p> <tscreen><verb> ALL: 194.82.103.0/255.255.255.0: ALLOW </verb></tscreen><p> <!-- This is because most Linux distributions use TCP wrappers to do access control for some or all of the NFS related daemons. Be aware that the <em>/etc/exports</em> syntax tends to be different on other Unix variants - the NFS servers bundled with Linux distributions tend to offer a much wider range of options than the ones shipped with other versions of Unix. --> このようなことが起こるのは,大部分の Linux ディストリビューションは NFS 関係デーモンの一部あるいは全てにおいて TCP wrappers を使ってアクセ ス制御を行っているためです.<em>/etc/exports</em> の文法は他の UNIX 系 OS と異なることが多いので注意してください.各 Linux ディストリビューショ ンに入っている NFS サーバは,他の UNIX に入っている NFS サーバよりも広 範囲に渡るオプションを持っていることがよくあります.<p> <!-- Be aware that if you include a root password in your KickStart config file, or NFS export directories containing sensitive information, you should take care to expose this information to as few people as possible. This can be done by making the NFS export permissions as fine grained as you can, e.g. by specifying a particular host or subnet to export to rather than a whole domain. If you keep a special IP address free for KickStart installations, everything's nice and simple, but you'll have to change it later - or reconfigure the machine to get its IP address via BOOTP/DHCP.<p> --> KickStart の設定ファイルに root のパスワードが書かれている場合や, 機密情報が入っているディレクトリを NFS でエクスポートする場合には,こ の情報を見せる人間をできるだけ少なくすべきである点に注意してください. これは NFS のエクスポート許可できるだけ絞り込むことによって行うことが できます.例えば,エクスポートの指定をドメイン全体でなく特定のホストや サブネットに対して行う等の方法です.KickStart を使ったインストール用に 自由に使える IP アドレスがあれば,問題もなく簡単に作業できますが,後で IP アドレスを変更するか,あるいは BOOTP/DCHP を使って IP アドレスを使 うようにマシンの設定を変更しなければならないでしょう.<p> <!-- Most NFS servers require you to tell <tt>mountd</tt> and <tt>nfsd</tt> (on some versions of Unix they're prefixed with a <tt>rpc.</tt>) that the <em>/etc/exports</em> file has changed - usually by sending a <tt>SIGHUP</tt>. There's often a program or script called <tt>exportfs</tt>, which will do this for you, e.g.<p> --> ほとんどの NFS サーバでは <em>/etc/exports</em> を変更したことを <tt>mountd</tt> と <tt>nfsd</tt> (一部の UNIX では名前の先頭に "<tt>rpc.</tt>" が付いています)に教えてやる必要があります.変更の通知 は普通,<tt>SIGHUP</tt> を送ることによって行います.変更の通知を行うた めの <tt>exportfs</tt> と呼ばれるプログラムまたはスクリプトが用意され ていることもあります.実行例を以下に示します:<p> <tscreen><verb> # exportfs -a </verb></tscreen><p> <!-- If you didn't have NFS up and running when this machine was booted, the directories may not be exported automatically. Try rebooting, or running the following programs as root:<p> --> このマシンが起動した時に NFS が起動,実行されていなければ,このディレ クトリは自動的にはエクスポートされません.試しに再起動するか,root に なって以下のプログラムを実行してください:<p> <tscreen><verb> # portmap # rpc.nfsd # rpc.mountd </verb></tscreen><p> <!-- As noted, on some systems the <tt>rpc.</tt> prefix isn't used. In most modern Unix distributions, these programs can be found in the <em>/usr/sbin</em> or <em>/usr/libexec</em> directories. These might not be in your path already, e.g. if you used <tt>su</tt> to become <em>root</em>. The <tt>portmap</tt> program is also sometimes called <tt>rpcbind</tt>, e.g. on Solaris, some versions of <tt>nfsd</tt> require a command line argument specifying the number of instances of the server to run, and you may find you also need to run another daemon called <tt>biod</tt>. The above should suffice on most (all?) Linux systems.<p> --> 前に書いたように,一部のシステムでは <tt>rpc.</tt> というプレフィック スは使われません.最近の UNIX ディストリビューションのほとんどでは,こ れらのプログラムは <em>/usr/sbin</em> ディレクトリまたは <em>/usr/libexec</em> ディレクトリにあります.これらのディレクトリはパ スには入っていないかもしれません(<tt>su</tt> を使って <em>root</em> になった場合など).<tt>portmap</tt> プログラムは <tt>rpcbind</tt> という名前のこともあります.例えば,Solaris の一部の バージョンの <tt>nfsd</tt> は実行するサーバの数をコマンドライン引き数 で指定しなければならず,<tt>biod</tt> と呼ばれる別のデーモンを起動しな ければならないこともあります.以上の説明で大部分(全て?)の Linux システ ムを満足させられるはずです.<p> <!-- If you're using the CMU BOOTP server with DHCP and dynamic addressing extensions referred to earlier, a sample <em>/etc/bootptab</em> entry (<em>/etc/bootptab</em> is the normal location of the BOOTP/DHCP configuration file) would look something like this:<p> --> CMU 版の BOOTP サーバで DHCP と動的アドレス割り当て拡張(前述)を用いる 場合には,<em>/etc/bootptab</em> エントリ(<em>/etc/bootptab</em> は BOOTP/DHCP 設定ファイルの通常の位置に置かれます)の例は以下のようになる でしょう:<p> <tscreen><verb> .dynamic-1:ip=198.168.254.128:T254=0x30:T250="ds=198.168.254.2: dn=swedish-chef.org:sm=255.255.255.0:gw=198.168.254.1: dl=0xFFFFFFFF": </verb></tscreen><p> <!-- (wrapped for clarity)<p> --> (見やすくするために行を折り返しています)<p> <!-- This says to allocate IP addresses dynamically on encountering new machines, starting at <em>198.168.254.128</em> and continuing for the next 48 (the hexadecimal value <em>30</em>) addresses. Each client will be passed back the value of <em>T250</em>. In this case that sets:<p> --> ここに書かれているのは,新しいマシンを見つける度に IP アドレスを動的 に割り当てること,割り当てるアドレスは <em>198.168.254.128</em> から始 まる連続した 48 個(16 進値で <em>30</em>)のアドレスであることです.各 クライアントには <em>T250</em> の値が返されます.この例では以下のよう な設定が行われます:<p> <itemize> <!-- <item> the DNS server <tt>ds</tt> to <em>198.168.254.2</em> --> <item> DNS サーバ <tt>ds</tt> に <em>198.168.254.2</em> を設定 <!-- <item> the domain name <tt>dn</tt> to <em>swedish-chef.org</em> --> <item> ドメイン名 <tt>dn</tt> に <em>swedish-chef.org</em> を設定 <!-- <item> the subnet mask <tt>sm</tt> to <em>255.255.255.0</em> --> <item> サブネットマスク <tt>sm</tt> に <em>255.255.255.0</em> を設定 <!-- <item> the default gateway <tt>gw</tt> to <em>198.168.254.1</em> --> <item> デフォルトゲートウェイ <tt>gw</tt> に <em>198.168.254.1</em> を設定 <!-- <item> the lease length <tt>dl</tt> (how long the address is valid for) to "forever" --> <item> リース期間 <tt>dl</tt> (アドレスが有効な期間)に「無期限」を設定 </itemize><p> <!-- There seem to be a number of other versions of this server kicking around which do not support dynamic addressing. For these, you would have to list the hardware (typically Ethernet MAC) address of each to-be-installed machine in <em>/etc/bootptab</em>, and the entries would look something like this:<p> --> 現在使われている CMU 版のサーバには,動的アドレス割り当てをサポートし ていないバージョンもたくさんあるようです.このような場合には,インストー ルするマシンのハードウェアアドレス(通常はイーサネットの MAC アドレス) を <em>/etc/bootptab</em> に列挙しなければならないでしょう.このファイ ル中でのエントリは以下のようになると思います:<p> <tscreen><verb> bork.swedish-chef.org:ip=198.168.254.128:ha=0000E8188E56: ds=198.168.254.2:dn=swedish-chef.org:sm=255.255.255.0: gw=198.168.254.1:dl=0xFFFFFFFF": </verb></tscreen><p> <!-- (wrapped for clarity)<p> --> (見やすくするために折り返しています)<p> <!-- Note that the parameter <tt>ha</tt> corresponds to the hardware address of the machine being installed.<p> --> パラメータ <tt>ha</tt> は,インストール先のマシンのハードウェアアドレ スに対応する点に注意してください.<p> <!-- <sect>Appendix B - Making your own RPMs<p> --> <sect>付録 B - 独自の RPM パッケージの作り方<p> <!-- The RPM package format is already very well documented, particularly in the book <em>Maximum RPM</em> by Ed Bailey, which you can download from the <url url="http://www.rpm.org/" name="RPM WWW site"> - also available from all good book stores! This is just a couple of quick hints for people in a hurry.<p> --> RPM パッケージのフォーマットは既に非常に詳しく文書化されています.特に Ed Bailey 氏の「<em>Maximum RPM</em>」という書籍が詳しいです.これは <url url="http://www.rpm.org/" name="RPM WWW site"> からダウンロードす ることができますし,書店で購入することもできます! 以下は急いでいる人が 簡単に利用できるようにするためのヒントです.<p> <!-- RPM packages are built from a <em>spec</em> file. This consists (in a similar fashion to the KickStart config file) of a recipe of steps that need to be taken in order to build the package - it's expected that you'll have to build it from source, potentially for multiple platforms, and may need to apply patches before compiling. Once built and installed, a binary RPM will be created from the files and directories you specify as being associated with the package. It's important to note that RPM has no idea of which files and directories are related to a given package - you have to tell it. --> RPM パッケージは <em>spec</em> ファイルから作られます.このファイル (KickStart の設定ファイルに似た形式)は,パッケージを構築するために必要 な手順のレシピから構成されています.もしかすると複数プラットフォームに 対応することあるかもしれないので,パッケージはソースから構築することが 期待されています.また,コンパイルの前にはパッチを適用する必要があるか もしれません.一度構築とインストールを行うと,パッケージに関連するもの として指定したファイルとディレクトリからバイナリの RPM ファイルが生成 されます.覚えておくべき重要な点としては,RPM は指定されたパッケージに 関連するファイルとディレクトリについて何も知らないので,これを指定する 必要があります. <!-- Here's a sample specification for a custom RPM of the <url name="Squid WWW cache server" url="http://squid.nlanr.net/">:<p> --> <url name="Squid WWW キャッシュサーバ" url="http://squid.nlanr.net/"> の独自 RPM 用のサンプル spec ファイルの例を以下に示します:<p> <tscreen><verb> Summary: Squid Web Cache server Name: squid Version: 1.NOVM.22 Release: 1 Copyright: GPL/Harvest Group: Networking/Daemons Source: squid-1.NOVM.22-src.tar.gz Patch: retry-1.NOVM.20.patch %description This is just a first attempt to package up the Squid Web Cache for easy installation on our RedHat Linux servers %prep %setup %build configure --prefix=/usr/squid perl -spi -e 's!#( -DALLOW_HOSTNAME_UNDERSCORES)!$1!' src/Makefile make %install make install %files /usr/squid </verb></tscreen><p> <!-- Here's how to build this RPM:<p> --> この RPM の構築方法を示します:<p> <tscreen><verb> % mkdir -p SOURCES BUILD SRPMS RPMS/i386 % cp ~/squid-1.NOVM.22-src.tar.gz SOURCES % cp ~/retry-1.NOVM.20.patch SOURCES % rpm -ba squid-1.NOVM.22+retry-1.spec </verb></tscreen><p> <!-- This will automatically create a subdirectory under the <em>BUILD</em> directory, into which it'll unpack the source code and then apply the patch (there are a number of options available for patching - check the book for details). Now, RPM will automatically build the package by running <tt>configure</tt> and then <tt>make</tt>, install it using <tt>make install</tt>, and take a snapshot of the files under <em>/usr/squid</em>. It's the latter which will form the binary RPM of the Squid software.<p> --> rpm コマンドは <em>BUILD</em> ディレクトリの下にサブディレクトリを自動 的に生成します.そして rpm コマンドは,このサブディレクトリにソースコー ドを展開し,パッチを適用します(パッチの当て方に関するオプションはたく さんあります.詳しくは先に挙げた書籍で調べてください).ここで rpm は <tt>configure</tt> と <tt>make</tt> を実行して自動的にパッケー ジを構築し,<tt>make install</tt> を使ってこれをインストールします.そ して <em>/usr/squid</em> の下にあるファイルのスナップショットを取りま す.Squid のバイナリ RPM となるのは,このスナップショットです.<p> <!-- Note that we can insert arbitrary shell commands into the unpacking, building and installing processes, e.g. the call to <tt>perl</tt> which tweaks one of Squid's compile-time parameters.<p> --> 展開,構築,インストールの処理には任意のシェルコマンドを入れることがで きる点に注意してください.例えば,Squid のコンパイル時のパラメータを少 し変えるために <tt>perl</tt> を呼び出すことができます.<p> <!-- The final binary RPM will be left under the <em>RPMS</em> directory in the platform specific subdirectory <em>i386</em>. In this case it will be called <em>squid-1.NOVM.22-1.i386.rpm</em>. Note that the filename is created by concatenating the values of the following parameters from the spec file: <tt>Name</tt>, <tt>Version</tt> and <tt>Release</tt> - plus the hardware platform in question, <em>i386</em> in this case. Try to bear this in mind when creating your own RPMs, to avoid giving them overly long or painful names!<p> --> 最終的なバイナリ RPM パッケージが <em>RPMS</em> ディレクトリにあるプラッ トフォーム固有のサブディレクトリ <em>i386</em> に残ります.今回の例で はパッケージは <em>squid-1.NOVM.22-1.i386.rpm</em> という名前になりま す.ファイル名は spec ファイルのパラメータを繋げて作る点に注意してくだ さい.すなわち <tt>Name</tt>, <tt>Version</tt>, <tt>Release</tt>, 該当 するハードウェアプラットフォーム(今回の例では <em>i386</em>)です.独自 の RPM を作る際には,長すぎて使いものにならない名前を付けてしまわない ように,この点を忘れないようにしましょう.<p> <!-- It's also worth bearing in mind that you can build RPMs without having to rebuild the whole software package, e.g.<p> --> RPM パッケージを構築する際にはパッケージ全体を再構築する必要はないこと も知っておいて損はないでしょう.操作例を以下に示します:<p> <tscreen><verb> Summary: Linux 2.0.36 kernel + filehandle patch + serial console patch Name: linux Version: 2.0.36+filehandle+serial_console Release: 1 Copyright: GPL Group: Base/Kernel Source: linux-2.0.36+filehandle+serial_console.tar.gz %description This is just a first attempt to package up the Linux kernel with patches for installation on our RedHat Linux servers %prep echo %setup echo %build echo %install echo %post /sbin/lilo %files /lib/modules/2.0.36 /boot/vmlinuz </verb></tscreen><p> <!-- In this case we simply create an RPM based on the <em>/boot/vmlinuz</em> file and the contents of the directory <em>/lib/modules/2.0.36</em>, and execute <em>/sbin/lilo</em> after the package has been installed on a target machine. Let me know if you know much neater way of writing the spec file than this.<p> --> この例は単に,<em>/boot/vmlinuz</em> ファイルと <em>/lib/modules/2.0.36</em> ディレクトリの内容に基づいて RPM パッケー ジを作成し,対象のマシンにパッケージのインストールを行った後に <em>/sbin/lilo</em> を実行するだけです.これよりもうまい spec ファイル の書き方があれば筆者にお知らせください.<p> <!-- <sect>Appendix C - Munging your own RPMs into the distribution<p> --> <sect>付録 C - 独自の RPM をディストリビューションに入れる<p> <!-- Here is Eric's script for munging updated RPMs into the RedHat distribution area: --> Eric さんが作成した,最新の RPM を RedHat ディストリビューションの領域 に入れるためのスクリプトを以下に示します: <!--NAKANO <code></code> の方が良いと思うけど...--> <tscreen><verb> #!/usr/bin/perl # $redhatdir="/cdrom/i386"; $rpmdir="/cdrom/i386/RedHat/RPMS/"; $updatedir="/cdrom/updates/"; @OTHERDIR=($updatedir); foreach $dir (@OTHERDIR) { print "update for $dir\n"; system(" find $dir -name \"*.rpm\" -exec cp {} $rpmdir \\; "); } chdir($contribdir) || die "peux pas aller dans $contribdir $!\n"; system("chmod -R 755 $redhatdir"); chdir($rpmdir) || die "problem to go in $rpmdir $!\n"; # # remove the old file # opendir(DIR,'.'); @package=grep(/\.rpm$/,readdir(DIR)); foreach $file (@package) { $file =~ /(.*)\-([\d+|\.]+\w*)\-(\d+)\.[i386|noarch].*/; $nom=$1; $version=$2; $buildvers=$3; if ($NOM{$nom}) { $version2=$VERSION{$nom}; $buildver2=$BUILDVERS{$nom}; $file2=$FILE{$nom}; $nom2=$NOM{$nom}; if ( $version2 gt $version ) { print "$file2 is newer than $file\n"; unlink($file); } else { if ( $version2 lt $version ) { print "$file is newer than $file2\n"; unlink($file2); $VERSION{$nom}=$version; $BUILDVERS{$nom}=$buildvers; $FILE{$nom}=$file; $NOM{$nom}=$nom; } else { if ( $buildver2 > $buildvers ) { print "$file2 : $buildver2 est mieux que $file : $buildvers\n"; unlink($file); } else { print "$file2 : $buildver2 is older than $file : $buildvers\n"; unlink($file2); $VERSION{$nom}=$version; $BUILDVERS{$nom}=$buildvers; $FILE{$nom}=$file; $NOM{$nom}=$nom; } } } } else { $VERSION{$nom}=$version; $BUILDVERS{$nom}=$buildvers; $FILE{$nom}=$file; $NOM{$nom}=$nom; } } # we do the hard thing here # system("$redhatdir/misc/src/install/genhdlist $redhatdir"); </verb></tscreen><p> </article>