Miscellaneuos

This page describes miscellaneous notebook-related configurations, such as ACPI, frequency scaling, CF and SD card support.

InitRAMFS

initramfs is a root file system which is embedded into the kernel and loaded at an early stage of the boot process. It is the successor of initrd. It provides early user space which lets you do things that the kernel cannot easily do by itself during the boot process. Instructions on how to set up a custom initramfs and then use it to load the custom, native netbook resolution as well as boot splash images can be found here.

Power Management

Power management covers a broad range of topics from ACPI, frequency scaling, hibernation, etc. Because it is an important, but very troublesome part of any Linux installation on a notebook, it received its own page.

udev

udev is a user-space utility for dynamically creating/removing device files while providing consistent naming and a user-space API. Every time the kernel gets an event in the device structure, it asks udev to take a look. udev follows the rules in the /etc/udev/rules.d/ directory. udev then uses the information given by the kernel to perform the necessary actions on the /dev structure (creating or deleting device files). If you are using kernel >= 2.6 there should be no need to emerge udev since it is part of the kernel and loaded automatically. You should only make sure the following kernel options are enabled:

General setup --->
  [*] Support for hot-pluggable devices

File systems --->
    [*] Inotify file change notification support
        [*] Inotify support for userspace
    Pseudo filesystems --->
        [*] /proc file system support
        [*] Virtual memory file system support (former shm fs)

Selective Module Loading

Thanks to the udev device manager you will notice that your system loads all kernel modules you enabled at startup. Since the whole point of having sub-systems as modules and not compiled into the kernel is to not have them enabled from the get-go, this is counter-productive. The only way to prevent udev from loading the modules - or to define the order in which the modules are loaded, for that matter - is to blacklist the modules (and then add them to /etc/modules.autoload.d/kernel-2.6 in the correct order, should you still wish to load them at startup). To blacklist a module all you need to do is simply add it to /etc/modprobe.d/blacklist:

echo "blacklist ath9k" >> /etc/modprobe.d/blacklist

For more information about udev feel free to visit Decibel's udev Primer or ArchLinux Wiki's udev page.

Writing udev Rules

A great resource on how to write udev rules is Daniel Drake's page. The most important information is the location of the udev rules: /etc/udev/rules.d/ In this directory the rules are sorted alphabetically (that is why they start with numbers) and are executed in that order as well. For any rule you need to figure out the kernel module that is responsible for it (KERNEL), its unique identifier (SUBSYSTEM or NAME or ATTRS), and what you want to do when the event is fired off. This information can be gathered via udevinfo:

udevinfo -a -p $(udevinfo -q path -n /dev/sdb1)

The code listed above gets the path of the device in question (/dev/sdb1) with the -q parameter and then gets the necessary information (-a -p). Of course the device needs to be plugged in for this to work. You usually place custom rules into a file called 10-local.rules so that it gets executed as one of the first rules. Also keep in mind that starting or stopping of anything in /etc/init.d/ causes the udev system to re-evaluate its state, i.e. trigger your rule. So you better not start/stop any service in a script called when a udev event is triggered …

Furthermore, any script called from within a rule has automatically a ${ACTION} variable set containing information about what happened (usually ”add” or ”remove”). However, the script is being called non-interactively, so there is no standard output or errors to the console and you will need to redirect it (2>&1), if desired.

 
setup/misc.txt · Last modified: 2009/09/19 03:57 by marco1475
 
Except where otherwise noted, content on this wiki is licensed under the following license:CC Attribution-Noncommercial-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki