Thinkpad Control .dsl extensionForum: Laptops Topic: Thinkpad Control .dsl extension started by: kopsis Posted by kopsis on July 22 2005,03:52
I've succeeded in building tpctl and its associated kernel modules and packaging it up as a .dsl extension. tpctl is a Thinkpad configuration utility (and kernel modules) that gives you the same kind of control over a Thinkpad's hardware features that you would get from the Windows control panel utility that IBM provides. You can find lot's of information on tpctl (including the list of Thinkpads it is known to work with) on the < tpctl homepage >. I'd like to know that this works on more than just my system before I submit it to the MyDSL repository. So if you'd like to give it a try, grab < thinkpad.dsl > (and the < md5 > if you wish) and report your results. A couple notes on the extension: 1) It creates an "S50updatemodules" script in your /etc/rc5.d directory that will run right after DSL finishes loading all the extensions. That script does an "update-modules" to update the modules.conf file and module dependency info for any modules installed by this (and any other) DSL extension. If you load this as an "optional" module, you should (as root) do an "/etc/rc5.d/S50updatemodules start" before you try to insmod/modprobe the "thinkpad.o" module. 2) tpctl includes several kernel modules but you only need to insmod/modprobe "thinkpad.o". It will then automatically load the other modules as needed. 3) HTMLized man pages are installed at /opt/thinkpad 4) The "apmiser" daemon is of particular interest if you're running on battery. It uses tpctl to dynamically change the "performance level" based on CPU usage. I don't have a working battery at the moment so I can't say how much difference it makes, but it seems like a great idea. If you try this out, please post success/failure reports here so I can get an idea how stable it is Good luck! Posted by SaidinUnleashed on July 22 2005,04:38
Does this have the mwave modem driver?If it does, and it works, I will love you forever! Also, I'll help host it, since the DSL crowd will quickly kill your bandwidth. < http://luna.vectori.net/~anorion/dsl/thinkpad.dsl > < http://luna.vectori.net/~anorion/dsl/thinkpad.dsl.md5.txt > -J.P. Posted by libretto on July 22 2005,08:47
Hello,Tried installing it on my IBM TP 240. Loaded the .dsl via CLI 'mydsl-load'. "tpctl --help" lists the options But if I try and run something such as "tpctl --ib" it returns: "tpctl: System error message is: No such device tpctl: CAn't open device file /dev/thinkpad/thinkpad with flags O_RDONLY. Exiting." Will have a further read of the manual. Posted by adraker on July 22 2005,09:13
TP380XDhmmm... not seeing that problem. Seems fine, I have not actually been brave enough to make any changes to bios settings, but I'm getting all the information from it. It took me a very long time to get the serial port to work under Linux when I first got this machine, only succeeding after getting a DOS copy of tpctl.... this SMAPI bios is a strange and cryptic thing! Wish I'd had this back then. Will play some more after this initial report, cheers. Posted by kopsis on July 22 2005,14:22
Saidin:It doesn't have the mwave driver because I thought that was already in the distro. I guess I need to take another look. If it's not there, I'll take a shot at building the driver and adding to this extension. libretto: The device files are installed with root access only. Try adding prefixing your tpctl commands with "sudo" and see if that fixes it. If so, you can "sudo chmod 666 /dev/thinkpad/thinkpad" to allow the dsl user access. adraker: Note that tpctl writes to hardware registers directly ... it does not change any of the BIOS non-volatile settings. The upside of that is if you screw something up, reboot and you're back to normal. The downside is that any settings you want to retain you'll need to explicitly set on every boot (add tpctl commands to bootlocal.sh). Posted by Max on July 22 2005,14:52
I'm running a T42. Loaded the thinkpad.dsl at boot.After boot, started terminal and ran "tpctl -ic" System reported that it couldn't open device. Did an insmod on thinkpad.o and then ran "tpctl -ic" and all is well. I thought that your S50updatemodules might also do the insmod. So I guess we'll need to add the insmod to the bootlocal.sh file to make it completely automatic. Haven't tried the apmiser proggie yet...hope that works too. Posted by Max on July 22 2005,15:27
I don't think apmiser is working...This is what I got... root@DSL1:/opt/thinkpad# apmiser apmiser: 10:22:37 Automatic power miser 4.14 started (daemon: no, low: 35%, high: 97%, term: 0.5s, trendiness: 2.2) No such file or directory at ./apmiser line 202. Line 202 is: open(APM,"/proc/apm") or die $!; and sure enough, there is on apm file in proc.... Posted by kopsis on July 22 2005,15:36
Thanks for mentioning that! Yes, S50updatemodules just updates the modutils info -- it doesn't actually load anything. It's worth noting that because S50updatemodules doesn't actualy load anything, anyone that wants to package modules in mydsl extensions should feel free to add S50updatemodules to their .dsl file. That way no matter how many module .dsl files you load at boot, the same init script will register them all with modutils. Doing a seperate update-modules for every .dsl that adds modules could really slow down the boot process. As for loading thinkpad.o, which would folks prefer to see: an rc5.d script that automatically loads thinkpad.o or a "Load thinkpad module" MyDSL menu item (and leave it to the user to add the insmod to their bootlocal.sh if they want it every time)? Posted by libretto on July 22 2005,21:24
I tried tpctl again.As i'm on a hdd install, i re-loaded thinkpad.o 'lsmod' lists the thinkpad module went to /opt/thinkpad running "tpctl --ix" as user dsl gives: "tpctl: module required for request is not loaded." running the command again as root gives the same running 'sudo tpctl' says theres no file or directory Posted by kopsis on July 22 2005,21:55
I should have done this sooner, but a check of the < tpctl supported models > page doesn't list any models prior to the 365. Your 240 may not have the necessary BIOS features to support tpctl. You might want to try starting klogd and syslogd prior to loading thinkpad.o. Then after loading thinkpad.o, check dmesg, /var/log/syslog, etc. for any thinkpad.o error messages. You may find something telling you the driver didn't load properly (which would mean there's not much hope for tpctl). You may also want to try a "tpctl -ic" which (I believe) doesn't need to load the SMAPI BIOS driver. Posted by spotslayer on July 22 2005,23:03
Kopsis I am out of town this weekend but will try it on my TP when I return. In the past I have noted that tpctl did not permanantly change bios settings. I have not used it in a day or two(maybe a year) but these settings needed to be added so they would load everytime at boot. Is this still the case?David Posted by adraker on July 23 2005,08:03
Just reminding everone of the terribly obvious-After changing TP bios settings, power down and power up. I've been going around in circles all day because of this, after doing a Frugal Grub and running into sound and serial problems. I don't know what happened in the first place, but I was simply rebooting and not getting anywhere. BTW, very happy with Frugal Grub! Posted by Max on July 23 2005,16:55
Now if we could get those Gnome apps to work that let you display and set everything...that would be nice...
Posted by Max on Sep. 07 2005,16:47
Just a little update....If you add the boot options: apm acpi=off lots of things with tpctl and apmiser become active on my T42. For one thing, I am able to suspend the notebook using the hotkey function for the first time!! If you want to get the apmiser battery saving program working, you need to edit the /opt/thinkpad/apmiser script (as root) and replace all instances of "tpctl" with "/opt/thinkpad/tpctl" (there are 8 occurances). Then add "opt/thinkpad/apmiser" to your .filetool.lst file so the changes are restored at every boot. Then add "sudo /opt/thinkpad/apmiser &>/dev/null &" to the .xinitrc file and the battery miser program takes over when your xwindows start. For some reason I just couldn't get apmiser to work from bootlocal.sh For one thing, if you start it in daemon mode, the program crashes when it finds it can't write messages to syslog. I tried starting it about 5 other ways and just couldn't get it to go. If someone figures out how to load this from there, it would be better than doing it in .xinitrc Battery savings mode and suspend.... DSL just keeps getting better and better for me... Oh and incidently, once you load the boot options above, then the wmapm battery display dockapp (currently located in the dsl testing area) started working for me too. Posted by Max on Sep. 07 2005,17:36
A few more little quirks to smooth out. Once you get APM working via the boot options, I've found that when on battery the screen automatically blanks after X minutes (e.g., timer mode from my BIOS) and that there is no way to get it to come back up. (Please let me know if you can figure this out). Anyway to circumvent this, I also added "sudo /opt/thinkpad/tpctl --ptB=disable &>/dev/null &" to my .xinitrc and this will prevent the screen from ever blanking from the BIOS. (Note that you can just shut the lid to do this Also another little tidbit, I found that if I exit window manager, and then go back in via a startx that two copies of apmiser end up running and they compete against each other and your CPU load goes up (exactly the opposite of what apmiser is supposed to do for you). This of course is the result of load apmiser via .xinitrc instead of bootlocal.sh I had to end up manually killing one of the copies. The good news is that I don't exit the window manager much so it shouldn't be a recurring nusance......but if someone can get apmiser running from bootlocal.sh, I'm all ears... |