From 7eb3768b59f0aff7d59fcfd14eb8799a17451d98 Mon Sep 17 00:00:00 2001 From: Kairui Song Date: Sun, 25 Dec 2022 18:14:36 +0800 Subject: [PATCH] dist: support using same build/src path during rpmbuild by default Upstream: no The split was inherited from TK4, but it breaks older/third part kernel repos. Keep it by default since it does make the build progress cleaner. Signed-off-by: Kairui Song --- dist/templates/kernel.template.spec | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dist/templates/kernel.template.spec b/dist/templates/kernel.template.spec index 76af09f96..626e0d17c 100644 --- a/dist/templates/kernel.template.spec +++ b/dist/templates/kernel.template.spec @@ -462,7 +462,7 @@ This package provides debug information for the bpftool package. ### Prepare common build vars to share by %%prep, %%build and %%install section # _KernSrc: Path to kernel source, located in _buildir -# _KernBuild: Path to the built kernel objects, located in _buildir +# _KernBuild: Path to the built kernel objects, could be same as $_KernSrc (just like source points to build under /lib/modules/) # _KernVmlinuxH: path to vmlinux.h for BTF, located in _buildir # KernUnameR: Get `uname -r` output of the built kernel # KernExtVer: Kernel EXTRAVERSION plus debug/kasan/syzkaller marker @@ -560,9 +560,9 @@ sed -i "/^SUBLEVEL/cSUBLEVEL = $(echo %{kernel_majver} | cut -d '.' -f 3)" $_Ker BuildConfig() { mkdir -p $_KernBuild pushd $_KernBuild - cp $1 .config - echo "include $_KernSrc/Makefile" > Makefile + + [ "$_KernBuild" != "$_KernSrc" ] && echo "include $_KernSrc/Makefile" > Makefile # Ensures build-ids are unique to allow parallel debuginfo sed -i -e "s/^CONFIG_BUILD_SALT.*/CONFIG_BUILD_SALT=\"$KernUnameR\"/" .config