Skip to content

Commit e89afc5

Browse files
committed
Include unblacklist in initramfs (bsc#1224320)
Our modprobe.d files call /usr/lib/module-init-tools/unblacklist, causing an error message if modprobe is called on one of the blacklisted modules. Make sure unblacklist is included in the initrd, and is a no-op. Signed-off-by: Martin Wilck <[email protected]>
1 parent 9597ba3 commit e89afc5

File tree

3 files changed

+16
-2
lines changed

3 files changed

+16
-2
lines changed

10-unblacklist.conf

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# We ship modprobe.d files that call unblacklist.
2+
# It's a noop in the initramfs, but it needs to exist.
3+
install_items+=" /usr/lib/module-init-tools/unblacklist "

suse-module-tools.spec

+5
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
# This assumes post-usr-merge (20210527) for Tumbleweed
2121
%global modprobe_dir /usr/lib/modprobe.d
2222
%global depmod_dir /usr/lib/depmod.d
23+
%global dracutlibdir %{_prefix}/lib/dracut
2324
%global with_kernel_sysctl 1
2425
# boot_sysctl may be dropped on TW when we can assume that nobody keeps
2526
# kernel packages around that store sysctl files under /boot
@@ -126,6 +127,8 @@ for i in "pre" "preun" "post" "posttrans" "postun" ; do
126127
ln -s rpm-script %{buildroot}/usr/lib/module-init-tools/kernel-scriptlets/rpm-$i
127128
done
128129

130+
install -d -m 755 %{buildroot}%{dracutlibdir}/dracut.conf.d
131+
install -pm 644 10-unblacklist.conf %{buildroot}%{dracutlibdir}/dracut.conf.d
129132
install -d -m 755 "%{buildroot}%{_prefix}/bin"
130133

131134
# systemd service(s) to load kernel-specific sysctl settings
@@ -232,6 +235,8 @@ exit 0
232235
%{_unitdir}/systemd-sysctl.service.d
233236
%{_modulesloaddir}
234237
%{_udevrulesdir}
238+
%dir %{dracutlibdir}
239+
%{dracutlibdir}/dracut.conf.d
235240
%ifarch ppc64 ppc64le
236241
/usr/lib/systemd/system-generators
237242
%endif

unblacklist

+8-2
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,19 @@
11
#! /bin/sh
2-
# Copyright (c) 2021 SUSE LLC
2+
# Copyright (c) 2021-2024 SUSE LLC
33
# SPDX-License-Identifier: GPL-2.0-or-later
44

5+
ME="${0##*/}"
6+
if [ -e /etc/initrd-release ]; then
7+
[ "$RD_DEBUG" != "yes" ] || \
8+
echo "$ME: called in initramfs for \"$@\" - ignoring" >&2
9+
exit 0
10+
fi
11+
512
# Never unblacklist non-interactively
613
if ! tty -s <&0; then
714
exit 0
815
fi
916

10-
ME=$(basename "$0")
1117
if [ $UID -ne 0 ]; then
1218
echo "$ME: you must be root to run this program" >&2
1319
exit 1

0 commit comments

Comments
 (0)