diff --git a/Makefile b/Makefile index 7647e16..e62f35e 100644 --- a/Makefile +++ b/Makefile @@ -60,7 +60,6 @@ check: check-message $(foreach dep,$(DEPENDENCIES),require($(dep))) FORCE: -# XXX should thisbe an env var or an arg to make.sh??? %-bootstrap: export BOOTSTRAP=1 %-bootstrap: % @true @@ -100,24 +99,24 @@ gate: gate-traefik #---------------------------------------------------------------------- -# XXX goal: -# - build minimal system -# - bootstrap bridge -# - gate -# - ns -# ...not yet sure of the best way to do this... -# +# Bootstrap stage 1: build basic infrastructure... .PHONY: bootstrap -bootstrap: host-bootstrap gate-bootstrap \ - ns \ - ssh \ - wireguard \ +bootstrap: \ + host-bootstrap \ + gate-bootstrap \ + ns ssh wireguard \ bootstrap-clean -# NOTE: host-bootstrap-clean will drop all connections to the server... -.PHONY: bootstrap-clean -bootstrap-clean: gate-bootstrap-clean #host-bootstrap-clean +# Bootstrap stage 2: reconnect host through the base infrastructure... +.PHONY: bootstrap-clean host-bootstrap-clean +bootstrap-clean: host-bootstrap-clean + + +# Finalize: reconect admin port/bridge correctly... +.PHONY: finalize +finalize: bootstrap-clean gate-bootstrap-clean + @ make host-bootstrap-clean @@ -139,6 +138,12 @@ dev: minimal $(DEV_CTs) all: minimal $(APP_CTs) +.PHONY: test +test: + @echo "TEST!" + +test2: test test + #---------------------------------------------------------------------- diff --git a/host/make.sh b/host/make.sh index 9aa4c0c..dce0ef7 100755 --- a/host/make.sh +++ b/host/make.sh @@ -47,10 +47,20 @@ BRIDGES_TPL=bridges.tpl # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Bootstrap... -if ! [ -z $BOOTSTRAP_CLEAN ] \ - && [ -e "$INTERFACES".clean ] ; then +if ! [ -z $BOOTSTRAP_CLEAN ] ; then @ cp "$INTERFACES"{,.bak} - @ cp "$INTERFACES"{.clean,.new} + + # stage 1: bootstrap -> clean + if [ -e "$INTERFACES".clean ] ; then + @ mv "$INTERFACES"{.clean,.new} + # stage 2: clean -> final + elif [ -e "$INTERFACES".final ] ; then + @ mv "$INTERFACES"{.final,.new} + # donw + else + exit + fi + if reviewApplyChanges "$INTERFACES" ; then # XXX this must be done in nohup to avoid breaking on connection lost... if ! @ ifreload -a ; then