Orabug:
26929773
When creating kernel-ueknano package, the files (modules) to be included in
it are supplied from a input file. This input file lists the modules with
install path. When installing the rpm, parent directories for these
files are created automatically. When uninstalling, the modules get removed
but not the parent directories. Because of this, /lib/modules/<kversion>/kernel
and its subdirectories are left intact even after the package uninstall.
This commit adds post uninstall scriptlet to remove the
"/lib/modules/<kversion>/" directory when the package is uninstalled.
Signed-off-by: Somasundaram Krishnasamy <somasundaram.krishnasamy@oracle.com>
Reviewed-by: Jack Vogel <jack.vogel@oracle.com>
Group: System Environment/Kernel
License: GPLv2
%kernel_reqprovconf -r
+Obsoletes: kernel-smp
%description -n kernel-ueknano
The kernel package contains the Linux kernel (vmlinuz), the core of any
Linux operating system. The kernel handles the basic functions
ln -sf /lib/firmware/%{rpmversion}-%{pkg_release} /lib/firmware/%{rpmversion}-%{pkg_release}.%{_target_cpu}\
%{nil}
+#
+# When uninstalling kernel-ueknano package, the modules get removed but the parent
+# directories are removed automatically as they are not tracked by rpm. This post uninstall scriptlet
+# cleanups the /lib/modules/<version>/kernel and its subdirectories.
+#
+%ifarch x86_64
+%postun -n kernel-ueknano
+ rm -rf /lib/modules/%{KVERREL}
+%{nil}
+%endif
+
#
# This macro defines a %%preun script for a kernel package.
# %%kernel_variant_preun [-n] <subpackage>