CONFIG_APM=y CONFIG_APM_DO_ENABLE=y CONFIG_APM_CPU_IDLE=y CONFIG_APM_RTC_IS_GMT=y (snip) CONFIG_SOUND=y CONFIG_SOUND_OSS=m CONFIG_SOUND_CS4232=m CONFIG_SOUND_YM3812=m |
/sbin/modprobe sound /sbin/insmod ad1848 /sbin/insmod uart401 /sbin/insmod cs4232 io=0x530 irq=5 dma=1 dma2=3 |
# Start the APM daemon if APM is enabled in the kernel: if [ -x /usr/sbin/apmd ]; then if cat /proc/apm 1> /dev/null 2> /dev/null ; then echo "Starting APM daemon..." /usr/sbin/apmd -P /etc/apmd/apmd_proxy ~~~~~~~~~~~~~~~~~~~~~~~ 追加 fi fi |
#!/bin/sh /usr/bin/logger "apmd_proxy: $*" case "$1,$2" in start,*) ;; stop,*) ;; suspend,*) /sbin/rmmod cs4232 /sbin/rmmod uart401 /sbin/rmmod ad1848 /sbin/rmmod sound ;; standby,*) ;; resume,*) /sbin/modprobe sound /sbin/insmod ad1848 /sbin/insmod uart401 /sbin/insmod cs4232 io=0x530 irq=5 dma=1 dma2=3 ;; change,*) ;; esac exit 0 |
# Start the APM daemon if APM is enabled in the kernel: #if [ -x /usr/sbin/apmd ]; then # if cat /proc/apm 1> /dev/null 2> /dev/null ; then # echo "Starting APM daemon..." # /usr/sbin/apmd # fi #fi |
apm: BIOS version 1.2 Flags 0x03 (Driver version 1.13) |
ifconfig eth0 down ifconfig eth0 up route add default gw xxx.xxx.xxx.xxx |
# ------------------------------- RESUME --------------------------- # Resume ... from standby is a NOP, except the clock update. "resume") # Typically the Linux system clock needs to be reset. update_clock (snip) # other common actions: reload troublesome drivers # EXAMPLE: reload OSS sound drivers. Path may vary. # /usr/local/bin/soundon # /sbin/ifconfig eth0 down <--- 追加 /sbin/ifconfig eth0 up <--- 追加 route add default gw xxx.xxx.xxx.xxx <--- 追加 ;; # ------------------------------- START ---------------------------- # Called when apmd first starts. |
# METHOD 1 - Logs command line arguments of apmd_proxy only logger apmd_proxy $* <--- 行頭の # を削除 |
Nov 25 17:34:00 jevex kernel: hda: status timeout: status=0xd0 { Busy } Nov 25 17:34:00 jevex kernel: hda: no DRQ after issuing WRITE Nov 25 17:34:00 jevex kernel: ide0: reset: success |
Nov 25 17:37:32 jevex 11月 25 17:37:32 logger: apmd_proxy change power Nov 25 17:37:32 jevex apmd[32689]: Now using Battery Power Nov 25 17:37:32 jevex apmd[32689]: Battery: * * * (100% unknown) Nov 25 17:37:32 jevex cardmgr[64]: executing: './serial suspend ttyS1' Nov 25 17:37:33 jevex 11月 25 17:37:33 logger: apmd_proxy suspend system Nov 25 17:37:33 jevex apmd[32689]: System Suspend Nov 25 17:38:03 jevex 11月 25 17:38:03 logger: apmd_proxy resume suspend Nov 25 17:38:03 jevex cardmgr[64]: executing: './serial resume ttyS1' Nov 25 17:38:21 jevex apmd[32689]: Normal Resume after 00:00:48 (100% 1 day, 12:27) Battery power |
(AC on 時) $ /usr/bin/on_ac_power $ echo $? 0 (AC off 時) $ /usr/bin/on_ac_power 98 <--- たぶんバッテリー残量 $ echo $? 1 |
> As we all know, several TP models (mine is a 600E) refuse > to suspend/hibernate if the machine is on AC power AND if > there are powered PC-cards in the slots. > I know. The problem is only, that apm does _not_ generate > any event at all if on AC power with a running card in the > slot. The APM-BIOS itself refuses to suspend and does not > bother to send an event - that's the problem (at least on > my TP600E). |
Nov 27 07:23:11 hostname apmd[214]: System Suspend Nov 27 07:23:41 hostname apmd[214]: Normal Resume after 00:00:30 (96% unknown) AC power |