DragonFly BSD

ConfigChromebook

Chromebook Config

DragonFly currently supports the Acer C720 and C720p Intel-haswell chromebook. You must follow the linux directions on how to unlock the chromebook so non-chrome OSs can be installed. Generally speaking, the linux directions get you to a point where you can boot any kernel via the built-in SeaBIOS. Note that you can always restore your chromebook back to using chrome by following Google's directions on recovering a chromebook.

On the Acer C720 you need to load specific drivers to gain support for the touchpad and touchscreen. You also need to load the sound drivers. In "/boot/loader.conf" add:

ig4_load="YES"
cyapa_load="YES"
atmel_mxt_load="YES"
if_ath_load="YES"
sound_load="YES"
snd_hda_load="YES"

The atmel module is only needed for the touchscreen model.

If you have trouble with the laptop recognizing the touchpad, try moving the ig4, cyapa, and atmel module loads into /etc/rc.local (kldload'ing the modules from /etc/rc.local). It is unclear to me why there are sometimes issues initializing the drivers in early boot.

WIFI setup

For WIFI support you will want this in your "/etc/rc.conf"

wlans_ath0="wlan0"
ifconfig_wlan0="DHCP WPA"

And your "/etc/wpa_supplicant.conf" file should contain entries for all the wifi basestations you can connect to. Most typically an entry looks like this:

network={
    ssid="blahblah"
    psk="passwordhere"
}

Its easiest to just reboot after setting up the files rather than trying to start wpa_supplicant manually. You can have multiple network={} elements in the config file.

Both 2.4 GHz and 5 GHz base stations will work. 5 GHz base stations may have a range issue though. ifconfig wlan0 for more information. Also make sure that your /etc/rc.conf does not have any setup for ath0, if you used the installer it might have done something.

Disabling the power button

The power button is a function key on the right and is very easy to hit accidently. You can disable the power button with a sysctl:

sysctl hw.acpi.power_button_state=NONE

You can put 'hw.acpi.power_button_state=NONE' in /etc/sysctl.conf to make this automatic on startup.

dbus setup

Newer versions of firefox do not start dbus automatically, so we recommend starting it up from /etc/rc.conf with this entry:

dbus_enable="YES"

I think you can start it manually with 'dbus-daemon --system' if you do not want to reboot to pick it up from rc.conf.

Sound Setup

The sound and snd_hda drivers can be loaded from /boot/loader.conf, which we have already described above. The C720[P] has two sound chips, one built into the Haswell cpu which drives the HDMI digital sound, and a Realtek AC0283 which drives the built-in speakers and headphones.

You should see /dev/dsp0 and /dev/dsp1 and the hw.snd.default_unit sysctl should already default to unit 1. I suggest testing sound with mpg123 and your favorite MP3. It should just work. However, we've noticed that some C720Ps use the wrong chipid in the pciconf output (probably a BIOS issue) so if your machine only sees one sound device the driver might need a tweak.

X11 Setup

DragonFly supports accelerated X on Haswell cpus via the "intel" driver. You no longer have to recompile the X server. We recommend the following package sets:

pkg install xorg-apps
pkg install xorg-docs
pkg install xorg-fonts
pkg install xorg-libraries
pkg install xorg-macros
pkg install xorg-drivers
pkg install xorg-server
pkg install xdm
pkg install dbus
pkg install xbindkeys
pkg install firefox
(also install your favorite apps, GUIs, window managers, whatever)

The base intel driver in xorg-drivers needs to be replaced with the intel29 driver from dports. As the X11 work has progressed this has become easier so now you just need to install the package:

pkg install xf86-video-intel29

The "/etc/X11/xorg.conf" configuration file should consist of the following. If you have trouble getting the keyboard to work you may have to mess around with the keyboard settings. But this should work.

Section "ServerLayout"
        Identifier     "X.org Configured"
        Screen      1  "Screen0" 0 0
        InputDevice    "Mouse0" "CorePointer"
        InputDevice    "Mouse1" "SendCoreEvents"
        InputDevice    "TouchScreen0" "SendCoreEvents"
        InputDevice    "Keyboard0" "CoreKeyboard"
EndSection

# This may be needed to prevent X from ignoring keyboard
# and mouse devices in xorg.conf.
#
Section "ServerFlags"
        Option "AutoAddDevices" "False"
EndSection

Section "Files"
        ModulePath   "/usr/local/lib/xorg/modules"
        FontPath     "/usr/local/lib/X11/fonts/misc/"
        FontPath     "/usr/local/lib/X11/fonts/TTF/"
        FontPath     "/usr/local/lib/X11/fonts/OTF/"
        FontPath     "/usr/local/lib/X11/fonts/Type1/"
        FontPath     "/usr/local/lib/X11/fonts/100dpi/"
        FontPath     "/usr/local/lib/X11/fonts/75dpi/"
EndSection

Section "Module"
        Load  "dbe"
        Load  "dri"
        Load  "dri2"
        Load  "extmod"
        Load  "record"
        Load  "glx"
EndSection

# Depending on how your keyboard probes, you may have to change this.
#
Section "InputDevice"
        Identifier  "Keyboard0"
        Driver      "kbd"
EndSection

Section "InputDevice"
        Identifier  "Mouse0"
        Driver      "mouse"
        Option          "Protocol" "imps/2"
        Option          "Device" "/dev/cyapa0-67"
EndSection

Section "InputDevice"
        Identifier  "Mouse1"
        Driver      "mouse"
        Option          "Protocol" "auto"
        Option          "Device" "/dev/sysmouse"
        Option          "ZAxisMapping" "4 5"
EndSection

Section "InputDevice"
        Identifier  "TouchScreen0"
        Driver      "elographics"
        Option          "Device" "/dev/atmel1-4a"
#   Option      "ZAxisMapping" "4 5 6 7"
EndSection

Section "Monitor"
        Identifier   "Monitor0"
        VendorName   "Monitor Vendor"
        ModelName    "Monitor Model"
EndSection

Section "Device"
        #Option     "NoAccel" "true"                # [<bool>]
        #Option     "AccelMethod"           # <str>
        #Option     "Backlight"             # <str>
        #Option     "DRI"                   # <str>
        Identifier  "Card0"
        Driver      "intel"
        #Option     "ReprobeOutputs" "true"
        #BusID      "PCI:0:2:0"
EndSection

Section "Screen"
        Identifier "Screen0"
        Device     "Card0"
        Monitor    "Monitor0"
        SubSection "Display"
                Depth     1
        EndSubSection
        SubSection "Display"
                Depth     4
        EndSubSection
        SubSection "Display"
                Depth     8
        EndSubSection
        SubSection "Display"
                Depth     15
        EndSubSection
        SubSection "Display"
                Depth     16
        EndSubSection
        SubSection "Display"
                Depth     24
        EndSubSection
EndSection

For the touchscreen to work, you need to install the "xf86-input-elographics" driver:

pkg install xf86-input-elographics

See these commits for details on how to simulate left, right, and middle clicks with the touchpad, and also support simulated mousewheel scrolling.

We suggest starting X via xdm which needs a package in addition to xorg:

pkg install xdm

Further Mouse Setup

We recommend using moused and /dev/sysmouse to handle external USB mouse attachments. By using moused, mice can be plugged and unplugged without imploding X11. Try putting this in your /etc/rc.conf:

moused_enable="YES"

If that doesn't work then set moused_enable="NO" in /etc/rc.conf and start moused manually in /etc/rc.local:

moused -p /dev/ums0
moused -p /dev/ums1

Touchpad and Touchscreen problems

Some people seem to have jitter problems with either or both the touchpad and the touchscreen, even on linux-based systems and the original chomebook chrome install. It depends on a number of factors and we aren't sure why it happens, but the problems seem to be at their worst when the laptop is sitting on a non-conductive (e.g. plastic) table with power connected. The problems can sometimes be mitigated by doing a few touches, or placing the laptop on your lap, or on some other surface, or disconnecting the power.

The issue does not crop up on all C720[P]'s. If the problem gets too annoying you may have to disable either or both the touchpad and touchscreen.

A secondary issue is that when the touchscreen is going bonkers it can cause X to get sludgy. If you have a refresh problem with X, it might be the touchscreen driver that is causing it.

I've seen jitter issues on my particular C720 and C720P occasionally but they go away completely if the laptop is sitting on a wood table or my lap.

Volume and backlight adjustment keys

In order to use these keys make two scripts:

#!/bin/csh
#
# mute script  "mute"

set curvol = "`mixer -f /dev/mixer1 -s vol`"

if ( -f ~/.savemute ) then
        set lastvol = "`cat ~/.savemute`"
else
        set lastvol = ""
endif

if ( "$curvol" == "vol 0:0" ) then
        if ( "$lastvol" != "" ) then
                eval mixer -f /dev/mixer1 $lastvol
        endif
else
        if ( "$lastvol" != "$curvol" ) then
                echo "$curvol" > ~/.savemute
        endif
        mixer -f /dev/mixer1 vol 0
endif

#!/bin/csh
#
# backlight script "backlight"

set level = `sysctl -n hw.backlight_level`
@ level = $level + $argv
sysctl hw.backlight_level=${level}

add next lines to ~/.xbindkeysrc:

# Volume
#
"/path/to/scripts/mute"
  F8

"mixer -f /dev/mixer1 vol -5"
  F9

"mixer -f /dev/mixer1 vol +5"
  F10

# Screen
#
"/path/to/scripts/backlight -20"
  F6

"/path/to/scripts/backlight 20"
  F7

You must call xbindkeys somewhere in your .xinitrc.

Hint: You can set default blacklight level by placing next line in .xinitrc:

sysctl hw.backlight_level=370

Home, End, Delete, ...

With Alt as modifier you can get:

Insert = Alt + \

Delete = Alt + BackSpace

Home = Alt + Left

End = Alt + Right

PageUp = Alt + Up

PageDown = Alt + Down

Create dirs for keyboard configuration

mkdir -p ${HOME}/.config/xkb/types ${HOME}/.config/xkb/symbols

Create modifiers' config file ${HOME}/.config/xkb/types/c720 which contains

xkb_types "c720" {
    virtual_modifiers Alt;
    type "ARROW" {
        modifiers    = Shift+Alt;
        map[Shift]  = Level2;
        map[Alt]    = Level3;
        map[Alt+Shift]    = Level3;
        level_name[Level1] = "Base";
        level_name[Level2] = "Caps";
        level_name[Level3] = "Alt";
    };
};

Create symbols' config file ${HOME}/.config/xkb/symbols/c720 which contains

xkb_symbols "c720" {
    key <BKSL> {
        type="ARROW",
        repeat=yes,
        symbol[Group1] = [backslash, bar, Insert],
        symbol[Group2] = [backslash, slash, Insert],
        actions[Group1] = [
            NoAction(),
            NoAction(),
            RedirectKey(key=<INS>, clearmods=Alt)
        ],
        actions[Group2] = [
            NoAction(),
            NoAction(),
            RedirectKey(key=<INS>, clearmods=Alt)
        ]
    };
    key <BKSP> {
        type="ARROW",
        repeat=yes,
        [BackSpace, BackSpace, Delete],
        actions[Group1] = [
            NoAction(),
            NoAction(),
            RedirectKey(key=<DELE>, clearmods=Alt)
        ]
    };
    key <LEFT> {
        type="ARROW",
        [Left, Left, Home],
        actions[Group1] = [
            NoAction(),
            NoAction(),
            RedirectKey(key=<HOME>, clearmods=Alt)
        ]
    };
    key <RGHT> {
        type="ARROW",
        repeat=yes,
        [Right, Right, End],
        actions[Group1] = [
            NoAction(),
            NoAction(),
            RedirectKey(key=<END>, clearmods=Alt)
        ]
    };
    key <UP> {
        type="ARROW",
        repeat=yes,
        [Up, Up, Prior],
        actions[Group1] = [
            NoAction(),
            NoAction(),
            RedirectKey(key=<PGUP>, clearmods=Alt)
        ]
    };
    key <DOWN> {
        type="ARROW",
        [Down, Down, Next],
        actions[Group1] = [
            NoAction(),
            NoAction(),
            RedirectKey(key=<PGDN>, clearmods=Alt)
        ]
    };
};

Add next line to .xinitrc (or in some autoload/autostart)

setxkbmap -layout "us+c720" -types "complete+c720" -print|xkbcomp -I"$HOME/.config/xkb" - "${DISPLAY%%.*}"

Power savings

This sysctl setting tells the Chromebook to automatically go to the best power state it can:

sysctl machdep.mwait.CX.idle=AUTODEEP

WARNING! We have recently come to believe that this mode may cause chromebooks lockup on disk I/O (AHCI), so if you get lockups please try without setting this mode.