Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge branch 'upstream_sync' into 'master'
Upstream sync

[version] Merge changes from upstream 0.86.0 version. Fixes MER#1583

Cherry-pick commits from upstream repo that are missing from mer usb-moded.

Due to version conflicts created earlier, the mer versions (that are
higher than ones used by upstream) are retained in configure.ac and
rpm/usb-moded.spec -files.

See merge request !18
  • Loading branch information
spiiroin committed Nov 3, 2016
2 parents 9686147 + e7d7bcc commit adf228b
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 2 deletions.
1 change: 1 addition & 0 deletions configure.ac
Expand Up @@ -23,6 +23,7 @@ test_gcc_flag() {
# We use gnu99 instead of c99 because many have interpreted the standard
# in a way that int64_t isn't defined on non-64 bit platforms.
CFLAGS="-Os -std=gnu99 -Wall -W -Wextra -pipe -Wformat -Wold-style-definition -Wdeclaration-after-statement -Wfloat-equal -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wendif-labels -Wpointer-arith -Wcast-align -Wwrite-strings -Winline -Wno-unused-parameter -finline-small-functions -Wno-unused-result -fstack-protector -D_FORTIFY_SOURCE=2 -Wl,-z,relro,-z,now -fPIE -fpie -pie"
LDFLAGS="-z relro -z now"

AC_ARG_ENABLE([debug], AS_HELP_STRING([--enable-debug],[Enable debug @<:@default=false@:>@]),
[case "${enableval}" in
Expand Down
9 changes: 9 additions & 0 deletions debian/changelog
@@ -1,3 +1,12 @@
usb-moded (0.86.0) unstable; urgency=low

* [ssu] Get device manufacturer and product name from ssu. Fixes JB#35156
* [dbus] Handle missing mode setting gracefully. Fixes MER#1576
* Bump version to enable to sync up with mer changes and get mer to use
upstream derived version numbering.

-- Philippe De Swert <philippedeswert@gmail.com> Sun, 29 May 2016 15:19:26 +0300

usb-moded (0.85.5) unstable; urgency=low

* [network] Set max_leases in udhcpd configuration. Fixes JB#18566
Expand Down
7 changes: 6 additions & 1 deletion rpm/usb-moded.spec
Expand Up @@ -359,7 +359,9 @@ install -m 755 -D systemd/turn-usb-rescue-mode-off %{buildroot}/%{_bindir}/turn-
install -m 644 -D systemd/usb-rescue-mode-off.service %{buildroot}/lib/systemd/system/usb-rescue-mode-off.service
install -m 644 -D systemd/usb-rescue-mode-off.service %{buildroot}/lib/systemd/system/graphical.target.wants/usb-rescue-mode-off.service
install -m 644 -D systemd/usb-moded.conf %{buildroot}/%{_sysconfdir}/tmpfiles.d/usb-moded.conf

install -m 644 -D systemd/adbd-prepare.service %{buildroot}/lib/systemd/system/adbd-prepare.service
install -m 644 -D systemd/adbd-prepare.service %{buildroot}/lib/systemd/system/graphical.target.wants/adbd-prepare.service
install -m 744 -D systemd/adbd-functionfs.sh %{buildroot}/usr/sbin/adbd-functionfs.sh

%preun
systemctl daemon-reload || :
Expand Down Expand Up @@ -435,6 +437,9 @@ systemctl daemon-reload || :
%{_sysconfdir}/usb-moded/run/adb-startserver.ini
%{_sysconfdir}/usb-moded/run/adb-prepare.ini
%{_sysconfdir}/usb-moded/run/udhcpd-adb-mode.ini
/lib/systemd/system/adbd-prepare.service
/lib/systemd/system/graphical.target.wants/adbd-prepare.service
/usr/sbin/adbd-functionfs.sh

%files mtp-mode-android
%defattr(-,root,root,-)
Expand Down
4 changes: 3 additions & 1 deletion src/usb_moded.c
Expand Up @@ -624,9 +624,11 @@ static void usb_moded_init(void)
readlist(diag_mode);
/* make sure all services are down when starting */
appsync_stop(1);
modelist = read_mode_list(diag_mode);
#endif /* APP_SYNC */

/* always read dyn modes even if appsync is not used */
modelist = read_mode_list(diag_mode);

if(check_trigger())
trigger_init();

Expand Down
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 adf228b

Please sign in to comment.