From d45e88505d846e3d25da6a0f1c4165c2bc5bbf07 Mon Sep 17 00:00:00 2001 From: Minecrell Date: Sat, 21 Dec 2019 20:55:41 +0100 Subject: [PATCH] envkernel.sh: Avoid changing local version based on Git repository state (!1844) 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) --- helpers/envkernel.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/helpers/envkernel.sh b/helpers/envkernel.sh index d441fc2d..a40e1484 100644 --- a/helpers/envkernel.sh +++ b/helpers/envkernel.sh @@ -195,6 +195,12 @@ set_alias_make() { fi cmd="$cmd make -C /mnt/linux O=/mnt/linux/.output" cmd="$cmd CC=$cc HOSTCC=$hostcc" + + # Avoid "+" suffix in kernel version if the working directory is dirty. + # (Otherwise we will generate a package that uses different paths...) + # Note: Set CONFIG_LOCALVERSION_AUTO=n in kernel config additionally + cmd="$cmd LOCALVERSION=" + # shellcheck disable=SC2139 alias make="$cmd" unset cmd