glean/glean/tests/fixtures/test/hp.redhat.network.out
Ian Wienand 8f9b156acc Add NetworkManager distro plugin support
On Fedora 29+, the network.service scripts have been moved into a
separate deprecated package.  NetworkManager is the supported
interface for configuring networks.  We have ignored NM for a long
time, but we are now running out of options.

Luckily we can support this fairly easily with the ifcfg-rh disto
plugin that NM provides.  Using this, the existing
/etc/sysconfig/network-scripts files are used by NM.  The only slight
difference to the config files is that we need to tell NM it's ok to
use it by removing NM_CONTROLLED=no.  We also need to update the
.service file which needs to call glean with the flag to enable NM,
and doesn't need to call ifup.  We have found that local-fs.target
seems to be the best place to run this so it's nice and early.

This is plumbed through from simple-init in DIB
(I4d76e88ce25e5675fd5ef48924acd09915a62a4b) which will call
glean-install with the new --use-nm flag if
DIB_SIMPLE_INIT_NETWORKMANAGER is set.

Since all Centos and Feodora are using NetworkManager by default,
there is an argument that we should just switch to this and not bother
with a flag.  However, since NM brings in new libraries and possibly
other changes to the base system, it's very possible we will either
want to revert the change temporarily or perhaps even run parallel
with and without.  In these cases we can simply flip the variable in
DIB and rebuild rather than having to revert code and do new glean
releases.  Longer term (say, around time we bring up CentOS 8), I see
this becoming the default.

Other platforms have distro plugins for NM to read their "legacy"
configuration files too in the same way as here.  This is left as
future work.

NetworkManager enabled build and boot for Centos and Fedora is tested
in I640838c68a05f3b22683c1e90279725a77678526

Change-Id: I3d379d35e7b000f32c3f6cc197c8aaafebc683fb
2018-11-29 21:28:25 +11:00

25 lines
552 B
Plaintext

### Write /etc/sysconfig/network-scripts/ifcfg-eth0
# Automatically generated, do not edit
DEVICE=eth0
BOOTPROTO=dhcp
HWADDR=bc:76:4e:01:62:86
ONBOOT=yes
%NM_CONTROLLED%
TYPE=Ethernet
### Write /etc/sysconfig/network-scripts/ifcfg-eth1
# Automatically generated, do not edit
DEVICE=eth1
BOOTPROTO=dhcp
HWADDR=bc:76:4e:05:7b:06
ONBOOT=yes
%NM_CONTROLLED%
TYPE=Ethernet
### Write /etc/sysconfig/network-scripts/ifcfg-eth3
# Automatically generated, do not edit
DEVICE=eth3
BOOTPROTO=dhcp
HWADDR=bc:76:4e:12:a4:bb
ONBOOT=yes
%NM_CONTROLLED%
TYPE=Ethernet