improv metadata append

This commit is contained in:
Luochongjun 2021-12-21 17:46:49 +08:00
parent 5b0cec5d9a
commit 59e5f242be
4 changed files with 43 additions and 346 deletions

View File

@ -1,141 +1,59 @@
From f068fa47cd9dd27c7beb0262e1d134674937ca4b Mon Sep 17 00:00:00 2001
From: gl-tanqi <qi.tan@gl-inet.com>
Date: Mon, 9 Aug 2021 17:22:55 +0800
Subject: [PATCH] feat:sdk4.0 metadata
From a9ec1704b91edaf7b10ce30b9337d56625ba3588 Mon Sep 17 00:00:00 2001
From: Luochongjun <luochongjun@gl-inet.com>
Date: Tue, 21 Dec 2021 17:34:08 +0800
Subject: [PATCH] support gl metadata
---
gl_metadata.mk | 17 ++++++++++
gl_release_note | 7 ++++
include/image-commands.mk | 70 ++++++++++++++++++++++++++++++++++++++-
3 files changed, 93 insertions(+), 1 deletion(-)
create mode 100644 gl_metadata.mk
create mode 100644 gl_release_note
include/image-commands.mk | 10 +++++-----
make_gl_metadata.py | 13 +++++++++++++
2 files changed, 18 insertions(+), 5 deletions(-)
create mode 100755 make_gl_metadata.py
diff --git a/gl_metadata.mk b/gl_metadata.mk
new file mode 100644
index 0000000000..9ee4460cd8
--- /dev/null
+++ b/gl_metadata.mk
@@ -0,0 +1,17 @@
+gl_not_keep_config_version := 4.003
+gl_not_keep_config_description := xxx
+gl_supported_version := 4.001
+
+gl_user := general
+
+gl_config_ssids := solve the ssids problem
+gl_config_wireless := solve the wireless problem
+gl_config_ddns := solve the ddns problem
+#gl_config_dhcp := solve the xxx problem
+#gl_config_firewall := solve the xxx problem
+#gl_config_openvpn := solve the xxx problem
+#gl_config_rtty := solve the xxx problem
+#gl_config_glconfig := solve the xxx problem
+#gl_config_system := solve the xxx problem
+#gl_config_mwan3 := solve the xxx problem
+#gl_config_network := solve the xxx problem
\ No newline at end of file
diff --git a/gl_release_note b/gl_release_note
new file mode 100644
index 0000000000..58d951bed0
--- /dev/null
+++ b/gl_release_note
@@ -0,0 +1,7 @@
+Security fix:
+mac80211: backport upstream fixes for FragAttacks(CVE-2020-24586,CVE-2020-24587,CVE-2020-24588,CVE-2020-26139,CVE-2020-26140,CVE-2020-26141,CVE-2020-26142,CVE-2020-26143,CVE-2020-26144,CVE-2020-26145,CVE-2020-26146,CVE-2020-26147)
+
+Important bugfix:
+1. Fixed a BUG where the OpenVPN connection status was displayed incorrectly on the E750 LCD
+2. Fixed XE300 modem manual settings always being overwritten
+3. Fixed DNS leakage BUG when using CloudFlare after connecting to OpenVPN
diff --git a/include/image-commands.mk b/include/image-commands.mk
index 32865b9a7d..d2637b178b 100644
index 32865b9..a6ee31b 100644
--- a/include/image-commands.mk
+++ b/include/image-commands.mk
@@ -384,6 +384,52 @@ define Build/append-metadata
}
endef
+include $(TOPDIR)/gl_metadata.mk
+
+ifdef gl_config_ssids
+ CONFIG_GL_SSIDS={"path":"/etc/config/ssids","description":"$(gl_config_ssids)"},
+endif
+
+ifdef gl_config_wireless
+ CONFIG_GL_WIRELESS={"path":"/etc/config/wireless","description":"$(gl_config_wireless)"},
+endif
+
+ifdef gl_config_ddns
+ CONFIG_GL_DDNS={"path":"/etc/config/ddns","description":"$(gl_config_ddns)"},
+endif
+
+ifdef gl_config_dhcp
+ CONFIG_GL_DHCP={"path":"/etc/config/dhcp","description":"$(gl_config_dhcp)"},
+endif
+
+ifdef gl_config_firewall
+ CONFIG_GL_FIREWALL={"path":"/etc/config/firewall","description":"$(gl_config_firewall)"},
+endif
+
+ifdef gl_config_openvpn
+ CONFIG_GL_OPENVPN={"path":"/etc/config/openvpn","description":"$(gl_config_openvpn)"},
+endif
+
+ifdef gl_config_rtty
+ CONFIG_GL_RTTY={"path":"/etc/config/rtty","description":"$(gl_config_rtty)"},
+endif
+
+ifdef gl_config_glconfig
+ CONFIG_GL_GLCONFIG={"path":"/etc/config/glconfig","description":"$(gl_config_glconfig)"},
+endif
+
+ifdef gl_config_system
+ CONFIG_GL_SYSTEM={"path":"/etc/config/system","description":"$(gl_config_system)"},
+endif
+
+ifdef gl_config_mwan3
+ CONFIG_GL_MWAN3={"path":"/etc/config/mwan3","description":"$(gl_config_mwan3)"},
+endif
+
+ifdef gl_config_network
+ CONFIG_GL_NETWORK={"path":"/etc/config/network","description":"$(gl_config_network)"},
+endif
+
metadata_gl_json = \
'{ $(if $(IMAGE_METADATA),$(IMAGE_METADATA)$(comma)) \
"metadata_version": "1.0", \
@@ -396,7 +442,29 @@ metadata_gl_json = \
@@ -396,16 +396,16 @@ metadata_gl_json = \
"revision": "$(call json_quote,$(REVISION))", \
"target": "$(call json_quote,$(TARGETID))", \
"board": "$(call json_quote,$(if $(BOARD_NAME),$(BOARD_NAME),$(DEVICE_NAME)))" \
- } \
+ }, \
+ "upgrade_control":{ \
+ "not_keep_config":{ \
+ "version":"$(gl_not_keep_config_version)", \
+ "description":"$(gl_not_keep_config_description)" \
+ }, \
+ "supported_version":"$(gl_supported_version)", \
+ "not_keep_config_part":[ \
+ $(CONFIG_GL_SSIDS)\
+ $(CONFIG_GL_WIRELESS)\
+ $(CONFIG_GL_DDNS)\
+ $(CONFIG_GL_DHCP)\
+ $(CONFIG_GL_FIREWALL)\
+ $(CONFIG_GL_OPENVPN)\
+ $(CONFIG_GL_RTTY)\
+ $(CONFIG_GL_GLCONFIG)\
+ $(CONFIG_GL_SYSTEM)\
+ $(CONFIG_GL_MWAN3)\
+ $(CONFIG_GL_NETWORK)\
+ ], \
+ "user":"$(gl_user)" \
+ }, \
+ "release_note":"$(shell cat $(TOPDIR)/gl_release_note)" \
+ "upgrade_control":$(shell python3 $(TOPDIR)/make_gl_metadata.py), \
+ "release_note":"$(shell sed ':a;N;s/\n/\\n/g;s/\r/\\r/g;ta' $(TOPDIR)/gl_release_note)" \
}'
define Build/append-gl-metadata
$(if $(SUPPORTED_DEVICES),-echo $(call metadata_gl_json,$(SUPPORTED_DEVICES)) | fwtool -I - $@)
- [ ! -s "$(BUILD_KEY)" -o ! -s "$(BUILD_KEY).ucert" -o ! -s "$@" ] || { \
- cp "$(BUILD_KEY).ucert" "$@.ucert" ;\
+ [ ! -s "$(BUILD_KEY)" -o ! -s "$@" ] || { \
usign -S -m "$@" -s "$(BUILD_KEY)" -x "$@.sig" ;\
- ucert -A -c "$@.ucert" -x "$@.sig" ;\
- fwtool -S "$@.ucert" "$@" ;\
+ fwtool -S "$@.sig" "$@" ;\
}
endef
diff --git a/make_gl_metadata.py b/make_gl_metadata.py
new file mode 100755
index 0000000..a7f2946
--- /dev/null
+++ b/make_gl_metadata.py
@@ -0,0 +1,13 @@
+import sys
+import os
+import yaml
+import json
+
+pyfilePath = os.path.split(os.path.realpath(__file__))[0]
+yamlPath = os.path.join(pyfilePath, 'gl_metadata.yaml')
+
+f = open(yamlPath, 'r', encoding='utf-8')
+cont = f.read()
+x = yaml.load(cont)
+
+print(json.dumps(x))
--
2.17.1
2.7.4

View File

@ -1,165 +0,0 @@
From 7ee05c70dc3a6a4855505db527774bd26c1e9738 Mon Sep 17 00:00:00 2001
From: gl-tanqi <qi.tan@gl-inet.com>
Date: Tue, 17 Aug 2021 10:39:13 +0800
Subject: [PATCH] fix: change metadata src from yaml
---
gl_metadata.mk | 17 ----------
gl_metadata.yaml | 12 +++++++
include/image-commands.mk | 68 +--------------------------------------
make_gl_metadata.py | 13 ++++++++
4 files changed, 26 insertions(+), 84 deletions(-)
delete mode 100644 gl_metadata.mk
create mode 100644 gl_metadata.yaml
create mode 100755 make_gl_metadata.py
diff --git a/gl_metadata.mk b/gl_metadata.mk
deleted file mode 100644
index 0ea276262f..0000000000
--- a/gl_metadata.mk
+++ /dev/null
@@ -1,17 +0,0 @@
-gl_not_keep_config_version := 4.003
-gl_not_keep_config_description := xxx
-gl_supported_version := 4.001
-
-gl_user := general
-
-gl_config_ssids := solve the ssids problem
-gl_config_wireless := solve the wireless problem
-gl_config_ddns := solve the ddns problem
-#gl_config_dhcp := solve the xxx problem
-#gl_config_firewall := solve the xxx problem
-#gl_config_openvpn := solve the xxx problem
-#gl_config_rtty := solve the xxx problem
-#gl_config_glconfig := solve the xxx problem
-#gl_config_system := solve the xxx problem
-#gl_config_mwan3 := solve the xxx problem
-#gl_config_network := solve the xxx problem
\ No newline at end of file
diff --git a/gl_metadata.yaml b/gl_metadata.yaml
new file mode 100644
index 0000000000..0c5557faff
--- /dev/null
+++ b/gl_metadata.yaml
@@ -0,0 +1,12 @@
+not_keep_config:
+ version: 4.003
+ description: Solve the xxx problem
+supported_version: 4.001
+not_keep_config_part:
+ -
+ path: /etc/config/ssids
+ description: Solve the ssids problem
+ -
+ path: /etc/config/dns
+ description: is dns problem
+user: general
diff --git a/include/image-commands.mk b/include/image-commands.mk
index d2637b178b..bcf871f679 100644
--- a/include/image-commands.mk
+++ b/include/image-commands.mk
@@ -384,52 +384,6 @@ define Build/append-metadata
}
endef
-include $(TOPDIR)/gl_metadata.mk
-
-ifdef gl_config_ssids
- CONFIG_GL_SSIDS={"path":"/etc/config/ssids","description":"$(gl_config_ssids)"},
-endif
-
-ifdef gl_config_wireless
- CONFIG_GL_WIRELESS={"path":"/etc/config/wireless","description":"$(gl_config_wireless)"},
-endif
-
-ifdef gl_config_ddns
- CONFIG_GL_DDNS={"path":"/etc/config/ddns","description":"$(gl_config_ddns)"},
-endif
-
-ifdef gl_config_dhcp
- CONFIG_GL_DHCP={"path":"/etc/config/dhcp","description":"$(gl_config_dhcp)"},
-endif
-
-ifdef gl_config_firewall
- CONFIG_GL_FIREWALL={"path":"/etc/config/firewall","description":"$(gl_config_firewall)"},
-endif
-
-ifdef gl_config_openvpn
- CONFIG_GL_OPENVPN={"path":"/etc/config/openvpn","description":"$(gl_config_openvpn)"},
-endif
-
-ifdef gl_config_rtty
- CONFIG_GL_RTTY={"path":"/etc/config/rtty","description":"$(gl_config_rtty)"},
-endif
-
-ifdef gl_config_glconfig
- CONFIG_GL_GLCONFIG={"path":"/etc/config/glconfig","description":"$(gl_config_glconfig)"},
-endif
-
-ifdef gl_config_system
- CONFIG_GL_SYSTEM={"path":"/etc/config/system","description":"$(gl_config_system)"},
-endif
-
-ifdef gl_config_mwan3
- CONFIG_GL_MWAN3={"path":"/etc/config/mwan3","description":"$(gl_config_mwan3)"},
-endif
-
-ifdef gl_config_network
- CONFIG_GL_NETWORK={"path":"/etc/config/network","description":"$(gl_config_network)"},
-endif
-
metadata_gl_json = \
'{ $(if $(IMAGE_METADATA),$(IMAGE_METADATA)$(comma)) \
"metadata_version": "1.0", \
@@ -443,27 +397,7 @@ metadata_gl_json = \
"target": "$(call json_quote,$(TARGETID))", \
"board": "$(call json_quote,$(if $(BOARD_NAME),$(BOARD_NAME),$(DEVICE_NAME)))" \
}, \
- "upgrade_control":{ \
- "not_keep_config":{ \
- "version":"$(gl_not_keep_config_version)", \
- "description":"$(gl_not_keep_config_description)" \
- }, \
- "supported_version":"$(gl_supported_version)", \
- "not_keep_config_part":[ \
- $(CONFIG_GL_SSIDS)\
- $(CONFIG_GL_WIRELESS)\
- $(CONFIG_GL_DDNS)\
- $(CONFIG_GL_DHCP)\
- $(CONFIG_GL_FIREWALL)\
- $(CONFIG_GL_OPENVPN)\
- $(CONFIG_GL_RTTY)\
- $(CONFIG_GL_GLCONFIG)\
- $(CONFIG_GL_SYSTEM)\
- $(CONFIG_GL_MWAN3)\
- $(CONFIG_GL_NETWORK)\
- ], \
- "user":"$(gl_user)" \
- }, \
+ "upgrade_control":$(shell python3 $(TOPDIR)/make_gl_metadata.py), \
"release_note":"$(shell cat $(TOPDIR)/gl_release_note)" \
}'
diff --git a/make_gl_metadata.py b/make_gl_metadata.py
new file mode 100755
index 0000000000..a7f294664e
--- /dev/null
+++ b/make_gl_metadata.py
@@ -0,0 +1,13 @@
+import sys
+import os
+import yaml
+import json
+
+pyfilePath = os.path.split(os.path.realpath(__file__))[0]
+yamlPath = os.path.join(pyfilePath, 'gl_metadata.yaml')
+
+f = open(yamlPath, 'r', encoding='utf-8')
+cont = f.read()
+x = yaml.load(cont)
+
+print(json.dumps(x))
--
2.17.1

View File

@ -1,30 +0,0 @@
From a884d48a1a59b2f56d70d42dfa0885c475a28952 Mon Sep 17 00:00:00 2001
From: gl-tanqi <qi.tan@gl-inet.com>
Date: Thu, 16 Sep 2021 15:06:16 +0800
Subject: [PATCH] feat: add gl firmware signature
---
include/image-commands.mk | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/include/image-commands.mk b/include/image-commands.mk
index bcf871f679..b914c7dcdd 100644
--- a/include/image-commands.mk
+++ b/include/image-commands.mk
@@ -403,11 +403,9 @@ metadata_gl_json = \
define Build/append-gl-metadata
$(if $(SUPPORTED_DEVICES),-echo $(call metadata_gl_json,$(SUPPORTED_DEVICES)) | fwtool -I - $@)
- [ ! -s "$(BUILD_KEY)" -o ! -s "$(BUILD_KEY).ucert" -o ! -s "$@" ] || { \
- cp "$(BUILD_KEY).ucert" "$@.ucert" ;\
+ [ ! -s "$(BUILD_KEY)" -o ! -s "$@" ] || { \
usign -S -m "$@" -s "$(BUILD_KEY)" -x "$@.sig" ;\
- ucert -A -c "$@.ucert" -x "$@.sig" ;\
- fwtool -S "$@.ucert" "$@" ;\
+ fwtool -S "$@.sig" "$@" ;\
}
endef
--
2.17.1

View File

@ -1,26 +0,0 @@
From 83b48fccc0802d73abe3789013a0647253029311 Mon Sep 17 00:00:00 2001
From: gl-tanqi <qi.tan@gl-inet.com>
Date: Mon, 25 Oct 2021 17:22:06 +0800
Subject: [PATCH] fix: Release_note displayed on the Web does not have a
carriage return newline
---
include/image-commands.mk | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/image-commands.mk b/include/image-commands.mk
index b914c7dcdd..a6ee31bb9f 100644
--- a/include/image-commands.mk
+++ b/include/image-commands.mk
@@ -398,7 +398,7 @@ metadata_gl_json = \
"board": "$(call json_quote,$(if $(BOARD_NAME),$(BOARD_NAME),$(DEVICE_NAME)))" \
}, \
"upgrade_control":$(shell python3 $(TOPDIR)/make_gl_metadata.py), \
- "release_note":"$(shell cat $(TOPDIR)/gl_release_note)" \
+ "release_note":"$(shell sed ':a;N;s/\n/\\n/g;s/\r/\\r/g;ta' $(TOPDIR)/gl_release_note)" \
}'
define Build/append-gl-metadata
--
2.17.1