Diff for /wikisrc/tutorials/how_to_poweroff_at_shutdown.mdwn between versions 1.1 and 1.2

version 1.1, 2011/11/20 20:55:21 version 1.2, 2012/02/05 07:14:36
Line 1 Line 1
 If you have ATX hardware, for various reasons, you might want your box to poweroff by itself when you shut it down. To achieve this you have to enable [apm(8)](http://netbsd.gw.com/cgi-bin/man-cgi?apm+8+NetBSD-current) in the kernel. Here's how to do it:  If you have ATX hardware, for various reasons, you might want your box to poweroff by itself when you shut it down. To achieve this you have to enable [apm(8)](http://netbsd.gw.com/cgi-bin/man-cgi?apm+8+NetBSD-current) in the kernel. Here's how to do it: 
   
 **Contents**  **Contents**
   
 [[!toc]]  [[!toc]]
   
 #  Obtaining the Sources  #  Obtaining the Sources 
   
 If you are running 3.0, you can get the Sources from the NetBSD FTP Server or from a [Mirror](Get BSD) close to you. If you are running current, you should check out the Sources from a CVS Mirror close to you.  If you are running 3.0, you can get the Sources from the NetBSD FTP Server or from a [Mirror](Get BSD) close to you. If you are running current, you should check out the Sources from a CVS Mirror close to you. 
          
   
     # cd /      # cd /
     # ftp ftp://ftp.netbsd.org/pub/NetBSD/NetBSD-3.0/source/sets/syssrc.tgz      # ftp ftp://ftp.netbsd.org/pub/NetBSD/NetBSD-3.0/source/sets/syssrc.tgz
     # tar -zxf syssrc.tgz      # tar -zxf syssrc.tgz
          
   
 #  Configure the kernel  #  Configure the kernel 
   
 Edit the file `/usr/src/sys/arch/i386/conf` and uncomment _apm_ to enable APM, it should look like:  Edit the file `/usr/src/sys/arch/i386/conf` and uncomment _apm_ to enable APM, it should look like: 
          
     apm0        at mainbus0                     # Advanced power management      apm0        at mainbus0                     # Advanced power management
          
   
 Alternatetively, you might want to customize (uncomment) these options:  Alternatetively, you might want to customize (uncomment) these options: 
          
     # Tuning for power management, see apm(4) for more details.      # Tuning for power management, see apm(4) for more details.
     #options        APM_NO_IDLE             # Don't call BIOS CPU idle function      #options        APM_NO_IDLE             # Don't call BIOS CPU idle function
     #options        APM_V10_ONLY            # Use only the APM 1.0 calls      #options        APM_V10_ONLY            # Use only the APM 1.0 calls
     #options        APM_NO_POWEROFF         # Don't power off on halt(8)      #options        APM_NO_POWEROFF         # Don't power off on halt(8)
     #options        APM_POWER_PRINT         # Print stats on the console      #options        APM_POWER_PRINT         # Print stats on the console
     #options        APM_DISABLE_INTERRUPTS=0 # Don't disable interrupts      #options        APM_DISABLE_INTERRUPTS=0 # Don't disable interrupts
          
   
 #  Build the kernel  #  Build the kernel 
          
     # config GENERIC_APM      # config GENERIC_APM
     # cd ../compile/GENERIC_APM      # cd ../compile/GENERIC_APM
     # make depend; make      # make depend; make
          
   
 If everything went OK, your new APM-enabled-kernel should be located in ./netbsd  If everything went OK, your new APM-enabled-kernel should be located in ./netbsd 
   
 #  Install the kernel  #  Install the kernel 
          
     # mv /netbsd /netbsd.old      # mv /netbsd /netbsd.old
     # cp netbsd /      # cp netbsd /
     # shutdown -r now      # shutdown -r now
          
   
 Now when you shutdown the box it should poweroff by itself, without the need for the power button to be pressed.  Now when you shutdown the box it should poweroff by itself, without the need for the power button to be pressed. 
   
 #  Troubleshooting  #  Troubleshooting 
   
 If something went wrong, test with [apm(8)](http://netbsd.gw.com/cgi-bin/man-cgi?apm+8+NetBSD-current). Sample output:  If something went wrong, test with [apm(8)](http://netbsd.gw.com/cgi-bin/man-cgi?apm+8+NetBSD-current). Sample output: 
          
   
     root@antfarm:~# apm      root@antfarm:~# apm
     Battery charge state: absent      Battery charge state: absent
     Battery remaining: 0 percent (0 minutes)      Battery remaining: 0 percent (0 minutes)
     A/C adapter state: connected      A/C adapter state: connected
     Power management enabled      Power management enabled
          
   
 ##  apmd  ##  apmd
   
 You will need the apm Daemon _apmd_ running for setting your Notebook fall into sleep. For that please add:  You will need the apm Daemon _apmd_ running for setting your Notebook fall into sleep. For that please add: 
          
     apmd=yes      apmd=yes
          
   
 to your /etc/rc.conf Also see [apmd(8)](http://netbsd.gw.com/cgi-bin/man-cgi?apmd+8+NetBSD-current) for more power management issues.  to your /etc/rc.conf Also see [apmd(8)](http://netbsd.gw.com/cgi-bin/man-cgi?apmd+8+NetBSD-current) for more power management issues. 

Removed from v.1.1  
changed lines
  Added in v.1.2


CVSweb for NetBSD wikisrc <wikimaster@NetBSD.org> software: FreeBSD-CVSweb