Commit e6b65ee1 authored by Jose Fernandez's avatar Jose Fernandez Committed by Masahiro Yamada

kbuild: control extra pacman packages with PACMAN_EXTRAPACKAGES

Introduce the PACMAN_EXTRAPACKAGES variable in PKGBUILD to allow users
to specify which additional packages are built by the pacman-pkg target.

Previously, the api-headers package was always included, and the headers
package was included only if CONFIG_MODULES=y. With this change, both
headers and api-headers packages are included by default. Users can now
control this behavior by setting PACMAN_EXTRAPACKAGES to a
space-separated list of desired extra packages or leaving it empty to
exclude all.

For example, to build only the base package without extras:

make pacman-pkg PACMAN_EXTRAPACKAGES=""
Signed-off-by: default avatarJose Fernandez <jose.fernandez@linux.dev>
Reviewed-by: default avatarPeter Jung <ptr1337@cachyos.org>
Reviewed-by: default avatarNathan Chancellor <nathan@kernel.org>
Tested-by: default avatarNathan Chancellor <nathan@kernel.org>
Reviewed-by: default avatarChristian Heusel <christian@heusel.eu>
Tested-by: default avatarChristian Heusel <christian@heusel.eu>
Acked-by: default avatarThomas Weißschuh <linux@weissschuh.net>
Signed-off-by: default avatarMasahiro Yamada <masahiroy@kernel.org>
parent 7a7f9745
...@@ -3,10 +3,13 @@ ...@@ -3,10 +3,13 @@
# Contributor: Jan Alexander Steffens (heftig) <heftig@archlinux.org> # Contributor: Jan Alexander Steffens (heftig) <heftig@archlinux.org>
pkgbase=${PACMAN_PKGBASE:-linux-upstream} pkgbase=${PACMAN_PKGBASE:-linux-upstream}
pkgname=("${pkgbase}" "${pkgbase}-api-headers") pkgname=("${pkgbase}")
if grep -q CONFIG_MODULES=y include/config/auto.conf; then
pkgname+=("${pkgbase}-headers") _extrapackages=${PACMAN_EXTRAPACKAGES-headers api-headers}
fi for pkg in $_extrapackages; do
pkgname+=("${pkgbase}-${pkg}")
done
pkgver="${KERNELRELEASE//-/_}" pkgver="${KERNELRELEASE//-/_}"
# The PKGBUILD is evaluated multiple times. # The PKGBUILD is evaluated multiple times.
# Running scripts/build-version from here would introduce inconsistencies. # Running scripts/build-version from here would introduce inconsistencies.
...@@ -77,10 +80,13 @@ _package-headers() { ...@@ -77,10 +80,13 @@ _package-headers() {
cd "${objtree}" cd "${objtree}"
local builddir="${pkgdir}/usr/${MODLIB}/build" local builddir="${pkgdir}/usr/${MODLIB}/build"
if grep -q CONFIG_MODULES=y include/config/auto.conf; then
echo "Installing build files..." echo "Installing build files..."
"${srctree}/scripts/package/install-extmod-build" "${builddir}" "${srctree}/scripts/package/install-extmod-build" "${builddir}"
fi
echo "Installing System.map and config..." echo "Installing System.map and config..."
mkdir -p "${builddir}"
cp System.map "${builddir}/System.map" cp System.map "${builddir}/System.map"
cp .config "${builddir}/.config" cp .config "${builddir}/.config"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment