<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugzilla.yoctoproject.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugzilla.yoctoproject.org/"
          
          maintainer="it-coreprojects-helpdesk@linuxfoundation.org"
>

    <bug>
          <bug_id>9384</bug_id>
          
          <creation_ts>2016-04-04 20:42:18 +0000</creation_ts>
          <short_desc>wic should write startup.nsh for bootimg-efi</short_desc>
          <delta_ts>2016-04-28 16:22:03 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>7</classification_id>
          <classification>Build System, Metadata &amp; Runtime</classification>
          <product>OE-Core</product>
          <component>Scripts and Tools</component>
          <version>unspecified</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>INVALID</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Medium</priority>
          <bug_severity>enhancement</bug_severity>
          <target_milestone>2.2</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Christopher Larson">kergoth</reporter>
          <assigned_to name="Christopher Larson">kergoth</assigned_to>
          <cc>eduard.bartosh</cc>
    
    <cc>ross.burton</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>Don&apos;t know</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>60756</commentid>
    <comment_count>0</comment_count>
    <who name="Christopher Larson">kergoth</who>
    <bug_when>2016-04-04 20:42:18 +0000</bug_when>
    <thetext>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&apos;m not sure it&apos;s ideal, so would like to discuss with folks more familiar with wic and/or EFI, as I&apos;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 &lt;tom.zanussi (at] linux.intel.com&gt;
 #
 
+import glob
 import os
 import shutil
 
@@ -197,6 +198,12 @@ class BootimgEFIPlugin(SourcePlugin):
         except KeyError:
             msger.error(&quot;bootimg-efi requires a loader, none specified&quot;)
 
+        # Auto startup for /EFI/BOOT/boot*.efi
+        bootfiles = glob.glob(&apos;%s/EFI/BOOT/boot*.efi&apos; % hdddir)
+        if bootfiles and len(bootfiles) == 1:
+            with open(&apos;%s/startup.nsh&apos; % hdddir, &apos;w&apos;) as f:
+                f.write(&apos;fs0:\\EFI\\BOOT\\%s\n&apos; % os.path.basename(bootfiles[0]))
+
         du_cmd = &quot;du -bks %s&quot; % hdddir
         out = exec_cmd(du_cmd)
         blocks = int(out.split()[0])</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>61170</commentid>
    <comment_count>1</comment_count>
    <who name="Christopher Larson">kergoth</who>
    <bug_when>2016-04-13 17:11:38 +0000</bug_when>
    <thetext>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.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>61192</commentid>
    <comment_count>2</comment_count>
    <who name="Ed Bartosh">eduard.bartosh</who>
    <bug_when>2016-04-14 09:12:07 +0000</bug_when>
    <thetext>I like your idea. Need to find time to play with it. I&apos;m not familiar with EFI enough to say if it&apos;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.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>61232</commentid>
    <comment_count>3</comment_count>
    <who name="Christopher Larson">kergoth</who>
    <bug_when>2016-04-14 15:29:09 +0000</bug_when>
    <thetext>Yeah, I don&apos;t know enough about EFI either, just copied the bits from mkefidisk / bootimg :) It&apos;s only tested on MinnowMax thus far.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>61600</commentid>
    <comment_count>4</comment_count>
    <who name="Ed Bartosh">eduard.bartosh</who>
    <bug_when>2016-04-25 09:55:53 +0000</bug_when>
    <thetext>I think it&apos;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?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>61644</commentid>
    <comment_count>5</comment_count>
    <who name="Christopher Larson">kergoth</who>
    <bug_when>2016-04-25 16:58:59 +0000</bug_when>
    <thetext>That seems reasonable to me, thanks.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>61768</commentid>
    <comment_count>6</comment_count>
    <who name="Ed Bartosh">eduard.bartosh</who>
    <bug_when>2016-04-28 09:58:58 +0000</bug_when>
    <thetext>Should we close this bug then?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>61807</commentid>
    <comment_count>7</comment_count>
    <who name="Christopher Larson">kergoth</who>
    <bug_when>2016-04-28 16:22:03 +0000</bug_when>
    <thetext>Yeah, I&apos;ll open a new bug to track adding it to the efi bootloader(s). Thanks again.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>