From 9dd58026988d7314045fdea68b5562377074f441 Mon Sep 17 00:00:00 2001 From: Markus Hilger Date: Sat, 5 Sep 2026 02:12:18 +0200 Subject: [PATCH] Fill in the spots the SUSE 16 work missed - the aarch64 osdeploy spec builds the stateful suse16 addons but its diskless loop was never extended, so the aarch64 rpm shipped suse16 without suse16-diskless and a packed image got a dangling addons.cpio. - imgutil's builddeb keeps its own copy of the directory list that confluent_imgutil.spec.tmpl has, and it had learned about neither suse16 nor el10. - gather_bootloader gained a /usr/share/efi fallback for shim on both architectures but only for x86_64 on grub, so an aarch64 root found a shim and then died copying grub. Finally, rewriting repos.d file by file rather than copying the tree meant a subdirectory or a file that is not valid UTF-8 aborted the build before any package was installed, which also regressed SUSE 15. Pass anything that is not a plain text repo definition through untouched and restore the modes on the ones that are rewritten. --- .../confluent_osdeploy-aarch64.spec.tmpl | 2 +- imgutil/builddeb | 2 +- imgutil/imgutil | 26 +++++++++++++++---- 3 files changed, 23 insertions(+), 7 deletions(-) diff --git a/confluent_osdeploy/confluent_osdeploy-aarch64.spec.tmpl b/confluent_osdeploy/confluent_osdeploy-aarch64.spec.tmpl index df07dd23..17f572cd 100644 --- a/confluent_osdeploy/confluent_osdeploy-aarch64.spec.tmpl +++ b/confluent_osdeploy/confluent_osdeploy-aarch64.spec.tmpl @@ -47,7 +47,7 @@ for os in rhvh4 el7 genesis el8 suse15 suse16 debian debian13 ubuntu20.04 ubuntu mv ../addons.cpio . cd .. done -for os in el7 el8 suse15 el9 el10 ubuntu20.04 ubuntu22.04 ubuntu24.04 ubuntu26.04; do +for os in el7 el8 suse15 suse16 el9 el10 ubuntu20.04 ubuntu22.04 ubuntu24.04 ubuntu26.04; do mkdir ${os}disklessout cd ${os}disklessout if [ -d ../${os}bin ]; then diff --git a/imgutil/builddeb b/imgutil/builddeb index 930b22ed..64da5a2d 100755 --- a/imgutil/builddeb +++ b/imgutil/builddeb @@ -13,7 +13,7 @@ mkdir -p deb/confluent_imgutil_$VERSION/opt/confluent/lib/imgutil mkdir -p deb/confluent_imgutil_$VERSION/opt/confluent/bin mv imgutil deb/confluent_imgutil_$VERSION/opt/confluent/bin/ chmod a+x deb/confluent_imgutil_$VERSION/opt/confluent/bin/imgutil -mv ubuntu* suse15 el7 el9 el8 deb/confluent_imgutil_$VERSION/opt/confluent/lib/imgutil/ +mv ubuntu* suse15 suse16 el7 el9 el10 el8 deb/confluent_imgutil_$VERSION/opt/confluent/lib/imgutil/ mkdir -p deb/confluent_imgutil_$VERSION/opt/confluent/share/licenses/confluent_imgutil cp LICENSE deb/confluent_imgutil_$VERSION/opt/confluent/share/licenses/confluent_imgutil sed -e 's/#VERSION#/'$VERSION/ control.tmpl > deb/confluent_imgutil_$VERSION/DEBIAN/control diff --git a/imgutil/imgutil b/imgutil/imgutil index c03992a7..7f0e0506 100644 --- a/imgutil/imgutil +++ b/imgutil/imgutil @@ -634,12 +634,22 @@ class SuseHandler(OsHandler): targrepos = os.path.join(targzypp, 'repos.d') mkdirp(targrepos) for repofile in glob.glob('/etc/zypp/repos.d/*'): - with open(repofile) as repoin: - cfg = [line for line in repoin.read().splitlines() - if not line.startswith('service=')] - with open(os.path.join( - targrepos, os.path.basename(repofile)), 'w') as repoout: + targrepo = os.path.join(targrepos, os.path.basename(repofile)) + # Anything that is not a plain text repo definition is passed + # through as-is rather than rewritten + if os.path.isdir(repofile): + shutil.copytree(repofile, targrepo) + continue + try: + with open(repofile) as repoin: + cfg = [line for line in repoin.read().splitlines() + if not line.startswith('service=')] + except (IsADirectoryError, UnicodeDecodeError): + shutil.copy2(repofile, targrepo) + continue + with open(targrepo, 'w') as repoout: repoout.write('\n'.join(cfg) + '\n') + shutil.copystat(repofile, targrepo) idx = 1 for source in self.sources: if not source: @@ -1813,6 +1823,12 @@ def gather_bootloader(outdir, rootpath='/'): grubbin = os.path.join(rootpath, 'usr/lib/grub/arm64-efi/monolithic/grubaa64.efi') if not os.path.exists(grubbin): grubbin = os.path.join(rootpath, 'usr/share/efi/x86_64/grub.efi') + if not os.path.exists(grubbin): + # same relocation as the shim above, on the other architecture + aa64grub = os.path.join(rootpath, 'usr/share/efi/aarch64/grub.efi') + if os.path.exists(aa64grub): + grubbin = aa64grub + grubdestfilename = 'grubaa64.efi' if not os.path.exists(grubbin): grubs = os.path.join(rootpath, 'boot/efi/EFI/*/grubx64.efi') grubs = glob.glob(grubs)