summaryrefslogtreecommitdiff
path: root/scripts/package/install-extmod-build
diff options
context:
space:
mode:
authorJiri Kosina <jkosina@suse.com>2025-03-26 13:42:07 +0100
committerJiri Kosina <jkosina@suse.com>2025-03-26 13:42:07 +0100
commitb3cc7428a32202936904b5b07cf9f135025bafd6 (patch)
treed4a1a6180ac5939fccd92acd6f8d7d1388575c4a /scripts/package/install-extmod-build
parentdb52926fb0be40e1d588a346df73f5ea3a34a4c6 (diff)
parent01601fdd40ecf4467c8ae4d215dbb7d2a0599a2c (diff)
Merge branch 'for-6.15/amd_sfh' into for-linus
From: Mario Limonciello <mario.limonciello@amd.com> Some platforms include a human presence detection (HPD) sensor. When enabled and a user is detected a wake event will be emitted from the sensor fusion hub that software can react to. Example use cases are "wake from suspend on approach" or to "lock when leaving". This is currently enabled by default on supported systems, but users can't control it. This essentially means that wake on approach is enabled which is a really surprising behavior to users that don't expect it. Instead of defaulting to enabled add a sysfs knob that users can use to enable the feature if desirable and set it to disabled by default.
Diffstat (limited to 'scripts/package/install-extmod-build')
-rwxr-xr-xscripts/package/install-extmod-build33
1 files changed, 9 insertions, 24 deletions
diff --git a/scripts/package/install-extmod-build b/scripts/package/install-extmod-build
index d3c5b104c0631..b724626ea0ca0 100755
--- a/scripts/package/install-extmod-build
+++ b/scripts/package/install-extmod-build
@@ -49,17 +49,10 @@ mkdir -p "${destdir}"
# This caters to host programs that participate in Kbuild. objtool and
# resolve_btfids are out of scope.
if [ "${CC}" != "${HOSTCC}" ]; then
- echo "Rebuilding host programs with ${CC}..."
-
- # This leverages external module building.
- # - Clear sub_make_done to allow the top-level Makefile to redo sub-make.
- # - Filter out --no-print-directory to print "Entering directory" logs
- # when Make changes the working directory.
- unset sub_make_done
- MAKEFLAGS=$(echo "${MAKEFLAGS}" | sed s/--no-print-directory//)
-
- cat <<-'EOF' > "${destdir}/Kbuild"
- subdir-y := scripts
+ cat "${destdir}/scripts/Makefile" - <<-'EOF' > "${destdir}/scripts/Kbuild"
+ subdir-y += basic
+ hostprogs-always-y += mod/modpost
+ mod/modpost-objs := $(addprefix mod/, modpost.o file2alias.o sumversion.o symsearch.o)
EOF
# HOSTCXX is not overridden. The C++ compiler is used to build:
@@ -67,20 +60,12 @@ if [ "${CC}" != "${HOSTCC}" ]; then
# - GCC plugins, which will not work on the installed system even after
# being rebuilt.
#
- # Use the single-target build to avoid the modpost invocation, which
- # would overwrite Module.symvers.
- "${MAKE}" HOSTCC="${CC}" KBUILD_OUTPUT=. KBUILD_EXTMOD="${destdir}" scripts/
-
- cat <<-'EOF' > "${destdir}/scripts/Kbuild"
- subdir-y := basic
- hostprogs-always-y := mod/modpost
- mod/modpost-objs := $(addprefix mod/, modpost.o file2alias.o sumversion.o symsearch.o)
- EOF
-
- # Run once again to rebuild scripts/basic/ and scripts/mod/modpost.
- "${MAKE}" HOSTCC="${CC}" KBUILD_OUTPUT=. KBUILD_EXTMOD="${destdir}" scripts/
+ # Clear VPATH and srcroot because the source files reside in the output
+ # directory.
+ # shellcheck disable=SC2016 # $(MAKE), $(CC), and $(build) will be expanded by Make
+ "${MAKE}" run-command KBUILD_RUN_COMMAND='+$(MAKE) HOSTCC="$(CC)" VPATH= srcroot=. $(build)='"${destdir}"/scripts
- rm -f "${destdir}/Kbuild" "${destdir}/scripts/Kbuild"
+ rm -f "${destdir}/scripts/Kbuild"
fi
find "${destdir}" \( -name '.*.cmd' -o -name '*.o' \) -delete