In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/03 Report--
Today, the editor shares with you the linux kernel compilation steps, which I believe many people do not know very well. In order to let you know more about the linux kernel compilation steps, I have summarized the following contents and let's move on. I'm sure you'll get something.
Environment:
Computer operating system: ubuntu10.04.
Linux kernel version: linux-3.12.6
Specific steps:
1. Open the terminal and change it to root user. Enter the command su, and then enter the password.
2. Enter the directory where the downloaded kernel is located, and move the downloaded kernel to the / usr/src/ directory
Mv linux-3.12.6.tar.xz / usr/src
3. Change to the / usr/src/ directory and extract the kernel package. Since the downloaded package is the .tar.xz suffix, the decompression is divided into two steps:
Xz-d linux-3.12.6.tar.xztar-xvf linux-3.12.6.tar
Then do some preparatory work by linking / usr/include/asm, / usr/inlude/linux, / usr/include/scsi to the corresponding directory under the / usr/src/linux/include directory.
The above red font is not required.
(online learning video tutorials sharing: linux video tutorials)
At the same time, clean up the residue in the kernel source code (left by multiple compilations):
Cd / usr/src/linux-3.12.6make mrproper
4. Enter cd linux-3.12.6 to enter the decompressed directory.
Now it's time to configure the kernel.
5. Since there is no graphical interface configuration tool ncurses in the system, first download the installation package of this tool, then open the directory where the tool is located in the terminal, change to the root user, and enter the following command:
Tar zxvf ncurses-5.9.tar.gzcd ncurses-5.9./configuremakemake install
Ncurses is now installed and ready to use.
6. the fifth step is an independent step. Operate alone. This step follows the fourth step above. Enter the following command at the terminal:
Make menuconfig
A graphical interface for configuration appears.
Tell me about the configuration:
For each configuration option, the user has three options, which represent the following:
Or [*]-- compile this feature into the kernel
[]-- do not compile this feature into the kernel
[M]-compile this feature into code that can be dynamically inserted into the kernel when needed
7. This step is the configuration process. Configure what you need. After the configuration is complete, save and exit.
8. After the configuration is complete, start compiling the kernel and enter the make command in the terminal.
Another troublesome method is to enter the following commands in turn at the terminal:
Make depmake cleanmake bzlmagemake modules
That's okay.
This step will take a long time. Wait patiently.
Then install the kernel module.
9. Enter a command
Make modules_install
10. Enter commands
Make install
At this point, the kernel compilation is complete. The rest is to modify the startup program configuration and then run the new kernel program.
11. Copy the generated bzImage file and System.map file to the / boot/ directory with the following command:
Cp / usr/src/linux-3.12.6/arch/x86/boot/bzImage / boot/cp / usr/src/linux-3.12.6/System.map / boot/
12. Enter the command in the terminal:
Mkinitramfs 3.12.6-o / boot/initrd/img-3.12.6
To create an image file, and then enter the command:
Update-initramfs-c-k 3.12.6
Enter the command again:
Update-grub2
Update and modify the system boot configuration.
13. Go to the configuration file of the bootstrap program (boot loader). For different bootstrap programs (LILO and GRUB), the configuration files are located in different paths.
For LILO, the path is: / etc/lilo.conf
For GRUB, the path is: / boot/grub/grub.cfg
The system is booted by GRUB, so enter / boot/grub/grub.cfg with the following command:
Cd / boot/grubgedit grub.cfg
See the following in the configuration file:
Indicates that the kernel has been added to the startup item.
14. At this point, even if the kernel compilation is complete, the computer can be restarted.
15. Above is the whole process of compiling the kernel under ubuntu.
On the detailed interpretation of the linux kernel compilation steps to share here, I hope that the above content can have a certain reference value, you can learn to apply. If you like this article, you might as well share it for more people to see.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.