View previous topic :: View next topic |
Author |
Message |
RayDude Advocate
Joined: 29 May 2004 Posts: 2066 Location: San Jose, CA
|
Posted: Sat Jan 20, 2024 6:36 pm Post subject: initramfs required in 6.7.0? [solved] |
|
|
Hello all!
I disabled initramfs in the kernel, but it's still creating one.
I did realize that I have to install modules first, but I hesitate to reboot with a kernel that wants an initramfs even though it's disabled.
Can someone clue me in on the new 6.7.0 kernel method to simple booting?
Thanks in advance. _________________ Some day there will only be free software.
Last edited by RayDude on Mon Jan 22, 2024 6:38 am; edited 1 time in total |
|
Back to top |
|
|
NeddySeagoon Administrator
Joined: 05 Jul 2003 Posts: 54420 Location: 56N 3W
|
Posted: Sat Jan 20, 2024 6:52 pm Post subject: |
|
|
RayDude,
I booted 6.7.1 with no initrd a wee whie ago,
Code: | $ uptime
18:46:54 up 2:15, 1 user, load average: 0.26, 0.36, 0.65
$ uname -a
Linux neddy_static 6.7.1-gentoo #1 SMP PREEMPT_DYNAMIC Sat Jan 20 16:22:54 GMT 2024 x86_64 AMD Ryzen 9 5950X 16-Core Processor AuthenticAMD GNU/Linux |
Not an initrd/initfs in sight.
Code: | # ls /boot/EFI/EFI/SYSLINUX/
5.15.110-gentoo 6.6.1-gentoo 6.7.1-gentoo libcom32.c32 menu.c32 syslinux.efi
6.4.10-gentoo 6.6.2-gentoo ldlinux.e64 libutil.c32 syslinux.cfg vesamenu.c32 |
and /boot/EFI/EFI/SYSLINUX/syslinux.cfg
Code: | PROMPT 0
TIMEOUT 100
ONTIMEOUT Gentoo with Gentoo 6.1.1-gentoo
UI menu.c32
MENU TITLE Syslinux Boot Menu
#6.7.1-gentoo
LABEL Gentoo with Gentoo 6.7.1-gentoo
MENU LABEL Gentoo 6.7.1-gentoo
LINUX 6.7.1-gentoo
APPEND dm-mod.create="nvmestatic-root,,0,rw,0 4194304 linear /dev/nvme0n1p3 2048" root=/dev/dm-0 ro net.ifnames=0 acpi_enforce_resources=no
#6.6.2-gentoo
LABEL Gentoo with Gentoo 6.6.2-gentoo
MENU LABEL Gentoo 6.6.2-gentoo
LINUX 6.6.2-gentoo
APPEND dm-mod.create="nvmestatic-root,,0,rw,0 4194304 linear /dev/nvme0n1p3 2048" root=/dev/dm-0 ro net.ifnames=0 acpi_enforce_resources=no
|
With root in LVM I really should make an initrd :) _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
|
skellr l33t
Joined: 18 Jun 2005 Posts: 976 Location: The Village, Portmeirion
|
Posted: Sat Jan 20, 2024 6:57 pm Post subject: Re: initramfs required in 6.7.0? |
|
|
RayDude wrote: |
I disabled initramfs in the kernel, but it's still creating one. |
I suspect it's from the dracut USE flag for sys-kernel/installkernel. It will call dracut when you run "make install" from the kernel sources. |
|
Back to top |
|
|
NeddySeagoon Administrator
Joined: 05 Jul 2003 Posts: 54420 Location: 56N 3W
|
Posted: Sat Jan 20, 2024 7:03 pm Post subject: |
|
|
skellr,
Good call Code: | # eix sys-kernel/installkernel
* sys-kernel/installkernel
Available versions: 12{tbz2} (~)15-r1{tbz2} (~)17 (~)18{tbz2} {+dracut grub module-rebuild systemd uki ukify}
Homepage: https://github.com/projg2/installkernel-gentoo
Description: Gentoo fork of installkernel script from debianutils |
It has +dracut. The leading + means on by default. _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
|
skellr l33t
Joined: 18 Jun 2005 Posts: 976 Location: The Village, Portmeirion
|
Posted: Sat Jan 20, 2024 7:32 pm Post subject: |
|
|
NeddySeagoon wrote: | It has +dracut. The leading + means on by default. |
Yeah, I'm not sure how I feel about that. It seems like it would be opt in rather than opt out.
But, things are changing, and the *-kernel packages are gaining momentum. Maybe it is better to enable it by default and let the people that use *-sources, or that want to customize *-kernel packages, can just opt out? It's probably easier for the majority that way. |
|
Back to top |
|
|
logrusx Veteran
Joined: 22 Feb 2018 Posts: 1647
|
Posted: Sat Jan 20, 2024 8:32 pm Post subject: Re: initramfs required in 6.7.0? |
|
|
skellr wrote: | RayDude wrote: |
I disabled initramfs in the kernel, but it's still creating one. |
I suspect it's from the dracut USE flag for sys-kernel/installkernel. It will call dracut when you run "make install" from the kernel sources. |
Yeah, I noticed the same behavior just last night. Thanks for pointing that out. It makes no sense to me. Not everybody would want to run dracut on make install.
This change must have happened after 6.1.57 got stabilized, because I don't remember make install calling dracut when I installed it.
Best Regards,
Georgi |
|
Back to top |
|
|
NeddySeagoon Administrator
Joined: 05 Jul 2003 Posts: 54420 Location: 56N 3W
|
Posted: Sat Jan 20, 2024 8:42 pm Post subject: |
|
|
logrusx,
make install calls inslallkernel, which in turn calls dracut.
installkernel has seen some recent changes.
There is a news item being discussed on the -dev ml. _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
|
RayDude Advocate
Joined: 29 May 2004 Posts: 2066 Location: San Jose, CA
|
Posted: Sat Jan 20, 2024 10:19 pm Post subject: |
|
|
Thanks everyone!
I'm opting out of dracut!
Perhaps installkernel should check the kernel config to ensure that initrd is wanted?
Update: Yep that changed the default behavior _________________ Some day there will only be free software. |
|
Back to top |
|
|
RayDude Advocate
Joined: 29 May 2004 Posts: 2066 Location: San Jose, CA
|
Posted: Sat Jan 20, 2024 10:31 pm Post subject: |
|
|
Whelp the 6.7.0 kernel won't boot. Can't find boot device.
I guess it really needs an initrd, even though I disabled it.
I don't have time to investigate at this time. I'll have to look next weekend or the weekend after. _________________ Some day there will only be free software. |
|
Back to top |
|
|
eeckwrk99 Apprentice
Joined: 14 Mar 2021 Posts: 171 Location: Gentoo forums
|
Posted: Sat Jan 20, 2024 10:40 pm Post subject: |
|
|
RayDude wrote: | I'm opting out of dracut! |
Same here, since I still use sys-kernel/genkernel to generate my initramfs.
sys-kernel/dracut is also pulled by various kernel packages:
because of initramfs USE flag, which is enabled by default.
I know sys-kernel/dracut is the recommended tool nowadays but this should definitely be opt-in in my opinion. I dislike opt-out regardless so maybe I'm a bit biased. At least we can disable it. |
|
Back to top |
|
|
RayDude Advocate
Joined: 29 May 2004 Posts: 2066 Location: San Jose, CA
|
Posted: Sun Jan 21, 2024 7:44 am Post subject: |
|
|
My two other machines are working fine with 6.7.0
Not my server. It attempts to load an initramfs on bootup, even though it is disabled in config.
Then after not finding it, it doesn't even bother using the command line specified drive, it just bails and says it can't find the boot device.
I can't figure out what is different between this config and the two other machines.
I might start with my old config again, just to see if it works better. I specifically shut off initrd as it had been enabled before, but not used.
[Update] For some reason this system is using an initrd with 6.7.0, but I don't know why. It boots now that there is an 11MiB initramfs file in /boot, but I never used one before. It looks like grub is requiring it. I don't see anything about how grub determines if initramfs is required...
I'm sure this happened because I had installkernel emerge with +dracut and my default config had initramfs enabled, but I actually never used it.
I guess I'll have to research it more.
But for now it at least boots 6.7.0. _________________ Some day there will only be free software. |
|
Back to top |
|
|
NeddySeagoon Administrator
Joined: 05 Jul 2003 Posts: 54420 Location: 56N 3W
|
Posted: Sun Jan 21, 2024 12:40 pm Post subject: |
|
|
RayDude,
Grub is self contained. It is run by the firmware. It can make firmware calls but that's all the support that it gets.
Once grub is in control, it loads the file(s) its told to load.
That's the kernel and optionally, one or more initrd files.
Its possible to embed the kernel command line into the kernel and tell it to ignore anything that the boot loader passes in. Search for CMDLINE.
Code: | │ │ --- Built-in kernel command line │ │
│ │ (dm-mod.create="nvmestatic-root,,0,rw,0 4194304 linear /dev/nvme0n1p│ │
│ │ [ ] Built-in command line overrides boot loader arguments │ │ |
Are you sure it says "can't find the boot device" and not "root device" ? _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
|
RayDude Advocate
Joined: 29 May 2004 Posts: 2066 Location: San Jose, CA
|
Posted: Sun Jan 21, 2024 5:37 pm Post subject: |
|
|
Hi Neddy. Thanks for the help. I really appreciate it.
I'm not sure it was saying boot device. It was probably root device. I should have taken a picture of the boot screen.
But it's working now.
The issue is grub.cfg contains code to load initramfs. I don't understand why mkconfig is creating this section in this way:
Code: | menuentry 'Gentoo GNU/Linux' --class gentoo --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux
-simple-XXXXXXXXXX' {
load_video
set gfxpayload=keep
insmod gzio
insmod part_gpt
insmod fat
search --no-floppy --fs-uuid --set=root 2450-7E62
echo 'Loading Linux 6.7.0-gentoo ...'
linux /vmlinuz-6.7.0-gentoo root=UUID=XXXXXXXXXXXXX ro initcall_blacklist=acpi_cpufreq_init amd_pstate=passive amd_iommu=on sysrq_always_enabled=1 bdl_pos_adj=8,8
echo 'Loading initial ramdisk ...'
initrd /initramfs-6.7.0-gentoo.img
} |
Grub thinks there should be an initramfs...
The other machines are not doing this. _________________ Some day there will only be free software. |
|
Back to top |
|
|
skellr l33t
Joined: 18 Jun 2005 Posts: 976 Location: The Village, Portmeirion
|
Posted: Sun Jan 21, 2024 6:28 pm Post subject: |
|
|
RayDude wrote: | Grub thinks there should be an initramfs... |
It's probably just seeing that you have an initramfs with the same version as the kernel and thinks you need it. You probably need to remove it and regenerate the config. |
|
Back to top |
|
|
RayDude Advocate
Joined: 29 May 2004 Posts: 2066 Location: San Jose, CA
|
Posted: Mon Jan 22, 2024 5:12 am Post subject: |
|
|
skellr wrote: | RayDude wrote: | Grub thinks there should be an initramfs... |
It's probably just seeing that you have an initramfs with the same version as the kernel and thinks you need it. You probably need to remove it and regenerate the config. |
Thanks, but the file was missing the whole time because I prevented it from installing. Grub actually complained that it couldn't find it on boot and then panicked.
It only started booting when I allowed it to install.
Maybe it found it in the /usr/src/linux folder and used it because of that.
I'll start the kernel from scratch and see if that fixes the config file. _________________ Some day there will only be free software. |
|
Back to top |
|
|
RayDude Advocate
Joined: 29 May 2004 Posts: 2066 Location: San Jose, CA
|
Posted: Mon Jan 22, 2024 6:08 am Post subject: |
|
|
Skellr.
You are right. It is installing an initramfs even though I'm asking it not to build one... _________________ Some day there will only be free software. |
|
Back to top |
|
|
skellr l33t
Joined: 18 Jun 2005 Posts: 976 Location: The Village, Portmeirion
|
Posted: Mon Jan 22, 2024 6:32 am Post subject: |
|
|
RayDude wrote: | skellr wrote: | RayDude wrote: | Grub thinks there should be an initramfs... |
It's probably just seeing that you have an initramfs with the same version as the kernel and thinks you need it. You probably need to remove it and regenerate the config. |
Thanks, but the file was missing the whole time because I prevented it from installing. Grub actually complained that it couldn't find it on boot and then panicked.
It only started booting when I allowed it to install.
Maybe it found it in the /usr/src/linux folder and used it because of that.
I'll start the kernel from scratch and see if that fixes the config file. |
I have a feeling it will sort itself out when the kernel updates to a different version. 6.7.1-r1 is currently available.
Just watch that dracut isn't cooking up an initramfs for you when you install the kernel. It shouldn't if you have disabled it for sys-kernel/installkernel. |
|
Back to top |
|
|
RayDude Advocate
Joined: 29 May 2004 Posts: 2066 Location: San Jose, CA
|
Posted: Mon Jan 22, 2024 6:38 am Post subject: |
|
|
Okay. So I removed gentoo-sources-6.7.0 (emerge -C), blew away the folder, the files in /boot and the modules.
Then I re-emerged it, copied my old config file in, ran make menuconfig and deselected initramfs/initrd and then rebuilt the kernel.
This time, when I ran make install, no initramfs file was created and because it wasn't there, the proper grub config file was created.
Previously I had:
1. Removed the initrd/initramfs option and re-run make. That still produced an initramfs file in /boot when make install was run.
2. Run make distclean to get rid of all configuration files, then redo the config to disable initrd/initramfs, make and make install. But the initramfs was still in /boot.
Only removing the package and removing the directory, then re-emerging the package and changing the config before running make at all enabled the initramfs file to not appear in /boot.
Seems like a kernel config issue to me. Some file is hanging around and causing initramfs to be generated even when it's not selected in the kernel. _________________ Some day there will only be free software. |
|
Back to top |
|
|
logrusx Veteran
Joined: 22 Feb 2018 Posts: 1647
|
Posted: Mon Jan 22, 2024 8:25 am Post subject: |
|
|
This thread seems to be related: https://forums.gentoo.org/viewtopic-t-1167018.html
@Neddy, could you please bring the attention of the the devs to it?
From what I understand from the news item under discussion you referenced, they wanted to make the transition smooth an yet for some people it turned out to roll out in an unexpected way. I think this thread would help them consider the matter from more angles.
Best Regards,
Georgi |
|
Back to top |
|
|
AndrewAmmerlaan Developer
Joined: 25 Jun 2014 Posts: 302 Location: Nijmegen
|
Posted: Mon Jan 22, 2024 11:25 am Post subject: |
|
|
skellr wrote: | NeddySeagoon wrote: | It has +dracut. The leading + means on by default. |
Yeah, I'm not sure how I feel about that. It seems like it would be opt in rather than opt out.
But, things are changing, and the *-kernel packages are gaining momentum. Maybe it is better to enable it by default and let the people that use *-sources, or that want to customize *-kernel packages, can just opt out? It's probably easier for the majority that way. |
Yes this is indeed not what we want to be the default, it is unfortunately required at the moment because of this bug: https://bugs.gentoo.org/917145
This is one of the reasons I'm merging installkernel-gentoo and installkernel-systemd into installkernel, having one package avoids the bug and means we can then disable the dracut flag by default again. _________________ OS: Gentoo 6.8.10-gentoo-dist, ~amd64, 23.0/desktop/plasma/systemd
MB: MSI Z370-A PRO
CPU: Intel Core i9-9900KS
GPU: Intel Arc A770 16GB & Intel UHD Graphics 630
SSD: Samsung 970 EVO Plus 2 TB
RAM: Crucial Ballistix 32GB DDR4-2400 |
|
Back to top |
|
|
RayDude Advocate
Joined: 29 May 2004 Posts: 2066 Location: San Jose, CA
|
Posted: Mon Jan 22, 2024 5:30 pm Post subject: |
|
|
AndrewAmmerlaan wrote: | skellr wrote: | NeddySeagoon wrote: | It has +dracut. The leading + means on by default. |
Yeah, I'm not sure how I feel about that. It seems like it would be opt in rather than opt out.
But, things are changing, and the *-kernel packages are gaining momentum. Maybe it is better to enable it by default and let the people that use *-sources, or that want to customize *-kernel packages, can just opt out? It's probably easier for the majority that way. |
Yes this is indeed not what we want to be the default, it is unfortunately required at the moment because of this bug: https://bugs.gentoo.org/917145
This is one of the reasons I'm merging installkernel-gentoo and installkernel-systemd into installkernel, having one package avoids the bug and means we can then disable the dracut flag by default again. |
Thanks everyone for all your support. I appreciate it!
There's also two issues with the kernel: (although they may be one bug)
1. make distclean after building an initramfs does not prevent the kernel initramfs file from being built, even if it is deselected in make menuconfig.
2. make install still builds and installs initramfs even if the kernel config is changed to disable initramfs. _________________ Some day there will only be free software. |
|
Back to top |
|
|
pietinger Moderator
Joined: 17 Oct 2006 Posts: 4396 Location: Bavaria
|
Posted: Mon Jan 22, 2024 5:41 pm Post subject: |
|
|
RayDude wrote: | 1. make distclean after building an initramfs does not prevent the kernel initramfs file from being built, even if it is deselected in make menuconfig.
2. make install still builds and installs initramfs even if the kernel config is changed to disable initramfs. |
1. make distclean deletes all files you had built before ... but it has NO influence about how you build your kernel AFTER this ... SO, the question is: HOW do you build your kernel after a "make distclean" ?
If you do a "make menuconfig" (and disable initramfs completely) AND THEN do a "make" (or e.g. a "make -j8") THEN this make will NOT build an initramfs.
2. make install DOES NOT build an initramfs (if you have emerged it with USE-flag "-dracut") ... it will ONLY copy an initramfs IF IT FIND some.
3. Do you use grub ? Please be aware what grub-mkconfig is doing when it finds an initramfs ... ... read more here:
https://wiki.gentoo.org/wiki/User:Pietinger/Tutorials/Confusion_with_root%3DPARTUUID%3D_and_root%3DUUID%3D
(Maybe also: https://wiki.gentoo.org/wiki/User:Pietinger/Tutorials/Manual_kernel_configuration ) _________________ https://wiki.gentoo.org/wiki/User:Pietinger |
|
Back to top |
|
|
sMueggli Guru
Joined: 03 Sep 2022 Posts: 378
|
Posted: Mon Jan 22, 2024 5:46 pm Post subject: |
|
|
RayDude wrote: | 2. make install still builds and installs initramfs even if the kernel config is changed to disable initramfs. |
Please check your USE flags of sys-kernel/installkernel. If you still have "dracut" set and sys-kernel/dracut installed, it will automagically create an initramfs. |
|
Back to top |
|
|
figueroa Advocate
Joined: 14 Aug 2005 Posts: 2969 Location: Edge of marsh USA
|
Posted: Tue Jan 23, 2024 6:01 am Post subject: |
|
|
That was unexpected. I equate this to being a "Catch 22" situation. Running "make install" might deliver surprises. (Note: a Catch 22 is a " a paradoxical situation from which an individual cannot escape because of contradictory rules or limitations.") "https://en.wikipedia.org/wiki/Catch-22_(logic)"
Fortunately, I've never run "make install" but instead after building the kernel with "make && make modules_install" just copy the three files, .config, System.map, and bzImage into /boot, adjust grub.cfg, and then reboot. Otherwise, I would soon forget how to maintain Linux without those nice little helper scripts. _________________ Andy Figueroa
hp pavilion hpe h8-1260t/2AB5; spinning rust x3
i7-2600 @ 3.40GHz; 16 gb; Radeon HD 7570
amd64/23.0/split-usr/desktop (stable), OpenRC, -systemd -pulseaudio -uefi |
|
Back to top |
|
|
|