I think the user will expect their device to boot on its own without having to manually input commands at the EFI boot prompt. I have this applied locally, but I'm not sure it's ideal, so would like to discuss with folks more familiar with wic and/or EFI, as I'm not an expert at either: diff --git i/scripts/lib/wic/plugins/source/bootimg-efi.py w/scripts/lib/wic/plugins/source/bootimg-efi.py index a4734c9..960c672 100644 --- i/scripts/lib/wic/plugins/source/bootimg-efi.py +++ w/scripts/lib/wic/plugins/source/bootimg-efi.py @@ -24,6 +24,7 @@ # Tom Zanussi <tom.zanussi (at] linux.intel.com> # +import glob import os import shutil @@ -197,6 +198,12 @@ class BootimgEFIPlugin(SourcePlugin): except KeyError: msger.error("bootimg-efi requires a loader, none specified") + # Auto startup for /EFI/BOOT/boot*.efi + bootfiles = glob.glob('%s/EFI/BOOT/boot*.efi' % hdddir) + if bootfiles and len(bootfiles) == 1: + with open('%s/startup.nsh' % hdddir, 'w') as f: + f.write('fs0:\\EFI\\BOOT\\%s\n' % os.path.basename(bootfiles[0])) + du_cmd = "du -bks %s" % hdddir out = exec_cmd(du_cmd) blocks = int(out.split()[0])
Any thoughts on this, Ed? Is this the right direction for this, or is there a better way to resolve this? This will align the behavior of wic with that of mkefidisk.sh.
I like your idea. Need to find time to play with it. I'm not familiar with EFI enough to say if it's going to work on all EFI hardware or we need to do it differently. BTW, which hardware did you test it on? I can try if it works on Minnowboard max if needed.
Yeah, I don't know enough about EFI either, just copied the bits from mkefidisk / bootimg :) It's only tested on MinnowMax thus far.
I think it's better to include startup.nsh into efi bootloader package. This way wic will just put it into boot partition as it does for other bootloader components. Cristopher, does it make sense for you?
That seems reasonable to me, thanks.
Should we close this bug then?
Yeah, I'll open a new bug to track adding it to the efi bootloader(s). Thanks again.