]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
uek-rpm: Clean up installed directories when uninstalling kernel-ueknano
authorSomasundaram Krishnasamy <somasundaram.krishnasamy@oracle.com>
Fri, 6 Oct 2017 23:54:06 +0000 (16:54 -0700)
committerSomasundaram Krishnasamy <somasundaram.krishnasamy@oracle.com>
Wed, 11 Oct 2017 22:13:57 +0000 (15:13 -0700)
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>
uek-rpm/ol6/kernel-uek.spec

index 25a8e3176f7f645a78a9aad172b07d19e324b6d0..cfcc0a7ed9a85a9be8ef3c6906ae1682bffdd6be 100644 (file)
@@ -628,6 +628,7 @@ Summary: The Linux kernel
 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
@@ -1646,6 +1647,17 @@ fi\
 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>