Install Fedora 17 on Samsung Chromebook Series 3 (ARM)

Following up a previous post on how to install Ubuntu on the new Chromebook, here is another shameless copy paste from Christopher Hewitt‘s Google Plus stream. He was kind enough to explain the process to install Fedora on Chromebook for chromestory.

How To Install Fedora 17 on Samsung Chromebook Series 3 (ARM)

The following is a process for installing Fedora 17 with Xfce on a Samsung Chromebook. Many of the steps below were explained by+Olof Johansson, a Google developer, and have been repeated here for clarity.

chromebook  Install Fedora 17 on Samsung Chromebook Series 3 (ARM)

Prepare a reasonably-sized SD card. A 4GB SanDisk Ultra was used to test this procedure.

Also download the “HFP XFCE image” from https://fedoraproject.org/wiki/Architectures/ARM
This is a Fedora 17 root filesystem designed for ARM platforms.

From Olof:
“Get an SD card, insert it in a reader on your Ubuntu PC (mine was a 16GB card that ended up at /dev/sdd on the PC, so the below reflects that):

First, the SD card needs a GPT partition table. I’m lazy and mixed tools here to make it easy for myself. First, I created the blank partition table in parted:

# sudo parted /dev/sdd
(parted) mktable gpt
(parted) quit

Then edit it with gdisk (apt-get install gdisk), since the syntax is close to what I am used with regular cfdisk. The first part sets the sector alignment to 4M based on the recommendation from Arnd in the comments below:

sudo gdisk /dev/sdd
x
l
8192
m

n
1
<enter>
+16M
7f00    (ChromeOS kernel)

n
2
<enter>
+16M
7f00

n
3
<enter>
<enter>
<enter>

This creates three partitions; two kernel ones and one for the root filesystem. I wanted two kernel partitions to make it easier to tinker with the kernel and have a fallback to a known-good kernel in case the one being tested fails.

Then, create a filesystem on the root partition:

sudo mkfs.ext4 /dev/sdd3

Once the filesystem is created, it needs to be mounted somewhere and the Fedora 17 filesystem extracted to it.
sudo mount /dev/sdd3 /mnt
sudo tar Jxvf ~/Downloads/Fedora-17-armhfp-xfce.tar.xz -C /mnt

Don’t forget to unmount the filesystem when you are finished.
sudo umount /mnt

Now enable developer mode on the Chromebook, if it is not already, as it seems to be required for the rest of the procedure. This is accomplished through booting into recovery mode first by holding both the escape and refresh keys on the keyboard and then striking the power key. While in recovery mode, you can safely ignore any messages indicating the installation is broken. Press Ctrl+D while in recovery mode to enable developer mode. The prompt will ask for permission to clear all local data from the system before removing OS verification. It is an automatic process that takes about ten minutes. Once it is finished there is a message indicating that OS verification is disabled. This message will now appear at every boot time to indicate your system is in developer mode. Press Ctrl+D to continue booting ChromeOS.

Once logged in and have the SD card inserted, press Ctrl+Alt+T to open a crosh prompt.
Subsequently executing “shell” grants the familiar bash shell. From here run “sudo -s” to switch to root user as the following steps require root access.

From Olof:
“Now the only remaining piece is to put an actual kernel on the kernel
partitions of the SD card.

This is something I did on my Chromebook system directly. Be VERY careful here, mmcblk1 and mmcblk0 are very easy to mistype, and you won’t like the results from doing it (I nuked my stateful partition by mistake once when I went through this because I dd:d a kernel to mmcblk0p1 instead of mmcblk1p1).

The kernel command line is going to be different from what you use for
Chrome OS, so you’ll need to repack the kernel blob manually first. This
is what I did:

cd /tmp
echo “console=tty1 debug verbose root=/dev/mmcblk1p3 rootwait rw” > /tmp/config
vbutil_kernel –pack /tmp/newkern –keyblock /usr/share/vboot/devkeys/kernel.keyblock –version 1 –signprivate /usr/share/vboot/devkeys/kernel_data_key.vbprivk –config=/tmp/config –vmlinuz /boot/vmlinuz-3.4.0 –arch arm

Then I moved the SD card to the Chromebook, and wrote out the kernel:

dd if=/tmp/newkern of=/dev/mmcblk1p1
dd if=/tmp/newkern of=/dev/mmcblk1p2

Now, enable boot from “USB” (which includes SD card on these systems):
crossystem dev_boot_usb=1

Final step is to mark the partitions on the SD card as known good so
that the firmware will try to boot them:

cgpt add -i 1 -S 1 -T 5 -P 10 -l KERN-A /dev/mmcblk1
cgpt add -i 2 -S 1 -T 5 -P 5 -l KERN-B /dev/mmcblk1

I.e. mark both as successful, first partition as priority 10, second
as priority 5. I don’t think tries are technically needed here since
the partition is already marked as successful, but I included it by
habit. Same with the label names, they shouldn’t be needed.”

Also copy over the modules and firmware to the root filesystem that was added to the card earlier. The filesystem on the SD card used in this procedure automatically mounted as /media/removable/External\ Drive\ 2/. It might be different. Check with the ‘mount’ command if not sure.
cp -rf /lib/modules/* /media/removable/External\ Drive\ 2/lib/modules/
cp -rf /lib/firmware/* /media/removable/External\ Drive\ 2/lib/modules/

There were also a couple things that needed to be fixed before it was possible to log in to the new Fedora 17 system.

First remount the filesystem with some extra permissions.
mount -o remount,suid,exec /media/removable/External\ Drive\ 2/

Run a shell on the new filesystem.
chroot /media/removable/External\ Drive\ 2/

Give root a password.
passwd

Give guest a home directory and proper group.
mkdir /home/guest
rsync -a /etc/skel/ /home/guest
chown -R guest:users /home/guest
usermod -d /home/guest -g users guest

Exit the chroot environment and unmount filesystem.
exit
umount /media/removable/External\ Drive\ 2/

Now reboot the Chromebook. Instead of pressing Ctrl+D, press Ctrl+U to boot from the SD card. If all went well, the Fedora 17 boot process should stream down the screen. Thanks, Olof and Fedora ARM team!

Hope you got it working!

Comments on this entry are closed.