Talk:Custom Kernel

From Alpine Linux

Needs to be adjusted for other archs

— Preceding unsigned comment added by Orson Teodoro (talkcontribs) 03:36, 4 March 2018

Locations/paths of build config files

My goal is to build the Virt (not Standard/LTS) kernel using the defaults for Virt, and I don't understand which files are needed in exactly which paths.

I had difficulty understanding the excerpt below. Is anyone willing to assist me in understanding it? For example, where/what is the "linux-4.15" folder?

When you are done with your edits either by editing directly the APKBUILD and copying the lts.ARCH.config as .config in the linux-4.15 folder. You will then move the .config back overriding the lts.ARCH.config generated by make menuconfig.

— Preceding unsigned comment added by -anthumchris- (talkcontribs) 17:34, 23 November 2024‎

build_NAME

After you are done using the menu in the build-NAME folder by doing make menuconfig

It is really not clear what is meant by "the build-NAME folder" here.

Locations/paths of build config files Answer

Usually these are the directories you would look for in linux-lts apk package development (replace "x86_64" with different $ARCH if needed) (replace $YOUR_WORK_DIR to which directory you downloaded aports to),

Below should contain APKBUILD, lts.x86_64.config, virt.x86_64.config and .patch files (and more $ARCH's by default, but to keep it simple, I will just state the x86_64 files)

$YOUR_WORK_DIR/aports/main/linux-lts

ALL .patch files that are in $YOUR_WORK_DIR/aports/main/linux-lts are also in below

$YOUR_WORK_DIR/aports/main/linux-lts/src

Below is a tar compressed linux file that decompresses into linux-$VERSION

$YOUR_WORK_DIR/aports/main/linux-lts/src/linux-$VERSION.tar.gz

$YOUR_WORK_DIR/aports/main/linux-lts/src/linux-$VERSION

$YOUR_WORK_DIR/aports/main/linux-lts/src/build-lts.x86_64

$YOUR_WORK_DIR/aports/main/linux-lts/src/build-virt.x86_64

In the "APKBUILD" file, change this "source" line to this:

Contents of $YOUR_WORK_DIR/aports/main/linux-lts/APKBUILD

... source="https://cdn.kernel.org/pub/linux/kernel/v${pkgver%%.*}.x/linux-$_kernver.tar.xz 0001-powerpc-boot-wrapper-Add-z-notext-flag-for-ppc64le.patch 0002-x86-Compress-vmlinux-with-zstd-19-instead-of-22.patch 0003-kexec-add-kexec_load_disabled-boot-option.patch 0004-objtool-respect-AWK-setting.patch 0005-powerpc-config-defang-gcc-check-for-stack-protector-.patch lts.x86_64.config virt.x86_64.config " ...

do make menuconfig within $YOUR_WORK_DIR/aports/main/linux-lts/src/linux-$VERSION and copy the .config file to $YOUR_WORK_DIR/aports/main/linux-lts/lts.x86_64.config and/or $YOUR_WORK_DIR/aports/main/linux-lts/virt.x86_64.config

build_NAME Answer

After you are done using the menu in the build-NAME folder by doing make menuconfig

the "build-NAME" folder should actually be $YOUR_WORK_DIR/aports/main/linux-lts/src/linux-$VERSION