ARM Chromebook/nv u-boot

From Linux Exynos
Jump to: navigation, search

Chromebooks are originally designed to only run verified versions of U-Boot as that tends to be somewhat more secure. Fortunately, it is possible to chain into a non-verified version of U-Boot. This can be done by switching to developer mode, downloading or building a non-verified version of U-Boot, writing it to a ChromeOS kernel partition and setting a boot priority (i.e. marking it as bootable).

TODO: simplefb is typically no longer required, and this guide needs updating to reflect that mainline u-boot master now has support for at least Samsung Chromebook XE303C12

Status

At the moment, the following nv u-boot images are available:

Recent mainline Linux kernels do not need simplefb and instead have a working KMS driver. So you typically want a u-boot without simplefb.

Unfortunately, it is required to follow the build instructions using a Chromium OS chroot, as it is not yet possible to build u-boot in a more conventional manner for the ARM Chromebook.

Partitioning

The U-Boot environment that we will be using assumes the following lay-out:

  • 1st partition: kernel partition with nv u-boot.
  • 2nd partition: boot partition (must be formatted as FAT32 or Ext2).
  • 3rd partition: root partition.

In order to set up the partition lay-out the use of gdisk is encouraged:

gdisk /dev/mmcblk1

Set the sector size to 8192 bytes:

x<enter>
l<enter>
8192<enter>
m<enter>

Create an empty partition table:

o<enter>
y<enter>

Create the ChromeOS kernel partition (partition type is 7f00):

n<enter>
1<enter>
<enter>
+16M<enter>
7f00<enter> # The ChromeOS kernel partition type.

Create the boot partition:

n<enter>
2<enter>
<enter>
+64M<enter>
<enter>

Create the root partition:

n<enter>
3<enter>
<enter>
<enter>
<enter>

Set the partition labels:

c<enter>
1<enter>
nv u-boot<enter>
c<enter>
2<enter>
bootfs<enter>
c<enter>
3<enter>
rootfs<enter>

Then write the results to the disk by pressing w. Now that the partition table has been written, the second and third partition can be formatted:

mkfs.ext2 /dev/mmcblk1p3
mkfs.ext4 /dev/mmcblk1p4

Finally, you'll want to install a root filesystem onto the third partition.

Installing U-boot

If you just want to use the ChromeOS kernel, then using U-Boot without simple FB is fine. You can download it from Google's mirror:

wget -O - http://commondatastorage.googleapis.com/chromeos-localmirror/distfiles/nv_uboot-snow.kpart.bz2 | bunzip2 > nv_uboot.kpart

For the purpose of running the mainline Linux kernel, it is encouraged to use nv u-boot with support for simple FB, so that the kernel is capable of using the framebuffer that was originally in use by U-Boot. You can also download it from Google's mirror:

wget -O - http://commondatastorage.googleapis.com/chromeos-localmirror/distfiles/nv_uboot-snow-simplefb.kpart.bz2 | bunzip2 > nv_uboot.kpart

After you have downloaded the nv u-boot image, you can write it to the ChromeOS kernel partition, and set the boot priority:

dd if=nv_uboot.kpart of=/dev/mmcblk1p1
cgpt add -i 1 -S 1 -T 5 -P 10 /dev/mmcblk1

After you have installed U-Boot, you can proceed with tweaking U-Boot's environment variables.