View previous topic :: View next topic |
Author |
Message |
pgu l33t
Joined: 30 Jul 2009 Posts: 721 Location: Oslo, Norway
|
Posted: Tue Jan 23, 2024 6:18 am Post subject: [SOLVED] Is dracut required now? |
|
|
I just updated to linux-6.6.13 and got:
Code: |
/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 |
|
Back to top |
|
|
pgu l33t
Joined: 30 Jul 2009 Posts: 721 Location: Oslo, Norway
|
Posted: Tue Jan 23, 2024 6:26 am Post subject: |
|
|
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 |
|
Back to top |
|
|
Ionen Developer
Joined: 06 Dec 2018 Posts: 2732
|
Posted: Tue Jan 23, 2024 6:37 am Post subject: |
|
|
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. |
|
Back to top |
|
|
pgu l33t
Joined: 30 Jul 2009 Posts: 721 Location: Oslo, Norway
|
Posted: Tue Jan 23, 2024 8:14 am Post subject: |
|
|
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. |
|
Back to top |
|
|
Ionen Developer
Joined: 06 Dec 2018 Posts: 2732
|
Posted: Tue Jan 23, 2024 10:25 am Post subject: |
|
|
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: | 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. |
|
Back to top |
|
|
spica Apprentice
Joined: 04 Jun 2021 Posts: 293
|
Posted: Tue Jan 23, 2024 10:56 am Post subject: |
|
|
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 |
|
Back to top |
|
|
Ionen Developer
Joined: 06 Dec 2018 Posts: 2732
|
Posted: Tue Jan 23, 2024 11:21 am Post subject: |
|
|
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. |
|
Back to top |
|
|
spica Apprentice
Joined: 04 Jun 2021 Posts: 293
|
|
Back to top |
|
|
pgu l33t
Joined: 30 Jul 2009 Posts: 721 Location: Oslo, Norway
|
Posted: Tue Jan 23, 2024 2:28 pm Post subject: |
|
|
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). |
|
Back to top |
|
|
pgu l33t
Joined: 30 Jul 2009 Posts: 721 Location: Oslo, Norway
|
Posted: Tue Jan 23, 2024 2:46 pm Post subject: |
|
|
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. |
|
Back to top |
|
|
AndrewAmmerlaan Developer
Joined: 25 Jun 2014 Posts: 302 Location: Nijmegen
|
Posted: Tue Jan 23, 2024 4:41 pm Post subject: |
|
|
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.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 |
|
|
pgu l33t
Joined: 30 Jul 2009 Posts: 721 Location: Oslo, Norway
|
Posted: Wed Jan 24, 2024 6:39 am Post subject: |
|
|
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. |
|
Back to top |
|
|
AndrewAmmerlaan Developer
Joined: 25 Jun 2014 Posts: 302 Location: Nijmegen
|
Posted: Fri Jan 26, 2024 1:55 pm Post subject: |
|
|
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.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 |
|
|
pgu l33t
Joined: 30 Jul 2009 Posts: 721 Location: Oslo, Norway
|
Posted: Sun Jan 28, 2024 3:18 pm Post subject: |
|
|
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: |
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: |
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: |
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: |
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: |
make distclean
cp ~/dot.config .config
make -j$(nproc)
make modules
make modules_install
|
Code: |
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. |
|
Back to top |
|
|
AndrewAmmerlaan Developer
Joined: 25 Jun 2014 Posts: 302 Location: Nijmegen
|
Posted: Sun Jan 28, 2024 3:58 pm Post subject: |
|
|
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.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 |
|
|
pgu l33t
Joined: 30 Jul 2009 Posts: 721 Location: Oslo, Norway
|
Posted: Mon Jan 29, 2024 7:19 pm Post subject: |
|
|
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 |
|
Back to top |
|
|
AndrewAmmerlaan Developer
Joined: 25 Jun 2014 Posts: 302 Location: Nijmegen
|
Posted: Mon Jan 29, 2024 8:41 pm Post subject: |
|
|
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.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 |
|
|
|