Skip to contentSkip to conversation

android-tools: add recipe from AOSP tag android-5.1.1_r37

PATCH In review Fathi Boudra 2 participants 2 messages Sep 7, 2016 – Sep 8, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 android-tools: add recipe from AOSP tag android-5.1.1_r37

Android tools offer filsystem tools for creating sparse images, so package them in package of its own.

This recipe is re-worked and not a straight import from meta-shr.

It's built from AOSP source. I've dropped the ubuntu-ism which will never be upstreamed.

The intent is to be closer to the upstream AOSP source code and be able to update the recipe regularly.

---
 .../android-tools-conf/android-gadget-setup        |  25 ++++
 .../android-tools/android-tools-conf_1.0.bb        |  13 ++
 .../android-tools/android-tools/.gitignore         |  57 +++++++
 .../android-tools/android-tools/adb.mk             |  72 +++++++++
 .../android-tools/android-tools/adbd.mk            | 163 +++++++++++++++++++++
 .../android-tools/android-tools-adbd.service       |  12 ++
 .../android-tools/define-shell-command.patch       |  23 +++
 .../android-tools/android-tools/ext4_utils.mk      | 103 +++++++++++++
 .../android-tools/android-tools/fastboot.mk        |  89 +++++++++++
 ...cit-declaration-function-strlcat-strlcopy.patch |  42 ++++++
 ...timg-Add-dt-parameter-to-specify-DT-image.patch | 108 ++++++++++++++
 .../android-tools/android-tools/mkbootimg.mk       |  29 ++++
 .../android-tools/preserve-ownership.patch         |  72 +++++++++
 .../android-tools/remove-bionic-android.patch      |  67 +++++++++
 .../android-tools/remove-selinux-android.patch     |  56 +++++++
 .../android-tools/use-capability.patch             |  19 +++
 .../android-tools/use-local-socket.patch           |  62 ++++++++
 .../android-tools/android-tools_5.1.1.r37.bb       | 136 +++++++++++++++++
 18 files changed, 1148 insertions(+)
 create mode 100644 meta-oe/recipes-devtools/android-tools/android-tools-conf/android-gadget-setup
 create mode 100644 meta-oe/recipes-devtools/android-tools/android-tools-conf_1.0.bb
 create mode 100644 meta-oe/recipes-devtools/android-tools/android-tools/.gitignore
 create mode 100644 meta-oe/recipes-devtools/android-tools/android-tools/adb.mk
 create mode 100644 meta-oe/recipes-devtools/android-tools/android-tools/adbd.mk
 create mode 100644 meta-oe/recipes-devtools/android-tools/android-tools/android-tools-adbd.service
 create mode 100644 meta-oe/recipes-devtools/android-tools/android-tools/define-shell-command.patch
 create mode 100644 meta-oe/recipes-devtools/android-tools/android-tools/ext4_utils.mk
 create mode 100644 meta-oe/recipes-devtools/android-tools/android-tools/fastboot.mk
 create mode 100644 meta-oe/recipes-devtools/android-tools/android-tools/implicit-declaration-function-strlcat-strlcopy.patch
 create mode 100644 meta-oe/recipes-devtools/android-tools/android-tools/mkbootimg-Add-dt-parameter-to-specify-DT-image.patch
 create mode 100644 meta-oe/recipes-devtools/android-tools/android-tools/mkbootimg.mk
 create mode 100644 meta-oe/recipes-devtools/android-tools/android-tools/preserve-ownership.patch
 create mode 100644 meta-oe/recipes-devtools/android-tools/android-tools/remove-bionic-android.patch
 create mode 100644 meta-oe/recipes-devtools/android-tools/android-tools/remove-selinux-android.patch
 create mode 100644 meta-oe/recipes-devtools/android-tools/android-tools/use-capability.patch
 create mode 100644 meta-oe/recipes-devtools/android-tools/android-tools/use-local-socket.patch
 create mode 100644 meta-oe/recipes-devtools/android-tools/android-tools_5.1.1.r37.bb
meta-oe/recipes-devtools/android-tools/android-tools-conf/android-gadget-setup new file +25 -0
new file mode 100644
index 0000000..f7d9973
@@ -0,0 +1,25 @@
+#!/bin/sh
+
+# TODO enable the lines below once we have support for getprop
+# retrieve the product info from Android
+# manufacturer=$(getprop ro.product.manufacturer Android)
+# model=$(getprop ro.product.model Android)
+# serial=$(getprop ro.serialno 0123456789ABCDEF)
+
+manufacturer="$(cat /system/build.prop | grep -o 'ro.product.manufacturer=.*' | cut -d'=' -f 2)"
+model="$(cat /system/build.prop | grep -o 'ro.product.model=.*' | cut -d'=' -f 2)"
+# get the device serial number from /proc/cmdline directly(since we have no getprop on
+# GNU/Linux)
+serial="$(cat /proc/cmdline | sed 's/.*androidboot.serialno=//' | sed 's/ .*//')"
+
+echo $serial > /sys/class/android_usb/android0/iSerial
+echo $manufacturer > /sys/class/android_usb/android0/iManufacturer
+echo $model > /sys/class/android_usb/android0/iProduct
+
+echo "0" > /sys/class/android_usb/android0/enable
+echo "18d1" > /sys/class/android_usbid_usb/android0/idVendor
+echo "D002" > /sys/class/android_usb/android0/idProduct
+echo "adb" > /sys/class/android_usb/android0/functions
+echo "1" >  /sys/class/android_usb/android0/enable
+
+sleep 4
meta-oe/recipes-devtools/android-tools/android-tools-conf_1.0.bb new file +13 -0
new file mode 100644
index 0000000..af98f92
@@ -0,0 +1,13 @@
+DESCRIPTION = "Different utilities from Android - corressponding configuration files"
+SECTION = "console/utils"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
+
+SRC_URI = "file://android-gadget-setup"
+
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+
+do_install() {
+    install -d ${D}${bindir}
+    install -m 0755 ${WORKDIR}/android-gadget-setup ${D}${bindir}
+}
meta-oe/recipes-devtools/android-tools/android-tools/.gitignore new file +57 -0

57 lines not on this page · raw message

meta-oe/recipes-devtools/android-tools/android-tools/adb.mk new file +72 -0

72 lines not on this page · raw message

meta-oe/recipes-devtools/android-tools/android-tools/adbd.mk new file +163 -0

163 lines not on this page · raw message

meta-oe/recipes-devtools/android-tools/android-tools/android-tools-adbd.service new file +12 -0
new file mode 100644
index 0000000..88ed687
@@ -0,0 +1,12 @@
+[Unit]
+Description=Android Debug Bridge
+
+[Service]
+Type=simple
+Restart=on-failure
+ExecStartPre=/usr/bin/android-gadget-setup adb
+ExecStart=/usr/bin/adbd
+StandardOutput=null
+
+[Install]
+WantedBy=basic.target
meta-oe/recipes-devtools/android-tools/android-tools/define-shell-command.patch new file +23 -0
new file mode 100644
index 0000000..8381967
@@ -0,0 +1,23 @@
+Description: we intend to run on Linux system so the shell is always /bin/sh,
+             for the host or the target.
+Author: Fathi Boudra <[email protected]>
+
+Upstream-Status: Inappropriate
+---
+ system/core/adb/services.c |    4 ----
+ 1 file changed, 4 deletions(-)
+
+--- a/system/core/adb/services.c
++++ b/system/core/adb/services.c
+@@ -299,11 +299,7 @@ static int create_subproc_raw(const char
+ }
+ #endif  /* !ABD_HOST */
+ 
+-#if ADB_HOST
+ #define SHELL_COMMAND "/bin/sh"
+-#else
+-#define SHELL_COMMAND "/system/bin/sh"
+-#endif
+ 
+ #if !ADB_HOST
+ static void subproc_waiter_service(int fd, void *cookie)
meta-oe/recipes-devtools/android-tools/android-tools/ext4_utils.mk new file +103 -0

103 lines not on this page · raw message

meta-oe/recipes-devtools/android-tools/android-tools/fastboot.mk new file +89 -0

89 lines not on this page · raw message

meta-oe/recipes-devtools/android-tools/android-tools/implicit-declaration-function-strlcat-strlcopy.patch new file +42 -0

42 lines not on this page · raw message

meta-oe/recipes-devtools/android-tools/android-tools/mkbootimg-Add-dt-parameter-to-specify-DT-image.patch new file +108 -0

108 lines not on this page · raw message

meta-oe/recipes-devtools/android-tools/android-tools/mkbootimg.mk new file +29 -0
new file mode 100644
index 0000000..519f609
@@ -0,0 +1,29 @@
+# Makefile for mkbootimg
+
+SRCDIR ?= $(S)
+
+VPATH += $(SRCDIR)/system/core/mkbootimg
+mkbootimg_SRC_FILES += mkbootimg.c
+mkbootimg_OBJS := $(mkbootimg_SRC_FILES:.c=.o)
+
+VPATH += $(SRCDIR)/system/core/libmincrypt
+libmincrypt_SRC_FILES := dsa_sig.c p256.c p256_ec.c p256_ecdsa.c rsa.c sha.c sha256.c
+libmincrypt_OBJS := $(libmincrypt_SRC_FILES:.c=.o)
+
+CFLAGS += -DANDROID
+CFLAGS += -I$(SRCDIR)/system/core/mkbootimg
+CFLAGS += -I$(SRCDIR)/system/core/include
+CFLAGS += -include $(SRCDIR)/build/core/combo/include/arch/$(android_arch)/AndroidConfig.h
+
+LIBS += libmincrypt.a
+
+all: mkbootimg
+
+mkbootimg: libmincrypt.a $(mkbootimg_OBJS)
+	$(CC) -o $@ $(LDFLAGS) $(mkbootimg_OBJS) $(LIBS)
+
+libmincrypt.a: $(libmincrypt_OBJS)
+	$(AR) rcs $@ $(libmincrypt_OBJS)
+
+clean:
+	$(RM) $(mkbootimg_OBJS) $(libmincrypt_OBJS) mkbootimg *.a
meta-oe/recipes-devtools/android-tools/android-tools/preserve-ownership.patch new file +72 -0

72 lines not on this page · raw message

meta-oe/recipes-devtools/android-tools/android-tools/remove-bionic-android.patch new file +67 -0

67 lines not on this page · raw message

meta-oe/recipes-devtools/android-tools/android-tools/remove-selinux-android.patch new file +56 -0

56 lines not on this page · raw message

meta-oe/recipes-devtools/android-tools/android-tools/use-capability.patch new file +19 -0
new file mode 100644
index 0000000..b8ebe09
@@ -0,0 +1,19 @@
+Subject: use linux/capability.h on linux systems too
+Author: Loïc Minier <[email protected]>
+
+Upstream-Status: Inappropriate
+---
+ system/core/include/private/android_filesystem_config.h |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/system/core/include/private/android_filesystem_config.h
++++ b/system/core/include/private/android_filesystem_config.h
+@@ -27,7 +27,7 @@
+ #include <sys/types.h>
+ #include <stdint.h>
+ 
+-#ifdef HAVE_ANDROID_OS
++#if defined(HAVE_ANDROID_OS) || defined(__linux__)
+ #include <linux/capability.h>
+ #else
+ #include "android_filesystem_capability.h"
meta-oe/recipes-devtools/android-tools/android-tools/use-local-socket.patch new file +62 -0

62 lines not on this page · raw message

meta-oe/recipes-devtools/android-tools/android-tools_5.1.1.r37.bb new file +136 -0

136 lines not on this page · raw message

Signature · 1 line
2.9.3
#1 lore raw
Quoted 5 lines · Fathi Boudra

Android tools offer filsystem tools for creating sparse images, so package them in package of its own.

This recipe is re-worked and not a straight import from meta-shr.

Quoted 7 lines

It's built from AOSP source. I've dropped the ubuntu-ism which will never be upstreamed.

The intent is to be closer to the upstream AOSP source code and be able to update the recipe regularly.

Please add nativesdk support; one commit improvement would be a small example of usage or an external link documenting its usage.

Signature · 3 lines
Otavio Salvador                             O.S. Systems
http://www.ossystems.com.br        http://code.ossystems.com.br
Mobile: +55 (53) 9981-7854            Mobile: +1 (347) 903-9750