Skip to content

Commit 75a1141

Browse files
committed
Review fixes
1 parent 699ec79 commit 75a1141

File tree

3 files changed

+12
-11
lines changed

3 files changed

+12
-11
lines changed

dkms.8.in

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -954,18 +954,18 @@ Run no more than this number of jobs in parallel.
954954
Control how modules are compressed. By default, the highest available level of compression is used.
955955
.TP
956956
.B build_environment
957-
If the directive is set to any non null-value, the content of the directive will be imported into the DKMS shell with the
957+
If the directive is set to any non null-value, when building modules, the exported variables that are in the file will be imported into the DKMS shell with the
958958
.B source
959-
command when building modules.
959+
command.
960960

961961
Can be used to specify a custom
962962
.B gcc
963963
installed in a custom path; and the variable
964964
.B $kernelver
965-
can be used to represent the target kernel version. Some examples:
965+
can be used inside the environment file to represent the target kernel version. Some examples:
966966

967967
Define a custom script to point to a specific GCC (
968-
.B CC=/opt/gcc12/bin/gcc
968+
.B export CC=/opt/gcc12/bin/gcc
969969
):
970970
.B build_environment="/opt/gcc12/env"
971971

dkms.in

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1380,12 +1380,6 @@ do_build()
13801380
{
13811381
[[ $kernelver && $arch ]] || die 16 "do_build: Empty \$kernelver or \$arch"
13821382

1383-
# Source build environment file if specified
1384-
if [[ -n "$build_environment" && -f "$build_environment" ]]; then
1385-
# shellcheck disable=SC1090
1386-
source "$build_environment"
1387-
fi
1388-
13891383
# If the module has not been added, try to add it.
13901384
if ! is_module_added "$module" "$module_version" ; then
13911385
add_module
@@ -1479,6 +1473,12 @@ do_build()
14791473
fi
14801474
fi
14811475

1476+
# Source build environment file if specified
1477+
if [[ -n "$build_environment" && -f "$build_environment" ]]; then
1478+
# shellcheck disable=SC1090
1479+
source <( (source "$build_environment" &>/dev/null; export -p) )
1480+
fi
1481+
14821482
# Check for missing BUILD_DEPENDS
14831483
bd_missing=
14841484
# shellcheck disable=SC2153

dkms_framework.conf.in

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,8 @@
5757
# compress_zstd_opts="-q --rm -T0 -3"
5858

5959
# Path to a file containing environment variables to be sourced by DKMS.
60-
# This file will be sourced for the build command.
60+
# This file will be sourced for the build command. $kernelver can be used in
61+
# the environment file to represent the target kernel version.
6162
# build_environment=""
6263

6364
# Command to run at the end of every DKMS transaction, for example after a new

0 commit comments

Comments
 (0)