Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve 'make' command substitution #360

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion dkms.in
Original file line number Diff line number Diff line change
Expand Up @@ -1076,14 +1076,22 @@ actual_build()
local -r base_dir="$dkms_tree/$module/$module_version/$kernelver/$arch"
local -r build_dir="$dkms_tree/$module/$module_version/build"
local -r build_log="$build_dir/make.log"
local -r make_subst='{
for (i=1; i<=NF; i++)
if ($i == "make") {
$i = $i" -j"jobs" KERNELRELEASE="ver
print
exit
}
}'

echo $""
echo $"Building module:"

invoke_command "$clean" "Cleaning build area" background
echo $"DKMS make.log for $module-$module_version for kernel $kernelver ($arch)" >> "$build_log"
date >> "$build_log"
local the_make_command="${make_command/#make/make -j$parallel_jobs KERNELRELEASE=$kernelver}"
local the_make_command=$(echo $make_command | awk -v jobs=$parallel_jobs -v ver=$kernelver "$make_subst")
Copy link

@TriMoon TriMoon Nov 27, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No matter if you guys decide if it is preferable to change the detection logic:
Please find a solution without adding awk as a dependency for the dkms package...

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why? To request such things you have to provide strong arguments that you didn't. Also, awk is already used by dkms script as well as many other tools such as grep, sed etc. Should dependencies be dropped on all of them?

Copy link

@TriMoon TriMoon Nov 29, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@alsgnet Stating what you claim and providing proof of that are two different things...
I don't see awk as a dependency for dkms on my system...

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@TriMoon , it is off-topic. Please raise your questions with a packages vendor which is Canonical in your case.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@alsgnet please press reset wait 30s then retry again.
Doesn't make any sense with repesct to what you wrote either doesn't it? same with your redirect to the biggest Linux distro maker...

Anyhow idc anymore what and how you code, might as well try python/lisp or even javascript 🤦‍♀️ 🖖


invoke_command "{ $the_make_command; } >> $build_log 2>&1" "$the_make_command" background || \
report_build_problem 10 $"Bad return status for module build on kernel: $kernelver ($arch)" \
Expand Down