Skip to content

Commit

Permalink
fix(45ifcfg): mark as deprecated and strictly opt-in
Browse files Browse the repository at this point in the history
The `45ifcfg` module should be considered deprecated now since
ifcfg files themselves are deprecated. They've been replaced by e.g.
NetworkManager keyfiles or systemd-networkd files.

Currently, the `45ifcfg` module checks if the `/etc/sysconfig/network-
scripts` directory exists to know if to automatically get pulled in.
However, on systems with NetworkManager, this directory always exists
even if the functionality to read ifcfg files is disabled by default (NM
kindly ships a README in there to ease migrating to keyfiles).

Since almost everyone should've already migrated to a more modern
alternative, let's make this module purely opt-in now.
  • Loading branch information
jlebon committed Oct 27, 2023
1 parent 6acfeca commit 96a95f2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion modules.d/45ifcfg/module-setup.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
#!/bin/bash

# This module is deprecated. Modern replacements are NetworkManager keyfiles and
# systemd network files. It must now be explicitly opted in by the user to be
# added to the initrd.

# called by dracut
check() {
[[ -d $dracutsysrootdir/etc/sysconfig/network-scripts ]] && return 0
return 255
}

Expand Down
2 changes: 1 addition & 1 deletion test/TEST-60-BONDBRIDGEVLAN/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ test_setup() {
"$DRACUT" -l -i "$TESTDIR"/overlay / \
--no-early-microcode \
-o "plymouth" \
-a "debug ${USE_NETWORK}" \
-a "debug ${USE_NETWORK} ifcfg" \
--no-hostonly-cmdline -N \
-f "$TESTDIR"/initramfs.testing "$KVERSION" || return 1

Expand Down

0 comments on commit 96a95f2

Please sign in to comment.