# $HeadURL$ $LastChangedRevision$ ifndef FACILITY_NETWORK_MK FACILITY_NETWORK_MK = 1 # In pass #1: load recipe generators # In pass #0: load generated recipes include method-service.mk include file-tradnics.mk include file-traddnss.mk include file-nmnics.mk include file-nmdnss.mk include file-hosts.mk include method-copy.mk # Do not install stuff in this facility; the network may be down! # Variables mentioned both in pass#1 and pass#0. # Tell recipe generators what to generate recipes for ifeq ($(PCMS_PASS_NUM),1) all.service: networking.service #all.copy: $(shell encode /etc/NetworkManager/conf.d/stop-nm-touching-resolv.conf).copy all.copy: $(shell encode /etc/NetworkManager/conf.d/stop-nm-automatically-managing-wired-connections.conf).copy all.uninstall: network-manager.uninstall # No .install targets allowed here! # The real Makefile else ifeq ($(PCMS_PASS_NUM),0) all.facility: network.facility # Dependencies differ on laptops ifeq ($(HOST_PROFILE),laptop) # laptops have one traditionally managed NIC: loopback. NM won't manage this # (see https://access.redhat.com/solutions/2108251). network.facility: hosts.file drivers.facility tradnics.file nmnics.file nmdnss.file tradnics.file nmnics.file nmdns.file: purge-nm-config.fix else network.facility: hosts.file drivers.facility tradnics.file traddnss.file tradnics.file traddnss.file: network-manager.uninstall endif # Recipe is the same everywhere network.facility: msg --progname=$(PROGNAME) --debug=$(VERBOSELEVEL) info "restarting networking with 10s settle time ..." systemctl restart networking sleep 10 netreach --debug=$(VERBOSELEVEL) internet touch $@ # purge-nm-config.fix is a dependency of configuring individual NM-managed NICs *and* individual # tradnic entries in /etc/network/interfaces. *This* file is the 'lowest' file that controls # both those things, so it's the best place to put the recipe for purge-nm-config.fix. purge-nm-config.fix: $(shell encode /etc/NetworkManager/conf.d/stop-nm-automatically-managing-wired-connections.conf).copy @# can't use xargs to process list as listy may be empty and xargs can't handle that. if type -p nmcli > /dev/null; then \ nmcli -t conn show | cut -f1 -d: | while read CONN_NAME; do nmcli conn delete "$$CONN_NAME"; done; \ fi touch $@ endif # PCMS_PASS_NUM endif # FACILITY_NETWORK_MK