Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Additional kernel parameters that *may* be required to boot
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
guyuming
Apprentice
Apprentice


Joined: 19 Nov 2020
Posts: 235

PostPosted: Wed Jul 14, 2021 2:07 pm    Post subject: Additional kernel parameters that *may* be required to boot Reply with quote

I had configured my desktop to boot with https://wiki.gentoo.org/wiki/Handbook:AMD64/Installation/Bootloader#Alternative_2:_efibootmgr , it has worked for several month.

Today, i am emerging the ufw firewall, which prompt me to turn on some kernel flags. And i use genkernel to rebuild and install as follows, and it contains some warning that i may not be able to boot!

Code:
gym@gymDeskGentoo /usr/src/linux $ sudo  genkernel --install --no-mrproper --no-clean --no-strip all
密码:
* Gentoo Linux Genkernel; Version 4.2.1
* Using genkernel configuration from '/etc/genkernel.conf' ...
* Running with options: --install --no-mrproper --no-clean --no-strip all

* Working with Linux kernel 5.4.97-gentoo-x86_64 for x86_64
* Using kernel config file '/etc/kernels/kernel-config-5.4.97-gentoo-x86_64' ...
*
* Note: The version above is subject to change (depends on config and status of kernel sources).

* kernel: >> Initializing ...
*         >> --no-clean is set; Skipping 'make clean' ...
*         >> --no-mrproper is set; Skipping 'make mrproper' ...
*         >> Running 'make oldconfig' ...
*         >> Compiling 5.4.97-gentoo-x86_64 bzImage ...
*         >> Compiling 5.4.97-gentoo-x86_64 modules ...
*         >> Installing 5.4.97-gentoo-x86_64 modules ...
*         >> Generating module dependency data ...
*         >> Compiling out-of-tree module(s) ...
*         >> Saving config of successful build to '/etc/kernels/kernel-config-5.4.97-gentoo-x86_64' ...

* initramfs: >> Initializing ...
*         >> Appending devices cpio data ...
*         >> Appending base_layout cpio data ...
*         >> Appending util-linux cpio data ...
*         >> Appending eudev cpio data ...
*         >> Appending devicemanager cpio data ...
*         >> Appending auxiliary cpio data ...
*         >> Appending busybox cpio data ...
*         >> Appending modprobed cpio data ...
*         >> Appending modules cpio data ...
*         >> Appending linker cpio data ...
*         >> Deduping cpio ...
*         >> Pre-generating initramfs' /etc/ld.so.cache ...
*         >> Compressing cpio data (.xz) ...

* Kernel compiled successfully!
*
* --no-bootloader set; Skipping bootloader update ...
*
* Required kernel parameter:
*
*       root=/dev/$ROOT
*
* Where $ROOT is the device node for your root partition as the
* one specified in /etc/fstab

* If you require Genkernel's hardware detection features, you MUST
* tell your bootloader to use the provided initramfs file '/boot/initramfs-5.4.97-gentoo-x86_64.img'.

* WARNING... WARNING... WARNING...
* Additional kernel parameters that *may* be required to boot properly:

* Do NOT report kernel bugs as genkernel bugs unless your bug
* is about the default genkernel configuration...
*
* Make sure you have the latest ~arch genkernel before reporting bugs.



What follows is output of efibootmgr:
Code:
gym@gymDeskGentoo ~ $ efibootmgr
BootCurrent: 0006
Timeout: 1 seconds
BootOrder: 0006,0001,0000,0002,0003
Boot0000* Windows Boot Manager
Boot0001* ubuntu
Boot0002  网卡
Boot0003  硬盘
Boot0006* Gentoo


In https://wiki.gentoo.org/wiki/Handbook:AMD64/Installation/Bootloader#Alternative_2:_efibootmgr , there are commands as follows:
Code:
root #mkdir -p /boot/efi/boot
root #cp /boot/vmlinuz-* /boot/efi/boot/bootx64.efi


but i cannot find efi subfolder in /boot. I don't remember whether i had created /boot/efi/boot folder or not several months ago when i installed gentoo, and i don't think that i would have deleted this folder manually. Anyway, the boot is working for several month.

Is that normal if there is no /boot/efi/boot folder?

So, my problem is can i verify that the efibootmgr is configured well for the gentoo? The warning from genkernel says that " Additional kernel parameters that *may* be required to boot properly", anyway for the efibootmgr to output my currently configured parameters? Did i missed anything after the genkernel command?
Back to top
View user's profile Send private message
alamahant
Advocate
Advocate


Joined: 23 Mar 2019
Posts: 3879

PostPosted: Thu Jul 15, 2021 5:32 pm    Post subject: Reply with quote

Quote:


but i cannot find efi subfolder in /boot. I don't remember whether i had created /boot/efi/boot folder or not several months ago when i installed gentoo, and i don't think that i would have deleted this folder manually. Anyway, the boot is working for several month.

Is that normal if there is no /boot/efi/boot folder?

You can not find an efi subfolder in /boot because you never created it.
The correct way for EFI boot partitioning is this
Code:

mount /dev/<root> /mnt/gentoo
mkdir /mnt/gentoo/boot
mount /dev/<boot> /mnt/gentoo/boot ####IF you have seperate /boot partition
mkdir /mnt/gentoo/boot/efi
mount ESP /mnt/gentoo/boot/efi
cd /mnt/gentoo
tar xf <stage3>

If you dont have a separate /boot partition then dont mount anything at /boot BUT mount the ESP on /boot/efi.
Some people call the ESP "boot partition" but this is WRONG.
There is confusion between the Handbook and UEFI install
The Handbook used to advice people to mount the ESP on /boot.
This is WRONG.

Now for your ufw firewall you should go to menuconfig and enable ALL netfilter options.
Plz dont try to be minimal or stingy because you will regret it later........
_________________
:)
Back to top
View user's profile Send private message
pietinger
Moderator
Moderator


Joined: 17 Oct 2006
Posts: 4148
Location: Bavaria

PostPosted: Thu Jul 15, 2021 10:04 pm    Post subject: Reply with quote

alamahant wrote:
The Handbook used to advice people to mount the ESP on /boot.
This is WRONG.

I have a different view. First of all: What's in a name?

Historical the boot-partition is where the linux kernel resides. This must not be changed when we have UEFI.

ESP means "efi system partition" (must be a FAT variant; best FAT32). In this partition, UEFI searches in a DIRECTORY named "efi" (or "EFI"; doesnt matter). It would be possible to put a bootable binary in this directory; but it is recommended to use a sub-directory. If you install grub2, the install routine of grub2 creates a sub-directory named "gentoo" and there you will find the "grubx64.efi". A view from UEFI says:
Code:
# efibootmgr  -v
BootCurrent: 0001
Timeout: 1 seconds
BootOrder: 0001,0002,0000
Boot0000* gentoo        HD(2,GPT,e6cccc9a-40e0-4b59-b6d2-082596500077,0x1800,0x1fe800)/File(\EFI\gentoo\grubx64.efi)
[...]


You can mount this partition to every MOUNT-POINT you want. The amd64-handbook says: mount it to /boot. Now from our view it is: /boot/EFI/gentoo/grubx64.efi

If you would mount it to /boot/efi then you would have /boot/efi/EFI/gentoo/grubx64.efi (what a nonsense ...)

Dont mix Partition with Mount-Point !

Now the name of this partition could be "blabla" or "esp" or "boot"; it really doesnt matter. As I am an old man, I prefer "boot" because - for me - boot means here is the kernel ... for me it doesnt matter if it is either a bootloader OR a linux-STUB-kernel (or both).

The amd64-handbook prefers ONE partition for all: grubx64.efi and all files belonging to grub2 AND - if I want - my stub-kernels. This is my system:
Code:
# efibootmgr  -v
BootCurrent: 0001
Timeout: 1 seconds
BootOrder: 0001,0002,0000
Boot0000* gentoo        HD(2,GPT,e6cccc9a-40e0-4b59-b6d2-082596500077,0x1800,0x1fe800)/File(\EFI\gentoo\grubx64.efi)
Boot0001* DIRECT        HD(2,GPT,e6cccc9a-40e0-4b59-b6d2-082596500077,0x1800,0x1fe800)/File(\EFI\Boot\bzImage.efi)
Boot0002* UNLOCKED      HD(2,GPT,e6cccc9a-40e0-4b59-b6d2-082596500077,0x1800,0x1fe800)/File(\EFI\unlocked\bzImage.efi)


Now what you CAN do is, to put those files into two different partitions: ONE partition with FAT32 having only one "EFI"-directory PLUS ANOTHER partition for all the grub-files (this can be ext4 for example) ... BUT this is NOT A MUST ... therefore I would say: What the amd64-handbook says is NOT WRONG ... 8)

(I even recommend to use only ONE partition as the amd64-handbook says; I have also only one)

I call this partition "esp-/boot-partition" because it is ... BOTH ... but again: What's in a name?


Last edited by pietinger on Thu Jul 15, 2021 10:53 pm; edited 1 time in total
Back to top
View user's profile Send private message
alamahant
Advocate
Advocate


Joined: 23 Mar 2019
Posts: 3879

PostPosted: Thu Jul 15, 2021 10:47 pm    Post subject: Reply with quote

pietinger
The handbook advises people to mount the ESP yes I know what it means :) on /boot(i mean directory NOT boot partition)
This is wrong.
Because all the kernels initrds and grub related stuf will be on a vfat partition.
ESP should be mounted on /boot/efi irrespective if there is a seperate /boot partition or not.
I know you will end up having a hierarchy like
/boot/efi/EFI/<bootloader-folder>
Some people might not like this structure and prefer to putt all /boot stuff inside vfat but to me this sounds horrible.
Also I prefer if the efi binary folder inside the ESP be called "gentoo" or any other name than plain "boot"
IMHO /boot should contain kernels initrds and grub and can be any fs one likes either as part of / or as a separate partition in case of lvm or luks etc whereas /boot/efi the efi binaries and should be preferably vfat.


:)
_________________
:)


Last edited by alamahant on Thu Jul 15, 2021 11:08 pm; edited 1 time in total
Back to top
View user's profile Send private message
pietinger
Moderator
Moderator


Joined: 17 Oct 2006
Posts: 4148
Location: Bavaria

PostPosted: Thu Jul 15, 2021 11:01 pm    Post subject: Reply with quote

alamahant wrote:
pietinger
The handbook advises people to mount the ESP yes I know what it means :) on /boot(i mean directory NOT boot partition)
This is wrong. Period.
Because all the kernels initrds and grub related stuf will be on a vfat partition.
ESP should be mounted on /boot/efi irrespective if there is a seperate /boot partition or not.
I know you will end up having a hierarchy like
/boot/efi/EFI/<bootloader-folder>
Some people might not like this structure and prefer to putt all /boot stuff inside vfat but to me this sounds horrible.
Also I prefer if the efi binary folder inside the ESP be called "gentoo" or any other name than plain "boot"
:)

alamahant,

I dont would say it is wrong. It is a decision. Having only ONE partition and using it for all "boot-things" (/boot stuff), or having two partitions ... with all its confusion for many new UEFI-users ... ;-)

And I like to be with our gentoo-developers who did a decision. This is - IMHO - not wrong; it is one of two possibilities. Yes, you prefer something (I fully understand), but I prefer the other way ... and I dont say one way is correct and the other way is wrong.
Back to top
View user's profile Send private message
alamahant
Advocate
Advocate


Joined: 23 Mar 2019
Posts: 3879

PostPosted: Thu Jul 15, 2021 11:13 pm    Post subject: Reply with quote

I totally agree with you.
Gentoo needing to acomodate bios and uefi boot and a myriad of bootloaders--or absence of them-- and booting configs made this kind of "generic" decision but I have seen countless users confused about UEFI boot on the forums...
And why not?Having a separate /boot partition is an asset not a liability.IMHO.Regardless of using lvm or luks or not.
All the major distros I have seen except some archaically obsessed use this structure:

/boot
/boot/efi
separate partitions.
grub
and initrd
Sometimes conformity is very reassuring.
And all new users -like me- would benefit in the beginning to stick with convention before they try "extreme" smart and otherwise sleek configs.
:)

There used to be a "correct" :) UEFI boot entry in the wiki someplace but I cant seem to find it anymore........
I think it used to be this
https://wiki.gentoo.org/wiki/UEFI_Gentoo_Quick_Install_Guide
_________________
:)


Last edited by alamahant on Thu Jul 15, 2021 11:43 pm; edited 2 times in total
Back to top
View user's profile Send private message
pjp
Administrator
Administrator


Joined: 16 Apr 2002
Posts: 20067

PostPosted: Thu Jul 15, 2021 11:29 pm    Post subject: Reply with quote

alamahant wrote:
I have seen countless users confused about UEFI boot on the forums...
There used to be a "correct" :) UEFI boot entry in the wiki someplace but I cant seem to find it anymore........
I think it used to be this
https://wiki.gentoo.org/wiki/UEFI_Gentoo_Quick_Install_Guide
Depending on when it might have had the "correct" information, this seems to be the most recent version with content (2014?):
https://wiki.gentoo.org/index.php?title=UEFI_Gentoo_Quick_Install_Guide&oldid=166862
_________________
Quis separabit? Quo animo?
Back to top
View user's profile Send private message
pietinger
Moderator
Moderator


Joined: 17 Oct 2006
Posts: 4148
Location: Bavaria

PostPosted: Thu Jul 15, 2021 11:35 pm    Post subject: Reply with quote

alamahant wrote:
Gentoo needing to acomodate bios and uefi boot and a myriad of bootloaders--or absence of them-- and booting configs made this kind of "generic" decision but I have seen countless users confused about UEFI boot on the forums...

Yes, I am knowing many of those threads ... MAYBE one reason COULD be the transition to one partition, ...

alamahant wrote:
There used to be a "correct" :) UEFI boot entry in the wiki someplace but I cant seem to find it anymore........
I think it used to be this
https://wiki.gentoo.org/wiki/UEFI_Gentoo_Quick_Install_Guide


.. as far as I can remember it was also in the old version of https://wiki.gentoo.org/wiki/Handbook:AMD64/Installation/Disks (where parted was used).

The first time I came in contact with the confusion of /efi/EFI was when I had read all the rodsbooks about UEFI ... and ...hey ... I found it again (for your pleassure :-) ) :
http://www.rodsbooks.com/efi-bootloaders/installation.html

(but this is 10 years old ...)

I fully understand you dont want files on a ... bäääh ... FAT-partition ... but I understand it is easier for new users dealing only with one partition ... (so I like the decision of our developers).


Many greetings,
Peter
Back to top
View user's profile Send private message
alamahant
Advocate
Advocate


Joined: 23 Mar 2019
Posts: 3879

PostPosted: Thu Jul 15, 2021 11:36 pm    Post subject: Reply with quote

pip
Yes
Thanks..
That's it.
https://wiki.gentoo.org/index.php?title=UEFI_Gentoo_Quick_Install_Guide&oldid=166862
Thanks
:)
_________________
:)
Back to top
View user's profile Send private message
guyuming
Apprentice
Apprentice


Joined: 19 Nov 2020
Posts: 235

PostPosted: Fri Jul 16, 2021 2:47 am    Post subject: Reply with quote

pietinger wrote:


Thanks for the "efibootmgr -v", my result is

Code:
Boot0006* Gentoo        HD(3,GPT,5ce893bd-2337-40b5-97b8-f497b7cebc18,0x12f3e800,0x8f000)/File(\EFI\gentoo\vmlinuz-5.4.97-gentoo-x86_64.efi)r.o.o.t.=.P.A.R.T.U.U.I.D.=.3.6.e.0.b.2.b.0.-.4.2.5.3.-.f.a.4.f.-.8.8.c.1.-.4.9.5.3.3.a.d.b.c.c.e.f. .i.n.i.t.r.d.=.\.E.F.I.\.g.e.n.t.o.o.\.i.n.i.t.r.a.m.f.s.-.5...4...9.7.-.g.e.n.t.o.o.-.x.8.6._.6.4...i.m.g.


i put my computer into sleep and will read all your replies after my three day vacation.

update: i figured it out: UEFI can load gentoo kernel based on the information in "efibootmgr -v", that is, the ESP partition uuid and the file name.

And the ESP partition don't need to be mounted when system boot. I only need to mount the ESP partition to some mount point after kernel rebuild, so that i can copy the new kernel and initramfs from /boot into ESP partition. And the name of mount point does not matter. I found a mount point called /EFI_boot which i created several months ago when i installed gentoo.

I put some screenshot here: https://gitee.com/guyuming76/personal/commit/c91b16e23309b6e238e85dfc9b4d455721a3abe0 (sorry that you might be prompted for authentication with Windows live id, but i think my reply here still make sense without these screenshots)

I wonder what if i do not copy the newly built kernel and initramfs into ESP partition and reboot, what will happen if the files in ESP partition do not match those in /boot, can the system still boot?

by the way, i don't have a separate partition for /boot, it is in the same partition as root /.


Last edited by guyuming on Tue Jul 20, 2021 10:07 am; edited 4 times in total
Back to top
View user's profile Send private message
dmpogo
Advocate
Advocate


Joined: 02 Sep 2004
Posts: 3267
Location: Canada

PostPosted: Fri Jul 16, 2021 5:07 am    Post subject: Reply with quote

pietinger wrote:
alamahant wrote:
Gentoo needing to acomodate bios and uefi boot and a myriad of bootloaders--or absence of them-- and booting configs made this kind of "generic" decision but I have seen countless users confused about UEFI boot on the forums...

Yes, I am knowing many of those threads ... MAYBE one reason COULD be the transition to one partition, ...

alamahant wrote:
There used to be a "correct" :) UEFI boot entry in the wiki someplace but I cant seem to find it anymore........
I think it used to be this
https://wiki.gentoo.org/wiki/UEFI_Gentoo_Quick_Install_Guide


.. as far as I can remember it was also in the old version of https://wiki.gentoo.org/wiki/Handbook:AMD64/Installation/Disks (where parted was used).

The first time I came in contact with the confusion of /efi/EFI was when I had read all the rodsbooks about UEFI ... and ...hey ... I found it again (for your pleassure :-) ) :
http://www.rodsbooks.com/efi-bootloaders/installation.html

(but this is 10 years old ...)

I fully understand you dont want files on a ... bäääh ... FAT-partition ... but I understand it is easier for new users dealing only with one partition ... (so I like the decision of our developers).


Many greetings,
Peter




Advantage of a single partition with all the boot stuff, is that this partition is not even mounted under normail operation ( i,e after regular boot ) - and thus your boot stuff has less chance to be corrupted while your are using your computer. You mount /boot only if you want to do some maintenance on your booting setup.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum