From cbfb556f7c2a3afc1d9428e127ffd9108931c0bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lubom=C3=ADr=20Sedl=C3=A1=C5=99?= Date: Thu, 11 Oct 2018 15:24:09 +0200 Subject: [PATCH] extra-iso: Use correct efiboot.img file MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If the file is generated, Pungi will modify it at the end of buildinstall phase. We need to point ISO creation to the modified file, otherwise the checksum in .treeinfo will be incorrect. It's sufficient to just update the graft point to correct file, copying is not needed. JIRA: COMPOSE-2976 Signed-off-by: Lubomír Sedlář --- pungi/phases/extra_isos.py | 8 ++++++++ tests/test_extra_isos_phase.py | 5 +++++ 2 files changed, 13 insertions(+) diff --git a/pungi/phases/extra_isos.py b/pungi/phases/extra_isos.py index 6a688bab..8462b517 100644 --- a/pungi/phases/extra_isos.py +++ b/pungi/phases/extra_isos.py @@ -155,6 +155,14 @@ def get_iso_contents(compose, variant, arch, include_variants, filename, bootabl copy_boot_images(buildinstall_dir, iso_dir) files = iso.get_graft_points([buildinstall_dir, iso_dir]) + # We need to point efiboot.img to compose/ tree, because it was + # modified in buildinstall phase and the file in work/ has different + # checksum to what is in the .treeinfo. + if "images/efiboot.img" in files: + files["images/efiboot.img"] = os.path.join( + compose.paths.compose.os_tree(arch, variant), "images/efiboot.img" + ) + variants = [variant.uid] + include_variants for variant_uid in variants: var = compose.all_variants[variant_uid] diff --git a/tests/test_extra_isos_phase.py b/tests/test_extra_isos_phase.py index e17202c1..7187a708 100644 --- a/tests/test_extra_isos_phase.py +++ b/tests/test_extra_isos_phase.py @@ -493,6 +493,7 @@ class GetIsoContentsTest(helpers.PungiTestCase): iso_dir = os.path.join(self.topdir, 'work/x86_64/iso/my.iso') helpers.touch(os.path.join(bi_dir, 'isolinux/isolinux.bin')) helpers.touch(os.path.join(bi_dir, 'images/boot.img')) + helpers.touch(os.path.join(bi_dir, 'images/efiboot.img')) gp = { 'compose/Client/x86_64/os/Packages': {'f/foo.rpm': '/mnt/f/foo.rpm'}, @@ -506,6 +507,7 @@ class GetIsoContentsTest(helpers.PungiTestCase): bi_gp = { 'isolinux/isolinux.bin': os.path.join(iso_dir, 'isolinux/isolinux.bin'), 'images/boot.img': os.path.join(iso_dir, 'images/boot.img'), + 'images/efiboot.img': os.path.join(iso_dir, 'images/efiboot.img'), } ggp.side_effect = lambda x: gp[x[0][len(self.topdir) + 1:]] if len(x) == 1 else bi_gp @@ -534,6 +536,9 @@ class GetIsoContentsTest(helpers.PungiTestCase): 'Server/repodata/repomd.xml': '/mnt/repodata/repomd.xml', 'isolinux/isolinux.bin': os.path.join(iso_dir, 'isolinux/isolinux.bin'), 'images/boot.img': os.path.join(iso_dir, 'images/boot.img'), + 'images/efiboot.img': os.path.join( + self.topdir, 'compose', self.variant.uid, 'x86_64/os/images/efiboot.img', + ), } self.assertItemsEqual(