Skip to content

Commit e8257de

Browse files
aafeijoo-suseLaszloGombos
authored andcommitted
fix(dracut-lib): only remove initqueue/finished scripts, not the hook dir
The `remove_hostonly_files` function should only remove (as its name suggests) hostonly configuration and files. The initqueue/finished scripts considered as hostonly that must be removed are added via `wait_for_dev`. But, the `hookdirs` are always created at build time, and should not be removed. This patch also allows to remove the `mkdir` workaround in the `network-manager` module (copied-pasted into the `connman` module after), and avoids having to add it tree-wide in many missing places. Fixes 87e90d7 Fixes dracutdevs#2620
1 parent 1ac8f8f commit e8257de

File tree

3 files changed

+1
-3
lines changed

3 files changed

+1
-3
lines changed

modules.d/35connman/cm-lib.sh

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ type getcmdline > /dev/null 2>&1 || . /lib/dracut-lib.sh
44

55
cm_generate_connections() {
66
if getargbool 0 rd.neednet; then
7-
mkdir -p "$hookdir"/initqueue/finished
87
echo '[ -f /tmp/cm.done ]' > "$hookdir"/initqueue/finished/cm.sh
98
mkdir -p /run/connman/initrd
109
: > /run/connman/initrd/neednet # activate ConnMan services

modules.d/35network-manager/nm-lib.sh

-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ nm_generate_connections() {
2020
/etc/NetworkManager/system-connections/* \
2121
/etc/sysconfig/network-scripts/ifcfg-*; do
2222
[ -f "$i" ] || continue
23-
mkdir -p "$hookdir"/initqueue/finished
2423
echo '[ -f /tmp/nm.done ]' > "$hookdir"/initqueue/finished/nm.sh
2524
mkdir -p /run/NetworkManager/initrd
2625
: > /run/NetworkManager/initrd/neednet # activate NM services

modules.d/99base/dracut-lib.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1143,7 +1143,7 @@ check_meminfo() {
11431143
}
11441144

11451145
remove_hostonly_files() {
1146-
rm -fr /etc/cmdline /etc/cmdline.d/*.conf "$hookdir/initqueue/finished"
1146+
rm -fr /etc/cmdline /etc/cmdline.d/*.conf "$hookdir"/initqueue/finished/*.sh
11471147
if [ -f /lib/dracut/hostonly-files ]; then
11481148
while read -r line || [ -n "$line" ]; do
11491149
[ -e "$line" ] || [ -h "$line" ] || continue

0 commit comments

Comments
 (0)