ASUS Zenbook Prime UX31A

From ArchWiki
Revision as of 02:05, 6 October 2012 by Snakeroot (Talk | contribs) (rdrand)

Jump to: navigation, search

This page contains instructions, tips, pointers, and links for installing and configuring Arch Linux on the ASUS Zenbook UX31A and UX21A Ultrabooks. Most of it should also hold for UX32VD.

See previous generation ASUS Zenbook UX31E page that has mostly orthogonal information to those here (may be only partially applicable to UX31A)

Installation

The following instructions cover a complete installation of a setup with dm-crypt with LUKS and LVM on the ASUS Zenbook UX31a.

Notes

Note: It is recommended to read the UEFI, GPT and UEFI_Bootloaders pages before following those instructions.

Prepare installation medium

dd bs=5M if=archlinux-XXXX.YY.ZZ-dual.iso of=/dev/sdX

Boot from USB medium

Press Template:Keypress to get into the boot menu. If the USB bootable device is not listed, enter the configuration menu and directly press Template:Keypress to save. Press Template:Keypress again on reboot: This time the USB bootable device should appear in the menu.

Select 'Boot Arch Linux (x86_64)" and press Template:Keypress. The installation system will be booted and you will end up with a terminal.

Partition the disk

As earlier mentioned this installation covers a setup with an encrypted hard drive and LUKS on top of it. Therefore we need at least three partitions:

  • UEFI boot partition
  • system boot partition
  • encrypted system partition
Note: You can also keep the first two partitions in the default setup, especially if you want to dual boot windows. Those are UEFI boot partition and GPT partition.

We run gdisk /dev/sda to start the partition manager. By typing d we are capable of deleting all existing partitions and start with a fresh configuration.

Now use n to create new partitions:

  • UEFI boot partition:
 ID: 1
 Start (sector): <empty>
 End (sector): +512M
 Code: EF00
  • System boot partition
 ID: 2
 Start (sector): <empty>
 End (sector): +200M
 Code: <empty>
  • Encrypted system partition
 ID: 3
 Start (sector): <empty>
 End (sector): <empty>
 Code: <empty>

The <empty> command means that you leave the field in the prompt empty and just hit Template:Keypress directly. After creating those partitions enter p to print the partition table which should like the following:

 Number Start (sector) End (sector) Size      Code Name
 1      2048           1050623      512.0 MiB EF00 EFI System
 2      1050624        1460223      200.0 MiB 8300 Linux filesystem
 3      1460224        250069646    118.5 GiB 8300 Linux filesystem

Finally write the partition table with w and confirm with Y.

Setup dm-crypt with LUKS

In this section we setup dm-crypt with LUKS by preparing our encrypted system disk (/dev/sda3) and creating our logical volumes for the system, home and swap partition.

 modprobe dm-crypt
 cryptsetup -c aes-xts-plain64 -y -s 512 luksFormat /dev/sda3
 cryptsetup luksOpen /dev/sda3 lvm
 lvm pvcreate /dev/mapper/lvm
 lvm vgcreate vgroup /dev/mapper/lvm
 lvm lvcreate -L 20GB -n root vgroup
 lvm lvcreate -C y -L 8GB -n swap vgroup
 lvm lvcreate -l 100%Free -n home vgroup

Format partitions

 mkfs.vfat -F32 /dev/sda1
 mkfs.ext4 /dev/sda2
 mkfs.ext4 /dev/mapper/vgroup-root
 mkfs.ext4 /dev/mapper/vgroup-home
 mkswap /dev/mapper/vgroup-swap

Mount partitions

 mount /dev/mapper/vgroup-root /mnt
 mkdir -p /mnt/boot
 mount /dev/sda2 /mnt/boot
 mkdir -p /mnt/boot/efi
 mount /dev/sda1 /mnt/boot/efi
 mkdir -p /mnt/home
 mount /dev/mapper/vgroup-home /mnt/home
 swapon -va

Connect to the internet

Follow Installation_Guide#Connect_to_the_internet to establish an internet connection.

Install the base system

 pacstrap /mnt base base-devel

=== Install a bootloader

 pacstrap /mnt grub-efi-x86_64

Configure system

Generate fstab

 genfstab -p -U /mnt >> /mnt/etc/fstab

Chroot in the newly installed system

 arch-chroot /mnt

Set hostname

 echo UX31A > /etc/hostname

Set timezone

 ln -s /usr/share/zoneinfo/Europe/Vienna /etc/localtime

Set locale preferences

Append the following lines to /etc/locale.conf

 LANG="en_US.UTF-8"
 LC_COLLATE="C"

and uncomment the following line in /etc/locale.gen

 en_US.UTF-8

Then execute locale-gen.

Configure mkinitcpio.conf and create initial RAM disk

Edit /etc/mkinitcpio.conf

 HOOKS=(... sata encrypt lvm2 filesystems ...)

and run mkinitcpio -p linux,.

Configure rc.conf

Edit /etc/rc.conf and set:

 USELVM="yes"

Configure bootloader

Load the required modules:

 modprobe dm-mod
 modprobe dmefivars

Edit /etc/default/grub:

 GRUB_CMDLINE_LINUX_DEFAULT="quiet add_efi_memmap i915.i915_enable_rc6=1 pcie_aspm=force drm.vblankoffdelay=1 i915.semaphores=1 nmi_watchdog=0"
 GRUB_CMDLINE_LINUX="cryptdevice=/dev/sda3:vgroup:allow-discards"
Note: Kernel parameter pcie_aspm=force status is unsure: Ubuntu wiki recommends it, but UX31E Arch wiki says it should not be used. There is no noticeable problem when it is added to the list, so it is probably safe.

Install the bootloader:

  grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=arch_grub --recheck

Copy necessary files and reconfigure grub:

 mkdir -p /boot/grub/locale
 cp /usr/share/locale/en\@quot/LC_MESSAGES/grub.mo /boot/grub/locale/en.mo
 grub-mkconfig -o /boot/grub/grub.cfg
 cp /boot/efi/EFI/arch_grub/grubx64.efi /boot/efi/shellx64.efi

Reboot and launch EFI shell

Type reboot and press F2 and choose "Launch EFI shell from filesystem device" from the "Save and exit" tab. grub2 should be launched and you should be able to boot into your system.

Create GRUB2 entry in the FBM

 modprobe efivars
 efibootmgr --create --gpt --disk /dev/sda --part 1 --write-signature --label "Arch Linux (GRUB2)" --loader '\EFI\arch_grub\grubx64.efi'
 reboot

Additional steps

It might happen that the parameters of the /boot/efi entry in /etc/fstab are a bit messed up. You are safe to remove the whole line or reduce its parameters to "rw,relatime 0 2"

Mount installed system from installation medium

If any error occured or you forgot any necessary steps you are able to mount the installed system from the installation medium with the following commands:

 cryptsetup luksOpen /dev/sda3 lvm 
 vgscan
 vgchange -ay
 
 mount /dev/mapper/vgroup-root /mnt
 mount /dev/sda2 /mnt/boot
 mount /dev/sda1 /mnt/boot/efi
 mount /dev/mapper/vgroup-home /mnt/home
 
 arch-chroot /mnt

Function keys

Note: A working keymap means that there is some output in xev when the key combination is pressed. It does not means that the keymap is linked to the functionality. For that it is necessary to add a keyboard shortcut by the method of your choice or to use a desktop shell with built-in support the keycode in question.

Screen backlight

Screen Brightness keymaps (Template:Keypress, Template:Keypress) does not work. You can either install xorg-xbacklight or use the hack here:

As root, create the file /usr/local/share/backlight:

#!/bin/bash

path="/sys/class/backlight/intel_backlight"
# alternative interface (0 < x < 10)
#path="/sys/class/backlight/acpi_video0/"

# max should be 4296
max=$(cat ${path}/max_brightness)

step=$(($max/10))
# for a value smaller than treshold, the steps are smaller for a more accurate setting at low intensity
treshold=$((2*$step))
previous=$(cat ${path}/brightness)

function commit {
	if [[ $1 = [0-9]* ]]
	then 
		if [[ $1 -gt $max ]]
		then 
			next=$max
		elif [[ $1 -lt 0 ]]
		then 
			next=0
		else 
			next=$1
		fi
		echo $next >> ${path}/brightness
		exit 0
	else 
		exit 1
	fi
}

case "$1" in
 up)
	if [[ $previous -le $treshold ]]
	then 
	    step=$(($step/4))
	fi
	commit $(($previous + $step))
   ;;
 down)
	if [[ $previous -le $treshold ]]
	then 
	    step=$(($step/4))
	fi
	commit $(($previous - $step))
   ;;
 max)
	 commit $max
   ;;
 off)
	 commit 0
   ;;
 show)
	 echo $previous
   ;;
 night)
	 commit $(($max/4)) 
 	 ;;
 allowusers)
	 # Allow members of users group to change brightness
	 sudo chgrp users ${path}/brightness
	 sudo chmod g+w ${path}/brightness
   ;;
 disallowusers)
	 # Disallow members of users group to change brightness
	 sudo chgrp root ${path}/brightness
	 sudo chmod g-w ${path}/brightness
   ;;
 *)
	 commit	$1
esac

exit 0

Allow file to be executed :

# chmod +x /usr/local/share/backlight

Allow users to change brightness at each boot :

# echo "/bin/bash /usr/local/share/backlight allowusers" >> /etc/rc.local

Adding to .zshrc or .bashrc :

alias -g "backlight"="/bin/bash /usr/local/share/backlight"

allows to easy toggle backlight in terminal :

$ backlight up
$ backlight down
$ backlight max
$ backlight off
$ backlight night
$ backlight 2000
$ backlight show

And finally, add some convenient keyboard shortcuts by the method of your choice.

Screen Backlight Method 2

Note: UX31A BIOS 211 IGDM Base Address is 0xDA8A9018 and UX31A BIOS 204 IGDM Base Address is 0xDA8CF018, everything else is the same.
Note: Warning, this is highly experimental. It works for the UX32VD with bios 2.06, no guarantee that it works for different configurations.

First off, this method requires that you know what you are doing (although there are good tutorials anyway), and needs a little bit patience. It also requires that you have the hexidecimal dump and undump package xxd available in the AUR: https://aur.archlinux.org/packages.php?ID=35311 .

This method is based on a proposed fix posted on https://bugs.freedesktop.org/show_bug.cgi?id=45452, which apparently works for the UX31A/UX32VD too. The cause why the brightness buttons don't work is exactly the same as in the bugreport.

As root, create the file /usr/local/share/backlightfix: This script is posted here: https://bbs.archlinux.org/viewtopic.php?pid=1156051#p1156051

#!/bin/bash                                                                                                                                                                                                                                  
#                                                                                                                                                                                                                                            
# Asus UX32VD acpi backlight fix                                                                                                                                                                                                             
#                                                                                                                                                                                                                                            
# Copyright(C) 2012 Eugen Dahm <eugen.dahm@gmail.com>.                                                                                                                                                                                       
#                                                                                                                                                                                                                                            
# fix is based on a proposed bugfix posted on <[url]https://bugs.freedesktop.org/show_bug.cgi?id=45452[/url]>                                                                                                                                           
#                                                                                                                                                                                                                                            
#  This program is free software; you can redistribute it and/or modify                                                                                                                                                                      
#  it under the terms of the GNU General Public License as published by                                                                                                                                                                      
#  the Free Software Foundation; either version 2 of the License, or                                                                                                                                                                         
#  (at your option) any later version.                                                                                                                                                                                                       
#                                                                                                                                                                                                                                            
#  This program is distributed in the hope that it will be useful,                                                                                                                                                                           
#  but WITHOUT ANY WARRANTY; without even the implied warranty of                                                                                                                                                                            
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the                                                                                                                                                                             
#  GNU General Public License for more details.                                                                                                                                                                                              
#                                                                                                                                                                                                                                            
#  You should have received a copy of the GNU General Public License                                                                                                                                                                         
#  along with this program; if not, write to the Free Software                                                                                                                                                                               
#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                                                                                                                                                                 
#                                                                                                                                                                                                                                              
# Asus UX32VD acpi backlight fix                                                                                                                                                                                                             
# Disclaimer!!!! not recommended to use if laptop is not the Asus UX32VD\                                                                                                                                                                    
# probably works with other models too, but the didl and cadl offset needs to be extracted                                                                                                                                                   
# from the dsdt                                                                                                                                                                                                                              
# Tested with bios 2.06                                                                                                                                                                                                                       
# IGDM_BASE has to be determined for each notebook                                                                                                                                                                                           
# IGDM is the operation region (\_SB_.PCI0.GFX0.IGDM) containing the CADL/DIDL fields                                                                                                                                                        
# \aslb is a named field containing the base-address of the IGDM region                                                                                                                                                                      
# this address depends on the installed ram                                                                                                                                                                                                  
# how to get the address:                                                                                                                                                                                                                    
# - git clone git://github.com/Bumblebee-Project/acpi_call.git                                                                                                                                                                               
# - make                                                                                                                                                                                                                                     
# - load module with insmod or copy to /lib/modules/.... and modprobe                                                                                                                                                                        
# - echo '\aslb' > /proc/acpi/call                                                                                                                                                                                                           
# - cat /proc/acpi/call                                                                                                                                                                                                                      
# - this is the IGDM base address - fill in below                                                                                                                                                                                             
IGDM_BASE=0xBE8B7018
DIDL_OFFSET=0x120
CADL_OFFSET=0x160
# this basically copies the values of the initialized fields DIDL-DDL8 in the IGDM opregion and initializes CADL-CAL8 with it                                                                                                                
# CADL-CAL8 are fields, telling the bios that a screen or something is connected (this is a bit speculation - check                                                                                                                          
# <[url]https://bugs.freedesktop.org/show_bug.cgi?id=45452[/url]> for  more                                                                                                                                                                              
# if interested, disasselbe the dsdt to understand, why no notifyevent gets thrown, when CADL isn't initialized                                                                                                                              
# (hint: _Q0E/_Q0F are the backlight methods on the UX32VD)                                                                                                                                                                                  
dd if=/dev/mem skip=$(( $IGDM_BASE + $DIDL_OFFSET )) count=32 bs=1 | xxd  | xxd -r | dd of=/dev/mem bs=1 seek=$(( $IGDM_BASE + $CADL_OFFSET )) count=32 

This script still needs to be adjusted to your notebook configuration (it uses a memory address which strongly depends on the amount of installed system memory.

The exact address can be determined with following steps:

  1. git clone git://github.com/Bumblebee-Project/acpi_call.git
  2. cd acpi_call
  3. make
  4. gzip acpi_call.ko
  5. load module acpi_call.ko.gz with insmod or copy to /lib/modules/.... and modprobe
  6. echo '\aslb' > /proc/acpi/call
  7. cat /proc/acpi/call
  8. this is the IGDM base address - initialize the IGDM_BASE variable with this value in the script

Initialize your bios with this script on boot :

# echo "/usr/local/share/backlightfix" >> /etc/rc.local

Execute the script and hope the backlight buttons work afterwards. If they don't you probably have to disasselbe the dsdt for yourself, because you have to adjust the following 2 variables in the script:

DIDL_OFFSET=0x120
CADL_OFFSET=0x160

These are the offsets on the Asus UX32VD bios version 2.06. Try google to find a tutorial how to disassemble the dsdt.

Getting the DIDL and CADL offsets

Now comes the funny part:

  1. open your disassembled dsdt. The should have the filename dsdt.dsl.
  2. find the operationregion IGBM. It should have a Field statement below, and probably looks something like this:
OperationRegion (IGDM, SystemMemory, ASLB, 0x2000)
              Field (IGDM, AnyAcc, NoLock, Preserve)
              {
                  SIGN,   128, 
                  SIZE,   32, 
                  OVER,   32, 
...

This specifies some variables in this IGDM field (for me, they look similar to a c struct, except that you don't need to give the size of each element in a struct). The numbers are the size for each element in bit.

You must add those field sizes until you reach the DIDL variable. With the UX32VD the DIDL offset is easy, because of this statement:

..
Offset (0x120), 
DIDL,   32,

.. Don't know exactly why they use the Offset statement, since this is somewhat redundant. It tells you that the following element has the offset 0x120.

Since I thought it is obvious what this statement does, I didn't bother to look it up in the dsl language specification. I thought it tells the bios that the following variable starts with an offset of 0x120 bytes relative to the previous element, but I was wrong. It basically tells you/bios that the following variable starts with an offset of 0x120 relative to the beginning of the opregion (in this case its completely unnecessary).

Now the only thing left is the CADL offset. Add the numbers starting from DIDL until you reach CADL and add it to your previous offset. This should be the 2nd needed offset.

After updating both offset variables in the script and executing it again, the backlight should now work (no guarantee).

Other function keys

Note: Since Kernel 3.4.9-1 the instructions below concerning the kernel patch/dkms are no longer required.

There is a fix for Ubuntu : http://ubuntuforums.org/showthread.php?p=12054636#post12054636

Method 1

You can apply the following patch (semi-)manually and rebuild the kernel (you may want to read Custom_Kernel_Compilation_with_ABS).

Signed-off-by: Alex Hung <alex.hung <at> canonical.com>
---
 drivers/platform/x86/asus-wmi.c |    7 +------
 1 files changed, 1 insertions(+), 6 deletions(-)

diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c
index 25e3093..0f69a97 100644
--- a/drivers/platform/x86/asus-wmi.c
+++ b/drivers/platform/x86/asus-wmi.c
@@ -1461,14 +1461,9 @@ static int asus_wmi_platform_init(struct asus_wmi *asus)
 	 */
 	if (!asus_wmi_evaluate_method(ASUS_WMI_METHODID_DSTS, 0, 0, NULL))
 		asus->dsts_id = ASUS_WMI_METHODID_DSTS;
-	else if (!asus_wmi_evaluate_method(ASUS_WMI_METHODID_DSTS2, 0, 0, NULL))
+	else
 		asus->dsts_id = ASUS_WMI_METHODID_DSTS2;

-	if (!asus->dsts_id) {
-		pr_err("Can't find DSTS");
-		return -ENODEV;
-	}
-
 	/* CWAP allow to define the behavior of the Fn+F2 key,
 	 * this method doesn't seems to be present on Eee PCs */

This will make most keys useable (you have to bind them to functions yourself), except the screen brightness keys.

It worked with kernel 3.4.4-2.

Method 2

It is also possible to use Dynamic Kernel Module Support (DKMS) (package in community), to avoid compiling the whole kernel:

1 get the archive at http://ubuntuforums.org/showthread.php?p=12054636#post12054636 (ubuntu forums account + minimum of 50 posts required) or http://markmail.org/message/idvl6s27r26xzorb (no account required)

Note: there is perhaps more suitable place to get the asus-wmi kernel module sources, the patch and the dkms conf file

2 extract the archive, and then extract the .deb and get the sources inside (asus-wmi.c is already patched with above patch):

 # cp -a usr/src/asus-wmi-0.2 /usr/src/
 # cd /usr/src/
 # dkms add -m asus-wmi -v 0.2
 # dkms built -m asus-wmi -v 0.2 -k 3.4.7-1-ARCH
 # dkms status
 # dkms install -m asus-wmi -v 0.2 -k 3.4.7-1-ARCH
 # dkms status

replace 3.4.7-1-ARCH by your output for uname -r

3 There is still a problem since dkms doesn't gzip the kernel module and archlinux does (see $ modinfo asus-wmi):

# cd /lib/modules/3.4.7-1-ARCH/kernel/drivers/platform/x86/
# mv asus-wmi.ko.gz asus-wmi.ko.gz.save
# gzip asus-wmi.ko
Note: there is probably a cleaner way to do that with dkms

4 After reboot, xev should display events for Template:Keypress keys. And keyboard backlight can be trigger by:

# echo 0 >> /sys/class/leds/asus\:\:kbd_backlight/brightness
# echo 3 >> /sys/class/leds/asus\:\:kbd_backlight/brightness

Keyboard backlight

There was a script on this page, which I have packaged for your convenience. Install asus-kbd-backlightAUR from AUR. To allow users to change the brightness, say:

# asus-kbd-backlight allowusers

If you use initscripts, put this into your /etc/rc.local:

# echo "asus-kbd-backlight allowusers" >> /etc/rc.local

Users of systemd can use the unit file included in the package.

# systemctl daemon-reload
# systemd start asus-kbd-backlight.service
# systemd enable asus-kbd-backlight.service

No you can easily change keyboard backlight in terminal:

$ asus-kbd-backlight up
$ asus-kbd-backlight down
$ asus-kbd-backlight max
$ asus-kbd-backlight off
$ asus-kbd-backlight night
$ asus-kbd-backlight 2
$ asus-kbd-backlight show

And finally, add some convenient keyboard shortcuts by the method of your choice.

UPower Script

Upower allows control of the keyboard backlight as an ordinary user. Use of these scripts requires installation of dbus, upower and if you want the OSD notifications, libnotify.

This script increases the keyboard brightness and provides onscreen notification of the current brightness:

#! /bin/bash
# get current keyboard brightness from UPower
current_state=$(dbus-send --type=method_call --print-reply=literal --system \
--dest="org.freedesktop.UPower" /org/freedesktop/UPower/KbdBacklight org.freedesktop.UPower.KbdBacklight.GetBrightness)
# strip leading 9 characters "   int32 "
current_state=${current_state:9}
# get maximum keyboard brightness from UPower
max_brightness=$(dbus-send --type=method_call --print-reply=literal --system \
--dest="org.freedesktop.UPower" /org/freedesktop/UPower/KbdBacklight org.freedesktop.UPower.KbdBacklight.GetMaxBrightness)
# strip leading 9 characters "   int32 "
max_brightness=${max_brightness:9}
# if the current keyboard brightness is less than max, increment brightness by one
if [ $current_state -lt $max_brightness ] ; then 
dbus-send --type=method_call --print-reply=literal --system \
--dest="org.freedesktop.UPower" /org/freedesktop/UPower/KbdBacklight org.freedesktop.UPower.KbdBacklight.SetBrightness \
int32:$((current_state+1))
notify-send "Keyboard brightness reset to $((current_state+1))"
else
# if the keyboard brightness is already at maximum, complain
notify-send "Keyboard brightness already at maximum"
fi

This script decreases the keyboard brightness and provides onscreen notification of the current brightness:

#! /bin/bash
# get current keyboard brightness from UPower
current_state=$(dbus-send --type=method_call --print-reply=literal --system \
--dest="org.freedesktop.UPower" /org/freedesktop/UPower/KbdBacklight org.freedesktop.UPower.KbdBacklight.GetBrightness)
# strip leading 9 characters "   int32 "
current_state=${current_state:9}
min_brightness=0
# if the current keyboard brightness is greater than zero, decrement brightness by one
if [ $current_state -gt $min_brightness ] ; then 
dbus-send --type=method_call --print-reply=literal --system \
--dest="org.freedesktop.UPower" /org/freedesktop/UPower/KbdBacklight org.freedesktop.UPower.KbdBacklight.SetBrightness \
int32:$((current_state-1))
notify-send "Keyboard brightness reset to $((current_state-1))"
else
# if the keyboard brightness is already at zero, complain
notify-send "Keyboard brightness already at zero"
fi

Solid State Drive

Check Solid_State_Drives


Touchpad

This makes the right click button work and activates palm detection. Multifinger taps work out of the box.

Tip: Multifinger taps: Two finger for middle click; three fingers for right click.

Powersave management

Configure Laptop_Mode_Tools and do not forget to check CPU_Frequency_Scaling.

Here is a custom script for easy power management (feel free to improve)

#!/bin/bash

case "$1" in
 ac)
  sudo pm-powersave ac
  for i in 0 1 2 3; do sudo cpufreq-set -c $i -g ondemand; done
 ;;
 battery)
  sudo pm-powersave battery
  sudo cpufreq-set -c 0 -g conservative 
  for i in 1 2 3; do sudo cpufreq-set -c $i -g powersave; done
 ;;
 aggressive)
  sudo pm-powersave battery
  for i in 0 1 2 3; do sudo cpufreq-set -c $i -g powersave; done
 ;;
 info)
  echo "#########################"
  echo "# acpi"
  acpi
  read
  echo "#########################"
  echo "# cpufreq-info"
  cpufreq-info
  read
  echo "#########################"
  echo "Available energy governators"
  cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors
  read

 ;;
 powertop)
	 sudo powertop
	 ;;
 suspend)
	sudo pm-suspend
	;;

 load)
	sudo modprobe cpufreq_powersave
	sudo modprobe cpufreq_conservative
	echo "#########################"
	echo "Available energy governators"
	cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors
	;;

 install)
	 sudo pacman -S pm-utils acpi powertop laptop-mode-tools cpufrequtils
	 echo "You should add  DAEMONS=(...cpufreq_powersave  cpufreq_conservative laptop-mode...) in /etc/rc.conf"
	 ;;
 *)
	echo "#########################"
	echo "Choose an option:"
	echo "0) info"
	echo "1) battery"
	echo "2) ac"
	echo "3) aggressive powersave"
	echo "4) suspend"
	echo "5) powertop"
	echo "6) install"
	read choice
	#echo $choice
	case $choice in
		0)
			$0 info
			;;
		1)
			$0 battery
			;;
		2)
			$0 ac
			;;
		3)
			$0 aggressive
			;;
		4)
			$0 suspend
			;;
		5)
			$0 powertop
			;;
		6)
			$0 install
			;;
		*)
			exit 0
			;;
	esac
 esac
 
exit 0

Hardware and Modules

PCI

This is output of lscpci -nnn -k

Description PCI Id Module
Intel Corporation 3rd Gen Core processor DRAM Controller 8086:0154 none
Intel Corporation 3rd Gen Core processor Graphics Controller 8086:0166 i915
Intel Corporation Device 8086:0153 none
Intel Corporation 7 Series/C210 Series Chipset Family USB xHCI Host Controller 8086:1e31 xhci_hcd
Intel Corporation 7 Series/C210 Series Chipset Family MEI Controller #1 8086:1e3a mei
Intel Corporation 7 Series/C210 Series Chipset Family USB Enhanced Host Controller #2 8086:1e2d ehci_hcd
Intel Corporation 7 Series/C210 Series Chipset Family High Definition Audio Controller 8086:1e20 snd_hda_intel
Intel Corporation 7 Series/C210 Series Chipset Family PCI Express Root Port 1 8086:1e10 pcieport
Intel Corporation 7 Series/C210 Series Chipset Family PCI Express Root Port 2 8086:1e12 pcieport
Intel Corporation 7 Series/C210 Series Chipset Family USB Enhanced Host Controller #1 8086:1e26 ehci_hcd
Intel Corporation HM76 Express Chipset LPC Controller 8086:1e59 lpc_ich
Intel Corporation 7 Series Chipset Family 6-port SATA Controller 8086:1e03 ahci
Intel Corporation 7 Series/C210 Series Chipset Family Thermal Management Controller 8086:1e24 none
Intel Corporation Centrino Advanced-N 6235 8086:088e iwlwifi

Other Devices and Drivers

mei

PCE device 8086:1e3a, the Intel Corporation 7 Series/C210 Series Chipset Family MEI Controller #1 and the associated device "/dev/mei" (10,59) relating to an Intel-specific hardware monitoring technology called "Advanced Management Technology". Intel has a downloadable configuration tool: AMT Tool. The tool requires libcrypto and libssl. It was coded to look for libcrypto.so.0.9.8 and libssl.so.0.9.8. This can be fixed with a symlink:

$sudo ln -s /usr/lib/libcrypto.so.1.0.0 /usr/lib/libcrypto.so.0.9.8
$sudo ln -s /usr/lib/libssl.so.1.0.0 /usr/lib/libssl.so.0.9.8
rdrand

The i7 Core CPU has an on-chip random number generator, rdrand, code named "Bull Mountain". It appears that since 3.2, this is used as a source for /dev/urandom. It is also used as a randomness source by rng-tools version 4.

In contrast to other hardware random number generators, rdrand does not create a character device in /dev. However, rngd version 4 does appear to detect and use it.

First, make sure rngd sees it:

[root@asarum system]# rngd -v --no-tpm=1
Available entropy sources:
   	DRNG

Second, start rngd:

[root@asarum log]# rngd -f --no-tpm=1

The options for rngd.service are found in /etc/conf.d/rngd. I modified the file as follows:

# RNGD_OPTS="-o /dev/random -r /dev/urandom"
RNGD_OPTS=" -o /dev/random --no-tpm=1"
[root@asarum system]# cat /dev/random | rngtest -c 1000
rngtest 4
Copyright (c) 2004 by Henrique de Moraes Holschuh
This is free software; see the source for copying conditions.  There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

rngtest: starting FIPS tests...
rngtest: bits received from input: 20000032
rngtest: FIPS 140-2 successes: 1000
rngtest: FIPS 140-2 failures: 0
rngtest: FIPS 140-2(2001-10-10) Monobit: 0
rngtest: FIPS 140-2(2001-10-10) Poker: 0
rngtest: FIPS 140-2(2001-10-10) Runs: 0
rngtest: FIPS 140-2(2001-10-10) Long run: 0
rngtest: FIPS 140-2(2001-10-10) Continuous run: 0
rngtest: input channel speed: (min=891.472; avg=2161.828; max=2788.585)Kibits/s
rngtest: FIPS tests speed: (min=28.682; avg=47.816; max=146.719)Mibits/s
rngtest: Program run time: 9434482 microseconds

Issue with ACPI and gpio_ich

The gpio_ich module causes the following error:

ACPI Warning: 0x0000000000000428-0x000000000000042f SystemIO conflicts with Region \PMIO 2 (20120711/utaddress-251)
ACPI Warning: 0x0000000000000500-0x000000000000053f SystemIO conflicts with Region \GPIO 1 (20120711/utaddress-251)
ACPI Warning: 0x0000000000000500-0x000000000000053f SystemIO conflicts with Region \GP01 2 (20120711/utaddress-251)
lpc_ich: Resource conflict(s) found affecting gpio_ich
ACPI Warning: 0x000000000000f040-0x000000000000f05f SystemIO conflicts with Region \SMB0 1 (20120711/utaddress-251)
ACPI Warning: 0x000000000000f040-0x000000000000f05f SystemIO conflicts with Region \_SB_.PCI0.SBUS.SMBI 2 (20120711/utaddress-251)

It doesn't seem to cause any realworld problems.

Random kernel panics on boot

If Archlinux boots without any issues sometimes, but locks up with a kernel panic other times, the cause (as described by Whef in this thread: https://bbs.archlinux.org/viewtopic.php?pid=1169781#p1169781) is likely the 'btusb' module.

To fix the issue, blacklist the 'btusb' module on the next boot by running:

 sudo echo "blacklist btusb" > /etc/modprobe.d/disable_btusb.conf

Then use rc.local to load it at the end of the boot process by running:

 sudo echo "modprobe btusb" >> /etc/rc.local

This appears to avoid whatever race condition conflict that causes the kernel to panic on boot, but if you're still having the same issue, try removing 'modprobe btusb' from /etc/rc.local to avoid the module completely.

Additional resources