From caccfdc0a6493ca536835dafee3623ea10652370 Mon Sep 17 00:00:00 2001 From: Philippe De Swert Date: Sun, 24 Jan 2016 15:50:21 +0200 Subject: [PATCH] adb: Add missing scripts and service for adb mode To get a working adb mode, we need to add the functionfs mounting, as just starting adbd is not enough anymore. Signed-off-by: Philippe De Swert --- systemd/adbd-functionfs.sh | 10 ++++++++++ systemd/adbd-prepare.service | 17 +++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 systemd/adbd-functionfs.sh create mode 100644 systemd/adbd-prepare.service diff --git a/systemd/adbd-functionfs.sh b/systemd/adbd-functionfs.sh new file mode 100644 index 0000000..0e06cfd --- /dev/null +++ b/systemd/adbd-functionfs.sh @@ -0,0 +1,10 @@ +#!/bin/sh +set -e +mkdir -p /dev/usb-ffs +chmod 0770 /dev/usb-ffs +chown shell:shell /dev/usb-ffs +mkdir -p /dev/usb-ffs/adb +chmod 0770 /dev/usb-ffs/adb +chown shell:shell /dev/usb-ffs/adb +/bin/mount -t functionfs adb /dev/usb-ffs/adb -o uid=shell,gid=shell +exit 0 diff --git a/systemd/adbd-prepare.service b/systemd/adbd-prepare.service new file mode 100644 index 0000000..fe0eaf4 --- /dev/null +++ b/systemd/adbd-prepare.service @@ -0,0 +1,17 @@ +# Copyright (C) 2013 Jolla Oy +# +# Prepare functionfs for adbd + +[Unit] +Description=functionfs setup for adbd +Before=adbd.service +PartOf=adbd.service + +[Service] +Type=notify +RemainAfterExit=yes +ExecStart=/usr/sbin/adbd-functionfs.sh +ExecStop=/bin/umount adb + +[Install] +WantedBy=graphical.target