ChrUbuntu installation on Samsung Chromebook 2 XE503C12

Resources

linux-exynos

Status : http://linux-exynos.org/wiki/Samsung_Chromebook_2_XE503C12

Install : http://linux-exynos.org/wiki/Samsung_Chromebook_2_XE503C12/Installing_Linux

chromeos kernel

Attempting to build release-R43-6946.B-chromeos-3.14

Seems like chromeos kernels >= 3.10 do not have exynos support

Boot Priority

Boot priority is set in the GPT table

cgpt add -i 6 -P 5 -T 1 -S /dev/mmcblk0p6

$[Get Code]42

ChrUbuntu

After doing a reinstall on a USB stick, inexplicably succeeded in booting to the root partition on the internal eMMC!

SDHC

See Tech.FlashBench

Samsung 32GB

  • Try 8MB partition start (16384s)
  • Try 4KB ext4 blocksize

Sandisk 16GB

  • Try 8MB partition start
  • Try 4KB ext4 blocksize
  • stride = 1
  • stripe-width = (4MB / 4KB) = 1024

mkfs.ext4 -O ^has_journal -E stride=1,stripe-width=1024 -b 4096 -L archix-home /dev/sdi1

$[Get Code]44

All sorts of corruption!

If I mount, create dir, unmount the fs is corrupted.

SDHC (Old)

Configure an SDHC containing an LVM2 volume group and a logical volume for /home

GPT

Attempting to use cryptsetup without a GPT resulted in corruption of the LUKS header at some point.

On a 32GB sdcard, create a 30GB partition, reserving the last 1440MB just in case.

sudo parted /dev/mmcblk1 mklabel gpt
sudo parted /dev/mmcblk1 mkpart primary  30G
sudo parted /dev/mmcblk1 mkpart primary 30G -- -1  # -- needed to pass -1 (end of disk)

Cryptsetup

No xts kernel module, so use cbc-essiv instead.

sudo cryptsetup -v luksFormat -c "aes-cbc-essiv:sha256" -s 256 /dev/mmcblk1p1
sudo cryptsetup luksOpen /dev/mmcblk1p1 crypt-sdhc

LVM2

LVM stack including 20G home directory. Reserving remaining 10G for later. Zeroing fails, so disable it when creating lvs.

sudo pvcreate /dev/mapper/crypt-sdhc
sudo vgcreate vg-sdhc /dev/mapper/crypt-sdhc
sudo vgchange -a y vg-sdhc
sudo lvcreate -Zn -n home -L20g vg-sdhc # disable zeroing as workaround

Filesystem

sudo mkfs.ext4 -m0 -L home /dev/vg-sdhc/home

$[Get Code]49

NB: random crashes when accessing the SDHC. Probably shouldn't use ext4 journaling on an SD card.

sudo mkfs.ext4 -O has_journal -m0 -L home /dev/vg-sdhc/home

$[Get Code]50

Post-creation use tune2fs -O ^has_journal DEV

fstab and crypttab

Leaving root on the eMMC for now while I evaluate the performance. Home is on the external SDHC.

/etc/crypttab

crypt-sdhc  /dev/mmcblk1p1  none    luks

/etc/fstab

proc    /proc   proc    defaults        0       0
UUID=0f623493-6b40-42f5-bd99-bb37dd74b585       /       auto    errors=remount-ro       0       1
/dev/mapper/vg--sdhc-home       /home   ext4    noatime 0       2

System Config

Kernel Config

Reading the current kernel config

modprobe configs
zless /proc/config.gz

Username

sudo usermod -l myuser -d /home/myuser user

$[Get Code]52

Hostname

sudo hostname "myhost"
sudo echo "myhost" > /etc/hostname

sudo vi /etc/hosts

127.0.0.1   localhost
127.0.1.1   archix archix.lan

Locale and Timezone

Set system locale to en_GB.UTF-8

sudo vi /etc/defaults/locale

LANG="en_GB.UTF-8"





sudo locale-gen en_GB.UTF-8
sudo dpkg-reconfigure tzdata

Keyboard Layout

Maps dvorak and uses Chromebook search key as compose. sudo vi /etc/defaults/keyboard

XKBMODEL="pc105"
XKBLAYOUT="us,gb,gb"
XKBVARIANT="dvorak,dvorak,"
XKBOPTIONS="compose:lwin"

Also

setxkbmap -option compose:lwin

$[Get Code]55

Then

sudo dpkg-reconfigure console-data   # select layout from full list
sudo dpkg-reconfigure console-setup  # rebuilds initramfs with new settings

iptables ip6tables

Missing kernel modules x_tables, xt_limit, etc.

Hardware Configuration

Working

  • Wifi 802.11bgn
  • Touchpad
  • Ethernet (my Asix USB2 gigabit adapter)
  • Bluetooth
  • Camera

Unconfirmed

  • Sleep
    • Is it actually sleeping?
    • Lots of freezes overnight
    • Many cases where battery has exhausted

Not Working

  • Graphics hardware acceleration (Mali)

Mali Graphics Acceleration

New link: http://community.arm.com/docs/DOC-9494

With loopback and kpartx

dd if=/dev/zero of=mali.img bs=1k count=1M
# create partitions manually based on chromebook-setup.sh
sudo kpartx mali.img  # creates /dev/loopXpY etc
# comment out options sanitising and storage formatting from script
./chromebook-setup.sh --variant=XE503C12 --storage=/dev/loop1p do_everything

Old instructions

  • ARM Mali T628MP6
  • Needs kernel support (present?)
  • Needs custom built driver

sudo apt-get install xserver-xorg-video-armsoc

$[Get Code]60 provides

/etc/X11/xorg.conf.d/exynos.conf Config from http://archlinuxarm.org/forum/viewtopic.php?f=47&t=7469&start=10

Section "Monitor"
   Identifier   "LVDS-1"
   Option      "DPMS"   "standby"
   #Option      "DPMS"   "false" #mw04/11/2013
   Option      "Enable" "True"
   Option      "Primary" "False"
   Option      "RightOf" "HDMI-1"
EndSection

Section "Monitor"
   Identifier   "HDMI-1"
   Option      "DPMS"   "standby"
   #Option      "DPMS"   "false" #mw04/11/2013
   Option      "Primary" "True"
   Option      "Enable" "True"
   Option      "DefaultMode" "1920x1080"
EndSection

Section "ServerLayout"
   Identifier   "ServerLayout0"
   Option      "BlankTime"   "0"
   Option      "StandbyTime"   "0"
   Option      "SuspendTime"   "0"
   Option      "OffTime"   "0"
   #Option      "OffTime"   "30" #mw04/11/2013
EndSection

Section "Device"
        Identifier      "Mali FBDEV"
        Driver          "armsoc"
        Option          "fbdev"                 "/dev/fb0"
        Option          "DRI2"                  "true"
        Option          "DRI2_PAGE_FLIP"        "false"
        Option          "DRI2_WAIT_VSYNC"       "true"
        Option          "Fimg2DExa"             "false"
#       Option          "Fimg2DExaSolid"        "false"
#       Option          "Fimg2DExaCopy"         "false"
#       Option          "Fimg2DExaComposite"    "false"
        Option          "SWcursorLCD"           "false"
EndSection

Section "Screen"
        Identifier      "DefaultScreen"
        Device          "Mali FBDEV"
        DefaultDepth    24
   SubSection "Display"
      Modes "1920x1080"
   EndSubSection
EndSection

Wifi

mwifiex_sdio

The driver creates three interfaces (mlan0, uap0 and p2p0).

Change the wicd preferences to use mlan0.

Prevent NetworkManager messing with uap0 and p2p0

Add uap0 and p2p0 to /etc/network/interfaces as manual interfaces:

vim /etc/network/interfaces.d/mwifiex-blacklist

# Prevent NetworkMangler from scanning these interfaces
#
iface uap0 inet manual
iface p2p0 inet manual

Sound

Needed to add the default user to the audio group:

sudo groupmod -a -G audio myuser

$[Get Code]62

Speakers

Working with SDL only so far (mplayer).

Mute digital:

  • "Digital EQ 3 Band"
  • "Digital EQ 5 Band"
  • "Digital EQ 7 Band"

Unmute Speaker DACs:

  • "Left Speaker Mixer Left DAC" = 00
  • "Left Speaker Mixer Right DAC" = 00
  • "Right Speaker Mixer Left DAC" = 00
  • "Right Speaker Mixer Right DAC" = 00

Working

  • Headphone jack
  • HDMI (via lxrandr)
  • HDMI audio (via lxrandr)

Kernel Upgrade

Arch Linux

http://archlinuxarm.org/platforms/armv7/samsung/samsung-chromebook-2

Back to Crouton

Finally irritated enough by constant freezes.

Install

Create a trusty chroot on the SD card

sudo mount -t ext4 /dev/mmcblk0p7 /mnt/0p7
sudo sh -e ~/Downloads/crouton -r trusty -t lxde -p /mnt/0p7

Obsolete Crouton stuff

Hostname

Changing the hostname breaks Xauth in Crouton (#514) and Chromium (#283167)

Add workaround to /etc/rc.local:

xauth -f /var/host/Xauthority add : MIT-MAGIC-COOKIE-1 \
    `xauth -f /var/host/Xauthority list | sed -e 's/.*  MIT-MAGIC-COOKIE-1  //'`