#756046 laptop-mode-tools: config file hard defaults to non-existent device

#756046#5
Date:
2014-07-25 17:31:18 UTC
From:
To:
Dear Maintainer,


The package installs a config file, "/etc/laptop-mode/conf.d/ethernet.conf", which on line 59 sets ETHERNET_DEVICES="eth0", without first checking whether such a device exists (I ususally does, but see below), or whether other devices exist instead, or in addition.

In my case, a few months ago debian changed my eth0 to eth1, and my wlan0 to wlan1.

Package laptop-mode-tools did not detect this, and when it updated today (apt-get -t testing upgrade), reported the following:

=== start message ===
Cannot find device "eth0"
/usr/sbin/laptop_mode: 108: [: /sys/bus/platform/devices/SP5100: unexpected operator
/usr/sbin/laptop_mode: 115: [: /sys/bus/platform/devices/SP5100: unexpected operator
/usr/sbin/laptop_mode: 118: [: /sys/bus/platform/devices/SP5100: unexpected operator
[ ok ] Laptop mode enabled, not active.
=== end message ===

The install should check for the valid existing device names and insert them into the config file

#756046#10
Date:
2014-07-25 18:12:48 UTC
From:
To:
I agree. But that's a wishlist for LMT's preinst script.
#756046#17
Date:
2014-07-28 15:43:28 UTC
From:
To:
Please reconsider. The purpose of a package management system is to
install and configure a package to a working, useful state, and this is
not happening.

#756046#22
Date:
2014-09-25 11:32:23 UTC
From:
To:
Please give me your thoughts here. If you were to do, how'd you approach
it ?

Putting this into Debhelper would mean a human intervention is required.
Now imagine 1000 Linux desktops.
Also, if we look at some of our derivatives (Ubuntu), they hide almost
all prompts from the user.


That made me think how would an IT team handle this.....
In LMT, we have a framework to handle scenarios like these.....

Quoting the manpage:

    /etc/laptop-mode/conf.d/board-specific/
        The board-specific settings framework is for users and
distributors who would like to ship their
        local customized settings on top of the default settings shipped
upstream.

        Add local customized settings under this folder to override the
system defaults.


Now one could use this to override the upstream defaults. This could
also include hardcoded device names.



What do you say ???