diff mbox

[Yocto,4/4] grub: Update grub git recipe

Message ID 1425397584-5154-5-git-send-email-naresh.bhat@linaro.org
State New
Headers show

Commit Message

naresh.bhat@linaro.org March 3, 2015, 3:46 p.m. UTC
Update the grub git recipe with the following actions for native and non-native
- Base class extend to native
- do_configure_prepand
- do_install_append
- do_mkimage native
- do_deploy

Signed-off-by: Naresh Bhat <naresh.bhat@linaro.org>
Reviewed-by: Graeme Gregory <graeme.gregory@linaro.org>
Reviewed-by: Matt Fleming <matt.fleming@intel.com>
---
 meta/recipes-bsp/grub/grub_git.bb |   51 ++++++++++++++++++++++++++++++++-----
 1 file changed, 45 insertions(+), 6 deletions(-)

Comments

naresh.bhat@linaro.org March 4, 2015, 7:46 a.m. UTC | #1
On 3 March 2015 at 23:33, Bernhard Reutner-Fischer
<rep.dot.nop@gmail.com> wrote:
> On 3 March 2015 at 16:46, Naresh Bhat <naresh.bhat@linaro.org> wrote:
>> Update the grub git recipe with the following actions for native and non-native
>> - Base class extend to native
>> - do_configure_prepand
>
> s/prepand/prepend/
Thanks, I will make the change.
>
>> - do_install_append
>> - do_mkimage native
>> - do_deploy
>>
>> Signed-off-by: Naresh Bhat <naresh.bhat@linaro.org>
>> Reviewed-by: Graeme Gregory <graeme.gregory@linaro.org>
>> Reviewed-by: Matt Fleming <matt.fleming@intel.com>
>> ---
>>  meta/recipes-bsp/grub/grub_git.bb |   51 ++++++++++++++++++++++++++++++++-----
>>  1 file changed, 45 insertions(+), 6 deletions(-)
>>
>> diff --git a/meta/recipes-bsp/grub/grub_git.bb b/meta/recipes-bsp/grub/grub_git.bb
>> index 3ab675b..a2abe01 100644
>> --- a/meta/recipes-bsp/grub/grub_git.bb
>> +++ b/meta/recipes-bsp/grub/grub_git.bb
>> @@ -8,6 +8,7 @@ DEFAULT_PREFERENCE_arm = "1"
>>  PV = "2.00+${SRCPV}"
>>  SRCREV = "87de66d9d83446ecddb29cfbdf7369102c8e209e"
>>  SRC_URI = "git://git.savannah.gnu.org/grub.git \
>> +           file://cfg \
>>             file://grub-2.00-fpmath-sse-387-fix.patch \
>>             file://autogen.sh-exclude-pc.patch \
>>             file://grub-2.00-add-oe-kernel.patch \
>> @@ -18,7 +19,7 @@ S = "${WORKDIR}/git"
>>
>>  COMPATIBLE_HOST = '(x86_64.*|i.86.*|arm.*|aarch64.*)-(linux.*|freebsd.*)'
>>
>> -inherit autotools gettext texinfo
>> +inherit autotools gettext texinfo deploy
>>
>>  PACKAGECONFIG ??= ""
>>  PACKAGECONFIG[grub-mount] = "--enable-grub-mount,--disable-grub-mount,fuse"
>> @@ -31,24 +32,62 @@ GRUBPLATFORM_arm = "uboot"
>>  GRUBPLATFORM_aarch64 = "efi"
>>  GRUBPLATFORM ??= "pc"
>>
>> +CACHED_CONFIGUREVARS += "ac_cv_path_HELP2MAN="
>>  EXTRA_OECONF = "--with-platform=${GRUBPLATFORM} --disable-grub-mkfont --program-prefix="" \
>>                  --enable-liblzma=no --enable-device-mapper=no --enable-libzfs=no"
>>
>> +B = "${S}"
>> +
>> +export ac_cv_path_HELP2MAN=""
>> +
>>  do_configure_prepend() {
>> -    ( cd ${S}
>> -      ${S}/autogen.sh )
>> +      ./autogen.sh
>> +}
>
> I did not follow the recentish B / S changes so i'm curious if the
> part(s) above are an improvement?
As far as I understand, when autotools is inherited, it jumps to ${B}
to build, and B is assigned with ${WORKDIR}/build
>
>> +
>> +do_install_append_class-native() {
>> +        install -d ${D}${bindir}
>> +        install -m 755 grub-mkimage ${D}${bindir}
>
> again, cut down on forks, use install -D
ok,  I will do the change
>
>>  }
>>
>> -do_install_append () {
>> +do_install_append_class-target() {
>> +    # Search for the grub.cfg on the local boot media by using the
>> +    # built in cfg file provided via this recipe
>> +    grub-mkimage -c ../cfg -p /EFI/BOOT -d ./grub-core/ \
>> +        -O ${GRUB_TARGET}-${GRUBPLATFORM} -o ./${GRUB_IMAGE} \
>> +        boot linux ext2 fat serial part_msdos part_gpt \
>> +        normal efi_gop iso9660 search efinet tftp all_video chain \
>> +        gfxmenu jpeg gfxterm
>> +
>>      install -d ${D}${sysconfdir}/grub.d
>> -
>> +    install -m 0755 ${B}/${GRUB_IMAGE} ${D}${bindir}
>
> install -D, again?
yes, I will change it.
>
>> +}
>> +
>> +GRUB_TARGET_aarch64 = "arm64"
>> +GRUB_IMAGE_aarch64 = "grubaa64.efi"
>> +
>> +do_mkimage_class-native() {
>> +        :
>> +}
>> +
>> +do_deploy() {
>> +    install -d ${DEPLOYDIR}
>> +    install -m 0755 ${B}/${GRUB_IMAGE} ${DEPLOYDIR}
>
> .. and again.
I will do the change.
>
> PS: Sorry, I seem to be in nitpicking mood right now ;)
> thanks,
Thank you very much for reviewing all the patches.
>
>>  }
>>
>> +do_deploy_class-native() {
>> +        :
>> +}
>> +
>> +addtask deploy after do_install before do_build
>> +
>>  # debugedit chokes on bare metal binaries
>>  INHIBIT_PACKAGE_DEBUG_SPLIT = "1"
>>
>> -RDEPENDS_${PN} = "diffutils freetype"
>> +RDEPENDS_${PN}_class-target = "diffutils freetype"
>>  FILES_${PN}-dbg += "${libdir}/${BPN}/*/.debug"
>>
>>  INSANE_SKIP_${PN} = "arch"
>>  INSANE_SKIP_${PN}-dbg = "arch"
>> +
>> +DEPENDS_class-target += "grub-native"
>> +BBCLASSEXTEND = "native"
>> --
>> 1.7.9.5
>>
>> --
>> _______________________________________________
>> Openembedded-core mailing list
>> Openembedded-core@lists.openembedded.org
>> http://lists.openembedded.org/mailman/listinfo/openembedded-core
naresh.bhat@linaro.org March 5, 2015, 1:54 p.m. UTC | #2
On 5 March 2015 at 02:05, Burton, Ross <ross.burton@intel.com> wrote:
>
> On 4 March 2015 at 07:46, Naresh Bhat <naresh.bhat@linaro.org> wrote:
>>
>> As far as I understand, when autotools is inherited, it jumps to ${B}
>> to build, and B is assigned with ${WORKDIR}/build
>
>
> Thats right, but if the recipe fails to work with B!=S then please inherit
> autotools-brokensep instead of autotools, so broken recipes are clearly
> marked as such.  B!=S makes builds far more reliable so fixing the
> recipe/upstream to work with that is preferable to simply using
> autotools-brokensep.
Thank you very much.  I will try to use it.
>
> Also we're feature frozen now, so merging of these patches will have to wait
> for the 1.9 cycle to open.
ok, l will wait for next cycle to open.
>
> Ross
diff mbox

Patch

diff --git a/meta/recipes-bsp/grub/grub_git.bb b/meta/recipes-bsp/grub/grub_git.bb
index 3ab675b..a2abe01 100644
--- a/meta/recipes-bsp/grub/grub_git.bb
+++ b/meta/recipes-bsp/grub/grub_git.bb
@@ -8,6 +8,7 @@  DEFAULT_PREFERENCE_arm = "1"
 PV = "2.00+${SRCPV}"
 SRCREV = "87de66d9d83446ecddb29cfbdf7369102c8e209e"
 SRC_URI = "git://git.savannah.gnu.org/grub.git \
+           file://cfg \
            file://grub-2.00-fpmath-sse-387-fix.patch \
            file://autogen.sh-exclude-pc.patch \
            file://grub-2.00-add-oe-kernel.patch \
@@ -18,7 +19,7 @@  S = "${WORKDIR}/git"
 
 COMPATIBLE_HOST = '(x86_64.*|i.86.*|arm.*|aarch64.*)-(linux.*|freebsd.*)'
 
-inherit autotools gettext texinfo
+inherit autotools gettext texinfo deploy
 
 PACKAGECONFIG ??= ""
 PACKAGECONFIG[grub-mount] = "--enable-grub-mount,--disable-grub-mount,fuse"
@@ -31,24 +32,62 @@  GRUBPLATFORM_arm = "uboot"
 GRUBPLATFORM_aarch64 = "efi"
 GRUBPLATFORM ??= "pc"
 
+CACHED_CONFIGUREVARS += "ac_cv_path_HELP2MAN="
 EXTRA_OECONF = "--with-platform=${GRUBPLATFORM} --disable-grub-mkfont --program-prefix="" \
                 --enable-liblzma=no --enable-device-mapper=no --enable-libzfs=no"
 
+B = "${S}"
+
+export ac_cv_path_HELP2MAN=""
+
 do_configure_prepend() {
-    ( cd ${S}
-      ${S}/autogen.sh )
+      ./autogen.sh
+}
+
+do_install_append_class-native() {
+        install -d ${D}${bindir}
+        install -m 755 grub-mkimage ${D}${bindir}
 }
 
-do_install_append () {
+do_install_append_class-target() {
+    # Search for the grub.cfg on the local boot media by using the
+    # built in cfg file provided via this recipe
+    grub-mkimage -c ../cfg -p /EFI/BOOT -d ./grub-core/ \
+        -O ${GRUB_TARGET}-${GRUBPLATFORM} -o ./${GRUB_IMAGE} \
+        boot linux ext2 fat serial part_msdos part_gpt \
+        normal efi_gop iso9660 search efinet tftp all_video chain \
+        gfxmenu jpeg gfxterm
+
     install -d ${D}${sysconfdir}/grub.d
- 
+    install -m 0755 ${B}/${GRUB_IMAGE} ${D}${bindir}
+}
+
+GRUB_TARGET_aarch64 = "arm64"
+GRUB_IMAGE_aarch64 = "grubaa64.efi"
+
+do_mkimage_class-native() {
+        :
+}
+
+do_deploy() {
+    install -d ${DEPLOYDIR}
+    install -m 0755 ${B}/${GRUB_IMAGE} ${DEPLOYDIR}
 }
 
+do_deploy_class-native() {
+        :
+}
+
+addtask deploy after do_install before do_build
+
 # debugedit chokes on bare metal binaries
 INHIBIT_PACKAGE_DEBUG_SPLIT = "1"
 
-RDEPENDS_${PN} = "diffutils freetype"
+RDEPENDS_${PN}_class-target = "diffutils freetype"
 FILES_${PN}-dbg += "${libdir}/${BPN}/*/.debug"
 
 INSANE_SKIP_${PN} = "arch"
 INSANE_SKIP_${PN}-dbg = "arch"
+
+DEPENDS_class-target += "grub-native"
+BBCLASSEXTEND = "native"