- 系統: Debian (Lenny) 5.0.4
- 核心:kernel 2.6.26-2-amd64升級至2.6.30.3
Step 1:將source放到安裝目錄裡面
- cd /usr/src/kernels
- tar zxvf /root/linux-2.6.30.3.tar.gz
- cd /usr/src/kernels/linux-2.6.30.3
Step 2:刪除所有相關設定檔與 *.o
- make mrproper
- make clean
這個步驟是重複做幾次後再測試要選擇哪些kernel components與modules才需要做
Step 3:選擇需要的kernel components and kernel modules
- apt-get install libncurses5-dev (這是下一步需要用到的軟體)
- make menuconfig
在這邊請詳細選擇所需要的kernel component與module
Step 4:編譯核心
- make -j 8 bzImage (1m7s)
Root device is (9, 1)
Setup is 12732 bytes (padded to 12800 bytes).
System is 2613 kB
CRC ffa1ad08
Kernel: arch/x86/boot/bzImage is ready (#1) - file arch/x86/boot/bzImage
arch/x86/boot/bzImage: Linux kernel x86 boot executable RO-rootFS, root_dev 0x901, swap_dev 0x2, Normal VGA
Step 5:編譯模組並安裝到 /lib/modules
- make -j 8 modules (3m17s)
- make modules_install
- ls /lib/modules/2.6.30.3srvd/
Step 6:安裝核心到/boot下面
- cp /usr/src/kernels/linux-2.6.27.43/arch/x86/boot/bzImage /boot/vmlinuz-2.6.30.3srvd
- cp /usr/src/kernels/linux-2.6.27.43/.config /boot/config-2.6.30.3srvd
Step 7:製作initrds
- cat /etc/initramfs-tools/modules
raid1
raid0
raid10 - update-initramfs -c -k 2.6.30.3srvd
update-initramfs: Generating /boot/initrd.img-2.6.30.3srvd - file /boot/initrd.img-2.6.30.3srvd
/boot/initrd.img-2.6.30.3srvd: gzip compressed data, from Unix, last modified: Sun Jan 24 21:29:04 2010
Step 8:修改grub的menu.list
- cat /boot/grub/menu.lst
title Debian GNU/Linux, kernel 2.6.30.3srvd
root (hd0,1)
kernel /vmlinuz-2.6.30.3srvd root=/dev/md1 ro quiet vga=791
initrd /initrd.img-2.6.30.3srvd
因為是古老的黑手改法,所以要是沒改對,那這樣機器是無法開機的
_EOF_
沒有留言:
張貼留言