Add acpi pacakge for our acpi scripts.

This removes the acpi stuff from customize_rootfs and should make it easier
to do more acpi stuff in the future as needed. We still need to figure out
how to handle acpi across different devices.

Review URL: http://chromereview.prom.corp.google.com/1186038


git-svn-id: svn://chrome-svn/chromeos/trunk@220 06c00378-0e64-4dae-be16-12b19f9950a1
This commit is contained in:
tedbo@google.com 2009-11-13 00:04:19 +00:00
parent 7ba1563d79
commit 23eef58c60
2 changed files with 1 additions and 72 deletions

View File

@ -25,7 +25,7 @@ NUM_JOBS=`cat /proc/cpuinfo | grep processor | awk '{a++} END {print a}'`
PLATFORM_DIR="$SRC_ROOT/platform" PLATFORM_DIR="$SRC_ROOT/platform"
PLATFORM_DIRS="assets fake_hal init installer login_manager \ PLATFORM_DIRS="acpi assets fake_hal init installer login_manager \
memento_softwareupdate pam_google window_manager \ memento_softwareupdate pam_google window_manager \
cros chrome wifi screenlocker cryptohome \ cros chrome wifi screenlocker cryptohome \
monitor_reconfig" monitor_reconfig"

View File

@ -215,77 +215,6 @@ cat <<EOF > /etc/gtk-2.0/gtkrc
gtk-font-name="DroidSans 8" gtk-font-name="DroidSans 8"
EOF EOF
# -- Handle closelid/power button events to perform shutdown --
mkdir -p /etc/acpi/events
cat <<EOF > /etc/acpi/events/lidbtn
event=button[ /]lid
action=/etc/acpi/lid.sh
EOF
cat <<'EOF' > /etc/acpi/lid.sh
#!/bin/sh
# On lid close:
# - lock the screen
export HOME=/home/chronos
/usr/bin/xscreensaver-command -l
# - suspend the cryptohome device
#CRYPTOHOME=/dev/mapper/cryptohome
#/usr/bin/test -b $CRYPTOHOME && /sbin/dmsetup suspend $CRYPTOHOME
# - stop wireless if UP
wlan0isup=`/sbin/ifconfig wlan0 2>/dev/null | /bin/grep UP`
test "$wlan0isup" && /sbin/ifconfig wlan0 down
# - suspend to ram
echo -n mem > /sys/power/state
# - restore wireless state
test "$wlan0isup" && /sbin/ifconfig wlan0 up
# On lid open:
# - resume cryptohome device
#/usr/bin/test -b $CRYPTOHOME && /sbin/dmsetup resume $CRYPTOHOME
EOF
chmod 0755 /etc/acpi/lid.sh
cat <<EOF > /etc/acpi/events/powerbtn
event=button[ /]power
action=/etc/acpi/powerbtn.sh
EOF
cat <<EOF > /etc/acpi/powerbtn.sh
#!/bin/sh
# shutdown on power button
shutdown -h now
EOF
chmod 0755 /etc/acpi/powerbtn.sh
# -- Handle hotkeys --
# TODO(tedbo): This is specific to eeepc. Also, on the eee we can get all
# of the hotkeys except for the sleep one. Handle those?
cat <<EOF > /etc/acpi/events/hotkeys
event=hotkey ATKD
action=/etc/acpi/hotkeys.sh %e
EOF
cat <<EOF > /etc/acpi/hotkeys.sh
#!/bin/sh
case \$3 in
00000013) # Toggle sound
amixer set LineOut toggle
amixer set iSpeaker toggle
;;
00000014) # Decrease volume
amixer set LineOut 5%-
;;
00000015) # Increase volume
amixer set LineOut 5%+
;;
esac
EOF
chmod 0755 /etc/acpi/hotkeys.sh
# -- Some boot performance customizations -- # -- Some boot performance customizations --
# Setup our xorg.conf. This allows us to avoid HAL overhead. # Setup our xorg.conf. This allows us to avoid HAL overhead.