Pinebook Pro kernel compilation

I am a new, proud owner of a Pinebook Pro. The default OS (Debian stretch) comes with a kernel 4.4.190 (updates to 4.4.196). As there is no IO accounting support in the original kernel, also no btrfs support, I set out to compile a custom kernel on the pinebook pro plus booting it safely.

You will need:

  • a Pinebook Pro
  • an SD Card (at least 8GB)
  • patience

DISCLAIMER

These instructions are potentially able to brick your device. There are (somewhat painful) ways to get back from a bricked Pinebook Pro (using the RockChip Flash Tool or the UART console). So, if you never compiled a kernel and actually gotten to start it, you might want to refrain from following this guide.

Setting up the SD card

First, I acquired the original Debian image here: https://github.com/mrfixit2001/debian_desktop/releases/download/190905/pinebookpro-debian-desktop-mrfixit-190905.img.xz.

This needs to be decompressed and „flashed“ to your SD card (careful!). Be sure to use the right device, otherwise you might end up bricking your Pinebook Pro…

xz -d pinebookpro-debian-desktop-mrfixit-190905.img.xz

sudo dd if=pinebookpro-debian-desktop-mrfixit-190905.img of=/dev/mmcblk0
sync

Eject and insert the SD card.

sudo mount /dev/mmcblk0p1 /mnt/
nano /mnt/extlinux/extlinux.conf

Make sure it says
root=/dev/mmcblk1p2
in line #8 – this will load the kernel from SD, but set the root to your EMMC (interal) drive.

Reboot and make sure your device boots up normally. If you already did the update before, you will see that your kernel version now („uname -a“) should be 4.4.190 instead of the updated 4.4.196 on your internal drive.

Setting up the build environment

For this, we will use Debian „Buster“ on your pinebook pro. How? By using snap & lxd!

sudo apt install snapd
sudo snap install lxd
sudo /snap/bin/lxd init

Accept all defaults BUT for the storage pool – set up a new pool with storage backend „dir“.

Once that’s done, set up a new Debian Buster container:

sudo /snap/bin/lxc launch images:debian/buster myvm

Depending on your internet connection, this takes a while. Once that’s done, we’re ready to use the container:

sudo /snap/bin/lxc exec myvm /bin/bash

Now you’re in a shell in your container. First, you want to install some packages:

apt-get install crossbuild-essential-arm64 libncurses-dev git bc ccache nano

The kernel is an aarch64-kernel, the system is armhf however – that’s why we’re installing a cross compiler (credits). Edit your ~/.bashrc and add

export PATH="/usr/lib/ccache:$PATH"

At the bottom, then do

. ~/.bashrc

That should speed up compilation dramatically.

Use the source!

Make a new directory for your linux kernel, i.e. mkdir ~/src. Change to that directory cd ~/src and download the kernel sources of your choice, i.e.
git clone https://github.com/mrfixit2001/rockchip-kernel.git linux

Copy the existing kernel configuration to your source tree:

zcat /proc/config.gz ~/src/linux/.config
cd ~/src/linux/
make oldconfig

Almost set to go!

make menuconfig

Do your changes, save… now, compile the kernel:

make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- -j 6 bindeb-pkg

And the device tree afterwards:

make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- -j 6 rockchip/rk3399-pinebookpro.dtb

Log off from your container by using CTRL-D (or the method of your liking). The kernel is now in (with my names):

/var/snap/lxd/common/lxd/containers/myvm/rootfs/root/src

We’re going to install this and move it carefully. Make sure /boot/ isn’t mounted:

sudo umount /boot
sudo mount /dev/mmcblk0p1 /mnt/
sudo dpkg -i --force-architecture /var/snap/lxd/common/lxd/containers/myvm/rootfs/root/src/linux-image-4.4.196-gb9a54c00f_4.4.196-gb9a54c00f_arm64.deb
(or whatever .deb you just created).

cp /mnt/rk3399-pinebookpro.dtb /mnt/rk3399-pinebookpro.dtb.bak

cp /var/snap/lxd/common/lxd/containers/myvm/rootfs/root/src/linux/arch/arm64/boot/dts/rockchip/rk3399-pinebookpro.dtb /mnt/

Copy the kernel to SD card:

cp /boot/vmlinuz-4.4.196-gb9a54c00f /mnt/Image

Done! Reboot…

Yes, I know that there are LXD Api functions to work with container files, and working as root is not advised. But for the time being, it „works for me™“.

Schatzkiste

„Wir haben ein etwas gestörtes Verhältnis zum unbeschwerten Lachen, weil man unsinnigerweise glaubt, wo gelacht wird, fehle das kulturelle Niveau.“ – Georg Thomalla

Butterfly Keyboard

How long does it take before the first key on an Apple Buterfly Keyboard (MacBook Air 2018) is stuck? In my case six months and five days (186 days). I really, really am careful about dust on my MacBook, but my arrow-down-key is stuck now.

OpenVPN connects successfully, then immediately disconnects

If you’re using OpenVPN 2.4 or higher, there’s a changed behaviour within OpenVPN: expired certificate revocation lists will no longer be accepted by the server. A client will successfully connect, then disconnect. The log on the server will print something like:

VERIFY ERROR: depth=0, error=CRL has expired: C=US, ST=CA, L=Ubuntu, O=Org, CN=client1, emailAddress=mymail@example.org
OpenSSL: error:1417C086:SSL routines:tls_process_client_certificate:certificate verify failed
TLS_ERROR: BIO read tls_read_plaintext error
TLS Error: TLS object -> incoming plaintext read error
TLS Error: TLS handshake failed
Fatal TLS error (check_tls_errors_co), restarting

I startet /etc/openvpn/openvpn-server1/easy-rsa/revoke-full „dummy“ which gave an error but recreated the revocation list. Make sure to change „default_crl_days“ in your openssl configuration beforehand!

Denial of service as a service

Twitter today announced it was acquiring the “trust and safety as a service” startup Smyte to help it better address issues related to online abuse, harassment, spam, and security on its platform. But it also decided to immediately shut down access to Smyte’s API without warning, leaving Smyte’s existing customers no time to transition to a new service provider

Quelle: Twitter ‘smytes’ customers

Ohne Worte.

Ubuntu 18.04 & gnome3

Ubuntu 18.04 desktop (vanilla edition) switched to using gnome3 instead of their own unity desktop.

I’m switching to using xubuntu-desktop, since the new Ubuntu standard desktop combines the flaws of gnome3 with the flaws of Ubuntus desktop user interface.

Ubuntu & xrdp server black screen on login

I am running a xrdp server for when I need a full desktop on one of my android devices – if I’m using remote login for gui stuff, I’m using x2go.

Recently, the xrdp server stopped working. Looking for ways to fix it didn’t yield a proper result. I finally found the solution:

Due to upgrading my ubuntu server installation by using „do-release-upgrade“, an old libglib-2.0.0 was left over in /lib/x86_64-linux-gnu/ (version 4800.0). That library took priority over the new installed version in /usr/lib/x86_64-linux-gnu/ (version 5600.1). The error I saw was

„undefined symbol: g_date_copy“

After deleting /lib/x86_64-linux-gnu/libglib* and doing „apt –reinstall install libglib2.0-0“, I am able to log in to xfce4 again.

Dark Patterns, The Ratchet · Jacques Mattheij

The cumulative effect of all those little ratchets on your privacy is rather terrible, but there is no denying it: you were along for the ride and you had the option to ‘opt out’ at every step. Not just from that one dialogue: from all of them by refusing to use products that are fielded by companies that engage in these unethical practices. Say no to ‘The Ratchet’ and it’s sick family of dark patterns designed to little-by-little chip away at your privacy, kick products and companies like that to the kerb where they belong. That’s the only way to really opt out.

Quelle: Dark Patterns, The Ratchet · Jacques Mattheij

Dark Patterns ist sowieso ein interessantes Blog, dass „dunkle Patterns“ beschreibt, also Benutzeroberflächen und Prozesse, die so gestaltet sind, dass der Nutzer etwas zustimmt, dem er/ sie eigentlich nicht zustimmen will…