On Thu, Aug 15, 2024 at 02:24:23PM -0600, Simon Glass wrote: > Create a new disk for use with tests, which contains the new 'testapp' > EFI app specifically intended for testing the EFI loader. > > Attach it to the USB device, since most testing is currently done with > mmc. > > Initially this image will be used to test the EFI bootmeth. > > Fix a stale comment in prep_mmc_bootdev() while we are here. > > Signed-off-by: Simon Glass <s...@chromium.org> [snip] > + try: > + loop = mount_image(cons, fname, mnt, 'ext4') > + mounted = True > + efi_dir = os.path.join(mnt, 'EFI') > + mkdir_cond(efi_dir) > + bootdir = os.path.join(efi_dir, 'BOOT') > + mkdir_cond(bootdir) > + efi_src = os.path.join(cons.config.build_dir, > + f'lib/efi_loader/testapp.efi') > + efi_dst = os.path.join(bootdir, 'BOOTSBOX.EFI') > + with open(efi_src, 'rb') as inf: > + with open(efi_dst, 'wb') as outf: > + outf.write(inf.read()) > + except ValueError as exc: > + print(f'Falled to create image, failing back to prepared copy: > {exc}') > + > + finally: > + if mounted: > + u_boot_utils.run_and_log(cons, 'sudo umount --lazy %s' % mnt) > + if loop: > + u_boot_utils.run_and_log(cons, 'sudo losetup -d %s' % loop)
Please see https://patchwork.ozlabs.org/project/uboot/patch/20240802093322.15240-1-rich...@nod.at/ for inspiration on making this not require sudo. -- Tom
signature.asc
Description: PGP signature