forked from torvalds/linux
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
kbuild: refactor kernel-devel RPM package and linux-headers Deb package
The kernel-devel RPM package and the linux-headers Debian package provide headers and scripts needed for building external modules. They copy the necessary files in slightly different ways - the RPM copies almost everything except some exclude patterns, while the Debian copies less number of files. There is no need to maintain different code to do the same thing. Split the Debian code out to scripts/package/install-extmod-build, which is called from both of the packages. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
- Loading branch information
Showing
3 changed files
with
41 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#!/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 "$(find "arch/${SRCARCH}" -name include -o -name scripts -type d)" -type f | ||
) | 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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters