Chromebook

From silverwiki

kernel

Working: sleep, resume, brightness adjustment, wifi not tested: sound, bluetooth, headphones, hdmi, usb3

git clone git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
cd linux-next/
git fetch --tags
git checkout v4.3
make exynos_defconfig
#make menuconfig #If you want to add anything like game controller drivers or filesystems
sed -i 's/CONFIG_MWIFIEX_SDIO=y/CONFIG_MWIFIEX_SDIO=m/' .config
sed -i 's/# CONFIG_CFG80211_WEXT is not set/CONFIG_CFG80211_WEXT=y/' .config
make zImage modules exynos5420-peach-pit.dtb -j 10
cat arch/arm/boot/zImage arch/arm/boot/dts/exynos5420-peach-pit.dtb > zImage.dtb
mkimage -A arm -O linux -T kernel -C none -a 0x40008000 -e 0x40008000 -n Linux -d zImage.dtb uImage
sudo make modules_install
sudo cp /boot/uImage /boot/uImage.old
sudo cp uImage /boot/uImage

boot

To boot the thing, I use this boot.txt stored in partition 12 in /u-boot/

setenv bootdelay 1
setenv cros_bootfile /uImage
setenv loadaddr 0x41000000
setenv rootpart 3
setenv bootpart 2
setenv set_devname 'setenv bootargs console=tty1 ro init=/sbin/init root=/dev/mmcblk${devnum}p${rootpart}'
setenv ext2_boot 'ext2load ${devtype} ${devnum}:${bootpart} ${loadaddr} ${cros_bootfile}; bootm ${loadaddr}'

It's turned into a uboot image with

mkimage -A arm -C none -T script -d boot.txt boot.scr.uimg

boot printenv

Here are pictures of printenv output from u-boot before 'run run_disk_boot_scripts' gets called by mmc_boot. I think this is stock but it might have been modified in flash by chrubuntu.

Peachpituboot.jpg Peachpituboot2.jpg

partitions

Number  Start   End     Size    File system  Name    Flags
 1      4194kB  6291kB  2097kB               U-Boot
 2      6291kB  543MB   537MB   ext2         Boot    msftdata
12      543MB   560MB   16.8MB  fat16        Script  msftdata
 3      560MB   15.6GB  15.1GB  ext4         Root    msftdata

sleep in slackware arm 14.1

Make sure /etc/rc.d/rc.acpid is chmod +x

Edit /etc/acpi/acpi_handler.sh to include a section for the lid

#!/bin/sh
# Default acpi script that takes an entry for all actions

IFS=${IFS}/
set $@

echo "$1 $2 $3 $4" >> /aout

case "$1" in
  button)
    case "$2" in
      power) /sbin/init 0
         ;;
      lid)
        case "$4" in
          close) pm-suspend
          ;;
          open) wpatool.sh
          ;;
          *) logger "ACPI action $2 $4 is not defined"
          ;;
        esac
      ;;
    *) logger "ACPI action $2 is not defined"
    ;;
    esac
    ;;
  *)
    logger "ACPI group $1 / action $2 is not defined"
    ;;
esac

wifi

Network manager pisses me off, so I use a script like this to find and connect to networks:

#!/bin/bash
INT=mlan0
MYNETWORKS="a56kmodem MJ6CH"
MYNETWORKS="$(ls /root/.wpaconfigs/ -1 | xargs)"
LOG=/var/log/wpatool

# set -v

ifconfig $INT up

success () {
echo "$(date) we are connected to $SSID" >> $LOG; 
ntpdate -s time.nist.gov;
exit 0;
}

bummer () { echo "$(date) wpatool could not connect to a network" >> $LOG; exit 1;}

echo "$(date) wpatool called!" >> $LOG
#If we can ping the last dhcp server we talked to, we are already online. yay
ping "$(grep DHCPACK /var/log/syslog | tail -1 | awk '{print $10}')" -w3 -c1 && success

echo "$(date) not able to ping last gw. scanning wlans" >> $LOG
tries=12
until [ "$ESSIDS" != "" ]; do
	sleep 1;
	tries=$(($tries-1))
	ESSIDS="$(iwlist mlan0 scanning | grep ESSID)"
	#Makes a list of items like this:
	#                    ESSID:"a56kmodem"
	if [ $tries == "0" ]; then bummer; fi
done
echo "$(date) Networks currently in range $ESSIDS" >> $LOG

#For each network named in MYNETWORKS, try to connect if in range
for SSID in $MYNETWORKS; do
	if [ "$(echo $ESSIDS | grep "ESSID:\"$SSID\"")" != "" ]; then
        echo "$(date) connecting to $SSID" >> $LOG
		killall wpa_supplicant
		wpa_supplicant -c /root/.wpaconfigs/$SSID -i mlan0 -B && dhclient mlan0 -v && success
	fi
done

#You're only here if you can't get online. Bummer!
bummer

Alsamixer

These are the settings I needed to get audio output:

  • Digital EQ: maximum
  • Digital: maximum
  • Left Speaker Mixer Left DAC: on
  • Right Speaker Mixer Right DAC: on
  • Speaker Left: on
  • Speaker Left Mixer: maximum
  • Speaker Right: on
  • Speaker Right Mixer: maximum
  • Speaker: Set volume as desired


I think this routes the right channel into the left speaker, and viceversa. It made it noticeably louder too.

  • Left Speaker Mixer Right DAC: on
  • Right Speaker Mixer Left DAC: on


Install arch the easy way

Follow new arch install guide for two partition stick

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

Once booted, dd stick to mmc

run wifi setup

pacman -Sy gdisk

gdisk /dev/mmcblk0

x for extra mode

e to reallocate backup gpt table to end of disk

m for main menu

d to delete

2

n new partition

2

start where p2 started before, should be suggested

end at default

type 0700

n to name partition "Root"

w to write

q to quit

resize2fs /dev/mmcblk0p2 to fill space with filesystem