View previous topic :: View next topic |
Author |
Message |
nxe9 Tux's lil' helper
Joined: 05 Jun 2021 Posts: 116
|
Posted: Tue Oct 22, 2024 6:51 pm Post subject: Gentoo hangs on "Loading initial ramdisk" |
|
|
Hi, I am asking for help again .
I'm trying to boot with encrypted root. The vfat parition (/boot) is not encrypted and I have grub as boot loader.
The grub window appears, then the console hangs during startup. They are basically two consoles that overlap.
First console:
Code: | EFI stub: Loaded initrd from LINUX_EFI_INITRD_MEDIA_GUID device path
EFI stub: Measured initrd data into PCR 9 |
Second console:
Code: | Loading Linux 6.10.14-gentoo ...
Loading initial ramdisk ... |
This is where it freezes.
Hardware: ThinkPad E14 Ultra 7 155H
Kernel: I first tried 6.6.52, same problem, currently 6.10.14 because in 6.6 the Intel graphics in this processor were probably not stable yet. My live usb is arch 6.10.10.
lspci -nnk output: https://bpa.st/5NVWE
I know there have been a lot of threads on this topic and the problem is often the lack of a framebuffer option in the kernel, which is why the console does not display everything.
Code: | Device Drivers / Graphics support / Console display driver support
[*] Framebuffer Console support |
Code: | Device Drivers / Graphics support / Frame buffer Devices
(other options are not active here)
<*> Support for frame buffer device drivers[
[*] VESA...
[*] EFI
<*> Simple framebuffer support
[*] Provide legacy /dev/fb* device |
I'm not sure about the last one " Provide legacy /dev/fb* device". Should it be deactivated? Or maybe the problem is somewhere else?
UPDATE: Same behavior after changing Provide legacy /dev/fb* device to [] (disabled).
UPDATE2: Could this be related to the microcode? https://forums.gentoo.org/viewtopic-p-8830499.html#8830499
From what I read, grub loads intel-uc.img automatically. But is there also dracut that also does this automatically using the initramfs that I generated with it? I don't know myself... |
|
Back to top |
|
|
pietinger Moderator
Joined: 17 Oct 2006 Posts: 5121 Location: Bavaria
|
|
Back to top |
|
|
nxe9 Tux's lil' helper
Joined: 05 Jun 2021 Posts: 116
|
Posted: Tue Oct 22, 2024 11:12 pm Post subject: |
|
|
Probably not UKI, unless I'm not fully aware of it and it's happening via the installkernel with the dracut flag behind my back.
I will paste my cheat sheet, which includes almost all the installation steps and is based on the gentoo handbook. It'll probably be easier this way. The listed kernel options are the options that I chose myself.
https://bpa.st/GBXRQ "#" means comment or commands I didn't use. So these lines can be omitted.
Thank you for your help. |
|
Back to top |
|
|
pietinger Moderator
Joined: 17 Oct 2006 Posts: 5121 Location: Bavaria
|
|
Back to top |
|
|
nxe9 Tux's lil' helper
Joined: 05 Jun 2021 Posts: 116
|
Posted: Wed Oct 23, 2024 1:17 am Post subject: |
|
|
Thank you. Your contribution to documenting everything is great.
I quickly tried to add a few options from your entries, but it did not result in proper booting. The next day I would like to read your entries carefully, but now I am wondering if it is worth it.
I have not dealt with the topic of kernel distribution so far. I thought that it only made compilation and installation easier. However, now I am reading that "Distribution kernels default to a configuration supporting the majority of hardware". To be honest, I always thought that the default kernel configuration was already prepared for most devices and only required light tuning. For years, I used two other systems with a very simple manual configuration based on entries from the Gentoo wiki, and the systems worked without problems and very stably. So I guess I have to revise my views.
In short, if the distribution kernel is better configured by default, it will probably be better if I read the article about the distribution kernel and choose this route.
I will keep you posted on my progress. |
|
Back to top |
|
|
sMueggli Guru
Joined: 03 Sep 2022 Posts: 497
|
Posted: Wed Oct 23, 2024 9:02 am Post subject: |
|
|
What you can do:
1. Make sure that sshd is enabled on the system
2. Boot the system, wait a minute, enter the LUKS passphrase
3. Wait a minute and try to SSH into your machine
If you can SSH into your machine, then you can easily get information about the state of the machine.
If you cannot use SSH, you can ping the machine to see, whether the network part is working or not. |
|
Back to top |
|
|
nxe9 Tux's lil' helper
Joined: 05 Jun 2021 Posts: 116
|
Posted: Thu Oct 24, 2024 1:40 am Post subject: |
|
|
I tried the dist kernel (sys-kernel/gentoo-kernel-6.6.57). It took a long time to compile, but I can accept it. I know there is gentoo-kernel-bin, but I don't want to limit my configuration possibilities.
The most important information, the system started correctly with the gentoo-kernel configuration. I was able to decrypt the drive and log in.
Thank you again for your very helpful tips. |
|
Back to top |
|
|
Hu Administrator
Joined: 06 Mar 2007 Posts: 22694
|
Posted: Thu Oct 24, 2024 11:02 am Post subject: |
|
|
nxe9: what is the next step for this thread? Do you want to try to customize sys-kernel/gentoo-kernel down to some approximation of a minimum working kernel for your environment? Do you want to use some kernel other than that one? Do you want to consider this thread solved and stop work here, since your system is usable and you consider the compile time for this kernel to be acceptable? |
|
Back to top |
|
|
nxe9 Tux's lil' helper
Joined: 05 Jun 2021 Posts: 116
|
Posted: Thu Oct 24, 2024 5:10 pm Post subject: |
|
|
Currently I am satisfied and the compilation time is acceptable to me. Perhaps in the future I will take a closer look at Pietinger's articles and perhaps add snippets that will speed up the compilation.
One more question. From what I see, gentoo-kernel automatically calls installkernel. In turn, my installkernel is built with the dracut flag, which means that initramfs is created at this point. However, I also see that gentoo-kernel has an initrams flag. However, I also see that gentoo-kernel has an initrams flag, which I think also calls for dracut initramfs.
Do I understand correctly that I have the following two options and they will give me the same result?
Option 1:
gentoo-kernel with initramfs flag and installkernel without dracut flag
Option 2:
gentoo-kernel without initramfs flag and installkernel with dracut flag
What about option number 3? Will initramfs be created twice?
Option 3:
gentoo-kernel with initramfs flag and intallkernel with dracut flag |
|
Back to top |
|
|
pietinger Moderator
Joined: 17 Oct 2006 Posts: 5121 Location: Bavaria
|
Posted: Thu Oct 24, 2024 6:32 pm Post subject: |
|
|
nxe9 wrote: | Do I understand correctly that I have the following two options and they will give me the same result? |
No ...
Yes, it can be confusing ... ... short answer: you need everything ... long answer:
dracut
If you try to emerge our gentoo-kernel without ONE of two possible USE-flags you will get help:
Code: | # emerge -pvD gentoo-kernel-bin
These are the packages that would be merged, in order:
[...]
The following USE changes are necessary to proceed:
(see "package.use" in the portage(5) man page for more details)
# required by sys-kernel/gentoo-kernel-bin-6.6.57::gentoo[initramfs]
# required by virtual/dist-kernel-6.6.57::gentoo
>=sys-kernel/installkernel-48-r1 dracut |
But this is only half the truth, because instead of “dracut” you can also use “ugrd” to create an initramfs:
Code: | # USE="ugrd" emerge -pvD gentoo-kernel-bin
These are the packages that would be merged, in order:
Calculating dependencies... done!
Dependency resolution took 2.93 s (backtrack: 0/20).
[ebuild N ] dev-python/zenlib-2.2.4::gentoo PYTHON_TARGETS="python3_12 -python3_11" 18 KiB
[ebuild N ] dev-python/pycpio-1.3.2::gentoo USE="-test" PYTHON_TARGETS="python3_12 -python3_11" 22 KiB
[ebuild N ] sys-kernel/ugrd-1.22.0::gentoo USE="-test" PYTHON_TARGETS="python3_12 -python3_11" 65 KiB
[ebuild N ] sys-kernel/installkernel-48-r1::gentoo USE="ugrd -dracut (-efistub) -grub -refind -systemd -systemd-boot -uki -ukify" 25 KiB
[ebuild N ] sys-kernel/gentoo-kernel-bin-6.6.57:6.6.57::gentoo USE="initramfs (-generic-uki) -modules-compress -test" 261.522 KiB
[ebuild N ] virtual/dist-kernel-6.6.57:0/6.6.57::gentoo 0 KiB
Total: 6 packages (6 new), Size of downloads: 261.650 KiB |
You decide with this usr-flag which of these two applications creates your intramfs. It can easily be activated globally in your make.conf in USE=... dracut ... OR USE= ... ugrd ...
initramfs
This use-flag is only required if you are using a kernel with an associated initramfs. Our Gentoo distribution kernel requires (always) an initramfs; my personal manually configured kernel does NOT. However, it has been selectively enabled for some packages and should NEITHER be globally enabled NOR disabled. Just read the NEWS from 2024-05-17:
Quote: | Users of sys-kernel/dracut and/or Distribution Kernels should double
check two things:
1) Please ensure that you are *not* globally enabling or disabling
the "initramfs" USE flag. Enabling it globally might result in an
unnecessarily large initramfs. Disabling it globally might result
in missing functionality in the initramfs. |
For me, this paragraph applies:
Quote: | Other users may wish to disable the "initramfs" USE flag on
sys-kernel/linux-firmware and/or sys-firmware/intel-microcode
if they already have other mechanisms in place for updating the CPU
microcode (such as kernel built-in CPU microcode). Users who do not
use sys-kernel/dracut or Distribution Kernels can safely disable
the "initramfs" USE flag globally. |
dist-kernel
This use-flag does not necessarily have to be activated, but it automates the handling when new firmware files or microcodes are available. My recommendation: Activate it globally in your make.conf as well.
Complete
If I wanted to install a dist-kernel, I would enter the two use-flags globally in my make.conf (instead of only using them temporarily for presentation purposes).
Code: | ~ # USE="ugrd dist-kernel" emerge -pvD linux-firmware intel-microcode gentoo-kernel-bin
These are the packages that would be merged, in order:
Calculating dependencies... done!
Dependency resolution took 3.71 s (backtrack: 0/20).
[ebuild N ] dev-python/zenlib-2.2.4::gentoo PYTHON_TARGETS="python3_12 -python3_11" 18 KiB
[ebuild N ] dev-python/pycpio-1.3.2::gentoo USE="-test" PYTHON_TARGETS="python3_12 -python3_11" 22 KiB
[ebuild N ] sys-kernel/ugrd-1.22.0::gentoo USE="-test" PYTHON_TARGETS="python3_12 -python3_11" 65 KiB
[ebuild N ] sys-kernel/installkernel-48-r1::gentoo USE="ugrd -dracut (-efistub) -grub -refind -systemd -systemd-boot -uki -ukify" 25 KiB
[ebuild N ] sys-kernel/gentoo-kernel-bin-6.6.57:6.6.57::gentoo USE="initramfs (-generic-uki) -modules-compress -test" 261.522 KiB
[ebuild N ] virtual/dist-kernel-6.6.57:0/6.6.57::gentoo 0 KiB
[ebuild R ] sys-kernel/linux-firmware-20241017-r2::gentoo USE="dist-kernel* initramfs* redistributable -bindist -compress-xz -compress-zstd -deduplicate -savedconfig (-unknown-license)" 0 KiB
[ebuild R ] sys-firmware/intel-microcode-20240910_p20240915::gentoo USE="dist-kernel* initramfs* split-ucode -hostonly -vanilla" 0 KiB
Total: 8 packages (6 new, 2 reinstalls), Size of downloads: 261.650 KiB |
- OR -
Code: | ~ # USE="dracut dist-kernel" emerge -pvD linux-firmware intel-microcode gentoo-kernel-bin
These are the packages that would be merged, in order:
Calculating dependencies... done!
Dependency resolution took 3.73 s (backtrack: 0/20).
[ebuild N ] sys-kernel/dracut-103-r4::gentoo USE="(-selinux) (-test)" 555 KiB
[ebuild N ] sys-kernel/installkernel-48-r1::gentoo USE="dracut (-efistub) -grub -refind -systemd -systemd-boot -ugrd -uki -ukify" 25 KiB
[ebuild N ] sys-kernel/gentoo-kernel-bin-6.6.57:6.6.57::gentoo USE="initramfs (-generic-uki) -modules-compress -test" 261.522 KiB
[ebuild N ] virtual/dist-kernel-6.6.57:0/6.6.57::gentoo 0 KiB
[ebuild R ] sys-kernel/linux-firmware-20241017-r2::gentoo USE="dist-kernel* initramfs* redistributable -bindist -compress-xz -compress-zstd -deduplicate -savedconfig (-unknown-license)" 0 KiB
[ebuild R ] sys-firmware/intel-microcode-20240910_p20240915::gentoo USE="dist-kernel* initramfs* split-ucode -hostonly -vanilla" 0 KiB
Total: 6 packages (4 new, 2 reinstalls), Size of downloads: 262.101 KiB |
_________________ https://wiki.gentoo.org/wiki/User:Pietinger |
|
Back to top |
|
|
nxe9 Tux's lil' helper
Joined: 05 Jun 2021 Posts: 116
|
Posted: Thu Oct 24, 2024 7:26 pm Post subject: |
|
|
So as not to get confused, I have to ask right away.
Here is a computer with manual kernel configuration, without dracut, without ugrd. Initramfs is generated by the genkernel.
Code: | # emerge -av installkernel
These are the packages that would be merged, in order:
Calculating dependencies... done!
Dependency resolution took 1.39 s (backtrack: 0/20).
[ebuild R ] sys-kernel/installkernel-48-r1::gentoo USE="-dracut (-efistub) -grub -refind -systemd -systemd-boot -ugrd -uki -ukify" 0 KiB
Total: 1 package (1 reinstall), Size of downloads: 0 KiB
Would you like to merge these packages? [Yes/No] |
Code: | # emerge -av dracut
These are the packages that would be merged, in order:
Calculating dependencies... done!
Dependency resolution took 1.54 s (backtrack: 0/20).
[ebuild N ] sys-kernel/dracut-103-r4::gentoo USE="(-selinux) (-test)" 555 KiB
Total: 1 package (1 new), Size of downloads: 555 KiB
Would you like to merge these packages? [Yes/No] |
Code: | # emerge -av gentoo-kernel-bin
These are the packages that would be merged, in order:
Calculating dependencies... done!
Dependency resolution took 1.46 s (backtrack: 0/20).
[ebuild N ] sys-kernel/gentoo-kernel-bin-6.6.57:6.6.57::gentoo USE="(-generic-uki) -initramfs -modules-compress -test" 261,522 KiB
[ebuild N ] virtual/dist-kernel-6.6.57:0/6.6.57::gentoo 0 KiB
Total: 2 packages (2 new), Size of downloads: 261,522 KiB
Would you like to merge these packages? [Yes/No] |
Code: | emerge -av gentoo-kernel
These are the packages that would be merged, in order:
Calculating dependencies... done!
Dependency resolution took 1.52 s (backtrack: 0/20).
[ebuild N ] sys-kernel/gentoo-kernel-6.6.57:6.6.57::gentoo USE="debug strip -experimental (-generic-uki) -hardened -initramfs -modules-compress -modules-sign -savedconfig -secureboot -test" 3,716 KiB
[ebuild N ] virtual/dist-kernel-6.6.57:0/6.6.57::gentoo 0 KiB
Total: 2 packages (2 new), Size of downloads: 3,716 KiB
Would you like to merge these packages? [Yes/No] |
Code: | # emerge -av ugrd
These are the packages that would be merged, in order:
Calculating dependencies... done!
Dependency resolution took 1.54 s (backtrack: 0/20).
[ebuild N ] dev-python/zenlib-2.2.4::gentoo PYTHON_TARGETS="python3_12 -python3_11" 18 KiB
[ebuild N ] dev-python/pycpio-1.3.2::gentoo USE="-test" PYTHON_TARGETS="python3_12 -python3_11" 22 KiB
[ebuild N ] sys-kernel/ugrd-1.22.0::gentoo USE="-test" PYTHON_TARGETS="python3_12 -python3_11" 65 KiB
Total: 3 packages (3 new), Size of downloads: 104 KiB
Would you like to merge these packages? [Yes/No] |
In my opinion, the above output contradicts your statement:
pietinger wrote: | If you try to emerge our gentoo-kernel without ONE of two possible USE-flags you will get help:
Code: | # emerge -pvD gentoo-kernel-bin
These are the packages that would be merged, in order:
[...]
The following USE changes are necessary to proceed:
(see "package.use" in the portage(5) man page for more details)
# required by sys-kernel/gentoo-kernel-bin-6.6.57::gentoo[initramfs]
# required by virtual/dist-kernel-6.6.57::gentoo
>=sys-kernel/installkernel-48-r1 dracut |
|
What causes this difference? Would installing dracut affect "The following USE changes are necessary to proceed: ". I am confused. |
|
Back to top |
|
|
pietinger Moderator
Joined: 17 Oct 2006 Posts: 5121 Location: Bavaria
|
Posted: Thu Oct 24, 2024 7:45 pm Post subject: |
|
|
nxe9 wrote: | [...] Initramfs is generated by the genkernel. [...] I am confused. |
Yes, genkernel is a totally different thema ... genkernel uses gentoo-sources and NOT gentoo-kernel / gentoo-kernel-bin
Here I cannnot help because I have no experience with it ... maybe someone else will jump into this thread. _________________ https://wiki.gentoo.org/wiki/User:Pietinger |
|
Back to top |
|
|
nxe9 Tux's lil' helper
Joined: 05 Jun 2021 Posts: 116
|
Posted: Thu Oct 24, 2024 11:21 pm Post subject: |
|
|
Ok thanks, so I assume that with the genkernel installed, portage and its flags behave differently. So let's skip this situation and go back to the dracut system unless someone here wants to explain this behavior in more detail..
So currently gentoo-kernel package has the initramfs flag (default) and I activated the dracut flag in the installkernel package using the package.use file. In fact, when I remove the dracut flag from the installkernel, I get a depency conflict. So both flags are required and I assume that the gentoo-kernel package does not generate initramfs twice, because that would probably make no sense.
pietinger wrote: |
dist-kernel
This use-flag does not necessarily have to be activated, but it automates the handling when new firmware files or microcodes are available. My recommendation: Activate it globally in your make.conf as well.
|
I'm a little confused here. Let's consider the linux-firmware and intel-microcode packages. In both cases initramfs is activated by default and dist-kernel is not activated. This is also how it is set up for me at the moment. Isn't the initramfs flag enough to make initramfs load these packages correctly? Do I also need to add dist-kernel? I don't understand the difference exactly. |
|
Back to top |
|
|
pietinger Moderator
Joined: 17 Oct 2006 Posts: 5121 Location: Bavaria
|
Posted: Thu Oct 24, 2024 11:30 pm Post subject: |
|
|
nxe9 wrote: | [...] So both flags are required and I assume that the gentoo-kernel package does not generate initramfs twice, because that would probably make no sense. |
Yes.
nxe9 wrote: | [...] I'm a little confused here. Let's consider the linux-firmware and intel-microcode packages. In both cases initramfs is activated by default and dist-kernel is not activated. This is also how it is set up for me at the moment. [...] |
This is okay and you should have no problem.
nxe9 wrote: | [...] Isn't the initramfs flag enough to make initramfs load these packages correctly? Do I also need to add dist-kernel? I don't understand the difference exactly. |
Yes, the "initramfs" use-flag is sufficient. Maybe you dont need "dist-kernel" because you have no extra modules (e.g nvidia). But It is never wrong to enable it. This chapter explains it better than I could: https://wiki.gentoo.org/wiki/Handbook:Parts/Installation/Kernel#Post-install.2Fupgrade_tasks _________________ https://wiki.gentoo.org/wiki/User:Pietinger |
|
Back to top |
|
|
nxe9 Tux's lil' helper
Joined: 05 Jun 2021 Posts: 116
|
Posted: Thu Oct 24, 2024 11:35 pm Post subject: |
|
|
OK, I see
Code: | An upgrade of a distribution kernel is capable of triggering an automatic rebuild for external kernel modules installed by other packages (for example: sys-fs/zfs-kmod or x11-drivers/nvidia-drivers). This automated behaviour is enabled by enabling the dist-kernel USE flag. When required, this same flag will also trigger re-generation of the initramfs.
It is highly recommended to enable this flag globally via /etc/portage/make.conf when using a distribution kernel: |
So I will do as you advise, add dracut and dist-kernel globally.
Thank you. I don't have any more questions for now . |
|
Back to top |
|
|
pietinger Moderator
Joined: 17 Oct 2006 Posts: 5121 Location: Bavaria
|
Posted: Thu Oct 24, 2024 11:38 pm Post subject: |
|
|
nxe9 wrote: | Thank you. I don't have any more questions for now . |
You are very Welcome! ...
... and don't hesitate to ask beforehand ... it's usually better than having problems later. _________________ https://wiki.gentoo.org/wiki/User:Pietinger |
|
Back to top |
|
|
pietinger Moderator
Joined: 17 Oct 2006 Posts: 5121 Location: Bavaria
|
|
Back to top |
|
|
x610 n00b
Joined: 07 Aug 2014 Posts: 7 Location: Greater Philadelphia
|
Posted: Thu Oct 31, 2024 8:39 am Post subject: |
|
|
Are there any guides like the one you mentioned and https://wiki.gentoo.org/wiki/Quick_Installation_Checklist?
The installation handbook covers many cases and can often seem cumbersome and scary to newbies who want to start exploring Gentoo. I have been installing it many times lately, especially automating some items for my VM swarm of Gentoo systems. I have collected many steps and notes, which I have transformed into documentation. I was thinking of publishing it somewhere, but first, I want to see where I can find existing documentation and whether it makes sense to post another one. |
|
Back to top |
|
|
pietinger Moderator
Joined: 17 Oct 2006 Posts: 5121 Location: Bavaria
|
Posted: Thu Oct 31, 2024 12:13 pm Post subject: |
|
|
x610 wrote: | Are there any guides [...] ? |
I only know a few articles in the user section of the gentoo wiki.
x610 wrote: | [...] I was thinking of publishing it somewhere, but first, I want to see where I can find existing documentation and whether it makes sense to post another one. |
Although we have a subforum ”Documentation, Tips & Tricks” here in the forum, you might reach more people with an article in our Gentoo Wiki. The advantage of using our subforum is that it is easier to discuss and post additions. The advantage of the wiki is that you have your own user space where you can put your drafts. If an article is to be moved from your user space to the global area, then your article must not be written in the 1st or 2nd person. _________________ https://wiki.gentoo.org/wiki/User:Pietinger |
|
Back to top |
|
|
|