From: Somasundaram Krishnasamy Date: Fri, 6 Oct 2017 23:54:06 +0000 (-0700) Subject: uek-rpm: Clean up installed directories when uninstalling kernel-ueknano X-Git-Tag: v4.1.12-117.0_27200813_3~204 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=008dae863de6802b3f6c6a043d8dcce90c671365;p=users%2Fjedix%2Flinux-maple.git 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 --- diff --git a/uek-rpm/ol6/kernel-uek.spec b/uek-rpm/ol6/kernel-uek.spec index 25a8e3176f7f..cfcc0a7ed9a8 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]