From 1d8d4f3077090b520f615652ca11af98b95c2b27 Mon Sep 17 00:00:00 2001 From: Markus Hilger Date: Sun, 1 Nov 2026 15:02:43 +0100 Subject: [PATCH] Point boot entries at the kernel on the installed boot filesystem image2disk rewrote root= in the boot loader entries but kept their linux and initrd paths. Those come from where the image was built: in a diskless image from imgutil they carry the scratch directory of the server (grub2-mkrelpath sees its bind mount), and a /boot/ path does not match the separate /boot filesystem image2disk creates for such images. grub then fails with "you need to load the kernel". Make the paths relative to the boot filesystem of the target. --- .../profiles/default/scripts/image2disk.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/confluent_osdeploy/el9-diskless/profiles/default/scripts/image2disk.py b/confluent_osdeploy/el9-diskless/profiles/default/scripts/image2disk.py index cdbad39b..a0e22247 100644 --- a/confluent_osdeploy/el9-diskless/profiles/default/scripts/image2disk.py +++ b/confluent_osdeploy/el9-diskless/profiles/default/scripts/image2disk.py @@ -205,6 +205,19 @@ def fixup(rootdir, vols): with open(loadent, 'w') as loadentout: for cfgline in currentry: cfgparts = cfgline.split() + if cfgparts and cfgparts[0] in ('linux', 'initrd'): + # paths are relative to the boot filesystem of the target, + # not of the system that built the image + newcfgparts = [cfgparts[0]] + for cfgpart in cfgparts[1:]: + if cfgpart.startswith('/'): + if '/boot/' in cfgpart: + cfgpart = cfgpart[cfgpart.index('/boot/') + 5:] + if '/boot' not in devbymount: + cfgpart = '/boot' + cfgpart + newcfgparts.append(cfgpart) + loadentout.write(' '.join(newcfgparts) + '\n') + continue if not cfgparts or cfgparts[0] != 'options': loadentout.write(cfgline + '\n') continue