In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-04 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
This article introduces the knowledge of "how to configure Linux kernel image startup". Many people will encounter this dilemma in the operation of actual cases, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!
In Debian system, by modifying the startup configuration file / boot/extlinux/extlinux.conf, you can increase the Linux kernel image option when u-boot boots, which is convenient for Linux kernel debugging.
Note: this paper is based on RockPI 4A veneer Debian system.
I. extlinux.conf configuration file
After the Debian system starts, use the cat command to view the contents of the / boot/extlinux/extlinux.conf file.
Root@linaro-alip:~# cat / boot/extlinux/extlinux.conftimeout 10menu title select kernellabel kernel-4.4.154-90-rockchip-ga14f6502e045 kernel / vmlinuz-4.4.154-90-rockchip-ga14f6502e045 devicetreedir / dtbs/4.4.154-90-rockchip-ga14f6502e045 append earlyprintk console=ttyFIQ0,1500000n8 init=/sbin/init root=PARTUUID=b921b045-1D rw rootwait rootfstype=ext4label kernel-4.4.154-88-rockchip-00030-g90239a6 kernel / vmlinuz-4.4.154-88-rockchip-00030-g90239a6 devicetreedir / dtbs/4 .4.154-88-rockchip-00030-g90239a6 append earlyprintk console=ttyFIQ0,1500000n8 init=/sbin/init root=PARTUUID=b921b045-1D rw rootwait rootfstype=ext4label kernel-debug kernel / debug/Image fdt / debug/rk3399-rock-pi-4a.dtb append earlyprintk console=ttyFIQ0,1500000n8 init=/sbin/init root=PARTUUID=b921b045-1D rw rootwait rootfstype=ext4
Note: the last label kernel-debug is used for the Linux kernel debug image, which can be selected when u-boot starts.
The keyword kernel is followed by the Linux kernel image; the keyword fdt is followed by the dtb image. Where: debug is a new folder under the / boot directory to save the Linux kernel and dtb image for debugging. As follows:
Root@linaro-alip:~# ls / boot/debug/Image rk3399-rock-pi-4a.dtb
Keywords in extlinux.conf can refer to the cmd/pxe.c file in the u-boot code.
/ * Keywords recognized. * / static const struct token keywords [] = {{"menu", T_MENU}, {"title", T_TITLE}, {"timeout", T_TIMEOUT}, {"default", T_DEFAULT}, {"prompt", T_PROMPT}, {"label", T_LABEL}, {"kernel", T_KERNEL}, {"linux", T_LINUX}, {"localboot") T_LOCALBOOT}, {"append", T_APPEND}, {"initrd", T_INITRD}, {"include", T_INCLUDE}, {"devicetree", T_FDT}, {"fdt", T_FDT}, {"devicetreedir", T_FDTDIR}, {"fdtdir", T_FDTDIR}, {"ontimeout", T_ONTIMEOUT,}, {"ipappend", T_IPAPPEND }, {NULL, T_INVALID}}
II. Linux kernel loading
When you have finished modifying the extlinux.conf file, copy the Linux kernel and dtb image to the / boot/debug/ directory and restart the system. When u-boot starts to Hit key to stop autoboot ('CTRL+C'): 0, press enter, enter "3" after Enter choice:, and select the Linux kernel image 3: kernel-debug to be debugged, as follows:
Hit key to stop autoboot ('CTRL+C'): 0Device 0: unknown deviceswitch to partitions # 0 OKmmc1 is current deviceScanning mmc1: 4...Found / extlinux/extlinux.confpxefile_addr_str = 0x00500000bootfile = / extlinux/extlinux.confRetrieving file: / extlinux/extlinux.confreading / extlinux/extlinux.conf797 bytes readin 6 ms (128.9 KiB/s) select kernel1: kernel-4.4.154-90-rockchip-ga14f6502e0452: kernel-4.4.154-88-rockchip-00030-g90239a63: kernel-debugEnter choice: 3Retrieving file: / hw_intfc.confreading / hw_intfc .conf1720 bytes readin 4 ms (419.9 KiB/s)... (omitting part of log) Retrieving file: / debug/Imagereading / debug/Image20371464 bytes readin 885 ms (22 MiB/s) append: earlyprintk console=ttyFIQ0,1500000n8 init=/sbin/init root=PARTUUID=b921b045-1D rw rootwait rootfstype=ext4Retrieving file: / debug/rk3399-rock-pi-4a.dtbreading / debug/rk3399-rock-pi-4a.dtb94381 bytes readin 13 ms (6.9 MiB/s) fdt addr 0000000008300000fdt magic number edfe0dd0fdt size 1048576
At this point, u-boot boots the Linux kernel and dtb image corresponding to the kernle-debug tag in the / boot/extlinux/extlinux.conf file.
This method has a disadvantage: if you want to update the Linux kernel and dtb image corresponding to the kernle-debug tag, you need to first enter the system corresponding to the first or second tag, then download the debug image, restart the system, and then select the corresponding debug tag.
This is the end of "how to configure Linux kernel image startup". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!
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.