Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Gentoo hangs on "Loading initial ramdisk"
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
nxe9
Tux's lil' helper
Tux's lil' helper


Joined: 05 Jun 2021
Posts: 80

PostPosted: Tue Oct 22, 2024 6:51 pm    Post subject: Gentoo hangs on "Loading initial ramdisk" Reply with quote

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
View user's profile Send private message
pietinger
Moderator
Moderator


Joined: 17 Oct 2006
Posts: 5000
Location: Bavaria

PostPosted: Tue Oct 22, 2024 7:57 pm    Post subject: Reply with quote

Have you tried to make an UKI?

If yes, please read: https://forums.gentoo.org/viewtopic-t-1171401.html

If no, we would need to know all your steps you did for this installation.
_________________
https://wiki.gentoo.org/wiki/User:Pietinger
Back to top
View user's profile Send private message
nxe9
Tux's lil' helper
Tux's lil' helper


Joined: 05 Jun 2021
Posts: 80

PostPosted: Tue Oct 22, 2024 11:12 pm    Post subject: Reply with quote

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
View user's profile Send private message
pietinger
Moderator
Moderator


Joined: 17 Oct 2006
Posts: 5000
Location: Bavaria

PostPosted: Wed Oct 23, 2024 12:16 am    Post subject: Reply with quote

nxe9 wrote:
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 [...]

This is one of the best things you can do; it not only helps you in the future, but also us. :D


I see you are trying to use the Gentoo sources and combine them with dracut. If you use our distribution kernel, (almost) all modules are already configured ... and ... some options are already enabled correctly. This is (unfortunately) not the case with the default configuration of the sources. For example, a very important option is missing there:
Code:
Processor type and features  --->
    [*] Intel Low Power Subsystem Support

(see also later in first deep link I give you)

This module activates other (important) kernel modules. Also, you have not activated an ethernet module (the initramfs that is created by dracut can only load the required kernel modules if they have been created during “make”). Long story short: a lot is missing.


I see two options to continue:

1. The simple one: use our binary Gentoo dist-kernel (sys-kernel/gentoo-kernel-bin), or

2. Read these two articles (completely) ... you might want to change your mind afterwards and step back to option 1 ... :lol:

* https://wiki.gentoo.org/wiki/User:Pietinger/Experimental/Manual_Configuring_Current_Kernel#Essential_Options

Scroll up and you will see there: Please read User:Pietinger/Tutorials/Manual_kernel_configuration before you start here ! This is:

* https://wiki.gentoo.org/wiki/User:Pietinger/Tutorials/Manual_kernel_configuration

(Read really all; an important chapter for example is: https://wiki.gentoo.org/wiki/User:Pietinger/Tutorials/Manual_kernel_configuration#Driver_needs_Firmware )

If you really want to go this way, you should (after reading all) start here:

https://wiki.gentoo.org/wiki/User:Pietinger/Tutorials/Manual_kernel_configuration#Before_you_start
(do everything mentioned in number 2)
_________________
https://wiki.gentoo.org/wiki/User:Pietinger
Back to top
View user's profile Send private message
nxe9
Tux's lil' helper
Tux's lil' helper


Joined: 05 Jun 2021
Posts: 80

PostPosted: Wed Oct 23, 2024 1:17 am    Post subject: Reply with quote

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
View user's profile Send private message
sMueggli
Guru
Guru


Joined: 03 Sep 2022
Posts: 465

PostPosted: Wed Oct 23, 2024 9:02 am    Post subject: Reply with quote

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
View user's profile Send private message
nxe9
Tux's lil' helper
Tux's lil' helper


Joined: 05 Jun 2021
Posts: 80

PostPosted: Thu Oct 24, 2024 1:40 am    Post subject: Reply with quote

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
View user's profile Send private message
Hu
Administrator
Administrator


Joined: 06 Mar 2007
Posts: 22557

PostPosted: Thu Oct 24, 2024 11:02 am    Post subject: Reply with quote

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
View user's profile Send private message
nxe9
Tux's lil' helper
Tux's lil' helper


Joined: 05 Jun 2021
Posts: 80

PostPosted: Thu Oct 24, 2024 5:10 pm    Post subject: Reply with quote

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
View user's profile Send private message
pietinger
Moderator
Moderator


Joined: 17 Oct 2006
Posts: 5000
Location: Bavaria

PostPosted: Thu Oct 24, 2024 6:32 pm    Post subject: Reply with quote

nxe9 wrote:
Do I understand correctly that I have the following two options and they will give me the same result?

No ... :P

Yes, it can be confusing ... :lol: ... 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
View user's profile Send private message
nxe9
Tux's lil' helper
Tux's lil' helper


Joined: 05 Jun 2021
Posts: 80

PostPosted: Thu Oct 24, 2024 7:26 pm    Post subject: Reply with quote

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
View user's profile Send private message
pietinger
Moderator
Moderator


Joined: 17 Oct 2006
Posts: 5000
Location: Bavaria

PostPosted: Thu Oct 24, 2024 7:45 pm    Post subject: Reply with quote

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
View user's profile Send private message
nxe9
Tux's lil' helper
Tux's lil' helper


Joined: 05 Jun 2021
Posts: 80

PostPosted: Thu Oct 24, 2024 11:21 pm    Post subject: Reply with quote

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
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