First Last Prev Next    No search results available      Search page      Enter new bug
Bug#: 45593
Alias:
Product:
Component:
Status: CLOSED
Resolution: FIXED
Assigned To: Mobile Herd <mobile@gentoo.org>
Hardware:
OS:
Version:
Priority:
Severity:
Reporter: Johannes Ballé <os@xn--ball-epa.net>
Add CC:
CC:
Remove selected CCs
URL:
Summary:
Status Whiteboard:
Keywords:

Filename Description Type Creator Created Size Actions
laptop_mode.tar.gz The init script application/octet-stream Johannes Ballé 2004-03-24 05:16 0000 1.49 KB Details
laptop-mode-for-2.6.3.patch The patch which I used patch Johannes Ballé 2004-03-24 05:18 0000 22.37 KB Details | Diff
laptop-mode-20040403.ebuild laptop-mode-20040403.ebuild text/plain Dennis Nienhüser 2004-05-26 08:40 0000 861 bytes Details
laptop-mode.conf files/laptop-mode.conf text/plain Dennis Nienhüser 2004-05-26 08:41 0000 1.11 KB Details
laptop-mode.init files/laptop-mode.init text/plain Dennis Nienhüser 2004-05-26 08:45 0000 8.11 KB Details
laptop-mode.conf laptop-mode.conf text/plain Dennis Nienhüser 2004-07-02 05:54 0000 1.38 KB Details
laptop-mode.init laptop-mode.init text/plain Dennis Nienhüser 2004-07-02 05:55 0000 9.00 KB Details
laptop-mode.conf laptop-mode.conf text/plain Dennis Nienhüser 2004-09-06 02:56 0000 2.53 KB Details
laptop-mode.init laptop-mode.init text/plain Dennis Nienhüser 2004-09-06 02:59 0000 11.25 KB Details
laptop-mode-tools.package.tar.gz laptop-mode-tools.package.tar.gz application/octet-stream Adrian Almenar 2004-09-12 19:01 0000 1.55 KB Details
laptop-mode-tools-1.04.ebuild laptop-mode-tools-1.04.ebuild text/plain Dennis Nienhüser 2004-10-07 09:34 0000 2.13 KB Details
laptop-mode.init files/laptop-mode.init text/plain Dennis Nienhüser 2004-10-07 09:35 0000 692 bytes Details
laptop-mode-tools-1.04.ebuild laptop-mode-tools-1.04.ebuild (alternative version) text/plain TGL 2005-01-18 18:08 0000 1.44 KB Details
laptop-mode-tools-1.04.ebuild laptop-mode-tools-1.04.ebuild (merged) text/plain Christian Ludwig 2005-02-18 07:54 0000 2.14 KB Details
laptop-mode.init laptop-mode.init text/plain Christian Ludwig 2005-02-18 07:55 0000 882 bytes Details
Create a New Attachment (proposed patch, testcase, etc.) View All

Bug 45593 depends on: Show dependency tree
Show dependency graph
Bug 45593 blocks:
Votes: 0    Show votes for this bug    Vote for this bug

Additional Comments: (this is where you put emerge --info)





View Bug Activity   |   Format For Printing   |   XML   |   Clone This Bug


Description:   Opened: 2004-03-24 05:15 0000
Hello,

I put together this init script, which initializes the kernel laptop_mode. I used the init script which is provided with the laptop_mode patch for the linux kernel 2.6.3, and gentooized it.

The script needs hdparm installed, linux kernel 2.4 or 2.6 with the laptop_mode patch applied (I think for the later 2.4 kernels it is official), and the directory /var/lib/laptop_mode created.

For my notebook it works like a charm.

Maybe someone would like to make an ebuild for it.


Reproducible: Always
Steps to Reproduce:
1.
2.
3.



Expected Results:

------- Comment #1 From Johannes Ballé 2004-03-24 05:16:25 0000 -------
Created an attachment (id=27911) [edit]
The init script

------- Comment #2 From Johannes Ballé 2004-03-24 05:18:12 0000 -------
Created an attachment (id=27912) [edit]
The patch which I used

------- Comment #3 From SpanKY 2004-03-28 00:12:18 0000 -------
this is more than just an init script, it's also a kernel patch

------- Comment #4 From Johannes Ballé 2004-03-28 02:58:22 0000 -------
> this is more than just an init script, it's also a kernel patch

actually, since kernel 2.4.something, the patch became part of the official kernel. I forgot in which release it was included first. a kernel patch is therefore only required for the 2.6 series and for older 2.4 kernels. as far as i know, the patch is expected to be included in one of the coming 2.6 releases, too.

so the development of this script may be a little ahead of time, but the functionality it provides is definitely worth it (at least for mobile users)

------- Comment #5 From Dennis Nienhüser 2004-05-17 15:11:24 0000 -------
FYI: laptop mode got integrated into 2.6.6
http://kerneltrap.org/node/view/3070?PHPSESSID=f3d088276600ec6e5949261fd5f680be

------- Comment #6 From Dennis Nienhüser 2004-05-26 08:40:06 0000 -------
Created an attachment (id=32076) [edit]
laptop-mode-20040403.ebuild

Ebuild to install the init script

------- Comment #7 From Dennis Nienhüser 2004-05-26 08:41:09 0000 -------
Created an attachment (id=32077) [edit]
files/laptop-mode.conf

/etc/conf.d/laptop-mode

------- Comment #8 From Dennis Nienhüser 2004-05-26 08:45:53 0000 -------
Created an attachment (id=32078) [edit]
files/laptop-mode.init

/etc/init.d/laptop-mode

I updated Johannes work on the init script 
(integrated the changes that come with kernel-2.6.6_rc1).

It would be nice to have this in the Portage tree. Quite a few kernel sources
include the laptop_mode patch today, and gentoo-dev-sources will do it with the
2.6.6. release, too.

------- Comment #9 From Dennis Nienhüser 2004-06-30 00:33:50 0000 -------
gentoo-dev-sources-2.6.7 is out for some time now. Does anyone care to
integrate laptop-mode into portage? I want to finish bug #52109 now, so if
there'll be no progress on this I'll have to find another way.

------- Comment #10 From Dennis Nienhüser 2004-07-02 05:54:13 0000 -------
Created an attachment (id=34630) [edit]
laptop-mode.conf

The init script that ships with 2.6.7 contains some minor changes (although the
last changed date was not updated).

------- Comment #11 From Dennis Nienhüser 2004-07-02 05:55:04 0000 -------
Created an attachment (id=34631) [edit]
laptop-mode.init

as above

------- Comment #12 From Alan Schmitt 2004-07-02 06:10:01 0000 -------
I would like to try the ebuild by putting it in my overlay dir, but I don't
know where it should go. Is sys-apps/ the correct place? And does it matter?

------- Comment #13 From Johnny Robeson 2004-07-06 23:54:57 0000 -------
i personally put it in app-laptop

------- Comment #14 From Peter Johanson (RETIRED) 2004-07-20 16:00:18 0000 -------
Okay, CCing the base-system guys. This script itself is relatively ugly, and
has a few pretty nasty hacks. What's your take on this? I'm wary of having an
ebuild just for one script like this. Can we integrate either this or something
like this into base-layout maybe? Please either comment here, or catch me on
IRC.

------- Comment #15 From Dennis Nienhüser 2004-07-27 17:14:55 0000 -------
*bump* I'm still trying to reach "FIXED" or "WONTFIX" :)
Does the init script need to be rewritten, or do parts of it have to be changed (like remounting /)?

------- Comment #16 From Aron Griffis (RETIRED) 2004-07-27 19:51:11 0000 -------
I don't see baselayout as being an appropriate target for this.  Single-script
ebuilds are just fine, though it would be better if it could be grouped with
some other laptop stuff.  sys-apps/acpi comes to mind since it makes more sense
to have this script triggered by AC power events than an init script.

I looked through the script.  I agree that it looks pretty shaky, though I
don't know that there's actually anything *wrong* with it.  A bunch of the sed
stuff is overdone and could be accomplished with a few bash expressions (or at
least a single invocation of sed!)

------- Comment #17 From Dennis Nienhüser 2004-07-29 13:39:33 0000 -------
Thanks for looking through it. sys-apps/acpi is a good candidate for a
dependency (as it makes little sense without it). IMHO the init-script 
style is fine. It can easily be placed in a battery runlevel this way 
(and let acpi events switch runlevels).

------- Comment #18 From Dennis Nienhüser 2004-08-02 14:44:31 0000 -------
> I don't see baselayout as being an appropriate target for this.
Who is an appropriate target then? (aka bump ;-)

------- Comment #19 From Priit Laes 2004-08-03 02:39:28 0000 -------
What about this? 

http://www.xs4all.nl/~bsamwel/laptop_mode/tools/index.html

------- Comment #20 From Dennis Nienhüser 2004-08-03 09:34:40 0000 -------
The /usr/sbin/laptop-mode script (actually a modified version of the init
script) could be extracted from this.

------- Comment #21 From Eli Ben-Shoshan 2004-08-09 18:14:27 0000 -------
Just tried it on my Dell D600. Haven't done any battery testing but I have
confirmed that it does at least return the values in /proc back to the kernel
defaults. This could be very useful in the mainline tree. Is there really any
reason why it is not in there anymore?

------- Comment #22 From Bret Towe 2004-08-14 16:47:30 0000 -------
i recently took the latest laptop mode init script from linux kernel and 
make a crappy init script out of it and made it so it loads right after localmount
now i dont think my ver is any better than whats here but i would like to see
the script included in baselayout  the script is good for desktop computers
also on desktop just dont enable the hdparm sleeping and it helps your compiles
as it prevents a bunch of small writes all the time this of course would help
on slower IO systems even more i dont have numbers for you but 
genlop -t somepackage and laptop mode being enabled and disabled can show you


------- Comment #23 From Dennis Nienhüser 2004-09-06 02:56:00 0000 -------
Created an attachment (id=39036) [edit]
laptop-mode.conf

------- Comment #24 From Dennis Nienhüser 2004-09-06 02:59:12 0000 -------
Created an attachment (id=39037) [edit]
laptop-mode.init

Here is the one from kernel 2.6.8.1, dated 2004-06-10
There are some code improvements and new features added. 
Please test and post if it works.

------- Comment #25 From Adrian Almenar 2004-09-12 19:01:23 0000 -------
Created an attachment (id=39477) [edit]
laptop-mode-tools.package.tar.gz

This is a new full ebuild for laptop-mode-tools. It can go inside app-laptop.

Latexer, Here is what we talked about.

------- Comment #26 From Dennis Nienhüser 2004-09-13 02:45:40 0000 -------
Thanks Adrian for attaching this.
I played around with it the last hour, but there are some questionable things left.
First, the ebuild has some problems (unpack is never called, chmod too early, init file needs some clean-up as well) but that can be fixed easily.
What I really don't like is all that file creation in /etc/acpi (or /etc/apm). While CONFIG_PROTECT will prevent damage, it will still be messy if someone wants to merge the files.

------- Comment #27 From Adrian Almenar 2004-09-13 11:49:58 0000 -------
Yeah i know the ebuild can be improved a lot, but its 1000 times easier to
maintain if the original package have big changes or anything than writing
everytime a new init script.

The file creation in /etc/apm and /etc/acpi only gets done if the user has in
USE apm and/or acpi. Its included in the original package. Also, in the
install.sh in the original package, there is a part that talk about installing
on Gentoo and it recommends or better it deletes all in /etc/acpi and /etc/apm.

Sorry but packages should be installed the standard way, just adjusting to only
the strictly necessary.

------- Comment #28 From Dennis Nienhüser 2004-09-13 12:13:03 0000 -------
> Yeah i know the ebuild can be improved a lot, but its 1000 times easier to
> maintain if the original package have big changes or anything than writing
> everytime a new init script.
Agreed. 

> Sorry but packages should be installed the standard way, just adjusting to
> only the strictly necessary.
That's a weak argument, if any. By not using the install.sh script, you are
violating "the standard way" yourself - which is IMHO really fine as it's a
rather ugly install script.
Maybe we can agree on putting the files somewhere in /usr/share/doc and ask the
user to run ebuild ... config in case he wants /etc/a* to be screwed up, eh
configured. pkg_config() has to be created, of course.

------- Comment #29 From Edwin Shin 2004-10-06 20:04:41 0000 -------
>> Sorry but packages should be installed the standard way, just adjusting to
>> only the strictly necessary.
> That's a weak argument, if any. 

It's a perfectly reasonable stance to take: stick closely to the standard installer's behavior unless there's good reason to do otherwise.

Changing install locations and behavior can make support a pain. As the author of Product X, if an end-user reports a bug, configuration issue, etc., it potentially makes support that much more onerous if installation and configuration differ from the standard source or binary package I distribute.

This isn't to argue against customized packaging for Gentoo. Hardly. But in this case, I think Adrian is starting from the correct base assumption: stick closely to the default, by default. Then, adapt the ebuild to fit Gentoo requirements and customs.

Don't mean to rant; and certainly not against Dennis--I'm very appreciative of everyone who already worked on this. I was just about to make an ebuild for laptop-mode tools if I didn't find it here (precisely because I think in this case, install.sh is a bit messy).

------- Comment #30 From Dennis Nienhüser 2004-10-07 02:39:05 0000 -------
>>> Sorry but packages should be installed the standard way, just adjusting to
>>> only the strictly necessary.
>> That's a weak argument, if any. 
>It's a perfectly reasonable stance to take: stick closely to the standard
> installer's behavior unless there's good reason to do otherwise.

I guess you got me wrong (looking at the point you chose to cut the quote). Nevertheless, I think we all agree on your point and don't need a general discussion here. If you're going to fix the ebuild that would be really awesome, if not I'm going to do it in the next days (yeah! finally I'll have more time soon)

------- Comment #31 From Dennis Nienhüser 2004-10-07 09:34:08 0000 -------
Created an attachment (id=41295) [edit]
laptop-mode-tools-1.02.ebuild

Ebuild for the new version 1.02, even using install.sh to make maintaining it
as easy as possible (this screams for integration into portage, doesn't it? :)
)
Someone running apm (USE=apm) please confirm it works.

------- Comment #32 From Dennis Nienhüser 2004-10-07 09:35:08 0000 -------
Created an attachment (id=41296) [edit]
files/laptop-mode.init

init script necessary for the ebuild. Put in files directory.

------- Comment #33 From Dennis Nienhüser 2004-10-31 11:05:17 0000 -------
Rename the ebuild to laptop-mode-tools-1.03 to get the new version.

------- Comment #34 From Raphael Slinckx 2004-11-01 07:25:55 0000 -------
I tested and it worked for me, installation is flawless (not tested apm,
though)

This is somehting that realy should go in portage in
app-laptop/laptop-mode-utils or somthing..

------- Comment #35 From Gad Kadosh 2004-11-01 12:53:23 0000 -------
working very well here. except that apparently my laptop does not send ac
events, but when i change the related config in the configuration file it works
perfectly. this should really be in portage... as well as the
hibernate-script...

------- Comment #36 From Ehud Shabtai 2004-11-02 08:07:25 0000 -------
Does laptop mode support reiser4 file system?

------- Comment #37 From Remy Blank 2004-11-15 12:32:17 0000 -------
Works well for me on a Dell Inspiron 8600c with laptop-mode-tools 1.04 by
renaming the ebuild.

------- Comment #38 From Dennis Nienhüser 2004-11-24 14:35:06 0000 -------
(From update of attachment 41295 [edit])
bump

------- Comment #39 From Sven Vermeulen 2004-11-28 06:56:51 0000 -------
Mobile herd, can you dedicate a few minutes of your time to verify this ebuild
and the accompanying files?

It's blocking a documentation update that's getting more and more requested
(regarding powermanagement guide).

------- Comment #40 From Henrik Brix Andersen 2004-12-02 05:48:59 0000 -------
I'm currently working on improving the current laptop-mode-tools package -
latexer and I have been discussing the state of laptop-mode-tools; we do not
feel it is production ready yet.

I'll keep you posted.

------- Comment #41 From Peter Johanson (RETIRED) 2004-12-06 08:00:53 0000 -------
*** Bug 73308 has been marked as a duplicate of this bug. ***

------- Comment #42 From Aman Gupta 2004-12-27 14:17:33 0000 -------
If its not production ready yet, can it be added to the portage tree with
testing status, or is it still a step below testing?

------- Comment #43 From Antti Mäkelä 2005-01-01 04:39:38 0000 -------
One thing that should be patched in the 1.04 version is the syslog support. The
laptop mode script currently has a line that says 

"killall -HUP syslogd".

However, I think most gentoo users (at least if they go through installation
guide) are using syslog-ng.

Also, I think there should be a notification that (maybe) the best way to split
the syslogs is to use otherwise identical files, but add "sync(20);" to the
options{}-section - that is, the log is written only now and then on batteries,
not after every message. Another possibility might be and idea of additional
filters, ie. remove all the non-essential messages, like this:

log { source(src); filter(f_important); destination(messages); };
log { source(src); destination(console_all); };
filter f_important { level(emerg,alert,crit,err,warn,notice); };

This does not save debug and info-level messages to /var/log (it still saves
them to tty 12). 

Take these into consideration when you prepare the "production-ready"
laptop-mode..

------- Comment #44 From TGL 2005-01-18 18:08:14 0000 -------
Created an attachment (id=48913) [edit]
laptop-mode-tools-1.04.ebuild  (alternative version)

Errr... i should have searched bugzilla before writing my own ebuild. Bah, i'll
attach it anyway, because there are a few differences: 

 - i've not installed acpi or apm events handlers, but instead put them in the
documentation, just as it is in the ibm-acpi package for instance. Really, i
don't like package which install events handlers: it can interfere badly with
user's configuration (it would with mine), and etc-update won't be of any help
to prevent that since they are new files. From the moment the package is
installed, there are things that will start getting executed without any
agreement from user's side.

 - i've not used the makefile (to sed changes to do, especially since i also
move scripts to documentation dir), but instead rewrote it in src_install. But
i don't have strong arguments on that point, i don't really care.

Apart from that, my init script was 100% similar to the one in this bug (also
adapted from the one in the source package), so i won't submit it. 

------- Comment #45 From TGL 2005-01-18 18:16:05 0000 -------
Oh, i forgot to comment about testing if kernel actually supports laptop mode. 
I personally did not put a test in the ebuild. If the kernel does not support
it, then the script will fail, but that won't hurt. 

The point is that testing the running kernel is not really relevant (what if
i'm installing in a non-"/" $ROOT, etc.). If there must really be a test, it
must be done on ${ROOT}/usr/src/linux sources. As it has been said, the kernel
version is not really relevant, but a trick may be to test if a given file is
there. Something like that:

pkg_setup() {
        if [ ! -f ${ROOT}usr/src/linux/Documentation/laptop-mode.txt ] ; then
                eerror "Your kernel does not support laptop mode."
                eerror "Try 2.4.23 and above or 2.6.6 and above."
                die "Kernel too old."
        fi
}

That said, that introduces a DEPEND on virtual/linux-sources for a very small
benefit imho.

------- Comment #46 From Christian Ludwig 2005-02-18 07:54:13 0000 -------
Created an attachment (id=51525) [edit]
laptop-mode-tools-1.04.ebuild (merged)

I have merged and cleaned up both ebuild version commited here earlier.

Changes to ebuild:
 - merge DEPEND and instalation of certain bits depending on use-flags
 - fixed typos
 - added pkg_setup() as suggested by TGL, but changed errors to warnings only

People could boot into a laptop_mode enabled kernel any time, so this should
not prevent the package from installing on non-laptop_mode kernels. That's why
I changed the init-script to check if it is available on the current running
kernel, when invoked.

Changes to init-script:
 - add checkconfig()

------- Comment #47 From Christian Ludwig 2005-02-18 07:55:09 0000 -------
Created an attachment (id=51527) [edit]
laptop-mode.init

------- Comment #48 From Petteri Räty 2005-03-22 08:00:54 0000 -------
The merged ebuild has a bug in DEPEND:
--- attachment.cgi?id=51525     2005-03-22 17:59:22.498246700 +0200
+++ laptop-mode-tools-1.04.ebuild       2005-03-22 17:59:58.156839244 +0200
@@ -10,9 +10,10 @@
 SLOT="0"
 KEYWORDS="~x86"
 IUSE="acpi apm doc"
-DEPEND=        "acpi?  ( sys-apps/acpid )
-        apm?   ( sys-apps/apmd )
-        virtual/linux-sources"
+
+DEPEND=" acpi?( sys-power/acpid )
+                apm? ( sys-apps/apmd )
+                virtual/linux-sources"

There should be no space after DEPEND and sys-apps/acpid is now sys-power/acpid

------- Comment #49 From Petteri Räty 2005-03-22 08:01:51 0000 -------
Someone should mark the old attachments as obsolete. 

------- Comment #50 From Henrik Brix Andersen 2005-03-22 10:53:59 0000 -------
I've added this to app-laptop/laptop-mode-tools. Thank you to all who commented
on this bug report.

------- Comment #51 From Antti Mäkelä 2005-04-13 01:59:03 0000 -------
Laptop-mode-tools 1.05 is out..

------- Comment #52 From Henrik Brix Andersen 2005-04-13 02:19:33 0000 -------
... and it was added to portage two days ago:

*laptop-mode-tools-1.05 (11 Apr 2005)

  11 Apr 2005; <brix@gentoo.org> +files/laptop-mode-tools-1.05.init,
  +laptop-mode-tools-1.05.ebuild:
  Version bump.

First Last Prev Next    No search results available      Search page      Enter new bug