View previous topic :: View next topic |
Author |
Message |
Holysword l33t
![l33t l33t](/images/ranks/rank_rect_4.gif)
![](images/avatars/17990417948e660ac8cd36.jpg)
Joined: 19 Nov 2006 Posts: 946 Location: Greece
|
Posted: Sun Jul 16, 2017 1:27 pm Post subject: [SOLVED] efibootmgr and kernel commandline options |
|
|
How does one pass commandline options to the kernel, when one uses efibootmgr (without rEfind or the such)?
I basically need to workaround this bug
https://github.com/Bumblebee-Project/bbswitch/issues/140
which people do by setting pcie_port_pm=off. _________________ "Nolite arbitrari quia venerim mittere pacem in terram non veni pacem mittere sed gladium" (Yeshua Ha Mashiach)
Last edited by Holysword on Sat Aug 05, 2017 9:46 am; edited 1 time in total |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
Jaglover Watchman
![Watchman Watchman](/images/ranks/rank-G-2-watchman.gif)
![](images/avatars/179708169458f2999e44e26.gif)
Joined: 29 May 2005 Posts: 8291 Location: Saint Amant, Acadiana
|
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
charles17 Advocate
![Advocate Advocate](/images/ranks/rank-G-1-advocate.gif)
Joined: 02 Mar 2008 Posts: 3685
|
Posted: Sun Jul 16, 2017 5:38 pm Post subject: Re: efibootmgr and kernel commandline options |
|
|
Holysword wrote: | How does one pass commandline options to the kernel, when one uses efibootmgr (without rEfind or the such)? |
You are aware of gentoo wiki? |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
Holysword l33t
![l33t l33t](/images/ranks/rank_rect_4.gif)
![](images/avatars/17990417948e660ac8cd36.jpg)
Joined: 19 Nov 2006 Posts: 946 Location: Greece
|
Posted: Mon Jul 24, 2017 1:13 pm Post subject: |
|
|
Jaglover wrote: | The command line can be built into kernel. |
What I meant was without building it into the kernel (or else I'd have to keep copies of the same kernel with varying commandline).
Is it possible to pass commandline options without hardsetting them? _________________ "Nolite arbitrari quia venerim mittere pacem in terram non veni pacem mittere sed gladium" (Yeshua Ha Mashiach) |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
charles17 Advocate
![Advocate Advocate](/images/ranks/rank-G-1-advocate.gif)
Joined: 02 Mar 2008 Posts: 3685
|
Posted: Mon Jul 24, 2017 1:35 pm Post subject: |
|
|
What is the background this topic?
efibotmgr does nothing but make efi applications (such like grub.efi or refind.efi or bzImage.efi) known to the (u)efi firmware.
(u)efi firmware then loads the selected efi (e.g. bzImage.efi or bootmanager) application.
In case the selected efi application is not an EFI stub kernel and not a bootmanager, how then did you intend to load a kernel?????? |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
Holysword l33t
![l33t l33t](/images/ranks/rank_rect_4.gif)
![](images/avatars/17990417948e660ac8cd36.jpg)
Joined: 19 Nov 2006 Posts: 946 Location: Greece
|
Posted: Mon Jul 24, 2017 3:32 pm Post subject: |
|
|
charles17 wrote: | What is the background this topic?
efibotmgr does nothing but make efi applications (such like grub.efi or refind.efi or bzImage.efi) known to the (u)efi firmware.
(u)efi firmware then loads the selected efi (e.g. bzImage.efi or bootmanager) application.
In case the selected efi application is not an EFI stub kernel and not a bootmanager, how then did you intend to load a kernel?????? |
The background of this topic is stated at the first post. Workarounding a bug, but without hardsetting options into the kernel.
If it is not possible, an answer such as "Sorry, it is not possible" is much more informative than a rethorical question asking how to achieve the impossible followed by 6 interrogation marks.
Currently I am loading a kernel directly without any efi application. I know that the bios currently does not give me the option to "pass arguments" to the kernel being loaded, what I am wondering is if efibootmgr (or other tools) are able to provide this functionality. _________________ "Nolite arbitrari quia venerim mittere pacem in terram non veni pacem mittere sed gladium" (Yeshua Ha Mashiach) |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
charles17 Advocate
![Advocate Advocate](/images/ranks/rank-G-1-advocate.gif)
Joined: 02 Mar 2008 Posts: 3685
|
Posted: Mon Jul 24, 2017 4:50 pm Post subject: |
|
|
Holysword wrote: | Currently I am loading a kernel directly without any efi application. |
AFAIK that is only possible with EFI stub kernel. Is this what you are doing, or am I missing something?
Holysword wrote: | I know that the bios currently does not give me the option to "pass arguments" to the kernel being loaded, what I am wondering is if efibootmgr (or other tools) are able to provide this functionality. |
As I understand, efibootmgr is not at all involved in loading / booting. External resources say to add parameters to the efi firmware. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
dmpogo Advocate
![Advocate Advocate](/images/ranks/rank-G-1-advocate.gif)
Joined: 02 Sep 2004 Posts: 3468 Location: Canada
|
Posted: Mon Jul 24, 2017 5:01 pm Post subject: |
|
|
If you are using EFI stub kernel without bootloader (as I do as well), the only way to pass the parameters is to build them into the kernel. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
Holysword l33t
![l33t l33t](/images/ranks/rank_rect_4.gif)
![](images/avatars/17990417948e660ac8cd36.jpg)
Joined: 19 Nov 2006 Posts: 946 Location: Greece
|
Posted: Mon Jul 24, 2017 6:37 pm Post subject: |
|
|
charles17 wrote: | AFAIK that is only possible with EFI stub kernel. Is this what you are doing, or am I missing something? |
That's correct. I'm booting directly from EFI stub kernel. No bootloader.
dmpogo wrote: | If you are using EFI stub kernel without bootloader (as I do as well), the only way to pass the parameters is to build them into the kernel. |
Thank you, that's what I wanted to know. Quite inconvenient though. _________________ "Nolite arbitrari quia venerim mittere pacem in terram non veni pacem mittere sed gladium" (Yeshua Ha Mashiach) |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
dmpogo Advocate
![Advocate Advocate](/images/ranks/rank-G-1-advocate.gif)
Joined: 02 Sep 2004 Posts: 3468 Location: Canada
|
Posted: Mon Jul 24, 2017 6:57 pm Post subject: |
|
|
Holysword wrote: | charles17 wrote: | AFAIK that is only possible with EFI stub kernel. Is this what you are doing, or am I missing something? |
That's correct. I'm booting directly from EFI stub kernel. No bootloader.
dmpogo wrote: | If you are using EFI stub kernel without bootloader (as I do as well), the only way to pass the parameters is to build them into the kernel. |
Thank you, that's what I wanted to know. Quite inconvenient though. |
well, this is a limitation of direct boot, and (in my opinion, almost the only) reason for additional bootloaders to exist.
Another limitations is that all firmware needed at boot has to be compiled into the kernel as well, or the path to the root device
On the bright side, changing kernel parameters in make menuconfig does not lead to any recompilation, so almost as fast as editing bootloader config
(just not forget to copy the bzImage into its place on /boot/EFI) |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
charles17 Advocate
![Advocate Advocate](/images/ranks/rank-G-1-advocate.gif)
Joined: 02 Mar 2008 Posts: 3685
|
Posted: Tue Jul 25, 2017 6:46 am Post subject: |
|
|
dmpogo wrote: | On the bright side, changing kernel parameters in make menuconfig does not lead to any recompilation, so almost as fast as editing bootloader config
|
Are you saying changes done in make menuconfig were going directly into bzImage without recompilation? |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
grumblebear Apprentice
![Apprentice Apprentice](/images/ranks/rank_rect_2.gif)
Joined: 26 Feb 2008 Posts: 204
|
Posted: Tue Jul 25, 2017 7:44 am Post subject: |
|
|
This thread is going to be a little confusing. With efibootmgr you pass the kernel command line parameters with the -u option when creating a new boot entry (-c).
Only when booting the standard UEFI OS, that is the kernel you put under bootx64.efi, you have to compile the parameters into the kernel. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
s4e8 Guru
![Guru Guru](/images/ranks/rank_rect_3.gif)
Joined: 29 Jul 2006 Posts: 311
|
Posted: Tue Jul 25, 2017 7:54 am Post subject: |
|
|
"efibootmgr -u" would add load option/kernel parameters to firmware. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
charles17 Advocate
![Advocate Advocate](/images/ranks/rank-G-1-advocate.gif)
Joined: 02 Mar 2008 Posts: 3685
|
Posted: Tue Jul 25, 2017 8:25 am Post subject: |
|
|
grumblebear wrote: | Only when booting the standard UEFI OS, that is the kernel you put under bootx64.efi, you have to compile the parameters into the kernel. |
aka EFI stub kernel |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
grumblebear Apprentice
![Apprentice Apprentice](/images/ranks/rank_rect_2.gif)
Joined: 26 Feb 2008 Posts: 204
|
Posted: Tue Jul 25, 2017 9:38 am Post subject: |
|
|
Yes of course. Since the first entry in this thread we all know, that Holysword is using an EFI stub kernel. And yes, the -u option is storing the command line parameters in the EFI firmware. But from my understanding, this is what Holysword wants. If you want to pass different parameters on every single boot, you have to use the EFI shell. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
Holysword l33t
![l33t l33t](/images/ranks/rank_rect_4.gif)
![](images/avatars/17990417948e660ac8cd36.jpg)
Joined: 19 Nov 2006 Posts: 946 Location: Greece
|
Posted: Sat Aug 05, 2017 8:28 am Post subject: |
|
|
s4e8 wrote: | "efibootmgr -u" would add load option/kernel parameters to firmware. |
@s4e8 and @grumblebear
I'm sorry, I am indeed a bit confused:
Code: | -u | --unicode | --UCS-2
Handle extra command line arguments as UCS-2 (default is ASCII) |
That seems to only change the encoding of the arguments, but not to take the arguments themselves. Am I misunderstanding something? _________________ "Nolite arbitrari quia venerim mittere pacem in terram non veni pacem mittere sed gladium" (Yeshua Ha Mashiach) |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
grumblebear Apprentice
![Apprentice Apprentice](/images/ranks/rank_rect_2.gif)
Joined: 26 Feb 2008 Posts: 204
|
Posted: Sat Aug 05, 2017 9:33 am Post subject: |
|
|
Quote: | I'm sorry, I am indeed a bit confused:
Code: |
-u | --unicode | --UCS-2
Handle extra command line arguments as UCS-2 (default is ASCII)
|
That seems to only change the encoding of the arguments, but not to take the arguments themselves. Am I misunderstanding something? |
Admitted, that description is not very clear. It simply means the command line string does not have to be pure ASCII. So just put your arguments behind the -u.
For example:
Code: | efibootmgr -c -L MyGentoo -l '\EFI\BOOT\MyKernel.efi' -u "root=/dev/sda2 ro quiet" |
|
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
Holysword l33t
![l33t l33t](/images/ranks/rank_rect_4.gif)
![](images/avatars/17990417948e660ac8cd36.jpg)
Joined: 19 Nov 2006 Posts: 946 Location: Greece
|
Posted: Sat Aug 05, 2017 9:46 am Post subject: |
|
|
grumblebear wrote: | Quote: | I'm sorry, I am indeed a bit confused:
Code: |
-u | --unicode | --UCS-2
Handle extra command line arguments as UCS-2 (default is ASCII)
|
That seems to only change the encoding of the arguments, but not to take the arguments themselves. Am I misunderstanding something? |
Admitted, that description is not very clear. It simply means the command line string does not have to be pure ASCII. So just put your arguments behind the -u.
For example:
Code: | efibootmgr -c -L MyGentoo -l '\EFI\BOOT\MyKernel.efi' -u "root=/dev/sda2 ro quiet" |
|
Indeed! Works like a charm, thanks! _________________ "Nolite arbitrari quia venerim mittere pacem in terram non veni pacem mittere sed gladium" (Yeshua Ha Mashiach) |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
|