On Thu, 2017-11-30 at 11:06 -0800, Ricardo Neri wrote:
On Wed, Nov 29, 2017 at 07:08:16PM -0800, Megha Dey wrote:
> On Wed, 2017-11-29 at 21:12 +0000, Dey, Megha wrote:
> >
> > >-----Original Message-----
> > >From: Luv [mailto:luv-bounces@lists.01.org] On Behalf Of Ricardo Neri
> > >Sent: Tuesday, November 28, 2017 1:15 PM
> > >To: Naresh Bhat <naresh.bhat(a)linaro.org>
> > >Cc: luv(a)lists.01.org
> > >Subject: Re: [Luv] [PATCH 2/3] AArch64: Build grub-efi v2.02 for AArch64
> > >
> > >On Mon, Nov 27, 2017 at 05:29:11PM +0530, Naresh Bhat wrote:
> > >> We are trying to build and use grub across x86/ARM64 architecture.
> > >> Earlier there was no support of AArch64 in grub-efi, Hence AArch64
was
> > >> dependent on upstream grub git repository. The LUV project use to
pull
> > >> and build grub git repository whenever we build the project for
> > >> AArch64. But recently poky updated meta layer with grub v2.02 and
LUV
> > >> is rebased on top of poky. Hence we can use a common grub across all
> > >> the architecture. The luv-netboot-image also depends on the _RDEPENDS
> > >> variable.
> > >
> > >It is great to see that we are able to use grub-efi for both archs!
> > >>
> > >> Signed-off-by: Naresh Bhat <naresh.bhat(a)linaro.org>
> > >> ---
> > >> meta-luv/classes/luv-efi.bbclass | 12 +-----------
> > >> meta-luv/recipes-bsp/grub/grub-efi_2.02.bbappend | 12 ++++++++++--
> > >> meta-luv/recipes-core/images/luv-netboot-image.bb | 2 +-
> > >> meta/recipes-bsp/grub/grub-efi_2.02.bb | 3 +++
> > >> 4 files changed, 15 insertions(+), 14 deletions(-)
> > >>
> > >> diff --git a/meta-luv/classes/luv-efi.bbclass
> > >> b/meta-luv/classes/luv-efi.bbclass
> > >> index 441ab39..db7c886 100644
> > >> --- a/meta-luv/classes/luv-efi.bbclass
> > >> +++ b/meta-luv/classes/luv-efi.bbclass
> > >> @@ -16,17 +16,7 @@ def get_bits_depends(d):
> > >> return ""
> > >> _BITSDEPENDS = "${@get_bits_depends(d)}"
> > >>
> > >> -# The x86 build is depends on grub-efi and AArch64 build depends on
> > >> grub_git -def get_grub_depends(d):
> > >> - import re
> > >> - deps = d.getVar('TARGET_PREFIX', True)
> > >> - if re.search("(x86_64|i.86).*",deps):
> > >> - return "${MLPREFIX}grub-efi"
> > >> - if re.search("aarch64",deps):
> > >> - return "${MLPREFIX}grub"
> > >> -
> > >> -_RDEPENDS = "${@get_grub_depends(d)}"
> > >> -do_bootimg[depends] += "${_RDEPENDS}:do_deploy \
> > >> +do_bootimg[depends] += "${MLPREFIX}grub-efi:do_deploy \
> > >> sbsigntool-native:do_populate_sysroot"
> > >>
> > >> GRUB_EFI_LOADER_IMAGE_x86-64 = "grub-efi-bootx64.efi"
> > >> diff --git a/meta-luv/recipes-bsp/grub/grub-efi_2.02.bbappend
> > >> b/meta-luv/recipes-bsp/grub/grub-efi_2.02.bbappend
> > >> index de68f3d..3c11924 100644
> > >> --- a/meta-luv/recipes-bsp/grub/grub-efi_2.02.bbappend
> > >> +++ b/meta-luv/recipes-bsp/grub/grub-efi_2.02.bbappend
> > >> @@ -13,7 +13,7 @@ python __anonymous(){
> > >> d.appendVar("GRUB_BUILDIN", ' memdisk -m
${GRUB_MEMDISK}') }
> > >>
> > >> -SRC_URI +=
> > >>
"file://0001-pe32.h-add-header-structures-for-TE-and-DOS-executab.patc
> > >> h \
> > >> +COMMON_GRUB_x86 +=
> > >>
+"file://0001-pe32.h-add-header-structures-for-TE-and-DOS-executab.pat
> > >> +ch \
> > >> file://0002-shim-add-needed-data-structures.patch \
> > >>
file://0003-efi-chainloader-implement-an-UEFI-Exit-service-for-
> > >s.patch \
> > >> file://0004-efi-chainloader-port-shim-to-grub.patch \ @@
> > >> -26,7 +26,15 @@ SRC_URI +=
"file://0001-pe32.h-add-header-structures-
> > >for-TE-and-DOS-executab.pat
> > >> file://0011-grub-core-loader-extend-loader-options.patch
\
> > >>
file://0012-grub-core-loader-add-support-for-memdisks.patch \
> > >>
file://0013-grub-core-loader-pass-current-disk-device-to-loaded-
> > >.patch \
> > >> -
file://0014-grub-util-set-prefix-to-EFI-BOOT-when-booting-f.patch \
> > >> + "
> > >> +
> > >> +# Add grub-efi patches for x86/x86-64/arm64
> > >> +SRC_URI_append_x86 = "${COMMON_GRUB_x86} \
> > >> + "
> > >> +SRC_URI_append_x86-64 = "${COMMON_GRUB_x86} \
> > >> + "
> > >> +
> > >> +SRC_URI +=
> > >>
+"file://0014-grub-util-set-prefix-to-EFI-BOOT-when-booting-f.patch \
> > >> "
> > >>
> > >> GRUB_BUILDIN = "boot linux ext2 fat serial part_msdos part_gpt \
diff
> > >> --git a/meta-luv/recipes-core/images/luv-netboot-image.bb
> > >> b/meta-luv/recipes-core/images/luv-netboot-image.bb
> > >> index 88381a7..26b18c2 100644
> > >> --- a/meta-luv/recipes-core/images/luv-netboot-image.bb
> > >> +++ b/meta-luv/recipes-core/images/luv-netboot-image.bb
> > >> @@ -64,4 +64,4 @@ addtask do_deploy before do_build after
> > >do_mkimage
> > >> addtask image_ext4 before do_bootimg before do_build
> > >>
> > >> do_mkimage[depends] += "${INITRD_IMAGE_LIVE}:do_build"
> > >> -do_deploy[depends] += "${_RDEPENDS}:do_deploy"
> > >> +do_deploy[depends] += "${MLPREFIX}grub-efi:do_deploy"
> > >> diff --git a/meta/recipes-bsp/grub/grub-efi_2.02.bb
> > >> b/meta/recipes-bsp/grub/grub-efi_2.02.bb
> > >> index b949beb..fa9c6a9 100644
> > >> --- a/meta/recipes-bsp/grub/grub-efi_2.02.bb
> > >> +++ b/meta/recipes-bsp/grub/grub-efi_2.02.bb
> > >> @@ -21,6 +21,9 @@ python __anonymous () {
> > >> elif re.match('i.86', target):
> > >> grubtarget = 'i386'
> > >> grubimage = "grub-efi-bootia32.efi"
> > >> + elif re.match('aarch64', target):
> > >> + grubtarget = 'arm64'
> > >> + grubimage = "grub-efi-bootaa64.efi"
> > >> else:
> > >> raise bb.parse.SkipPackage("grub-efi is incompatible
with target %s"
> > >% target)
> > >> d.setVar("GRUB_TARGET", grubtarget)
> > >
> > >
> > >We should aim to send this hunk to the Yocto Project. Now that YP has a
> > >version of grub that supports aarch64, the should be open to take this
patch.
> > >Using LUV, you have verified that grub-efi works.
> > >
> > >I'll leave to Megha the decision on taking this hunk.
> >
> > Hi Ricardo,
> >
> > Since we are close to the release, I will take this hunk.
> >
> > Naresh,
> > Could you send the required hunks to YP as well? In the next release, if this
hunk gets merged to YP we can get rid of it in LUV.
> >
> > >
>
> Taking this patch for now. Once this hunk is merged into yocto, a
> separate patch should be pushed to remove it.
Perhaps you want to split this patch in two, so that it is easier to
revert only the hunk that needs to go to YP but not the hunks we want
to keep.
Thats a good idea Ricardo, will split this into 2 patches.
Thanks and BR,
Ricardo