KIWI - Appliance Builder Next Generation EL8 fork
Go to file
Andrew Lukoshko 881bb46fcb Fix BLS entries not corrected before grub2-mkconfig on RHEL 8
On RHEL 8-based distributions, grub2-mkconfig uses the
grub.d/10_linux_bls script which reads Boot Loader Specification
(BLS) entries from /boot/loader/entries/ and inlines them as
menuentry blocks directly in grub.cfg. This is different from
RHEL 9+ where grub.d/10_linux uses the blscfg command to load
BLS entries at boot time.

When kiwi builds a disk image, kernel packages are installed into
a chroot (the image root). The BLS entries created by the kernel
scriptlets at that point contain:

  - linux/initrd paths prefixed with the build host's image root
    path (e.g. /var/tmp/kiwi-build/build/image-root/boot/vmlinuz-...)
  - an options line from the build host's /proc/cmdline

Previously, kiwi corrected these BLS entries only *after* running
grub2-mkconfig. On RHEL 9+ this works fine because grub.cfg just
contains blscfg and reads the (now corrected) BLS entries at boot
time. On RHEL 8, however, grub2-mkconfig had already inlined the
*uncorrected* BLS entries into grub.cfg, resulting in wrong kernel
paths and boot options that caused the image to fail to boot.

This commit adds calls to _fix_grub_loader_entries_boot_cmdline()
and _fix_grub_loader_entries_linux_and_initrd_paths() before
grub2-mkconfig, so that BLS entries are corrected before they get
inlined into grub.cfg. The existing post-grub2-mkconfig calls are
retained because grub2-mkconfig itself may re-create or modify BLS
entries on some distributions.

Fixes boot failure on AlmaLinux 8 ppc64le GenericCloud images built
with kiwi where grub.cfg contained build-root paths like:
  linux /var/tmp/kiwi-build/build/image-root/boot/vmlinuz-4.18.0-...
instead of:
  linux /vmlinuz-4.18.0-...
2026-03-13 01:12:40 +01:00
.github Use xdist on the CI to speed up the test runs 2023-12-28 13:52:32 +01:00
build-tests Fixed grub terminal setup 2024-01-08 18:02:27 +01:00
doc Bump version: 9.25.21 → 9.25.22 2024-01-09 15:19:30 +01:00
dracut/modules.d Fix overwrite of kiwi_oemunattended 2024-01-04 13:05:39 +01:00
helper Delete ppc:fedora from testing report 2023-01-04 20:56:25 +01:00
kiwi Fix BLS entries not corrected before grub2-mkconfig on RHEL 8 2026-03-13 01:12:40 +01:00
package package: Drop unused xorriso dep on dracut-kiwi-live subpackage 2023-12-13 15:31:56 -05:00
test Fixed missing selinux context setup for live ISOs 2026-03-12 22:33:57 +01:00
tools Partially revert dcounter.c flaw report 2020-11-18 13:33:09 +01:00
.bumpversion.cfg Bump version: 9.25.21 → 9.25.22 2024-01-09 15:19:30 +01:00
.codacy.yml Update codacy configuration file 2020-11-17 15:55:53 +01:00
.gitattributes Set ident export-subst git attribute on version.py 2016-04-21 16:21:00 +02:00
.gitignore Add dracut-kiwi-verity dracut module package 2023-03-16 11:09:57 +01:00
.gitlab-ci-disabled.yml Disable gitlab CI pipeline 2022-11-12 21:52:38 +01:00
.mailmap Update mailmap 2023-11-21 20:46:03 +01:00
.obs_test Update arm integration test 2018-05-08 16:31:57 +02:00
.obs_test_status Fixed make obs_test_status 2018-07-31 09:00:28 +02:00
.virtualenv.dev-requirements.txt Fixed doc search field 2023-10-16 15:26:25 +02:00
.virtualenv.requirements.txt Support TOML markup 2023-09-13 12:07:24 +02:00
kiwi.yml Add check_efi_fat_image_has_correct_size 2023-11-08 09:22:16 +01:00
LICENSE Fixed GPL license text to match headers and spec 2017-04-28 12:13:30 +02:00
Makefile Fixed call of tox for xdist 2023-07-25 13:38:50 +02:00
MANIFEST.in Fixed MANIFEST 2021-09-15 12:04:43 +02:00
README.rst Added code style batch to landing page 2022-11-29 17:10:37 +01:00
setup.cfg no_implicit_optional = False 2022-11-08 15:27:10 +01:00
setup.py Don't make toml a requirement 2023-11-09 09:04:44 +01:00
tox.ini Fix tox.ini 2024-01-04 13:16:26 +01:00

KIWI - Next Generation
======================

.. |GitHub Action Code Style| image:: https://github.com/OSInside/kiwi/actions/workflows/ci-code-style.yml/badge.svg
   :target: https://github.com/OSInside/kiwi/actions
.. |GitHub Action Config Functions| image:: https://github.com/OSInside/kiwi/actions/workflows/ci-config-functions.yml/badge.svg
   :target: https://github.com/OSInside/kiwi/actions
.. |GitHub Action Documentation| image:: https://github.com/OSInside/kiwi/actions/workflows/ci-documentation.yml/badge.svg
   :target: https://github.com/OSInside/kiwi/actions
.. |GitHub Action Publish Pages| image:: https://github.com/OSInside/kiwi/actions/workflows/ci-publish-pages.yml/badge.svg
   :target: https://github.com/OSInside/kiwi/actions
.. |GitHub Action Publish PyPi| image:: https://github.com/OSInside/kiwi/actions/workflows/ci-publish-to-pypi.yml/badge.svg
   :target: https://github.com/OSInside/kiwi/actions
.. |GitHub Action Unit Types| image:: https://github.com/OSInside/kiwi/actions/workflows/ci-units-types.yml/badge.svg
   :target: https://github.com/OSInside/kiwi/actions
.. |Health| image:: https://app.codacy.com/project/badge/Grade/228f7e8cd15d448688a590c272ec3789
   :target: https://www.codacy.com/gh/OSInside/kiwi/dashboard?utm_source=github.com&utm_medium=referral&utm_content=OSInside/kiwi&utm_campaign=Badge_Grade
.. |Doc| replace:: `Documentation <https://osinside.github.io/kiwi/>`__
.. |Installation| replace:: `Installation <https://osinside.github.io/kiwi/installation.html>`__
.. |Contributing| replace:: `Contributing <https://osinside.github.io/kiwi/contributing.html>`__
.. |Donate| image:: https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif
   :target: https://www.paypal.me/SchaeferMarcus

|GitHub Action Code Style| |GitHub Action Config Functions| |GitHub Action Documentation| |GitHub Action Publish Pages| |GitHub Action Publish PyPi| |GitHub Action Unit Types| |Health|

**KIWI, the OS image and appliance builder.**

* |Installation|

* |Contributing|

* |Doc|

We'll donate it for good luck so's you're sure to come back :)

|Donate|