Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Installing Gentoo
  • Search

[SOLVED] Is dracut required now?

Having problems with the Gentoo Handbook? If you're still working your way through it, or just need some info before you start your install, this is the place. All other questions go elsewhere.
Post Reply
Advanced search
17 posts • Page 1 of 1
Author
Message
pgu
l33t
l33t
Posts: 722
Joined: Thu Jul 30, 2009 3:41 pm
Location: Oslo, Norway

[SOLVED] Is dracut required now?

  • Quote

Post by pgu » Tue Jan 23, 2024 6:18 am

I just updated to linux-6.6.13 and got:

Code: Select all

/usr/src/linux # make install
  INSTALL /boot
run-parts: executing /etc/kernel/preinst.d/50-dracut.install 6.6.13-gentoo arch/x86/boot/bzImage
 * dracut is not installed

/usr/src/linux # grep INITRD .config
# CONFIG_BLK_DEV_INITRD is not set

Is dracut required? If not, what has to be set in order for it not to be pulled in?

There is no USE flag which appears to be related to dracut in gentoo-sources.
Last edited by pgu on Mon Jan 29, 2024 7:19 pm, edited 1 time in total.
Top
pgu
l33t
l33t
Posts: 722
Joined: Thu Jul 30, 2009 3:41 pm
Location: Oslo, Norway

  • Quote

Post by pgu » Tue Jan 23, 2024 6:26 am

Seems like there is a USE flag in /etc/kernel/preinst.d/50-dracut.install

EDIT: That should have been sys-kernel/installkernel
Last edited by pgu on Tue Jan 23, 2024 6:41 am, edited 1 time in total.
Top
Ionen
Developer
Developer
User avatar
Posts: 3013
Joined: Thu Dec 06, 2018 2:23 pm

  • Quote

Post by Ionen » Tue Jan 23, 2024 6:37 am

Beside the message it's a no-op if dracut is not installed (not required in any way), but if you don't want the noise then you can sys-kernel/installkernel -dracut to get rid of the script noted above.
Top
pgu
l33t
l33t
Posts: 722
Joined: Thu Jul 30, 2009 3:41 pm
Location: Oslo, Norway

  • Quote

Post by pgu » Tue Jan 23, 2024 8:14 am

In my case it will stop right there and it would not continue until I installed dracut or until I rebuild sys-kernel/installkernel without the dracut USE flag.
Top
Ionen
Developer
Developer
User avatar
Posts: 3013
Joined: Thu Dec 06, 2018 2:23 pm

  • Quote

Post by Ionen » Tue Jan 23, 2024 10:25 am

pgu wrote:In my case it will stop right there and it would not continue until I installed dracut or until I rebuild sys-kernel/installkernel without the dracut USE flag.
That doesn't sound possible, or at least not from a quick look. installkernel does not abort when run-parts fails, and even then the dracut script exit with a success code when that message is printed.. so I don't quite see how it could happen

Are you sure it didn't just install the kernel anyway and just thought it was an error because of the message?

Edit: I gave it a quick try and despite seeing:

Code: Select all

linux-6.7.1# make install
  INSTALL /boot
run-parts: executing /etc/kernel/preinst.d/50-dracut.install 6.7.1 arch/x86/boot/bzImage
 * dracut is not installed
...I have /boot/vmlinuz-6.7.1 installed, so it worked normally.
Top
spica
Guru
Guru
Posts: 382
Joined: Fri Jun 04, 2021 6:12 pm

  • Quote

Post by spica » Tue Jan 23, 2024 10:56 am

According to git history,
2 weeks ago `sys-kernel/installkernel-gentoo-7` had IUSE="grub", now it is replaced by `sys-kernel/installkernel-12` with IUSE="+dracut grub uki ukify".
The `dracut` flag is not expected to be enabled by default, but it is. It confuses those ones who does not have dracut installed, possibly making an erroneous conclusion about the need to install it
Top
Ionen
Developer
Developer
User avatar
Posts: 3013
Joined: Thu Dec 06, 2018 2:23 pm

  • Quote

Post by Ionen » Tue Jan 23, 2024 11:21 am

Well, I just noticed that the current ~testing installkernel takes it further and actually depends on dracut now. So rather than a confusing message you'll get dracut called by default next stable unless turn off the USE.
Top
spica
Guru
Guru
Posts: 382
Joined: Fri Jun 04, 2021 6:12 pm

  • Quote

Post by spica » Tue Jan 23, 2024 11:51 am

Clarification requested in https://bugs.gentoo.org/922772
Top
pgu
l33t
l33t
Posts: 722
Joined: Thu Jul 30, 2009 3:41 pm
Location: Oslo, Norway

  • Quote

Post by pgu » Tue Jan 23, 2024 2:28 pm

spica wrote:The `dracut` flag is not expected to be enabled by default, but it is. It confuses those ones who does not have dracut installed, possibly making an erroneous conclusion about the need to install it
Exactly, and after sys-kernel/installkernel was updated the file /etc/kernel/preinst.d/50-dracut.install was created leading to the message and the halt (at least in my case).
Top
pgu
l33t
l33t
Posts: 722
Joined: Thu Jul 30, 2009 3:41 pm
Location: Oslo, Norway

  • Quote

Post by pgu » Tue Jan 23, 2024 2:46 pm

Ionen wrote:Well, I just noticed that the current ~testing installkernel takes it further and actually depends on dracut now. So rather than a confusing message you'll get dracut called by default next stable unless turn off the USE.
That would be even more confusing as you might not notice that dracut was installedand behind your back. In my case my system would not even boot, probably due to missing modules or statements in dracut.conf.
Top
Nowa
Developer
Developer
User avatar
Posts: 522
Joined: Wed Jun 25, 2014 7:07 am
Location: Hilversum

  • Quote

Post by Nowa » Tue Jan 23, 2024 4:41 pm

Are you sure the kernel is not installed?

It prints this message if dracut is not installed, but should still continue. In that case this is the final message that will be printed, but please double check the exit status and the contents of /boot.
OS: Gentoo 6.19.3-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
Top
pgu
l33t
l33t
Posts: 722
Joined: Thu Jul 30, 2009 3:41 pm
Location: Oslo, Norway

  • Quote

Post by pgu » Wed Jan 24, 2024 6:39 am

AndrewAmmerlaan wrote:Are you sure the kernel is not installed?
You're right. I tried to repeat the steps (even though my system is now in a different state than earlier) and the kernel is indeed installed in /boot. I must have missed line at the top of the dracut warning.

But I find it confusing that dracut is suddenly default enabled and that the USE flag in installkernel will affect gentoo-source.
Top
Nowa
Developer
Developer
User avatar
Posts: 522
Joined: Wed Jun 25, 2014 7:07 am
Location: Hilversum

  • Quote

Post by Nowa » Fri Jan 26, 2024 1:55 pm

pgu wrote:
AndrewAmmerlaan wrote:Are you sure the kernel is not installed?
But I find it confusing that dracut is suddenly default enabled and that the USE flag in installkernel will affect gentoo-source.
This has now been resolved
OS: Gentoo 6.19.3-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
Top
pgu
l33t
l33t
Posts: 722
Joined: Thu Jul 30, 2009 3:41 pm
Location: Oslo, Norway

  • Quote

Post by pgu » Sun Jan 28, 2024 3:18 pm

AndrewAmmerlaan wrote:This has now been resolved
What causes the img file to be built when running "make install" in /usr/src/linux?


I have two quite similar systems. On system A I did emerge @world with the default +dracut at first. I then installed dracut, booted and it crashed probably due to missing entries in /etc/dracut.conf. I then unmerged dracut, ran a world update with --newuse where -dracut was added to installkernel. Then re-building the kernel by make distclean, copy back my saved .config and make. When I install the kernel, even with CONFIG_BLK_DEV_INITRD disabled "make install" will create an img file:

Code: Select all

sys_a /usr/src/linux # find /etc -type f -print0 |xargs -0 grep -i dracut
/etc/portage/package.use/06_installkernel:sys-kernel/installkernel  -dracut
sys_a /usr/src/linux # emerge -pv dracut installkernel

These are the packages that would be merged, in order:

Calculating dependencies... done!
Dependency resolution took 3.93 s (backtrack: 0/20).

[ebuild   R    ] sys-kernel/installkernel-18-r1::gentoo  USE="-dracut -grub -systemd -uki -ukify" 0 KiB
[ebuild  N     ] sys-kernel/dracut-060_pre20240104::gentoo  USE="(-selinux) (-test)" 489 KiB

Total: 2 packages (1 new, 1 reinstall), Size of downloads: 489 KiB

 * IMPORTANT: 18 news items need reading for repository 'gentoo'.
 * Use eselect news read to view new items.
I then do

Code: Select all

make distclean
cp ~/dot.config .config
make -j$(nproc)
make modules
make modules_install
And when I install the kernel it will crete an initramfs img file:

Code: Select all

sys_a /usr/src/linux # make install
  INSTALL /boot
sys_a /usr/src/linux # ls -lt /boot/|head -5
total 148976
-rw-r--r-- 1 root root   142987 Jan 28 16:01 config-6.6.13-gentoo
-rw-r--r-- 1 root root  8663480 Jan 28 16:01 System.map
-rw-r--r-- 1 root root  8663480 Jan 28 16:01 System.map-6.6.13-gentoo
-rw-r--r-- 1 root root  7866735 Jan 28 16:01 initramfs-6.6.13-gentoo.img
sys_a /usr/src/linux # grub-mkconfig -o /boot/grub/grub.cfg 2>&1 | grep 6.6
Found linux image: /boot/vmlinuz-6.6.13-gentoo
Found initrd image: /boot/initramfs-6.6.13-gentoo.img
Found linux image: /boot/vmlinuz-6.6.13-gentoo.old
Found initrd image: /boot/initramfs-6.6.13-gentoo.img.old
I can remove the img files prior to grub-mkconfig in order to make sys_a to boot, but leaving it will cause my system not to boot.

On system B I was aware of the dracut problem so I added -dracut to installkernel before the world update. When I build the kernel "make install" will not include an img file, even if CONFIG_BLK_DEV_INITRD is set. Here's the same set commands as I ran on sys_a:

Code: Select all

sys_b /usr/src/linux # find /etc -type f -print0 |xargs -0 grep -i dracut
/etc/portage/package.use/06-installkernel:sys-kernel/installkernel  -grub -dracut
sys_b /usr/src/linux # emerge -pv dracut installkernel

These are the packages that would be merged, in order:

Calculating dependencies... done!
Dependency resolution took 2.20 s (backtrack: 0/20).

[ebuild   R    ] sys-kernel/installkernel-18-r1::gentoo  USE="-dracut -grub -systemd -uki -ukify" 0 KiB
[ebuild  N     ] sys-kernel/dracut-060_pre20240104::gentoo  USE="(-selinux) (-test)" 489 KiB

Total: 2 packages (1 new, 1 reinstall), Size of downloads: 489 KiB

 * IMPORTANT: 17 news items need reading for repository 'gentoo'.
 * Use eselect news read to view new items.

Code: Select all

make distclean
cp ~/dot.config .config
make -j$(nproc)
make modules
make modules_install

Code: Select all

sys_b /usr/src/linux # make install
  INSTALL /boot
sys_b /usr/src/linux # ls -lt /boot/|head -5
total 270924
-rw-r--r-- 1 root root   142700 Jan 28 16:03 config-6.6.13-gentoo
-rw-r--r-- 1 root root  7401737 Jan 28 16:03 System.map-6.6.13-gentoo
-rw-r--r-- 1 root root 12303520 Jan 28 16:03 vmlinuz-6.6.13-gentoo
drwxr-xr-x 6 root root     4096 Jan 28 15:09 grub
sys_b /usr/src/linux # grub-mkconfig -o /boot/grub/grub.cfg 2>&1 | grep 6.6
Found linux image: /boot/vmlinuz-6.6.13-gentoo
Found linux image: /boot/vmlinuz-6.6.13-gentoo.old

What causes the img file to be copied into /boot and be used by grub?

I even copied the .config from sys_a to sys_b and built and installed it with no img created on sys_b so it appears to be due some state in the system and not in the kernel .config file.
BTW: I understand that -dracut is now the default in installkernel so I no longer need to add the -dracut USE flag, but I don't know exactly what causes sys_a to create the img file and if it's related to some stale state caused by the earlier +dracut install.
Top
Nowa
Developer
Developer
User avatar
Posts: 522
Joined: Wed Jun 25, 2014 7:07 am
Location: Hilversum

  • Quote

Post by Nowa » Sun Jan 28, 2024 3:58 pm

pgu wrote:
AndrewAmmerlaan wrote:This has now been resolved
What causes the img file to be built when running "make install" in /usr/src/linux?
You probably still have an initrd at /usr/src/linux/arch/x86/boot/initrd left over.

The -systemd version of the dracut plugin puts it there, where the main script picks it up and installs it. Simply remove that file.
pgu wrote:
AndrewAmmerlaan wrote:This has now been resolved
When I install the kernel, even with CONFIG_BLK_DEV_INITRD disabled "make install" will create an img file:
Note that the kernel and its configuration is entirely irrelevant, if USE=dracut dracut will generate an initrd. Dracut has no mechanism to check that the kernel supports loading an initrd.
OS: Gentoo 6.19.3-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
Top
pgu
l33t
l33t
Posts: 722
Joined: Thu Jul 30, 2009 3:41 pm
Location: Oslo, Norway

  • Quote

Post by pgu » Mon Jan 29, 2024 7:19 pm

AndrewAmmerlaan wrote:You probably still have an initrd at /usr/src/linux/arch/x86/boot/initrd left over. The -systemd version of the dracut plugin puts it there, where the main script picks it up and installs it. Simply remove that file
Thank you, that resolved the problem.

However, I was expecting "make distclean" and/or "make mrproper" in the kernel source directory to remove all generated files.

But this is not the case with "/usr/src/linux/arch/x86/boot/initrd" as it was put there by dracut as you just explained.

It was not removed by unmerging dracut so I also find this a bit confusing that the user have to know that the initrd is left there as a result of the accidental dracut USE flag (which also made me believe that dracut was now required, hence I started this thread).
AndrewAmmerlaan wrote:Note that the kernel and its configuration is entirely irrelevant

Yes, that was my thinking and also why I cross built the kernel on the other system to confirm that there was nothing in the kernel .config file causing this. But I suspected there was some state left over by the dracut and/or installkernel but I could not figure out what it was. But now I do...

EDIT: BTW I'm not using systemd
Top
Nowa
Developer
Developer
User avatar
Posts: 522
Joined: Wed Jun 25, 2014 7:07 am
Location: Hilversum

  • Quote

Post by Nowa » Mon Jan 29, 2024 8:41 pm

pgu wrote:It was not removed by unmerging dracut so I also find this a bit confusing that the user have to know that the initrd is left there as a result of the accidental dracut USE flag (which also made me believe that dracut was now required, hence I started this thread).
Yes it is a bit unfortunate that the traditional installkernel insists on having the initrd and uki.efi at the same place as the kernel image. The systemd version is a bit better in this regard in the sense that it installs the generated initrd and/or uki.efi to a temporary staging area and then copies the files as required from there without ever modifying the kernel source tree.

I don't think we can change the behaviour of the traditional installkernel in this regard without breaking things elsewhere. But perhaps we can improve the documentation somewhat to mention that these files might be left over when users switch from a configuration with initrams and/or uki to one without.
OS: Gentoo 6.19.3-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
Top
Post Reply

17 posts • Page 1 of 1

Return to “Installing Gentoo”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic