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/
Showing the changes to scripts (1 of 1 file). Show all
Unified · Split
| @@ -9,15 +9,22 @@ is_enabled() { · 8 unmodified lines | |||
| 9 | grep -q "^$1=y" include/config/auto.conf | 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 | mkdir -p "${destdir}" | 18 | mkdir -p "${destdir}" |
| 13 | 19 | ||
| 14 | ( | 20 | ( |
| 15 | cd "${srctree}" | 21 | cd "${srctree}" |
| 16 | echo Makefile | 22 | echo Makefile |
| 17 | find "arch/${SRCARCH}" -maxdepth 1 -name 'Makefile*' | 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 | find "arch/${SRCARCH}" -name Kbuild.platforms -o -name Platform | 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 | ) | tar -c -f - -C "${srctree}" -T - | tar -xf - -C "${destdir}" | 28 | ) | tar -c -f - -C "${srctree}" -T - | tar -xf - -C "${destdir}" |
| 22 | 29 | ||
| 23 | { | 30 | { |
| @@ -25,12 +32,16 @@ mkdir -p "${destdir}" · 1 unmodified line | |||
| 25 | echo tools/objtool/objtool | 32 | echo tools/objtool/objtool |
| 26 | fi | 33 | fi |
| 27 | 34 | ||
| 28 | find "arch/${SRCARCH}/include" Module.symvers include scripts -type f | 35 | echo Module.symvers |
| 36 | echo "arch/${SRCARCH}/include/generated" | ||
| 37 | echo include/config/auto.conf | ||
| 38 | echo include/config/kernel.release | ||
| 39 | echo include/generated | ||
| 40 | find_in_scripts | ||
| 29 | 41 | ||
| 30 | if is_enabled CONFIG_GCC_PLUGINS; then | 42 | if is_enabled CONFIG_GCC_PLUGINS; then |
| 31 | find scripts/gcc-plugins -name '*.so' | 43 | find scripts/gcc-plugins -name '*.so' |
| 32 | fi | 44 | fi |
| 33 | } | tar -c -f - -T - | tar -xf - -C "${destdir}" | 45 | } | tar -c -f - -T - | tar -xf - -C "${destdir}" |
| 34 | 46 | ||
| 35 | # copy .config manually to be where it's expected to be | 47 | find "${destdir}" \( -name '.*.cmd' -o -name '*.o' \) -delete |
| 36 | cp "${KCONFIG_CONFIG}" "${destdir}/.config" | ||