@@ -53,7 +53,6 @@ LICENSE_PATH += "${LAYERDIR}/licenses"
PREFERRED_RPROVIDER_libdevmapper = "lvm2"
PREFERRED_RPROVIDER_libdevmapper-native = "lvm2-native"
PREFERRED_RPROVIDER_nativesdk-libdevmapper = "nativesdk-lvm2"
-PREFERRED_PROVIDER_android-tools-conf ?= "android-tools-conf"
# Those lines configure whether coreutils or uutils-coreutils is used.
PREFERRED_PROVIDER_coreutils = "coreutils"
PREFERRED_PROVIDER_coreutils-native = "coreutils-native"
deleted file mode 100644
@@ -1,40 +0,0 @@
-#!/bin/sh
-
-set -e
-
-conf="Conf 1"
-manufacturer=RPB
-model="Android device"
-product=0xd002
-serial=0123456789ABCDEF
-vendor=0x18d1
-
-if [ -r /etc/android-gadget-setup.machine ] ; then
- . /etc/android-gadget-setup.machine
-fi
-
-[ -d /sys/kernel/config/usb_gadget ] || modprobe libcomposite
-
-cd /sys/kernel/config/usb_gadget
-
-[ -d adb ] && /usr/bin/android-gadget-cleanup || true
-
-mkdir adb
-cd adb
-
-mkdir configs/c.1
-mkdir functions/ffs.usb0
-mkdir strings/0x409
-mkdir configs/c.1/strings/0x409
-echo -n "$vendor" > idVendor
-echo -n "$product" > idProduct
-echo "$serial" > strings/0x409/serialnumber
-echo "$manufacturer" > strings/0x409/manufacturer
-echo "$model" > strings/0x409/product
-echo "$conf" > configs/c.1/strings/0x409/configuration
-ln -s functions/ffs.usb0 configs/c.1
-
-mkdir -p /dev/usb-ffs/adb
-ADB_UID=$(id -u adb)
-ADB_GID=$(id -g adb)
-mount -t functionfs usb0 /dev/usb-ffs/adb -o "uid=$ADB_UID,gid=$ADB_GID"
deleted file mode 100644
@@ -1,38 +0,0 @@
-DESCRIPTION = "Different utilities from Android - corressponding configuration files for using ConfigFS"
-SECTION = "console/utils"
-LICENSE = "MIT"
-LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
-
-S = "${UNPACKDIR}"
-
-SRC_URI = " \
- file://android-gadget-setup \
- file://android-gadget-start \
- file://android-gadget-cleanup \
- file://10-adbd-configfs.conf \
-"
-
-PACKAGE_ARCH = "${MACHINE_ARCH}"
-
-do_install() {
- install -d ${D}${bindir}
- install -m 0755 ${UNPACKDIR}/android-gadget-setup ${D}${bindir}
- install -m 0755 ${UNPACKDIR}/android-gadget-start ${D}${bindir}
- install -m 0755 ${UNPACKDIR}/android-gadget-cleanup ${D}${bindir}
-
- if [ -r ${UNPACKDIR}/android-gadget-setup.machine ] ; then
- install -d ${D}${sysconfdir}
- install -m 0644 ${UNPACKDIR}/android-gadget-setup.machine ${D}${sysconfdir}
- fi
-
- install -d ${D}${systemd_unitdir}/system/android-tools-adbd.service.d
- install -m 0644 ${UNPACKDIR}/10-adbd-configfs.conf ${D}${systemd_unitdir}/system/android-tools-adbd.service.d
-}
-
-FILES:${PN} += " \
- ${systemd_unitdir}/system/ \
-"
-
-PROVIDES += "android-tools-conf"
-RPROVIDES:${PN} = "android-tools-conf"
-BBCLASSEXTEND = "native"
similarity index 100%
rename from meta-oe/recipes-devtools/android-tools/android-tools-conf-configfs/10-adbd-configfs.conf
rename to meta-oe/recipes-devtools/android-tools/android-tools-conf/10-adbd-configfs.conf
similarity index 100%
rename from meta-oe/recipes-devtools/android-tools/android-tools-conf-configfs/android-gadget-cleanup
rename to meta-oe/recipes-devtools/android-tools/android-tools-conf/android-gadget-cleanup
@@ -1,37 +1,40 @@
#!/bin/sh
-[ ! -e /dev/pts ] && mkdir -p /dev/pts
-[ ! -e /dev/pts/0 ] && mount devpts /dev/pts -t devpts
-
-# 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)
-
-#below are now needed in order to use FunctionFS for ADB, tested to work with 3.4+ kernels
-if grep -q functionfs /proc/filesystems; then
- mkdir -p /dev/usb-ffs/adb
- mount -t functionfs adb /dev/usb-ffs/adb
- #android-gadget-setup doesn't provide below 2 and without them it won't work, so we provide them here.
- echo adb > /sys/class/android_usb/android0/f_ffs/aliases
- echo ffs > /sys/class/android_usb/android0/functions
+set -e
+
+conf="Conf 1"
+manufacturer=RPB
+model="Android device"
+product=0xd002
+serial=0123456789ABCDEF
+vendor=0x18d1
+
+if [ -r /etc/android-gadget-setup.machine ] ; then
+ . /etc/android-gadget-setup.machine
fi
-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/ .*//')"
+[ -d /sys/kernel/config/usb_gadget ] || modprobe libcomposite
+
+cd /sys/kernel/config/usb_gadget
+
+[ -d adb ] && /usr/bin/android-gadget-cleanup || true
-echo $serial > /sys/class/android_usb/android0/iSerial
-echo $manufacturer > /sys/class/android_usb/android0/iManufacturer
-echo $model > /sys/class/android_usb/android0/iProduct
+mkdir adb
+cd adb
-echo "0" > /sys/class/android_usb/android0/enable
-echo "18d1" > /sys/class/android_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
+mkdir configs/c.1
+mkdir functions/ffs.usb0
+mkdir strings/0x409
+mkdir configs/c.1/strings/0x409
+echo -n "$vendor" > idVendor
+echo -n "$product" > idProduct
+echo "$serial" > strings/0x409/serialnumber
+echo "$manufacturer" > strings/0x409/manufacturer
+echo "$model" > strings/0x409/product
+echo "$conf" > configs/c.1/strings/0x409/configuration
+ln -s functions/ffs.usb0 configs/c.1
-sleep 4
+mkdir -p /dev/usb-ffs/adb
+ADB_UID=$(id -u adb)
+ADB_GID=$(id -g adb)
+mount -t functionfs usb0 /dev/usb-ffs/adb -o "uid=$ADB_UID,gid=$ADB_GID"
similarity index 100%
rename from meta-oe/recipes-devtools/android-tools/android-tools-conf-configfs/android-gadget-start
rename to meta-oe/recipes-devtools/android-tools/android-tools-conf/android-gadget-start
@@ -1,20 +1,40 @@
-DESCRIPTION = "Different utilities from Android - corresponding configuration files"
+DESCRIPTION = "Different utilities from Android - corresponding configuration files for using ConfigFS"
SECTION = "console/utils"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
-SRC_URI = "file://android-gadget-setup"
-
S = "${UNPACKDIR}"
+SRC_URI = " \
+ file://android-gadget-setup \
+ file://android-gadget-start \
+ file://android-gadget-cleanup \
+ file://10-adbd-configfs.conf \
+"
+
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+
do_install() {
install -d ${D}${bindir}
install -m 0755 ${UNPACKDIR}/android-gadget-setup ${D}${bindir}
-}
+ install -m 0755 ${UNPACKDIR}/android-gadget-start ${D}${bindir}
+ install -m 0755 ${UNPACKDIR}/android-gadget-cleanup ${D}${bindir}
-python () {
- pn = d.getVar('PN')
- profprov = d.getVar("PREFERRED_PROVIDER_" + pn)
- if profprov and pn != profprov:
- raise bb.parse.SkipRecipe("PREFERRED_PROVIDER_%s set to %s, not %s" % (pn, profprov, pn))
+ if [ -r ${UNPACKDIR}/android-gadget-setup.machine ] ; then
+ install -d ${D}${sysconfdir}
+ install -m 0644 ${UNPACKDIR}/android-gadget-setup.machine ${D}${sysconfdir}
+ fi
+
+ install -d ${D}${systemd_unitdir}/system/android-tools-adbd.service.d
+ install -m 0644 ${UNPACKDIR}/10-adbd-configfs.conf ${D}${systemd_unitdir}/system/android-tools-adbd.service.d
}
+
+FILES:${PN} += " \
+ ${systemd_unitdir}/system/ \
+"
+
+PROVIDES += "android-tools-conf-configfs"
+RPROVIDES:${PN} = "android-tools-conf-configfs"
+RREPLACES:${PN} = "android-tools-conf-configfs"
+RCONFLICTS:${PN} = "android-tools-conf-configfs"
+BBCLASSEXTEND = "native"