New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
kernel-install doesn't work for kernel tree-produced rpms #29568
Comments
Also filed https://bugzilla.redhat.com/show_bug.cgi?id=2244131 for this to track it downstream |
I've submitted https://lore.kernel.org/linux-kbuild/20231103-rpmpost-v1-1-9c18afab47f4@meta.com/ to simplify the |
The %post currently does a shuffling dance before calling installkernel. This isn't actually necessary afaict, and the current implementation ends up triggering downstream issues such as systemd/systemd#29568 This commit simplifies the logic to remove the shuffling. For reference, the original logic was added in commit 3c9c7a1("rpm-pkg: add %post section to create initramfs and grub hooks"). Signed-off-by: Davide Cavalca <dcavalca@meta.com>
A new installkernel application is now included in systemd-udev package and it has been improved to allow simplifications. For the new installkernel application, as Davide says: <<The %post currently does a shuffling dance before calling installkernel. This isn't actually necessary afaict, and the current implementation ends up triggering downstream issues such as systemd/systemd#29568 This commit simplifies the logic to remove the shuffling. For reference, the original logic was added in commit 3c9c7a1("rpm-pkg: add %post section to create initramfs and grub hooks").>> But we need to keep the old behavior as well, because the old installkernel application from grubby package, does not allow this simplification and we need to be backward compatible to avoid issues with the different packages. So the easiest solution is to check the package that provides the installkernel application, and simplify (and fix for this application at the same time), only if the package is systemd-udev. cc: stable@vger.kernel.org Co-Developed-by: Davide Cavalca <dcavalca@meta.com> Signed-off-by: Jose Ignacio Tornos Martinez <jtornosm@redhat.com>
The new installkernel application that is now included in systemd-udev package allows installation although destination files are already present in the boot directory of the kernel package, but is failing with the implemented workaround for the old installkernel application from grubby package. For the new installkernel application, as Davide says: <<The %post currently does a shuffling dance before calling installkernel. This isn't actually necessary afaict, and the current implementation ends up triggering downstream issues such as systemd/systemd#29568 This commit simplifies the logic to remove the shuffling. For reference, the original logic was added in commit 3c9c7a1("rpm-pkg: add %post section to create initramfs and grub hooks").>> But we need to keep the old behavior as well, because the old installkernel application from grubby package, does not allow this simplification and we need to be backward compatible to avoid issues with the different packages. Mimic Fedora shipping process and store vmlinuz, config amd System.map in the module directory instead of the boot directory. In this way, we will avoid the commented problem for all the cases, because the new destination files are not going to exist in the boot directory of the kernel package. Replace installkernel tool with kernel-install tool, because the latter is more complete. Suitable manual actions are added as a default if tool is not present (unusual). Special installation case for discontinued architecture ia64 has been removed. cc: stable@vger.kernel.org Co-Developed-by: Davide Cavalca <dcavalca@meta.com> Signed-off-by: Jose Ignacio Tornos Martinez <jtornosm@redhat.com>
The new installkernel application that is now included in systemd-udev package allows installation although destination files are already present in the boot directory of the kernel package, but is failing with the implemented workaround for the old installkernel application from grubby package. For the new installkernel application, as Davide says: <<The %post currently does a shuffling dance before calling installkernel. This isn't actually necessary afaict, and the current implementation ends up triggering downstream issues such as systemd/systemd#29568 This commit simplifies the logic to remove the shuffling. For reference, the original logic was added in commit 3c9c7a1("rpm-pkg: add %post section to create initramfs and grub hooks").>> But we need to keep the old behavior as well, because the old installkernel application from grubby package, does not allow this simplification and we need to be backward compatible to avoid issues with the different packages. Mimic Fedora shipping process and store vmlinuz, config amd System.map in the module directory instead of the boot directory. In this way, we will avoid the commented problem for all the cases, because the new destination files are not going to exist in the boot directory of the kernel package. Replace installkernel tool with kernel-install tool, because the latter is more complete. Suitable manual actions are added as a default if tool is not present (unusual). cc: stable@vger.kernel.org Co-Developed-by: Davide Cavalca <dcavalca@meta.com> Signed-off-by: Jose Ignacio Tornos Martinez <jtornosm@redhat.com>
https://bugzilla.redhat.com/show_bug.cgi?id=2244131#c1 has a longer debugging session. I'll paste just the gist here: $ /sbin/installkernel -v 6.7.0+ /boot/.vmlinuz-6.7.0+-rpm /boot/.System.map-6.7.0+-rpm
...
kernel version (6.7.0+) set via command line.
kernel image file (/boot/.vmlinuz-6.7.0+-rpm) set via command line.
...
Plugin arguments: add 6.7.0+ /boot/fb878d0057c640258a53deec11a1c2f7/6.7.0+ /boot/.vmlinuz-6.7.0+-rpm
...
About to execute /usr/lib/kernel/install.d/10-devicetree.install add 6.7.0+ /boot/fb878d0057c640258a53deec11a1c2f7/6.7.0+ /boot/.vmlinuz-6.7.0+-rpm
...
About to execute /usr/lib/kernel/install.d/20-grub.install add 6.7.0+ /boot/fb878d0057c640258a53deec11a1c2f7/6.7.0+ /boot/.vmlinuz-6.7.0+-rpm
...
grub2-mkrelpath: error: failed to get canonical path of `/boot/vmlinuz-6.7.0+'.
dirname: missing operand
Try 'dirname --help' for more information.
/usr/lib/kernel/install.d/20-grub.install succeeded.
About to execute /usr/lib/kernel/install.d/50-depmod.install add 6.7.0+ /boot/fb878d0057c640258a53deec11a1c2f7/6.7.0+ /boot/.vmlinuz-6.7.0+-rpm
... There is no /boot/vmlinuz-6.7.0+, there's only /boot/.vmlinuz-6.7.0+-rpm. |
@keszybz We've already figured out this regression was caused by your change in grubby to drop the /sbin/installkernel script: https://src.fedoraproject.org/rpms/grubby/c/aa9b1b454fd0c792226cefb65d744fadfaa8acda?branch=rawhide. kernel-install isn't a drop-in replacement for the grubby script since the grubby script also copied the kernel to /boot which kernel-install doesn't do unconditionally. Regardless, this is not a bug in kernel-install though. |
Yes. |
The new installkernel application that is now included in systemd-udev package allows installation although destination files are already present in the boot directory of the kernel package, but is failing with the implemented workaround for the old installkernel application from grubby package. For the new installkernel application, as Davide says: <<The %post currently does a shuffling dance before calling installkernel. This isn't actually necessary afaict, and the current implementation ends up triggering downstream issues such as systemd/systemd#29568 This commit simplifies the logic to remove the shuffling. For reference, the original logic was added in commit 3c9c7a1("rpm-pkg: add %post section to create initramfs and grub hooks").>> But we need to keep the old behavior as well, because the old installkernel application from grubby package, does not allow this simplification and we need to be backward compatible to avoid issues with the different packages. Mimic Fedora shipping process and store vmlinuz, config amd System.map in the module directory instead of the boot directory. In this way, we will avoid the commented problem for all the cases, because the new destination files are not going to exist in the boot directory of the kernel package. Replace installkernel tool with kernel-install tool, because the latter is more complete. Besides, after installkernel tool execution, check to complete if suitable (same release and build) vmlinuz, System.map and config files are present in /boot directory, and if necessary, copy manually for install operation or remmove manually for remove operation. Tested with Fedora 38, Fedora 39, RHEL 9, Oracle Linux 9.3, openSUSE Tumbleweed and openMandrive ROME, using dnf/zypper and rpm tools. cc: stable@vger.kernel.org Co-Developed-by: Davide Cavalca <dcavalca@meta.com> Signed-off-by: Jose Ignacio Tornos Martinez <jtornosm@redhat.com>
A new installkernel application is now included in systemd-udev package and it has been improved to allow simplifications. For the new installkernel application, as Davide says: <<The %post currently does a shuffling dance before calling installkernel. This isn't actually necessary afaict, and the current implementation ends up triggering downstream issues such as systemd/systemd#29568 This commit simplifies the logic to remove the shuffling. For reference, the original logic was added in commit 3c9c7a1("rpm-pkg: add %post section to create initramfs and grub hooks").>> But we need to keep the old behavior as well, because the old installkernel application from grubby package, does not allow this simplification and we need to be backward compatible to avoid issues with the different packages. So the easiest solution is to check the package that provides the installkernel application, and simplify (and fix for this application at the same time), only if the package is systemd-udev. cc: stable@vger.kernel.org Co-Developed-by: Davide Cavalca <dcavalca@meta.com> Signed-off-by: Jose Ignacio Tornos Martinez <jtornosm@redhat.com>
The new installkernel application that is now included in systemd-udev package allows installation although destination files are already present in the boot directory of the kernel package, but is failing with the implemented workaround for the old installkernel application from grubby package. For the new installkernel application, as Davide says: <<The %post currently does a shuffling dance before calling installkernel. This isn't actually necessary afaict, and the current implementation ends up triggering downstream issues such as systemd/systemd#29568 This commit simplifies the logic to remove the shuffling. For reference, the original logic was added in commit 3c9c7a1("rpm-pkg: add %post section to create initramfs and grub hooks").>> But we need to keep the old behavior as well, because the old installkernel application from grubby package, does not allow this simplification and we need to be backward compatible to avoid issues with the different packages. Mimic Fedora shipping process and store vmlinuz, config amd System.map in the module directory instead of the boot directory. In this way, we will avoid the commented problem for all the cases, because the new destination files are not going to exist in the boot directory of the kernel package. Replace installkernel tool with kernel-install tool, because the latter is more complete. Besides, after installkernel tool execution, check to complete if the correct package files vmlinuz, System.map and config files are present in /boot directory, and if necessary, copy manually for install operation. In this way, take into account if files were not previously copied from /usr/lib/kernel/install.d/* scripts and if the suitable files for the requested package are present (it could be others if the rpm files were replace with a new pacakge with the same release and a different build). Tested with Fedora 38, Fedora 39, RHEL 9, Oracle Linux 9.3, openSUSE Tumbleweed and openMandrive ROME, using dnf/zypper and rpm tools. cc: stable@vger.kernel.org Co-Developed-by: Davide Cavalca <dcavalca@meta.com> Signed-off-by: Jose Ignacio Tornos Martinez <jtornosm@redhat.com> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
The new installkernel application that is now included in systemd-udev package allows installation although destination files are already present in the boot directory of the kernel package, but is failing with the implemented workaround for the old installkernel application from grubby package. For the new installkernel application, as Davide says: <<The %post currently does a shuffling dance before calling installkernel. This isn't actually necessary afaict, and the current implementation ends up triggering downstream issues such as systemd/systemd#29568 This commit simplifies the logic to remove the shuffling. For reference, the original logic was added in commit 3c9c7a1("rpm-pkg: add %post section to create initramfs and grub hooks").>> But we need to keep the old behavior as well, because the old installkernel application from grubby package, does not allow this simplification and we need to be backward compatible to avoid issues with the different packages. Mimic Fedora shipping process and store vmlinuz, config amd System.map in the module directory instead of the boot directory. In this way, we will avoid the commented problem for all the cases, because the new destination files are not going to exist in the boot directory of the kernel package. Replace installkernel tool with kernel-install tool, because the latter is more complete. Besides, after installkernel tool execution, check to complete if the correct package files vmlinuz, System.map and config files are present in /boot directory, and if necessary, copy manually for install operation. In this way, take into account if files were not previously copied from /usr/lib/kernel/install.d/* scripts and if the suitable files for the requested package are present (it could be others if the rpm files were replace with a new pacakge with the same release and a different build). Tested with Fedora 38, Fedora 39, RHEL 9, Oracle Linux 9.3, openSUSE Tumbleweed and openMandrive ROME, using dnf/zypper and rpm tools. cc: stable@vger.kernel.org Co-Developed-by: Davide Cavalca <dcavalca@meta.com> Signed-off-by: Jose Ignacio Tornos Martinez <jtornosm@redhat.com> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
A new installkernel application is now included in systemd-udev package and it has been improved to allow simplifications. For the new installkernel application, as Davide says: <<The %post currently does a shuffling dance before calling installkernel. This isn't actually necessary afaict, and the current implementation ends up triggering downstream issues such as systemd/systemd#29568 This commit simplifies the logic to remove the shuffling. For reference, the original logic was added in commit 3c9c7a1("rpm-pkg: add %post section to create initramfs and grub hooks").>> But we need to keep the old behavior as well, because the old installkernel application from grubby package, does not allow this simplification and we need to be backward compatible to avoid issues with the different packages. So the easiest solution is to check the package that provides the installkernel application, and simplify (and fix for this application at the same time), only if the package is systemd-udev. cc: stable@vger.kernel.org Co-Developed-by: Davide Cavalca <dcavalca@meta.com> Signed-off-by: Jose Ignacio Tornos Martinez <jtornosm@redhat.com>
systemd version the issue has been seen with
254 (254.5-2.fc40)
Used distribution
Fedora Rawhide
Linux kernel version used
6.6.0-0.rc5.40.fc40.aarch64
CPU architectures issue was seen on
aarch64
Component
kernel-install
Expected behaviour you didn't see
/boot/vmlinuz-$kver
exists after the kernel RPM is installedUnexpected behaviour you saw
/boot/vmlinuz-$kver
does not exist after the kernel RPM is installedSteps to reproduce the problem
On a Fedora Rawhide (or Fedora ELN) system:
What's happening here is that the kernel RPM spec includes this logic: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=3c9c7a14b627 which moves vmlinuz away before calling installkernel. This then leads to errors in the output (coming from
/usr/lib/kernel/install.d/20-grub.install
I believe), but these don't interrupt the install:and at the end of it,
/boot/vmlinuz-6.6.0_rc5_00234_g8cb1f10d8c4b_dirty
is missing. We originally discovered this on Fedora ELN, but I've verified it repros on Rawhide as well (and likely any other distro with 254). I suspect this is a side effect of the kernel-install rewrite in C.Additional program output to the terminal or log subsystem illustrating the issue
No response
The text was updated successfully, but these errors were encountered: