[Nut-upsdev] Re: [nut-commits] svn commit r831 - in trunk: . docs scripts

Peter Selinger selinger at mathstat.dal.ca
Tue Feb 27 22:04:28 CET 2007


Arjen de Korte wrote:
> 
> Peter Selinger wrote:
> 
> > However, if the user specifies a list of drivers with
> > --with-drivers=driver[,driver...], then it is not so easy to detect
> > whether any of these require USB support. For this, the configure
> > script would have to contain a list of USB drivers, which adds one
> > more thing to update that could easily be forgotten.
> 
> Hmmm, that's another way to look at it.
> 
> > Is it a problem to install the hotplug/udev rules, even when no USB
> > driver has been requested?
> 
> Partially. The rules assume that the user specified in RUN_AS_USER
> exists, which may not be (and in my case is not) the case. Therefor at
> startup the system will complain about about this.

I see. Something needs to be done about this, although I am not yet
sure of the best way to address it. We could add a check for whether
the specified user exists, but that could be misleading, because the
user must be manually created, and there is no reason to do it before
(rather than after) running ./configure. We could fail if the user
doesn't exist, but then your setup would no longer be possible. 

Why would you want to compile in a user that doesn't exist? 
 
> > By default, this will only be done if the corresponding directory
> > exists, so should not give any errors or strange behavior.
> 
> Other than the above, no problems.
> 
> > The rule will never do anything unless a known UPS
> > is plugged into the USB port, in which case it's probably desired. 
> 
> I agree. Yet it is a little counter intuitive that if you don't want USB
> support compiled in (for whatever reason) and specify --without-usb, you
> still have to add --without-hotplug-dir and --without-udev-dir to get
> rid of the startup errors.
> 
> I had expected that --without-usb implies --without-hotplug-dir and
> --without-udev-dir.

The problem is something like

./configure --without-all --with-driver=newhidups

which is typical for a user who wants no optional features or drivers,
except the one driver. --without-all implies --without-usb, and this
would imply  --without-hotplug-dir and --without-udev-dir. What is
counterintuitive is that you can compile the newhidups driver even if
you have selected --without-usb.

Here is how it currently works:

(A) if you don't give the --with-driver=DRIVERS flag, then the
    following options determine the list of drivers that will be
    built:

      --with-serial           build and install serial drivers (yes)
      --with-usb              build and install USB drivers (auto)
      --with-snmp             build and install SNMP drivers (auto)
      --with-hal              build and install HAL support (auto)

(B) if you do give the --with-driver=DRIVERS flag, the the above four
    options will be mostly ignored ("mostly" because some tests may be
    run based on the options, but it will not affect the list of
    drivers to build).

The fact that (B) overrides (A) has been a source of confusion in the
past. 

-- Peter




More information about the Nut-upsdev mailing list