第二步:給2.4.31內核打補丁,重新編譯內核加載新特性
下載squashfs3.1-r2.tar.gz補丁文件,這個版本是針對與2.4內核的,如果你是2.6內核系統的話,需要下載對應2.6版本的。
先打補丁。將squashfs3.1-r2.tar.gz拷貝到/usr/src下
CODE: |
[root@localhost src]# tar -zxvf squashfs3.1-r2.tar.gz [root@localhost src]# cd linux |
備份我們升級內核用到的配置文件
CODE: |
[root@localhost linux]# cp .config ../backup.config |
進行上次編譯后的清理
CODE: |
[root@localhost linux]# make mrproper |
為了將2.4.31的內核跟打過補丁的內核區分開來或者不至引起錯誤,我們在makefile中添加自定義版本信息來進行區分。
[root@localhost linux]# vi Makefile
修改
CODE: |
EXTRAVERSION = |
為
CODE: |
EXTRAVERSION = -cucme |
保存。
下來需要給內核打補丁
CODE: |
[root@localhostlinux]#patch -p1 < ../squashfs3.1-r2/linux-2.4.31/squashfs3.1-patch patching file fs/Config.in patching file fs/Makefile patching file fs/squashfs/inode.c patching file fs/squashfs/Makefile patching file fs/squashfs/squashfs2_0.c patching file fs/squashfs/squashfs.h patching file include/linux/fs.h patching file include/linux/squashfs_fs.h patching file include/linux/squashfs_fs_i.h patching file include/linux/squashfs_fs_sb.h patching file init/do_mounts.c patching file lib/Config.in |
然后把配置文件拷貝回來,在make menuconfig中再次進行修改。(這次的工作主要是添加squashfs文件系統)
CODE: |
[root@localhost linux]# cp ../backup.config ./.config |
由于我們這次編譯內核的意圖明確,所以可以直奔主題,因為其它的選項都已經選擇好了。
CODE: |
[root@localhost linux]#make menuconfig |