Skip to content

Commit ce0a40c

Browse files
committed
redhat: Fix the ownership of /lib/modules/<kversion> directory
Upstream Status: RHEL-only ARK commit 77474b00e974f51edf1be49208795b9d1ecd4351 JIRA: https://issues.redhat.com/browse/RHEL-21034 /lib/modules/<kversion> is currently owned by 'kernel-core' so when this package is not installed (e.g. UKI use-case), the empty directory is not removed when kernel RPMs are removed. To make the removal work reliably regardless of the installed RPM set and the removal order, make /lib/modules/<kversion> (and /lib/modules for completeness) owned by: - kernel-core - kernel-modules-core - kernel-uki-virt Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
1 parent ea7aff5 commit ce0a40c

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

redhat/kernel.spec.template

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3662,6 +3662,8 @@ fi
36623662
%ghost %attr(0600, root, root) /boot/initramfs-%{KVERREL}%{?3:+%{3}}.img\
36633663
%ghost %attr(0644, root, root) /boot/config-%{KVERREL}%{?3:+%{3}}\
36643664
%{expand:%%files -f kernel-%{?3:%{3}-}modules-core.list %{?3:%{3}-}modules-core}\
3665+
%dir /lib/modules\
3666+
%dir /lib/modules/%{KVERREL}%{?3:+%{3}}\
36653667
%dir /lib/modules/%{KVERREL}%{?3:+%{3}}/kernel\
36663668
/lib/modules/%{KVERREL}%{?3:+%{3}}/build\
36673669
/lib/modules/%{KVERREL}%{?3:+%{3}}/source\
@@ -3712,6 +3714,8 @@ fi
37123714
%if %{efiuki}\
37133715
%if "%{3}" != "rt" && "%{3}" != "rt-debug"\
37143716
%{expand:%%files %{?3:%{3}-}uki-virt}\
3717+
%dir /lib/modules\
3718+
%dir /lib/modules/%{KVERREL}%{?3:+%{3}}\
37153719
%attr(0600, root, root) /lib/modules/%{KVERREL}%{?3:+%{3}}/System.map\
37163720
/lib/modules/%{KVERREL}%{?3:+%{3}}/symvers.gz\
37173721
/lib/modules/%{KVERREL}%{?3:+%{3}}/config\

0 commit comments

Comments
 (0)