linux/scripts/package/install-extmod-build
Masahiro Yamada 358c3f8cce kbuild: deb-pkg: do not search for 'scripts' directory under arch/
The 'scripts' directory was searched under arch/${SRCARCH} to copy
arch/ia64/scripts, but commit cf8e865810 ("arch: Remove Itanium
(IA-64) architecture") removed arch/ia64/ entirely.

There is another 'scripts' directory in arch/um/, but this script
is never executed with SRCARCH=um because UML does not support the
linux-headers package.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2024-01-05 19:35:38 +09:00

40 lines
883 B
Bash
Executable File

#!/bin/sh
# SPDX-License-Identifier: GPL-2.0-only
set -e
destdir=${1}
test -n "${srctree}"
test -n "${SRCARCH}"
is_enabled() {
grep -q "^$1=y" include/config/auto.conf
}
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 Kbuild.platforms -o -name Platform
find "arch/${SRCARCH}" -name include -type d
) | tar -c -f - -C "${srctree}" -T - | tar -xf - -C "${destdir}"
{
if is_enabled CONFIG_OBJTOOL; then
echo tools/objtool/objtool
fi
find "arch/${SRCARCH}/include" Module.symvers include scripts -type f
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"