summaryrefslogtreecommitdiffstats
path: root/scripts/kmodtool
diff options
context:
space:
mode:
authorSamuel VERSCHELDE <[email protected]>2019-06-10 18:06:58 +0200
committerBrian Behlendorf <[email protected]>2019-06-10 09:06:58 -0700
commit01d1e88b1aad73f76b0071fba1a79d79bda24c96 (patch)
tree7bc7dee9f3fe5391d51d401892cc4d48d5bc785f /scripts/kmodtool
parent893a6d62c1895f3e3eeb660b048236571995a564 (diff)
Fix %post and %postun generation in kmodtool
During zfs-kmod RPM build, $(uname -r) gets unintentionally evaluated on the build host, once and for all. It should be evaluated during the execution of the scriptlets on the installation host. Escaping the $ character avoids evaluating it during build. Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Olaf Faaland <[email protected]> Reviewed-by: Neal Gompa <[email protected]> Signed-off-by: Samuel Verschelde <[email protected]> Closes #8866
Diffstat (limited to 'scripts/kmodtool')
-rwxr-xr-xscripts/kmodtool4
1 files changed, 2 insertions, 2 deletions
diff --git a/scripts/kmodtool b/scripts/kmodtool
index 27a14cdac..a632dd046 100755
--- a/scripts/kmodtool
+++ b/scripts/kmodtool
@@ -178,9 +178,9 @@ EOF
else
cat <<EOF
%post -n kmod-${kmodname}-${kernel_uname_r}
-[[ "$(uname -r)" == "${kernel_uname_r}" ]] && ${prefix}/sbin/depmod -a > /dev/null || :
+[[ "\$(uname -r)" == "${kernel_uname_r}" ]] && ${prefix}/sbin/depmod -a > /dev/null || :
%postun -n kmod-${kmodname}-${kernel_uname_r}
-[[ "$(uname -r)" == "${kernel_uname_r}" ]] && ${prefix}/sbin/depmod -a > /dev/null || :
+[[ "\$(uname -r)" == "${kernel_uname_r}" ]] && ${prefix}/sbin/depmod -a > /dev/null || :
EOF
fi