Bug 2133293 - kernel-install depends on grub2 packages
Summary: kernel-install depends on grub2 packages
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: systemd
Version: 36
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: systemd-maint
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
: 2133294 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-10-09 15:49 UTC by Harald Reindl
Modified: 2022-10-25 16:28 UTC (History)
12 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-10-25 16:13:30 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 2121912 0 unspecified CLOSED kexec-tools: /bin/kdumpctl: line 1393: grubby: command not found 2023-12-22 16:35:19 UTC

Description Harald Reindl 2022-10-09 15:49:59 UTC
after switching to systemd-boot and removing grub2-packages only initrd get generated but no kernel and no boot-entry - at least "grub2-tools-minimal" is needed and to get rid of some obscure warning "grub2-tools" too

and what is creating this stuff?

grub_users $grub_users
grub_arg --unrestricted
grub_class generic

/efi/loader/entries/f2e61df948714ed49f14eac2840bc3f3-5.19.14-200.fc36.x86_64.conf:7: Unknown line "grub_users", ignoring.
/efi/loader/entries/f2e61df948714ed49f14eac2840bc3f3-5.19.14-200.fc36.x86_64.conf:8: Unknown line "grub_arg", ignoring.
/efi/loader/entries/f2e61df948714ed49f14eac2840bc3f3-5.19.14-200.fc36.x86_64.conf:9: Unknown line "grub_class", ignoring.

Comment 1 David Tardon 2022-10-20 10:36:29 UTC
(In reply to Harald Reindl from comment #0)
> after switching to systemd-boot and removing grub2-packages only initrd get
> generated but no kernel and no boot-entry - at least "grub2-tools-minimal"
> is needed and to get rid of some obscure warning "grub2-tools" too

Sorry, but this is too vague to be actionable. Which steps did you follow to set up systemd-boot? Which grub2 packages did you remove? Also, it would be nice to get the output of

# sh -x kernel-install add `uname -r` /lib/modules/`uname -r`/vmlinuz
 
> and what is creating this stuff?
> 
> grub_users $grub_users
> grub_arg --unrestricted
> grub_class generic

/lib/kernel/install.d/20-grub.install , coming from grub2-common.

Comment 2 Harald Reindl 2022-10-20 11:06:26 UTC Comment hidden (abuse)
Comment 3 David Tardon 2022-10-21 12:10:46 UTC
(In reply to Harald Reindl from comment #2)
> what is vague here?

Let me show you how I read the original description: "I did something I think is needed to switch to systemd-boot. After that I removed some grub2 packages. As a result of these unspecified steps, an initrd has been generated somewhere but kernel and boot entry has not."

Comment 4 Harald Reindl 2022-10-21 12:18:20 UTC Comment hidden (abuse)
Comment 5 David Tardon 2022-10-23 17:44:53 UTC
(In reply to Harald Reindl from comment #4)
> and it boots

But you did not mention this. 

> the i tried "dnf upgrade kernel\*"

Nor this.

> and keep your "an initrd has been generated somewhere" for yourself - it's
> where it belongs to at /efi

Good. But you did not mention that either.

> and even if it would be installed to /boot no
> problem because in my case /boot is just a symlink to /efi

Which is another thing you omitted.

I'm sorry, but I can only evaluate a bug report based on the information provided by it. And the original description is particularly lacking in information.

> 
> the point is that as soon as you remove grub2 packages because you no longer
> use rgub2 kernel-install don't install keernels

Yes, I've got that after reading comment 2. And I'm not too surprised. As I said in bug 2133294, nobody has done the work to provide first-class support for systemd-boot in Fedora. Patch(es) welcome.

Comment 6 Harald Reindl 2022-10-23 18:08:10 UTC
the "after" in "after switching to systemd-boot" implies a finished transition which is prerequisite for "and removing grub2-packages" which one would only do after a successfull boot with systemd-boot

> nobody has done the work to provide first-class support for systemd-boot in Fedora

given that systemd-boot and kernel-install are shipped by systemd it could be expected that both work together

Comment 7 Zbigniew Jędrzejewski-Szmek 2022-10-25 16:13:30 UTC
tl;dr: things work in F37. If not, please open a new bug.

Long version:
The story is complicated because of history and backwards-compatibility requirements.

systemd provides /usr/lib/kernel/install.d/90-loaderentry.install. That file will create a boot loader entry.
But it contains a check that layout=bls, where layout is configured by /etc/kernel/install.conf
or autodetected.

I assume you don't have layout specified in /etc/kernel/install.conf, so autodetection needs
to be performed. 'bootctl install' creates loader/entries.srel, and if that file is present,
kernel-install will autodetect layout as 'bls'. That code was added in systemd-251.

Options to get 90-loaderentry.install to work:
1. add 'layout=bls' in /etc/kernel/install.conf
2. make sure that loader/entries.srel is present

Also, things will only work properly in F37.
At this point we don't want to backport things to F36-. It is possible that things
are broken there, but the risk for regressions if we try to change anything is just too high.

On the other hand, if something does now work in F37, then it is a bug that
should be reported. In that case, please open a new bug or reopen this one. Please include
the package versions of relevant packages (i.e. at least systemd* and grub*), and also
the output from 'kernel-install -v add …'.

I'll also report a bug against /usr/lib/kernel/install.d/92-crashkernel.install, since it
spews errors if grubby is not installed.

Comment 8 Zbigniew Jędrzejewski-Szmek 2022-10-25 16:16:48 UTC
> I'll also report a bug against /usr/lib/kernel/install.d/92-crashkernel.install, since it
spews errors if grubby is not installed.

Actually, the bug is already open: #2121912.

Comment 9 Harald Reindl 2022-10-25 16:24:31 UTC
> I assume you don't have layout specified in /etc/kernel/install.conf

this file don't exist on machines installed 10 years ago and upgraded with yum/dnf at all

> make sure that loader/entries.srel is present

F36 has systemd-250 so it wasn't created by "bootctl install"

will both be created after upgrade to F37 next year and running "bootctl update" and if not what they are supposed to contain?

Comment 10 Zbigniew Jędrzejewski-Szmek 2022-10-25 16:28:51 UTC
*** Bug 2133294 has been marked as a duplicate of this bug. ***


Note You need to log in before you can comment on or make changes to this bug.