net: Added switch between NetworkManager (etcnet) and NetworkManager (native)

NetworkManager (etcnet) is default now.
This commit is contained in:
Anton Midyukov 2021-03-15 21:53:38 +07:00
parent 6741ce4edf
commit 4fa38acd17
2 changed files with 11 additions and 1 deletions

View File

@ -1,4 +1,5 @@
+nm: use/net/nm; @: +nm: use/net/nm; @:
+nm-native: use/net/nm/native; @:
use/net: use/services use/pkgpriorities use/net: use/services use/pkgpriorities
@$(call add_feature) @$(call add_feature)
@ -21,6 +22,11 @@ use/net/nm: use/net
@$(call add,DEFAULT_SERVICES_ENABLE,network) # need for NM? @$(call add,DEFAULT_SERVICES_ENABLE,network) # need for NM?
@$(call add,DEFAULT_SERVICES_ENABLE,NetworkManager ModemManager) @$(call add,DEFAULT_SERVICES_ENABLE,NetworkManager ModemManager)
@$(call add,DEFAULT_SERVICES_ENABLE,livecd-save-nfs) # keep interface up @$(call add,DEFAULT_SERVICES_ENABLE,livecd-save-nfs) # keep interface up
@$(call xport,NM_native)
# use NetworkManager(native)
use/net/nm/native: use/net/nm
@$(call set,NM_Native,yes)
# NOT recommended unless you know what you're doing # NOT recommended unless you know what you're doing
# (e.g. dnsmasq can win a race against dhcpcd) # (e.g. dnsmasq can win a race against dhcpcd)

View File

@ -7,5 +7,9 @@ defcfg=/etc/net/ifaces/default/options-eth
if [ -x /usr/sbin/NetworkManager -o -x /usr/sbin/connmand ]; then if [ -x /usr/sbin/NetworkManager -o -x /usr/sbin/connmand ]; then
shell_config_set "$defcfg" NM_CONTROLLED yes shell_config_set "$defcfg" NM_CONTROLLED yes
shell_config_set "$defcfg" DISABLED yes shell_config_set "$defcfg" DISABLED yes
if [ NM_Native = 'yes' ]; then
shell_config_set "$defcfg" BOOTPROTO static shell_config_set "$defcfg" BOOTPROTO static
else
shell_config_set "$defcfg" BOOTPROTO dhcp
fi
fi fi