HP Chromebook 14

From ArchWiki
Revision as of 19:09, 19 September 2014 by Dhead (talk | contribs) (→‎Touchpad Configuration: remove duplicate on the chromebook page)
Jump to navigation Jump to search

This is a work in progress with information about the HP Chromebook 14 (FALCO)

The HP Chromebook 14 (and newer chromebooks in general) features a "legacy boot" mode that makes it easy to boot Linux and other operating systems. The legacy boot mode is provided by the SeaBIOS payload of coreboot. SeaBIOS behaves like a traditional BIOS that boots into the GPT of a disk, and from there into your standard bootloaders like Syslinux and GRUB.

Installation

Enabling Developer Mode

See the Chromebook page.

Partitioning the drive

In order to partition the drive, we will run the first stage of the ChruBuntu script. After logging it, open a shell with Ctrl + Alt + T, run shell, then cd ~/ to enter the home directory. Once there, run the following:

curl -L -O http://goo.gl/9sgchs; sudo bash 9sgchs

It will ask how much space to partition for the alternate partition. 8GB is a safe number for the 16GB SSD. More than 9 may not work. After rebooting, ChromeOS will repair itself. Once this is done, verify that the disk space has been reduced by opening a file manager and clicking the gear in the top right of the window.

Open a terminal again and open a shell. Run sudo crossystem dev_boot_usb=1 dev_boot_legacy=1 to enable booting off of the install usb drive and the new partition.

Create Filesystem and BIOS Partition

Boot off of your usb drive by pressing Ctrl + l at the developer mode screen on boot, and choose i686.

Run the command fdisk -l to list drives and partitions. Find the internal drive and note the name of the partition matching the size you specified in the ChrUbuntu script.

Use mkfs.ext4 /dev/sdxY (where xY is drive letter and partition number, eg. /dev/sda7) This will create the filesystem for arch. Following the instructions for installing GRUB on GPT, use gdisk to create a 1007kb partition and set the type to EF02.

Note: Contrary to what some people say, the grub partition does NOT need to be the first partition on the disk. The existing ChromeOS partitions make this difficult to do anyways.

Installing Arch Linux

Continue by following the Installation on a Haswell Chromebook.

Touchpad Configuration

Add the Xorg touchpad configuration below for better usability (higher sensitivity).

/etc/X11/xorg.conf.d/50-cros-touchpad.conf
Section "InputClass" 
    Identifier      "touchpad peppy cyapa" 
    MatchIsTouchpad "on" 
    MatchDevicePath "/dev/input/event*" 
    MatchProduct    "cyapa" 
    Option          "FingerLow" "10" 
    Option          "FingerHigh" "10" 
EndSection

Reboot for the touchpad to become operational.

Fixing Suspend

The following are instructions to fix the suspend functionality. There have been a few alternatives discussed and those may work better for some.

Create the following cros-acpi-wakeup.conf file.

/etc/tmpfiles.d/cros-acpi-wakeup.conf
w /proc/acpi/wakeup - - - - EHCI
w /proc/acpi/wakeup - - - - HDEF
w /proc/acpi/wakeup - - - - XHCI
w /proc/acpi/wakeup - - - - LID0
w /proc/acpi/wakeup - - - - TPAD
w /proc/acpi/wakeup - - - - TSCR

Then, create the following cros-sound-suspend.sh file. Only the ehci binding/unbinding lines are listed below; see the alternatives linked above for additional sound suspend handling if you experience issues.

/usr/lib/systemd/system-sleep/cros-sound-suspend.sh
#!/bin/bash
case $1/$2 in
  pre/*)
    # Unbind ehci.
    echo -n "0000:00:1d.0" | tee /sys/bus/pci/drivers/ehci-pci/unbind
    ;;
  post/*)
    # Bind ehci.
    echo -n "0000:00:1d.0" | tee /sys/bus/pci/drivers/ehci-pci/bind
    ;;
esac

Then add the following kernel boot parameters. Different combinations have been mentioned, with tpm_tis.force=1 being the most important.

/etc/default/grub.cfg
GRUB_CMDLINE_LINUX_DEFAULT="quiet add_efi_memmap boot=local noresume noswap i915.modeset=1 tpm_tis.force=1 tpm_tis.interrupts=0 nmi_watchdog=panic,lapic"

Then rebuild your grub config.

Post Installation Configuration

Keyboard

To fix the keymapping so that the keys between escape and power work as F1-F10, you will need to edit the udev rules and comment out the specific modifications that where added for the chromebook. This will also change the search button back to Super_L/Mod4.

sudo nano /usr/lib/udev/hwdb.d/60-keyboard.hwdb

seach for the word "chromebook" and comment out all the lines for it by putting a # at the start of each line like so:

# Chromebook 14
# Top row keys (between ESC and power button)
#keyboard:dmi:bvn*:bvr*:bd*:svnHewlett-Packard*:pnFalco:pvr*
# KEYBOARD_KEY_3b=back
# KEYBOARD_KEY_3c=forward
# KEYBOARD_KEY_3d=refresh
# KEYBOARD_KEY_3f=switchvideomode
# KEYBOARD_KEY_40=brightnessdown
# KEYBOARD_KEY_41=brightnessup
# KEYBOARD_KEY_42=mute
# KEYBOARD_KEY_43=volumedown
# KEYBOARD_KEY_44=volumeup
# KEYBOARD_KEY_db=search # Same position as caps lock key on most keyboards
# KEYBOARD_KEY_3e=fullscreen, no defined key sym

Update the database, the reboot.

sudo udevadm hwdb --update
sudo reboot
Note: systemd upgrades may require re-applying this solution.

Adding hotkeys back

Once you've applied the above fix you can set the function and arrow keys to act similar to how they are in ChromeOS using a modifer key. The example below uses Mod4 (Search on the chromebook's keyboard). This can be changed to Control or Alt if you prefer.

First make sure you have all the needed packages:

sudo pacman -S xbindkeys xorg-xbacklight alsa-utils xvkbd xdotool

Create .xbindkeysrc in your home folder

# ~/.xbindkeysrc

#Delete
"xvkbd -xsendevent -text '\[Delete]'"
   Mod4 + BackSpace

#End
"xvkbd -xsendevent -text '\[End]'"
   Mod4 + Right

#Home
"xvkbd -xsendevent -text '\[Home]'"
   Mod4 + Left

#Page Down
"xvkbd -xsendevent -text '\[Page_Down]'"
   Mod4 + Down

#Page Up
"xvkbd -xsendevent -text '\[Page_Up]'"
   Mod4 + Up

#Volume Controls 
#Mute
"amixer sset Master toggle"
   Mod4 + F8 

#Volume Down
"amixer sset Master 2%-"
   Mod4 + F9 

#Volume Up
"amixer sset Master 2%+"
   Mod4 + F10
 
#Backlight
#Dim
"xbacklight -dec 10"
   Mod4 + F6 

#Brighten
"xbacklight -inc 10"
   Mod4 + F7 

#Back,Fwd,Reload as Multimedia Prev,Next,Play
#Play/Pause
"xdotool key XF86AudioPlay"
   Mod4 + F3

#Prev Track
"xdotool key XF86AudioPrev"
   Mod4 + F1 

#Next Track
"xdotool key XF86AudioNext"
   Mod4 + F2

To activate it when you login add

xbindkeys

to your .xinitrc, or whatever your DE uses for startup.

Shortening the Developer Mode Splash Screen

This process shortens the developer mode screen on boot to ~2-3 seconds as opposed to the normal 30 seconds, and it also silences the system beep that plays if a key isn't pressed. The steps are as follows:

  • Open case
  • Remove bios screw and pull battery
  • Read bios
  • Edit flags using gbb_utility
  • Write new bios
  • Replace bios screw (optional)

Opening the case

There is only 1 disassembly I have been able to find: http://imgur.com/a/aGSQC

Important notes:

  • There are 4 hidden screws under rubber stubs (not the rubber feet) of the bottom.
  • Once the screws on the bottom are removed, flip the laptop right side up and use a thin blunt object to pry the keyboard surface from the bottom half.

Removing the bios screw

The bios screw is located to the left of the fan. It can be recognized by the fact that the copper circle it sits on is split in half "( )" vs "O". The screw connects the two halves, making the bios unwriteable.

Once this screw is removed, it's advisable to unplug the battery and plug it back in to ensure that the removal is recognized.

A (mostly) complete step by step picture guide to opening the system and flashing the bios is available here: http://imgur.com/a/hFq7S

This picture shows the location of the bios writable screw on the inside of the laptop.

Modifying the BIOS

Boot and use Ctrl + Alt + F2 to access the terminal and log in as root. Run the following commands:

cd ~/Downloads 
flashrom -r bios.bin
gbb_utility --set --flags=0×01 bios.bin bios.new
flashrom -w bios.new

If the flashrom commands fail, check to make sure the right screw is removed, and that you are in the user's downloads directory. You can also try running "flashrom --wp-disable".

You can also modify flags with the "set_gbb_flags.sh" script which will write the changes instantly. It's probably a good idea to keep a backup of your original bios someplace safe (like a usb drive) before using this tool.

running without additional parameters will show additional usage information and list all possible flags.

set_gbb_flags.sh

For example to enable legacy boot by default:

set_gbb_flags.sh 0×489