Skip to content

Commit a741eab

Browse files
committed
Review fixes
1 parent 699ec79 commit a741eab

2 files changed

Lines changed: 9 additions & 9 deletions

File tree

dkms.8.in

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -954,9 +954,9 @@ 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 wil 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
@@ -965,7 +965,7 @@ installed in a custom path; and the variable
965965
can be used 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

0 commit comments

Comments
 (0)