Skip to content

Commit

Permalink
Fallback to uncompressed module when compress fails
Browse files Browse the repository at this point in the history
  • Loading branch information
deepskyblue86 authored and scaronni committed Feb 10, 2022
1 parent e09f306 commit 1194db8
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions dkms.in
Original file line number Diff line number Diff line change
Expand Up @@ -966,13 +966,17 @@ actual_build()
fi

if [ "$module_compressed_suffix" = ".gz" ]; then
gzip -9f "$built_module"
gzip -9f "$built_module" || compressed_module=""
elif [ "$module_compressed_suffix" = ".xz" ]; then
xz -f "$built_module"
xz -f "$built_module" || compressed_module=""
elif [ "$module_compressed_suffix" = ".zst" ]; then
zstd -q -f -T0 -20 --ultra "$built_module"
zstd -q -f -T0 -20 --ultra "$built_module" || compressed_module=""
fi
if [ -n "$compressed_module" ]; then
cp -f "$compressed_module" "$base_dir/module/${dest_module_name[$count]}$module_suffix" >/dev/null
else
cp -f "$built_module" "$base_dir/module/${dest_module_name[$count]}$module_uncompressed_suffix" >/dev/null
fi
cp -f "$compressed_module" "$base_dir/module/${dest_module_name[$count]}$module_suffix" >/dev/null
done

# Run the post_build script
Expand Down

0 comments on commit 1194db8

Please sign in to comment.