diff mbox series

[meta-yocto-bsp] meta-yocto-bsp: oeqa/selftest/systemd_boot: update for standalone wic

Message ID 20260204144600.514629-1-twoerner@gmail.com (mailing list archive)
State New
Headers show
Series [meta-yocto-bsp] meta-yocto-bsp: oeqa/selftest/systemd_boot: update for standalone wic | expand

Commit Message

Trevor Woerner Feb. 4, 2026, 2:46 p.m. UTC
The systemd_boot.Systemdboot.test_efi_systemdboot_images_can_be_built
oe-selftest invokes the wic utility. If wic is removed from oe-core,
how it is invoked would need to be updated. However, updating how it is
invoked will also succeed even if wic continues to be part of oe-core;
it is simply a more elaborate way to invoke wic which works in either
case.

Signed-off-by: Trevor Woerner <twoerner@gmail.com>
---
 meta-yocto-bsp/lib/oeqa/selftest/cases/systemd_boot.py | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
diff mbox series

Patch

diff --git a/meta-yocto-bsp/lib/oeqa/selftest/cases/systemd_boot.py b/meta-yocto-bsp/lib/oeqa/selftest/cases/systemd_boot.py
index 961d4ea31d0c..d727432d311f 100644
--- a/meta-yocto-bsp/lib/oeqa/selftest/cases/systemd_boot.py
+++ b/meta-yocto-bsp/lib/oeqa/selftest/cases/systemd_boot.py
@@ -60,10 +60,12 @@  class Systemdboot(OESelftestTestCase):
         if os.path.isfile(imagebootfile):
             runCmd('rm -f %s' % imagebootfile)
 
-        sysroot = get_bb_var('RECIPE_SYSROOT_NATIVE', 'wic-tools')
-
-        runCmd('wic cp %s:1/EFI/BOOT/bootx64.efi %s -n %s' % (systemdbootimage,
-                                                           imagebootfile, sysroot))
+        oldpath = os.environ['PATH']
+        os.environ['PATH'] = get_bb_var('PATH', 'wic-tools') + ':' + os.environ['PATH']
+        envfile = os.path.join(get_bb_var('STAGING_DIR', image), 'genericx86-64', 'imgdata', image) + '.env'
+        runCmd('wic cp %s:1/EFI/BOOT/bootx64.efi %s --vars %s' % (systemdbootimage,
+                                                                  imagebootfile, envfile))
+        os.environ['PATH'] = oldpath
 
         found = os.path.isfile(imagebootfile)
         self.assertTrue(found, 'bootx64.efi file %s was not copied from image'