Skip to content
Permalink
Browse files

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 <behlendorf1@llnl.gov>
Reviewed-by: Olaf Faaland <faaland1@llnl.gov>
Reviewed-by: Neal Gompa <ngompa@datto.com>
Signed-off-by: Samuel Verschelde <stormi-xcp@ylix.fr>
Closes #8866
  • Loading branch information...
stormi authored and behlendorf committed Jun 10, 2019
1 parent 8dc8bbd commit eaa21b2349fadcbbc9ebf48775311898ab27d2fb
Showing with 2 additions and 2 deletions.
  1. +2 −2 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

0 comments on commit eaa21b2

Please sign in to comment.
You can’t perform that action at this time.