The Semb + Wever Family
[ start | index | login ]
start > linux > Fujitsu-Siemens Lifebook E8020

Fujitsu-Siemens Lifebook E8020

Created by michaelwever. Last edited by michaelwever, 4 years and 30 days ago. Viewed 374 times. #3
[diff] [history] [edit] [rdf]
labels
attachments

Work laptop from Schibsted S?k AS.
Running Gentoo GNU/Linux.

Was remarkably easy to install. Thanks to good linux competence from work peers with the same model!
Centrino wireless adaptor uses ipw2200, with fantastic connectivity.
Using ATI prop. drivers to run "Big Desktop" when in the office.

Power management is followed almost to the word from >>http://www.gentoo.org/doc/en/power-management-guide.xml , an *excellent* guide from Dennis Nienh?ser. Except I have four runlevels instead of just the two:
  • default (battery, no network)
  • batterynetwork (battery, network)
  • power (power, no network)
  • powernetwork (power, network)

So my /etc/acpi/actions/pmg_switch_runlevel.sh instead looks like:
#!/bin/bash

# BEGIN configuration RUNLEVEL_AC="power" RUNLEVEL_AC_ONLINE="powernetwork" RUNLEVEL_BATTERY="default" RUNLEVEL_BATTERY_ONLINE="batterynetwork" # END configuration

# Pre-conditions: # - all runlevels exist #

if [ ! -d "/etc/runlevels/${RUNLEVEL_AC}" ] then logger "${0}: Runlevel ${RUNLEVEL_AC} does not exist. Aborting." exit 1 fi

if [ ! -d "/etc/runlevels/${RUNLEVEL_AC_ONLINE}" ] then logger "${0}: Runlevel ${RUNLEVEL_AC_ONLINE} does not exist. Aborting." exit 1 fi

if [ ! -d "/etc/runlevels/${RUNLEVEL_BATTERY}" ] then logger "${0}: Runlevel ${RUNLEVEL_BATTERY} does not exist. Aborting." exit 1 fi

if [ ! -d "/etc/runlevels/${RUNLEVEL_BATTERY_ONLINE}" ] then logger "${0}: Runlevel ${RUNLEVEL_BATTERY_ONLINE} does not exist. Aborting." exit 1 fi

logger "Checking power and network status against current runlevel"

if on_ac_power then

# Power plugged in. if ifconfig | grep -A 2 eth | grep --silent "inet addr" ; then

# Power plugged in. Network connected. --> RUNLEVEL_AC_ONLINE if [[ "$(cat /var/lib/init.d/softlevel)" != "${RUNLEVEL_AC_ONLINE}" ]] then logger "Switching to ${RUNLEVEL_AC_ONLINE} runlevel" /sbin/rc ${RUNLEVEL_AC_ONLINE} fi

else

# Power plugged in. No network. --> RUNLEVEL_AC if [[ "$(cat /var/lib/init.d/softlevel)" != "${RUNLEVEL_AC}" ]] then logger "Switching to ${RUNLEVEL_AC} runlevel" /sbin/rc ${RUNLEVEL_AC} fi

fi

else

# Running on battery. if ifconfig | grep -A 2 eth | grep --silent "inet addr" ; then

# Running on battery. Network connected. --> RUNLEVEL_BATTERY_ONLINE if [[ "$(cat /var/lib/init.d/softlevel)" != "${RUNLEVEL_BATTERY_ONLINE}" ]] then logger "Switching to ${RUNLEVEL_BATTERY_ONLINE} runlevel" /sbin/rc ${RUNLEVEL_BATTERY_ONLINE} fi

else

# Running on battery. No network. --> RUNLEVEL_BATTERY if [[ "$(cat /var/lib/init.d/softlevel)" != "${RUNLEVEL_BATTERY}" ]] then logger "Switching to ${RUNLEVEL_BATTERY} runlevel" /sbin/rc ${RUNLEVEL_BATTERY} fi

fi

fi

This gives me even finer control on my services, instead of just letting them fail. Especially since I've found there's a bigger difference in which services are running between network and no-network then there is between power and battery! This approach saves alot of time at startup.

no comments | post comment
Semb Wever Family:
>>Family Tree, >>Wedding, & >>Photos
>>Music & Movies
>>Mck's Radio Station
>>Hosted GnuPG Keys

< March 2010 >
SunMonTueWedThuFriSat
123456
78910111213
14151617181920
21222324252627
28293031

Corporate links:
Vet Products|Bokklubben|Finn

Opensource projects:
Scarab|NetBeans


Describe here what your SnipSnap is about!

Configure this box!

  1. Login in
  2. Click here: snipsnap-portlet-2
  3. Edit this box



>>The only thing worse than using cracked/stolen software is actually paying for it.
>>Liberate yourself. Free Software Foundation.


XHTML 1.0 validated CSS validated RSS 2.0 validated SnipSnap Get Firefox! RSS Feed
Powered by Gentoo Linux/GNU






Rainforest Site