User:Anthumchris:How to build the Alpine Linux kernel: Difference between revisions

From Alpine Linux
No edit summary
No edit summary
Line 10: Line 10:
<pre>
<pre>
doas apk add alpine-sdk
doas apk add alpine-sdk
doas addgroup USERNAME abuild   # your non-root user
doas addgroup USERNAME abuild         # your non-root user


git clone --depth 1 https://gitlab.alpinelinux.org/alpine/aports.git
git clone --depth 1 https://gitlab.alpinelinux.org/alpine/aports.git
abuild-keygen --append --install
abuild-keygen --append --install
doas chmod a+r /etc/apk/keys/*        # ensure keys are readable


cd aports/main/linux-lts/
cd aports/main/linux-lts/
Line 20: Line 21:


=== Install ===
=== Install ===
Identify the package name of your current kernel. This example shows that <code>linux-lts</code> is the current package that we will later revert to.
<pre>
echo "kernel: $(uname -r)"
apk list --installed linux-*
</pre>
[[File:Alpine-kernel-package.png|600px]]
==== Install new kernel ====
<pre>
<pre>
apk add /home/USERNAME/packages/.....................................
apk add /home/USERNAME/packages/.....................................

Revision as of 19:51, 3 December 2024

How build the Alpine Linux kernel

A customized Alpine Linux kernel may be needed if you are experimenting with adding/removing kernel features and modules. For example, Alpine releases multiple kernels that vary in features and file sizes. Alpine kernels extend the standard Linux kernel and build within a few minutes to a few hours (depending on the speed of your system) using abuild, aports, and alpine-sdk.

Before you start

A running instance of Alpine Linux and a non-root user with doas (wheel group) privileges are required to use abuild.

Build & install the kernel

Build

doas apk add alpine-sdk
doas addgroup USERNAME abuild         # your non-root user

git clone --depth 1 https://gitlab.alpinelinux.org/alpine/aports.git
abuild-keygen --append --install
doas chmod a+r /etc/apk/keys/*        # ensure keys are readable

cd aports/main/linux-lts/
time abuild -crK

Install

Identify the package name of your current kernel. This example shows that linux-lts is the current package that we will later revert to.

echo "kernel: $(uname -r)"
apk list --installed linux-*

Install new kernel

apk add /home/USERNAME/packages/.....................................

See Also