Difference between pages "Genkernel Quick Start Tutorial" and "Package:ACPI Daemon"

From Funtoo
(Difference between pages)
Jump to: navigation, search
 
m
 
Line 1: Line 1:
Genkernel is a tool which help you to build a Linux kernel and deploy it along with a ramdisk image which contains all of the necessary modules to make the kernel being able to mount the different partitions of your harddrives in the VFS at the system startup.
+
== Introduction ==
 +
=== What is acpi? ===
 +
"In computing, the Advanced Configuration and Power Interface (ACPI) specification provides an open standard for device configuration and power management by the operating system." ([http://en.wikipedia.org/wiki/Advanced_Configuration_and_Power_Interface Wikipedia])
  
= Concepts =
+
=== What is acpid? ===
 +
"ACPID is a completely flexible, totally extensible daemon for delivering ACPI events. It listens on a file (''<code>/proc/acpi/event</code>'') and when an event occurs, executes programs to handle the event. The programs it executes are configured through a set of configuration files, which can be dropped into place by packages or by the admin." ([http://acpid.sourceforge.net/ acpid Sourceforge])
  
TBC
+
== Preparing to install ==
 +
=== Kernel configuration ===
 +
Before we are ready to emerge acpid, it is a good idea to modify a few things in the kernel. If you have not modified your kernel before, you may want to check out the following page on configuring a kernel manually (page to be added..).
  
= Recompiling the Gentoo kernel sources from a SystemRescue CD chroot =
+
{{kernelop
 +
|Power management and ACPI options --->|<pre>
 +
[*] ACPI (Advanced Configuration and Power Interface) Support
 +
</pre>}}
  
A second case that many Funtoo users will face to is to compile their own kernel when installing a brand new Funtoo instance from a stage 3 archive (the most common scenario is to boot the machine with SystemRescue CD).
+
==== Optional: Other ACPI features ====
 +
Below are the locations and short descriptions of the function of different ACPI options in the kernel. In the majority of cases, you do not have to alter any of these to have a functional ACPI system.  
  
{{Note}} If you want to use the System rescue CD sources provided by Funtoo {{Package|sys-kernel/sysrescue-std-sources}}, the philosophy remains exactly the same
+
* '''AC Adapter'''
 +
{{kernelop
 +
|Power management and ACPI options --->|<pre>
 +
ACPI (Advanced Configuration and Power Interface) Support --->
 +
      < > AC Adapter
 +
</pre>}}
 +
{{Note}} If you have a system that can switch between being plugged into AC and using a battery (i.e. a laptop), you should compile this option into your kernel.
  
== First step emerging the required packages ==
+
*  '''Battery'''
 +
{{kernelop
 +
|Power management and ACPI options --->|<pre>
 +
ACPI (Advanced Configuration and Power Interface) Support --->
 +
      < > Battery
 +
</pre>}}
 +
{{Note}} As its name would suggest, this option adds or removes support for the battery. More specifically, through /proc/acpi/battery. If you have a laptop or other mobile system, you should probably compile this into your kernel.
  
The first step is to emerge:
+
* '''Button'''
 +
{{kernelop
 +
|Power management and ACPI options --->|<pre>
 +
ACPI (Advanced Configuration and Power Interface) Support --->
 +
      < > Button
 +
</pre>}}
 +
{{Note}} This driver handles power, sleep, and other buttons. This driver is recommended because it is necessary for software controlled power-off.
  
# The Gentoo kernel sources: {{Package|sys-kernel/gentoo-sources}}
+
* '''Video'''
# Genkernel itself: {{Package|sys-kernel/genkernel}}
+
{{kernelop
 +
|Power management and ACPI options --->|<pre>
 +
ACPI (Advanced Configuration and Power Interface) Support --->
 +
      < > Video
 +
</pre>}}  
 +
{{Note}} Implements ACPI extensions for integrated graphics devices. Also adds support for setting up a video output.
  
This is achieved by running the following:
+
* '''Fan'''
<console>
+
{{kernelop
###i## emerge sys-kernel/gentoo-sources sys-kernel/genkernel
+
|Power management and ACPI options --->|<pre>
</console>
+
ACPI (Advanced Configuration and Power Interface) Support --->
 +
      < > Fan
 +
</pre>}}
 +
{{Note}} Allows user-controlled applications to control fan speeds and access status of fans.
  
Once the Gentoo kernel sources are deployed, you should find a directory named '''linux-''version''-gentoo''' (e.g. linux-2.6.39-gentoo) under ''<code>/usr/src</code>''. Update the ''<code>linux</code>'' symlink to point to this directory:
+
* '''Dock'''
<console>
+
{{kernelop
###i## cd /usr/src
+
|Power management and ACPI options --->|<pre>
###i## rm linux
+
ACPI (Advanced Configuration and Power Interface) Support --->
###i## ln -s linux-2.6.39-gentoo linux
+
      [ ] Dock
</console>
+
</pre>}}
 +
{{Note}} Builds support in the kernel for docking stations like the Dell Module Bay and the IBM Ultrabay.
  
== Second step: Grabbing and tweaking a configuration file ==
+
* '''Processor'''
 +
{{kernelop
 +
|'''Power management and ACPI options --->|<pre>
 +
ACPI (Advanced Configuration and Power Interface) Support --->
 +
      < > Processor
 +
</pre>}}
 +
{{Note}} Helps save power while processor is idling and is required by several cpufreq drivers.
  
How to start your kernel configuration? Simply by using the same configuration template the running System Rescue CD kernel had been built with! Before chrooting in your Funtoo instance, you did something like:
+
* '''Processor Aggregator'''
 +
{{kernelop
 +
|'''Power management and ACPI options --->|<pre>
 +
ACPI (Advanced Configuration and Power Interface) Support --->
 +
      < > Processor Aggregator
 +
</pre>}}
 +
{{Note}} Allows the host system to practice logical processor idling (a way to reduce power consumption)
  
<console>
+
* '''Thermal Zone'''
###i## mount -o bind /proc /mnt/gentoo/proc
+
{{kernelop
</console>
+
|'''Power management and ACPI options --->|<pre>
Or:
+
ACPI (Advanced Configuration and Power Interface) Support --->
<console>
+
      < > Thermal Zone
###i## mount -t proc none /mnt/gentoo/proc
+
</pre>}}
</console>
+
{{Note}} Enables support for ACPI thermal zones. It is encouraged to enable this option, as your system may be damaged without it.  
 
+
In your chroot environment (or from a System Rescue CD virtual terminal) if you look what ''<code>/proc</code>'' contains you will notice a file named ''<code>config.gz</code>'':
+
  
 +
== Installing acpid ==
 +
=== Emerging ===
 +
After configuring the kernel power management options, we are ready to install {{Package|sys-power/acpid}}. To install acpid, run the following command:
 
<console>
 
<console>
###i## ls /proc
+
###i## emerge -av acpid
 
+
...
+
dr-xr-xr-x  7 root      root                    0 May 23 03:13 952
+
dr-xr-xr-x  7 root      root                    0 May 23 03:13 953
+
dr-xr-xr-x  7 root      root                    0 May 23 18:42 9834
+
...
+
-r--r--r--  1 root      root                16024 May 23 22:27 config.gz
+
-r--r--r--  1 root      root                    0 May 23 22:27 consoles
+
-r--r--r--  1 root      root                    0 May 23 22:27 cpuinfo
+
...
+
 
</console>
 
</console>
  
''<code>config.gz</code>'' holds the running kernel (System Rescue CD) configuration, just copy the unziped content into the Gentoo sources directory:
+
=== Adding to rc ===
 +
After you have finished emerging acpid, you may want to add it to the list of rc services to be started with your system at boot.
 
<console>
 
<console>
###i## cd /usr/src/linux
+
###i## rc-update add acpid default
###i## zcat /proc/config.gz > .config
+
 
</console>
 
</console>
 
+
Then, run the following to start acpid:
Next, run ''<code>make oldconfig</code>'' to set all newly added options:
+
 
<console>
 
<console>
###i## make oldconfig
+
###i## rc
 
</console>
 
</console>
 
+
[[Category:System]]
Next, tweak the kernel configuration in the way you prefer (manually edition of the .config file, make nconfig, make menuconfig....) if you wish. You are not ready yet! A final step is required: '''you ''must'' either set CONFIG_INITRAMFS_SOURCE to a blank value (CONFIG_INITRAMFS_SOURCE="") either delete the statement in the .config file'''. Forgotting to do that will make Genkernel abort the compilation process with a message like:
+
<console>
+
/usr/src/linux-2.6.39-gentoo/scripts/gen_initramfs_list.sh: Cannot open '/var/tmp/genkernel/initramfs-2.6.32.14-std155-i386.cpio.gz'
+
make[1]: *** [usr/initramfs_data.cpio.lzma] Error 1
+
</console>
+
 
+
== Third step: Building and installing the kernel ==
+
 
+
This is simply achieved by:
+
<console>
+
###i## genkernel --no-mrproper all
+
</console>
+
 
+
The same remarks written in the [[Genkernel_Quick_Start_Tutorial#Third_step:_Building_and_installing_the_kernel|third paragraph]] of the first use case are still valid here.
+
 
+
[[Category:Kernel]]
+

Revision as of 03:02, 11 January 2014

Contents

Introduction

What is acpi?

"In computing, the Advanced Configuration and Power Interface (ACPI) specification provides an open standard for device configuration and power management by the operating system." (Wikipedia)

What is acpid?

"ACPID is a completely flexible, totally extensible daemon for delivering ACPI events. It listens on a file (/proc/acpi/event) and when an event occurs, executes programs to handle the event. The programs it executes are configured through a set of configuration files, which can be dropped into place by packages or by the admin." (acpid Sourceforge)

Preparing to install

Kernel configuration

Before we are ready to emerge acpid, it is a good idea to modify a few things in the kernel. If you have not modified your kernel before, you may want to check out the following page on configuring a kernel manually (page to be added..).



Optional: Other ACPI features

Below are the locations and short descriptions of the function of different ACPI options in the kernel. In the majority of cases, you do not have to alter any of these to have a functional ACPI system.

  • AC Adapter

Note Note: If you have a system that can switch between being plugged into AC and using a battery (i.e. a laptop), you should compile this option into your kernel.

  • Battery

Note Note: As its name would suggest, this option adds or removes support for the battery. More specifically, through /proc/acpi/battery. If you have a laptop or other mobile system, you should probably compile this into your kernel.

  • Button

Note Note: This driver handles power, sleep, and other buttons. This driver is recommended because it is necessary for software controlled power-off.

  • Video
 

Note Note: Implements ACPI extensions for integrated graphics devices. Also adds support for setting up a video output.

  • Fan

Note Note: Allows user-controlled applications to control fan speeds and access status of fans.

  • Dock

Note Note: Builds support in the kernel for docking stations like the Dell Module Bay and the IBM Ultrabay.

  • Processor

Note Note: Helps save power while processor is idling and is required by several cpufreq drivers.

  • Processor Aggregator

Note Note: Allows the host system to practice logical processor idling (a way to reduce power consumption)

  • Thermal Zone

Note Note: Enables support for ACPI thermal zones. It is encouraged to enable this option, as your system may be damaged without it.

Installing acpid

Emerging

After configuring the kernel power management options, we are ready to install sys-power/acpid. To install acpid, run the following command:

# emerge -av acpid

Adding to rc

After you have finished emerging acpid, you may want to add it to the list of rc services to be started with your system at boot.

# rc-update add acpid default

Then, run the following to start acpid:

# rc