cd linux-2.6.34.14 make mrproper #清除舊目標文件和配置 make menuconfig #配置內核選項 這裏我沒選ipv6支持,添加了ntfs文件系統的支持 注意:"*" 表示啓動內核時直接加載的模塊 "M" 表示在須要該模塊時動態加載,這種好處就是節省資源 " " 空格表示不選 make #編譯內核 make modules #編譯內核模塊 make modules_install #安裝內核模塊 make install #安裝新內核
驗證:less /etc/grub.conf # default=0 timeout=5 splashimage=(hd0,0)/grub/splash.xpm.gz hiddenmenu title Red Hat Enterprise Linux Server (2.6.34.14) root (hd0,0) kernel /vmlinuz-2.6.34.14 ro root=UUID=2858d858-b089-4d4a-a044-4b75325a35dd rd_NO_LUKS rd_NO_LVM rd_NO_MD rd_NO_DM LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYBOARDTYPE=pc KEYTABLE=us crashkernel=auto rhgb quiet initrd /initramfs-2.6.34.14.img title Red Hat Enterprise Linux (2.6.32-71.el6.x86_64) root (hd0,0) kernel /vmlinuz-2.6.32-71.el6.x86_64 ro root=UUID=2858d858-b089-4d4a-a044-4b75325a35dd rd_NO_LUKS rd_NO_LVM rd_NO_MD rd_NO_DM LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYBOARDTYPE=pc KEYTABLE=us crashkernel=auto rhgb quiet initrd /initramfs-2.6.32-71.el6.x86_64.img # 格式化一個ntfs格式的U盤,在當前啓動的內核不識別,啓動新內核即可以自動掛載
出現的問題: 錯誤:make[2]: warning: Clock skew detected. Your build may be incomplete. make[2]: Warning: File `/usr/src/kernels/linux-2.6.34.14/Documentation/networking/Makefile' has modification time 1.4e+07 s in the future 網上資料分析: ###################################### We may get warning of this type when: 1) You try to build after moving your data from one machine to another. 2) You try to build after restarting any old machine. This is due to the fact that sometimes when a machine is restarted its time and date settings get affected. Also when you transfer data from one machine to another one may get such an error because of the time difference form machine to machine. There are two ways to overcome this error: A] Linux has a very handy ‘the touch command’. How to Use: # touch Explanation: The touch command changes the time stamp of the file with the ‘file name’ give as argument to the command. For every file the Linux OS maitains some data like the files creation time, last modification time, etc. touch changes the last modification time of the command and sets it to the time the touch command was executed. The very well known ‘make’ command works on a very similar principle. This method is suitable only if yu haev transferred one or two files. But if there are many such files (and also if the machine time is not set to the present) then it would be better to use the following method. [EDIT :] Okay here’s an update: You can use the touch command for any number of files in the following manner: 1. Just ‘cd’ into the directory where the files need a time-stamp update. 2. Next use the following command which will update the time-stamps of all the files in the directory: # find . -exec touch {} \; B] the ‘date’ command: How to use: # sudo date Explanation: The date command changes the time and date of the Linux system to the time and date given as an argument. The argument is formed int he following way - -> First two digits are the current month like 02 for February and 12 for December. -> Next two digits are the date from 01 to 30 or 31. -> Next two digits are the time digits. This is to be strictly given in the 24 hour format. Nevertheless, while displaying the system time ( which happens when the date command is executed without any arguments ) the time is displayed in 12 hour format or whatever format is set. -> next two digits are for minutes range is from 00 to 59 ->Next four digits are for the current year like 2013. This way the system time will be set to the current time and your build will be now successful.