diff mbox series

[isar-cip-core,2/7] efibootguard: Do not rely on mcopy to perform recursive copies

Message ID f08b660fa76e52b3c91b8e308281690e0af2e86b.1657568458.git.jan.kiszka@siemens.com (mailing list archive)
State Handled Elsewhere
Headers show
Series SWUpdate/secure boot for ARM, related recipe updates | expand

Commit Message

Jan Kiszka July 11, 2022, 7:40 p.m. UTC
From: Jan Kiszka <jan.kiszka@siemens.com>

This is broken for old buster on ARM (or over qemu-user for ARM).

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
 scripts/lib/wic/plugins/source/efibootguard-efi.py | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/scripts/lib/wic/plugins/source/efibootguard-efi.py b/scripts/lib/wic/plugins/source/efibootguard-efi.py
index e1411cb..140b734 100644
--- a/scripts/lib/wic/plugins/source/efibootguard-efi.py
+++ b/scripts/lib/wic/plugins/source/efibootguard-efi.py
@@ -98,7 +98,11 @@  class EfibootguardEFIPlugin(SourcePlugin):
             (part.label.upper(), efi_part_image, blocks)
         exec_cmd(dosfs_cmd)
 
-        mcopy_cmd = "mcopy -v -i %s -s %s/* ::/" % \
+        # mtools for buster have problems with resursive mcopy.
+        # Therefore, create the target dir via mmd first.
+        mmd_cmd = "mmd -i %s ::/EFI ::/EFI/BOOT" % (efi_part_image)
+        exec_cmd(mmd_cmd, True)
+        mcopy_cmd = "mcopy -v -i %s -s %s/EFI/BOOT/* ::/EFI/BOOT" % \
             (efi_part_image, part_rootfs_dir)
         exec_cmd(mcopy_cmd, True)