fix(network-manager): cope with distributions not using `libexec`
parent
3ad3b3a40d
commit
22d6863ef1
|
@ -30,7 +30,7 @@ install() {
|
||||||
inst_multiple ip sed grep
|
inst_multiple ip sed grep
|
||||||
|
|
||||||
inst NetworkManager
|
inst NetworkManager
|
||||||
inst /usr/libexec/nm-initrd-generator
|
inst_multiple -o /usr/{lib,libexec}/nm-initrd-generator
|
||||||
inst_multiple -o teamd dhclient
|
inst_multiple -o teamd dhclient
|
||||||
inst_hook cmdline 99 "$moddir/nm-config.sh"
|
inst_hook cmdline 99 "$moddir/nm-config.sh"
|
||||||
if dracut_module_included "systemd"; then
|
if dracut_module_included "systemd"; then
|
||||||
|
@ -59,7 +59,7 @@ install() {
|
||||||
inst_simple "$moddir/nm-lib.sh" "/lib/nm-lib.sh"
|
inst_simple "$moddir/nm-lib.sh" "/lib/nm-lib.sh"
|
||||||
|
|
||||||
if [[ -x "$initdir/usr/sbin/dhclient" ]]; then
|
if [[ -x "$initdir/usr/sbin/dhclient" ]]; then
|
||||||
inst /usr/libexec/nm-dhcp-helper
|
inst_multiple -o /usr/{lib,libexec}/nm-dhcp-helper
|
||||||
elif ! [[ -e "$initdir/etc/machine-id" ]]; then
|
elif ! [[ -e "$initdir/etc/machine-id" ]]; then
|
||||||
# The internal DHCP client silently fails if we
|
# The internal DHCP client silently fails if we
|
||||||
# have no machine-id
|
# have no machine-id
|
||||||
|
|
|
@ -4,8 +4,15 @@ type getcmdline > /dev/null 2>&1 || . /lib/dracut-lib.sh
|
||||||
|
|
||||||
nm_generate_connections() {
|
nm_generate_connections() {
|
||||||
rm -f /run/NetworkManager/system-connections/*
|
rm -f /run/NetworkManager/system-connections/*
|
||||||
|
if [ -x /usr/libexec/nm-initrd-generator ]; then
|
||||||
# shellcheck disable=SC2046
|
# shellcheck disable=SC2046
|
||||||
/usr/libexec/nm-initrd-generator -- $(getcmdline)
|
/usr/libexec/nm-initrd-generator -- $(getcmdline)
|
||||||
|
elif [ -x /usr/lib/nm-initrd-generator ]; then
|
||||||
|
# shellcheck disable=SC2046
|
||||||
|
/usr/lib/nm-initrd-generator -- $(getcmdline)
|
||||||
|
else
|
||||||
|
derror "nm-initrd-generator not found"
|
||||||
|
fi
|
||||||
|
|
||||||
if getargbool 0 rd.neednet; then
|
if getargbool 0 rd.neednet; then
|
||||||
for i in /usr/lib/NetworkManager/system-connections/* \
|
for i in /usr/lib/NetworkManager/system-connections/* \
|
||||||
|
|
Loading…
Reference in New Issue