Commit e565574f authored by Florent Revest's avatar Florent Revest

usb-moded: Initialize iSerial, iManufacturer and iProduct from Android's...

usb-moded: Initialize iSerial, iManufacturer and iProduct from Android's properties before starting usb-moded
parent e92aabce
#!/bin/sh
echo "0" > /sys/class/android_usb/android0/enable
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)"
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 "1" > /sys/class/android_usb/android0/enable
......@@ -10,6 +10,7 @@ Type=dbus
TimeoutSec=15
EnvironmentFile=-/var/lib/environment/usb-moded/*.conf
EnvironmentFile=-/run/usb-moded/*.conf
ExecStartPre=/usr/bin/init_ffs
ExecStart=/usr/sbin/usb_moded --systemd --force-syslog $USB_MODED_ARGS
Restart=always
ExecReload=/bin/kill -HUP $MAINPID
......
......@@ -8,7 +8,8 @@ SRC_URI = "git://github.com/philippedeswert/usb-moded.git;protocol=https \
file://usb-moded.ini \
file://com.meego.usb_moded.service \
file://udhcpd.service \
file://0001-systemd-Use-a-default-timeout-of-2sec-to-StartUnit-a.patch"
file://0001-systemd-Use-a-default-timeout-of-2sec-to-StartUnit-a.patch \
file://init_ffs"
SRCREV = "b2bcc5ba8d1bf3179c73a916f01ab4e0cf0a3526"
PR = "r1"
PV = "+git${SRCPV}"
......@@ -75,6 +76,8 @@ do_install_append() {
# Remove problematic ini files
rm ${D}/etc/usb-moded/run/udhcpd-connection-sharing.ini ${D}/etc/usb-moded/run/vfat.ini ${D}/etc/usb-moded/run/mtp.ini
rm ${D}/etc/usb-moded/dyn-modes/connection_sharing.ini ${D}/etc/usb-moded/dyn-modes/developer_mode.ini ${D}/etc/usb-moded/dyn-modes/diag_mode_old.ini ${D}/etc/usb-moded/dyn-modes/mass-storage.ini ${D}/etc/usb-moded/dyn-modes/mtp_mode.ini
cp ../init_ffs ${D}/usr/bin/init_ffs
}
FILES_${PN} += " /lib/systemd/system /usr/share/dbus-1/services/"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment