coral TPU gasket and apex driver modules for Alpine
  • Dockerfile 59.9%
  • Shell 32.7%
  • Makefile 7.4%
Find a file
2025-01-21 08:48:28 +01:00
docker feat: bump packages for 3.20.2 6.6.71-r0 support 2025-01-21 08:48:28 +01:00
.gitignore initial upload 2024-08-31 14:37:42 +02:00
.hadolint.yaml initial upload 2024-08-31 14:37:42 +02:00
.pre-commit-config.yaml fix: use vmlinux from alpine kernel 2024-08-31 23:16:28 +02:00
CONTRIBUTING.md fix: use vmlinux from alpine kernel 2024-08-31 23:16:28 +02:00
Makefile feat: bump packages for 3.20.2 6.6.71-r0 support 2025-01-21 08:48:28 +01:00
README.md feat: bump packages for 3.20.2 6.6.71-r0 support 2025-01-21 08:48:28 +01:00

Requirements:

  • git (optional if you download the repo zip instead)
  • docker
  • docker-compose

Building the kernel modules

git clone https://github.com/fr4nk3n5731n/alpine-coral-tpu.git
cd alpine-coral-tpu
make

this should create apex.ko and gasket.ko in the ./output directory

Installing the kernel modules

  1. copy the kernel modules into /lib/modules//
  2. depmod
  3. modprobe gasket
  4. modprobe apex
  5. add gasket and apex to your /etc/modules files

Example

assuming that we compiled the modules locally and want to deploy those modules to a target system running Alpine 3.20.2 with Kernel linux-virt version 6.6.71-r0

# on the machine you used to build the modules, copy the files to the target system
scp "output/*.ko" root@192.168.122.10:/lib/modules/6.6.71-0-virt/

# on the target system
depmod
modprobe gasket
modprobe apex

# adds modules  to modules file if it doesn't exist already
grep gasket /etc/modules || echo "gasket" >> /etc/modules
grep apex /etc/modules || echo "apex" >> /etc/modules

Customisation

keep in mind that just changing the kernel Version might not work due to the version pinning of other installed libraries. You might need to reference https://pkgs.alpinelinux.org/packages?branch=v3.20&repo=&arch=&maintainer= to update the versions.

Environment Variables

Variable Default Description
KERNEL_VERSION 6.6.71-r0
KERNEL_VARIANT virt options: lts, virt

TODOs:

  • add APKBUILD to alpine package
  • build CI pipeline to compile the Modules and stuff them into an alpine package
  • add support to compile for different CPU architectures