kbuild: deb-pkg: create source package without cleaning

If you run 'make deb-pkg', all objects are lost due to 'make clean',
which makes the incremental builds impossible.

Instead of cleaning, pass the exclude list to tar's --exclude-from
option.

Previously, *.diff.gz contained some check-in files such as
.clang-format, .cocciconfig.

With this commit, *.diff.gz will only contain the .config and debian/.
The other source files will go into the .orig tarball.

linux.tar.gz is rebuilt only when the source files that would go into
the tarball are changed.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Reviewed-by: Nicolas Schier <nicolas@fjasle.eu>
This commit is contained in:
Masahiro Yamada
2023-02-15 10:20:24 +09:00
parent 5c3d1d0abb
commit 7bf4582d7a
2 changed files with 66 additions and 6 deletions

View File

@@ -84,6 +84,8 @@ set_debarch() {
fi
}
rm -rf debian
# Some variables and settings used throughout the script
version=$KERNELRELEASE
if [ -n "$KDEB_PKGVERSION" ]; then
@@ -135,6 +137,28 @@ fi
mkdir -p debian/source/
echo "1.0" > debian/source/format
# Ugly: ignore anything except .config or debian/
cat<<'EOF' > debian/source/local-options
diff-ignore
extend-diff-ignore = ^[^.d]
extend-diff-ignore = ^\.[^c]
extend-diff-ignore = ^\.c($|[^o])
extend-diff-ignore = ^\.co($|[^n])
extend-diff-ignore = ^\.con($|[^f])
extend-diff-ignore = ^\.conf($|[^i])
extend-diff-ignore = ^\.confi($|[^g])
extend-diff-ignore = ^\.config.
extend-diff-ignore = ^d($|[^e])
extend-diff-ignore = ^de($|[^b])
extend-diff-ignore = ^deb($|[^i])
extend-diff-ignore = ^debi($|[^a])
extend-diff-ignore = ^debia($|[^n])
extend-diff-ignore = ^debian[^/]
EOF
echo $debarch > debian/arch
extra_build_depends=", $(if_enabled_echo CONFIG_UNWINDER_ORC libelf-dev:native)"
extra_build_depends="$extra_build_depends, $(if_enabled_echo CONFIG_SYSTEM_TRUSTED_KEYRING libssl-dev:native)"