Mail archive

[alpine-user] Build kernel module for Alpine

From: Vanish <>
Date: Tue, 2 Jan 2018 18:24:54 +0100

Hi everyone,

I'm going to build a little kernel module for Alpine, but get some problems.

Host: Ubuntu 16.04LTS 64bit
Guest : Alpine-vanilla-3.7.0-x86(kernel version 4.9.65) in qemu

It looks like there is no build environment for a kernel module natively in Alpine, so I tried to use cross-compiler to build it in the host.
I first get an i686-linux-musl-gcc cross-compiler from <> . It works fine since a compiled Hello_World.c runs perfectly in the guest.
Right now, I'm trying to build a kernel module hello_kernel.c. I download linux kernel 4.9.65 first from <> (e.g. in /home/yuxing/linux 4.9.65 ), and compile it with the cross-compiler mentioned above. Next, I use the build environment in /home/yuxing/linux 4.9.65 with the cross compiler to build the hello_kernel.ko . It looks fine since no errors come out.
But when I insmod hello_kernel.ko in Alpine, the error

Can someone please give me some advices to figure this problem or how to build a kernel module for Alpine. Thanks in advance.


Received on Tue Jan 02 2018 - 18:24:54 UTC