X-Original-To: alpine-user@lists.alpinelinux.org Received: from mail-wr0-f194.google.com (mail-wr0-f194.google.com [209.85.128.194]) by lists.alpinelinux.org (Postfix) with ESMTP id 09BF25C4DB0 for ; Tue, 2 Jan 2018 17:31:35 +0000 (GMT) Received: by mail-wr0-f194.google.com with SMTP id p17so25468409wre.7 for ; Tue, 02 Jan 2018 09:31:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=Qj6tP8SV67iy9QCj1kX0RDotDAcEWqG8E7yJfTnGwWI=; b=P7cRrA6qaRC/mtfV+5a/xUBYLudLuOvXVgBdpH8v5Ja3qwO3gQ5Y+qEdhH2Hp8FUEa 55fMF7E7tvOME/IIcDLbSQKsYhHvsNh8AtmJ/LTMTqvTvWfhutMwYb45dJo1tzAwKSnQ Iq+9mgW40Is/1N7Kt8KWsTaZUmO18V/WgtGsV56cjxnkCKquu3lYhBrMlRo3RVwifLyD ZnK18VpEy32VO/+PdMONZJETH+QICCwTT0UtiftlsdFh2VnXx6mAn/g5owtGJU2uwUJn rpfKfCUm2unfuut52zYi4PYxmo+ALczARd6JTvPtf3M45fzuZ/Q5J4jxTmOiFqKv5IBK otew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=Qj6tP8SV67iy9QCj1kX0RDotDAcEWqG8E7yJfTnGwWI=; b=Es/O5bIMaNdtjB/Bz0H0rB6Bz0I18a57LNJnK373mCxX5bvLJr4uvM5e/nLZx2Eidn rerTLLsoKjPvJy0VABPD7RJ/NChhYD9MD/+YqxcKWAZNTJwVNw4RBrWFXgd0bJp9ArQN 5kM0RDQW79Vik1LIJNCiGi/NyXF9L9ZgtSTgTl8RQY+w91wNFUZdhG2rOAsy/nPybtps 10sR8cON3iaWlGprJakbDooQChqyJjjTs0KDwRe4ppUhuatH4/1RzD14UjeEbWD+gWmr tE3BoWhSqOyx67Dcyu+lD79mFQZWIDImjRUteSupeKwRN88N5XYCMaTtUmr9lcH37KNy CbOw== X-Gm-Message-State: AKGB3mKS7AjqJvVpnVFnAsCj//It4wMn7fgtQH0p5F5wdpGV1pVX3mTk c0zfjCMrPlGufxHq8dk4MzB/GrX5S5szI+nwutw= X-Google-Smtp-Source: ACJfBovAda8/0odALZdgmDMFyeejjbnPrPYYdSeIQwK4xr0ntyXR6VmVyq2flScb36B87mOVUSxX8eKfP3gqZmxGiPk= X-Received: by 10.223.164.202 with SMTP id h10mr38472118wrb.98.1514914294232; Tue, 02 Jan 2018 09:31:34 -0800 (PST) X-Mailinglist: alpine-user Precedence: list List-Id: Alpine Development List-Unsubscribe: List-Post: List-Help: List-Subscribe: MIME-Version: 1.0 Received: by 10.223.153.100 with HTTP; Tue, 2 Jan 2018 09:31:13 -0800 (PST) In-Reply-To: <12F65096-CC56-4F42-A1BA-6D4534F6F6BE@gmail.com> References: <12F65096-CC56-4F42-A1BA-6D4534F6F6BE@gmail.com> From: Martin Galvan Date: Tue, 2 Jan 2018 14:31:13 -0300 Message-ID: Subject: Re: [alpine-user] Build kernel module for Alpine To: Vanish Cc: alpine-user@lists.alpinelinux.org Content-Type: text/plain; charset="UTF-8" IIRC to build a kernel module natively on Alpine you first need to do: # apk add linux-hardened-dev alpine-sdk This doesn't seem to be documented anywhere. I tried to build a module a while ago and succeeded, but I saw a lot of linker warnings such as warning: objtool: init_fp() can't find starting instruction 2018-01-02 14:24 GMT-03:00 Vanish : > 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 > https://github.com/richfelker/musl-cross-make . 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 kernel.org (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. > > Regards, > Yuxing > > --- Unsubscribe: alpine-user+unsubscribe@lists.alpinelinux.org Help: alpine-user+help@lists.alpinelinux.org ---