Differences between revisions 12 and 13
Revision 12 as of 2013-06-25 11:04:24
Size: 13482
Editor: ?DavidEdmondson
Comment: wicd patch now integrated in jessie.
Revision 13 as of 2013-06-25 11:16:27
Size: 14097
Editor: ?DavidEdmondson
Comment: Describe the intended partition layout, as well as the current.
Deletions are marked like this. Additions are marked like this.
Line 70: Line 70:
First, we prepare the SD card on a desktop machine. These instructions are for an 8G card, which affects on the second `cgpt add` call - you can adjust as required. First, we prepare the SD card on a desktop machine. These instructions are for an 8G card, which affects on the third `cgpt add` call - you can adjust as required.

Three partitions are created on the disk. In time, the intention is that these be used for:
 1. a copy of `nv-uboot` that is chainloaded by the standard firmware,
 1. a `/boot` filesystem containing the standard (non-ChromeOS) kernel, read by `nv-uboot`,
 1. the root filesystem.
Currently `nv-uboot` is not used, and so the arrangement is:
 1. a copy of the ChromeOS kernel that is loaded by the standard firmware,
 1. a `/boot` filesystem that is used only to contain the ChromeOS kernel (which is not used during booting, just during the preparation of the previous partition),
 1. the root filesystem.

Translation(s): none

DebianOn is an effort to document how to install, configure and use Debian on some specific hardware. Therefore potential buyers would know if that hardware is supported and owners would know how get the best out of that hardware.

The purpose is not to duplicate the Debian Official Documentation, but to document how to install Debian on some specific hardware.

If you need help to get Debian running on your hardware, please have a look at our user support channels where you may find specific channels (mailing list, IRC channel) dedicated to certain types of hardware.

Models covered
Samsung Chromebook (2012 ARM one)

Sub-models options :
- CPU: Samsung Exynos5 Dual
- Video card: Mali T604
- Screen size: 11.6"

Overall Status

Core Components

[ATTACH]

Boot Standard Kernel:

[?] (used Chromium kernel binary so far)

Detect hard drives:

{OK}

Extra Features

CPU Frequency Scaling

{OK}

Hibernation

[?]

Sleep / Suspend

{OK}

Xorg

{OK}

- OpenGLES

X-(

- Resize-and-Rotate(randr)

{OK}

Switch to External Screen

{OK}

Mouse

- Built-in (Touchpad)

{i}

Wireless/Wifi

{OK}

Legend :
{OK} = OK ; {X} Unsupported(No Driver) ; /!\ = Error (Couldn't get it working); [?] Unknown, Not Test ; [-] Not-applicable
{i} = Configuration Required; X-( = Only works with a non-free driver and or firmware

Important Note

There are several methods of installation other operating systems on Chromebook.

TODO: add some information about them

Preparing for the installation

Enabling Developer Mode

All of the installation techniques described require that the Chromebook be switched into Developer Mode. There are disadvantages to making this switch - see the link for more details, but it is currently a hard requirement.

Simply, developer mode can be enabled by first entering Recovery Mode (hold the ESC and Refresh keys then press the Power key). The system will reboot and show the Recovery Mode screen. Press Control-D or wait 30 seconds. The system will boot and ask you to confirm that you wish to make the change.

Switching to recovery mode will delete any content or data stored on your system.

Enabling Developer Mode proceeds and may take over 10 minutes to complete.

Enabling USB/SD card boot

All of the installation techniques described require that the Chromebook be able to boot from either a USB device or an SD card.

To enable this, first enable Developer Mode, then boot the system and start crosh. This can be done by pressing the Control, Shift and T keys simultaneously. A new window will open showing a terminal-style prompt. Here it is necessary to type shell, followed by sudo -s. You should now have a root shell prompt.

Enable USB/SD card boot with crosssystem dev_boot_usb=1, followed by reboot.

At the Developer Mode boot screen (which you will see every time you restart the system), USB/SD card boot can be selected by pressing Control-U.

Installing to an SD card using the ChromeOS kernel

This approach requires the enabling of both Developer Mode and USB/SD card boot. It uses the ChromeOS kernel and modules rather than the normal Debian kernel.

First, we prepare the SD card on a desktop machine. These instructions are for an 8G card, which affects on the third cgpt add call - you can adjust as required.

Three partitions are created on the disk. In time, the intention is that these be used for:

  1. a copy of nv-uboot that is chainloaded by the standard firmware,

  2. a /boot filesystem containing the standard (non-ChromeOS) kernel, read by nv-uboot,

  3. the root filesystem.

Currently nv-uboot is not used, and so the arrangement is:

  1. a copy of the ChromeOS kernel that is loaded by the standard firmware,
  2. a /boot filesystem that is used only to contain the ChromeOS kernel (which is not used during booting, just during the preparation of the previous partition),

  3. the root filesystem.

# On a desktop machine (does not need to be ARM):
#
DEV=/dev/mmcblk0
MNT=/mnt
# Partitioning the device:
parted --script ${DEV} mklabel gpt
cgpt create ${DEV}
cgpt add -t kernel -l uboot/kernel -b 34 -s 16384 ${DEV}
cgpt add -t data -l /boot -b 16418 -s 32768 ${DEV}
cgpt add -t data -l / -b 49186 -s 15474621 ${DEV}
blockdev --rereadpt ${DEV}
# Create the boot filesystem:
mkfs.ext2 ${DEV}p2
# Create the root filesystem:
mkfs.ext4 ${DEV}p3
# Install the bootstrap packages in the root filesystem:
mkdir -p ${MNT}
mount ${DEV}p3 ${MNT}
mkdir -p ${MNT}/boot
mount ${DEV}p2 ${MNT}/boot
debootstrap --arch=armhf --foreign jessie ${MNT} http://ftp.uk.debian.org/debian
# Unmount the filesystems:
umount ${MNT}/boot
umount ${MNT}

Now move the SD card to the Chromebook which is already booted with ChromeOS:

# On the Chromebook:
#
DEV=/dev/mmcblk1
MNT=/mnt
# Unmount from wherever ChromeOS decided to mount the device,
# remount where we want:
umount ${DEV}p2
umount ${DEV}p3
mount ${DEV}p3 ${MNT}
mount ${DEV}p2 ${MNT}/boot
# Complete the bootstrap:
chroot ${MNT} /debootstrap/debootstrap --second-stage
# Set up fstab:
cat > ${MNT}/etc/fstab <<EOF
${DEV}p3 / ext4 errors=remount-ro 0 1
${DEV}p2 /boot ext2 errors=remount-ro 0 1
EOF
# Set up the apt sources and update:
cat > ${MNT}/etc/apt/sources.list <<EOF
deb http://ftp.uk.debian.org/debian jessie main non-free contrib
deb-src http://ftp.uk.debian.org/debian jessie main non-free contrib
EOF
# Update the package list:
chroot ${MNT} apt-get update
# Install useful packages:
chroot ${MNT} apt-get install -y cgpt vboot-utils \
        vboot-kernel-utils
chroot ${MNT} apt-get install -y wicd-daemon wicd-cli \
   wicd-curses console-setup
# Set the root password to blank:
chroot ${MNT} passwd -d root
# Set the hostname:
echo "wowbagger" > ${MNT}/etc/hostname
# Copy the ChromeOS kernel to the root filesystem:
cp /boot/vmlinuz ${MNT}/boot/vmlinuz
# Declare the kernel flags:
cat > ${MNT}/boot/kernel.flags <<EOF
console=tty1 printk.time=1 nosplash rootwait root=${DEV}p3 rw rootfstype=ext4 lsm.module_locking=0
EOF
# Sign the kernel:
cat > ${MNT}/boot/sign-kernel.sh <<EOF
chroot ${MNT} vbutil_kernel --pack /boot/vmlinuz.signed --keyblock \
  /usr/share/vboot/devkeys/kernel.keyblock --version 1 \
  --signprivate /usr/share/vboot/devkeys/kernel_data_key.vbprivk \
  --config /boot/kernel.flags --vmlinuz /boot/vmlinuz \
  --arch arm
EOF
chroot ${MNT} sh /boot/sign-kernel.sh
# Write the signed kernel to the kernel partition:
dd if=${MNT}/boot/vmlinuz.signed of=${DEV}p1 bs=4M
# Mark the newly written kernel partition as good and set the
# priority:
cgpt add -i 1 -S 1 -T 5 -P 12 ${DEV}
# Copy the ChromeOS kernel modules into the root filesystem:
mkdir -p ${MNT}/lib/modules
cp -r /lib/modules/* ${MNT}/lib/modules
# Copy the non-free firmware for the wifi device:
mkdir -p ${MNT}/lib/firmware/mrvl
cp /lib/firmware/mrvl/sd8797_uapsta.bin ${MNT}/lib/firmware/mrvl
# Umount the filesystems:
umount ${MNT}/boot
umount ${MNT}

You should now be able to reboot your system and press Control-U at the boot screen to boot from the SD card. There is no root password - you should set one.

Notes

  • wicd-curses needs a patch to be useful as of 2013-06-19. (Not required as of 2013-06-25.)

  • Installing the X server, etc. doesn't result in a working X configuration yet.
  • This same sequence of steps using a USB flash drive instead of the SD card failed to boot for reasons currently unknown.

Configuration

Display

There is a driver for X11: xf86-video-armsoc. It was created from xf86-video-omap one but forked quite long time ago. There is armsoc driver at Linaro git server but it does not have Mali T604 support at all.

Xorg.conf snippet (taken from Chromium OS):

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

Section "Screen"
        Identifier      "DefaultScreen"
        Device          "Mali FBDEV"
        DefaultDepth    24
EndSection

OpenGL ES

To get OpenGL ES working several files from Chromium OS needs to be copied from /usr/lib/:

  • libmali*
  • libEGL*
  • libGLES*

There is a package in my Ubuntu PPA which automates it and provides everything to get it working instead of Mesa. Did not tested under Debian yet.

Audio

Do not play with ALSA mixer - you may fry your speakers!

UCM profiles from Chromium OS are on a way to be included in Debian. In meantime copy /usr/share/alsa/ucm/ directory contents from Chromium OS.

Touchpad

Two choices exists:

  • xf86-input-cmt used by Chromium. Requires libevdev, libgestures, libbase-* to be created.
  • xf86-input-multitouch

Second option requires small xorg.conf snippet:

Section "InputClass"
        Identifier "touchpad"
        MatchIsTouchpad "on"
EndSection

Power Management

Suspend to memory works but looks like battery usage is higher than expected.

Not tested hibernation.

WiFi

Works fine.


System Summary

lsusb

lsusb -v | grep -E '\<(Bus|iProduct|bDeviceClass|bDeviceProtocol)' 2>/dev/null

Bus 001 Device 002: ID 0424:3503 Standard Microsystems Corp.
  bDeviceClass            9 Hub
  bDeviceProtocol         2 TT per port
  iProduct                0
  bDeviceClass            9 Hub
  bDeviceProtocol         0 Full speed (or root) hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
  bDeviceClass            9 Hub
  bDeviceProtocol         0 Full speed (or root) hub
  iProduct                2 S5P EHCI Host Controller
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
  bDeviceClass            9 Hub
  bDeviceProtocol         0 Full speed (or root) hub
  iProduct                2 EXYNOS OHCI Host Controller
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
  bDeviceClass            9 Hub
  bDeviceProtocol         1 Single TT
  iProduct                2 xHCI Host Controller
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
  bDeviceClass            9 Hub
  bDeviceProtocol         3
  iProduct                2 xHCI Host Controller
Bus 001 Device 003: ID 2232:1037
  bDeviceClass          239 Miscellaneous Device
  bDeviceProtocol         1 Interface Association
  iProduct                1 WebCam SC-03FFM12339N
      (Bus Powered)
  bDeviceClass          239 Miscellaneous Device
  bDeviceProtocol         1 Interface Association
  (Bus Powered)

Resources

List of loaded modules

Module                  Size  Used by
hidp                   12084  1
isl29018                6412  0
industrialio           14340  1 isl29018
uvcvideo               59681  0
videobuf2_vmalloc       2732  1 uvcvideo
sbs_battery             6441  0
joydev                  8277  0
rfcomm                 21424  12
mwifiex_sdio           11492  0
mwifiex               102827  1 mwifiex_sdio
cfg80211              159128  1 mwifiex
btmrvl_sdio             7952  0
btmrvl                 11681  1 btmrvl_sdio
bluetooth             165503  25 hidp,btmrvl,rfcomm,btmrvl_sdio
spidev                  4304  0

Attachments

Some configuration files and sample outputs.

Credits