Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the kernel compilation commands in the Linux operating system

2025-01-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article is about the Linux operating system kernel compilation commands. Xiaobian thinks it is quite practical, so share it with everyone for reference. Let's follow Xiaobian and have a look.

The Linux kernel compilation process is lengthy: preparation, configuration, and compilation begin.

There are several commands related to compilation:

#make dep

#make clean

#make zImage

#make bzImage

#make modules

#make modules_install

#depmod -a

*** The first command make dep actually reads the configuration file generated by the configuration process to create a dependency tree corresponding to the configuration, thus deciding which ones need to be compiled and which ones do not; the second command make clean completes the deletion of the files left by the previous step to avoid some errors; The third command, make zImage, and the fourth command, make bzImage, compile the kernel completely. The kernel generated by both commands is compressed by gzip. Just one is enough. The difference between them is that you can generate a larger kernel by using make bzImage. For example, if you use the make zImage command when compiling the kernel version 2.4.0, the error prompt system too big will appear. We recommend using the make bzImage command.

The last three commands are only necessary if you select "Yes" in the answer to Enable loadable module support (CONFIG_MODULES) during the configuration process. Make modules and make modules_install generate the corresponding modules and copy the modules to the required directories respectively.

Strictly speaking, the seventh command has nothing to do with the compilation process. It generates dependencies between modules so that when you load modules using modprobe after you start a new kernel, you can locate them correctly.

update

After the above steps, we finally got a new version of the kernel. In order to be able to use the new version of the kernel, we need to make some changes:

#cp /usr/src/linux/System.map /boot/System.map-2.4.0test8

#cp /usr/src/linux/arch/i386/bzImage /boot/vmlinuz-2.4.0test8

The above two files are newly generated when we just compiled. Modify the two links System.map and vmlinuz under/boot to point to the new kernel file:

#cd /boot;rm -f System.map vmlinuz

#ln -s vmlinuz-2.4.0test8 vmlinuz

#ln -s System.map-2.4.0test8 System.map

Then modify/etc/lilo.conf:

#vi /etc/lilo.conf

Add the following paragraph:

image=/boot/vmlinuz-2.4.0test8

label=linux240

read-only

root=/dev/hda2

The root=/dev/hda2 line is modified as needed. Run:

#/sbin/lilo -v

Make sure you edited/etc/lilo.conf correctly and restart the system now:

#shutdown -r now

Press TAB when LILO appears after the machine restarts, type linux240, our new kernel works, enjoy it

Thank you for reading! About "Linux operating system kernel compilation command what" this article is shared here, I hope the above content can have some help to everyone, so that we can learn more knowledge, if you think the article is good, you can share it to let more people see it!

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.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report