[systemd-devel] systemd unit review requested
Peter Hutterer
peter.hutterer at who-t.net
Thu Dec 5 22:20:09 PST 2013
On Thu, Dec 05, 2013 at 01:24:10PM +0000, "Jóhann B. Guðmundsson" wrote:
>
> On 12/05/2013 12:28 PM, Michael Biebl wrote:
> >2013/12/5 "Jóhann B. Guðmundsson"<johannbg at gmail.com>:
> >>On 12/05/2013 06:50 AM, Peter Hutterer wrote:
> >>>ExecStartPre=/usr/sbin/modprobe wacom_w8001
> >>Add a configuration file called wacom-w8001.conf to /etc/modules-load.d
> >>directory with the following content to load the module
> >>( /etc/modules-load.d/wacom-w8001.conf )
> >># Load wacom_w8001 at boot
> >>wacom_w8001
> >Well, this loads the kernel module unconditionally, though. Even for
> >users which don't have that hardware. So this approach isn't that
> >great.
> >
> >It also depends on the wacom_w8001 and how it reacts when it's loaded
> >and no hardware is present.
> >
> >Peter, couldn't this module be autoloaded?
the module just sits there, it needs to be triggered by
inputattach to actually hook onto the device. there's a small number of
devices only that need it, so unconditionally modprobing it seems a bit
wasteful.
> I'm not that familiar with udev policy regarding rules rule but I
> would think that if you autoload module you tie the startup of the
> systemd unit to the module being loaded ( if the intent is to
> trigger a unit )
>
> So we need an udev wacom-serial-driver rule that might look like
> this for the wacom serial devices
>
> ACTION=="remove", GOTO="drivers_end"
> ENV{MODALIAS}=="?*", RUN{builtin}="kmod load $env{MODALIAS}"
> SUBSYSTEM=="tty|pnp", SUBSYSTEMS=="pnp", ATTRS{id}=="WACf*",
> ENV{ID_MODEL}="Serial Wacom Tablet $attr{id}", ENV{ID_INPUT}="1",
> ENV{ID_INPUT_TABLET}="1", ENV{NAME}="Serial Wacom Tablet $attr{id}
> ,RUN{builtin}="kmod load wacom_w8001"
> SUBSYSTEM=="tty|pnp", SUBSYSTEMS=="pnp", ATTRS{id}=="FUJ*",
> ENV{ID_MODEL}="Serial Wacom Tablet $attr{id}", ENV{ID_INPUT}="1",
> ENV{ID_INPUT_TABLET}="1", ENV{NAME}="Serial Wacom Tablet $attr{id}
> ,RUN{builtin}="kmod load wacom_w8001"
> LABEL="drivers_end"
>
> Followed by an systemd rule that looks something like this
>
> SUBSYSTEM=="module", KERNEL=="wacom*", TAG+="systemd",
> ENV{SYSTEMD_WANTS}+="wacom-inputattach@%k.service"
>
> And the modprobe would be dropped from that unit file but as I say
> I'm not all that familiar with udev policy rules and I personally
> had not planned on mastering udev until I started the cleanup
> process in Fedora which might never happen today thanks to the that
> WG process.
thanks, that seems to be the best solution so far (haven't tested it yet
though :). Can anyone confirm that this matches the current policies?
Thanks
Cheers,
Peter
More information about the systemd-devel
mailing list