Difference between revisions of "ASUS Zenbook Prime UX31A"

From ArchWiki
Jump to: navigation, search
(mei)
m (Installation: "an UEFI" -> "a UEFI")
(34 intermediate revisions by 18 users not shown)
Line 6: Line 6:
  
 
== Installation ==
 
== Installation ==
The following instructions cover a complete installation of a setup with [[dm-crypt with LUKS]] and [[LVM]] on the ASUS Zenbook UX31a.
+
To install Arch Linux on UX31A, you can follow the official [[Installation_Guide]]. Since the UX31A uses UEFI and GPT, make sure to also read the [[UEFI]], [[GPT]] and [[UEFI_Bootloaders]] pages. It is recommended to use [[GRUB]] as a bootloader. To prepare a UEFI USB device, read [[UEFI#Create_UEFI_bootable_USB_from_ISO]].
 
+
=== Notes ===
+
{{Note|It is recommended to read the [[UEFI]], [[GPT]] and [[UEFI_Bootloaders]] pages before following those instructions.}}
+
 
+
=== Prepare installation medium ===
+
* Download the new Arch Linux ISO from the [https://www.archlinux.org/download/ Arch Linux download page].
+
* Install it to your USB device (/dev/sdX) by running
+
dd bs=5M if=archlinux-XXXX.YY.ZZ-dual.iso of=/dev/sdX
+
  
 
=== Boot from USB medium ===
 
=== Boot from USB medium ===
Press {{keypress|Escape}} to get into the boot menu. If the USB bootable device is not listed, enter the configuration menu and directly press {{keypress|F10}} to save. Press {{keypress|Escape}} again on reboot: This time the USB bootable device should appear in the menu.
+
Press {{ic|Escape}} to get into the boot menu. If the USB bootable device is not listed, enter the configuration menu and directly press {{ic|F10}} to save. Press {{ic|Escape}} again on reboot: This time the USB bootable device should appear in the menu.
 
+
Select 'Boot Arch Linux (x86_64)" and press {{keypress|Enter}}. 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 [[dm-crypt with LUKS|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 {{ic|gdisk /dev/sda}} to start the partition manager. By typing {{ic|d}} we are capable of deleting all existing partitions and start with a fresh configuration.
+
 
+
Now use {{ic|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 {{ic|<empty>}} command means that you leave the field in the prompt empty and just hit {{keypress|Enter}} directly. After creating those partitions enter {{ic|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 {{ic|w}} and confirm with {{ic|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 {{ic|/etc/locale.conf}}
+
 
+
  LANG="en_US.UTF-8"
+
  LC_COLLATE="C"
+
 
+
and uncomment the following line in {{ic|/etc/locale.gen}}
+
 
+
  en_US.UTF-8
+
 
+
Then execute {{ic|locale-gen}}.
+
 
+
==== Configure mkinitcpio.conf and create initial RAM disk ====
+
Edit {{ic|/etc/mkinitcpio.conf}}
+
 
+
  HOOKS=(... sata encrypt lvm2 filesystems ...)
+
 
+
and run {{ic|mkinitcpio -p linux}},.
+
 
+
==== Configure rc.conf ====
+
Edit {{ic|/etc/rc.conf}} and set:
+
 
+
  USELVM="yes"
+
 
+
=== Configure bootloader ===
+
Load the required modules:
+
 
+
  modprobe dm-mod
+
  modprobe efivars
+
 
+
{{note | running `modprobe efivars' should display a few lines, confirming the success of the module addition. If such "efi variables" are not set up properly, errors will ensue and you won't be able to reboot on your partition correctly. One of the way to have such efi variables is to make a bootable UEFI device using [[UEFI#Create_UEFI_bootable_USB_from_ISO]] and to boot on it properly. }}
+
 
+
Edit {{ic|/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"
+
  GRUB_CMDLINE_LINUX="cryptdevice=/dev/sda3:vgroup:allow-discards"
+
{{Note| Kernel parameter {{ic| pcie_aspm&#61;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 {{ic|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
+
Select 'Boot Arch Linux (x86_64)" and press {{ic|Enter}}. The installation system will be booted and you will end up with a terminal.
  efibootmgr --create --gpt --disk /dev/sda --part 1 --write-signature --label "Arch Linux (GRUB2)" --loader '\EFI\arch_grub\grubx64.efi'
+
  reboot
+
  
=== Additional steps ===
+
=== Grub2 Installation ===
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"
+
The UX31A should come with an EFI System Partition ("ESP", see [[UEFI#Booting_an_OS_using_UEFI]]). For an Arch-only installation, following normal install procedure without formatting that partition -- thus using Windows' bootloader -- will result in a bootable system. However, partitioning the disk from scratch, creating a new ESP, and installing Arch will result in a non bootable system, because Grub will not be added to the UEFI boot option menu (instead, the user will likely be dropped to the UEFI BIOS). To fix this, after following normal installation procedure, follow the instructions at [[GRUB_EFI_Examples#Z68_Family_and_U47_Family]]. (UX31A's BIOS has the "Launch EFI shell from filesystem device" option, so only follow the instructions for that specific case). You should now be able to boot into your newly installed system.
  
=== Mount installed system from installation medium ===
+
== Kernel Parameters ==
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:
+
These kernel parameters offer some speed optimizations and longer battery life. It is recommended to enable them. To add kernel paramaters to GRUB2 you have to edit {{ic|/etc/default/grub}} and add them to the GRUB_CMDLINE_LINUX_DEFAULT line.
  
  cryptsetup luksOpen /dev/sda3 lvm
+
{{ic|1=add_efi_memmap i915.i915_enable_rc6=1 pcie_aspm=force drm.vblankoffdelay=1 i915.semaphores=1}}
  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 ==
 
== Function keys ==
Line 207: Line 30:
 
! Keys!! Function !! X sees !! shortcut needed  
 
! Keys!! Function !! X sees !! shortcut needed  
 
|-
 
|-
| {{keypress|Fn+F1}} || Sleep || XF86Sleep || yes
+
| {{ic|Fn+F1}} || Sleep || XF86Sleep || no
 
|-
 
|-
| {{keypress|Fn+F2}} || Turn off WLAN and Bluetooth || XF86WLAN & XF86Bluetooth || no
+
| {{ic|Fn+F2}} || Turn off WLAN and Bluetooth || XF86WLAN & XF86Bluetooth || no
 
|-
 
|-
| {{keypress|Fn+F3}} || Dim keyboard backlight || XF86KbdBrightnessDown || yes
+
| {{ic|Fn+F3}} || Dim keyboard backlight || XF86KbdBrightnessDown || yes
 
|-
 
|-
| {{keypress|Fn+F4}} || Brighten keyboard backlight || XF86KbdBrightnessUp || yes
+
| {{ic|Fn+F4}} || Brighten keyboard backlight || XF86KbdBrightnessUp || yes
 
|-
 
|-
| {{keypress|Fn+F5}} || Dim LCD backlight || No recognized key || no
+
| {{ic|Fn+F5}} || Dim LCD backlight || XF86MonBrightnessDown || no
 
|-
 
|-
| {{keypress|Fn+F6}} || Brighten LCD backlight || No recognized key || no
+
| {{ic|Fn+F6}} || Brighten LCD backlight || XF86MonBrightnessUp || no
 
|-
 
|-
| {{keypress|Fn+F7}} || Turn off LCD || No named key || no
+
| {{ic|Fn+F7}} || Turn off LCD || No named key || no
 
|-
 
|-
| {{keypress|Fn+F8}} || Toggle display || XF86Display || yes
+
| {{ic|Fn+F8}} || Toggle display || XF86Display || yes
 
|-
 
|-
| {{keypress|Fn+F9}} || Toggle touchpad || XF86TouchpadToggle || yes
+
| {{ic|Fn+F9}} || Toggle touchpad || XF86TouchpadToggle || yes
 
|-
 
|-
| {{keypress|Fn+F10}} || Audio mute/unmute || XF86AudioMute|| yes
+
| {{ic|Fn+F10}} || Audio mute/unmute || XF86AudioMute|| yes
 
|-
 
|-
| {{keypress|Fn+F11}} || Audio volume down || XF86AudioLowerVolume || yes
+
| {{ic|Fn+F11}} || Audio volume down || XF86AudioLowerVolume || yes
 
|-
 
|-
| {{keypress|Fn+F12}} || Audio volume up || XF86AudioRaiseVolume || yes
+
| {{ic|Fn+F12}} || Audio volume up || XF86AudioRaiseVolume || yes
 
|-
 
|-
| {{keypress|Fn+a}} || Ambient light sensor || No recognized key ||N/A
+
| {{ic|Fn+a}} || Ambient light sensor || No recognized key ||N/A
 
|-
 
|-
| {{keypress|Fn+c}} || Switch display profiles || XF86Launch1 || yes
+
| {{ic|Fn+c}} || Switch display profiles || XF86Launch1 || yes
 
|-
 
|-
| {{keypress|Fn+v}} || Webcam || XF86WebCam || yes
+
| {{ic|Fn+v}} || Webcam || XF86WebCam || yes
 
|-
 
|-
| {{keypress|Fn+space}} || Switch power profiles || XF86Launch6 || yes
+
| {{ic|Fn+space}} || Switch power profiles || XF86Launch6 || yes
 
|}
 
|}
  
 
=== Screen backlight ===
 
=== Screen backlight ===
 +
{{note | Since kernel 3.7.3 screen brightness keys are working out of the box with boot parameter acpi_osi&#61; , so this section is legacy and will soon be moved }}
  
Screen Brightness keymaps ({{keypress|Fn+F5}}, {{keypress|Fn+F6}}) does not work. It means the system does not get any keymap when the key combination is pressed. You get two options here :
+
Screen Brightness keymaps ({{ic|Fn+F5}}, {{ic|Fn+F6}}) does not work. It means the system does not get any keymap when the key combination is pressed. You get two options here :
 
* try to fix the problem
 
* try to fix the problem
 
* work around the problem and just use a different key combination
 
* work around the problem and just use a different key combination
Line 321: Line 145:
 
  # IGDM is the operation region (\_SB_.PCI0.GFX0.IGDM) containing the CADL/DIDL fields                                                                                                                                                         
 
  # 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                                                                                                                                                                       
 
  # \aslb is a named field containing the base-address of the IGDM region                                                                                                                                                                       
  # this address depends on the installed ram                                                                       |-
+
  # this address depends on the installed ram  
| {{keypress|Fn+c}} || Switch display profiles || XF86Launch1 || yes                                                                                                                         
+
  # how to get the address:                                                        
  # how to get the address:                                                                                                                                                                                                                  
+
 
  # - git clone git://github.com/Bumblebee-Project/acpi_call.git                                                                                                                                                                               
 
  # - git clone git://github.com/Bumblebee-Project/acpi_call.git                                                                                                                                                                               
 
  # - make                                                                                                                                                                                                                                     
 
  # - make                                                                                                                                                                                                                                     
Line 394: Line 217:
  
 
=== Keyboard backlight ===
 
=== Keyboard backlight ===
Install {{AUR|asus-kbd-backlight}} from AUR. To allow users to change the brightness, say:
+
Load the {{ic|asus-nb-wmi}} kernel module:
 +
# modprobe asus-nb-wmi
 +
 
 +
You'll also want to create the file {{ic|/etc/modules-load.d/asus-kbd-backlight.conf}} with the following content, to ensure that the module is loaded when the laptop is booted:
 +
# Enable control of keyboard backlight using asus-kbd-backlight (<nowiki>https://aur.archlinux.org/packages/asus-kbd-backlight/</nowiki>)
 +
asus-nb-wmi
 +
 
 +
Next, install {{AUR|asus-kbd-backlight}} from AUR. To allow users to change the brightness, say:
  
 
  # asus-kbd-backlight allowusers
 
  # asus-kbd-backlight allowusers
Line 467: Line 297:
 
  notify-send "Keyboard brightness already at zero"
 
  notify-send "Keyboard brightness already at zero"
 
  fi
 
  fi
 +
 +
==== Automatic Backlight Control ====
 +
This C program will automatically turn off the backlight after a given idle time, and turn it on proportionally to the screen brightness. Written for Asus N56DP but will probably work here as well. Please email me if not. Note that you must run it as root, or if using some other user, give that user write permission to the backlight brightness file. This program works in plain tty mode as well as in X, but if you're using X you must start the X server first before starting this program, otherwise the X server will hang.
 +
[[User:Hyc|Hyc]] ([[User talk:Hyc|talk]]) 13:24, 16 January 2013 (UTC)
 +
/* Author: Howard Chu <hyc@symas.com> 2013-01-15
 +
  *
 +
  * monitor keyboard activity and toggle keyboard backlight
 +
  * for Asus laptops. Tested on Asus N56DP.
 +
  */
 +
#include <sys/types.h>
 +
#include <sys/stat.h>
 +
#include <fcntl.h>
 +
#include <poll.h>
 +
 +
static char dummybuf[8192];
 +
 +
/** @brief How many milliseconds before turning off kbd light */
 +
#ifndef IDLE_MSEC
 +
#define IDLE_MSEC 7000
 +
#endif
 +
 +
int main(int argc, char *argv[])
 +
{
 +
struct pollfd pfd;
 +
int rc, blfd, scfd;
 +
int brt, timeout, prev = -1;
 +
char bm[2] = "0\n";
 +
 +
scfd = open("/sys/class/backlight/acpi_video0/brightness", O_RDONLY);
 +
blfd = open("/sys/class/leds/asus::kbd_backlight/brightness", O_WRONLY);
 +
pfd.fd = open("/dev/input/by-path/platform-i8042-serio-0-event-kbd", O_RDONLY);
 +
pfd.events = POLLIN;
 +
 +
timeout = IDLE_MSEC;
 +
while (1) {
 +
rc = poll(&pfd, 1, timeout);
 +
/* Kbd brightness ranges from 0 to 3.
 +
* Screen brightness ranges from 1 to 10.
 +
* Make the keyboard brightness
 +
* depend on the screen brightness.
 +
*
 +
* Assume 10 means working in a bright room.
 +
* In that case, leave the kbd light off.
 +
* map screen 1-9 to kbd 1-3.
 +
*/
 +
if (rc) {
 +
/* got keyboard input, flush it all and
 +
* wait for the next event. Also check
 +
* the screen brightness and set the kbd
 +
* backlight accordingly.
 +
*/
 +
read(pfd.fd, dummybuf, sizeof(dummybuf));
 +
timeout = IDLE_MSEC;
 +
read(scfd, dummybuf, sizeof(dummybuf));
 +
lseek(scfd, 0, SEEK_SET);
 +
brt = atoi(dummybuf);
 +
if (brt == 10) {
 +
brt = 0;
 +
} else {
 +
brt = (brt + 2) / 3;
 +
}
 +
} else {
 +
/* once we've gotten a timeout, turn off
 +
* kbd backlight and wait forever for
 +
* the next keypress
 +
*/
 +
timeout = -1;
 +
brt = 0;
 +
}
 +
if (brt == prev)
 +
continue;
 +
bm[0] = brt + '0';
 +
write(blfd, bm, 2);
 +
lseek(blfd, 0, SEEK_SET);
 +
prev = brt;
 +
}
 +
}
  
 
== Solid State Drive ==
 
== Solid State Drive ==
 
Check [[Solid_State_Drives]]
 
Check [[Solid_State_Drives]]
 
  
 
== Touchpad ==
 
== Touchpad ==
Line 478: Line 384:
 
Multifinger taps work out of the box.
 
Multifinger taps work out of the box.
 
{{Tip|Multifinger taps: Two finger for middle click; three fingers for right click.}}
 
{{Tip|Multifinger taps: Two finger for middle click; three fingers for right click.}}
 +
 +
=== Multitouch gestures ===
 +
To enable multitouch gestures like those under Windows, one can install {{AUR|touchegg}} from the AUR. Using {{ic|touchegg}} will require disabling some input-handling that is done by the synaptics input driver. Edit your {{ic|/etc/X11/xorg.conf.d/10-synaptics.conf}}
 +
 +
Section "InputClass"
 +
        Identifier "touchpad catchall"
 +
        Driver "synaptics"
 +
        MatchIsTouchpad "on"
 +
        MatchDevicePath "/dev/input/event*"
 +
        Option "TapButton1" "1"
 +
        Option "TapButton2" "0"
 +
        Option "TapButton3" "0"
 +
        Option "ClickFinger2" "0"
 +
        Option "ClickFinger3" "0"
 +
        Option "HorizTwoFingerScroll" "0"
 +
        Option "VertTwoFingerScroll" "0"
 +
        Option "ClickPad" "true"
 +
        Option "EmulateMidButtonTime" "0"
 +
        Option "SoftButtonAreas" "50% 0 82% 0 0 0 0 0"
 +
EndSection
 +
 +
An alternative to X.org configuration files is to use the {{ic|synclient}} command within the {{ic|.xinitrc}} script. This method will limit changes to your desktop environment.
 +
 +
  synclient TapButton2=0 TapButton3=0 ClickFinger2=0 ClickFinger3=0 HorizTwoFingerScroll=0 VertTwoFingerScroll=0
 +
 +
{{ic|touchegg}} will need to be autostarted for multitouch gestures to be activated. This can be done with {{ic|touchegg &}} in your {{ic|.xinitrc}}, or using the autostart/startup applications functionality of your desktop environment. {{ic|~/.config/touchegg/touchegg.conf}} can then be configured as necessary.
 +
 +
=== Multi-tap, two-finger scrolling doesn't work ===
 +
Check "xinput list" and see whether the Elantech touchpad was recognized as an Elantech Click-pad. If so, brenix's comment in [https://aur.archlinux.org/packages/psmouse-elantech/ psmouse-elantech AUR] fixed it for me.
 +
 +
=== Multitouch gestures in Gnome 3 ===
 +
GNOME 3's gnome-shell does its own mouse-handling, which can interfere with synaptics and touchegg settings unless the appropriate plugin is disabled.
 +
 +
  gsettings set org.gnome.settings-daemon.plugins.mouse active false
 +
 +
Note that disabling this plugin will cause the the current settings within the Mouse & Touchpad section of System Settings to be ignored.
  
 
=== Disable Touchpad While Typing ===
 
=== Disable Touchpad While Typing ===
Line 485: Line 427:
 
== HDMI plugged at boot ==
 
== HDMI plugged at boot ==
  
There seems to be an issue whereby having an HDMI device plugged in at boot results in the screens being switched and also the laptop screen not coming on. To make this more bearable you can automate switching HDMI on with the following udev rule and script:
+
There seems to be a problem whereby having an HDMI device plugged in at boot results in the screens being switched and also the laptop screen not coming on. To make this more bearable you can automate switching HDMI on with the following udev rule and script:
  
 
   
 
   
Line 502: Line 444:
 
And add the following udev rule:
 
And add the following udev rule:
 
  # echo 'ACTION=="change", SUBSYSTEM=="drm", RUN+="/usr/local/share/hdmi-plugged-startup"' >> /etc/udev/rules.d/10-local.rules
 
  # echo 'ACTION=="change", SUBSYSTEM=="drm", RUN+="/usr/local/share/hdmi-plugged-startup"' >> /etc/udev/rules.d/10-local.rules
 +
 +
Suspending, unplugging the HDMI cable, and resuming is a way to enable the Zenbook's screen without rebooting if it was booted with the cable plugged in.
  
 
== Powersave management ==
 
== Powersave management ==
See [[Power saving]]. Configure [[Laptop_Mode_Tools]] and do not forget to check [[CPU_Frequency_Scaling]].
+
For automatic powersaving when on battery configure [[Laptop_Mode_Tools]]. For manual power saving see [[Power saving]]
 
+
Here is a helper script for easy power management (feel free to improve)
+
 
+
#!/bin/bash
+
# -*- coding: UTF8 -*-
+
+
case "$1" in
+
  ac)
+
  sudo pm-powersave ac
+
  for i in 0 1 2 3; do sudo cpupower -c $i -g ondemand; done
+
  ;;
+
  battery)
+
  sudo pm-powersave battery
+
  sudo cpupower -c 0 frequency-set -g ondemand
+
  for i in 1 2 3; do sudo cpupower -c $i frequency-set -f 800Mhz; done
+
  ;;
+
  aggressive)
+
  sudo pm-powersave battery
+
  for i in 0 1 2 3; do sudo cpupower -c $i frequency-set -f 800Mhz; done
+
  ;;
+
  info)
+
  echo "#########################"
+
  echo "# acpi"
+
  acpi
+
  echo "#########################"
+
  echo "# cpupower frequency-info"
+
  for i in 0 1 2 3; do cpupower -c $i frequency-info; done
+
  echo "#########################"
+
  echo "Available energy governators"
+
  cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors
+
  ;;
+
  powertop)
+
  sudo powertop
+
  ;;
+
  suspend)
+
  sudo pm-suspend
+
  ;;
+
  load)
+
  sudo modprobe cpufreq_powersave
+
sudo modprobe cpufreq_conservative
+
sudo modprobe cpufreq_userspace
+
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 cpupower
+
;;
+
0)
+
$0 info
+
;;
+
1)
+
$0 battery
+
;;
+
2)
+
$0 ac
+
;;
+
3)
+
$0 aggressive
+
;;
+
4)
+
$0 suspend
+
;;
+
5)
+
  $0 powertop
+
;;
+
6)
+
$0 install
+
;;
+
7)
+
$0 load
+
;;
+
*)
+
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"
+
echo "7) load"
+
read choice
+
#echo $choice
+
if [[ $choice = [0-9]* ]]
+
then
+
$0 $choice
+
else
+
$0 0
+
fi
+
  esac
+
 
+
exit 0
+
  
 
==Hardware and Modules==
 
==Hardware and Modules==
Line 604: Line 454:
 
====PCI====
 
====PCI====
  
This is output of lscpci -nnn -k
+
This is output of lspci -nnn -k
  
 
{| class="wikitable" border="1" cellpadding="5" cellspacing="0"
 
{| class="wikitable" border="1" cellpadding="5" cellspacing="0"
Line 721: Line 571:
 
  Oct 06 06:36:27 asarum systemd[1]: Set hardware watchdog to 30s.
 
  Oct 06 06:36:27 asarum systemd[1]: Set hardware watchdog to 30s.
  
====Issue with ACPI and gpio_ich====
+
====Problem with ACPI and gpio_ich====
  
 
The gpio_ich module causes the following error:
 
The gpio_ich module causes the following error:
Line 755: Line 605:
 
       0500-057f : pnp 00:05
 
       0500-057f : pnp 00:05
  
So, net/net, there's no real issue.
+
So, net/net, there's no real problem.
 +
 
 +
====Problem with USB and Laptop_Mode_Tools====
 +
 
 +
USB mouse problems and hotplug does not working in some cases with messages in dmesg like:
 +
 
 +
      xhci_hcd 0000:00:14.0: setting latency timer to 64
 +
      xhci_hcd 0000:00:14.0: WARN Event TRB for slot 1 ep 0 with no TDs queued?
 +
 
 +
The solution is to set "CONTROL_USB_AUTOSUSPEND" in /etc/laptop-mode/conf.d/usb-autosuspend.conf to 1 and having a long "AUTOSUSPEND_TIMEOUT"
  
 
== Random kernel panics on boot ==
 
== 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.
+
If Archlinux boots without any problems 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:
+
To fix the problem, blacklist the 'btusb' module on the next boot by running:
  
 
   sudo echo "blacklist btusb" > /etc/modprobe.d/disable_btusb.conf
 
   sudo echo "blacklist btusb" > /etc/modprobe.d/disable_btusb.conf
Line 769: Line 628:
 
   sudo echo "modprobe btusb" >> /etc/rc.local
 
   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.
+
This appears to avoid whatever race condition conflict that causes the kernel to panic on boot, but if you're still having the same problem, try removing 'modprobe btusb' from /etc/rc.local to avoid the module completely.
 
+
== Legacy information ==
+
Here is legacy information from earlier fix that are no longer required.
+
=== function keys (other than screen backlight) ===
+
 
+
{{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 {{ic|3.4.7-1-ARCH}} by your output for {{ic|uname -r}}
+
==BIOS Version Problems==
  
3 There is still a problem since dkms doesn't gzip the kernel module and archlinux does (see {{ic|$ modinfo asus-wmi}}):
+
It seems that updating the BIOS to versions 215 and higher causes problems with ACPI handling of the battery charge levels. In particular it seems that one cannot charge the battery beyond 91%-93%. The problem does not seem to be present in Windows however. For further details please see the forum thread [https://bbs.archlinux.org/viewtopic.php?pid=1211033#p1211033 here]. The most up to date BIOS version without any problems is 212. Unless it's absolutely necessary, refrain from updating your BIOS.
# 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, {{ic|xev}} should display events for {{keypress|Fn}} 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
+
  
 
==See also==
 
==See also==
Line 844: Line 640:
 
*https://help.ubuntu.com/community/AsusZenbookPrime
 
*https://help.ubuntu.com/community/AsusZenbookPrime
 
*http://ubuntuforums.org/showthread.php?t=2005999
 
*http://ubuntuforums.org/showthread.php?t=2005999
*[[ Wikipedia Zenbook#UX32.2C_UX42_and_UX52 ]]
+
*[[Wikipedia:Zenbook#UX32.2C_UX42_and_UX52]]

Revision as of 19:35, 5 September 2013

Tango-edit-clear.pngThis article or section needs language, wiki syntax or style improvements.Tango-edit-clear.png

Reason: This should only have information specific to the hardware. Other content should not be duplicated here. (Discuss in Talk:ASUS Zenbook Prime UX31A#)

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

To install Arch Linux on UX31A, you can follow the official Installation_Guide. Since the UX31A uses UEFI and GPT, make sure to also read the UEFI, GPT and UEFI_Bootloaders pages. It is recommended to use GRUB as a bootloader. To prepare a UEFI USB device, read UEFI#Create_UEFI_bootable_USB_from_ISO.

Boot from USB medium

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

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

Grub2 Installation

The UX31A should come with an EFI System Partition ("ESP", see UEFI#Booting_an_OS_using_UEFI). For an Arch-only installation, following normal install procedure without formatting that partition -- thus using Windows' bootloader -- will result in a bootable system. However, partitioning the disk from scratch, creating a new ESP, and installing Arch will result in a non bootable system, because Grub will not be added to the UEFI boot option menu (instead, the user will likely be dropped to the UEFI BIOS). To fix this, after following normal installation procedure, follow the instructions at GRUB_EFI_Examples#Z68_Family_and_U47_Family. (UX31A's BIOS has the "Launch EFI shell from filesystem device" option, so only follow the instructions for that specific case). You should now be able to boot into your newly installed system.

Kernel Parameters

These kernel parameters offer some speed optimizations and longer battery life. It is recommended to enable them. To add kernel paramaters to GRUB2 you have to edit /etc/default/grub and add them to the GRUB_CMDLINE_LINUX_DEFAULT line.

add_efi_memmap i915.i915_enable_rc6=1 pcie_aspm=force drm.vblankoffdelay=1 i915.semaphores=1

Function keys

Note: A working keymap means that there is some output in xev when the key combination is pressed OR that the functionality is built in and "just works". It does not means that the keymap is linked to the functionality. For that it is often necessary to add a keyboard shortcut by the method of your choice or to use a desktop shell with built-in shortcut support for the keycode in question. For some of the keys the function operates on a BIOS level and no shortcut is needed.

This table shows the function keys, their intended function, what keycode (if any) X recognizes and whether the function key operates at the BIOS level or if it needs a shortcut.

Keys Function X sees shortcut needed
Fn+F1 Sleep XF86Sleep no
Fn+F2 Turn off WLAN and Bluetooth XF86WLAN & XF86Bluetooth no
Fn+F3 Dim keyboard backlight XF86KbdBrightnessDown yes
Fn+F4 Brighten keyboard backlight XF86KbdBrightnessUp yes
Fn+F5 Dim LCD backlight XF86MonBrightnessDown no
Fn+F6 Brighten LCD backlight XF86MonBrightnessUp no
Fn+F7 Turn off LCD No named key no
Fn+F8 Toggle display XF86Display yes
Fn+F9 Toggle touchpad XF86TouchpadToggle yes
Fn+F10 Audio mute/unmute XF86AudioMute yes
Fn+F11 Audio volume down XF86AudioLowerVolume yes
Fn+F12 Audio volume up XF86AudioRaiseVolume yes
Fn+a Ambient light sensor No recognized key N/A
Fn+c Switch display profiles XF86Launch1 yes
Fn+v Webcam XF86WebCam yes
Fn+space Switch power profiles XF86Launch6 yes

Screen backlight

Note: Since kernel 3.7.3 screen brightness keys are working out of the box with boot parameter acpi_osi= , so this section is legacy and will soon be moved

Screen Brightness keymaps (Fn+F5, Fn+F6) does not work. It means the system does not get any keymap when the key combination is pressed. You get two options here :

  • try to fix the problem
  • work around the problem and just use a different key combination

The lazy option first:

Screen backlight workarounds

Method 1

Install xorg-xbacklight

You can add some convenient keyboard shortcuts by the method of your choice.

Method 2

Install asus-screen-brightnessAUR from AUR. To allow users to change the brightness, say:

# asus-screen-brightness allowusers

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

# echo "asus-screen-brightness allowusers" >> /etc/rc.local

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

# systemctl daemon-reload
# systemctl start asus-screen-brightness.service
# systemctl enable asus-screen-brightness.service

Adding to .zshrc or .bashrc :

alias -g "backlight"="/bin/bash /usr/bin/asus-screen-brightness"

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 fix

Note: UX31A BIOS 211 IGDM Base Address is 0xDA8A9018, UX31A BIOS 206 UGDM Base Address is 0xDA8CE018 and UX31A BIOS 204 IGDM Base Address is 0xDA8CF018, everything else is the same.
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).

Keyboard backlight

Load the asus-nb-wmi kernel module:

# modprobe asus-nb-wmi

You'll also want to create the file /etc/modules-load.d/asus-kbd-backlight.conf with the following content, to ensure that the module is loaded when the laptop is booted:

# Enable control of keyboard backlight using asus-kbd-backlight (https://aur.archlinux.org/packages/asus-kbd-backlight/)
asus-nb-wmi

Next, 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
# systemctl start asus-kbd-backlight.service
# systemctl enable asus-kbd-backlight.service

Now 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

Automatic Backlight Control

This C program will automatically turn off the backlight after a given idle time, and turn it on proportionally to the screen brightness. Written for Asus N56DP but will probably work here as well. Please email me if not. Note that you must run it as root, or if using some other user, give that user write permission to the backlight brightness file. This program works in plain tty mode as well as in X, but if you're using X you must start the X server first before starting this program, otherwise the X server will hang. Hyc (talk) 13:24, 16 January 2013 (UTC)

/* Author: Howard Chu <hyc@symas.com> 2013-01-15
 *
 * monitor keyboard activity and toggle keyboard backlight
 * for Asus laptops. Tested on Asus N56DP.
 */
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <poll.h>

static char dummybuf[8192];

/** @brief How many milliseconds before turning off kbd light */
#ifndef IDLE_MSEC
#define IDLE_MSEC	7000
#endif

int main(int argc, char *argv[])
{
	struct pollfd pfd;
	int rc, blfd, scfd;
	int brt, timeout, prev = -1;
	char bm[2] = "0\n";

	scfd = open("/sys/class/backlight/acpi_video0/brightness", O_RDONLY);
	blfd = open("/sys/class/leds/asus::kbd_backlight/brightness", O_WRONLY);
	pfd.fd = open("/dev/input/by-path/platform-i8042-serio-0-event-kbd", O_RDONLY);
	pfd.events = POLLIN;

	timeout = IDLE_MSEC;
	while (1) {
		rc = poll(&pfd, 1, timeout);
		/* Kbd brightness ranges from 0 to 3.
		 * Screen brightness ranges from 1 to 10.
		 * Make the keyboard brightness
		 * depend on the screen brightness.
		 *
		 * Assume 10 means working in a bright room.
		 * In that case, leave the kbd light off.
		 * map screen 1-9 to kbd 1-3.
		 */
		if (rc) {
			/* got keyboard input, flush it all and
			 * wait for the next event. Also check
			 * the screen brightness and set the kbd
			 * backlight accordingly.
			 */
			read(pfd.fd, dummybuf, sizeof(dummybuf));
			timeout = IDLE_MSEC;
			read(scfd, dummybuf, sizeof(dummybuf));
			lseek(scfd, 0, SEEK_SET);
			brt = atoi(dummybuf);
			if (brt == 10) {
				brt = 0;
			} else {
				brt = (brt + 2) / 3;
			}
		} else {
			/* once we've gotten a timeout, turn off
			 * kbd backlight and wait forever for
			 * the next keypress
			 */
			timeout = -1;
			brt = 0;
		}
		if (brt == prev)
			continue;
		bm[0] = brt + '0';
		write(blfd, bm, 2);
		lseek(blfd, 0, SEEK_SET);
		prev = brt;
	}
}

Solid State Drive

Check Solid_State_Drives

Touchpad

Instructions to activate the right button. (As an alternative you cant try This).

Multifinger taps work out of the box.

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

Multitouch gestures

To enable multitouch gestures like those under Windows, one can install toucheggAUR from the AUR. Using touchegg will require disabling some input-handling that is done by the synaptics input driver. Edit your /etc/X11/xorg.conf.d/10-synaptics.conf

Section "InputClass"
        Identifier "touchpad catchall"
        Driver "synaptics"
        MatchIsTouchpad "on"
        MatchDevicePath "/dev/input/event*"
        Option "TapButton1" "1"
        Option "TapButton2" "0"
        Option "TapButton3" "0"
        Option "ClickFinger2" "0"
        Option "ClickFinger3" "0"
        Option "HorizTwoFingerScroll" "0"
        Option "VertTwoFingerScroll" "0"
        Option "ClickPad" "true"
        Option "EmulateMidButtonTime" "0"
        Option "SoftButtonAreas" "50% 0 82% 0 0 0 0 0"
EndSection

An alternative to X.org configuration files is to use the synclient command within the .xinitrc script. This method will limit changes to your desktop environment.

 synclient TapButton2=0 TapButton3=0 ClickFinger2=0 ClickFinger3=0 HorizTwoFingerScroll=0 VertTwoFingerScroll=0

touchegg will need to be autostarted for multitouch gestures to be activated. This can be done with touchegg & in your .xinitrc, or using the autostart/startup applications functionality of your desktop environment. ~/.config/touchegg/touchegg.conf can then be configured as necessary.

Multi-tap, two-finger scrolling doesn't work

Check "xinput list" and see whether the Elantech touchpad was recognized as an Elantech Click-pad. If so, brenix's comment in psmouse-elantech AUR fixed it for me.

Multitouch gestures in Gnome 3

GNOME 3's gnome-shell does its own mouse-handling, which can interfere with synaptics and touchegg settings unless the appropriate plugin is disabled.

 gsettings set org.gnome.settings-daemon.plugins.mouse active false

Note that disabling this plugin will cause the the current settings within the Mouse & Touchpad section of System Settings to be ignored.

Disable Touchpad While Typing

One of the criticisms this laptop gets (see reviews at Amazon) is that the placement of the touchpad results in frequent touchpad brushing during typing. You should use whatever touchpad disabling method you prefer. See Touchpad_Synaptics#Disable_Trackpad_while_Typing .

HDMI plugged at boot

There seems to be a problem whereby having an HDMI device plugged in at boot results in the screens being switched and also the laptop screen not coming on. To make this more bearable you can automate switching HDMI on with the following udev rule and script:


Add the following script as root:

/usr/local/share/hdmi-plugged-startup
#!/bin/bash

export XAUTHORITY=/home/$USER/.Xauthority
export DISPLAY=:0

/usr/bin/xrandr -display :0 --output eDP1 --auto --output HDMI1 --auto --above eDP1

then make it executable

# chmod +x /usr/local/share/hdmi-plugged-startup

And add the following udev rule:

# echo 'ACTION=="change", SUBSYSTEM=="drm", RUN+="/usr/local/share/hdmi-plugged-startup"' >> /etc/udev/rules.d/10-local.rules

Suspending, unplugging the HDMI cable, and resuming is a way to enable the Zenbook's screen without rebooting if it was booted with the cable plugged in.

Powersave management

For automatic powersaving when on battery configure Laptop_Mode_Tools. For manual power saving see Power saving

Hardware and Modules

PCI

This is output of lspci -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 SMBus Controller 8086:1e22] none
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".

The MEI driver speaks to or through the "Local Manageability Service" or LMS. The LMS driver is available here. Note that with GCC 4.7.2-2, the driver will refuse to compile. I was able to convince it to compile by:

  • adding "#include <unistd.h>" to src/tools/ATVersion.cpp
  • adding "#include <stdio.h>" to src/tools/ATNetworkTool.cpp

It then installs the driver file lms in /usr/local/sbin and the init.d-type daemon file lms in /etc/init.d/.

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"

Test:

[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
watchdog

The chipset also has an hardware watchdog:

root@asarum chris]# wdctl
Device:        /dev/watchdog
Identity:      iTCO_wdt [version 0]
Timeout:       30 seconds
Timeleft:       2 seconds
FLAG           DESCRIPTION               STATUS BOOT-STATUS
KEEPALIVEPING  Keep alive ping reply          0           0
MAGICCLOSE     Supports magic close char      0           0
SETTIMEOUT     Set timeout (in seconds)       0           0

Activating the watchdog under systemd is trivial, as systemd author Lennart Poettering explains in this blog post.

All you do is go into /etc/systemd/system.conf, uncomment the RuntimeWatchdogSec=0 line and change zero to how long the watchdog should go without receiving a ping before it reboots the system. I used 30s, which is the default setting for iTCO_wdt and seemed sane.

#RuntimeWatchdogSec=0
RuntimeWatchdogSec=30

Check after next boot:

[root@asarum chris]# journalctl | grep -i watchdog
Oct 06 06:36:27 asarum kernel: iTCO_wdt: Intel TCO WatchDog Timer Driver v1.10
Oct 06 06:36:27 asarum systemd[1]: Hardware watchdog 'iTCO_wdt', version 0
Oct 06 06:36:27 asarum systemd[1]: Set hardware watchdog to 30s.

Problem 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)

In this case an lsmod shows that the gpio_ich module doesn't wind up being loaded

# lsmod | grep gpio
# 

I then rebooted with apci_enforce_resources=lax. A cat /proc/ioports showed the conflict:

     0420-042f : ACPI GPE0_BLK
      0428-042f : gpio_ich

and

     0500-057f : pnp 00:05
       0500-053f : gpio_ich

In contrast, here's the same lines without acpi_enforce_resources=lax:

     0420-042f : ACPI GPE0_BLK

and

     0500-057f : pnp 00:05

So, net/net, there's no real problem.

Problem with USB and Laptop_Mode_Tools

USB mouse problems and hotplug does not working in some cases with messages in dmesg like:

     xhci_hcd 0000:00:14.0: setting latency timer to 64
     xhci_hcd 0000:00:14.0: WARN Event TRB for slot 1 ep 0 with no TDs queued?

The solution is to set "CONTROL_USB_AUTOSUSPEND" in /etc/laptop-mode/conf.d/usb-autosuspend.conf to 1 and having a long "AUTOSUSPEND_TIMEOUT"

Random kernel panics on boot

If Archlinux boots without any problems 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 problem, 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 problem, try removing 'modprobe btusb' from /etc/rc.local to avoid the module completely.

BIOS Version Problems

It seems that updating the BIOS to versions 215 and higher causes problems with ACPI handling of the battery charge levels. In particular it seems that one cannot charge the battery beyond 91%-93%. The problem does not seem to be present in Windows however. For further details please see the forum thread here. The most up to date BIOS version without any problems is 212. Unless it's absolutely necessary, refrain from updating your BIOS.

See also

Additional resources