Widevine support in Librem 5

I’ve made some progress!

Instead of using the main system, I prepared a chroot like so:

sudo mkdir -p /var/lib/debbuild/aarch64/root
sudo debootstrap --arch arm64 byzantium /var/lib/debbuild/aarch64/root
sudo mount --bind /path/to/my/workdir \
  /var/lib/debbuild/aarch64/root/var/lib/packages

This lets me do the risky install in a chroot jail:

$ debuild -i -us -uc -b
$ sudo chroot /var/lib/debbuild/aarch64/root
# dpkg -i /var/lib/packages/libc6_2.31-13+deb11u6_arm64.deb
# /lib/ld-linux-aarch64.so.1  # test if my modification works

To test this, I made a minor modification to the help text of ld.so (in the elf/rtld.c source file), and it works:

$ /lib/ld-linux-aarch64.so.1
Usage: ld.so [OPTION]... EXECUTABLE-FILE [ARGS-FOR-PROGRAM...]
[…] # Original help text
$ sudo chroot /var/lib/debbuild/aarch64/root /lib/ld-linux-aarch64.so.1
[…] # Modified help text

That means I have everything I need to safely tinker with the libc6 package, and I no longer have to worry about irreparably breaking my system when I make a mistake.

Next steps: look at the patches in the AUR package glibc-widevine, then port those patches to Debian’s glibc source package, step by step, in the hopes that I end up with a working glibc-widevine for Debian.

That’s probably going to take me a couple of months. I’m still learning how to do Debian packaging properly, and just building that libc6 package once takes several hours on my L5. That means the feedback loop is abysmal, and I’ll only be able to do at most one or two tiny iterations per day even if I can find the time to do it.

(I’ve tried to set up an environment in a virtual machine on my laptop so I can iterate faster, but I couldn’t get QEMU to boot the image. So I gave up on that for now, and went back to building on the L5 directly.)

Any help is appreciated so I can iterate faster.

6 Likes