Skip to content

Commit

Permalink
openwrt: add some devices
Browse files Browse the repository at this point in the history
  • Loading branch information
hugcabbage committed Dec 18, 2023
1 parent bd408ea commit 7e8c6f0
Show file tree
Hide file tree
Showing 4 changed files with 67 additions and 41 deletions.
44 changes: 29 additions & 15 deletions .github/workflows/build-openwrt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,26 +17,40 @@ on:
required: true
type: choice
options:
- 'xiaomi-cr6608'
- 'xiaomi-cr6606'
- 'xiaomi-cr6609'
- 'redmi-ac2100'
- 'xiaomi-ac2100'
- 'xiaomi-4a-gigabit'
- 'xiaomi-4a-gigabit-v2'
- 'xiaomi-3g-v2'
- 'glinet-mt1300'
- 'glinet-mt300n-v2'
- 'glinet-microuter-n300'
- 'h3c-magic-nx30-pro'
- 'hiwifi-hc5962'
- 'phicomm-k2p'
- 'phicomm-k3'
- 'qihoo-360t7'
- 'qihoo-c301'
- 'tenda-ac9'
- 'xiaomi-ax3600'
- 'xiaomi-ax9000'
- 'xiaomi-3g'
- 'xiaomi-4'
- 'xiaomi-3g-v2'
- 'xiaomi-3-pro'
- 'phicomm-k2p'
- 'redmi-ax6s'
- 'xiaomi-4'
- 'xiaomi-4a-100m'
- 'xiaomi-4a-gigabit'
- 'xiaomi-4c'
- 'miwifi-nano'
- 'glinet-mt300n-v2'
- 'glinet-microuter-n300'
- 'xiaomi-ac2100'
- 'xiaomi-cr6606'
- 'xiaomi-cr6608'
- 'xiaomi-cr6609'
- 'xiaomi-wr30u-112m-nmbm'
- 'xiaomi-wr30u-stock'
- 'xiaomi-wr30u-ubootmod'
- 'miwifi-3c'
- 'miwifi-mini'
- 'miwifi-r3'
- 'miwifi-nano'
- 'redmi-ac2100'
- 'xiaomi-ax6000-stock'
- 'xiaomi-ax6000-ubootmod'
- 'redmi-ax6s'
- 'youhua-wr1200js'
branch:
description: '选择版本'
required: true
Expand Down
Binary file modified extra-files/headers.xlsx
Binary file not shown.
8 changes: 3 additions & 5 deletions extra-files/tools/process_text.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,17 +121,15 @@ def xlsx_to_dict(file) -> dict:
return dict_data


def dict_to_json(dict_data, file):
def dict_to_json(data: dict) -> str:
"""convert dict data to json file, apply to header.json"""

json_str = json.dumps(dict_data, indent=2)
json_str = json.dumps(data, indent=2)

# make key and value be one line
json_str = json_str.replace('[\n ', '[').replace(
',\n ', ', ').replace('"\n ', '"')
with open(file, 'w', encoding='utf-8') as f:
f.write(json_str)
print('json file saved')
return json_str


def simplify_config(file: str, *, backup=True, remain_text=None):
Expand Down
56 changes: 35 additions & 21 deletions preset-openwrt/headers.json
Original file line number Diff line number Diff line change
@@ -1,22 +1,36 @@
{
"xiaomi-cr6608": ["1", "ramips", "mt7621", "xiaomi_mi-router-cr6608"],
"xiaomi-cr6606": ["1", "ramips", "mt7621", "xiaomi_mi-router-cr6606"],
"xiaomi-cr6609": ["1", "ramips", "mt7621", "xiaomi_mi-router-cr6609"],
"xiaomi-3g": ["1", "ramips", "mt7621", "xiaomi_mi-router-3g"],
"xiaomi-4": ["1", "ramips", "mt7621", "xiaomi_mi-router-4"],
"xiaomi-3-pro": ["1", "ramips", "mt7621", "xiaomi_mi-router-3-pro"],
"redmi-ac2100": ["1", "ramips", "mt7621", "xiaomi_redmi-router-ac2100"],
"xiaomi-ac2100": ["1", "ramips", "mt7621", "xiaomi_mi-router-ac2100"],
"redmi-ax6s": ["1", "mediatek", "mt7622", "xiaomi_redmi-router-ax6s"],
"xiaomi-4a-gigabit": ["2", "ramips", "mt7621", "xiaomi_mi-router-4a-gigabit"],
"xiaomi-4a-gigabit-v2": ["2", "ramips", "mt7621", "xiaomi_mi-router-4a-gigabit-v2"],
"xiaomi-3g-v2": ["2", "ramips", "mt7621", "xiaomi_mi-router-3g-v2"],
"phicomm-k2p": ["2", "ramips", "mt7621", "phicomm_k2p"],
"xiaomi-4a-100m": ["2", "ramips", "mt76x8", "xiaomi_mi-router-4a-100m"],
"xiaomi-4c": ["2", "ramips", "mt76x8", "xiaomi_mi-router-4c"],
"miwifi-nano": ["2", "ramips", "mt76x8", "xiaomi_miwifi-nano"],
"glinet-mt300n-v2": ["2", "ramips", "mt76x8", "glinet_gl-mt300n-v2"],
"glinet-microuter-n300": ["2", "ramips", "mt76x8", "glinet_microuter-n300"],
"miwifi-mini": ["2", "ramips", "mt7620", "xiaomi_miwifi-mini"],
"miwifi-r3": ["2", "ramips", "mt7620", "xiaomi_miwifi-r3"]
}
"glinet-mt1300": ["2", "ramips", "mt7621", "glinet_gl-mt1300"],
"glinet-mt300n-v2": ["1", "ramips", "mt76x8", "glinet_gl-mt300n-v2"],
"glinet-microuter-n300": ["1", "ramips", "mt76x8", "glinet_microuter-n300"],
"h3c-magic-nx30-pro": ["2", "mediatek", "filogic", "h3c_magic-nx30-pro"],
"hiwifi-hc5962": ["2", "ramips", "mt7621", "hiwifi_hc5962"],
"phicomm-k2p": ["1", "ramips", "mt7621", "phicomm_k2p"],
"phicomm-k3": ["2", "bcm53xx", "generic", "phicomm_k3"],
"qihoo-360t7": ["2", "mediatek", "filogic", "qihoo_360t7"],
"qihoo-c301": ["1", "ath79", "generic", "qihoo_c301"],
"tenda-ac9": ["1", "bcm53xx", "generic", "tenda_ac9"],
"xiaomi-ax3600": ["2", "ipq807x", "generic", "xiaomi_ax3600"],
"xiaomi-ax9000": ["2", "ipq807x", "generic", "xiaomi_ax9000"],
"xiaomi-3g": ["2", "ramips", "mt7621", "xiaomi_mi-router-3g"],
"xiaomi-3g-v2": ["1", "ramips", "mt7621", "xiaomi_mi-router-3g-v2"],
"xiaomi-3-pro": ["2", "ramips", "mt7621", "xiaomi_mi-router-3-pro"],
"xiaomi-4": ["2", "ramips", "mt7621", "xiaomi_mi-router-4"],
"xiaomi-4a-100m": ["1", "ramips", "mt76x8", "xiaomi_mi-router-4a-100m"],
"xiaomi-4a-gigabit": ["1", "ramips", "mt7621", "xiaomi_mi-router-4a-gigabit"],
"xiaomi-4c": ["1", "ramips", "mt76x8", "xiaomi_mi-router-4c"],
"xiaomi-ac2100": ["2", "ramips", "mt7621", "xiaomi_mi-router-ac2100"],
"xiaomi-cr6606": ["2", "ramips", "mt7621", "xiaomi_mi-router-cr6606"],
"xiaomi-cr6608": ["2", "ramips", "mt7621", "xiaomi_mi-router-cr6608"],
"xiaomi-cr6609": ["2", "ramips", "mt7621", "xiaomi_mi-router-cr6609"],
"xiaomi-wr30u-112m-nmbm": ["2", "mediatek", "filogic", "xiaomi_mi-router-wr30u-112m-nmbm"],
"xiaomi-wr30u-stock": ["2", "mediatek", "filogic", "xiaomi_mi-router-wr30u-stock"],
"xiaomi-wr30u-ubootmod": ["2", "mediatek", "filogic", "xiaomi_mi-router-wr30u-ubootmod"],
"miwifi-3c": ["1", "ramips", "mt76x8", "xiaomi_miwifi-3c"],
"miwifi-mini": ["1", "ramips", "mt7620", "xiaomi_miwifi-mini"],
"miwifi-nano": ["1", "ramips", "mt76x8", "xiaomi_miwifi-nano"],
"redmi-ac2100": ["2", "ramips", "mt7621", "xiaomi_redmi-router-ac2100"],
"xiaomi-ax6000-stock": ["2", "mediatek", "filogic", "xiaomi_redmi-router-ax6000-stock"],
"xiaomi-ax6000-ubootmod": ["2", "mediatek", "filogic", "xiaomi_redmi-router-ax6000-ubootmod"],
"redmi-ax6s": ["2", "mediatek", "mt7622", "xiaomi_redmi-router-ax6s"],
"youhua-wr1200js": ["1", "ramips", "mt7621", "youhua_wr1200js"]
}

0 comments on commit 7e8c6f0

Please sign in to comment.