Compile the kernel of UBUNTU 7.04 system

1. Install the necessary tool packages: libncurses5-dev (required for menuconfig) and essential sudo aptitude install build-essential bin86 kernel-package sudo aptitude install libqt3-headers libqt3-mt-dev sudo aptitude install make sudo aptitude install gcc //Even if gcc has been installed, it is best to update it. In addition, enter sudo mki in the terminal and press the "Tab" key twice to see if the terminal displays mkinitramfs mkisofs. These two tools are used to generate *. img file, if not, install it. The second step is to download the kernel. Go to www.kernel.org to download the new kernel. The latest one is linux-2.6.21.1.tar.bz2 (the original system kernel is 2.6.20-15-generic. If you use Nvadia's acceleration driver, please use the Source in the source, otherwise you may not be able to start If the current kernel version is the same: cd /lib/modules Rename the folder under it and also change some things under /boot. After the change, you need to modify /boot/grub/menu.lst. It is quite troublesome. The best suggestion is Download a kernel that is higher than the currently installed version. Unzip linux-2.6.21.1.tar.bz2 and put the linux-2.6.16.2 folder under /usr/src. sudo ln -s linux-2.6.21.1 linux //If this file If there is already a link named linux in the folder, please change it to linux.old. Step 4: Start compiling cd /usr/src/linux //All the following work is completed under /usr/src/linux sudo make mrproper // Remove the .o compiled file sudo make menuconfig //If you use menuconfig, you need the support of two other tool packages. I forgot their names, Ncurses? Or use sudo make xconfig. Then you can configure it slowly and save it after configuring (a kernel configuration file saved in the system is named .config under /usr/src/linux. Add a new startup item: sudo vim /boot/grub/menu.lst title Ubuntu, kernel 2.6.21.1 root (hd1,0) //Pay attention to the partition name kernel /boot/vmlinuz- 2.6.21.1 root=/dev/sdb1 ro initrd /boot/initrd.img- 2.6.21.1 boot

Guess you like

Origin blog.csdn.net/shaken/article/details/1610645