[laptop-mode] Making install.sh more distribution independent

Bart Samwel bart at samwel.tk
Tue Jul 15 09:17:54 CEST 2008


Hi Alon,
Alon Bar-Lev wrote:
> Hello,
> 
> Thank you for your response.
> 
> On 7/14/08, Bart Samwel <bart at samwel.tk> wrote:
>> Hi Alon,
>>
>>
>>  Alon Bar-Lev wrote:
>>  > Can you please consider making the script more distribution independent?
>>
>>
>> Sure, I can do that. For Debian I kind of copied everything, but it
>>  would be nice if other distros could simply call install.sh.
>>
> 
> Great!
> 
>>  > For example:
>>  >
>>  > a) support DESTDIR
>>  >
>>  > DESTDIR=/tmp/temp-root ./install.sh
>>  >
>>  > This will install all required files into $DESTDIR so that package management can
>>  > commit the files.
>>
>>
>> Sounds like a good idea. I can do that.
>>
>>
>>  > b) Do not handle init.d
>>  >
>>  > INIT_D="skip" ./install.sh
>>  >
>>  > This will not modify the init.d script, so that distribution specific init.d script may be used.
>>
>>
>> OK, sounds very acceptable too.
>>
>>
>>  > c) Manual selection of acpi/apm support.
>>  >
>>  > ACPI="no" APM="auto" ./install.sh
>>
>>
>> Hmmm, can you explain the use of this for package managers? I'd expect
>>  that you would want to be able to enable *everything*:
>>
>>  FORCE_ALL_POWERMGMT_TYPES=1 ./install.sh
>>
>>  so that you as a package writer have all files at your disposal below
>>  $DESTDIR, installed in the correct locations. And then you yourself can
>>  install only the subtrees intended for the power management daemon that
>>  you want. Or not?
> 
> This means that one need to know which files belongs to which daemon.
> Best if you, as author, decide which goes where and when.
> For example, if one installs from source, the package management knows
> what the user want to install, and it should be able not to "auto
> detect" the environment if it likes.
> This why I separated the two types.
> 
> To force both:
> ACPI="yes" APM="yes" ./install.sh
> To enable one:
> ACPI="yes" APM="no" ./install.sh
> Current behavior:
> ACPI="auto" APM="auto" ./install.sh

I've implemented this for version 1.44. I can now do:

DESTDIR=~/testinstall INIT_D=none APM=force ACPI=disabled PMU=auto
./install.sh

If DESTDIR is given, the power management options "auto" and "force" are
both treated as "force" -- if you specify a DESTDIR, you basically say
"I'm a package manager, don't try to do determine anything from the
current system", so autodetection is meaningless. When a DESTDIR is
given, it also doesn't install runlevel scripts even if INIT_D is given
(since it can't use chkconfig or update-rc.d), and it doesn't try to
restart services.

Please try it when I've released it, and let me know what you think. If
you have any more suggestions for improvement, please let me know!

Cheers,
Bart


More information about the laptop-mode mailing list