]> git.proxmox.com Git - mirror_zfs.git/commitdiff
Fix %post and %postun generation in kmodtool
authorSamuel VERSCHELDE <stormi-github@ylix.fr>
Mon, 10 Jun 2019 16:06:58 +0000 (18:06 +0200)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Mon, 10 Jun 2019 16:06:58 +0000 (09:06 -0700)
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

scripts/kmodtool

index 27a14cdac23a8e1a381953c5a505485148df1b09..a632dd046b5a01ba205e05ce9ee28e9937ae196f 100755 (executable)
@@ -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