Skip to content
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

Move hardware information into directory structure and add scripting to autopopulate #271

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
543 changes: 16 additions & 527 deletions openwisp_firmware_upgrader/hardware.py

Large diffs are not rendered by default.

571 changes: 571 additions & 0 deletions openwisp_firmware_upgrader/populatehardware.py

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions openwisp_firmware_upgrader/targets/ar71xx/generic/devices.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
def returnData():
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The camelCase style is not a thing in python projects, not important though here, because I think we should get rid of the function and just leave something like data = {....}.

The data structure should be indented (should be doable using openwisp-qa-format, make sure to use the latest version available in the openwisp-utils repo).

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, I will look into it

return {'ar71xx-generic-xd3200-squashfs-sysupgrade.bin': {'label': 'YunCore XD3200 (OpenWrt 19.07 and earlier)', 'boards': ('YunCore XD3200',)}, 'ar71xx-generic-ubnt-uap-pro-squashfs-sysupgrade.bin': {'label': 'Ubiquiti UniFi AP Pro (OpenWrt 19.07 and earlier)', 'boards': ('Ubiquiti UAP Pro',)}, 'ar71xx-generic-ubnt-unifiac-mesh-pro-squashfs-sysupgrade.bin': {'label': 'Ubiquiti Unifi AC Mesh-Pro (OpenWrt 19.07 and earlier)', 'boards': ('Ubiquiti UniFi AC-Mesh-Pro',)}, 'ar71xx-generic-ubnt-unifiac-mesh-squashfs-sysupgrade.bin': {'label': 'Ubiquiti Unifi AC Mesh (OpenWrt 19.07 and earlier)', 'boards': ('Ubiquiti UniFi AC-Mesh', 'Ubiquiti UniFi-AC-MESH', 'Ubiquiti UniFi-AC-LITE/MESH')}, 'ar71xx-generic-ubnt-bullet-m-squashfs-sysupgrade.bin': {'label': 'Ubiquiti Picostation M2HP & Bullet (OpenWrt 19.07 and earlier)', 'boards': ('Ubiquiti Bullet-M', 'Ubiquiti PicoStation M2', 'Ubiquiti PicoStation M2HP')}, 'ar71xx-generic-ubnt-bullet-m-xw-squashfs-sysupgrade.bin': {'label': 'Ubiquiti Picostation Bullet XW (OpenWrt 19.07 and earlier)', 'boards': ('Ubiquiti Bullet-M XW',)}, 'ar71xx-generic-ubnt-nano-m-squashfs-sysupgrade.bin': {'label': 'Ubiquiti Nanostation M (OpenWrt 19.07 and earlier)', 'boards': ('Ubiquiti Nano-M', 'Ubiquiti NanoStation M2', 'Ubiquiti NanoStation M5', 'Ubiquiti NanoStation loco M2', 'Ubiquiti NanoStation loco M5')}, 'ar71xx-generic-ubnt-nano-m-xw-squashfs-sysupgrade.bin': {'label': 'Ubiquiti Nanostation M - XW (OpenWrt 19.07 and earlier)', 'boards': ('Ubiquiti Nano M XW',)}, 'ar71xx-generic-ubnt-loco-m-xw-squashfs-sysupgrade.bin': {'label': 'Ubiquiti Nanostation Loco M2 - XW (OpenWrt 19.07 and earlier)', 'boards': ('Ubiquiti Loco XW',)}, 'ar71xx-generic-ubnt-airrouter-squashfs-sysupgrade.bin': {'label': 'Ubiquiti AirRouter (OpenWrt 19.07 and earlier)', 'boards': ('Ubiquiti AirRouter',)}, 'ar71xx-generic-tl-wr2543-v1-squashfs-sysupgrade.bin': {'label': 'TP-Link WR2543N/ND (OpenWrt 19.07 and earlier)', 'boards': ('TP-Link TL-WR2543N/ND',)}, 'ar71xx-generic-tl-wdr4300-v1-il-squashfs-sysupgrade.bin': {'label': 'TP-Link WDR4300 v1 Israel Version (OpenWrt 19.07 and earlier)', 'boards': ('TP-LINK TL-WDR4300 v1 (IL)',)}, 'ar71xx-generic-tl-wdr4300-v1-squashfs-sysupgrade.bin': {'label': 'TP-Link WDR4300 v1 (OpenWrt 19.07 and earlier)', 'boards': ('TP-Link TL-WDR4300 v1',)}, 'ar71xx-generic-tl-wdr3600-v1-squashfs-sysupgrade.bin': {'label': 'TP-Link WDR3600 v1 (OpenWrt 19.07 and earlier)', 'boards': ('TP-Link TL-WDR3600 v1',)}, 'ar71xx-generic-cpe210-220-v1-squashfs-sysupgrade.bin': {'label': 'TP-LINK CPE210 v3 (OpenWrt 19.07 and earlier)', 'boards': ('TP-LINK CPE210 v1', 'TP-LINK CPE220 v1')}, 'ar71xx-generic-archer-c7-v5-squashfs-sysupgrade.bin': {'label': 'TP-Link Archer C7 v5 (OpenWrt 19.07 and earlier)', 'boards': ('TP-Link Archer C7 v5',)}, 'ar71xx-generic-archer-c7-v4-squashfs-sysupgrade.bin': {'label': 'TP-Link Archer C7 v4 (OpenWrt 19.07 and earlier)', 'boards': ('TP-Link Archer C7 v4',)}, 'ar71xx-generic-archer-c7-v2-squashfs-sysupgrade.bin': {'label': 'TP-Link Archer C7 v2 (OpenWrt 19.07 and earlier)', 'boards': ('TP-Link Archer C7 v2', 'TP-Link Archer C7 v3')}, 'ar71xx-generic-archer-c7-v1-squashfs-sysupgrade.bin': {'label': 'TP-Link Archer C7 v1 (OpenWrt 19.07 and earlier)', 'boards': ('tplink,archer-c7-v1',)}, 'ar71xx-generic-cf-e320n-v2-squashfs-sysupgrade.bin': {'label': 'COMFAST CF-E320N v2 (OpenWrt 19.07 and earlier)', 'boards': ('COMFAST CF-E320N v2',)}}
2 changes: 2 additions & 0 deletions openwisp_firmware_upgrader/targets/ath79/generic/devices.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
def returnData():
return {'ath79-generic-ubnt_unifi-ap-pro-squashfs-sysupgrade.bin': {'label': 'Ubiquiti UniFi AP Pro (OpenWrt 19.07 and later)', 'boards': ('Ubiquiti UniFi AP Pro',)}, 'ath79-generic-ubnt_unifiac-pro-squashfs-sysupgrade.bin': {'label': 'Ubiquiti UniFi AC Pro (OpenWrt 19.07 and later)', 'boards': ('Ubiquiti UniFi AC Pro', 'Ubiquiti UniFi-AC-PRO')}, 'ath79-generic-ubnt_unifiac-mesh-pro-squashfs-sysupgrade.bin': {'label': 'Ubiquiti Unifi AC Mesh-Pro (OpenWrt 19.07 and later)', 'boards': ('Ubiquiti UniFi AC-Mesh Pro',)}, 'ath79-generic-ubnt_unifiac-mesh-squashfs-sysupgrade.bin': {'label': 'Ubiquiti Unifi AC Mesh (OpenWrt 19.07 and later)', 'boards': ('Ubiquiti UniFi AC Mesh', 'Ubiquiti UniFi AC-Mesh', 'Ubiquiti UniFi-AC-MESH', 'Ubiquiti UniFi-AC-LITE/MESH')}, 'ath79-generic-ubnt_unifiac-lr-squashfs-sysupgrade.bin': {'label': 'Ubiquiti UniFi AC LR (OpenWrt 19.07 and later)', 'boards': ('Ubiquiti UniFi AC LR',)}, 'ath79-generic-ubnt_unifi-squashfs-sysupgrade.bin': {'label': 'Ubiquiti UniFi (OpenWRT 19.07 and later)', 'boards': ('Ubiquiti UniFi', 'Ubiquiti UniFi AP')}, 'ath79-generic-ubnt_picostation-m-squashfs-sysupgrade.bin': {'label': 'Ubiquiti Picostation M (OpenWrt 19.07 and later)', 'boards': ('Ubiquiti Picostation M',)}, 'ath79-generic-ubnt_nanostation-m-squashfs-sysupgrade.bin': {'label': 'Ubiquiti Nanostation M (OpenWrt 19.07 and later)', 'boards': ('Ubiquiti Nanostation M',)}, 'ath79-generic-ubnt_nanostation-m-xw-squashfs-sysupgrade.bin': {'label': 'Ubiquiti Nanostation M - XW (OpenWrt 19.07 and later)', 'boards': ('Ubiquiti Nanostation M (XW)', 'Ubiquiti Nanostation M XW')}, 'ath79-generic-ubnt_nanostation-loco-m-xw-squashfs-sysupgrade.bin': {'label': 'Ubiquiti Nanostation Loco M - XW (OpenWrt 19.07 and later)', 'boards': ('Ubiquiti Nanostation Loco M (XW)',)}, 'ath79-generic-ubnt_nanostation-loco-m-squashfs-sysupgrade.bin': {'label': 'Ubiquiti Nanostation Loco M (OpenWrt 19.07 and later)', 'boards': ('Ubiquiti Nanostation Loco M',)}, 'ath79-generic-ubnt_airrouter-squashfs-sysupgrade.bin': {'label': 'Ubiquiti AirRouter (OpenWrt 19.07 and later)', 'boards': ('Ubiquiti AirRouter',)}, 'ath79-generic-tplink_tl-wr2543-v1-squashfs-sysupgrade.bin': {'label': 'TP-Link WR2543N/ND (OpenWrt 19.07 and later)', 'boards': ('TP-Link TL-WR2543N/ND',)}, 'ath79-generic-tplink_tl-wdr4300-v1-il-squashfs-sysupgrade.bin': {'label': 'TP-Link WDR4300 v1 Israel Version (OpenWrt 19.07 and later)', 'boards': ('TP-LINK TL-WDR4300 v1 (IL)',)}, 'ath79-generic-tplink_tl-wdr4300-v1-squashfs-sysupgrade.bin': {'label': 'TP-Link WDR4300 v1 (OpenWrt 19.07 and later)', 'boards': ('TP-Link TL-WDR4300 v1',)}, 'ath79-generic-tplink_tl-wdr3600-v1-squashfs-sysupgrade.bin': {'label': 'TP-Link WDR3600 v1 (OpenWrt 19.07 and later)', 'boards': ('TP-Link TL-WDR3600 v1',)}, 'ath79-generic-tplink_eap225-outdoor-v3-squashfs-sysupgrade.bin': {'label': 'TP-Link EAP225-Outdoor v3', 'boards': ('TP-Link EAP225-Outdoor v3',)}, 'ath79-generic-tplink_cpe510-v3-squashfs-sysupgrade.bin': {'label': 'TP-LINK CPE510 v3 (OpenWrt 19.07 and later)', 'boards': ('TP-LINK CPE510 v3',)}, 'ath79-generic-tplink_cpe210-v3-squashfs-sysupgrade.bin': {'label': 'TP-LINK CPE210 v3 (OpenWrt 19.07 and later)', 'boards': ('TP-LINK CPE210 v3',)}, 'ath79-generic-tplink_cpe210-v2-squashfs-sysupgrade.bin': {'label': 'TP-LINK CPE210 v2 (OpenWrt 19.07 and later)', 'boards': ('TP-LINK CPE210 v2',)}, 'ath79-generic-tplink_archer-c7-v5-squashfs-sysupgrade.bin': {'label': 'TP-Link Archer C7 v5 (OpenWrt 19.07 and later)', 'boards': ('TP-Link Archer C7 v5',)}, 'ath79-generic-tplink_archer-c7-v4-squashfs-sysupgrade.bin': {'label': 'TP-Link Archer C7 v4 (OpenWrt 19.07 and later)', 'boards': ('TP-Link Archer C7 v4',)}, 'ath79-generic-tplink_archer-c7-v2-squashfs-sysupgrade.bin': {'label': 'TP-Link Archer C7 v2 (OpenWrt 19.07 and later)', 'boards': ('TP-Link Archer C7 v2', 'TP-Link Archer C7 v3')}, 'ath79-generic-tplink_archer-c7-v1-squashfs-sysupgrade.bin': {'label': 'TP-Link Archer C7 v1 (OpenWrt 19.07 and later)', 'boards': ('tplink,archer-c7-v1',)}, 'ath79-generic-comfast_cf-e375ac-squashfs-sysupgrade.bin': {'label': 'COMFAST CF-E375AC', 'boards': ('COMFAST CF-E375AC',)}}
2 changes: 2 additions & 0 deletions openwisp_firmware_upgrader/targets/ath79/nand/devices.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
def returnData():
return {'ath79-nand-glinet_gl-ar300m-nand-squashfs-sysupgrade.bin': {'label': 'GL.iNet GL-AR300M (NAND)', 'boards': ('GL.iNet GL-AR300M (NAND)',)}}
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
def returnData():
return {'brcm2708-bcm2709-rpi-2-ext4-sysupgrade.img.gz': {'label': 'Raspberry Pi 2 Model B', 'boards': ('Raspberry Pi 2 Model B Rev 1.0', 'Raspberry Pi 2 Model B Rev 1.1', 'Raspberry Pi 2 Model B Rev 1.2')}}
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
def returnData():
return {'brcm2708-bcm2710-rpi-3-ext4-sysupgrade.img.gz': {'label': 'Raspberry Pi 3 Model B', 'boards': ('Raspberry Pi 3 Model B Rev 1.2',)}}
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
def returnData():
return {'dongwon_dw02-412h-128m-squashfs-sysupgrade.bin': {'label': 'Dongwon T&I DW02-412H (128M) / KT GiGA WiFi home (128M)', 'boards': ('DW02-412H-128M-NAND',)}}
2 changes: 2 additions & 0 deletions openwisp_firmware_upgrader/targets/ipq40xx/generic/devices.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
def returnData():
return {'ipq40xx-generic-engenius_eap1300-squashfs-sysupgrade.bin': {'label': 'EnGenius EAP1300', 'boards': ('EnGenius EAP1300',)}}
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
def returnData():
return {'ipq40xx-mikrotik-mikrotik_wap-ac-squashfs-sysupgrade.bin': {'label': 'MikroTik wAP ac', 'boards': ('MikroTik wAP ac',)}}
2 changes: 2 additions & 0 deletions openwisp_firmware_upgrader/targets/ipq807x/generic/devices.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
def returnData():
return {'ipq807x-generic-edgecore_eap102-squashfs-sysupgrade.bin': {'label': 'Edgecore EAP102', 'boards': ('Edgecore EAP102',)}}
2 changes: 2 additions & 0 deletions openwisp_firmware_upgrader/targets/mvebu/cortexa9/devices.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
def returnData():
return {'mvebu-cortexa9-linksys_wrt3200acm-squashfs-sysupgrade.img': {'label': 'Linksys WRT3200ACM', 'boards': ('Linksys WRT3200ACM',)}, 'mvebu-cortexa9-linksys_wrt1900acs-squashfs-sysupgrade.img': {'label': 'Linksys WRT1900ACS', 'boards': ('Linksys WRT1900ACS',)}}
2 changes: 2 additions & 0 deletions openwisp_firmware_upgrader/targets/octeon/erlite/devices.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
def returnData():
return {'octeon-erlite-squashfs-sysupgrade.tar': {'label': 'Ubiquiti EdgeRouter Lite', 'boards': ('Ubiquiti EdgeRouter Lite',)}}
2 changes: 2 additions & 0 deletions openwisp_firmware_upgrader/targets/ramips/mt7620/devices.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
def returnData():
return {'ramips-mt7620-zbtlink_zbt-we826-32m-squashfs-sysupgrade.bin': {'label': 'Zbtlink ZBT-WE826 (32M)', 'boards': ('Zbtlink ZBT-WE826 (32M)',)}, 'ramips-mt7620-zbtlink_zbt-we826-16m-squashfs-sysupgrade.bin': {'label': 'Zbtlink ZBT-WE826 (16M)', 'boards': ('Zbtlink ZBT-WE826 (16M)',)}, 'ramips-mt7620-zbtlink_zbt-we1026-5g-16m-squashfs-sysupgrade.bin': {'label': 'Zbtlink ZBT-WE1026-5G (16M)', 'boards': ('Zbtlink ZBT-WE1026-5G (16M)',)}}
2 changes: 2 additions & 0 deletions openwisp_firmware_upgrader/targets/ramips/mt7621/devices.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
def returnData():
return {'ramips-mt7621-zbt-wg3526-32M-squashfs-sysupgrade.bin': {'label': 'Zbtlink ZBT-WG3526 (32M)', 'boards': ('ZBT-WG3526 (32M)', 'Zbtlink ZBT-WG3526 (32M)')}, 'ramips-mt7621-zbt-wg3526-16M-squashfs-sysupgrade.bin': {'label': 'Zbtlink ZBT-WG3526 (16M)', 'boards': ('ZBT-WG3526 (16M)', 'Zbtlink ZBT-WG3526 (16M)')}, 'ramips-mt7621-yuncore_g720-squashfs-sysupgrade.bin': {'label': 'YunCore G720', 'boards': ('YunCore G720',)}, 'ramips-mt7621-yuncore_ax820-squashfs-sysupgrade.bin': {'label': 'YunCore AX820', 'boards': ('YunCore AX820',)}}
2 changes: 2 additions & 0 deletions openwisp_firmware_upgrader/targets/ramips/mt76x8/devices.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
def returnData():
return {'ramips-mt76x8-tplink_tl-wr902ac-v3-squashfs-sysupgrade.bin': {'label': 'TP-Link TL-WR902AC v3', 'boards': ('TP-Link TL-WR902AC v3',)}, 'ramips-mt76x8-tplink_archer-c50-v4-squashfs-sysupgrade.bin': {'label': 'TP-Link Archer C50 v4', 'boards': ('TP-Link Archer C50 v4',)}, 'ramips-mt76x8-gl-mt300n-v2-squashfs-sysupgrade.bin': {'label': 'GL.iNet GL-MT300N-V2', 'boards': ('GL-MT300N-V2',)}}
2 changes: 2 additions & 0 deletions openwisp_firmware_upgrader/targets/x86/64/devices.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
def returnData():
return {'x86-64-combined-squashfs.img.gz': {'label': 'VMware, Inc. VMware Virtual Platform', 'boards': ('VMware, Inc. VMware Virtual Platform',)}, 'x86-64-generic-squashfs-combined.img.gz': {'label': 'Generic x86/64 (QEMU/KVM)', 'boards': ('x86_64', 'PC Engines APU2', 'PC Engines apu2', 'PC Engines apu6')}}
2 changes: 2 additions & 0 deletions openwisp_firmware_upgrader/targets/x86/generic/devices.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
def returnData():
return {'x86-generic-combined-squashfs.img.gz': {'label': 'Generic x86/32 bit', 'boards': ('x86',)}}
2 changes: 2 additions & 0 deletions openwisp_firmware_upgrader/targets/x86/geode/devices.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
def returnData():
return {'x86-geode-combined-squashfs.img.gz': {'label': 'x86 Geode(TM) Integrated Processor by AMD', 'boards': ('Geode(TM) Integrated Processor by AMD PCS', 'Alix 2D2')}}