- 浏览: 87436 次
- 性别:
- 来自: 北京
文章分类
最新评论
http://www.cyberciti.biz/tips/compiling-linux-kernel-26.html
Step # 1 Get Latest Linux kernel code
Visit http://kernel.org/ and download the latest source code. File name would be linux-x.y.z.tar.bz2, where x.y.z is actual version number. For example file inux-2.6.25.tar.bz2 represents 2.6.25 kernel version. Use wget command to download kernel source code:
$ cd /tmp
$ wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-x.y.z.tar.bz2
Note: Replace x.y.z with actual version number.
Step # 2 Extract tar (.tar.bz3) file
Type the following command:
# tar -xjvf linux-2.6.25.tar.bz2 -C /usr/src
# cd /usr/src
Step # 3 Configure kernel
Before you configure kernel make sure you have development tools (gcc compilers and related tools) are installed on your system. If gcc compiler and tools are not installed then use apt-get command under Debian Linux to install development tools.
# apt-get install gcc
Now you can start kernel configuration by typing any one of the command:
* $ make menuconfig - Text based color menus, radiolists & dialogs. This option also useful on remote server if you wanna compile kernel remotely.
* $ make xconfig - X windows (Qt) based configuration tool, works best under KDE desktop
* $ make gconfig - X windows (Gtk) based configuration tool, works best under Gnome Dekstop.
For example make menuconfig command launches following screen:
$ make menuconfig
You have to select different options as per your need. Each configuration option has HELP button associated with it so select help button to get help.
Step # 4 Compile kernel
Start compiling to create a compressed kernel image, enter:
$ make
Start compiling to kernel modules:
$ make modules
Install kernel modules (become a root user, use su command):
$ su -
# make modules_install
Step # 5 Install kernel
So far we have compiled kernel and installed kernel modules. It is time to install kernel itself.
# make install
It will install three files into /boot directory as well as modification to your kernel grub configuration file:
* System.map-2.6.25
* config-2.6.25
* vmlinuz-2.6.25
Step # 6: Create an initrd image
Type the following command at a shell prompt:
# cd /boot
# mkinitrd -o initrd.img-2.6.25 2.6.25
initrd images contains device driver which needed to load rest of the operating system later on. Not all computer requires initrd, but it is safe to create one.
Step # 7 Modify Grub configuration file - /boot/grub/menu.lst
Open file using vi:
# vi /boot/grub/menu.lst
title Debian GNU/Linux, kernel 2.6.25 Default
root (hd0,0)
kernel /boot/vmlinuz root=/dev/hdb1 ro
initrd /boot/initrd.img-2.6.25
savedefault
boot
Remember to setup correct root=/dev/hdXX device. Save and close the file. If you think editing and writing all lines by hand is too much for you, try out update-grub command to update the lines for each kernel in /boot/grub/menu.lst file. Just type the command:
# update-grub
Neat. Huh?
Step # 8 : Reboot computer and boot into your new kernel
Just issue reboot command:
# reboot
Step # 1 Get Latest Linux kernel code
Visit http://kernel.org/ and download the latest source code. File name would be linux-x.y.z.tar.bz2, where x.y.z is actual version number. For example file inux-2.6.25.tar.bz2 represents 2.6.25 kernel version. Use wget command to download kernel source code:
$ cd /tmp
$ wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-x.y.z.tar.bz2
Note: Replace x.y.z with actual version number.
Step # 2 Extract tar (.tar.bz3) file
Type the following command:
# tar -xjvf linux-2.6.25.tar.bz2 -C /usr/src
# cd /usr/src
Step # 3 Configure kernel
Before you configure kernel make sure you have development tools (gcc compilers and related tools) are installed on your system. If gcc compiler and tools are not installed then use apt-get command under Debian Linux to install development tools.
# apt-get install gcc
Now you can start kernel configuration by typing any one of the command:
* $ make menuconfig - Text based color menus, radiolists & dialogs. This option also useful on remote server if you wanna compile kernel remotely.
* $ make xconfig - X windows (Qt) based configuration tool, works best under KDE desktop
* $ make gconfig - X windows (Gtk) based configuration tool, works best under Gnome Dekstop.
For example make menuconfig command launches following screen:
$ make menuconfig
You have to select different options as per your need. Each configuration option has HELP button associated with it so select help button to get help.
Step # 4 Compile kernel
Start compiling to create a compressed kernel image, enter:
$ make
Start compiling to kernel modules:
$ make modules
Install kernel modules (become a root user, use su command):
$ su -
# make modules_install
Step # 5 Install kernel
So far we have compiled kernel and installed kernel modules. It is time to install kernel itself.
# make install
It will install three files into /boot directory as well as modification to your kernel grub configuration file:
* System.map-2.6.25
* config-2.6.25
* vmlinuz-2.6.25
Step # 6: Create an initrd image
Type the following command at a shell prompt:
# cd /boot
# mkinitrd -o initrd.img-2.6.25 2.6.25
initrd images contains device driver which needed to load rest of the operating system later on. Not all computer requires initrd, but it is safe to create one.
Step # 7 Modify Grub configuration file - /boot/grub/menu.lst
Open file using vi:
# vi /boot/grub/menu.lst
title Debian GNU/Linux, kernel 2.6.25 Default
root (hd0,0)
kernel /boot/vmlinuz root=/dev/hdb1 ro
initrd /boot/initrd.img-2.6.25
savedefault
boot
Remember to setup correct root=/dev/hdXX device. Save and close the file. If you think editing and writing all lines by hand is too much for you, try out update-grub command to update the lines for each kernel in /boot/grub/menu.lst file. Just type the command:
# update-grub
Neat. Huh?
Step # 8 : Reboot computer and boot into your new kernel
Just issue reboot command:
# reboot
发表评论
-
modprobe --- no symbol version for struct_module
2009-12-18 12:07 1969这个错误很可能是由于 kernel version 不一致导致 ... -
USB auto suspend udev sysfs
2009-12-11 11:42 1059http://reactivated.net/writing_ ... -
interface
2009-12-02 16:37 619/etc/network/interface -
Exit from X to console
2009-11-27 23:42 754/etc/init.d/gdm stop to reback ... -
gnome resolution pre user
2009-11-27 23:41 668gnome resolution config files a ... -
Linux touchpad too sensitive
2009-11-27 19:35 1111http://ubuntuguide.org/wiki/Ubu ... -
lspci lsusb
2009-11-27 19:34 1197liunx 硬件查看 lsusb lspci dmesg -
check dirty page on linux
2009-11-24 15:44 9431. top ->'f' ->'v' http: ... -
inittab
2009-07-30 15:44 780http://www.netadmintools.com/ht ... -
Linux 上运行Windows的程序---Wine
2009-04-26 21:37 814FAQ: 1. How to install Debian ... -
如何查看wifi 的 frequency 和 out power
2009-04-25 20:48 995iwconfig 的输出中有 frequency 和 Tx-p ... -
如何查看BT (BlueTooth) 的信息
2009-04-25 20:48 710lsusb -vv bluez下面 hciconfig h ... -
Linux 2.6.18 下安装 usb 无线网卡(zd1211)
2009-04-25 20:43 2769[设备采购] SAGEM XG-760 ... -
usb mass storage
2009-04-25 20:39 965refer to http://www.linux-usb.o ... -
How to Take a Screenshot in Linux With the Termina
2009-04-25 20:35 583please refer to: http://tips.w ... -
How to make root file system image file
2009-04-25 20:35 731Refer to : http://topic.csdn.ne ... -
initrd
2009-04-25 20:32 798http://hi.baidu.com/liyangzhao/ ... -
如何生成 xorg.conf
2009-04-25 20:32 1555Xorg -configure -
config sound card in Dell laptop (Latitude LS)
2009-04-25 20:30 666# install alsa utilty apt-get ... -
play audio(mp3)/vedio online (mozilla)
2009-04-25 20:29 812#install mozilla plugins --- mp ...
相关推荐
### 如何编译 Linux 内核 2.6 版本 随着技术的发展与进步,Linux 内核作为操作系统的核心部分,在系统管理、性能优化以及安全性方面起着至关重要的作用。对于想要深入了解 Linux 内核并对其进行定制化的用户来说,...
- This section discusses how to compile and build the Linux kernel image. It covers the necessary tools, configurations, and steps required to create a custom kernel tailored for specific needs. 2. ...
Other topics covered include the 1-Wire driver interface, how to configure a serial Linux console, and cross-compile code, including the Linux kernel. You'll find yourself turning to Advanced ...
As you delve deeper into the kernel, you'll discover its intricate design and how it enables the robust and flexible nature of Linux systems. 总之,开始学习Linux内核需要获取源码,为系统配置,编译,...
Over the years, this bestselling guide has helped countless programmers learn how to support computer peripherals under the Linux operating system, and how to develop new hardware under Linux....
软件包:r8168-dkms(8.043.02-1) dkms source for the r8168 network driver r8168 is the Linux device driver released for RealTek RTL8111... Kernel source or headers are required to compile these modules.
shell scripting, as well as how to compile your own kernel, and some simple knowledge about the kernel internals. I have tried as much as possible to eradicate all prerequisites needed before fully ...
How To Use ---------- Please don't proceed if you see any error in the below steps. 0. 0rth Law (as in thermodynamics) cat LICENSE 1. compile a. create the header files $ make header ( sometimes ...
Read INSTALL for details on how to compile/install it. Read CHANGELOG for whats new There is a vd.conf as example configuration, for those who would like to use this feature. Compiling the effects ...
内核发布包版本说明 2015.02.28 使用 zImage 注意: 1、这个包只制作zImage,在替换手机的bootimage之前,你必须得到ramdisk并添加内核cmdline来生成一... edit Makefile edit "CROSS_COMPILE" to right toolchain pa
8.11.2. Set up the linux Kernel [1] 8.11.3. Configure Bochs to use the tuntap interface 8.11.4. Set up the private network between the host and the guest 8.11.5. Set up the host to masquerade the ...
compiler from the JDK to compile JSPs, or any other Java compiler supported by Apache Ant. ============== API Stability: ============== The public interfaces for the following classes are fixed and ...
* Cross-compile with cross-gcc -I/path/to/cross-kernel/include */ #include #include #include #include #include #include #include #include <linux/types.h> #include <linux/spi/spidev.h> #...