Re: Laptop-mode-tools question.

17 views
Skip to first unread message

Ritesh Raj Sarraf

unread,
Jan 8, 2019, 12:34:39 AM1/8/19
to nasm, laptop-m...@googlegroups.com
On Sun, 2019-01-06 at 18:45 +0500, nasm wrote:
> Hello!
>
> I have question.
>
> How redefine(customize) settings laptop-mode in board-specific
> directory, if last read /etc/laptop-mode/laptop-mode.conf ( redefine
> only variable from /etc/laptop-mode/conf.d) ?

Hi,

The board-specific directory is used to override settings specific to
the modules. This is mostly useful for OEMs that are using laptop-mode-
tools as a power saving tool for their platforms.

For example, developers could ship a runtime-pm.conf specific to their
board types, overriding the generic default configuration file.

For laptop-mode.conf, it is primarily the main file that defines
application wide settings. So, it was left out of the overrides.



>
> Thank you and Happy new year!
>
>
> P.S. Sorry for my bad english.
>
>
> CONF_DIR=""
> test -d /etc/laptop-mode/conf.d && CONF_DIR="$CONF_DIR
> /etc/laptop-mode/conf.d"
> test -d /etc/laptop-mode/conf.d/board-specific &&
> CONF_DIR="$CONF_DIR /etc/laptop-mode/conf.d/board-specific"
>
> for PER_DIR in $CONF_DIR; do
> for CONF in $PER_DIR/*.conf; do
> if [ -r "$CONF" ] ; then
> . "$CONF"
> #Handle individual module debug
> settings
> if [ "$DEBUG" -eq 1 ]; then
> export $(basename $CONF |
> cut
> -d . -f1 | tr "[:lower:]" "[:upper:]" | sed 's/-/_/g')_DEBUG=1
> log "VERBOSE" "Enabling
> debug
> mode for module $CONF"
> fi
> DEBUG=0
> else
> log "MSG" "Warning: Configuration
> file
> $CONF is not readable, skipping."
> fi
> done
> done
>
> if [ -r /etc/laptop-mode/laptop-mode.conf ] ; then
> . /etc/laptop-mode/laptop-mode.conf
> else
> log "ERR" "$0: Configuration file
> /etc/laptop-mode/laptop-mode.conf not present or not readable."
> exit 1
> fi
>
--
Ritesh Raj Sarraf
RESEARCHUT - http://www.researchut.com
"Necessity is the mother of invention."
signature.asc
Reply all
Reply to author
Forward
0 new messages