Navigation Menu

Skip to content

Commit

Permalink
adb: Add missing scripts and service for adb mode
Browse files Browse the repository at this point in the history
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 <philippedeswert@gmail.com>
  • Loading branch information
philippedeswert authored and spiiroin committed Nov 2, 2016
1 parent efe0512 commit caccfdc
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
10 changes: 10 additions & 0 deletions 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
17 changes: 17 additions & 0 deletions 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

0 comments on commit caccfdc

Please sign in to comment.