In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-08 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
The main content of this article is to explain "what are the ways to view the compilation information of Linux kernel image?", interested friends may wish to take a look. The method introduced in this paper is simple, fast and practical. Next, let the editor take you to learn "what are the ways to view the compilation information of Linux kernel images?"
1. Check the startup log when the system loads the Linux kernel
Starting kernel... [0.000000] Booting Linux on physical CPU 0x0 [0.000000] Initializing cgroup subsys cpuset [0.000000] Initializing cgroup subsys cpu [0.000000] Initializing cgroup subsys cpuacct [0.000000] Linux version 4.4.154-00036-gcef30e88a9f5-dirty (root@ubuntu) (gcc version 7.3.1 20180425 [linaro-7.3-2018.05 revision d29120a424ecfbc167ef90065c0eeb7f91977701] (Linaro GCC 7.3-2018.05)) # 5 SMP Sun Jan 31 05:56:36 PST 2021
According to the boot log above, you can get the following information:
1) Linux kernel version
The Linux kernel version is 4.4.154. The Linux kernel version information can also be verified by Makefile in the Linux kernel code root directory, as follows:
Root@ubuntu:/home/run/code/rockchip-bsp/kernel# vi MakefileVERSION = 4PATCHLEVEL = 4SUBLEVEL = 154
2) compile user and host names
The compiler user is: root; hostname: ubuntu.
3) tool chain information
The tool chain information is: linaro-7.3-2018.05 revision d29120a424ecfbc167ef90065c0eeb7f91977701] (Linaro GCC 7.3-2018.05).
4) Linux kernel image compilation time
The Linux kernel image compilation time is: Jan 31 05:56:36 PST 2021.
The above log can be parsed by referring to the kernel code root file: scripts/mkcompile_h.
Delete the last line of the file, recompile the kernel, and then look at the .tmpver.1 file.
Scripts/mkcompile_h file code modification:
# rm-f .tmpver.1 .tmpver.2
.tmpver.1 file contents:
Root@ubuntu:/home/run/code/rockchip-bsp/kernel# cat .tmpver.1 / * This file is auto generated, version 5 * / * SMP * / # define UTS_MACHINE "arm64" # define LINUX_COMPILE_BY "root" # define LINUX_COMPILE_HOST "ubuntu" # define LINUX_COMPILER "gcc version 7.3.1 20180425 [linaro-7.3-2018.05 revision d29120a424ecfbc167ef90065c0eeb7f91977701] (Linaro GCC 7.3-2018.05)"
2 、 dmesg
If the system boot log is not saved, you can also view it through the dmesg command.
Root@linaro-alip:~# dmesg [0.000000] Booting Linux on physical CPU 0x0 [0.000000] Initializing cgroup subsys cpuset [0.000000] Initializing cgroup subsys cpu [0.000000] Initializing cgroup subsys cpuacct [0.000000] Linux version 4.4.154-00036-gcef30e88a9f5-dirty (root@ubuntu) (gcc version 7.3.1 20180425 [linaro-7.3-2018.05 revision d29120a424ecfbc167ef90065c0eeb7f91977701] (Linaro GCC 7.3-2018.05)) # 5 SMP Sun Jan 31 05:56:36 PST 2021
3 、 cat / proc/version
In addition to the dmesg command, it can also be viewed through cat / proc/version for a clearer display.
Root@linaro-alip:~# cat / proc/versionLinux version 4.4.154-00036-gcef30e88a9f5-dirty (root@ubuntu) (gcc version 7.3.1 20180425 [linaro-7.3-2018.05 revision d29120a424ecfbc167ef90065c0eeb7f91977701] (Linaro GCC 7.3-2018.05)) # 5 SMP Sun Jan 31 05:56:36 PST 2021
4 、 cat / proc/sys/kernel/version
If you are debugging on your own, you can also use the cat / proc/sys/kernel/version command to check only the compilation time.
Root@linaro-alip:~# cat / proc/sys/kernel/version#5 SMP Sun Jan 31 05:56:36 PST 2021
5. Uname-a
Of course, you can also use the uname-a command.
Root@linaro-alip:~# uname-aLinux linaro-alip 4.4.154-00036-gcef30e88a9f5-dirty # 5 SMP Sun Jan 31 05:56:36 PST 2021 aarch74 GNU/Linux
Finally, adhering to the principle of buy one get one free, there is a command to view the version of the system: cat / etc/issue
Root@linaro-alip:~# cat / etc/issueDebian GNU/Linux 9\ n\ l so far, I believe you have a deeper understanding of "what are the ways to view the compilation information of Linux kernel images". You might as well do it in practice! Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!
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.