coreos / layering-examples

Apache License 2.0
105 stars 24 forks source link

build-zfs-module: Add example building a kernel module #43

Closed jmarrero closed 1 year ago

jmarrero commented 1 year ago

Co-authored-by: Micah Abbott

This example builds the rpms for the ZFS module using multi stage builds.

Few fun things learned from this: @ashcrow found out that ld is not properly installed on CoreOS/Silverblue it looks like it's the %post script failing. I found out that because the Makefile tries to create a folder using 'mkdir -p /usr/local/X' and /usr/local is a link to /var/usrlocal it fails. Based on these two constraints building in a intermediate fedora application container(non-ostree) seems like the best way forward at the moment.

Closes #40

jmarrero commented 1 year ago

I tested with Silverblue: https://github.com/jmarrero/silverblue-setup/blob/main/zfs-test/Dockerfile-zfs

➜  ~ sudo modprobe zfs
➜  ~ cat /proc/modules | grep zfs
zfs 3964928 0 - Live 0x0000000000000000 (POE)
zunicode 335872 1 zfs, Live 0x0000000000000000 (POE)
zzstd 577536 1 zfs, Live 0x0000000000000000 (OE)
zlua 188416 1 zfs, Live 0x0000000000000000 (OE)
zavl 16384 1 zfs, Live 0x0000000000000000 (POE)
icp 319488 1 zfs, Live 0x0000000000000000 (POE)
zcommon 106496 2 zfs,icp, Live 0x0000000000000000 (POE)
znvpair 110592 2 zfs,zcommon, Live 0x0000000000000000 (POE)
spl 126976 6 zfs,zzstd,zavl,icp,zcommon,znvpair, Live 0x0000000000000000 (OE)
cgwalters commented 1 year ago

Based on these two constraints building in a fedora intermediate container

A wording nit...to me, Fedora CoreOS is now a Fedora container. (It's worth repeating out loud to oneself)

So we could call the other one the "application base" perhaps? IOW say "fedora app container". Notice that this naming scheme gets much stronger when applied to RHEL, because we already have a distinct "brand" in "UBI" for the app base image.

jmarrero commented 1 year ago

naming is hard