pixelc-linux / documentation

Documentation on how to get everything to work and entry point for new users.
MIT License
82 stars 2 forks source link
c dragon google linux nvidia pixel pixel-c ryu smaug tegra tegra210

Linux on Google Pixel C (2015)

Void Linux on Pixel C

The Pixel C is an Android based tablet released by Google in 2015. Originally intended to be a Chrome OS device, Google went with Android in the end which greatly reduced the usefulness of the device.

We weren't satisfied with this situation and even though Google has since dropped the device, the hardware is still very good today and thus we've created this project to make it into a legitimate productivity device.

Hardware

The specifications of the Pixel C are as follows:

Distribution status

It should be fairly easy to get any distribution to work, and infrastructure to provide premade platformfs tarballs for supported distributions is being worked on.

As of currently, the following distributions are confirmed working:

Arch Linux Arm

Maintained by @denvit.

Void Linux aarch64 (glibc or musl)

Current status: Maintainer inactive

Maintained by @q66.

Hardware support status

CURRENT RELEASE: 4.18-rc4

We have kernel branches for the latest release candidate (or stable when no RC is currently released) as well as the linux-next repository, all supplied with custom patches for the device as well as backported patches from other sources. If you want "latest and greatest" support, you will need to use our next branch, which may also happen to be more unstable than the others; otherwise, the current primary release candidate branch should be relatively stable, but might have various things missing.

What is working?

What is broken?

Software notes

If you're porting a distribution or setting up a rootfs, there are some things to keep in mind.

Mesa

You need Mesa 18.1.1 at minimum. 18.1.0 lacks certain patches needed for proper function under a recent kernel and Xorg; they were introduced later and are currently present in git as well as in the latest release.

When building, you need at least the following options for configure:

--with-gallium-drivers=tegra,nouveau

The tegra driver is for scanout and nouveau is for the GPU, both need to be enabled. It's also good to build a software rasterizer (swrast) as a fallback.

Installation

Prerequisites

Good to have

Preparations

All the necessary tooling repositories are linked into this repository as submodules.

Additionally, you will likely probably want these:

The latter two are used to create fastboot compatible boot images and sign them. They can frequently be installed from Linux distribution repos, but if your distro doesn't have those, you can use ours; ours are also patched to work on FreeBSD.

A Linux installation for your Pixel C consists of the following steps:

Root FS preparation

You can download prebuilt root filesystem tarballs from us. Alternatively, you can make your own rootfs tarball; we provide the pixelc-rootfs-scripts to make it easier and it can be run on either x86/x86_64/etc hardware or native aarch64 hardware. In the former case, the scripts will automatically set up emulation.

We support a specific set of distributions in those scripts. It is always possible to write support for new distros, so if you want to contribute any, it would be much appreciated. The instructions on how to do so can be found in the actual repository.

Of course, it is possible to use any rootfs for 64-bit ARM. However, these will probably not have the appropriate software stack you will need and they will also lack stuff like patched up to date Mesa for proper X11 function and 3D acceleration, and you might have to connect a USB keyboard.

A root filesystem for the Pixel C should have at least the following:

Everything else is up to you.

Kernel image preparation

You can download signed boot images from us which are ready for flashing, as well as individual parts like unsigned boot images, individual kernels and ramdisks.

You can also easily build your own. We provide a set of scripts to aid all the steps described below. The general procedure is as follows:

Host operating systems

While most users are expected to be running Linux on their host computer, we also support FreeBSD.

If you use FreeBSD and want system specific instructions on how to get your environment ready for the rest, please refer to our pixelc-freebsd-scripts repository.

If you get another host operating system to work for this, we'll be glad to incorporate it here as well, so report any success you have with that.

Kernel build, image generation, signing

If you're building your own kernel, please refer to the pixelc-kernel-scripts repository, which contains all the necessary tools as well as detailed steps on everything.

Alternatively, download a prebuilt image.

Initramfs generation

The tools and detailed instructions are in the pixelc-mkinitramfs.sh repo.

Alternatively, download a prebuilt initramfs.

Root FS setup on the device

This is the Pixel C user partition table:

Device Label Size Mount Point Description Can be installed here?
mmcblk0p1 KERN-A 33.55 MB Kernel part A
mmcblk0p2 KERN-B 33.55 MB Kernel part B
mmcblk0p3 recovery 33.55 MB Recovery
mmcblk0p4 APP 3.76 GB /system System Partition ✔️
mmcblk0p5 VNR 318.76 MB /vendor Vendor Partition
mmcblk0p6 CAC 150.99 MB /cache Cache Partition
mmcblk0p7 UDA 57.82 GB /data Data Partition ✔️
mmcblk0p8 MD1 67.11 MB Metadata
mmcblk0p9 LNX 33.55 MB Linux ?
mmcblk0p10 MSC 4.19 MB Misc
mmcblk0p11 PST 0.52 MB Persistent

There is also mmcblk0boot0 and mmcblk0boot1 where the bootloader resides. You cannot alter those.

Generally, two locations can be chosen for your root filesystem:

Android by default encrypts /data, so you will need to unencrypt the partition from TWRP if you wish to make use of it. There is currently no support for mounting Android-encrypted /data from either ramdisk or the running system. Keep in mind that removing encryption from it will wipe all your user data.

If you boot back into Android with unencrypted /data, it will attempt to reencrypt the partition by default. It has been suggested that by modifying Android's fstab, you can disable that.

There is a third way that will be supported in the future:

Any "dual-booting" approach will need a custom initramfs which is currently not supported. One obstacle is getting the system to boot at all that way; another is getting it to work with Android without using fastboot to boot every time.

The recommended way to install is to wipe your Android setup and use /data for your root file system; then you can repurpose /system for something else, such as swap space or additional storage. It is not recommended to try to mess with the partition table to merge the partitions.

Device preparation

First, you will need to boot into TWRP.

If you have chosen to use /data, you will need to go to the Wipe menu and tap Format Data to unencrypt the partition and prepare a clean filesystem on it.

Mount /data from TWRP, and /system as well if you're installing there. Download a BusyBox static binary for ARM from any source; the one in TWRP apparently has a broken tar. Mount /cache from TWRP.

Then on your host system:

This will switch you to a shell on the device.

If you install on /data:

If you install on /system:

If you install in a sparse image on /data:

You can also use a non-sparse file or a sparse file generated by dd from /dev/zero for non-sparse or with seek for sparse image.

If your rootfs is ready, this is all you need to do; if you need to do any changes in it, you can bind-mount /proc, /dev and /sys and chroot inside it from TWRP, but keep in mind that you won't have any network access.

Reboot using adb reboot bootloader and switch to fastboot mode.

Kernel flash

You have multiple choices here. With the device in fastboot mode:

1) You can use a raw Image.fit (u-boot image) plus a ramdisk to boot directly without flashing.

Persistent flashing only works with signed images.

Booting

If you've done everything, your chosen distribution should show up on the device and you can proceed with post-installation setup.

Configuration

Bluetooth

Keyboard

Assuming E8:88:57:D5:E8:96 is the bluetooth address of your keyboard:

  1. Start the bluetoothctl CLI
  2. Power on the adapter: power on
  3. Set the default agent: default-agent
  4. Enable scan mode: scan on
  5. When [NEW] Device E8:88:57:D5:E8:96 Pixel C Keyboard you're ready to connect to your Pixel C Keyboard
  6. You can connect to the keyboard: pair E8:88:57:D5:E8:96
  7. You'll see a code on your screen (e:g: [agent] Passkey: 032578): put this code on your keyboard and press ENTER.
  8. If you did everything as instructed you should be able to see Pairing successful on your screen, meaning that the keyboard can now be used with your tablet.
Keyboard Layout

Arch Linux Wiki Reference

To edit the keyboard layout you'll need to use your DM settings, or add a file in /etc/X11/xorg.conf.d/00-keyboard.conf with the following content:

Section "InputClass"
        Identifier "system-keyboard"
        MatchIsKeyboard "on"
        Option "XkbLayout" "cz,us"
        Option "XkbModel" "pc104"
        Option "XkbVariant" ",dvorak"
        Option "XkbOptions" "grp:alt_shift_toggle"
EndSection

where XkbLayout is your keyboard layout, XKbModel ist the keyboard model and XkbVariant is the keyboard variant.

More information is available here.

Further reading

You can check out the Wiki of this repository, which will gradually be adding more and more resources. There are also some others:

Contributors

Currently active contributors are:

Inactive:

Contributions in all areas are welcome, even if you don't own a Pixel C - any relevant information or code is welcome.