summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorMasahiro Yamada <masahiroy@kernel.org>2024-07-27 10:42:03 +0300
committerMasahiro Yamada <masahiroy@kernel.org>2024-09-01 14:33:33 +0300
commitaaed5c7739be81ebdd6008aedc8befd98c88e67a (patch)
tree4d2c8f0ab8a88d997106df951805b9c8f15012d3 /scripts
parenta660deb0f1f62214439640292cd7726f6ed8023d (diff)
downloadlinux-aaed5c7739be81ebdd6008aedc8befd98c88e67a.tar.xz
kbuild: slim down package for building external modules
Exclude directories and files unnecessary for building external modules: - include/config/ (except include/config/{auto.conf,kernel.release}) - scripts/atomic/ - scripts/dtc/ - scripts/kconfig/ - scripts/mod/mk_elfconfig - scripts/package/ - scripts/unifdef - .config - *.o - .*.cmd Avoid copying files twice for the following directories: - include/generated/ - arch/*/include/generated/ Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Reviewed-by: Nicolas Schier <nicolas@fjasle.eu>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/package/install-extmod-build21
1 files changed, 16 insertions, 5 deletions
diff --git a/scripts/package/install-extmod-build b/scripts/package/install-extmod-build
index 8cc9e13403ae..9fee4a3236cc 100755
--- a/scripts/package/install-extmod-build
+++ b/scripts/package/install-extmod-build
@@ -9,15 +9,22 @@ is_enabled() {
grep -q "^$1=y" include/config/auto.conf
}
+find_in_scripts() {
+ find scripts \
+ \( -name atomic -o -name dtc -o -name kconfig -o -name package \) -prune -o \
+ ! -name unifdef -a ! -name mk_elfconfig -a \( -type f -o -type l \) -print
+}
+
mkdir -p "${destdir}"
(
cd "${srctree}"
echo Makefile
find "arch/${SRCARCH}" -maxdepth 1 -name 'Makefile*'
- find include scripts -type f -o -type l
+ find "arch/${SRCARCH}" -name generated -prune -o -name include -type d -print
find "arch/${SRCARCH}" -name Kbuild.platforms -o -name Platform
- find "arch/${SRCARCH}" -name include -type d
+ find include \( -name config -o -name generated \) -prune -o \( -type f -o -type l \) -print
+ find_in_scripts
) | tar -c -f - -C "${srctree}" -T - | tar -xf - -C "${destdir}"
{
@@ -25,12 +32,16 @@ mkdir -p "${destdir}"
echo tools/objtool/objtool
fi
- find "arch/${SRCARCH}/include" Module.symvers include scripts -type f
+ echo Module.symvers
+ echo "arch/${SRCARCH}/include/generated"
+ echo include/config/auto.conf
+ echo include/config/kernel.release
+ echo include/generated
+ find_in_scripts
if is_enabled CONFIG_GCC_PLUGINS; then
find scripts/gcc-plugins -name '*.so'
fi
} | tar -c -f - -T - | tar -xf - -C "${destdir}"
-# copy .config manually to be where it's expected to be
-cp "${KCONFIG_CONFIG}" "${destdir}/.config"
+find "${destdir}" \( -name '.*.cmd' -o -name '*.o' \) -delete