Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(dracut-lib): only remove initqueue/finished scripts, not the hook dir #2623

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion modules.d/35connman/cm-lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ type getcmdline > /dev/null 2>&1 || . /lib/dracut-lib.sh

cm_generate_connections() {
if getargbool 0 rd.neednet; then
mkdir -p "$hookdir"/initqueue/finished
echo '[ -f /tmp/cm.done ]' > "$hookdir"/initqueue/finished/cm.sh
mkdir -p /run/connman/initrd
: > /run/connman/initrd/neednet # activate ConnMan services
Expand Down
1 change: 0 additions & 1 deletion modules.d/35network-manager/nm-lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ nm_generate_connections() {
/etc/NetworkManager/system-connections/* \
/etc/sysconfig/network-scripts/ifcfg-*; do
[ -f "$i" ] || continue
mkdir -p "$hookdir"/initqueue/finished
echo '[ -f /tmp/nm.done ]' > "$hookdir"/initqueue/finished/nm.sh
mkdir -p /run/NetworkManager/initrd
: > /run/NetworkManager/initrd/neednet # activate NM services
Expand Down
2 changes: 1 addition & 1 deletion modules.d/99base/dracut-lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1131,7 +1131,7 @@ show_memstats() {
}

remove_hostonly_files() {
rm -fr /etc/cmdline /etc/cmdline.d/*.conf "$hookdir/initqueue/finished"
rm -fr /etc/cmdline /etc/cmdline.d/*.conf "$hookdir"/initqueue/finished/*.sh
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be possible to make this even more generic, e.g.

"$hookdir"/initqueue/finished/*

if [ -f /lib/dracut/hostonly-files ]; then
while read -r line || [ -n "$line" ]; do
[ -e "$line" ] || [ -h "$line" ] || continue
Expand Down
Loading