From 54d9d1d20bfec4240d9b014bd93942381d04a203 Mon Sep 17 00:00:00 2001 From: Markus Hilger Date: Sun, 1 Nov 2026 18:50:46 +0100 Subject: [PATCH] Drop the boot entries kernel scriptlets write during imgutil build The kernel package writes a boot loader entry inside the build chroot. Its linux and initrd paths point into the scratch directory of the server (grub2-mkrelpath sees the bind mount) and its options are the kernel command line of the server. Diskless boot never reads it, but after installing to disk it sits next to the entry post.sh writes on the installed system, so grub may pick the broken one. Remove the entries when building, post.sh writes the right one when installing. --- imgutil/imgutil | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/imgutil/imgutil b/imgutil/imgutil index 0bf73230..f777f00a 100644 --- a/imgutil/imgutil +++ b/imgutil/imgutil @@ -924,6 +924,10 @@ class ElHandler(OsHandler): subprocess.check_call(['yum'] + self.yumargs) else: subprocess.check_call(['yum', '-y'] + self.yumargs) + # boot entries written in the chroot carry the kernel command line of + # the build system, and installing to disk writes its own entries + for loadent in glob.glob(os.path.join(self.targpath, 'boot/loader/entries/*.conf')): + os.remove(loadent) if self.selinux: # keep SELinux enabled, build_root labels the tree afterwards seconfigpath = os.path.join(self.targpath, 'etc/selinux/config')