Installing Manjaro on an ARM Chromebook

by Craig Miller

Traffic
Running Native Linux on a Chromebook

I like Chromebooks. You can get them in small form factors for not a lot of money. However, I grow weary of Google knowing my every move, and that ChromeOS updates usually break some functionality that I use on a daily basis (IPv6, sshfs, Linux Containers, etc).

For some time I have been interested in dumping ChromeOS and putting a native Linux distro on my ARM-based Asus C101PA Chromebook. However, although there is pretty good Linux support for x86-based Chromebooks, ARM-based units have lagged behind considerably.

Linux Distros for ARM-based Chromebooks

This is changing and there are at least 3 choices for running native Linux on your ARM-based Chromebook

All of the above use the native ChromeOS bootloader (coreboot), which requires putting the laptop into Dev Mode (make a backup of your data first, as this will wipe everything on the laptop). Once in Dev Mode one must enable USB boot with the following command:

sudo su
crossystem dev_boot_usb=1 dev_boot_signed_only=0

Yet another distro

Continuing my search, I ran across Manjaro which has good ARM support for many ARM devices, including Raspberry Pi, Odroid C2, and Pinebook. Unfortunately, there is no support for Chromebooks. And images downloaded from the manjaro.org website won't boot on a Chromebook.

Linux Basics

Fortunately, Linux, like its Unix ancestors implements the concept of Kernel space and User space. This provides some level of independence between the kernel and applications.

Kernel & User Space

We can take advantage of this separation of kernel and user spaces by creating a Frankenstein, using the Arch Linux kernel (and modules) and the Manjaro user space applications, including X11, xfce4 desktop, etc.

While it is possible to run a 64 bit kernel and 32 bit apps, we are going to keep things simple and use a 64 bit kernel, and 64 bit userspace apps. In the ARM world this is called aarch64

Creating a Linux Frankenstein

The easiest method of creating this Frankenstein is to use two SD cards1. You can do this on any linux machine (even non-ARM ones).

  1. Follow the ARM Linux well documented steps to create the first SD Card, which we'll label ARCH Linux.
    1. Skip mount /dev/sda2 root in Step 10, and extract to /tmp/root
  2. Download the Manjaro ARM xfce4 image

With the Manjaro image downloaded we need to extract the user space partition info, and copy it to the Arch Linux user space partition.

Use a tool like Etcher to burn this image to a second SD card, which we'll label Manjaro.

Copying user space

Now find a linux machine which can mount two SD cards (I used a USB SD Card reader for one SD Card). We'll be copying the second partition of the Manjaro SD Card to the second partition of the Arch Linux SD card.

Assume the following (your mount points will be different):

Now become root and do the copy, which will take some time. Note the period at the end of the cp line, it is the destination, which is the current directory. The -pr options mean preserve ownership and re-curse directories.

sudo su
cd /media/craig/arch
cp -pr /media/craig/manjaro/* .

Copy the kernel modules & firmware

Since the kernel partition of the Arch Linux SD card only has the kernel, we need to copy the kernel modules, and wifi card firmware from the Arch Linux user space to the Manjaro user space SD card.

First the kernel modules. On my Arch Linux it was using a 4.4.193-1 kernel. Therefore the modules can be found in /lib/modules/4.4.193-1/ or since this was extracted to /tmp/root the modules will be in /tmp/root//lib/modules/4.4.193-1/

As root

cd /media/craig/manjaro/lib/modules
mkdir 4.4.193-1
cp -pr /tmp/root//lib/modules/4.4.193-1/ 4.4.193-1/

Next the Wifi firmware. Again we'll turn to /tmp/root for the source. You may have to download the firmware directly from archlinuxarm.org or get an older version from NXP

As root

cd /media/craig/manjaro/lib/firmware
mkdir mrvl
cp -pr /tmp/root//lib/firmware/mrvl/* mrvl/

Ready to Boot in the Chromebook

Now it is time to boot the Arch Linux SD Card in the Asus C101PA Chromebook. Put the SD card in the Chromebook and press the power button. When the white boot screen comes up, press Ctrl+U to boot from the SD card.

With any luck, you will see the text-only screen come up, and lots of systemd messages, and then it will go black (be patient), and then the xfce desktop will appear (continue to be patient), and the Manjaro ARM Linux Setup Program will come up and let you create a user, password, locale, and other things, then offer to reboot, go ahead and do so.

Manjaro Setup Program

Initially, the distro has a oem account, once the Manjaro ARM Linux Setup has run, it will delete the oem account, creating your user account, as well as setting all the other parameters you set (location, keyboard, etc). This is a nice way to deal with the default password problem. Since there is no default password.

Problems?

You may run into an issue with systemd in the initial boot. There was an error message:

systemd-fstab-generator[403]: Failed to create unit file /run/systemd/generator/boot.mount, as it already exists. Duplicate entry in /etc/fstab?

After a minute and a half, systemd will allow you to fix this, by offering to go into maintenance mode. The fix is to delete the existing /etc/fstab. In maintenance mode:

rm -rf /etc/fstab

Press ^D to exit maintenance mode. This is counter intuitive, as many things in systemd are. However, systemd wants to manage your fstab, and having a real one messes it up. Once you surrender to the systemd way, the boot up should work normally.

What works and what doesn't

The good news is that most things work in this Frankenstein setup. Here's a list of items that do work:

What doesn't work. There may be ways to get the rest working, but I haven't succeeded yet.

There are other items which I haven't checked such as the external HDMI (via a USB-C dongle), and such, but amazingly it works well enough to be useful.

Conclusion

My motivation to putting native Linux on my Chromebook was to disconnect from Google, and get better stability from the OS. By merging the Arch Linux kernel (and modules) and the Manjaro User Interface, I have achieved that.

Manjaro Running

Best of all, I am running off of an SD Card, which means if I want to go back to ChromeOS, I just reboot (and don't press ^U). At some point I may move the installation over to the internal storage, which will only make it run faster. But for now, I am enjoying running native Linux on my ARM-based Chromebook.


1) It is possible to mount the images via -o loop, however that is advanced, since one must figure out offsets, and such. If you know how to do loop mounts, go for it.

14 June 2022

Chromebook Photo by Asus