Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 1687266 - When grub2 is not installed, installing a kernel does not copy kernel files into /boot
Summary: When grub2 is not installed, installing a kernel does not copy kernel files i...
Keywords:
Status: NEW
Alias: None
Product: Fedora
Classification: Fedora
Component: grub2
Version: 29
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Peter Jones
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-03-11 06:35 UTC by Kostya Vasilyev
Modified: 2019-03-15 06:48 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed:


Attachments (Terms of Use)

Description Kostya Vasilyev 2019-03-11 06:35:28 UTC
Description of problem:

I use an alternative UEFI boot loader caller rEFInd:

http://www.rodsbooks.com/refind/

It scans disk drives for bootable images (including Linux but not only) on every boot, and for Linux is able to book kernel images directly - without requiring any other boot loader in between.

And so I should be able to uninstall grub2 and related packages.

But when I do, installing a newer kernel (with dnf update let's say) does not copy kernel files into /boot.

It must be some script that runs during kernel install (/usr/bin/kernel-install maybe?) and when it sees that grub2 is not there, it decides to not copy kernel files into /boot, so the new kernel cannot be booted.


Version-Release number of selected component (if applicable):

kernel-install (if that's what it is) is from

systemd-udev-239-12.git8bca462.fc29.x86_64


How reproducible:

100%


Steps to Reproduce:

1. Uninstall grub2-pc (will also remove grub2-common, grub2-tools, os-prober, etc.)

2. dnf install or rpm install a new (not yet installed) kernel version

Actual results:

The new kernel's files are *not* copied into /boot


Expected results:

New kernel's files *are* copied into /boot


Additional info:

I have the EFI system partition mounted on /boot/efi.

/boot is not a separate partition it's part of / mount.

No trouble with either as long as grub2 is installed - but I would like to remove it (and for kernel updates to still copy kernel files into /boot).

Comment 1 Kostya Vasilyev 2019-03-11 06:51:57 UTC
I *think* actual installation (of kernel files into /boot) is handled by

/usr/lib/kernel/install.d/20-grub.install

which belongs to grub2-common.

The funny thing is that kernel-core package already contains all the necessary files in the right location (under /boot) so when grub2 is not installed, these files are probably getting removed...

rpm -ql kernel-core-5.0.1  | grep boot
/boot/.vmlinuz-5.0.1-350.vanilla.knurd.1.fc29.x86_64.hmac
/boot/System.map-5.0.1-350.vanilla.knurd.1.fc29.x86_64
/boot/config-5.0.1-350.vanilla.knurd.1.fc29.x86_64
/boot/initramfs-5.0.1-350.vanilla.knurd.1.fc29.x86_64.img
/boot/vmlinuz-5.0.1-350.vanilla.knurd.1.fc29.x86_64


Any way for kernel install scripts to just keep them in place (when grub2 is not installed and there is no 20-grub.install)?

Comment 2 Javier Martinez Canillas 2019-03-11 08:07:38 UTC
(In reply to Kostya Vasilyev from comment #0)
> Description of problem:
> 
> I use an alternative UEFI boot loader caller rEFInd:
> 
> http://www.rodsbooks.com/refind/
> 
> It scans disk drives for bootable images (including Linux but not only) on
> every boot, and for Linux is able to book kernel images directly - without
> requiring any other boot loader in between.
> 
> And so I should be able to uninstall grub2 and related packages.
> 
> But when I do, installing a newer kernel (with dnf update let's say) does
> not copy kernel files into /boot.
> 
> It must be some script that runs during kernel install
> (/usr/bin/kernel-install maybe?) and when it sees that grub2 is not there,
> it decides to not copy kernel files into /boot, so the new kernel cannot be
> booted.
>

You need to install the grubby-deprecated package for this setup.

Comment 3 Kostya Vasilyev 2019-03-11 08:10:54 UTC
Javier thank you.

Um package name is actually "grubby" - and then I'll be able to uninstall grub2 (and related)?

Comment 4 Javier Martinez Canillas 2019-03-11 08:14:59 UTC
(In reply to Kostya Vasilyev from comment #3)
> Javier thank you.
> 
> Um package name is actually "grubby" - and then I'll be able to uninstall
> grub2 (and related)?

Right, missed that the bug was filed for F29. Yes, it's still called grubby there but for F30 the grubby tool is moved to the grubby-deprecated package.

And yes, in that case you will be able to uninstall all grub2 related packages.

Comment 5 Kostya Vasilyev 2019-03-11 08:26:46 UTC
Looks like it worked.

grubby pulls in some grub2 packages:

$ rpm -qa | grep grub
grub2-tools-2.02-62.fc29.x86_64
grub2-common-2.02-62.fc29.noarch
grub2-tools-minimal-2.02-62.fc29.x86_64
grubby-8.40-18.fc29.x86_64

os-prober is also there.

I just verified that the kernel does get installed into /boot - and there is no "looking for other OSs" (good! what I was trying to avoid).

Thank you for your help Javier.

Maybe (suggestion if this is a supported scenario) - take it further and make a new package that 1) still installs kernel into /boot but 2) depends on as few grub2 packages as possible 3) the dependency on os-prober also seems unnecessary in this particular scenario.

Thanks again!

Comment 6 Villy Kruse 2019-03-15 06:48:30 UTC
(In reply to Kostya Vasilyev from comment #1)
> I *think* actual installation (of kernel files into /boot) is handled by
> 
> /usr/lib/kernel/install.d/20-grub.install
> 
> which belongs to grub2-common.
> 
> The funny thing is that kernel-core package already contains all the
> necessary files in the right location (under /boot) so when grub2 is not
> installed, these files are probably getting removed...
> 
> rpm -ql kernel-core-5.0.1  | grep boot
> /boot/.vmlinuz-5.0.1-350.vanilla.knurd.1.fc29.x86_64.hmac
> /boot/System.map-5.0.1-350.vanilla.knurd.1.fc29.x86_64
> /boot/config-5.0.1-350.vanilla.knurd.1.fc29.x86_64
> /boot/initramfs-5.0.1-350.vanilla.knurd.1.fc29.x86_64.img
> /boot/vmlinuz-5.0.1-350.vanilla.knurd.1.fc29.x86_64
> 
> 
> Any way for kernel install scripts to just keep them in place (when grub2 is
> not installed and there is no 20-grub.install)?

These are "ghost" files.  The script is copying them in from
/usr/lib/modules/$(uname -r)/vmlinuz and equivalent for System.map and config.


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