All of lore.kernel.org
 help / color / mirror / Atom feed
* [meta-oe][PATCH] android-tools: fix native build
@ 2016-10-21  7:10 Koen Kooi
  2016-10-21 17:12 ` Khem Raj
  2016-11-16 22:24 ` Nicolas Dechesne
  0 siblings, 2 replies; 4+ messages in thread
From: Koen Kooi @ 2016-10-21  7:10 UTC (permalink / raw)
  To: openembedded-devel; +Cc: Koen Kooi

* Find libbsd headers when building natively
* Disable tools that needs sys/capability.h when building natively
* Enhance do_install to work when some tools are disabled

Signed-off-by: Koen Kooi <koen.kooi@linaro.org>
---
 .../android-tools/android-tools_5.1.1.r37.bb       | 59 +++++++++++++++-------
 1 file changed, 40 insertions(+), 19 deletions(-)

diff --git a/meta-oe/recipes-devtools/android-tools/android-tools_5.1.1.r37.bb b/meta-oe/recipes-devtools/android-tools/android-tools_5.1.1.r37.bb
index 2dbddf1..1769b6a 100644
--- a/meta-oe/recipes-devtools/android-tools/android-tools_5.1.1.r37.bb
+++ b/meta-oe/recipes-devtools/android-tools/android-tools_5.1.1.r37.bb
@@ -65,6 +65,16 @@ do_unpack_extra() {
 
 addtask unpack_extra after do_unpack before do_patch
 
+# Find libbsd headers during native builds
+CC_append_class-native = " -I${STAGING_INCDIR}"
+CC_append_class-nativesdk = " -I${STAGING_INCDIR}"
+
+TOOLS = "adb fastboot ext4_utils mkbootimg adbd"
+
+# Adb needs sys/capability.h, which is not available for native*
+TOOLS_class-native = "fastboot ext4_utils mkbootimg"
+TOOLS_class-nativesdk = "fastboot ext4_utils mkbootimg"
+
 do_compile() {
     # Setting both variables below causing our makefiles to not work with
     # implicit make rules
@@ -91,31 +101,42 @@ do_compile() {
       ;;
     esac
 
-    tools="adb fastboot ext4_utils mkbootimg adbd"
-    for tool in ${tools}; do
+    for tool in ${TOOLS}; do
       mkdir -p ${B}/${tool}
       oe_runmake -f ${B}/${tool}.mk -C ${B}/${tool}
     done
 }
 
 do_install() {
-    install -D -p -m0755 ${S}/system/core/libsparse/simg_dump.py ${D}${bindir}/simg_dump
-    install -D -p -m0755 ${S}/system/extras/ext4_utils/mkuserimg.sh ${D}${bindir}/mkuserimg
-
-    install -m0755 ${B}/ext4_utils/ext2simg ${D}${bindir}
-    install -m0755 ${B}/ext4_utils/ext4fixup ${D}${bindir}
-    install -m0755 ${B}/ext4_utils/img2simg ${D}${bindir}
-    install -m0755 ${B}/ext4_utils/make_ext4fs ${D}${bindir}
-    install -m0755 ${B}/ext4_utils/simg2img ${D}${bindir}
-    install -m0755 ${B}/ext4_utils/simg2simg ${D}${bindir}
-
-    install -m0755 ${B}/adb/adb ${D}${bindir}
-    install -m0755 ${B}/adbd/adbd ${D}${bindir}
-    install -m0755 ${B}/fastboot/fastboot ${D}${bindir}
-    install -m0755 ${B}/mkbootimg/mkbootimg ${D}${bindir}
-
-    install -D -p -m0644 ${WORKDIR}/android-tools-adbd.service \
-      ${D}${systemd_unitdir}/system/android-tools-adbd.service
+    if [ grep -q "ext4_utils" "${TOOLS}" ] ; then
+        install -D -p -m0755 ${S}/system/core/libsparse/simg_dump.py ${D}${bindir}/simg_dump
+        install -D -p -m0755 ${S}/system/extras/ext4_utils/mkuserimg.sh ${D}${bindir}/mkuserimg
+
+        install -m0755 ${B}/ext4_utils/ext2simg ${D}${bindir}
+        install -m0755 ${B}/ext4_utils/ext4fixup ${D}${bindir}
+        install -m0755 ${B}/ext4_utils/img2simg ${D}${bindir}
+        install -m0755 ${B}/ext4_utils/make_ext4fs ${D}${bindir}
+        install -m0755 ${B}/ext4_utils/simg2img ${D}${bindir}
+        install -m0755 ${B}/ext4_utils/simg2simg ${D}${bindir}
+    fi
+
+    if [ grep -q "adb " "${TOOLS}" ] ; then
+        install -m0755 ${B}/adb/adb ${D}${bindir}i
+    fi
+
+    if [ grep -q "adbd" "${TOOLS}" ] ; then
+        install -m0755 ${B}/adbd/adbd ${D}${bindir}
+        install -D -p -m0644 ${WORKDIR}/android-tools-adbd.service \
+          ${D}${systemd_unitdir}/system/android-tools-adbd.service
+    fi
+
+    if [ grep -q "fastboot" "${TOOLS}" ] ; then
+        install -m0755 ${B}/fastboot/fastboot ${D}${bindir}
+    fi
+
+    if [ grep -q "mkbootimg" "${TOOLS}" ] ; then
+         install -m0755 ${B}/mkbootimg/mkbootimg ${D}${bindir}
+    fi
 }
 
 PACKAGES += "${PN}-fstools"
-- 
2.4.11



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [meta-oe][PATCH] android-tools: fix native build
  2016-10-21  7:10 [meta-oe][PATCH] android-tools: fix native build Koen Kooi
@ 2016-10-21 17:12 ` Khem Raj
  2016-10-24  5:36   ` Koen Kooi
  2016-11-16 22:24 ` Nicolas Dechesne
  1 sibling, 1 reply; 4+ messages in thread
From: Khem Raj @ 2016-10-21 17:12 UTC (permalink / raw)
  To: openembedded-devel; +Cc: Koen Kooi

[-- Attachment #1: Type: text/plain, Size: 342 bytes --]


> On Oct 21, 2016, at 12:10 AM, Koen Kooi <koen.kooi@linaro.org> wrote:
> 
> +# Find libbsd headers during native builds
> +CC_append_class-native = " -I${STAGING_INCDIR}"
> +CC_append_class-nativesdk = " -I${STAGING_INCDIR}"
> +

is CC the only option to be tweaked ? can it be done via CFLAGS or BUILD_CFLAGS
and BUILDSDK_CFLAGS

[-- Attachment #2: Message signed with OpenPGP using GPGMail --]
[-- Type: application/pgp-signature, Size: 211 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [meta-oe][PATCH] android-tools: fix native build
  2016-10-21 17:12 ` Khem Raj
@ 2016-10-24  5:36   ` Koen Kooi
  0 siblings, 0 replies; 4+ messages in thread
From: Koen Kooi @ 2016-10-24  5:36 UTC (permalink / raw)
  To: Khem Raj; +Cc: OpenEmbedded Devel List

On 21 October 2016 at 19:12, Khem Raj <raj.khem@gmail.com> wrote:
>
>> On Oct 21, 2016, at 12:10 AM, Koen Kooi <koen.kooi@linaro.org> wrote:
>>
>> +# Find libbsd headers during native builds
>> +CC_append_class-native = " -I${STAGING_INCDIR}"
>> +CC_append_class-nativesdk = " -I${STAGING_INCDIR}"
>> +
>
> is CC the only option to be tweaked ? can it be done via CFLAGS or BUILD_CFLAGS
> and BUILDSDK_CFLAGS

Among other things, CFLAGS gets emptied a bit later in the recipe,
which I why I went the CC_append route.

-- 
Koen Kooi

Builds and Baselines | Release Manager
Linaro.org | Open source software for ARM SoCs


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [meta-oe][PATCH] android-tools: fix native build
  2016-10-21  7:10 [meta-oe][PATCH] android-tools: fix native build Koen Kooi
  2016-10-21 17:12 ` Khem Raj
@ 2016-11-16 22:24 ` Nicolas Dechesne
  1 sibling, 0 replies; 4+ messages in thread
From: Nicolas Dechesne @ 2016-11-16 22:24 UTC (permalink / raw)
  To: openembedded-devel; +Cc: Koen Kooi

On Fri, Oct 21, 2016 at 9:10 AM, Koen Kooi <koen.kooi@linaro.org> wrote:
> +    if [ grep -q "ext4_utils" "${TOOLS}" ] ; then
> +        install -D -p -m0755 ${S}/system/core/libsparse/simg_dump.py ${D}${bindir}/simg_dump
> +        install -D -p -m0755 ${S}/system/extras/ext4_utils/mkuserimg.sh ${D}${bindir}/mkuserimg
> +
> +        install -m0755 ${B}/ext4_utils/ext2simg ${D}${bindir}
> +        install -m0755 ${B}/ext4_utils/ext4fixup ${D}${bindir}
> +        install -m0755 ${B}/ext4_utils/img2simg ${D}${bindir}
> +        install -m0755 ${B}/ext4_utils/make_ext4fs ${D}${bindir}
> +        install -m0755 ${B}/ext4_utils/simg2img ${D}${bindir}
> +        install -m0755 ${B}/ext4_utils/simg2simg ${D}${bindir}
> +    fi
> +
> +    if [ grep -q "adb " "${TOOLS}" ] ; then
> +        install -m0755 ${B}/adb/adb ${D}${bindir}i
> +    fi
> +
> +    if [ grep -q "adbd" "${TOOLS}" ] ; then
> +        install -m0755 ${B}/adbd/adbd ${D}${bindir}
> +        install -D -p -m0644 ${WORKDIR}/android-tools-adbd.service \
> +          ${D}${systemd_unitdir}/system/android-tools-adbd.service
> +    fi
> +
> +    if [ grep -q "fastboot" "${TOOLS}" ] ; then
> +        install -m0755 ${B}/fastboot/fastboot ${D}${bindir}
> +    fi
> +
> +    if [ grep -q "mkbootimg" "${TOOLS}" ] ; then
> +         install -m0755 ${B}/mkbootimg/mkbootimg ${D}${bindir}
> +    fi

sorry to notice that just now.. but how can this work? the 'grep'
statements above are wrong and non functional. I was trying to build
the recipe and noticed that no files get installed. The current
implementation will lead to:

$ grep "ext4_utils" "adb fastboot ext4_utils mkbootimg adbd"
grep: adb fastboot ext4_utils mkbootimg adbd: No such file or directory

Both the target and -native build fails, with target build i end up
with this error

ERROR: android-tools-5.1.1.r37-r0 do_package:
SYSTEMD_SERVICE_android-tools value android-tools-adbd.service does
not exist
ERROR: android-tools-5.1.1.r37-r0 do_package: Function failed:
systemd_populate_packages

I suppose it was tested without systemd , so there was no obvious
error, but the resulting packages were empty..

I also needed to add libcap in DEPENDS, to get the compile task to work.

nico


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-11-16 22:24 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-10-21  7:10 [meta-oe][PATCH] android-tools: fix native build Koen Kooi
2016-10-21 17:12 ` Khem Raj
2016-10-24  5:36   ` Koen Kooi
2016-11-16 22:24 ` Nicolas Dechesne

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.