You are not logged in.
pkgname=laptop-mode-tools
pkgver=1.02
pkgrel=1
pkgdesc="Usermode tools for configuring the kernel's laptop-mode"
url="http://www.xs4all.nl/~bsamwel/laptop_mode/index.html"
source=(http://www.xs4all.nl/~bsamwel/laptop_mode/tools/downloads/${pkgname}_${p
kgver}.tar.gz
laptop-mode.rcd)
md5sums=('2d6ff92d3e18845bea2f3cd18815ede0' 'dbf0407477967a2bb4724f574bd27d7d')
build()
{
cd $startdir/src/$pkgname-$pkgver
make || return 1
mkdir -p $startdir/pkg/etc/rc.d
install -m755 $startdir/laptop-mode.rcd $startdir/pkg/etc/rc.d/laptop-mode
install -d etc/laptop-mode $startdir/pkg/etc
install -d etc/acpi $startdir/pkg/etc
install -d etc/apm $startdir/pkg/etc
mkdir -p $startdir/pkg/usr/sbin
install -m755 usr/sbin/laptop_mode $startdir/pkg/usr/sbin
mkdir -p $startdir/pkg/usr/local/man/man8
install -m644 man/laptop_mode.8 $startdir/pkg/usr/local/man/man8
install -m644 man/laptop-mode.conf.8 $startdir/pkg/usr/local/man/man8
}
and laptop-mode.rcd
#!/bin/sh
. /etc/rc.conf
. /etc/rc.d/functions
case $1 in
start)
stat_busy "Initializing Laptop Mode"
touch /var/run/laptop-mode-enabled
/usr/sbin/laptop_mode auto > /dev/null
if [ $? -gt 0 ]; then
stat_fail
else
stat_done
fi
;;
stop)
echo -n "Stopping laptop mode..."
rm -f /var/run/laptop-mode-enabled
/usr/sbin/laptop_mode stop > /dev/null
if [ $? -gt 0 ]; then
stat_fail
else
stat_done
fi
;;
restart)
$0 stop
$0 start
;;
*) echo "usage: $0 {stop|start|restart}" >&2
;;
esac
package also in my repo
Offline
How well is it working for you, what kind of difference are you seeing on battery life phrakture?
Offline
mkdir -p $startdir/pkg/usr/local/man/man8
install -m644 man/laptop_mode.8 $startdir/pkg/usr/local/man/man8
install -m644 man/laptop-mode.conf.8 $startdir/pkg/usr/local/man/man8
This is the only part in which I think there is a problem. My understanding that Arch didn't use /usr/local at all unless it was a locally installed program, ie not a package. I don't have any man pages under /usr/local/man. All of mine are under /usr/man. But it would be an easy enough fix. Now to see if the program makes a difference on my battery eating laptop.
Offline
whoops... sorry - i used the install script for the package to make the pkgbuild and copied most verbatim.....
i apologize for the man page error
Offline
Hi. Thanks for the PKGBUILD. Just wanted to say that the config files weren't installed, I had to move them manually from src/laptop-mode-tools-1.02/etc to /etc/laptop-mode. I might have done something wrong though, since I'm new to arch. But I was wondering what exatly laptop-mode does? I thought it as supposed to spin done the drive, but I'm not sure it does. Is there a way to find out if the drive is idle or not?
Offline
If the drivee is idle you will hear a noise when it "awakes".
Offline
Thanks, but I was looking for something more black on white..
Offline
I realized the config was merged in the script itself... so, nevermind my previous remark on the config-files. It seems to work great
Offline
Something's continuously forcing my disk to spin up. I'd wager it's syslog-ng. How do I stop it from writing to disk. I have this in /etc/syslog-ng/syslog-ng.conf
#
# /etc/syslog-ng/syslog-ng.conf
#
options {
sync (0);
time_reopen (10);
log_fifo_size (1000);
long_hostnames(off);
use_dns (no);
use_fqdn (no);
create_dirs (no);
keep_hostname (yes);
};
source src {
unix-stream("/dev/log");
internal();
pipe("/proc/kmsg");
};
#destination authlog { file("/var/log/auth.log"); };
#destination syslog { file("/var/log/syslog.log"); };
#destination cron { file("/var/log/crond.log"); };
#destination daemon { file("/var/log/daemon.log"); };
#destination kernel { file("/var/log/kernel.log"); };
#destination lpr { file("/var/log/lpr.log"); };
#destination user { file("/var/log/user.log"); };
#destination uucp { file("/var/log/uucp.log"); };
#destination mail { file("/var/log/mail.log"); };
#destination news { file("/var/log/news.log"); };
##destination debug { file("/var/log/debug.log"); };
#destination messages { file("/var/log/messages.log"); };
#destination errors { file("/var/log/errors.log"); };
#destination everything { file("/var/log/everything.log"); };
#destination iptables { file("/var/log/iptables.log"); };
#destination console { usertty("root"); };
# Log everything to vc12
destination console_all { file("/dev/vc/12"); };
filter f_auth { facility(auth); };
filter f_authpriv { facility(auth, authpriv); };
filter f_syslog { program(syslog-ng); };
filter f_cron { facility(cron); };
filter f_daemon { facility(daemon); };
filter f_kernel { facility(kern); };
filter f_lpr { facility(lpr); };
filter f_mail { facility(mail); };
filter f_news { facility(news); };
filter f_user { facility(user); };
filter f_uucp { facility(cron); };
filter f_news { facility(news); };
#filter f_debug { not facility(auth, authpriv, news, mail); };
filter f_messages { level(info..warn) and not facility(auth, authpriv, mail, news) and not program(syslog-ng); };
filter f_everything { level(debug..emerg) and not facility(auth, authpriv); };
filter f_emergency { level(emerg); };
filter f_info { level(info); };
filter f_notice { level(notice); };
filter f_warn { level(warn); };
filter f_crit { level(crit); };
filter f_err { level(err); };
filter f_iptables { match("IN="); };
#log { source(src); filter(f_authpriv); destination(authlog); };
#log { source(src); filter(f_syslog); destination(syslog); };
#log { source(src); filter(f_cron); destination(cron); };
#log { source(src); filter(f_daemon); destination(daemon); };
#log { source(src); filter(f_kernel); destination(kernel); };
#log { source(src); filter(f_lpr); destination(lpr); };
#log { source(src); filter(f_mail); destination(mail); };
#log { source(src); filter(f_news); destination(news); };
#log { source(src); filter(f_user); destination(user); };
#log { source(src); filter(f_uucp); destination(uucp); };
##log { source(src); filter(f_debug); destination(debug); };
#log { source(src); filter(f_messages); destination(messages); };
#log { source(src); filter(f_err); destination(errors); };
#log { source(src); filter(f_emergency); destination(console); };
#log { source(src); filter(f_everything); destination(everything); };
#log { source(src); filter(f_iptables); destination(iptables); };
# Log everything to vc12
log { source(src); destination(console_all); };
...but that doesn't seem to help. Thanks in advance.
Offline
why does one wanna use laptop-mode-tools? what do they provide which the kernel and cpufreq don't?
I do use a laptop as my primary computer, but never used laptopmodes....should I?
http://www.linuxportalen.com -> Linux Help portal for Linux and ArchLinux (in swedish)
Dell Inspiron 8500
Kernel 2.6.14-archck1 (selfcompiled)
Enlightenment 17
Offline
I only use it in order to get a drive spin down (which I guess you could do with hdparm)- it has some additional features, like caching a certain amount of writes to memory, and then flush everything at once when the drive spins up. You should check the script which starts with the configs in order to see the available features. I don't use it to manage cpu-frequencies though.
Offline
all these tools really do is "echo 1 >> /proc/sys/..../laptop_mode"
I don't use this anymore, I just set laptop mode to 1 in rc.local
laptop_mode doesn't do disk spindown the same way hdparm does. It tells the kernel to hold disk writes for a number of seconds in case there are more writes... so if I wrote 10b, 10b, 10b, 10b, 10b, the kernel would normally write 5 10b blocks... with laptop mode on, it would probably write a 30b block and a 20b block (just making it up as I don't know the "wait time")
Offline
all these tools really do is "echo 1 >> /proc/sys/..../laptop_mode"
Yeah, that's smart. How about the config, then? Do you still have /etc/laptop-mode/laptop-mode.conf?
And, also, is it really no problem for the drive to spin up & down continuously?
Offline
all these tools really do is "echo 1 >> /proc/sys/..../laptop_mode"
Yeah, that's smart. How about the config, then? Do you still have /etc/laptop-mode/laptop-mode.conf?
And, also, is it really no problem for the drive to spin up & down continuously?
laptop mode is part of the kernel (been around since 2.6.4 or something) - the laptop mode tools simply toggle around the kernel's laptop mode
disk spin up/down isn't an issue, really - it's just that a) this may prolong disk life by a tad and b) prevents extra noise/heat from the laptop
Offline
laptop mode is part of the kernel (been around since 2.6.4 or something) - the laptop mode tools simply toggle around the kernel's laptop mode
but if you just "echo 1 > /proc/sys/vm/laptop-mode", what decides how long the disk will be idle before it spins down?
disk spin up/down isn't an issue, really - it's just that a) this may prolong disk life by a tad and b) prevents extra noise/heat from the laptop
Oh, that's a relief
Offline
Something's continuously forcing my disk to spin up. I'd wager it's syslog-ng. How do I stop it from writing to disk. I have this in /etc/syslog-ng/syslog-ng.conf
be very careful with this... it gets crazy... do it for like 1min max
echo 1 >> /proc/sys/vm/block_dump
this will log to dmesg info about which process is causing the disk spin up
...
the write delay is set in the kernel, but laptop_mode... I have no clue what it's set at....
Offline
Thanks alot! That's preciely what I've been looking for. I'm gonna try that out next time I'm on battery.
Offline
Hi phrakture,
I've tryed the PKGBUILD, but I don't know why the "install -d" doesn't seem to work...
So I've adapted your PKGBUILD (and updated to lates program version) following the install.sh script.
The PKGBUILD now create explicitly the folders, then use install -mXXX with permissions taken from the install.sh. Its longer to create such a pkgbuild but its cleaner.
Here it is:
PKGBUILD
pkgname=laptop-mode-tools
pkgver=1.06
pkgrel=1
pkgdesc="Usermode tools for configuring the kernel's laptop-mode"
url="http://www.xs4all.nl/~bsamwel/laptop_mode/index.html"
backup=('/etc/laptop-mode/laptop-mode.conf')
source=(http://www.xs4all.nl/~bsamwel/laptop_mode/tools/downloads/${pkgname}_${pkgver}.tar.gz laptop-mode.rcd)
md5sums=('d8001d456ae2005a78a5fae8b96d34a1' '93c90238995f7b20bda1b0bf7cfe16b1')
build() {
cd $startdir/src/$pkgname-$pkgver
mkdir -p $startdir/pkg{/etc{/acpi{/actions,/events},/apm/event.d,/laptop-mode,/power{/event.d,/scripts.d},/rc.d},/usr{/sbin,/man/man8}}
install -m600 etc/laptop-mode/laptop-mode.conf $startdir/pkg/etc/laptop-mode/laptop-mode.conf
install -m700 usr/sbin/laptop_mode $startdir/pkg/usr/sbin
install -m700 usr/sbin/lm-syslog-setup $startdir/pkg/usr/sbin
install -m700 etc/acpi/actions/* $startdir/pkg/etc/acpi/actions
install -m600 etc/acpi/events/* $startdir/pkg/etc/acpi/events
install -m700 etc/apm/event.d/* $startdir/pkg/etc/apm/event.d
# No pbbuttons support
install -m755 $startdir/laptop-mode.rcd $startdir/pkg/etc/rc.d/laptop-mode
install -m644 man/laptop_mode.8 $startdir/pkg/usr/man/man8
install -m644 man/laptop-mode.conf.8 $startdir/pkg/usr/man/man8
}
laptop-mode.rcd (unchanged)
#!/bin/sh
. /etc/rc.conf
. /etc/rc.d/functions
case $1 in
start)
stat_busy "Initializing Laptop Mode"
touch /var/run/laptop-mode-enabled
/usr/sbin/laptop_mode auto > /dev/null
if [ $? -gt 0 ]; then
stat_fail
else
stat_done
fi
;;
stop)
echo -n "Stopping laptop mode..."
rm -f /var/run/laptop-mode-enabled
/usr/sbin/laptop_mode stop > /dev/null
if [ $? -gt 0 ]; then
stat_fail
else
stat_done
fi
;;
restart)
$0 stop
$0 start
;;
*) echo "usage: $0 {stop|start|restart}" >&2
;;
esac
Offline
ummm this has been in the AUR for some time - please check there before posting PKGBUILDs to the forum - this is a very old thread too
Offline
Please correct it if I'm wrong,
but _laptop-mode.rcd_ has moved to _/etc/rc.d/laptop-mode_
I'm running _laptop-mode-tools 1.05-1_
Seeded last month: Arch 50 gig, derivatives 1 gig
Desktop @3.3GHz 8 gig RAM, linux-ck
laptop #1 Atom 2 gig RAM, Arch linux stock i686 (6H w/ 6yrs old battery ) #2: ARM Tegra K1, 4 gig RAM, ChrOS
Atom Z520 2 gig RAM, OMV (Debian 7) kernel 3.16 bpo on SDHC | PGP Key: 0xFF0157D9
Offline