From 01d1e88b1aad73f76b0071fba1a79d79bda24c96 Mon Sep 17 00:00:00 2001 From: Samuel VERSCHELDE Date: Mon, 10 Jun 2019 18:06:58 +0200 Subject: [PATCH] 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 Reviewed-by: Olaf Faaland Reviewed-by: Neal Gompa Signed-off-by: Samuel Verschelde Closes #8866 --- scripts/kmodtool | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/kmodtool b/scripts/kmodtool index 27a14cdac2..a632dd046b 100755 --- a/scripts/kmodtool +++ b/scripts/kmodtool @@ -178,9 +178,9 @@ EOF else cat < /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