LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices


Reply
  Search this Thread
Old 01-31-2021, 03:14 AM   #136
JSB
Member
 
Registered: Dec 2020
Posts: 102

Rep: Reputation: 22

Quote:
Originally Posted by Emerson View Post
jsbjsb001,

there is no need to go into details, but letting people to know about all possibilities can't harm. Everyone interested can do their own research once they are made aware.
I think this is true.
I try nconfig with kernel source, but it not works.
Maybe put this text in wiki also?

Thank you.
 
Old 01-31-2021, 03:23 AM   #137
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,706
Blog Entries: 19

Rep: Reputation: 4506Reputation: 4506Reputation: 4506Reputation: 4506Reputation: 4506Reputation: 4506Reputation: 4506Reputation: 4506Reputation: 4506Reputation: 4506Reputation: 4506
Quote:
Originally Posted by Emerson View Post
With my motherboard if I hit F11 after powerup I will be presented with a boot menu, where I can choose the image to boot.

I'm surprised there are UEFI motherboards which do not have such a menu.
Ah, you mean the "magic key". Yes, of course my UEFI has that. It's <F1> as far as I can remember. But using it is awkward; you have to press it at exactly the right moment or it doesn't work. Apparently some UEFIs can be set to print a menu out as part of their normal startup procedure, but mine can't.
 
Old 01-31-2021, 06:49 AM   #138
jsbjsb001
Senior Member
 
Registered: Mar 2009
Location: Earth, unfortunately...
Distribution: Currently: OpenMandriva. Previously: openSUSE, PCLinuxOS, CentOS, among others over the years.
Posts: 3,881

Original Poster
Rep: Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063
Quote:
Originally Posted by Emerson View Post
Thanks for the welcome!

Once I wrote a few words for novice Gentoo users and put it in my router. Feel free to use any bits from it, in case you find something useful there.

What's not in Gentoo Handbook
You're welcome

While I'll have a proper look at it when I've got more time on my hands (I did add a link to the "See also" section at the bottom of the wiki article, as upon a quick skim, it did look quite interesting), but thanks for the link in any case, I'll have a look at it later on.

Quote:
Originally Posted by hazel View Post
nconfig looks prettier than menuconfig. I don't think there's any functional difference.
I just had a look, and yes, that does seem to be the case. So I added a bit about it with the make menuconfig bit in the configure the kernel part of the article.

Quote:
Originally Posted by hazel View Post
The main problem with Emerson's method is that it requires deep knowledge of how the kernel works and what is or is not necessary to make a particular collection of software work reliably on particular hardware.
...
I don't think they are saying we should add a detailed explanation of how to build "that perfect kernel".

Quote:
Originally Posted by hazel View Post
I have played around too with the idea of self-booting kernels. They sound like an elegant solution, but I have several distros so I need a menu to boot them from. I understand that some UEFIs have a built-in menu facility but mine doesn't seem to have one; apparently it's something the UEFI standard doesn't require. But we certainly could add a paragraph about booting without a bootloader for single-distro users.
There seems to me to be a couple of ways I could add the bit about booting the kernel directly from UEFI (without using a bootloader). I think it does warrant a quick mention in the Tips and tricks section in terms of a basic outline of which kernel config option needs to be set, along with an example in regards to adding an entry with efibootmgr. Along with a quick pointer to the Tips and tricks sub-section for it in the main body of the article, being in the "making your kernel bootable" section. In any case, it should be added, and if I knew about that before, I would have added it already. But before I do add anything about it, may I ask you what your way of adding it might be?

Quote:
Originally Posted by hazel View Post
I would be unhappy with the idea of making the existing wiki entry much longer. Actually I think it is already too long. A better solution imho would be to write a sequel on fine tuning your kernel. This would assume the knowledge of how to actually build a kernel by referencing the present entry and then take it on from there, explaining how to interpret the configuration options and determine which ones you actually need on your system. I think it might prove particularly useful for single-board computer users.
...
I think you're a little too fixated on "the article is too long". As long as it's something that's directly relevant to the process of building the kernel and the merit is there, then I think that's more important than just how long the article is. At the end of the day, if someone isn't prepared to do the required reading, then they shouldn't be trying to build a kernel in the first place, period. However, I do agree that when it comes to things like fine-tuning a build, then yes, I think you have a point. There is also already a wiki article about patching the kernel, which is why I added the "See also" section at the bottom of the article and added a link to the existing wiki page about patching the kernel (and the existing configuring the kernel page as well). Because while yes, patching the kernel for one thing is still about the kernel, it's not something that someone building a kernel is explicitly required to consider, not to mention to do that "justice" as it were, it's better off in it's own separate page instead (as it already is). The various kernel config options are a good example of the point I'm making here, in that, yes if we included every single one of them in the article, let alone with a description, then yes, that would make it far too long. Not to mention the fact the page would have to be updated with every new kernel release in that case. Besides, you can go to kernel.org for that info already anyway - I'll add a link to that in the "See also" section at the bottom of the article.
 
Old 01-31-2021, 07:18 AM   #139
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,706
Blog Entries: 19

Rep: Reputation: 4506Reputation: 4506Reputation: 4506Reputation: 4506Reputation: 4506Reputation: 4506Reputation: 4506Reputation: 4506Reputation: 4506Reputation: 4506Reputation: 4506
Quote:
Originally Posted by jsbjsb001 View Post
I think it does warrant a quick mention in the Tips and tricks section in terms of a basic outline of which kernel config option needs to be set, along with an example in regards to adding an entry with efibootmgr. Along with a quick pointer to the Tips and tricks sub-section for it in the main body of the article, being in the "making your kernel bootable" section. In any case, it should be added, and if I knew about that before, I would have added it already. But before I do add anything about it, may I ask you what your way of adding it might be?
Tips and Tricks sounds like a good place. The main kernel configuration option that you need is efistubs, which incorporates the efi bootloader code. I think all stock kernels include this nowadays. If you use an initrd, you will also need config_initramfs_source, which allows the kernel to identify and load this without a bootloader to pass the information. I don't know how you insert the kernel command line but I'm sure there's a way of configuring it in.

Then you just copy your kernel to the ESP with a name that ends with 64.efi. If your particular UEFI won't boot vmlinuz64.efi or linux64.efi, rename it boot64.efi.
 
1 members found this post helpful.
Old 01-31-2021, 08:13 AM   #140
colorpurple21859
LQ Veteran
 
Registered: Jan 2008
Location: florida panhandle
Distribution: Slackware Debian, Fedora, others
Posts: 7,418

Rep: Reputation: 1601Reputation: 1601Reputation: 1601Reputation: 1601Reputation: 1601Reputation: 1601Reputation: 1601Reputation: 1601Reputation: 1601Reputation: 1601Reputation: 1601
Quote:
I don't know how you insert the kernel command line but I'm sure there's a way of configuring it in.
Code:
Processor type and Features ---->
   ( )Built-in kernel command line
 
2 members found this post helpful.
Old 01-31-2021, 08:20 AM   #141
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,706
Blog Entries: 19

Rep: Reputation: 4506Reputation: 4506Reputation: 4506Reputation: 4506Reputation: 4506Reputation: 4506Reputation: 4506Reputation: 4506Reputation: 4506Reputation: 4506Reputation: 4506
Quote:
Originally Posted by colorpurple21859 View Post
Code:
Processor type and Features ---->
   ( )Built-in kernel command line
Ah! I was looking for it under General Setup and couldn't find it. I never thought of looking under Processor Type. What's it got to do with that?
 
Old 01-31-2021, 08:23 AM   #142
colorpurple21859
LQ Veteran
 
Registered: Jan 2008
Location: florida panhandle
Distribution: Slackware Debian, Fedora, others
Posts: 7,418

Rep: Reputation: 1601Reputation: 1601Reputation: 1601Reputation: 1601Reputation: 1601Reputation: 1601Reputation: 1601Reputation: 1601Reputation: 1601Reputation: 1601Reputation: 1601
That is where the efi-stub option is located as well. I knew I had seen it before, but I had to look for it.
 
1 members found this post helpful.
Old 01-31-2021, 09:35 AM   #143
Emerson
LQ Sage
 
Registered: Nov 2004
Location: Saint Amant, Acadiana
Distribution: Gentoo ~amd64
Posts: 7,673

Rep: Reputation: Disabled
Now when I think of it my PCI and USB page may be useful as well, feel free to use it as you wish.
 
1 members found this post helpful.
Old 01-31-2021, 09:59 AM   #144
Emerson
LQ Sage
 
Registered: Nov 2004
Location: Saint Amant, Acadiana
Distribution: Gentoo ~amd64
Posts: 7,673

Rep: Reputation: Disabled
Quote:
Originally Posted by hazel View Post
If your particular UEFI won't boot vmlinuz64.efi or linux64.efi, rename it boot64.efi.
There is a typo, it must be EFI/boot/bootx64.efi. Also, the location is important as I wrote in one of my previous posts. But only if you want your image to be found automatically. When you use efibootmgr to add your images to the boot list then you do not have these restrictions.
 
Old 02-02-2021, 08:08 AM   #145
jsbjsb001
Senior Member
 
Registered: Mar 2009
Location: Earth, unfortunately...
Distribution: Currently: OpenMandriva. Previously: openSUSE, PCLinuxOS, CentOS, among others over the years.
Posts: 3,881

Original Poster
Rep: Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063
Quote:
Originally Posted by hazel View Post
Tips and Tricks sounds like a good place. The main kernel configuration option that you need is efistubs, which incorporates the efi bootloader code. I think all stock kernels include this nowadays. If you use an initrd, you will also need config_initramfs_source, which allows the kernel to identify and load this without a bootloader to pass the information. I don't know how you insert the kernel command line but I'm sure there's a way of configuring it in.

Then you just copy your kernel to the ESP with a name that ends with 64.efi. If your particular UEFI won't boot vmlinuz64.efi or linux64.efi, rename it boot64.efi.
With the CONFIG_INITRAMFS_SOURCE option, I assume like the kernel itself, you would need to copy the initrd to the ESP? Assuming I'm right in thinking that; would an example of that be:

Code:
CONFIG_INITRAMFS_SOURCE="/EFI/boot/initrd"
?

or

Do you need to specify the initrd in /boot instead, so an example being:

Code:
CONFIG_INITRAMFS_SOURCE="/boot/initrd"
?
 
Old 02-02-2021, 08:16 AM   #146
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,706
Blog Entries: 19

Rep: Reputation: 4506Reputation: 4506Reputation: 4506Reputation: 4506Reputation: 4506Reputation: 4506Reputation: 4506Reputation: 4506Reputation: 4506Reputation: 4506Reputation: 4506
Quote:
Originally Posted by jsbjsb001 View Post
With the CONFIG_INITRAMFS_SOURCE option, I assume like the kernel itself, you would need to copy the initrd to the ESP? Assuming I'm right in thinking that; would an example of that be:

Code:
CONFIG_INITRAMFS_SOURCE="/EFI/boot/initrd"
or do you need to specify the initrd in /boot instead, so an example being:

Code:
CONFIG_INITRAMFS_SOURCE="/boot/initrd"
I really have no idea. Emerson would know, I think. I've never booted a kernel that way. And any kernel I build doesn't need an initrd anyway because I always build the root filesystem driver in.
 
Old 02-02-2021, 08:20 AM   #147
jsbjsb001
Senior Member
 
Registered: Mar 2009
Location: Earth, unfortunately...
Distribution: Currently: OpenMandriva. Previously: openSUSE, PCLinuxOS, CentOS, among others over the years.
Posts: 3,881

Original Poster
Rep: Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063
No worries Hazel, I'll wait for Emerson's advice about that. I have starting writing the bit about booting the kernel directly from UEFI (I haven't added anything to the wiki article itself just yet though - just in a text file on my machine), but I thought I'd clear up any bits that I'm not entirely sure about before I post it to the article.

Thanks for your help in any case though.
 
Old 02-02-2021, 10:19 AM   #148
Emerson
LQ Sage
 
Registered: Nov 2004
Location: Saint Amant, Acadiana
Distribution: Gentoo ~amd64
Posts: 7,673

Rep: Reputation: Disabled
Uncharted territory for me, also. Like Hazel, I have no noteworthy experience with initrd. I understand it is a build-time option, not boot-time. As you can read here multiple directories can be specified. If you are into EFI booting with initrd then initrd=<image> can be used by EFI firmware (one would guess it must be on ESP or it won't be found), but to be honest, in cases like this I'd probably resort to using rEFInd which has no limitiations.
 
1 members found this post helpful.
Old 02-03-2021, 09:24 AM   #149
jsbjsb001
Senior Member
 
Registered: Mar 2009
Location: Earth, unfortunately...
Distribution: Currently: OpenMandriva. Previously: openSUSE, PCLinuxOS, CentOS, among others over the years.
Posts: 3,881

Original Poster
Rep: Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063
Thanks Emerson. If I'm understanding your link right, it basically says there are two methods one can use. Being either specifying an existing initrd image or building an image (I assume a separate image rather than built into the kernel itself?). So in any case, it does seem to suggest you can use an existing initrd image for the CONFIG_INITRAMFS_SOURCE kernel config option - which was what I was wondering.

PS: You should add an article to your website about fine-tuning a kernel without the clutter like you were talking about before Emerson - I'd love to read that if you do that.
 
Old 02-03-2021, 10:17 AM   #150
Emerson
LQ Sage
 
Registered: Nov 2004
Location: Saint Amant, Acadiana
Distribution: Gentoo ~amd64
Posts: 7,673

Rep: Reputation: Disabled
jsbjsb001,

I may be good enough to build my own kernels but teaching others means taking it to another level. I'm not ready for this. I'm honest with you, I feel this would be too much work for me. There are tens of features and options which need to be discussed and explained for fine tuning. Some bits and pieces can be collected from kernelnewbies.org. In any case, an internet search brings up plenty of sites dedicated to kernel tuning, I do not feel I have much to add at this time.
 
  


Reply

Tags
development, kernel, lq wiki



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Web Served 7: Wiki wiki wiki! LXer Syndicated Linux News 0 02-19-2013 09:10 PM
Tip: for answers, "wiki, wiki!" sundialsvcs Linux - Newbie 1 01-18-2006 02:40 PM
Wiki: Show Printable Version / printer friendly version / wiki page setup Emmanuel_uk LQ Suggestions & Feedback 1 10-24-2005 08:09 AM
tutorial on wiki wiki web alix123 Programming 1 04-02-2005 02:08 PM
wiki: supposed to use the same wiki namespace? liquigel LQ Suggestions & Feedback 1 03-07-2004 10:11 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel

All times are GMT -5. The time now is 12:42 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration