<?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>6307</bug_id>
          
          <creation_ts>2014-05-09 21:10:49 +0000</creation_ts>
          <short_desc>Package grub-efi modules and scripts similar to grub-bios</short_desc>
          <delta_ts>2018-08-20 02:14:12 +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>kernel</component>
          <version>1.7</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Medium</priority>
          <bug_severity>enhancement</bug_severity>
          <target_milestone>2.6</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Bill Mills">wmills</reporter>
          <assigned_to name="Hongxu Jia">hongxu.jia</assigned_to>
          <cc>bruce.ashfield</cc>
    
    <cc>randy.macleod</cc>
    
    <cc>sgw</cc>
    
    <cc>tom.zanussi</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>43228</commentid>
    <comment_count>0</comment_count>
    <who name="Bill Mills">wmills</who>
    <bug_when>2014-05-09 21:10:49 +0000</bug_when>
    <thetext>This is a feature request for YP1.7.

[oe-core recipes-bsp seems hard to place in your bugzilla schema.]

grub-efi 2.x is built and packaged very differently than grub-bios 2.x (aka grub-pc aka grub).  (I am not talking about grub 0.97 aka grub-legacy)

The deploy of the composite image is fine but I see no reason it can&apos;t package up the modules and scripts as grub-bios does.  This allows the user to install a full function version of grub on their target if they choose to or create alternative composite images later.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>49313</commentid>
    <comment_count>1</comment_count>
    <who name="Bill Mills">wmills</who>
    <bug_when>2015-03-09 18:14:02 +0000</bug_when>
    <thetext>I did take a crack at this and I think I know why the original shortcut was taken.
grub-efi and grub-bios want to export to the host sysroot the same install scripts that grub-bios does.
bitbake (or an oe-core class) does not let that happen even if the files are identical.
This makes it impossible to share a workspace with builds that use grub-bios and grub-efi which is not acceptable.
I looked at how Debian does this and there is one grub source package that builds grub-common grub-pc and grub-efi.

Possible resoultions:
1) merge grub-bios and grub-efi recipies and build both whenever either is needed.
2) make grub-bios and grub-efi both depend on a new grub-common and do all host sysroot exports from the new recipie.  (duplicates grub code 3 times and I am not sure this works)
3) rename scripts or place into subdir for sysroot and change use to use the one needed.

Not going to happen:
4) extend bitbake to allow sysroot export duplication if exact same file
5) per-package dependeniecs (sysroots) :)  

Right now I lean toward #1.
However I think the same conflict would exist between any new grub and legacy grub (0.97).  Only #3 would help there.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>79143</commentid>
    <comment_count>2</comment_count>
    <who name="Randy MacLeod">randy.macleod</who>
    <bug_when>2018-01-18 16:13:31 +0000</bug_when>
    <thetext>Hongxu can you work with the reporter to re-do you grub, grub-efi patch and ensure that most if not all of Bill&apos;s points have been addressed. If things get bogged down, ask for help.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>79152</commentid>
    <comment_count>3</comment_count>
    <who name="Bill Mills">wmills</who>
    <bug_when>2018-01-18 17:00:27 +0000</bug_when>
    <thetext>I have not looked at this in a while.  We never really started to use Grub on TI platforms.  My motivation at the time I wrote this bug was to create an fully contained grub with config and modules etc for netbooting from EFI on Minnowboard.  I was trying to get Minnowboard into a test lab at the time.

I was able to do this but I think it involved going into the work dir and hacking things up.

I will be happy to look at what you come up with.

On the bright side: OE now has per-package staging (my #5 above) so this might be a lot easier now.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>81407</commentid>
    <comment_count>4</comment_count>
    <who name="Hongxu Jia">hongxu.jia</who>
    <bug_when>2018-08-20 02:14:12 +0000</bug_when>
    <thetext>OE-core has fixed in following commit:

commit 6fd0bc313c6035b7de5b7a62cbbcd1d6f546c7f9
Author: Hongxu Jia &lt;hongxu.jia@windriver.com&gt;
Date:   Wed Jan 17 03:25:58 2018 -0500

    grub/grub-efi: fix conflict
    
    While installing grub and grub-efi, there are conflict files
    in ${sysconfdir} ${datadir} ${bindir} ${sbindir}.
    
    - Since all of the conflicted files are tools which is
      common for grub and grub-efi, we split them (except
      grub-editenv) to grub-common in grub.
    
    - The package grub-common runtime depends grub-editenv
    
    - The package grub-editenv runtime provides grub-efi-editenv
    
    - Remove SYSROOT_DIRS_BLACKLIST
    
    - The recipe grub-efi does not generate the duplicated files
      and use runtime depends grub-common to instead
    
    Debian and Fedora do the similar thing.
    
    Debian use a common package grub-common for both of pc bios and efi,
    and use package grub-pc-bin for pc bios, grub-efi-amd64-bin for efi.
    Both of grub-pc-bin and grub-efi-amd64-bin requires grub-common.
    https://packages.debian.org/sid/grub-common
    https://packages.debian.org/jessie/grub-pc-bin
    https://packages.debian.org/jessie/grub-efi-amd64-bin
    
    Fedora use a common package grub2-tools for both of pc bios and efi,
    and use package grub2 for pc bios, grub2-efi-modules for efi.
    Both of grub2 and grub2-efi-modules requires grub2-tools.
    https://www.rpmfind.net/linux/RPM/fedora/devel/rawhide/x86_64/g/grub2-tools-2.02-0.34.fc24.x86_64.html
    https://www.rpmfind.net/linux/RPM/fedora/devel/rawhide/x86_64/g/grub2-2.02-0.34.fc24.x86_64.html
    https://www.rpmfind.net/linux/RPM/fedora/devel/rawhide/x86_64/g/grub2-efi-modules-2.02-0.34.fc24.x86_64.html
    
    [YOCTO #11639]
    
    Signed-off-by: Hongxu Jia &lt;hongxu.jia@windriver.com&gt;
    Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>