kernelの update
sorry Japanese only
最終更新日 2004/09/11
page size = Mbyte


関連するページ iptables3+brctl kernelの update sourceからの kernel構築

私が使用している linuxは vine linux 2.6なのですが、vine linux公式ホームページを見ると、バグフィックスが時々あるようです。
今までも何度か kernelの updateや apacheの updateをやってきましたが、あらためて記録を取ってみました。
今回は、kernelを 2.4.22-0vl2.14から 2.4.22-0vl2.15へ updateしました。

以下のサイトを参考にさせていただきました。
カーネルのアップグレード、設定の方法(vine linux公式日本語ページ)
6.5.2.Linuxのアップデート

まず、自分の使っている linuxの kernelがどんなバージョン、リリースなのかを調べます。
[root]# uname --all
Linux vine1 2.4.22-0vl2.14 #1 2004年 6月 16日 水曜日 19:04:34 JST i686 unknown
最後の unknownはいただけません。本来なら vine linuxとか表示されるはずです。

上の情報から分かることは、
カーネルバージョン2.4.22
リリース0vl2.14
マシンタイプi686

以上の情報を元に、自分に必要なファイルを ring serverなどから、downloadしてきます。
必要なのは kernelと kernel-headersです。

[root]# wget http://ring.ocn.ad.jp/archives/linux/Vine/updates/2.6/RPMS/i386/kernel-2.4.22-0vl2.15.i686.rpm
--14:33:06--  http://ring.ocn.ad.jp/archives/linux/Vine/updates/2.6/RPMS/i386/kernel-2.4.22-0vl2.15.i686.rpm
           => `kernel-2.4.22-0vl2.15.i686.rpm'
ring.ocn.ad.jp をDNSに問いあわせています... 完了しました。
ring.ocn.ad.jp[211.129.16.228]:80 に接続しています... 接続しました。
HTTP による接続要求を送信しました、応答を待っています... 200 OK
長さ: 9,882,686 [application/octet-stream]

100%[====================================>] 9,882,686    104.94K/s    ETA 00:00

14:34:38 (104.94 KB/s) - `kernel-2.4.22-0vl2.15.i686.rpm' を保存しました [9882686/9882686]

[root]# wget http://ring.ocn.ad.jp/archives/linux/Vine/updates/2.6/RPMS/i386/kernel-headers-2.4.22-0vl2.15.i386.rpm
--13:03:24--  http://ring.ocn.ad.jp/archives/linux/Vine/updates/2.6/RPMS/i386/kernel-headers-2.4.22-0vl2.15.i386.rpm
           => `kernel-headers-2.4.22-0vl2.15.i386.rpm'
ring.ocn.ad.jp をDNSに問いあわせています... 完了しました。
ring.ocn.ad.jp[211.129.16.228]:80 に接続しています... 接続しました。
HTTP による接続要求を送信しました、応答を待っています... 200 OK
長さ: 4,776,835 [application/octet-stream]

100%[====================================>] 4,776,835   1007.53K/s    ETA 00:00

13:03:29 (1007.53 KB/s) - `kernel-headers-2.4.22-0vl2.15.i386.rpm' を保存しました [4776835/4776835]
なんでか知りませんが ocnの ring server速度が安定しません・・

それでは kernelを installします。
[root]# rpm -Uvh kernel-2.4.22-0vl2.15.i686.rpm 
kernel              ##################################################
なんかあっけなく終わりました。
(どうも -Uオプションで実行すると /bootの古いカーネル本体が削除されてしまうようなので -iオプションの方が良いようです。)

次は ramdiskイメージファイルの作成です。(scsi hddより bootしている人のみ)
[root]#cd /boot
[root]# mkinitrd /boot/initrd-2.4.22-0vl2.15.img 2.4.22-0vl2.15
/bootへの cdは必要無いかも知れません。

上記コマンドを実行すると /bootへ以下のファイルが出来上がります。
-rw-r--r--    1 root     root       172518 Sep 11 14:52 initrd-2.4.22-0vl2.15.img

次は /etc/lilo.confファイルの書き換えです。
/bootへ新たに追加されたファイル名を確認します。
[root]# cd /boot
[root]# ls -ltr
-rw-r--r--    1 root     root      1233767 Aug 12 15:57 vmlinuz-2.4.22-0vl2.15
-rwxr-xr-x    1 root     root      3446529 Aug 12 15:57 vmlinux-2.4.22-0vl2.15
-rw-r--r--    1 root     root        11773 Aug 12 15:57 module-info-2.4.22-0vl2.15
-rw-r--r--    1 root     root       641585 Aug 12 15:57 System.map-2.4.22-0vl2.15
-rw-r--r--    1 root     root        63169 Aug 12 15:58 autoconf-up.h-2.4.22-0vl2.15
lrwxrwxrwx    1 root     root           22 Sep 11 14:37 vmlinuz -> vmlinuz-2.4.22-0vl2.15
lrwxrwxrwx    1 root     root           26 Sep 11 14:37 module-info -> module-info-2.4.22-0vl2.15
lrwxrwxrwx    1 root     root           25 Sep 11 14:37 System.map -> System.map-2.4.22-0vl2.15
lrwxrwxrwx    1 root     root           28 Sep 11 14:37 autoconf-up.h -> autoconf-up.h-2.4.22-0vl2.15
-rw-------    1 root     root        43520 Sep 11 14:37 map

新たに追加されたファイル名を確認しながら、/etc/lilo.confを編集します。
prompt
timeout=50
default=linux-2.15                                  ---下に追加した label=に合わせる
boot=/dev/sda
map=/boot/map
install=/boot/boot.b
message=/boot/message
lba32

image=/boot/vmlinuz-2.4.22-0vl2.15                  ---追加
        label=linux-2.15                            ---追加
        read-only                                   ---追加
        root=/dev/sda7                              ---追加
        initrd=/boot/initrd-2.4.22-0vl2.15.img      ---追加


image=/boot/vmlinuz-2.4.22-0vl2.14
        label=linux-2.14
        read-only
        root=/dev/sda7
        initrd=/boot/initrd-2.4.22-0vl2.14.img

image=/boot/vmlinuz-2.4.22-0vl2.10
        label=linux
        read-only
        root=/dev/sda7
        initrd=/boot/initrd-2.4.22-0vl2.10.img

/etc/lilo.confを編集したら、liloを実行してブートローダーをインストールします。
[root]# /sbin/lilo
Added linux-2.15 *
Added linux-2.14
Added linux
Added linux-2.2-up

実行する前にテストしてみるのも良いかもしれません。
[root]# lilo -t -v 3
LILO version 21.4-4 (test mode), Copyright (C) 1992-1998 Werner Almesberger
'lba32' extensions Copyright (C) 1999,2000 John Coffman

Reading boot sector from /dev/sda
Merging with /boot/boot.b
Device 0x0801: BIOS drive 0x80, 255 heads, 4462 cylinders,
               63 sectors. Partition offset: 63 sectors.
Secondary loader: 11 sectors.
Device 0x0801: BIOS drive 0x80, 255 heads, 4462 cylinders,
               63 sectors. Partition offset: 63 sectors.
Mapping message file /boot/message
Device 0x0801: BIOS drive 0x80, 255 heads, 4462 cylinders,
               63 sectors. Partition offset: 63 sectors.
Message: 0 sectors.
Boot image: /boot/vmlinuz-2.4.22-0vl2.15
Device 0x0801: BIOS drive 0x80, 255 heads, 4462 cylinders,
               63 sectors. Partition offset: 63 sectors.
Setup length is 10 sectors.
Mapped 0 sectors.
Mapping RAM disk /boot/initrd-2.4.22-0vl2.15.img
Device 0x0801: BIOS drive 0x80, 255 heads, 4462 cylinders,
               63 sectors. Partition offset: 63 sectors.
RAM disk: 0 sectors.
Added linux-2.15 *
    
    "ro root=807 BOOT_FILE=/boot/vmlinuz-2.4.22-0vl2.15"
Boot image: /boot/vmlinuz-2.4.22-0vl2.14
Device 0x0801: BIOS drive 0x80, 255 heads, 4462 cylinders,
               63 sectors. Partition offset: 63 sectors.
Setup length is 10 sectors.
Mapped 0 sectors.
Mapping RAM disk /boot/initrd-2.4.22-0vl2.14.img
Device 0x0801: BIOS drive 0x80, 255 heads, 4462 cylinders,
               63 sectors. Partition offset: 63 sectors.
RAM disk: 0 sectors.
Added linux-2.14
    
    "ro root=807 BOOT_FILE=/boot/vmlinuz-2.4.22-0vl2.14"
Boot image: /boot/vmlinuz-2.4.22-0vl2.10
Device 0x0801: BIOS drive 0x80, 255 heads, 4462 cylinders,
               63 sectors. Partition offset: 63 sectors.
Setup length is 10 sectors.
Mapped 0 sectors.
Mapping RAM disk /boot/initrd-2.4.22-0vl2.10.img
Device 0x0801: BIOS drive 0x80, 255 heads, 4462 cylinders,
               63 sectors. Partition offset: 63 sectors.
RAM disk: 0 sectors.
Added linux
    
    "ro root=807 BOOT_FILE=/boot/vmlinuz-2.4.22-0vl2.10"
Boot image: /boot/vmlinuz-2.2.25-0vl3
Device 0x0801: BIOS drive 0x80, 255 heads, 4462 cylinders,
               63 sectors. Partition offset: 63 sectors.
Setup length is 8 sectors.
Mapped 0 sectors.
Added linux-2.2-up
    
    "ro root=807 BOOT_FILE=/boot/vmlinuz-2.2.25-0vl3"
Map file size: 58880 bytes.
The boot sector and the map file have *NOT* been altered.

次は kernel-headersを installします。
[root]# rpm -Uvh kernel-headers-2.4.22-0vl2.15.i386.rpm 
kernel-headers              ##################################################

必要な人は、kernel srcも installします。
[root]# rpm -Uvh kernel-source-2.4.22-0vl2.15.i386.rpm 
kernel-source               ##################################################
パッケージ Makefile は file index 中に見つかりません
パッケージ Makefile は file index 中に見つかりません
パッケージ Makefile は file index 中に見つかりません
んー、エラーが多量に出て終わりました。
googleしても、何をやれば良いかが分かりません。と言うかどの人も放置しているという・・
もしかして rpm -ivhで実行すればいいのかもしれません。
-U installする前に 前バージョンは削除する。
-i installする。
って事のようですから。

rebootして起動するのを確認して終了です。

14667
戻る