mirror of
				https://github.com/Telecominfraproject/wlan-ap.git
				synced 2025-10-31 18:38:10 +00:00 
			
		
		
		
	ucentral: development update
* add board information page to webui * fix github workflow, it actually reports fails now Signed-off-by: John Crispin <john@phrozen.org>
This commit is contained in:
		
							
								
								
									
										2
									
								
								.github/workflows/build-dev.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								.github/workflows/build-dev.yml
									
									
									
									
										vendored
									
									
								
							| @@ -10,7 +10,7 @@ jobs: | |||||||
|     strategy: |     strategy: | ||||||
|       fail-fast: false |       fail-fast: false | ||||||
|       matrix: |       matrix: | ||||||
|         target: ['cig_wf188', 'cig_wf194c', 'cig_wf160d.yml', 'edgecore_eap101', 'edgecore_eap102', 'edgecore_ecs4100-12ph', 'edgecore_ecw5211', 'linksys_e8450', 'linksys_ea8300', 'mikrotik_rb91x', 'tplink_cpe210_v3', 'tplink_ex227', 'tplink_ex447', 'zyxel_gs1900-10hp'] |         target: ['cig_wf188', 'cig_wf194c', 'cig_wf160d', 'edgecore_eap101', 'edgecore_eap102', 'edgecore_ecs4100-12ph', 'edgecore_ecw5211', 'linksys_e8450', 'linksys_ea8300', 'mikrotik_rb91x', 'tplink_cpe210_v3', 'tplink_ex227', 'tplink_ex447', 'zyxel_gs1900-10hp'] | ||||||
|  |  | ||||||
|     steps: |     steps: | ||||||
|     - uses: actions/checkout@v2 |     - uses: actions/checkout@v2 | ||||||
|   | |||||||
							
								
								
									
										3
									
								
								build.sh
									
									
									
									
									
								
							
							
						
						
									
										3
									
								
								build.sh
									
									
									
									
									
								
							| @@ -24,5 +24,4 @@ cd - | |||||||
|  |  | ||||||
| echo "### Building image ..." | echo "### Building image ..." | ||||||
| cd $BUILD_DIR | cd $BUILD_DIR | ||||||
| make -j$(nproc) V=s 2>&1 | tee build.log | make -j$(nproc) V=s | ||||||
| echo "Done" |  | ||||||
|   | |||||||
| @@ -5,7 +5,7 @@ RUN apt-get update \ | |||||||
|     && apt-get install -y \ |     && apt-get install -y \ | ||||||
|             time git-core build-essential gcc-multilib \ |             time git-core build-essential gcc-multilib \ | ||||||
|             libncurses5-dev zlib1g-dev gawk flex gettext wget unzip python \ |             libncurses5-dev zlib1g-dev gawk flex gettext wget unzip python \ | ||||||
|             python3 python3-pip python3-yaml openvswitch-common openvswitch-switch libssl-dev rsync \ |             python3 python3-pip python3-yaml libssl-dev rsync \ | ||||||
|     && apt-get clean |     && apt-get clean | ||||||
| RUN git config --global user.email "you@example.com" | RUN git config --global user.email "you@example.com" | ||||||
| RUN git config --global user.name "Your Name" | RUN git config --global user.name "Your Name" | ||||||
|   | |||||||
| @@ -26,6 +26,11 @@ var callSystemValidateFirmwareImage = rpc.declare({ | |||||||
| 	reject: true | 	reject: true | ||||||
| }); | }); | ||||||
|  |  | ||||||
|  | var callSystemBoard = rpc.declare({ | ||||||
|  | 	object: 'system', | ||||||
|  | 	method: 'board' | ||||||
|  | }); | ||||||
|  |  | ||||||
| function parseAddressAndNetmask(ipaddr, netmask) { | function parseAddressAndNetmask(ipaddr, netmask) { | ||||||
|         var m = (ipaddr || '').match(/^(.+)\/(\d+)$/); |         var m = (ipaddr || '').match(/^(.+)\/(\d+)$/); | ||||||
|         if (m) { |         if (m) { | ||||||
| @@ -125,12 +130,16 @@ function showProgress(text, ongoing) { | |||||||
| 	} | 	} | ||||||
| } | } | ||||||
|  |  | ||||||
|  | var formSystemBoard; | ||||||
|  |  | ||||||
| return view.extend({ | return view.extend({ | ||||||
| 	load: function() { | 	load: function() { | ||||||
| 		return Promise.all([ | 		return Promise.all([ | ||||||
| 			uci.load('network'), | 			uci.load('network'), | ||||||
| 			uci.load('ucentral') | 			uci.load('ucentral'), | ||||||
|  | 			callSystemBoard().then(function(reply) { | ||||||
|  | 				formSystemBoard = reply; | ||||||
|  | 			}) | ||||||
| 		]); | 		]); | ||||||
| 	}, | 	}, | ||||||
|  |  | ||||||
| @@ -376,12 +385,18 @@ return view.extend({ | |||||||
| 			uci.get('network', 'wan', 'dns')); | 			uci.get('network', 'wan', 'dns')); | ||||||
|  |  | ||||||
| 		var formdata = { | 		var formdata = { | ||||||
|  | 			information: { | ||||||
|  | 				serial: formSystemBoard.hostname, | ||||||
|  | 				model: formSystemBoard.model, | ||||||
|  | 				version: formSystemBoard.release["tip-version"], | ||||||
|  | 				revision: formSystemBoard.release["tip-revision"] | ||||||
|  | 			}, | ||||||
| 			wan: { | 			wan: { | ||||||
| 				proto: uci.get('network', 'wan', 'proto'), | 				proto: uci.get('network', 'wan', 'proto'), | ||||||
| 				addr: addr_wan ? addr_wan[0] : null, | 				addr: addr_wan ? addr_wan[0] : null, | ||||||
| 				mask: addr_wan ? addr_wan[1] : null, | 				mask: addr_wan ? addr_wan[1] : null, | ||||||
| 				gateway: addr_wan ? addr_wan[1] : null, | 				gateway: addr_wan ? addr_wan[2] : null, | ||||||
| 				dns: addr_wan ? addr_wan[1] : null | 				dns: addr_wan ? addr_wan[3] : null | ||||||
| 			}, | 			}, | ||||||
| 			maintenance: {}, | 			maintenance: {}, | ||||||
| 			certificates: {redirector: null} | 			certificates: {redirector: null} | ||||||
| @@ -390,9 +405,19 @@ return view.extend({ | |||||||
| 		m = new form.JSONMap(formdata, _('Setup')); | 		m = new form.JSONMap(formdata, _('Setup')); | ||||||
| 		m.tabbed = true; | 		m.tabbed = true; | ||||||
|  |  | ||||||
|  | 		s = m.section(form.NamedSection, "information", 'information', _('Information')); | ||||||
|  | 		o = s.option(form.Value, 'serial', _('Serial')); | ||||||
|  | 		o.readonly = true; | ||||||
|  | 		o = s.option(form.Value, 'model', _('Model')); | ||||||
|  | 		o.readonly = true; | ||||||
|  | 		o = s.option(form.Value, 'version', _('Release')); | ||||||
|  | 		o.readonly = true; | ||||||
|  | 		o = s.option(form.Value, 'revision', _('Revision')); | ||||||
|  | 		o.readonly = true; | ||||||
|  |  | ||||||
| 		s = m.section(form.NamedSection, 'wan', 'wan', _('Connectivity')); | 		s = m.section(form.NamedSection, 'wan', 'wan', _('Connectivity')); | ||||||
|  |  | ||||||
| 		o = s.option(cbiRichListValue, 'proto'); | 		o = s.option(cbiRichListValue, 'proto', "Protocol"); | ||||||
| 		o.value('dhcp', E('div', { 'style': 'white-space:normal' }, [ | 		o.value('dhcp', E('div', { 'style': 'white-space:normal' }, [ | ||||||
| 			E('strong', [ _('Automatic address configuration (DHCP)') ]), E('br'), | 			E('strong', [ _('Automatic address configuration (DHCP)') ]), E('br'), | ||||||
| 			E('span', { 'class': 'hide-open' }) | 			E('span', { 'class': 'hide-open' }) | ||||||
|   | |||||||
| @@ -2,6 +2,9 @@ | |||||||
|  |  | ||||||
| cd /etc/ucentral/ | cd /etc/ucentral/ | ||||||
| tar xf /tmp/certs.tar | tar xf /tmp/certs.tar | ||||||
|  | /etc/init.d/firstcontact disable | ||||||
|  | /etc/init.d/firstcontact stop | ||||||
|  | /etc/init.d/ucentral enable | ||||||
| /etc/init.d/ucentral restart | /etc/init.d/ucentral restart | ||||||
|  |  | ||||||
| return 0 | return 0 | ||||||
|   | |||||||
| @@ -1,60 +1,68 @@ | |||||||
| From b69fb05f4a476b4b57fb146904e6a435d009f9bd Mon Sep 17 00:00:00 2001 | From af8a5fcd98e0d1d0f0cca85c62a3551d3d589d88 Mon Sep 17 00:00:00 2001 | ||||||
| From: John Crispin <john@phrozen.org> | From: John Crispin <john@phrozen.org> | ||||||
| Date: Sat, 29 Aug 2020 08:25:41 +0200 | Date: Sat, 29 Aug 2020 08:25:41 +0200 | ||||||
| Subject: [PATCH 08/21] base-files: add the wlan-ap repo hash | Subject: [PATCH 01/25] base-files: add the wlan-ap repo hash | ||||||
|  |  | ||||||
| currently the banner will show the revision of the build tree. | currently the banner will show the revision of the build tree. | ||||||
| This patch adds the hash of the wlan-ap tree. | This patch adds the hash of the wlan-ap tree. | ||||||
|  |  | ||||||
| Signed-off-by: John Crispin <john@phrozen.org> | Signed-off-by: John Crispin <john@phrozen.org> | ||||||
| --- | --- | ||||||
|  include/version.mk                           | 3 +++ |  include/version.mk                            |  7 +++++ | ||||||
|  package/base-files/files/etc/banner           |  1 + |  package/base-files/files/etc/banner           |  1 + | ||||||
|  package/base-files/files/etc/openwrt_release | 1 + |  package/base-files/files/etc/openwrt_release  |  2 ++ | ||||||
|  package/base-files/files/etc/openwrt_version  |  1 + |  package/base-files/files/etc/openwrt_version  |  1 + | ||||||
|  scripts/getver.sh                            | 6 ++++++ |  ...p-revision-info-to-system.board-call.patch | 28 +++++++++++++++++++ | ||||||
|  5 files changed, 12 insertions(+) |  scripts/gen_config.py                         |  2 +- | ||||||
|  |  scripts/getver.sh                             | 12 ++++++++ | ||||||
|  |  7 files changed, 52 insertions(+), 1 deletion(-) | ||||||
|  |  create mode 100644 package/system/procd/patches/0001-procd-add-tip-revision-info-to-system.board-call.patch | ||||||
|  |  | ||||||
| diff --git a/include/version.mk b/include/version.mk | diff --git a/include/version.mk b/include/version.mk | ||||||
| index a4b47c8a57..dd5f9a20f9 100644 | index a4b47c8a57..214f32974b 100644 | ||||||
| --- a/include/version.mk | --- a/include/version.mk | ||||||
| +++ b/include/version.mk | +++ b/include/version.mk | ||||||
| @@ -56,6 +56,8 @@ VERSION_PRODUCT:=$(if $(VERSION_PRODUCT),$(VERSION_PRODUCT),Generic) | @@ -56,6 +56,11 @@ VERSION_PRODUCT:=$(if $(VERSION_PRODUCT),$(VERSION_PRODUCT),Generic) | ||||||
|  VERSION_HWREV:=$(call qstrip,$(CONFIG_VERSION_HWREV)) |  VERSION_HWREV:=$(call qstrip,$(CONFIG_VERSION_HWREV)) | ||||||
|  VERSION_HWREV:=$(if $(VERSION_HWREV),$(VERSION_HWREV),v0) |  VERSION_HWREV:=$(if $(VERSION_HWREV),$(VERSION_HWREV),v0) | ||||||
|   |   | ||||||
| +VERSION_TIP:=$(shell $(TOPDIR)/scripts/getver.sh wlan-ap) | +VERSION_TIP:=$(shell $(TOPDIR)/scripts/getver.sh wlan-ap) | ||||||
|  | + | ||||||
|  | +VERSION_TIP_VERSION:=$(shell $(TOPDIR)/scripts/getver.sh wlan-ap-version) | ||||||
|  | +VERSION_TIP_VERSION:=$(if $(VERSION_TIP_VERSION),$(VERSION_TIP_VERSION),devel) | ||||||
| + | + | ||||||
|  define taint2sym |  define taint2sym | ||||||
|  $(CONFIG_$(firstword $(subst :, ,$(subst +,,$(subst -,,$(1)))))) |  $(CONFIG_$(firstword $(subst :, ,$(subst +,,$(subst -,,$(1)))))) | ||||||
|  endef |  endef | ||||||
| @@ -104,5 +106,6 @@ VERSION_SED_SCRIPT:=$(SED) 's,%U,$(call sed_escape,$(VERSION_REPO)),g' \ | @@ -104,5 +109,7 @@ VERSION_SED_SCRIPT:=$(SED) 's,%U,$(call sed_escape,$(VERSION_REPO)),g' \ | ||||||
|  	-e 's,%u,$(call sed_escape,$(VERSION_HOME_URL)),g' \ |  	-e 's,%u,$(call sed_escape,$(VERSION_HOME_URL)),g' \ | ||||||
|  	-e 's,%s,$(call sed_escape,$(VERSION_SUPPORT_URL)),g' \ |  	-e 's,%s,$(call sed_escape,$(VERSION_SUPPORT_URL)),g' \ | ||||||
|  	-e 's,%P,$(call sed_escape,$(VERSION_PRODUCT)),g' \ |  	-e 's,%P,$(call sed_escape,$(VERSION_PRODUCT)),g' \ | ||||||
| +	-e 's,%a,$(call sed_escape,$(VERSION_TIP)),g' \ | +	-e 's,%a,$(call sed_escape,$(VERSION_TIP)),g' \ | ||||||
|  | +	-e 's,%x,$(call sed_escape,$(VERSION_TIP_VERSION)),g' \ | ||||||
|  	-e 's,%h,$(call sed_escape,$(VERSION_HWREV)),g' |  	-e 's,%h,$(call sed_escape,$(VERSION_HWREV)),g' | ||||||
|   |   | ||||||
| diff --git a/package/base-files/files/etc/banner b/package/base-files/files/etc/banner | diff --git a/package/base-files/files/etc/banner b/package/base-files/files/etc/banner | ||||||
| index f73423bad4..53e3cfcf4a 100644 | index f73423bad4..65c175e1ef 100644 | ||||||
| --- a/package/base-files/files/etc/banner | --- a/package/base-files/files/etc/banner | ||||||
| +++ b/package/base-files/files/etc/banner | +++ b/package/base-files/files/etc/banner | ||||||
| @@ -4,5 +4,6 @@ | @@ -4,5 +4,6 @@ | ||||||
|   |_______||   __|_____|__|__||________|__|__|   |__| |   |_______||   __|_____|__|__||________|__|__|   |__| | ||||||
|            |__| W I R E L E S S   F R E E D O M |            |__| W I R E L E S S   F R E E D O M | ||||||
|   --------------------------------------------------- |   --------------------------------------------------- | ||||||
| + ApNos-%a | + ApNos-%a-%x | ||||||
|   %D %V, %C |   %D %V, %C | ||||||
|   --------------------------------------------------- |   --------------------------------------------------- | ||||||
| diff --git a/package/base-files/files/etc/openwrt_release b/package/base-files/files/etc/openwrt_release | diff --git a/package/base-files/files/etc/openwrt_release b/package/base-files/files/etc/openwrt_release | ||||||
| index d03400ca05..11eb7f0361 100644 | index d03400ca05..0327c21f68 100644 | ||||||
| --- a/package/base-files/files/etc/openwrt_release | --- a/package/base-files/files/etc/openwrt_release | ||||||
| +++ b/package/base-files/files/etc/openwrt_release | +++ b/package/base-files/files/etc/openwrt_release | ||||||
| @@ -5,3 +5,4 @@ DISTRIB_TARGET='%S' | @@ -5,3 +5,5 @@ DISTRIB_TARGET='%S' | ||||||
|  DISTRIB_ARCH='%A' |  DISTRIB_ARCH='%A' | ||||||
|  DISTRIB_DESCRIPTION='%D %V %C' |  DISTRIB_DESCRIPTION='%D %V %C' | ||||||
|  DISTRIB_TAINTS='%t' |  DISTRIB_TAINTS='%t' | ||||||
| +DISTRIB_TIP='%a' | +DISTRIB_TIP='%a' | ||||||
|  | +DISTRIB_TIP_VERSION='%x' | ||||||
| diff --git a/package/base-files/files/etc/openwrt_version b/package/base-files/files/etc/openwrt_version | diff --git a/package/base-files/files/etc/openwrt_version b/package/base-files/files/etc/openwrt_version | ||||||
| index 48157ed97f..bb0ef233ac 100644 | index 48157ed97f..bb0ef233ac 100644 | ||||||
| --- a/package/base-files/files/etc/openwrt_version | --- a/package/base-files/files/etc/openwrt_version | ||||||
| @@ -62,11 +70,58 @@ index 48157ed97f..bb0ef233ac 100644 | |||||||
| @@ -1 +1,2 @@ | @@ -1 +1,2 @@ | ||||||
| +ApNos-%a | +ApNos-%a | ||||||
|  %C |  %C | ||||||
|  | diff --git a/package/system/procd/patches/0001-procd-add-tip-revision-info-to-system.board-call.patch b/package/system/procd/patches/0001-procd-add-tip-revision-info-to-system.board-call.patch | ||||||
|  | new file mode 100644 | ||||||
|  | index 0000000000..4e8f05a700 | ||||||
|  | --- /dev/null | ||||||
|  | +++ b/package/system/procd/patches/0001-procd-add-tip-revision-info-to-system.board-call.patch | ||||||
|  | @@ -0,0 +1,28 @@ | ||||||
|  | +From b08e6ce0ebf0cd5aa7a6ed463a83160634ad9693 Mon Sep 17 00:00:00 2001 | ||||||
|  | +From: John Crispin <john@phrozen.org> | ||||||
|  | +Date: Tue, 4 May 2021 10:37:41 +0200 | ||||||
|  | +Subject: [PATCH] procd: add tip revision info to system.board call | ||||||
|  | + | ||||||
|  | +Signed-off-by: John Crispin <john@phrozen.org> | ||||||
|  | +--- | ||||||
|  | + system.c | 4 ++++ | ||||||
|  | + 1 file changed, 4 insertions(+) | ||||||
|  | + | ||||||
|  | +diff --git a/system.c b/system.c | ||||||
|  | +index 83aea42..8a87566 100644 | ||||||
|  | +--- a/system.c | ||||||
|  | ++++ b/system.c | ||||||
|  | +@@ -197,6 +197,10 @@ static int system_board(struct ubus_context *ctx, struct ubus_object *obj, | ||||||
|  | + 				key = "target"; | ||||||
|  | + 			else if (!strcasecmp(key, "DISTRIB_DESCRIPTION")) | ||||||
|  | + 				key = "description"; | ||||||
|  | ++			else if (!strcasecmp(key, "DISTRIB_TIP")) | ||||||
|  | ++				key = "tip-revision"; | ||||||
|  | ++			else if (!strcasecmp(key, "DISTRIB_TIP_VERSION")) | ||||||
|  | ++				key = "tip-version"; | ||||||
|  | + 			else | ||||||
|  | + 				continue; | ||||||
|  | +  | ||||||
|  | +--  | ||||||
|  | +2.25.1 | ||||||
|  | + | ||||||
|  | diff --git a/scripts/gen_config.py b/scripts/gen_config.py | ||||||
|  | index 5bc7068ae7..b380a2e605 100755 | ||||||
|  | --- a/scripts/gen_config.py | ||||||
|  | +++ b/scripts/gen_config.py | ||||||
|  | @@ -62,7 +62,7 @@ def load_yaml(fname: str, profile: dict, include = True): | ||||||
|  |   | ||||||
|  |      if "include" in new and include: | ||||||
|  |          for i in range(len(new["include"])): | ||||||
|  | -            profile = load_yaml(new["include"][i], profile, False) | ||||||
|  | +            profile = load_yaml(new["include"][i], profile) | ||||||
|  |      return profile | ||||||
|  |   | ||||||
|  |   | ||||||
| diff --git a/scripts/getver.sh b/scripts/getver.sh | diff --git a/scripts/getver.sh b/scripts/getver.sh | ||||||
| index dc3d1bb1c3..fe4fc4afbe 100755 | index dc3d1bb1c3..cd4d7aedf4 100755 | ||||||
| --- a/scripts/getver.sh | --- a/scripts/getver.sh | ||||||
| +++ b/scripts/getver.sh | +++ b/scripts/getver.sh | ||||||
| @@ -3,6 +3,12 @@ export LANG=C | @@ -3,6 +3,18 @@ export LANG=C | ||||||
|  export LC_ALL=C |  export LC_ALL=C | ||||||
|  [ -n "$TOPDIR" ] && cd $TOPDIR |  [ -n "$TOPDIR" ] && cd $TOPDIR | ||||||
|   |   | ||||||
| @@ -75,6 +130,12 @@ index dc3d1bb1c3..fe4fc4afbe 100755 | |||||||
| +	git log -n 1 --format="%h" | +	git log -n 1 --format="%h" | ||||||
| +	exit 0 | +	exit 0 | ||||||
| +} | +} | ||||||
|  | + | ||||||
|  | +[ "$1" = "wlan-ap-version" ] && { | ||||||
|  | +	cd .. | ||||||
|  | +	git tag --points-at HEAD | ||||||
|  | +	exit 0 | ||||||
|  | +} | ||||||
| + | + | ||||||
|  GET_REV=$1 |  GET_REV=$1 | ||||||
|   |   | ||||||
|   | |||||||
| @@ -6,6 +6,9 @@ feeds: | |||||||
|   - name: tip |   - name: tip | ||||||
|     path: ../../feeds/tip |     path: ../../feeds/tip | ||||||
|  |  | ||||||
|  | include: | ||||||
|  |   - webui | ||||||
|  |  | ||||||
| packages: | packages: | ||||||
|   - kmod-batman-adv |   - kmod-batman-adv | ||||||
|   - batctl-default |   - batctl-default | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 John Crispin
					John Crispin