Linux on Chromebook with ARM® Mali™ GPU

Disclaimer

The step-by-step guidelines below provided by ARM for your convenience contain information about downloading and installing files, licensed by third parties, which are subject to their own licence terms and conditions.  Your use of such downloads are expressly subject to those third party terms. You hereby agree to comply with all the terms and conditions imposed on you by the relevant third party terms. You acknowledge that ARM shall have no liability to you in respect of those third party files and that your use of the step-by-step guidelines is at your own risk.

Chromebook-Seemore-450px.jpeg

1. Introduction

This guide provides instructions to build and run a GNU/Linux distribution on the Samsung Chromebook devices as an alternative to the Chrome OS™ operating system. Some experience with Linux as a programmer is expected in order to use this guide. More specifically, one should be familiar with opening and executing commands in a terminal and mounting storage devices. The supported windowing systems are fbdev (direct frame buffer access), X11 and Weston (Wayland). The instructions are written for several Chromebook variants with accompanying notes to highlight specific things for each of them.

2. Prerequisites

The first prerequisite is to have one of the following devices covered by this guide:

Device NameVariant
Samsung Chromebook 1XE303C12
Samsung Chromebook 2 11.6″XE503C12
Samsung Chromebook 2 13.3″XE503C32
ASUS Chromebook C201C201PA

You will then need the following extra items in order to be able to follow this guide:

  • SD card (Samsung Chromebook 1) or Micro SD card (other devices) with at least 1GB capacity (approx 800MB required with X11, 900MB with X11 and Weston), Class 10 recommended
  • PC with a 64-bit distribution of Linux such as Ubuntu 14.04 LTS or Ubuntu 16.04 LTS
  • 3GB of free disk space
  • USB-Ethernet adapter to enable network communications

3. Host system preparation

This step is to prepare your host Ubuntu system to compile and install the Chromebook software. You may use an alternative Linux distribution but these instructions have been tested only with Ubuntu 14.04 and 16.04.

3.1 Ubuntu packages

Run the following command to install all the required packages on the host Ubuntu system:

For Ubuntu 14.04:

sudo apt-get install build-essential curl wget git gdisk u-boot-tools
sudo apt-get install device-tree-compiler libssl-dev uuid-dev liblzma-dev libyaml-dev libtspi-dev
sudo apt-get install libc6:i386 libncurses5:i386 libstdc++6:i386 lib32z1-dev lib32bz2-1.0

For Ubuntu 16.04:

sudo apt-get install build-essential curl wget git gdisk u-boot-tools
sudo apt-get install device-tree-compiler libssl-dev uuid-dev liblzma-dev libyaml-dev libtspi-dev
sudo apt-get install libc6:i386 libncurses5:i386 libstdc++6:i386 lib32z1-dev libbz2-1.0:i386

3.2 Git configuration

If this is a new installation of Git, you need to configure your name and email.  Otherwise, cloning the Linux kernel repository will fail.  You can do this with the following commands:

git config --global user.name "Your Name"
git config --global user.email "your email"

3.3 Initial set-up directory

Download the attached mali_chromebook-setup_006.tar.gz set-up archive and extract it in an empty directory:

tar xzf mali_chromebook-setup_006.tar.gz
cd mali_chromebook-setup_006

This archive contains a chromebook-setup.sh script, also referred to as the set-up script, to automate the process of preparing an SD card, as well as some associated data files like Linux kernel patches and configuration files for the Chromebook.

4. Configuration

The set-up script relies on several configuration options. This step is to determine which values you need to use for each of them.

4.1 Determine the Chromebook variant

The ‑‑variant option is to specify the Chromebook variant you want to use. The product code needs to be used, as previously listed in the 2. Prerequisites section.  For example:

--variant=XE303C12 # for Samsung Chromebook 1

4.2 Determine the storage device

You then need to determine the block device associated with your SD card and pass it to the ‑‑storage option. Insert the SD card into as SD card reader on your host computer. There should be a new block device corresponding to the SD card which you can discover by running lsblk:

$ lsblk
NAME  MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
sda    8:0    0  42G  0 disk
├─sda1  8:1    0  38G  0 part /
├─sda2  8:2    0    1K  0 part
└─sda5  8:5    0    4G  0 part [SWAP]
sdc    8:32  1  3.7G  0 disk
├─sdc1  8:33  1  16M  0 part
├─sdc2  8:34  1  16M  0 part
└─sdc3  8:35  1  3.4G  0 part
sr0    11:0    1 1024M  0 rom

In this example, /dev/sdc is the SD card of 4GB in capacity. It’s also possible to look at the kernel messages (only showing relevant lines here):

$ dmesg | tail
sd 8:0:0:1: [sdc] 7744512 512-byte logical blocks: (3.96 GB/3.69 GiB)
sdc: sdc1 sdc2

Warning: If you pick the wrong device you may erase all the data on your computer. You need to be absolutely sure which device the SD card is.

The option should then look like this:

--storage=/dev/sdX # adjust to match your actual device like /dev/sdc

4.3 Optional: Select Mali driver version

It is highly recommended to use the latest available version of the Mali drivers, in which case this step can be skipped. Otherwise, if you want to use an older driver version, make sure you download the appropriate archives and pass the corresponding version code to the ‑‑mali option. For example, you may use:

--mali=r12p0-04rel0 # to manually specify the Mali driver version

Note: The current version of this guide only supports r12p0 but more driver versions with different features may be made available in the future.

5. Automatic set-up

This step will automatically perform all the necessary actions to install a full Debian system on an SD card which can then be directly used with the Chromebook. Among other things, this means creating partitions, building and installing the Linux kernel as well as copying the Debian operating system files. If you later need to re-run only a subset of this process or if you want to do something different, then please refer to the 8. Manual set-up.

This will automatically download the Debian 9 (Stretch) file system built for the armhf architecture from the Linaro website.

To compile the Linux kernel and bootloader, a Linaro compiler toolchain will be automatically downloaded and extracted in the current directory.

This will also download the source code of the Linux kernel and bootloader for the Chromebook. The exact revisions can be found in the script.

With the SD card still present with the same device name, you now only need to run the do_everything command with options as determined in the previous section:

./chromebook-setup.sh --storage=/dev/sdX --variant=VARIANT do_everything

This typically takes about 20 minutes but will vary greatly depending on the network and SD card speed to download and install files as well as the host PC performance to build the Linux kernel.

After successful completion, you should see these final messages which indicate that the SD card is ready to be inserted into the Chromebook:

Ejecting storage device...
All done.

6. Enable Chromebook developer mode

You now need to enable Developer Mode on the Chromebook to allow booting with an alternative operating system from USB/SD card with the procedure below.

Warning: Enabling Developer Mode will erase all user data. Make a back-up first.

  1. Eject the SD card from the host PC and insert it into the Chromebook while it’s powered off.
  2. Enter Recovery Mode by holding the ESC and REFRESH (↻ or F3) buttons, and pressing the POWER button.
  3. In Recovery Mode press Ctrl+D and ENTER to confirm and enable Developer Mode.
  4. After the system reboots, when a warning about ‘OS Verification’ is displayed, press Ctrl+D to boot into Chrome OS. The system will offer to cancel the transitioning to Developer Mode for 30 seconds. With no further action, it will erase all user data. This process may take up to 20 minutes.
  5. Once this process is complete the system will reboot; press Ctrl+D to boot into Chrome OS.
  6. Press Ctrl+Alt+→ (or F2) to switch to a virtual terminal.
  7. Login with username root and an empty password.
  8. Enable booting from USB/SD card with:
crossystem dev_boot_usb=1
crossystem dev_boot_signed_only=0

You will now be able to boot from SD card after powering on the Chromebook when the ‘OS Verification’ message is displayed by pressing Ctrl+U. To boot in normal Chrome OS mode, press Ctrl+D. The Chromebook should now be able to boot in fbdev mode, i.e. without any windowing system. Log in as root with an empty password.

7. Extra Chromebook set-up

This step explains how to do just a few extra things on the Chromebook while it’s running. For example, the Debian distribution contains a large repository of packages from which you can install many more programs using the apt-get utility.

7.1 Network

The network should automatically be started at boot time; this can be verified by running ifconfig.

If this does not work, the following commands can be run to bring up the network manually:

ifconfig -a # to find out the name of the usb ethernet interface - usually beginning with enx
dhcpcd enx??? # replace as appropriate

7.2 X11 windowing system

To enable hardware-accelerated graphics rendering with X11, you will need the armsoc DDX driver and compatible Mali user-space driver. As armsoc is not available in the Debian repositories, you need to build it from source. You can run the install-x11.sh script to do this automatically, which gets installed automatically during the setup_rootfs command. Boot the Chromebook, log in as root and run:

./install-x11.sh
. ~/.bashrc # reload the .bashrc to provide the runX alias
runX # to actually start X11

The runX command is being used as a workaround in place of the usual startx command due to an incompatibility between the current versions of the armsoc driver and systemd-logind package. It starts the X server on virtual terminal 12 instead of the current one. This should be removed when a future version of armsoc becomes available.

Note: The graphical performance is currently suboptimal with the X11 windowing system.  Please see section 7.3. Weston windowing system to enable the Weston windowing system.

Note: X11 is currently not supported on the ASUS C201 Chromebook, this should also get resolved with a future armsoc version.

7.3 Weston windowing system

To enable hardware-accelerated graphics rendering with Wayland, you will need to install the relevant Weston/Wayland packages and compatible Mali user-space driver. The install-wayland.sh script can be used to automate this; it should have already been installed as part of the automatic set-up. Boot the Chromebook, log in as root and run:

./install-wayland.sh
runweston-drm # to start weston with DRM backend
runweston-fbdev # to start weston with fbdev backend

The Samsung Chromebook devices support Wayland with Weston and DRM back-end; this provides the best performance.

Note: The ASUS C201 Chromebook only supports Wayland with fbdev backend due to a kernel display driver issue when starting Weston with DRM back-end.

8. Manual set-up

As an alternative to the guidelines described in section 5. Automatic Set-up, it is also possible to run each step of the set-up process manually. This is especially useful if you want to build with a different toolchain, partition the SD card differently, use a different version of Debian or modify the Linux kernel.

To get a detailed description of all the available commands in the set-up script, run:

./chromebook-setup.sh help

Here’s a summary of the syntax:

Usage:

  ./chromebook-setup.sh COMMAND [ARGS] OPTIONS

  Only COMMAND and ARGS are positional arguments; the OPTIONS can be

  placed anywhere and in any order.  The definition of ARGS varies

  with each COMMAND.

Options are detailed in 4. Configuration.  Here’s a short summary of each command:

  • format_storage

Create partitions and format the storage device.

  • setup_rootfs [ARCHIVE]

Extract Debian archive on the root file system and adjust system configuration.

  • get_mali

Download the relevant Mali user-side driver archives.

  • install_mali

Extract the Mali user-side driver archive into the root file system.

  • get_toolchain

Download and extract the default cross-compiler toolchain.

  • get_kernel [URL]

Create a shallow clone of the Chromebook Linux kernel Git repository and apply any extra patches.

  • build_kernel

Build the Linux kernel and install modules on the root file system.

  • get_vboot [URL]

Create a shallow clone of the Chromebook bootloader Git repository.

  • build_vboot [ROOT]

Build the bootloader, package it with the Linux kernel image and install it on the boot partition.

Once you’ve completed the manual process, you can run this to safely remove your storage device:

sync
sudo eject /dev/sdX # adjust to match your storage device
mali_chromebook-setup_006.tar.gz
  • I'm getting this error:

      LD [M]  sound/core/seq/snd-seq-device.ko

      LD [M]  sound/core/seq/snd-seq-dummy.ko

      LD [M]  sound/core/seq/snd-seq-midi-event.ko

      LD [M]  sound/core/seq/snd-seq-midi.ko

      LD [M]  sound/core/seq/snd-seq.ko

      LD [M]  sound/core/snd-hrtimer.ko

      LD [M]  sound/core/snd-hwdep.ko

      LD [M]  sound/core/snd-rawmidi.ko

      LD [M]  sound/usb/snd-usb-audio.ko

      LD [M]  sound/usb/snd-usbmidi-lib.ko

    DTC: dts->dtb  on file "kernel.its"

    FIT description: Chrome OS kernel image with one or more FDT blobs

    Created:        Sun Apr  5 20:33:30 2015

    Image 0 (kernel@1)

      Description:  kernel

    Invalid Image Type - valid names are: filesystem, firmware, flat_dt, imximage, kernel, kwbimage, multi, omapimage, ramdisk, script, standalone, flat_dt, kwbimage, imximage, ublimage

      Type:        Unknown Image

      Compression:  uncompressed

      Data Size:    3721384 Bytes = 3634.16 kB = 3.55 MB

    Image 1 (fdt@1)

      Description:  exynos5250-snow-rev4.dtb

      Type:        Flat Device Tree

      Compression:  uncompressed

      Data Size:    46153 Bytes = 45.07 kB = 0.04 MB

      Architecture: ARM

      Hash algo:    sha1

      Hash value:  2b4017777bd65329178c2fa220e647c2df06c298

    Default Configuration: 'conf@1'

    Configuration 0 (conf@1)

      Description:  unavailable

      Kernel:      kernel@1

      FDT:          fdt@1

    [sudo] password for stefan:

      INSTALL crypto/deflate.ko

      INSTALL crypto/michael_mic.ko

      INSTALL crypto/sha512_generic.ko

      INSTALL drivers/bluetooth/bfusb.ko

      INSTALL drivers/bluetooth/btmrvl.ko

      INSTALL drivers/bluetooth/btmrvl_sdio.ko

      INSTALL drivers/bluetooth/btsdio.ko

      INSTALL drivers/bluetooth/btusb.ko

      INSTALL drivers/bluetooth/hci_uart.ko

      INSTALL drivers/bluetooth/hci_vhci.ko

      INSTALL drivers/cdrom/cdrom.ko

      INSTALL drivers/gpu/arm/midgard/mali_kbase.ko

      INSTALL drivers/hid/hid-apple.ko

      INSTALL drivers/hid/hid-cherry.ko

      INSTALL drivers/hid/hid-logitech-dj.ko

      INSTALL drivers/hid/hid-logitech-hidpp.ko

      INSTALL drivers/hid/hid-logitech-wtp.ko

      INSTALL drivers/hid/hid-logitech.ko

      INSTALL drivers/hid/hid-magicmouse.ko

      INSTALL drivers/hid/hid-microsoft.ko

      INSTALL drivers/hid/hid-multitouch.ko

      INSTALL drivers/hid/hid-plantronics.ko

      INSTALL drivers/hid/hid-primax.ko

      INSTALL drivers/hid/hid-quickstep.ko

      INSTALL drivers/hid/hid-sony.ko

      INSTALL drivers/hid/hid-wiimote.ko

      INSTALL drivers/i2c/i2c-dev.ko

      INSTALL drivers/i2c/i2c-stub.ko

      INSTALL drivers/input/joydev.ko

      INSTALL drivers/input/joystick/iforce/iforce.ko

      INSTALL drivers/input/joystick/xpad.ko

      INSTALL drivers/input/misc/uinput.ko

      INSTALL drivers/input/serio/serport.ko

      INSTALL drivers/input/tablet/wacom.ko

      INSTALL drivers/media/platform/vivi.ko

      INSTALL drivers/media/usb/uvc/uvcvideo.ko

      INSTALL drivers/media/v4l2-core/videobuf2-vmalloc.ko

      INSTALL drivers/mmc/card/mmc_test.ko

      INSTALL drivers/net/ppp/ppp_async.ko

      INSTALL drivers/net/ppp/ppp_generic.ko

      INSTALL drivers/net/slip/slhc.ko

      INSTALL drivers/net/tun.ko

      INSTALL drivers/net/usb/asix.ko

      INSTALL drivers/net/usb/ax88179_178a.ko

      INSTALL drivers/net/usb/cdc_ether.ko

      INSTALL drivers/net/usb/cdc_ncm.ko

      INSTALL drivers/net/usb/dm9601.ko

      INSTALL drivers/net/usb/mcs7830.ko

      INSTALL drivers/net/usb/net1080.ko

      INSTALL drivers/net/usb/pegasus.ko

      INSTALL drivers/net/usb/r8152.ko

      INSTALL drivers/net/usb/rndis_host.ko

      INSTALL drivers/net/usb/rtl8150.ko

      INSTALL drivers/net/usb/smsc75xx.ko

      INSTALL drivers/net/usb/smsc95xx.ko

      INSTALL drivers/net/usb/usbnet.ko

      INSTALL drivers/net/veth.ko

      INSTALL drivers/net/wireless/brcm80211/brcmfmac/brcmfmac.ko

      INSTALL drivers/net/wireless/brcm80211/brcmutil/brcmutil.ko

      INSTALL drivers/net/wireless/hostap/hostap.ko

      INSTALL drivers/net/wireless/libertas_tf/libertas_tf.ko

      INSTALL drivers/net/wireless/libertas_tf/libertas_tf_usb.ko

      INSTALL drivers/net/wireless/mac80211_hwsim.ko

      INSTALL drivers/net/wireless/mwifiex/mwifiex.ko

      INSTALL drivers/net/wireless/mwifiex/mwifiex_sdio.ko

      INSTALL drivers/net/wireless/rndis_wlan.ko

      INSTALL drivers/net/wireless/rt2x00/rt2500usb.ko

      INSTALL drivers/net/wireless/rt2x00/rt2800lib.ko

      INSTALL drivers/net/wireless/rt2x00/rt2800usb.ko

      INSTALL drivers/net/wireless/rt2x00/rt2x00lib.ko

      INSTALL drivers/net/wireless/rt2x00/rt2x00usb.ko

      INSTALL drivers/power/bq27x00_battery.ko

      INSTALL drivers/power/sbs-battery.ko

      INSTALL drivers/rtc/rtc-s3c.ko

      INSTALL drivers/scsi/sr_mod.ko

      INSTALL drivers/spi/spi-bitbang.ko

      INSTALL drivers/staging/iio/light/isl29018.ko

      INSTALL drivers/staging/iio/light/tsl2563.ko

      INSTALL drivers/staging/iio/light/tsl2583.ko

      INSTALL drivers/staging/zram/zram.ko

      INSTALL drivers/staging/zsmalloc/zsmalloc.ko

      INSTALL drivers/usb/misc/ezusb.ko

      INSTALL drivers/usb/serial/cp210x.ko

      INSTALL drivers/usb/serial/ftdi_sio.ko

      INSTALL drivers/usb/serial/keyspan.ko

      INSTALL drivers/usb/serial/option.ko

      INSTALL drivers/usb/serial/oti6858.ko

      INSTALL drivers/usb/serial/pl2303.ko

      INSTALL drivers/usb/serial/qcserial.ko

      INSTALL drivers/usb/serial/sierra.ko

      INSTALL drivers/usb/serial/usb_wwan.ko

      INSTALL fs/fat/fat.ko

      INSTALL fs/fat/vfat.ko

      INSTALL fs/fuse/fuse.ko

      INSTALL fs/hfsplus/hfsplus.ko

      INSTALL fs/isofs/isofs.ko

      INSTALL fs/nls/nls_ascii.ko

      INSTALL fs/nls/nls_cp437.ko

      INSTALL fs/nls/nls_iso8859-1.ko

      INSTALL fs/nls/nls_utf8.ko

      INSTALL fs/udf/udf.ko

      INSTALL kernel/configs.ko

      INSTALL kernel/test_module.ko

      INSTALL kernel/time/udelay_test.ko

      INSTALL lib/crc-itu-t.ko

      INSTALL lib/crc-t10dif.ko

      INSTALL lib/crc7.ko

      INSTALL lib/libcrc32c.ko

      INSTALL lib/zlib_deflate/zlib_deflate.ko

      INSTALL net/802/p8022.ko

      INSTALL net/802/psnap.ko

      INSTALL net/802/stp.ko

      INSTALL net/bluetooth/bluetooth.ko

      INSTALL net/bluetooth/hidp/hidp.ko

      INSTALL net/bluetooth/rfcomm/rfcomm.ko

      INSTALL net/bridge/bridge.ko

      INSTALL net/ipv4/ah4.ko

      INSTALL net/ipv4/esp4.ko

      INSTALL net/ipv4/ipcomp.ko

      INSTALL net/ipv4/netfilter/ipt_MASQUERADE.ko

      INSTALL net/ipv4/netfilter/iptable_nat.ko

      INSTALL net/ipv4/netfilter/nf_nat_ipv4.ko

      INSTALL net/ipv4/tcp_lp.ko

      INSTALL net/ipv4/tunnel4.ko

      INSTALL net/ipv4/xfrm4_mode_beet.ko

      INSTALL net/ipv4/xfrm4_mode_transport.ko

      INSTALL net/ipv4/xfrm4_mode_tunnel.ko

      INSTALL net/ipv4/xfrm4_tunnel.ko

      INSTALL net/ipv6/ah6.ko

      INSTALL net/ipv6/esp6.ko

      INSTALL net/ipv6/netfilter/ip6_tables.ko

      INSTALL net/ipv6/netfilter/ip6t_MASQUERADE.ko

      INSTALL net/ipv6/netfilter/ip6t_REJECT.ko

      INSTALL net/ipv6/netfilter/ip6t_ipv6header.ko

      INSTALL net/ipv6/netfilter/ip6table_filter.ko

      INSTALL net/ipv6/netfilter/ip6table_mangle.ko

      INSTALL net/ipv6/netfilter/ip6table_nat.ko

      INSTALL net/ipv6/netfilter/nf_conntrack_ipv6.ko

      INSTALL net/ipv6/netfilter/nf_defrag_ipv6.ko

      INSTALL net/ipv6/netfilter/nf_nat_ipv6.ko

      INSTALL net/ipv6/sit.ko

      INSTALL net/ipv6/xfrm6_mode_beet.ko

      INSTALL net/ipv6/xfrm6_mode_transport.ko

      INSTALL net/ipv6/xfrm6_mode_tunnel.ko

      INSTALL net/key/af_key.ko

      INSTALL net/llc/llc.ko

      INSTALL net/mac80211/mac80211.ko

      INSTALL net/netfilter/nf_nat.ko

      INSTALL net/netfilter/xt_TCPMSS.ko

      INSTALL net/netfilter/xt_mark.ko

      INSTALL net/netfilter/xt_nat.ko

      INSTALL net/sched/cls_u32.ko

      INSTALL net/sched/sch_codel.ko

      INSTALL net/sched/sch_fq_codel.ko

      INSTALL net/sched/sch_htb.ko

      INSTALL net/wireless/cfg80211.ko

      INSTALL net/wireless/lib80211.ko

      INSTALL net/wireless/lib80211_crypt_ccmp.ko

      INSTALL net/wireless/lib80211_crypt_tkip.ko

      INSTALL net/wireless/lib80211_crypt_wep.ko

      INSTALL net/xfrm/xfrm_algo.ko

      INSTALL net/xfrm/xfrm_ipcomp.ko

      INSTALL net/xfrm/xfrm_user.ko

      INSTALL sound/core/seq/snd-seq-device.ko

      INSTALL sound/core/seq/snd-seq-dummy.ko

      INSTALL sound/core/seq/snd-seq-midi-event.ko

      INSTALL sound/core/seq/snd-seq-midi.ko

      INSTALL sound/core/seq/snd-seq.ko

      INSTALL sound/core/snd-hrtimer.ko

      INSTALL sound/core/snd-hwdep.ko

      INSTALL sound/core/snd-rawmidi.ko

      INSTALL sound/usb/snd-usb-audio.ko

      INSTALL sound/usb/snd-usbmidi-lib.ko

      DEPMOD  3.8.11

    Done.

    Getting initial vboot repository

    Cloning into 'vboot'...

    WARNING: gnome-keyring:: couldn't connect to: /tmp/keyring-GPyYeB/pkcs11: No such file or directory

    remote: Sending approximately 36.63 MiB ...

    remote: Counting objects: 1337, done

    remote: Finding sources: 100% (63/63)

    remote: Total 18215 (delta 11776), reused 18188 (delta 11776)

    Receiving objects: 100% (18215/18215), 36.71 MiB | 427.00 KiB/s, done.

    Resolving deltas: 100% (11910/11910), done.

    Checking connectivity... done.

    Checking out files: 100% (1079/1079), done.

    Checking out vboot revision 9e1da784487fb8cfbe4e76693e07205b66675bda onto branch mali-chromebook-setup

    Switched to a new branch 'mali-chromebook-setup'

    Already on 'mali-chromebook-setup'

    Done.

    Using qemu for testing.

        CC            firmware/lib/cryptolib/padding.o

        CC            firmware/lib/cryptolib/rsa.o

        CC            firmware/lib/cryptolib/rsa_utility.o

        CC            firmware/lib/cryptolib/sha1.o

        CC            firmware/lib/cryptolib/sha256.o

        CC            firmware/lib/cryptolib/sha512.o

        CC            firmware/lib/cryptolib/sha_utility.o

        CC            firmware/lib/stateful_util.o

        CC            firmware/lib/vboot_api_firmware.o

        CC            firmware/lib/vboot_common.o

        CC            firmware/lib/vboot_firmware.o

        CC            firmware/lib/region-fw.o

        CC            firmware/lib/tpm_bootmode.o

        CC            firmware/stub/vboot_api_stub_sf.o

        CC            firmware/lib/crc8.o

        CC            firmware/lib/utility.o

        CC            firmware/lib/vboot_api_init.o

        CC            firmware/lib/vboot_common_init.o

        CC            firmware/lib/vboot_nvstorage.o

        CC            firmware/lib/region-init.o

        CC            firmware/lib/rollback_index.o

        CC            firmware/lib/tpm_lite/tlcl.o

        CC            firmware/stub/tpm_lite_stub.o

        CC            firmware/stub/utility_stub.o

        CC            firmware/stub/vboot_api_stub_init.o

        CC            firmware/stub/vboot_api_stub_region.o

        CC            firmware/lib/cgptlib/cgptlib.o

        CC            firmware/lib/cgptlib/cgptlib_internal.o

        CC            firmware/lib/cgptlib/crc32.o

        CC            firmware/lib/cgptlib/mtdlib.o

        CC            firmware/lib/utility_string.o

        CC            firmware/lib/vboot_api_kernel.o

        CC            firmware/lib/vboot_audio.o

        CC            firmware/lib/vboot_display.o

        CC            firmware/lib/vboot_kernel.o

        CC            firmware/lib/region-kernel.o

        CC            firmware/stub/vboot_api_stub.o

        CC            firmware/stub/vboot_api_stub_disk.o

        CC            firmware/linktest/main_vbinit.o

        CC            firmware/linktest/main_vbsf.o

        CC            firmware/linktest/main.o

        CC            host/linktest/main.o

        CC            cgpt/cgpt_create.o

        CC            cgpt/cgpt_add.o

        CC            cgpt/cgpt_boot.o

        CC            cgpt/cgpt_show.o

        CC            cgpt/cgpt_repair.o

        CC            cgpt/cgpt_prioritize.o

        CC            cgpt/cgpt_common.o

        CC            cgpt/flash_ts_drv.o

        CC            firmware/lib/flash_ts.o

        CC            host/arch/arm/lib/crossystem_arch.o

        CC            host/lib/crossystem.o

        CC            host/lib/file_keys.o

        CC            host/lib/fmap.o

        CC            host/lib/host_common.o

        CC            host/lib/host_key.o

        CC            host/lib/host_keyblock.o

        CC            host/lib/host_misc.o

        CC            host/lib/host_signature.o

        CC            host/lib/signature_digest.o

        CC            utility/dump_kernel_config_lib.o

        CC            cgpt/cgpt.o

        CC            cgpt/cgpt_find.o

        CC            cgpt/cgpt_legacy.o

        CC            cgpt/cmd_add.o

        CC            cgpt/cmd_boot.o

        CC            cgpt/cmd_create.o

        CC            cgpt/cmd_find.o

        CC            cgpt/cmd_legacy.o

        CC            cgpt/cmd_prioritize.o

        CC            cgpt/cmd_repair.o

        CC            cgpt/cmd_show.o

        CC            utility/crossystem.o

        CXX          utility/gbb_utility.o

        CC            utility/dev_sign_file.o

        CC            utility/dump_kernel_config.o

        CC            utility/dumpRSAPublicKey.o

        CC            utility/tpm_init_temp_fix.o

        CC            utility/tpmc.o

        CC            utility/vbutil_firmware.o

        CC            utility/vbutil_kernel.o

        CC            utility/vbutil_key.o

        CC            utility/vbutil_keyblock.o

        CC            utility/bmpblk_font.o

        CC            utility/image_types.o

        CXX          utility/bmpblk_utility.o

        CC            utility/bmpblk_util.o

        CC-for-lib    utility/eficompress_for_lib.o

        CC-for-lib    utility/efidecompress_for_lib.o

        CC            utility/eficompress.o

        CC            utility/efidecompress.o

        CC            utility/load_kernel_test.o

        CC            utility/pad_digest_utility.o

        CC            utility/signature_digest_utility.o

        CC            utility/verify_data.o

        CC            futility/futility.o

        CC            futility/cmd_dump_fmap.o

        CC            futility/cmd_foo.o

        CC            futility/cmd_hey.o

        CC            tests/cgptlib_test.o

        CC            tests/test_common.o

        CC            tests/timer_utils.o

        CC            tests/crc32_test.o

        CC            tests/rollback_index2_tests.o

    utility/bmpblk_utility.cc: In member function ‘void vboot_reference::BmpBlockUtil::load_yaml_config(const char*)’:

    utility/bmpblk_utility.cc:104:61: error: format ‘%ld’ expects argument of type ‘long int’, but argument 2 has type ‘std::vector<std::basic_string<char> >::size_type {aka unsigned int}’ [-Werror=format]

    utility/bmpblk_utility.cc:108:59: error: format ‘%ld’ expects argument of type ‘long int’, but argument 2 has type ‘std::map<std::basic_string<char>, vboot_reference::ImageConfig>::size_type {aka unsigned int}’ [-Werror=format]

    utility/bmpblk_utility.cc:119:61: error: format ‘%ld’ expects argument of type ‘long int’, but argument 2 has type ‘std::map<std::basic_string<char>, vboot_reference::ScreenConfig>::size_type {aka unsigned int}’ [-Werror=format]

    utility/bmpblk_utility.cc: In member function ‘void vboot_reference::BmpBlockUtil::pack_bmpblock()’:

    utility/bmpblk_utility.cc:597:70: error: format ‘%ld’ expects argument of type ‘long int’, but argument 3 has type ‘std::basic_string<char>::size_type {aka unsigned int}’ [-Werror=format]

    utility/bmpblk_utility.cc:609:59: error: format ‘%ld’ expects argument of type ‘long int’, but argument 3 has type ‘std::basic_string<char>::size_type {aka unsigned int}’ [-Werror=format]

        CC-for-test  firmware/lib/rollback_index_for_test.o

        CC            tests/rollback_index3_tests.o

    cc1plus: all warnings being treated as errors

    make: *** [/tmp/mali_chromebook-setup_004/vboot/build/utility/bmpblk_utility.o] Error 1

    make: *** Waiting for unfinished jobs....


  • I'm not aware of this issue, at least not with the default toolchain used in the script and Ubuntu 12.04 or 14.04  Which toolchain and Linux distribution are you using?

    Also, it looks like this wasn't the first time you'd run the do_everything command.  Do you get this error from a clean set-up directory?

    Best regards,

    Guillaume

  • Great job on this little script.

    Just ran through from a Fedora 20 host machine. It's become (seemingly) impossible to get your hands on a static library for libuuid ( wine and mingw provide it according to yum, but they were incompatible when I tried to use them ). If you get to the build_vboot stage and you get an error

    ld: cannot find -luuid

    You can edit the vboot/Makefile and remove the -static flag from the cgpt target.

  • Handy guide - works fine for me, but yeah, this definitely requires an Ubuntu setup to get going.  I first tried doing this from my 64 bit Arch system and didn't get very far (claimed one of the .o files was missing).  Definitely seems not all compilers are equal.


    Personally, I'd prefer to install to the internal storage, but I couldn't find a way to get the shell script to use mmcblk0 (while booting ubuntu from a separate SD card).  I tried cloning another copy of the SD card to the internal storage but that didn't work either.


    For now, I managed to meet half-way, where /opt /var and /usr are located on the internal storage and are symlinked to the SD card, which the system otherwise boots from.  Not ideal, but at least it works.  I was able to successfully get Arch Linux to run solely from the internal storage, but the lack of maintenance doesn't make it so useful.



    Also I was wondering - is there a way to enable Global Task Scheduling?  Right now, lscpu says 4 cores are disabled (which I hope means it's using the Internal Kernel Switcher, rather than 4 cores being inaccessible altogether).

  • These instructions don't cover booting from the internal device storage, but generally speaking the rootfs device is hard-coded in the bootloader.  This is done by the cmd_build_vboot function which takes the rootfs device as an argument.  So in principle this should work, if you go through the manual steps (I haven't tested it and the mmcblk device name may need to be adjusted depending on how you formatted the internal storage):

    ./chromebook-setup.sh build_vboot /dev/mmcblk0p1

    Regarding the 4 CPU issue, which I guess you're seeing on a Chromebook 2 (XE503C12 or XE503C32), then I'm not sure what the issue is.  I'll try to reproduce it and post another message.

    Guillaume

  • Thanks for the reply.  I tried running the chromebook-setup.sh and it failed somewhere along the way, but, I also managed to successfully mount /var, /usr, and /opt to the eMMC while leaving everything else on the SD card (which I'm ok with).  Doing this allows me to tweak files in /etc if things go sour, or I can grab any personal data from my home folder if there is a hardware failure.  Putting all non-system applications on the internal storage also greatly improves performance.

    On another note - any suggestions on upgrading to Ubuntu 15.04?  Every time I try upgrading to that it goes horribly wrong.  I'm guessing this is largely because of the transition from upstart to systemd, but I wonder if maybe there's some conflict with the mali drivers, or maybe something like xorg server?

  • In case anybody else this this: my Ubuntu host system recognizes the SD card as /dev/mmcblk0 instead of /dev/sdX. This is fine to pass as the storage argument, but the script uses the variable $CB_SETUP_STORAGE and appends the partition numbers directly to the variable. For mmcblk0 the partition numbers are mmcblk0p2 and only a 2 is appended which results in a failure. I was able to modify the script and add the "p" before the places a 0 or 2 was appended to $CB_SETUP_STORAGE and the script works as expected.

  • As what i can notice the SD card are always recognised by linux as ide storage due certainly of the speed access, /dev/mmcblk are for the nand or emmc memory

  • The instructions call for a USB-Ethernet adapter, but I didn't have one. Instead, I was able to use the built-in wifi on the Chromebook 1.

    The Marvell mwifiex driver was already compiled and loaded as a module. The hardest part was to find the firmware. Without it an error about missing firmware will happen in the boot log.

    I found the firmware at:

    git.marvell.com - mwifiex-firmware.git/tree - mrvl/

    I downloaded sd8797_uapsta.bin and copied it to /lib/firmware/mrvl/sd8797_uapsta.bin  and the wifi works -- the device is mlan0

    To connect I used:

    $ sudo iwconfig mlan0 essid "network ESSID"

    $ sudo dhclient mlan0

    There is also a key argument for iwconfig to enter a password if needed and iwlist can be used to scan for access points.

  • Another option is to use USB tethering with an Android phone, then on the chromebook as root dhclient usb0.  install.sh works fine.

    I believe but am not 100% sure the phone will bridge wifi by default, if you're worried you can turn off mobile data using airplane mode (and then re-enable wifi)

  • Hello,

    First of all thank you for the great article.

    I was trying for a while to create a linux-based ARM development station using my chromebook XE503C32.

    The idea behind is to run GUI desktop, eclipse CDT and develop software to seamlessly (no cross-compiling) distribute on other Arm v7 systems, like Raspberry Pi.

    My biggest hope was that I could use SDL2 -> OpenGLES -> Mali GPU for graphics development.

    I tried the solution described in this article and I had no luck with installing a desktop environment.

    I tried three - Unity, lxde and xfce.

    Unity just keeped crashing and never let me log in, xfce was unstable - crashed several times, and even when it allowed me to log in the screen was flickering terribly.

    lxde would show error after error with menus, panels and other ui elements disappearing.

    Let alone smaller problems, that wifi modem never worked for me etc.

    I found another solution that has only one problem.

    https://www.offensive-security.com/kali-linux-arm-images/

    Their Chromebook image is near perfect, it has working xfce, supports wifi and HDMI, and everything works very smoothly.

    I was able to get Eclipse 3.8 CDT using apt-get and it ran just fine.

    One problem is that when I tried to run one of my applications (just drawing a background image) the FPS was around 1.

    There is no OpenGLES, and apparently graphics acceleration is not supported out of the box.

    I wish there existed a set of instructions that would address the problem of installing just the Mali drivers on existing system.

    I also have several questions:

    1) http://malideveloper.arm.com/ tells about at least two drivers - kernel level and user level.

    Also they provide

    Open Source Mali Midgard GPU Kernel Drivers

    As far as I understand "armsoc DDX" is the kernel-level driver

    ./install-x11.sh script gets it from git://git.linaro.org/arm/xorg/driver/xf86-video-armsoc.git

    What is the difference between the drivers malideveloper.arm.com provides and the one you use?

    How about compatibility with user-level drivers of different versions?

    2) User space driver comes from ARM Mali Midgard GPU User Space Drivers - Mali Developer Center

    However the archive only contains *.so files.

    What is the right way to install OpenGLES header files to use it for development (e.g. build SDL against it) ?

    3) Numerous tutorials say that there should be mali kernel module in the system.

    e.g. Mali GPU driver - Device drivers(GPU&VPU) - OrangePi - Mobile - Powered by Discuz!

    Which means /etc/modules should contain mali, some *.ko files should be installed, and perhaps modprobe and lsmod should show mali as an existing module.

    However after I followed the installation instructions you provide there is no such module.

    Could you please explain why (is the name different?)

    4) Overall it's not exactly clear how to predictably diagnose the success of Mali driver installation.

    I mean to me it's pretty clear that if my chromebook gives lower FPS than my raspberry pi, there is a problem.

    But I would greatly appreciate any advice on how to quickly diagnose the drivers state, working or not, if it's possible.

    5) Kali linux image for samsung chromebook seems to be almost perfect except for Mali drivers.

    I wish I could turn my chromebook into a predecessor of what Linus Torvalds envisions as ARM development machine.

    Linus Torvalds wants to see a Linux-based ARM laptop | ZDNet

    And Kali linux gives the right setup out of the box, except for it doesn't work for graphical-intensive applications because apparently Mali drivers are not there.

    One thing that's missing is how to make this GPU work properly and be supported.

    You have provided a lot of information in the article, but it's still not enough to put everything together for a person who is not a kernel-level developer, like myself.

    Could you please share more details on how exactly to add Mali drivers and make them work properly to this Kali image or any other image, and how to diagnose.

    As of now it seems like all the components are out there, but there are no instructions how to put it together or make sure it works.

    Enabling this on chromebook would save so much of my time (no more cross-compilation for my RaspberryPi hobby project development), and perhaps help a lot of other people turn their chromebook into a full-scale development station.

    I only hope you would agree to help and make this happen.

    I would appreciate your help so greatly.

    Thank you very much once again.

  • Nice job, first of all. Ubuntu 14.04 installation goes flawlessly, and so does Lubuntu, to turn the system into user-ready (nearly) solution. Just a few more tricks are needed to make nearly everything work.

    Now, as Ubuntu 16.04.1 for armhf was released a few days ago, I tried to upgrade to it - and did it mostly successfully. Nevertheless, Guillaume, will there be a next season in these series, for professionally done 16.04 ?

    Moreover, I finally installed Mate (1.12) from Ubuntu repository. It was not ported completely until 16.04, and that was my final goal. I could share my end-user experince, but probably it will be too long for this thread.

  • Nice script. Exactly what I have been looking for.

    Install script runs and completes fine. When placing microSD card into Chromebook, hitting ctrl-u, it goes about 2 seconds into the boot process but hangs on Waiting for device /dev/sd?

    Anybody else come up against this issue? Any remedies?

  • Thanks for all the work that went into this script.  Unfortunately, I can't get the script to work properly (I have a ubuntu 14.04).  I made minor tweaks to the script for the correct download path for the Ubuntu download and got that working properly but now I am getting stuck downloading the linaro toolchain.  The path and URL is correct but cURL isn't downloading the file.  Any ideas?  Thanks again.