-
Notifications
You must be signed in to change notification settings - Fork 1
feat: allow multiple architectures from netinstall-cli 7.16 #5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| ARCH ?= arm | ||
| ARCH ?= arm arm64 | ||
|
||
| PKGS ?= wifi-qcom-ac | ||
| CHANNEL ?= stable | ||
| OPTS ?= -b -r | ||
|
|
@@ -10,18 +10,28 @@ URLVER ?= https://upgrade.mikrotik.com/routeros/NEWESTa7 | |
| channel_ver = $(firstword $(shell wget -q -O - $(URLVER).$(1))) | ||
| VER ?= $(call channel_ver,$(CHANNEL)) | ||
| VER_NETINSTALL ?= $(call channel_ver,$(CHANNEL)) | ||
| PKGS_FILES := $(foreach pkg, $(PKGS), $(pkg)-$(VER)-$(ARCH).npk) | ||
| PKGS_FILES := $(foreach somearch, $(ARCH), $(foreach pkg, $(PKGS), $(pkg)-$(VER)-$(somearch).npk)) | ||
|
|
||
| QEMU ?= ./i386 | ||
| PLATFORM ?= $(shell uname -m) | ||
| FIRST_MULTIARCH_NETINSTALL_VER ?= 7.16 | ||
|
|
||
| .PHONY: run all service download clean nothing dump extra-packages stable long-term testing arm arm64 mipsbe mmips smips ppc tile x86 | ||
| .SUFFIXES: | ||
|
|
||
| define compare_versions | ||
| $(if $(findstring $(word 1,$(sort $(1) $(2))),$(2)),true,false) | ||
| endef | ||
|
Comment on lines
+22
to
+24
|
||
|
|
||
| run: all | ||
| $(eval PKGS_FILES := $(shell for file in $(PKGS_FILES); do if [ -e "./$$file" ]; then echo "$$file"; fi; done)) | ||
| @echo starting netinstall... PLATFORM=$(PLATFORM) ARCH=$(ARCH) VER=$(VER) OPTS="$(OPTS)" NET_OPTS="$(NET_OPTS)" PKGS=$(PKGS) | ||
| @echo using $(PKGS_FILES) | ||
|
|
||
| $(if $(call compare_versions,$(VER_NETINSTALL),$(FIRST_MULTIARCH_NETINSTALL_VER)), , \ | ||
| $(if $(findstring ,$(wordlist 2,2,$(ARCH))),, \ | ||
| $(error "You cannot have multiple ARCH items if you use netinstall-cli < 7.16"))) | ||
|
Comment on lines
+31
to
+33
|
||
|
|
||
| $(if $(findstring x86_64, $(PLATFORM)), , $(QEMU)) ./netinstall-cli-$(VER_NETINSTALL) $(OPTS) $(NET_OPTS) routeros-$(VER)-$(ARCH).npk $(PKGS_FILES) $(PKGS_CUSTOM) | ||
|
||
|
|
||
| service: all | ||
|
|
@@ -30,7 +40,7 @@ service: all | |
| download: all | ||
| @echo use 'make' to run netinstall after connecting $(IFACE) or $(CLIENTIP) to router | ||
|
|
||
| all: routeros-$(VER)-$(ARCH).npk netinstall-cli-$(VER_NETINSTALL) all_packages-$(ARCH)-$(VER).zip | ||
| all: $(foreach somearch,$(ARCH),routeros-$(VER)-$(somearch).npk netinstall-cli-$(VER_NETINSTALL) all_packages-$(somearch)-$(VER).zip) | ||
| @echo finished download ARCH=$(ARCH) VER=$(VER) PKGS=$(PKGS) PLATFORM=$(PLATFORM) | ||
|
Comment on lines
+43
to
44
|
||
|
|
||
| dump: | ||
|
|
@@ -49,12 +59,12 @@ netinstall-cli-$(VER_NETINSTALL): netinstall-$(VER_NETINSTALL).tar.gz | |
| mv netinstall-cli netinstall-cli-$(VER_NETINSTALL) | ||
| touch netinstall-cli-$(VER_NETINSTALL) | ||
|
|
||
| routeros-$(VER)-$(ARCH).npk: | ||
| routeros-$(VER)-%.npk: | ||
| wget https://download.mikrotik.com/routeros/$(VER)/$@ | ||
|
|
||
| all_packages-$(ARCH)-$(VER).zip: | ||
| all_packages-%-$(VER).zip: | ||
| wget https://download.mikrotik.com/routeros/$(VER)/$@ | ||
| unzip -o all_packages-$(ARCH)-$(VER).zip | ||
| unzip -o all_packages-$*-$(VER).zip | ||
|
|
||
| stable long-term testing: | ||
| $(MAKE) $(filter-out $@,$(MAKECMDGOALS)) CHANNEL=$@ ARCH=$(ARCH) | ||
|
|
@@ -63,4 +73,4 @@ arm arm64 mipsbe mmips smips ppc tile x86: | |
| $(MAKE) $(filter-out $@,$(MAKECMDGOALS)) CHANNEL=$(CHANNEL) ARCH=$@ | ||
|
|
||
| nothing: | ||
| while :; do sleep 3600; done | ||
| while :; do sleep 3600; done | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With a multi-item default like
ARCH ?= arm arm64, any recursive$(MAKE) ... ARCH=$(ARCH)invocations will be parsed by the shell as multiple words (e.g.,make ... ARCH=arm arm64 ...), causingarm64to be treated as an extra make goal and dropping the intended multi-arch value. Quote/escape the assignment in recursive make calls (e.g.,ARCH='$(ARCH)') or avoid space-separated lists forARCHin those paths.