Skip to content

envkernel.sh: Avoid changing local version based on Git repository state

Administrator requested to merge envkernel-localversion into master

When git is installed, the Linux kernel build system appends suffixes to the Linux kernel version based on the local repository state. This means that we get different kernel versions when building the package normally or with envkernel.sh.

This causes problems with Alpine's installkernel script, which detects the kernel flavor based on the kernel version.
e.g. when building linux-postmarketos-qcom-msm8916 with git installed the kernel image is installed to /boot/vmlinuz-g556e2c21dbac-dirty where pmbootstrap (and anything else) cannot find it.

Two changes are necessary to prevent the kernel build system from appending Git version information:

  1. Set LOCALVERSION= - this is done by this commit.
  2. Unset CONFIG_LOCALVERSION_AUTO
    • this needs to be done in each kernel config (when needed)

Most kernel pmaports do not make use of Alpine's installkernel (it is used when installing the kernel image using make install or make zinstall instead of copying it manually), so they are not affected by this problem.

I considered adding CONFIG_LOCALVERSION_AUTO=n to the kconfig requirements, but not sure if this is strictly needed enough to make it a strong requirement.

Merge request reports

Loading