From 008dae863de6802b3f6c6a043d8dcce90c671365 Mon Sep 17 00:00:00 2001 From: Somasundaram Krishnasamy Date: Fri, 6 Oct 2017 16:54:06 -0700 Subject: [PATCH] uek-rpm: Clean up installed directories when uninstalling kernel-ueknano 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//kernel and its subdirectories are left intact even after the package uninstall. This commit adds post uninstall scriptlet to remove the "/lib/modules//" directory when the package is uninstalled. Signed-off-by: Somasundaram Krishnasamy Reviewed-by: Jack Vogel --- uek-rpm/ol6/kernel-uek.spec | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/uek-rpm/ol6/kernel-uek.spec b/uek-rpm/ol6/kernel-uek.spec index 25a8e3176f7f6..cfcc0a7ed9a85 100644 --- a/uek-rpm/ol6/kernel-uek.spec +++ b/uek-rpm/ol6/kernel-uek.spec @@ -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//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] -- 2.50.1