init/Makefile: Disallow default MAC Address (#446)

Defaulting the MAC address of a device will cause issues when connecting multiple devices to a network. The makefile now requires the caller to set the MAC address using the MA argument whenever the netsender.conf file is being updated.
This commit is contained in:
David Sutton 2024-04-22 11:22:11 +09:30
parent 9f56bee095
commit d6c230e97f
1 changed files with 12 additions and 3 deletions

View File

@ -13,9 +13,6 @@ RUN_SCRIPT_DIR := /src/bitbucket.org/ausocean/av/init/run.sh
# Change this to withcv if you wish to use CV.
BUILD_TAG :=
ifeq ($(MA),)
MA := "00:E0:4C:00:00:01"
endif
ifeq ($(DK),)
DK := 0
endif
@ -69,6 +66,10 @@ soft_copy_files:
if [ -f /etc/netsender.conf ] ; then \
echo "/etc/netsender.conf left unmodified" ; \
else \
if [ -z "$(MA)" ]; then \
echo "/etc/netsender.conf not defined, must set MAC address using MA= in call to make" ; \
exit 1; \
fi ; \
printf "ma $(MA)\ndk $(DK)\n" > /etc/netsender.conf; \
bash permissions.sh; \
fi
@ -83,6 +84,10 @@ hard_copy_files:
echo "Backed up netsender.conf to /etc/netsender.conf.bak"; \
cp /etc/netsender.conf /etc/netsender.conf.bak ; \
fi
if [ -z "$(MA)" ]; then \
echo "/etc/netsender.conf not defined, must set MAC address using MA= in call to make" ; \
exit 1; \
fi
printf "ma $(MA)\ndk $(DK)\n" > /etc/netsender.conf
bash permissions.sh
@ -97,6 +102,10 @@ hard_copy_files_treat:
echo "Backed up netsender.conf to /etc/netsender.conf.bak"; \
cp /etc/netsender.conf /etc/netsender.conf.bak ; \
fi
if [ -z "$(MA)" ]; then \
echo "/etc/netsender.conf not defined, must set MAC address using MA= in call to make" ; \
exit 1; \
fi
printf "ma $(MA)\ndk $(DK)\n" > /etc/netsender.conf
bash permissions.sh