https://wiki.archlinux.org/api.php?action=feedcontributions&user=Djcoin&feedformat=atomArchWiki - User contributions [en]2024-03-28T19:44:08ZUser contributionsMediaWiki 1.41.0https://wiki.archlinux.org/index.php?title=ASUS_Zenbook_Prime_UX31A&diff=229823ASUS Zenbook Prime UX31A2012-10-20T00:00:21Z<p>Djcoin: /* Configure bootloader */</p>
<hr />
<div>[[Category:ASUS]]<br />
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.<br />
<br />
See previous generation [[ASUS Zenbook UX31E]] page that has mostly orthogonal information to those here (may be only partially applicable to UX31A)<br />
<br />
== Installation ==<br />
The following instructions cover a complete installation of a setup with [[dm-crypt with LUKS]] and [[LVM]] on the ASUS Zenbook UX31a.<br />
<br />
=== Notes ===<br />
{{Note|It is recommended to read the [[UEFI]], [[GPT]] and [[UEFI_Bootloaders]] pages before following those instructions.}}<br />
<br />
=== Prepare installation medium ===<br />
* Download the new Arch Linux ISO from the [https://www.archlinux.org/download/ Arch Linux download page].<br />
* Install it to your USB device (/dev/sdX) by running<br />
dd bs=5M if=archlinux-XXXX.YY.ZZ-dual.iso of=/dev/sdX<br />
<br />
=== Boot from USB medium ===<br />
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.<br />
<br />
Select 'Boot Arch Linux (x86_64)" and press {{keypress|Enter}}. The installation system will be booted and you will end up with a terminal.<br />
<br />
=== Partition the disk ===<br />
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:<br />
<br />
* [[UEFI]] boot partition<br />
* system boot partition<br />
* encrypted system partition<br />
{{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.}}<br />
<br />
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.<br />
<br />
Now use {{ic|n}} to create new partitions:<br />
<br />
* UEFI boot partition:<br />
ID: 1<br />
Start (sector): <empty><br />
End (sector): +512M<br />
Code: EF00<br />
<br />
* System boot partition<br />
ID: 2<br />
Start (sector): <empty><br />
End (sector): +200M<br />
Code: <empty><br />
<br />
* Encrypted system partition<br />
ID: 3<br />
Start (sector): <empty><br />
End (sector): <empty><br />
Code: <empty><br />
<br />
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:<br />
<br />
Number Start (sector) End (sector) Size Code Name<br />
1 2048 1050623 512.0 MiB EF00 EFI System<br />
2 1050624 1460223 200.0 MiB 8300 Linux filesystem<br />
3 1460224 250069646 118.5 GiB 8300 Linux filesystem<br />
<br />
Finally write the partition table with {{ic|w}} and confirm with {{ic|Y}}.<br />
<br />
=== Setup dm-crypt with LUKS ===<br />
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.<br />
<br />
modprobe dm-crypt<br />
cryptsetup -c aes-xts-plain64 -y -s 512 luksFormat /dev/sda3<br />
cryptsetup luksOpen /dev/sda3 lvm<br />
<br />
lvm pvcreate /dev/mapper/lvm<br />
lvm vgcreate vgroup /dev/mapper/lvm<br />
lvm lvcreate -L 20GB -n root vgroup<br />
lvm lvcreate -C y -L 8GB -n swap vgroup<br />
lvm lvcreate -l 100%Free -n home vgroup<br />
<br />
=== Format partitions ===<br />
<br />
mkfs.vfat -F32 /dev/sda1<br />
mkfs.ext4 /dev/sda2<br />
mkfs.ext4 /dev/mapper/vgroup-root<br />
mkfs.ext4 /dev/mapper/vgroup-home<br />
mkswap /dev/mapper/vgroup-swap<br />
<br />
=== Mount partitions ===<br />
<br />
mount /dev/mapper/vgroup-root /mnt<br />
mkdir -p /mnt/boot<br />
mount /dev/sda2 /mnt/boot<br />
mkdir -p /mnt/boot/efi<br />
mount /dev/sda1 /mnt/boot/efi<br />
mkdir -p /mnt/home<br />
mount /dev/mapper/vgroup-home /mnt/home<br />
swapon -va<br />
<br />
=== Connect to the internet ===<br />
<br />
Follow [[Installation_Guide#Connect_to_the_internet]] to establish an internet connection.<br />
<br />
=== Install the base system ===<br />
<br />
pacstrap /mnt base base-devel<br />
<br />
=== Install a bootloader ===<br />
<br />
pacstrap /mnt grub-efi-x86_64<br />
<br />
=== Configure system ===<br />
<br />
==== Generate fstab ====<br />
<br />
genfstab -p -U /mnt >> /mnt/etc/fstab<br />
<br />
==== Chroot in the newly installed system ====<br />
<br />
arch-chroot /mnt<br />
<br />
==== Set hostname ====<br />
<br />
echo UX31A > /etc/hostname<br />
<br />
==== Set timezone ====<br />
<br />
ln -s /usr/share/zoneinfo/Europe/Vienna /etc/localtime<br />
<br />
==== Set locale preferences ====<br />
<br />
Append the following lines to {{ic|/etc/locale.conf}}<br />
<br />
LANG="en_US.UTF-8"<br />
LC_COLLATE="C"<br />
<br />
and uncomment the following line in {{ic|/etc/locale.gen}}<br />
<br />
en_US.UTF-8<br />
<br />
Then execute {{ic|locale-gen}}.<br />
<br />
==== Configure mkinitcpio.conf and create initial RAM disk ====<br />
Edit {{ic|/etc/mkinitcpio.conf}}<br />
<br />
HOOKS=(... sata encrypt lvm2 filesystems ...)<br />
<br />
and run {{ic|mkinitcpio -p linux}},.<br />
<br />
==== Configure rc.conf ====<br />
Edit {{ic|/etc/rc.conf}} and set:<br />
<br />
USELVM="yes"<br />
<br />
=== Configure bootloader ===<br />
Load the required modules:<br />
<br />
modprobe dm-mod<br />
modprobe efivars<br />
<br />
{{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. }}<br />
<br />
Edit {{ic|/etc/default/grub}}:<br />
<br />
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"<br />
GRUB_CMDLINE_LINUX="cryptdevice=/dev/sda3:vgroup:allow-discards"<br />
{{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.}}<br />
<br />
Install the bootloader:<br />
<br />
grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=arch_grub --recheck<br />
<br />
Copy necessary files and reconfigure grub:<br />
<br />
mkdir -p /boot/grub/locale<br />
cp /usr/share/locale/en\@quot/LC_MESSAGES/grub.mo /boot/grub/locale/en.mo<br />
grub-mkconfig -o /boot/grub/grub.cfg<br />
cp /boot/efi/EFI/arch_grub/grubx64.efi /boot/efi/shellx64.efi<br />
<br />
==== Reboot and launch EFI shell ====<br />
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.<br />
<br />
==== Create GRUB2 entry in the FBM ====<br />
<br />
modprobe efivars<br />
efibootmgr --create --gpt --disk /dev/sda --part 1 --write-signature --label "Arch Linux (GRUB2)" --loader '\EFI\arch_grub\grubx64.efi'<br />
reboot<br />
<br />
=== Additional steps ===<br />
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"<br />
<br />
=== Mount installed system from installation medium ===<br />
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:<br />
<br />
cryptsetup luksOpen /dev/sda3 lvm <br />
vgscan<br />
vgchange -ay<br />
<br />
mount /dev/mapper/vgroup-root /mnt<br />
mount /dev/sda2 /mnt/boot<br />
mount /dev/sda1 /mnt/boot/efi<br />
mount /dev/mapper/vgroup-home /mnt/home<br />
<br />
arch-chroot /mnt<br />
<br />
== Function keys ==<br />
<br />
{{note | A working keymap means that there is some output in {{ic|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 [[Extra_Keyboard_Keys_in_Xorg|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.}}<br />
<br />
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.<br />
<br />
{| class="wikitable" border="1" cellpadding="5" cellspacing="0"<br />
! Keys!! Function !! X sees !! shortcut needed <br />
|-<br />
| {{keypress|Fn+F1}} || Sleep || XF86Sleep || yes <br />
|-<br />
| {{keypress|Fn+F2}} || Turn off WLAN and Bluetooth || XF86WLAN & XF86Bluetooth || no<br />
|-<br />
| {{keypress|Fn+F3}} || Dim keyboard backlight || XF86KbdBrightnessDown || yes<br />
|-<br />
| {{keypress|Fn+F4}} || Brighten keyboard backlight || XF86KbdBrightnessUp || yes<br />
|-<br />
| {{keypress|Fn+F5}} || Dim LCD backlight || No recognized key || no<br />
|-<br />
| {{keypress|Fn+F6}} || Brighten LCD backlight || No recognized key || no<br />
|-<br />
| {{keypress|Fn+F7}} || Turn off LCD || No named key || no<br />
|-<br />
| {{keypress|Fn+F8}} || Toggle display || XF86Display || yes<br />
|-<br />
| {{keypress|Fn+F9}} || Toggle touchpad || XF86TouchpadToggle || yes<br />
|-<br />
| {{keypress|Fn+F10}} || Audio mute/unmute || XF86AudioMute|| yes<br />
|-<br />
| {{keypress|Fn+F11}} || Audio volume down || XF86AudioLowerVolume || yes<br />
|-<br />
| {{keypress|Fn+F12}} || Audio volume up || XF86AudioRaiseVolume || yes<br />
|-<br />
| {{keypress|Fn+a}} || Ambient light sensor || No recognized key ||N/A<br />
|-<br />
| {{keypress|Fn+c}} || Switch display profiles || XF86Launch1 || yes<br />
|-<br />
| {{keypress|Fn+v}} || Webcam || XF86WebCam || yes<br />
|-<br />
| {{keypress|Fn+space}} || Switch power profiles || XF86Launch6 || yes<br />
|}<br />
<br />
=== Screen backlight ===<br />
<br />
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 :<br />
* try to fix the problem<br />
* work around the problem and just use a different key combination<br />
<br />
The lazy option first:<br />
==== Screen backlight workarounds ====<br />
===== Method 1 =====<br />
Install <code>xorg-xbacklight</code> <br />
<br />
You can add some convenient keyboard shortcuts [[Extra_Keyboard_Keys_in_Xorg|by the method of your choice]].<br />
===== Method 2 =====<br />
Install {{AUR|asus-screen-brightness}} from AUR. To allow users to change the brightness, say:<br />
<br />
# asus-screen-brightness allowusers<br />
<br />
If you use [[initscripts]], put this into your {{ic|/etc/rc.local}}:<br />
<br />
# echo "asus-screen-brightness allowusers" >> /etc/rc.local<br />
<br />
Users of [[systemd]] can use the unit file included in the package.<br />
<br />
# systemctl daemon-reload<br />
# systemctl start asus-screen-brightness.service<br />
# systemctl enable asus-screen-brightness.service<br />
<br />
Adding to {{ic|.zshrc}} or {{ic|.bashrc}} :<br />
alias -g "backlight"="/bin/bash /usr/bin/asus-screen-brightness"<br />
allows to easy toggle backlight in terminal :<br />
$ backlight up<br />
$ backlight down<br />
$ backlight max<br />
$ backlight off<br />
$ backlight night<br />
$ backlight 2000<br />
$ backlight show<br />
<br />
And finally, add some convenient keyboard shortcuts [[Extra_Keyboard_Keys_in_Xorg|by the method of your choice]].<br />
<br />
==== Screen backlight fix ====<br />
{{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. }}<br />
<br />
{{warning | This is highly experimental. It works for the UX32VD with bios 2.06, no guarantee that it works for different configurations. }}<br />
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 .<br />
<br />
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. <br />
The cause why the brightness buttons don't work is exactly the same as in the bugreport.<br />
<br />
As root, create the file {{ic|/usr/local/share/backlightfix}}:<br />
This script is posted here: https://bbs.archlinux.org/viewtopic.php?pid=1156051#p1156051<br />
#!/bin/bash <br />
# <br />
# Asus UX32VD acpi backlight fix <br />
# <br />
# Copyright(C) 2012 Eugen Dahm <eugen.dahm@gmail.com>. <br />
# <br />
# fix is based on a proposed bugfix posted on <[url]https://bugs.freedesktop.org/show_bug.cgi?id=45452[/url]> <br />
# <br />
# This program is free software; you can redistribute it and/or modify <br />
# it under the terms of the GNU General Public License as published by <br />
# the Free Software Foundation; either version 2 of the License, or <br />
# (at your option) any later version. <br />
# <br />
# This program is distributed in the hope that it will be useful, <br />
# but WITHOUT ANY WARRANTY; without even the implied warranty of <br />
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the <br />
# GNU General Public License for more details. <br />
# <br />
# You should have received a copy of the GNU General Public License <br />
# along with this program; if not, write to the Free Software <br />
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA <br />
# <br />
# Asus UX32VD acpi backlight fix <br />
# Disclaimer!!!! not recommended to use if laptop is not the Asus UX32VD\ <br />
# probably works with other models too, but the didl and cadl offset needs to be extracted <br />
# from the dsdt <br />
# Tested with bios 2.06 <br />
# IGDM_BASE has to be determined for each notebook <br />
# IGDM is the operation region (\_SB_.PCI0.GFX0.IGDM) containing the CADL/DIDL fields <br />
# \aslb is a named field containing the base-address of the IGDM region <br />
# this address depends on the installed ram |-<br />
| {{keypress|Fn+c}} || Switch display profiles || XF86Launch1 || yes <br />
# how to get the address: <br />
# - git clone git://github.com/Bumblebee-Project/acpi_call.git <br />
# - make <br />
# - load module with insmod or copy to /lib/modules/.... and modprobe <br />
# - echo '\aslb' > /proc/acpi/call <br />
# - cat /proc/acpi/call <br />
# - this is the IGDM base address - fill in below <br />
IGDM_BASE=0xBE8B7018<br />
DIDL_OFFSET=0x120<br />
CADL_OFFSET=0x160<br />
# this basically copies the values of the initialized fields DIDL-DDL8 in the IGDM opregion and initializes CADL-CAL8 with it <br />
# CADL-CAL8 are fields, telling the bios that a screen or something is connected (this is a bit speculation - check <br />
# <[url]https://bugs.freedesktop.org/show_bug.cgi?id=45452[/url]> for more <br />
# if interested, disasselbe the dsdt to understand, why no notifyevent gets thrown, when CADL isn't initialized <br />
# (hint: _Q0E/_Q0F are the backlight methods on the UX32VD) <br />
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 <br />
<br />
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.<br />
<br />
The exact address can be determined with following steps:<br />
<br />
# git clone git://github.com/Bumblebee-Project/acpi_call.git <br />
# cd acpi_call <br />
# make <br />
# gzip acpi_call.ko <br />
# load module acpi_call.ko.gz with insmod or copy to /lib/modules/.... and modprobe <br />
# echo '\aslb' > /proc/acpi/call <br />
# cat /proc/acpi/call <br />
# this is the IGDM base address - initialize the IGDM_BASE variable with this value in the script<br />
<br />
Initialize your bios with this script on boot :<br />
# echo "/usr/local/share/backlightfix" >> /etc/rc.local<br />
<br />
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:<br />
DIDL_OFFSET=0x120<br />
CADL_OFFSET=0x160<br />
<br />
These are the offsets on the Asus UX32VD bios version 2.06. Try google to find a tutorial how to disassemble the dsdt.<br />
<br />
===== Getting the DIDL and CADL offsets =====<br />
<br />
Now comes the funny part: <br />
<br />
# open your disassembled dsdt. The should have the filename dsdt.dsl.<br />
# find the operationregion IGBM. It should have a Field statement below, and probably looks something like this:<br />
OperationRegion (IGDM, SystemMemory, ASLB, 0x2000)<br />
Field (IGDM, AnyAcc, NoLock, Preserve)<br />
{<br />
SIGN, 128, <br />
SIZE, 32, <br />
OVER, 32, <br />
...<br />
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).<br />
The numbers are the size for each element in bit. <br />
<br />
You must add those field sizes until you reach the DIDL variable. With the UX32VD the DIDL offset is easy, because of this statement:<br />
..<br />
Offset (0x120), <br />
DIDL, 32,<br />
..<br />
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.<br />
<br />
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<br />
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 <br />
offset of 0x120 relative to the beginning of the opregion (in this case its completely unnecessary).<br />
<br />
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.<br />
<br />
After updating both offset variables in the script and executing it again, the backlight should now work (no guarantee).<br />
<br />
=== Keyboard backlight ===<br />
Install {{AUR|asus-kbd-backlight}} from AUR. To allow users to change the brightness, say:<br />
<br />
# asus-kbd-backlight allowusers<br />
<br />
If you use [[initscripts]], put this into your {{ic|/etc/rc.local}}:<br />
<br />
# echo "asus-kbd-backlight allowusers" >> /etc/rc.local<br />
<br />
Users of [[systemd]] can use the unit file included in the package.<br />
<br />
# systemctl daemon-reload<br />
# systemctl start asus-kbd-backlight.service<br />
# systemctl enable asus-kbd-backlight.service<br />
<br />
Now you can easily change keyboard backlight in terminal:<br />
<br />
$ asus-kbd-backlight up<br />
$ asus-kbd-backlight down<br />
$ asus-kbd-backlight max<br />
$ asus-kbd-backlight off<br />
$ asus-kbd-backlight night<br />
$ asus-kbd-backlight 2<br />
$ asus-kbd-backlight show<br />
<br />
And finally, add some convenient keyboard shortcuts [[Extra_Keyboard_Keys_in_Xorg|by the method of your choice]].<br />
<br />
==== UPower Script ====<br />
<br />
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.<br />
<br />
This script increases the keyboard brightness and provides onscreen notification of the current brightness:<br />
<br />
#! /bin/bash<br />
# get current keyboard brightness from UPower<br />
current_state=$(dbus-send --type=method_call --print-reply=literal --system \<br />
--dest="org.freedesktop.UPower" /org/freedesktop/UPower/KbdBacklight org.freedesktop.UPower.KbdBacklight.GetBrightness)<br />
# strip leading 9 characters " int32 "<br />
current_state=${current_state:9}<br />
# get maximum keyboard brightness from UPower<br />
max_brightness=$(dbus-send --type=method_call --print-reply=literal --system \<br />
--dest="org.freedesktop.UPower" /org/freedesktop/UPower/KbdBacklight org.freedesktop.UPower.KbdBacklight.GetMaxBrightness)<br />
# strip leading 9 characters " int32 "<br />
max_brightness=${max_brightness:9}<br />
# if the current keyboard brightness is less than max, increment brightness by one<br />
if [ $current_state -lt $max_brightness ] ; then <br />
dbus-send --type=method_call --print-reply=literal --system \<br />
--dest="org.freedesktop.UPower" /org/freedesktop/UPower/KbdBacklight org.freedesktop.UPower.KbdBacklight.SetBrightness \<br />
int32:$((current_state+1))<br />
notify-send "Keyboard brightness reset to $((current_state+1))"<br />
else<br />
# if the keyboard brightness is already at maximum, complain<br />
notify-send "Keyboard brightness already at maximum"<br />
fi<br />
<br />
This script decreases the keyboard brightness and provides onscreen notification of the current brightness:<br />
<br />
#! /bin/bash<br />
# get current keyboard brightness from UPower<br />
current_state=$(dbus-send --type=method_call --print-reply=literal --system \<br />
--dest="org.freedesktop.UPower" /org/freedesktop/UPower/KbdBacklight org.freedesktop.UPower.KbdBacklight.GetBrightness)<br />
# strip leading 9 characters " int32 "<br />
current_state=${current_state:9}<br />
min_brightness=0<br />
# if the current keyboard brightness is greater than zero, decrement brightness by one<br />
if [ $current_state -gt $min_brightness ] ; then <br />
dbus-send --type=method_call --print-reply=literal --system \<br />
--dest="org.freedesktop.UPower" /org/freedesktop/UPower/KbdBacklight org.freedesktop.UPower.KbdBacklight.SetBrightness \<br />
int32:$((current_state-1))<br />
notify-send "Keyboard brightness reset to $((current_state-1))"<br />
else<br />
# if the keyboard brightness is already at zero, complain<br />
notify-send "Keyboard brightness already at zero"<br />
fi<br />
<br />
== Solid State Drive ==<br />
Check [[Solid_State_Drives]]<br />
<br />
<br />
== Touchpad ==<br />
[http://ubuntuforums.org/showpost.php?p=12110689&postcount=73 This] makes the right click button work and activates palm detection.<br />
Multifinger taps work out of the box.<br />
{{Tip|Multifinger taps: Two finger for middle click; three fingers for right click.}}<br />
<br />
== HDMI plugged at boot ==<br />
<br />
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:<br />
<br />
<br />
<br />
Add the following script as root:<br />
{{hc|/usr/local/share/hdmi-plugged-startup|#!/bin/bash<br />
<br />
export XAUTHORITY&#61;/home/$USER/.Xauthority<br />
export DISPLAY&#61;:0<br />
<br />
/usr/bin/xrandr -display :0 --output eDP1 --auto --output HDMI1 --auto --above eDP1}}<br />
<br />
then make it executable<br />
# chmod +x /usr/local/share/hdmi-plugged-startup<br />
<br />
And add the following udev rule:<br />
# echo 'ACTION=="change", SUBSYSTEM=="drm", RUN+="/usr/local/share/hdmi-plugged-startup"' >> /etc/udev/rules.d/10-local.rules<br />
<br />
== Powersave management ==<br />
Configure [[Laptop_Mode_Tools]] and do not forget to check [[CPU_Frequency_Scaling]].<br />
<br />
Here is a helper script for easy power management (feel free to improve)<br />
<br />
#!/bin/bash<br />
# -*- coding: UTF8 -*-<br />
<br />
case "$1" in<br />
ac)<br />
sudo pm-powersave ac<br />
for i in 0 1 2 3; do sudo cpupower -c $i -g ondemand; done<br />
;;<br />
battery)<br />
sudo pm-powersave battery<br />
sudo cpupower -c 0 frequency-set -g ondemand <br />
for i in 1 2 3; do sudo cpupower -c $i frequency-set -f 800Mhz; done<br />
;;<br />
aggressive)<br />
sudo pm-powersave battery<br />
for i in 0 1 2 3; do sudo cpupower -c $i frequency-set -f 800Mhz; done<br />
;;<br />
info)<br />
echo "#########################"<br />
echo "# acpi"<br />
acpi<br />
echo "#########################"<br />
echo "# cpupower frequency-info"<br />
for i in 0 1 2 3; do cpupower -c $i frequency-info; done<br />
echo "#########################"<br />
echo "Available energy governators"<br />
cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors<br />
;;<br />
powertop)<br />
sudo powertop<br />
;;<br />
suspend)<br />
sudo pm-suspend<br />
;;<br />
load)<br />
sudo modprobe cpufreq_powersave<br />
sudo modprobe cpufreq_conservative<br />
sudo modprobe cpufreq_userspace<br />
echo "#########################"<br />
echo "Available energy governators"<br />
cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors<br />
;;<br />
install)<br />
sudo pacman -S pm-utils acpi powertop laptop-mode-tools cpupower<br />
;;<br />
0)<br />
$0 info<br />
;;<br />
1)<br />
$0 battery<br />
;;<br />
2)<br />
$0 ac<br />
;;<br />
3)<br />
$0 aggressive<br />
;;<br />
4)<br />
$0 suspend<br />
;;<br />
5)<br />
$0 powertop<br />
;;<br />
6)<br />
$0 install<br />
;;<br />
7)<br />
$0 load<br />
;;<br />
*)<br />
echo "#########################"<br />
echo "Choose an option:"<br />
echo "0) info"<br />
echo "1) battery"<br />
echo "2) ac"<br />
echo "3) aggressive powersave"<br />
echo "4) suspend"<br />
echo "5) powertop"<br />
echo "6) install"<br />
echo "7) load"<br />
read choice<br />
#echo $choice<br />
if [[ $choice = [0-9]* ]]<br />
then<br />
$0 $choice<br />
else<br />
$0 0<br />
fi<br />
esac<br />
<br />
exit 0<br />
<br />
==Hardware and Modules==<br />
<br />
====PCI====<br />
<br />
This is output of lscpci -nnn -k<br />
<br />
{| class="wikitable" border="1" cellpadding="5" cellspacing="0"<br />
! Description !! PCI Id !! Module<br />
|-<br />
| Intel Corporation 3rd Gen Core processor DRAM Controller || 8086:0154 || none<br />
|-<br />
| Intel Corporation 3rd Gen Core processor Graphics Controller || 8086:0166 || i915 <br />
|-<br />
| Intel Corporation Device || 8086:0153 || none<br />
|-<br />
| Intel Corporation 7 Series/C210 Series Chipset Family USB xHCI Host Controller || 8086:1e31 || xhci_hcd<br />
|-<br />
| Intel Corporation 7 Series/C210 Series Chipset Family MEI Controller #1 || 8086:1e3a || mei<br />
|-<br />
| Intel Corporation 7 Series/C210 Series Chipset Family USB Enhanced Host Controller #2 || 8086:1e2d || ehci_hcd<br />
|-<br />
| Intel Corporation 7 Series/C210 Series Chipset Family High Definition Audio Controller || 8086:1e20 || snd_hda_intel<br />
|-<br />
| Intel Corporation 7 Series/C210 Series Chipset Family PCI Express Root Port 1 || 8086:1e10 || pcieport<br />
|-<br />
| Intel Corporation 7 Series/C210 Series Chipset Family PCI Express Root Port 2 || 8086:1e12 || pcieport<br />
|-<br />
| Intel Corporation 7 Series/C210 Series Chipset Family USB Enhanced Host Controller #1|| 8086:1e26 || ehci_hcd<br />
|-<br />
| Intel Corporation HM76 Express Chipset LPC Controller || 8086:1e59 || lpc_ich<br />
|-<br />
| Intel Corporation 7 Series Chipset Family 6-port SATA Controller || 8086:1e03 || ahci<br />
|-<br />
| Intel Corporation 7 Series/C210 Series Chipset Family SMBus Controller || 8086:1e22] || none<br />
|-<br />
| Intel Corporation 7 Series/C210 Series Chipset Family Thermal Management Controller || 8086:1e24 || none<br />
|-<br />
| Intel Corporation Centrino Advanced-N 6235 || 8086:088e || iwlwifi<br />
|}<br />
<br />
====Other Devices and Drivers====<br />
<br />
=====mei=====<br />
<br />
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: [http://software.intel.com/file/38014 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:<br />
<br />
$sudo ln -s /usr/lib/libcrypto.so.1.0.0 /usr/lib/libcrypto.so.0.9.8<br />
$sudo ln -s /usr/lib/libssl.so.1.0.0 /usr/lib/libssl.so.0.9.8<br />
<br />
Some of the rest of the package requires compiling, but it fails for me.<br />
<br />
=====rdrand=====<br />
<br />
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.<br />
<br />
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.<br />
<br />
First, make sure rngd sees it:<br />
<br />
[root@asarum system]# rngd -v --no-tpm=1<br />
Available entropy sources:<br />
DRNG<br />
<br />
Second, start rngd:<br />
<br />
[root@asarum log]# rngd -f --no-tpm=1<br />
<br />
The options for rngd.service are found in /etc/conf.d/rngd. I modified the file as follows:<br />
<br />
# RNGD_OPTS="-o /dev/random -r /dev/urandom"<br />
RNGD_OPTS=" -o /dev/random --no-tpm=1"<br />
<br />
Test:<br />
<br />
[root@asarum system]# cat /dev/random | rngtest -c 1000<br />
rngtest 4<br />
Copyright (c) 2004 by Henrique de Moraes Holschuh<br />
This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.<br />
<br />
rngtest: starting FIPS tests...<br />
rngtest: bits received from input: 20000032<br />
rngtest: FIPS 140-2 successes: 1000<br />
rngtest: FIPS 140-2 failures: 0<br />
rngtest: FIPS 140-2(2001-10-10) Monobit: 0<br />
rngtest: FIPS 140-2(2001-10-10) Poker: 0<br />
rngtest: FIPS 140-2(2001-10-10) Runs: 0<br />
rngtest: FIPS 140-2(2001-10-10) Long run: 0<br />
rngtest: FIPS 140-2(2001-10-10) Continuous run: 0<br />
rngtest: input channel speed: (min=891.472; avg=2161.828; max=2788.585)Kibits/s<br />
rngtest: FIPS tests speed: (min=28.682; avg=47.816; max=146.719)Mibits/s<br />
rngtest: Program run time: 9434482 microseconds<br />
<br />
=====watchdog=====<br />
<br />
The chipset also has an hardware watchdog:<br />
<br />
root@asarum chris]# wdctl<br />
Device: /dev/watchdog<br />
Identity: iTCO_wdt [version 0]<br />
Timeout: 30 seconds<br />
Timeleft: 2 seconds<br />
FLAG DESCRIPTION STATUS BOOT-STATUS<br />
KEEPALIVEPING Keep alive ping reply 0 0<br />
MAGICCLOSE Supports magic close char 0 0<br />
SETTIMEOUT Set timeout (in seconds) 0 0<br />
<br />
Activating the watchdog under systemd is trivial, as systemd author Lennart Poettering explains in [http://0pointer.de/blog/projects/watchdog.html this blog post].<br />
<br />
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.<br />
<br />
#RuntimeWatchdogSec=0<br />
RuntimeWatchdogSec=30<br />
<br />
Check after next boot:<br />
<br />
[root@asarum chris]# journalctl | grep -i watchdog<br />
Oct 06 06:36:27 asarum kernel: iTCO_wdt: Intel TCO WatchDog Timer Driver v1.10<br />
Oct 06 06:36:27 asarum systemd[1]: Hardware watchdog 'iTCO_wdt', version 0<br />
Oct 06 06:36:27 asarum systemd[1]: Set hardware watchdog to 30s.<br />
<br />
====Issue with ACPI and gpio_ich====<br />
<br />
The gpio_ich module causes the following error:<br />
<br />
ACPI Warning: 0x0000000000000428-0x000000000000042f SystemIO conflicts with Region \PMIO 2 (20120711/utaddress-251)<br />
ACPI Warning: 0x0000000000000500-0x000000000000053f SystemIO conflicts with Region \GPIO 1 (20120711/utaddress-251)<br />
ACPI Warning: 0x0000000000000500-0x000000000000053f SystemIO conflicts with Region \GP01 2 (20120711/utaddress-251)<br />
lpc_ich: Resource conflict(s) found affecting gpio_ich<br />
ACPI Warning: 0x000000000000f040-0x000000000000f05f SystemIO conflicts with Region \SMB0 1 (20120711/utaddress-251)<br />
ACPI Warning: 0x000000000000f040-0x000000000000f05f SystemIO conflicts with Region \_SB_.PCI0.SBUS.SMBI 2 (20120711/utaddress-251)<br />
<br />
In this case an lsmod shows that the gpio_ich module doesn't wind up being loaded <br />
<br />
# lsmod | grep gpio<br />
# <br />
<br />
I then rebooted with apci_enforce_resources=lax. A cat /proc/ioports showed the conflict:<br />
<br />
0420-042f : ACPI GPE0_BLK<br />
0428-042f : gpio_ich<br />
<br />
and<br />
<br />
0500-057f : pnp 00:05<br />
0500-053f : gpio_ich<br />
<br />
In contrast, here's the same lines without acpi_enforce_resources=lax:<br />
<br />
0420-042f : ACPI GPE0_BLK<br />
<br />
and<br />
<br />
0500-057f : pnp 00:05<br />
<br />
So, net/net, there's no real issue.<br />
<br />
== Random kernel panics on boot ==<br />
<br />
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.<br />
<br />
To fix the issue, blacklist the 'btusb' module on the next boot by running:<br />
<br />
sudo echo "blacklist btusb" > /etc/modprobe.d/disable_btusb.conf<br />
<br />
Then use rc.local to load it at the end of the boot process by running:<br />
<br />
sudo echo "modprobe btusb" >> /etc/rc.local<br />
<br />
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.<br />
<br />
== Legacy information ==<br />
Here is legacy information from earlier fix that are no longer required.<br />
=== function keys (other than screen backlight) ===<br />
<br />
{{note | Since Kernel 3.4.9-1 the instructions below concerning the kernel patch/dkms are no longer required.}}<br />
<br />
There is a fix for Ubuntu :<br />
http://ubuntuforums.org/showthread.php?p=12054636#post12054636<br />
<br />
==== Method 1 ====<br />
You can apply the following patch (semi-)manually and rebuild the kernel (you may want to read [[Custom_Kernel_Compilation_with_ABS]]). <br />
<br />
Signed-off-by: Alex Hung <alex.hung <at> canonical.com><br />
---<br />
drivers/platform/x86/asus-wmi.c | 7 +------<br />
1 files changed, 1 insertions(+), 6 deletions(-)<br />
<br />
diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c<br />
index 25e3093..0f69a97 100644<br />
--- a/drivers/platform/x86/asus-wmi.c<br />
+++ b/drivers/platform/x86/asus-wmi.c<br />
@@ -1461,14 +1461,9 @@ static int asus_wmi_platform_init(struct asus_wmi *asus)<br />
*/<br />
if (!asus_wmi_evaluate_method(ASUS_WMI_METHODID_DSTS, 0, 0, NULL))<br />
asus->dsts_id = ASUS_WMI_METHODID_DSTS;<br />
- else if (!asus_wmi_evaluate_method(ASUS_WMI_METHODID_DSTS2, 0, 0, NULL))<br />
+ else<br />
asus->dsts_id = ASUS_WMI_METHODID_DSTS2;<br />
<br />
- if (!asus->dsts_id) {<br />
- pr_err("Can't find DSTS");<br />
- return -ENODEV;<br />
- }<br />
-<br />
/* CWAP allow to define the behavior of the Fn+F2 key,<br />
* this method doesn't seems to be present on Eee PCs */<br />
<br />
This will make most keys useable (you have to bind them to functions yourself), except the screen brightness keys.<br />
<br />
It worked with kernel 3.4.4-2.<br />
<br />
==== Method 2 ====<br />
<br />
It is also possible to use [[Dynamic Kernel Module Support]] (DKMS) (package in community), to avoid compiling the whole kernel:<br />
<br />
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)<br />
{{note | there is perhaps more suitable place to get the asus-wmi kernel module sources, the patch and the dkms conf file}}<br />
2 extract the archive, and then extract the .deb and get the sources inside (asus-wmi.c is already patched with above patch):<br />
# cp -a usr/src/asus-wmi-0.2 /usr/src/<br />
# cd /usr/src/<br />
# dkms add -m asus-wmi -v 0.2<br />
# dkms built -m asus-wmi -v 0.2 -k 3.4.7-1-ARCH<br />
# dkms status<br />
# dkms install -m asus-wmi -v 0.2 -k 3.4.7-1-ARCH<br />
# dkms status<br />
<br />
replace {{ic|3.4.7-1-ARCH}} by your output for {{ic|uname -r}}<br />
<br />
3 There is still a problem since dkms doesn't gzip the kernel module and archlinux does (see {{ic|$ modinfo asus-wmi}}):<br />
# cd /lib/modules/3.4.7-1-ARCH/kernel/drivers/platform/x86/<br />
# mv asus-wmi.ko.gz asus-wmi.ko.gz.save<br />
# gzip asus-wmi.ko<br />
{{note | there is probably a cleaner way to do that with dkms}}<br />
4 After reboot, {{ic|xev}} should display events for {{keypress|Fn}} keys. And keyboard backlight can be trigger by:<br />
# echo 0 >> /sys/class/leds/asus\:\:kbd_backlight/brightness<br />
# echo 3 >> /sys/class/leds/asus\:\:kbd_backlight/brightness<br />
<br />
<br />
== Additional resources ==<br />
*https://help.ubuntu.com/community/AsusZenbookPrime</div>Djcoin