summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaciej S. Szmigiero <mail@maciej.szmigiero.name>2017-01-08 23:47:56 +0100
committerRobin H. Johnson <robbat2@gentoo.org>2017-02-03 13:47:32 -0800
commit2e2ceb709324edec7baf64370ba3d3070e8d43f2 (patch)
tree277ce2efb53968b86cc181efc478e1f2a34925a8
parentsys-fs/squashfs-tools: fix build with musl (diff)
downloadgentoo-2e2ceb709324edec7baf64370ba3d3070e8d43f2.tar.gz
gentoo-2e2ceb709324edec7baf64370ba3d3070e8d43f2.tar.bz2
gentoo-2e2ceb709324edec7baf64370ba3d3070e8d43f2.zip
sys-apps/usb_modeswitch: udev scripts need RW temporary directory
/lib/udev/usb_modeswitch script and usb_modeswitch_dispatcher Tcl script that it calls both need a writable temporary directory which is a problematic requirement for example if usb_modeswitch is triggered by a module loaded during system startup. Fortunately, /run is available RW very early at boot so let's redirect them there instead. Fixes a case where system startup with an USB modem plugged in would often result in this modem not being switched correctly if USB host controller modules are loaded via the "modules" service. Gentoo-Bug: https://bugs.gentoo.org/565262 Fixes: https://github.com/gentoo/gentoo/pull/3389 Package-Manager: Portage-2.3.3, Repoman-2.3.1 (cherry picked from commit 1cede4c86a4e691cd51f82aad27c2a4e543cacdd) Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
-rw-r--r--sys-apps/usb_modeswitch/files/usb_modeswitch.sh-tmpdir.patch18
-rw-r--r--sys-apps/usb_modeswitch/usb_modeswitch-2.4.0-r1.ebuild (renamed from sys-apps/usb_modeswitch/usb_modeswitch-2.4.0.ebuild)3
2 files changed, 20 insertions, 1 deletions
diff --git a/sys-apps/usb_modeswitch/files/usb_modeswitch.sh-tmpdir.patch b/sys-apps/usb_modeswitch/files/usb_modeswitch.sh-tmpdir.patch
new file mode 100644
index 000000000000..5039d44da1fd
--- /dev/null
+++ b/sys-apps/usb_modeswitch/files/usb_modeswitch.sh-tmpdir.patch
@@ -0,0 +1,18 @@
+Script that this patch modifies and usb_modeswitch_dispatcher Tcl script
+that is being called by it both need a writable temporary directory which
+is a problematic requirement for example if usb_modeswitch is triggered
+by a module loaded during system startup.
+Fortunately, /run is available very early at boot so let's redirect them
+there instead.
+
+--- a/usb_modeswitch.sh 2016-11-29 17:29:47.000000000 +0100
++++ b/usb_modeswitch.sh 2016-11-30 01:11:51.747993839 +0100
+@@ -17,6 +17,8 @@
+ return 0
+ }
+
++export TMPDIR=/run
++
+ if [ $(expr "$1" : "--.*") ]; then
+ p_id=$4
+ if [ -z $p_id ]; then
diff --git a/sys-apps/usb_modeswitch/usb_modeswitch-2.4.0.ebuild b/sys-apps/usb_modeswitch/usb_modeswitch-2.4.0-r1.ebuild
index ceb9bfd3b851..74132f36d153 100644
--- a/sys-apps/usb_modeswitch/usb_modeswitch-2.4.0.ebuild
+++ b/sys-apps/usb_modeswitch/usb_modeswitch-2.4.0-r1.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2016 Gentoo Foundation
+# Copyright 1999-2017 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$
@@ -37,6 +37,7 @@ CONFIG_CHECK="~USB_SERIAL"
src_prepare() {
sed -i -e '/install.*BIN/s:-s::' Makefile || die
+ epatch "${FILESDIR}/usb_modeswitch.sh-tmpdir.patch"
}
src_compile() {