Kozupon.com    
 
 Slackware11 On Kernel-2.6.21!


Slackware11は、インストール時にkernel-2.4.33とkernel-2.6.17を選ぶことが出来るが、Slackware11自体、標準のブートストラップが未だにLILOなので、こりゃー2.6kernelの最新をソースからコンパイルしてもいいんじゃん!みたいに思ったのがきかっけで、思った通りかなり簡単に最新の2.6カーネルがマウント出来た。
2.6カーネルは、 http://www.kernel.org/ から2007年05月最新のkernel-2.6.21.3をマウントすることにした。

セットアップ環境)
マシン環境:以下lspciコマンドでのView
00:00.0 Host bridge: Intel Corporation 82815 815 Chipset Host Bridge and Memory Controller Hub (rev 04)
00:01.0 PCI bridge: Intel Corporation 82815 815 Chipset AGP Bridge (rev 04)
00:1e.0 PCI bridge: Intel Corporation 82801 PCI Bridge (rev 02)
00:1f.0 ISA bridge: Intel Corporation 82801BA ISA Bridge (LPC) (rev 02)
00:1f.1 IDE interface: Intel Corporation 82801BA IDE U100 (rev 02)
00:1f.2 USB Controller: Intel Corporation 82801BA/BAM USB (Hub #1) (rev 02)
00:1f.3 SMBus: Intel Corporation 82801BA/BAM SMBus (rev 02)
00:1f.4 USB Controller: Intel Corporation 82801BA/BAM USB (Hub #2) (rev 02)
01:00.0 VGA compatible controller: NVidia / SGS Thomson (Joint Venture) Riva128 (rev 10)
02:0d.0 Ethernet controller: 3Com Corporation 3c905 100BaseTX [Boomerang]
OS:Slackware11.0
デフォルトカーネル:kernel-2.4.33


1.2007年05月現在最新2.6カーネルをゲット
1)カーネルをゲット

 http://www.kernel.org/ から kernel-2.6.21.tar.gz をゲット
root@cameleon:~# cd /usr/src/
root@cameleon:/usr/src# wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.21.tar.gz

--18:27:57-- http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.21.tar.gz
=> `linux-2.6.21.tar.gz'
Connecting to 192.168.0.9:8080... connected.
Proxy request sent, awaiting response... 200 OK
Length: 55,328,580 (53M) [application/x-gzip]

100%[===========================================>] 55,328,580 973.13K/s ETA 00:00patch-2.6.21.3.gz

18:28:51 (996.16 KB/s) - `linux-2.6.21.tar.gz' saved [55328580/55328580]

2)カーネルパッチをゲット
同サイトからカーネルパッチ patch-2.6.21.3.gz をゲット。
root@cameleon:/usr/src# wget http://www.kernel.org/pub/linux/kernel/v2.6/patch-2.6.21.3.gz
--18:30:23-- http://www.kernel.org/pub/linux/kernel/v2.6/patch-2.6.21.3.gz
=> `patch-2.6.21.3.gz'
Connecting to 192.168.0.9:8080... connected.
Proxy request sent, awaiting response... 200 OK
Length: 25,531 (25K) [application/x-gzip]

100%[===========================================>] 25,531 49.83K/s

18:30:24 (49.73 KB/s) - `patch-2.6.21.3.gz' saved [25531/25531]


2.カーネルの展開
ダウンロードしたカーネルを展開する。
root@cameleon:/usr/src# tar zxvf linux-2.6.21.tar.gz
root@cameleon:/usr/src# chown -R root.root linux-2.6.21
root@cameleon:/usr/src# cd linux-2.6.21


3.カーネルへパッチを当てる
2007年05月最新だったダウンロード済みの patch-2.6.21.3.gz をカーネルへ当てる。このパッチプログラムとは、このバージョンのkernelのソース中でのバグフィックス、kernelデバイスの追加等が合った場合に、シリーズ番号を付けて管理しているpatchプログラムである。
root@cameleon:/usr/src/linux-2.6.21# zcat ../patch-2.6.21.3.gz | patch -p1
patching file Makefile
patching file arch/arm/kernel/traps.c
patching file arch/arm/mach-iop13xx/pci.c
patching file arch/arm/plat-iop/time.c
patching file arch/i386/kernel/cpu/cpufreq/powernow-k7.c
patching file arch/i386/kernel/cpu/cpufreq/powernow-k8.c
patching file arch/i386/kernel/cpu/cpufreq/powernow-k8.h
patching file arch/sparc64/kernel/of_device.c
patching file arch/sparc64/kernel/prom.c
patching file arch/sparc64/kernel/smp.c
patching file arch/x86_64/kernel/vsyscall.c
patching file crypto/api.c
patching file drivers/acpi/tables/tbfadt.c
patching file drivers/ata/libata-sff.c
patching file drivers/ata/sata_via.c
patching file drivers/base/core.c
patching file drivers/char/ipmi/ipmi_si_intf.c
patching file drivers/crypto/geode-aes.c
patching file drivers/crypto/geode-aes.h
patching file drivers/md/raid1.c
patching file drivers/message/fusion/mptspi.c
patching file drivers/net/Kconfig
patching file drivers/net/bnx2.c
patching file drivers/net/sis900.c
patching file drivers/net/skge.c
patching file drivers/net/sky2.c
patching file drivers/net/smc911x.c
patching file drivers/net/tg3.c
patching file drivers/pci/quirks.c
patching file drivers/serial/sunhv.c
patching file drivers/usb/atm/cxacru.c
patching file drivers/usb/input/hiddev.c
patching file fs/fat/dir.c
patching file fs/jfs/jfs_logmgr.c
patching file fs/nfsd/export.c
patching file fs/reiserfs/xattr.c
patching file fs/udf/namei.c
patching file include/asm-arm/arch-iop13xx/iop13xx.h
patching file include/asm-sparc64/openprom.h
patching file include/linux/clocksource.h
patching file include/linux/netdevice.h
patching file include/linux/netfilter/nf_conntrack_proto_gre.h
patching file include/linux/netfilter_ipv4/ip_conntrack_proto_gre.h
patching file kernel/time/clocksource.c
patching file kernel/time/tick-common.c
patching file kernel/time/tick-internal.h
patching file kernel/time/tick-sched.c
patching file kernel/timer.c
patching file lib/zlib_inflate/inflate.c
patching file mm/hugetlb.c
patching file mm/oom_kill.c
patching file mm/slob.c
patching file net/ipv4/fib_frontend.c
patching file net/ipv4/netfilter/ip_conntrack_core.c
patching file net/ipv4/netfilter/ip_nat_proto_gre.c
patching file net/ipv4/netfilter/nf_nat_proto_gre.c
patching file net/ipv4/tcp.c
patching file net/ipv6/addrconf.c
patching file net/ipv6/exthdrs.c
patching file net/ipv6/ip6_input.c
patching file net/ipv6/ip6_output.c
patching file net/ipv6/proc.c
patching file net/ipv6/xfrm6_tunnel.c
patching file net/netfilter/nf_conntrack_core.c
patching file net/sched/sch_prio.c
patching file net/sctp/socket.c
patching file net/sunrpc/auth_gss/svcauth_gss.c
patching file net/xfrm/xfrm_policy.c
patching file scripts/basic/fixdep.c
patching file sound/pci/hda/patch_sigmatel.c


4.カーネルをconfigする
1)既存のカーネルの設定をそのまま新カーネルの設定へ引き継ぐためカレントへ以前の カーネル設定をコピーする

root@cameleon:/usr/src/linux-2.6.21# cp /boot/config .config

2)本格的にカーネルを設定する
カーネル設定の見直し。1)の処理で既存のカーネルの設定で引き継がれてないもの、特に2.6カーネルで追加された事項の設定。
root@cameleon:/usr/src/linux-2.6.21# make menuconfig
HOSTCC scripts/kconfig/lxdialog/checklist.o
HOSTCC scripts/kconfig/lxdialog/inputbox.o
HOSTCC scripts/kconfig/lxdialog/menubox.o
HOSTCC scripts/kconfig/lxdialog/textbox.o
HOSTCC scripts/kconfig/lxdialog/util.o
HOSTCC scripts/kconfig/lxdialog/yesno.o
HOSTCC scripts/kconfig/mconf.o
HOSTLD scripts/kconfig/mconfmake modules_install
scripts/kconfig/mconf arch/i386/Kconfig

途中省略

*** End of Linux kernel configuration.
*** Execute 'make' to build the kernel or try 'make help'.


5.コンパイル&ビルド
1)カーネルmake
root@cameleon:/usr/src/linux-2.6.21# make
scripts/kconfig/conf -s arch/i386/Kconfig
CHK include/linux/version.h
UPD include/linux/version.h
CHK include/linux/utsrelease.h
UPD include/linux/utsrelease.h
SYMLINK include/asm -> include/asm-i386
CC arch/i386/kernel/asm-offsets.s
GEN include/asm-i386/asm-offsets.h
CC scripts/mod/empty.o
HOSTCC scripts/mod/mk_elfconfig
MKELF scripts/mod/elfconfig.h
HOSTCC scripts/mod/file2alias.o
HOSTCC scripts/mod/modpost.o
HOSTCC scripts/mod/sumversion.o
HOSTLD scripts/mod/modpost
HOSTCC scripts/kallsyms
HOSTCC scripts/conmakehash
CC init/main.o
CHK include/linux/compile.h
以下省略

root@cameleon:/usr/src/linux-2.6.21# make clean

2)カーネルイメージを作る
root@cameleon:/usr/src/linux-2.6.21# make bzImage

3)デバイスモジュール関係のmake
root@cameleon:/usr/src/linux-2.6.21# make modules

root@cameleon:/usr/src/linux-2.6.21# make modules_install

4)カーネルのリンク
root@cameleon:/usr/src/linux-2.6.21# make install


6.LILOの設定
root@cameleon:/usr/src/linux-2.6.21# cd /etc

1)lilo.confの編集
root@cameleon:/etc# vi lilo.conf

reading lilo.conf

# LILO configuration file
# generated by 'liloconfig'
#
# Start LILO global section
boot = /dev/hda
message = /boot/boot_message.txt
prompt
timeout = 1200

# Override dangerous defaults that rewrite the partition table:
change-rules
reset

# VESA framebuffer console @ 1024x768x256
# vga = 773
# Normal VGA console

vga = normal

# VESA framebuffer console @ 1024x768x64k
# vga=791
# VESA framebuffer console @ 1024x768x32k
# vga=790
# VESA framebuffer console @ 1024x768x256
# vga=773
# VESA framebuffer console @ 800x600x64k
# vga=788
# VESA framebuffer console @ 800x600x32k
# vga=787
# VESA framebuffer console @ 800x600x256
# vga=771
# VESA framebuffer console @ 640x480x64k
# vga=785
# VESA framebuffer console @ 640x480x32k
# vga=784
# VESA framebuffer console @ 640x480x256
# vga=769
# End LILO global section
# Linux bootable partition config begins
image = /boot/vmlinuz
root = /dev/hda3
label = Linux
read-only

image = /boot/vmlinuz-ide-2.4.33.3
root = /dev/hda3
label = Linux.old
read-only

# Linux bootable partition config ends

wrote lilo.conf, 46 lines, 1053 chars

root@cameleon:/etc# /sbin/lilo -v
LILO version 22.7.1, Copyright (C) 1992-1998 Werner Almesberger
Development beyond version 21 Copyright (C) 1999-2005 John Coffman
Released 17-Sep-2005 and compiled at 00:33:53 on Aug 8 2006.

Warning: LBA32 addressing assumed
Reading boot sector from /dev/hda
Using MENU secondary loader
Calling map_insert_data
Mapping message file /boot/boot_message.txt
Calling map_insert_file

Boot image: /boot/vmlinuz
Added Linux *

Boot image: /boot/vmlinuz-ide-2.4.33.3
Added Linux.old

Writing boot sector.
/boot/boot.0300 exists - no boot sector backup copy made.


7.kernel-2.6で動かしてみる
1)マシンをリブートする。
root@cameleon:/etc# reboot

2)sshでクライアントからloginしてみる
mity@tommy:~$ slogin -l mity 192.168.3.4
mity@192.168.3.4's password: ***********
Last login: Mon May 28 22:04:27 2007 from 192.168.3.16
Linux 2.6.21.3.
ネットワーク接続問題無し。

3)カーネルのバージョンを確かめてみる
mity@cameleon:~$ uname -a

Linux cameleon 2.6.21.3 #2 Mon May 28 20:02:08 JST 2007 i686 pentium3 i386 GNU/Linux
カーネルのバージョンチェックもこの通り。
Slackware11.0 On Kernel-2.6.21.3再構築完成!

以上


 
 
 



Copyright 2007 Kozupon.com.