Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

+16 -5
+16 -5
scripts/package/install-extmod-build
··· 9 9 grep -q "^$1=y" include/config/auto.conf 10 10 } 11 11 12 + find_in_scripts() { 13 + find scripts \ 14 + \( -name atomic -o -name dtc -o -name kconfig -o -name package \) -prune -o \ 15 + ! -name unifdef -a ! -name mk_elfconfig -a \( -type f -o -type l \) -print 16 + } 17 + 12 18 mkdir -p "${destdir}" 13 19 14 20 ( 15 21 cd "${srctree}" 16 22 echo Makefile 17 23 find "arch/${SRCARCH}" -maxdepth 1 -name 'Makefile*' 18 - find include scripts -type f -o -type l 24 + find "arch/${SRCARCH}" -name generated -prune -o -name include -type d -print 19 25 find "arch/${SRCARCH}" -name Kbuild.platforms -o -name Platform 20 - find "arch/${SRCARCH}" -name include -type d 26 + find include \( -name config -o -name generated \) -prune -o \( -type f -o -type l \) -print 27 + find_in_scripts 21 28 ) | tar -c -f - -C "${srctree}" -T - | tar -xf - -C "${destdir}" 22 29 23 30 { ··· 32 25 echo tools/objtool/objtool 33 26 fi 34 27 35 - find "arch/${SRCARCH}/include" Module.symvers include scripts -type f 28 + echo Module.symvers 29 + echo "arch/${SRCARCH}/include/generated" 30 + echo include/config/auto.conf 31 + echo include/config/kernel.release 32 + echo include/generated 33 + find_in_scripts 36 34 37 35 if is_enabled CONFIG_GCC_PLUGINS; then 38 36 find scripts/gcc-plugins -name '*.so' 39 37 fi 40 38 } | tar -c -f - -T - | tar -xf - -C "${destdir}" 41 39 42 - # copy .config manually to be where it's expected to be 43 - cp "${KCONFIG_CONFIG}" "${destdir}/.config" 40 + find "${destdir}" \( -name '.*.cmd' -o -name '*.o' \) -delete