From f33bea6ccb0b07e98e7cfe135c9718135d7ea069 Mon Sep 17 00:00:00 2001 From: Louis Abel Date: Mon, 27 Mar 2023 20:13:21 -0700 Subject: [PATCH] Add boot file lists for potential modifications --- iso/empanadas/empanadas/util/iso_utils.py | 28 +++++++++++++++++++---- iso/empanadas/empanadas/util/shared.py | 12 ++++++++++ 2 files changed, 36 insertions(+), 4 deletions(-) diff --git a/iso/empanadas/empanadas/util/iso_utils.py b/iso/empanadas/empanadas/util/iso_utils.py index 96db632..f9422a4 100644 --- a/iso/empanadas/empanadas/util/iso_utils.py +++ b/iso/empanadas/empanadas/util/iso_utils.py @@ -1157,12 +1157,26 @@ class IsoBuild: xorrs = f'{lorax_base_dir}/xorriso-{iso}-{arch}.txt' - # Generate exclusion list/dict + # Generate exclusion list/dict from boot.iso manifest boot_manifest = f'{lorax_base_dir}/lorax/images/boot.iso.manifest' + # Boot configs and images that may change + # It's unlikely these will be changed in empanadas, they're used as is + # and it works fine. This is a carry over from a recent pungi commit, + # based on an issue I had filed. The above was the original part, the + # below is a pungi "buildinstall" thing that we don't do, but may + # include as a feature if it ever happens. + updatable_files = set(ArchCheck.boot_configs, ArchCheck.boot_images, ['.discinfo']) + ignores = set() + updatables = set() try: with open(boot_manifest) as i: - ignores = set(line.lstrip("/").rstrip("\n") for line in i) + for line in i: + path = line.lstrip("/").rstrip("\n") + if path in updatable_files: + updatables.add(path) + else: + ignores.add(path) except Exception as e: self.log.error(Color.FAIL + 'File was likely not found.') raise SystemExit(e) @@ -1171,7 +1185,8 @@ class IsoBuild: grafts, xorrs, files, - exclude=ignores + exclude=ignores, + update=updatables ) if self.iso_map['xorrisofs']: @@ -1211,12 +1226,17 @@ class IsoBuild: return result - def _write_grafts(self, filepath, xorrspath, u, exclude=None): + def _write_grafts(self, filepath, xorrspath, u, exclude=None, update=None): """ Write out the graft points """ seen = set() + # There are files that are on the exclude list typically. exclude = exclude or [] + # There is a chance files may get updated before being placed in a + # variant ISO - it's rare though. most that will be different is + # .discinfo + update = update or [] result = {} for zl in sorted(u, reverse=True): dirn = os.path.dirname(zl) diff --git a/iso/empanadas/empanadas/util/shared.py b/iso/empanadas/empanadas/util/shared.py index aef01a9..9aeeb8e 100644 --- a/iso/empanadas/empanadas/util/shared.py +++ b/iso/empanadas/empanadas/util/shared.py @@ -40,6 +40,18 @@ class ArchCheck: ] } + # These are files that can potentially change on an image. + boot_configs = [ + "isolinux/isolinux.cfg", + "etc/yaboot.conf", + "ppc/ppc64/yaboot.conf", + "EFI/BOOT/BOOTX64.conf", + "EFI/BOOT/grub.cfg" + ] + boot_images = [ + "images/efiboot.img" + ] + class Shared: """ Quick utilities that may be commonly used