Summary: | sys-apps/usb_modeswitch - udev support needs RW temporary directory | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Maciej S. Szmigiero <mail> |
Component: | [OLD] Core system | Assignee: | Rafael Martins (RETIRED) <rafaelmartins> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | freedesktop-bugs, mmokrejs |
Priority: | Normal | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- |
Description
Maciej S. Szmigiero
2015-11-09 16:24:14 UTC
> Simplest solution is to let "modules" init script be ordered after "root" by
> adding "after root" to /etc/init.d/modules.
In openrc-0.21+ /etc/init.d/modules-load needs similar treatment, too.
However, there is a problem that now fsck service will be run after root was
mounted RW (since it contains "use modules") and so will not check root
filesystem.
I think that fsck should be split into two services: one for checking root fs
(and without "use modules") and second one for checking remaining filesystems
(which can need some modules loaded so with "use modules").
> > Simplest solution is to let "modules" init script be ordered after "root" by
> > adding "after root" to /etc/init.d/modules.
>
> In openrc-0.21+ /etc/init.d/modules-load needs similar treatment, too.
>
> However, there is a problem that now fsck service will be run after root was
> mounted RW (since it contains "use modules") and so will not check root
> filesystem.
>
> I think that fsck should be split into two services: one for checking root fs
> (and without "use modules") and second one for checking remaining filesystems
> (which can need some modules loaded so with "use modules").
It looks like there are even more init scripts with dependency on "root" init script being after "modules" that changing them all would amount to a significant work (not to mention a real possibility of breaking some use case).
Fortunately, what sys-apps/usb_modeswitch scripts really want is just a writable temporary directory:
it is needed (at least) for shell here-document in /lib/udev/usb_modeswitch and
for Tcl exec command used by /usr/sbin/usb_modeswitch_dispatcher.
This requirement can easily be satisfied on current OpenRC by setting TMPDIR to "/run" in /lib/udev/usb_modeswitch:
--- 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
This way USB modem switching on boot works properly without any changes to init
scripts (tested by me).
Created Github PR 3389 that includes a fix for this bug. Need this to fix my laptop. [master 2e2ceb7093] sys-apps/usb_modeswitch: udev scripts need RW temporary directory Author: Maciej S. Szmigiero <mail@maciej.szmigiero.name> Date: Sun Jan 8 23:47:56 2017 +0100 2 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 sys-apps/usb_modeswitch/files/usb_modeswitch.sh-tmpdir.patch rename sys-apps/usb_modeswitch/{usb_modeswitch-2.4.0.ebuild => usb_modeswitch-2.4.0-r1.ebuild} (94%) |