diff --git a/.circleci/config.yml b/.circleci/config.yml
index cc1893b1..e9aca158 100644
--- a/.circleci/config.yml
+++ b/.circleci/config.yml
@@ -48,6 +48,10 @@ jobs:
name: Build
command: make MAINTARGET=ipq40xx SUBTARGET=mikrotik
no_output_timeout: 2h
+ - run:
+ name: Build
+ command: make MAINTARGET=x86 SUBTARGET=64
+ no_output_timeout: 2h
- run:
name: Compress build files
command: tar -cjf ~/${CIRCLE_BRANCH}_${ARTIFACTS_FILE} -C ${MY_WORKING_DIRECTORY}/${ARTIFACTS_DIR} .
diff --git a/Makefile b/Makefile
index b89e8360..e16e5a6d 100644
--- a/Makefile
+++ b/Makefile
@@ -149,7 +149,7 @@ compile: stamp-clean-compiled .stamp-compiled
$(UMASK); \
$(MAKE) -C $(OPENWRT_DIR) $(MAKE_ARGS)
for FILE in `find $(TOP_DIR)/firmware/targets/$(MAINTARGET)/$(SUBTARGET) -path "*packages" -prune -o \( -type f -a \
- ! \( -name "*factory.bin" -o -name "*sysupgrade.bin" -o -name "*initramfs*" -o -name sha256sums -o -name "*.buildinfo" -o -name "*.json" \) \
+ ! \( -name "*factory.bin" -o -name "*sysupgrade.bin" -o -name "*x86*" -o -name "*initramfs*" -o -name sha256sums -o -name "*.buildinfo" -o -name "*.json" \) \
-print \)`; do rm $$FILE; \
done;
$(TOP_DIR)/scripts/tests-postbuild.sh
diff --git a/configs/x86-64.config b/configs/x86-64.config
new file mode 100755
index 00000000..3307fca5
--- /dev/null
+++ b/configs/x86-64.config
@@ -0,0 +1,6 @@
+CONFIG_TARGET_x86=y
+CONFIG_TARGET_x86_64=y
+CONFIG_TARGET_ALL_PROFILES=y
+CONFIG_TARGET_ROOTFS_INITRAMFS=n
+CONFIG_TARGET_ROOTFS_TARGZ=n
+CONFIG_TARGET_ROOTFS_SQUASHFS=n
diff --git a/files/etc/radios.json b/files/etc/radios.json
index 949208dd..f810629d 100644
--- a/files/etc/radios.json
+++ b/files/etc/radios.json
@@ -541,5 +541,8 @@
"name" : "Ubiquiti PowerBridge M5",
"maxpower" : "22",
"pwroffset" : "5"
+ },
+ "QEMU Standard PC (i440FX + PIIX, 1996)" : {
+ "name" : "QEMU PC"
}
}
diff --git a/files/usr/lib/lua/aredn/hardware.lua b/files/usr/lib/lua/aredn/hardware.lua
index 65d49389..14d6d773 100644
--- a/files/usr/lib/lua/aredn/hardware.lua
+++ b/files/usr/lib/lua/aredn/hardware.lua
@@ -240,6 +240,14 @@ function hardware.has_usb()
return false
end
+function hardware.has_wifi()
+ if nixio.fs.stat("/sys/kernel/debug/ieee80211") then
+ return true
+ else
+ return false
+ end
+end
+
function hardware.get_rfbandwidths(wifiintf)
return { 5, 10, 20 }
end
diff --git a/files/usr/local/bin/node-setup b/files/usr/local/bin/node-setup
index e799f6d5..4bc1418e 100755
--- a/files/usr/local/bin/node-setup
+++ b/files/usr/local/bin/node-setup
@@ -102,8 +102,8 @@ local ieee80211 = "/sys/class/ieee80211/"
local lanintf = aredn.hardware.get_board_network_ifname("lan")
local node = aredn_info.get_nvram("node")
local tactical = aredn_info.get_nvram("tactical")
-local mac2 = mac_to_ip(aredn.hardware.get_interface_mac(aredn.hardware.get_iface_name("wifi")), 0)
-local dtdmac = mac_to_ip(aredn.hardware.get_interface_mac(lanintf:match("^(%S+)")), 0) -- *not* based of dtdlink
+local mac2 = aredn_info.get_nvram("mac2")
+local dtdmac = aredn_info.get_nvram("dtdmac")
local deleteme = {}
local cfg = {
@@ -739,119 +739,121 @@ c:commit("dhcp")
local config = ""
local ifacenum = 0
local ifacecount = 0
-for devname in nixio.fs.dir(ieee80211)
-do
- ifacecount = ifacecount + 1
-end
-for devname in nixio.fs.dir(ieee80211)
-do
- local dev = devname:match("^phy(%d+)$")
- local radio = "radio" .. dev
- local wlan = "wlan" .. dev
- local devpath = nixio.fs.realpath(ieee80211 .. nixio.fs.readlink(ieee80211 .. devname)):match("^/sys/devices/(.*)/ieee802.*$")
- if devpath:match("^platform.*/pci.*") then
- devpath = devpath:match("^platform/(.*)")
+if nixio.fs.stat(ieee80211) then
+ for devname in nixio.fs.dir(ieee80211)
+ do
+ ifacecount = ifacecount + 1
end
- local is_mesh_rf = false
- local htmode = "HT20"
- local disabled = "0"
- local chanbw = nil
- local country = nil
- local channel = nil
- local distance = nil
- local hwmode = "11g"
- if iwinfo.nl80211.freqlist(devname)[1].mhz > 5000 then
- hwmode="11a"
- end
- local network = nil
- local mode = nil
- local ssid = nil
- local encryption = nil
- local key = nil
-
- if wlan == cfg.wifi_intf then
- -- mesh RF adhoc configuration
- is_mesh_rf = true
- channel = cfg.wifi_channel
- chanbw = cfg.wifi_chanbw
- country = "HX"
- distance = cfg.wifi_distance
- ssid = cfg.wifi_ssid .. "-" .. chanbw .. "-v3"
- mode = "adhoc"
- encryption = "none"
- network = "wifi"
- elseif cfg.wifi2_enable == "1" and (ifacecount == 1 or (ifacecount > 1 and hwmode == cfg.wifi2_hwmode)) then
- -- lan AP interface
- channel = cfg.wifi2_channel
- ssid = h2s(cfg.wifi2_ssid)
- mode = "ap"
- encryption = cfg.wifi2_encryption
- key = h2s(cfg.wifi2_key)
- network = "lan"
- elseif cfg.wifi3_enable == "1" and (ifacecount == 1 or (ifacecount > 1 and hwmode == cfg.wifi3_hwmode)) then
- -- wan client
- ssid = h2s(cfg.wifi3_ssid)
- mode = "sta"
- if cfg.wifi3_key and cfg.wifi3_key ~= "" then
- encryption = "psk2"
- key = h2s(cfg.wifi3_key)
- else
- enable = "none"
+ for devname in nixio.fs.dir(ieee80211)
+ do
+ local dev = devname:match("^phy(%d+)$")
+ local radio = "radio" .. dev
+ local wlan = "wlan" .. dev
+ local devpath = nixio.fs.realpath(ieee80211 .. nixio.fs.readlink(ieee80211 .. devname)):match("^/sys/devices/(.*)/ieee802.*$")
+ if devpath:match("^platform.*/pci.*") then
+ devpath = devpath:match("^platform/(.*)")
end
- network = "wan"
- htmode = nil
- else
- disabled = "1"
- end
+ local is_mesh_rf = false
+ local htmode = "HT20"
+ local disabled = "0"
+ local chanbw = nil
+ local country = nil
+ local channel = nil
+ local distance = nil
+ local hwmode = "11g"
+ if iwinfo.nl80211.freqlist(devname)[1].mhz > 5000 then
+ hwmode="11a"
+ end
+ local network = nil
+ local mode = nil
+ local ssid = nil
+ local encryption = nil
+ local key = nil
- config = config .. "config wifi-device '" .. radio .. "'\n option type 'mac80211'\n"
- config = config .. " option disabled '" .. disabled .. "'\n"
- if channel then
- config = config .. " option channel '" .. channel .. "'\n"
- end
- if chanbw then
- config = config .. " option chanbw '" .. chanbw .. "'\n"
- end
- if country then
- config = config .. " option country '" .. country .. "'\n"
- end
- if distance then
- config = config .. " option distance '" .. distance .. "'\n"
- end
- config = config .. " option hwmode '" .. hwmode .. "'\n"
- if htmode then
- config = config .. " option htmode '" .. htmode .. "'\n"
- end
- config = config .. " option path '" .. devpath .. "'\n\n"
+ if wlan == cfg.wifi_intf then
+ -- mesh RF adhoc configuration
+ is_mesh_rf = true
+ channel = cfg.wifi_channel
+ chanbw = cfg.wifi_chanbw
+ country = "HX"
+ distance = cfg.wifi_distance
+ ssid = cfg.wifi_ssid .. "-" .. chanbw .. "-v3"
+ mode = "adhoc"
+ encryption = "none"
+ network = "wifi"
+ elseif cfg.wifi2_enable == "1" and (ifacecount == 1 or (ifacecount > 1 and hwmode == cfg.wifi2_hwmode)) then
+ -- lan AP interface
+ channel = cfg.wifi2_channel
+ ssid = h2s(cfg.wifi2_ssid)
+ mode = "ap"
+ encryption = cfg.wifi2_encryption
+ key = h2s(cfg.wifi2_key)
+ network = "lan"
+ elseif cfg.wifi3_enable == "1" and (ifacecount == 1 or (ifacecount > 1 and hwmode == cfg.wifi3_hwmode)) then
+ -- wan client
+ ssid = h2s(cfg.wifi3_ssid)
+ mode = "sta"
+ if cfg.wifi3_key and cfg.wifi3_key ~= "" then
+ encryption = "psk2"
+ key = h2s(cfg.wifi3_key)
+ else
+ enable = "none"
+ end
+ network = "wan"
+ htmode = nil
+ else
+ disabled = "1"
+ end
- config = config .. "config wifi-iface\n"
- config = config .. " option ifname '" .. wlan .. "'\n"
- config = config .. " option device '" .. radio .. "'\n"
- if network then
- config = config .. " option network '" .. network .. "'\n"
- end
- if mode then
- config = config .. " option mode '" .. mode .. "'\n"
- end
- if ssid then
- config = config .. " option ssid '" .. ssid .. "'\n"
- end
- if encryption then
- config = config .. " option encryption '" .. encryption .. "'\n"
- end
- if key then
- config = config .. " option key '" .. key .. "'\n"
- end
- config = config .. "\n"
+ config = config .. "config wifi-device '" .. radio .. "'\n option type 'mac80211'\n"
+ config = config .. " option disabled '" .. disabled .. "'\n"
+ if channel then
+ config = config .. " option channel '" .. channel .. "'\n"
+ end
+ if chanbw then
+ config = config .. " option chanbw '" .. chanbw .. "'\n"
+ end
+ if country then
+ config = config .. " option country '" .. country .. "'\n"
+ end
+ if distance then
+ config = config .. " option distance '" .. distance .. "'\n"
+ end
+ config = config .. " option hwmode '" .. hwmode .. "'\n"
+ if htmode then
+ config = config .. " option htmode '" .. htmode .. "'\n"
+ end
+ config = config .. " option path '" .. devpath .. "'\n\n"
- if is_mesh_rf then
- config = config .. "config wifi-iface\n"
- config = config .. " option ifname '" .. wlan .. "-1'\n"
+ config = config .. "config wifi-iface\n"
+ config = config .. " option ifname '" .. wlan .. "'\n"
config = config .. " option device '" .. radio .. "'\n"
- config = config .. " option network 'wifi_mon'\n option mode 'monitor'\n\n"
- end
+ if network then
+ config = config .. " option network '" .. network .. "'\n"
+ end
+ if mode then
+ config = config .. " option mode '" .. mode .. "'\n"
+ end
+ if ssid then
+ config = config .. " option ssid '" .. ssid .. "'\n"
+ end
+ if encryption then
+ config = config .. " option encryption '" .. encryption .. "'\n"
+ end
+ if key then
+ config = config .. " option key '" .. key .. "'\n"
+ end
+ config = config .. "\n"
- ifacenum = ifacenum + 1
+ if is_mesh_rf then
+ config = config .. "config wifi-iface\n"
+ config = config .. " option ifname '" .. wlan .. "-1'\n"
+ config = config .. " option device '" .. radio .. "'\n"
+ config = config .. " option network 'wifi_mon'\n option mode 'monitor'\n\n"
+ end
+
+ ifacenum = ifacenum + 1
+ end
end
write_all("/etc/config/wireless", config)
diff --git a/files/usr/local/bin/nvram-setup b/files/usr/local/bin/nvram-setup
index c07aa1ce..7947b9e9 100755
--- a/files/usr/local/bin/nvram-setup
+++ b/files/usr/local/bin/nvram-setup
@@ -1,37 +1,37 @@
#! /usr/bin/lua
--[[
- Part of AREDN -- Used for creating Amateur Radio Emergency Data Networks
- Copyright (C) 2021 Tim Wilkinson
- Original Perl Copyright (C) 2015 Conrad Lara
- See Contributors file for additional contributors
+ Part of AREDN -- Used for creating Amateur Radio Emergency Data Networks
+ Copyright (C) 2021 Tim Wilkinson
+ Original Perl Copyright (C) 2015 Conrad Lara
+ See Contributors file for additional contributors
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation version 3 of the License.
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation version 3 of the License.
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
- You should have received a copy of the GNU General Public License
- along with this program. If not, see
Mesh RF (" .. (M3model and "3GHz" or M9model and "900MHz" or wifi_channel < 36 and "2GHz" or "5GHz") .. ") | |||
---|---|---|---|
Mesh RF (" .. (M3model and "3GHz" or M9model and "900MHz" or wifi_channel < 36 and "2GHz" or "5GHz") .. ") | |||
Mesh | |||
Enable | Enable | ||
Netmask | " .. ip .. " / " .. cidr .. " " +local mask = cursor:get("network", "wifi", "netmask") +local cidr +if not ip or not mask then + col1[#col1 + 1] = " | none " else - wifi_gw = get_default_gw("wifi") - col1[#col1 + 1] = " | SSID: channel: | " .. ip .. " / " .. cidr .. " " .. wifi_gw .. " " .. mesh_ip_to_hostnames(wifi_gw) .. " " .. wifi_ssid .. " " .. wifi_channel .. " " .. wifi_chanbw .. " MHz | "
+ cidr = netmask_to_cidr(mask)
+ if wifi_disabled then
+ col1[#col1 + 1] = "" .. ip .. " / " .. cidr .. " " + else + wifi_gw = get_default_gw("wifi") + col1[#col1 + 1] = " | SSID: channel: | " .. ip .. " / " .. cidr .. " " .. wifi_gw .. " " .. mesh_ip_to_hostnames(wifi_gw) .. " " .. wifi_ssid .. " " .. wifi_channel .. " " .. wifi_chanbw .. " MHz | "
+ end
end
ip = cursor:get("network", "lan", "ipaddr")
diff --git a/patches/751-x86.patch b/patches/751-x86.patch
new file mode 100755
index 00000000..1fbb1381
--- /dev/null
+++ b/patches/751-x86.patch
@@ -0,0 +1,14 @@
+--- a/target/linux/x86/base-files/etc/board.d/02_network
++++ b/target/linux/x86/base-files/etc/board.d/02_network
+@@ -45,6 +45,11 @@
+ macaddr="$(cat /sys/class/net/eth0/address)" 2>/dev/null
+ [ -n "$macaddr" ] && ucidef_set_interface_macaddr "wan" "$macaddr"
+ ;;
++*)
++ ucidef_set_interfaces_lan_wan "eth0" "eth0.1"
++ ucidef_set_interface "dtdlink" device "eth0.2" protocol "static"
++ ;;
++
+ esac
+ board_config_flush
+
diff --git a/patches/series b/patches/series
index 47c99f84..861f84ae 100644
--- a/patches/series
+++ b/patches/series
@@ -36,5 +36,6 @@
749-fix-tiny.patch
749-ubiquiti-extra-support.patch
750-ibss-2g-fix.patch
+751-x86.patch
800-upgrade-compatibility.patch
801-mikrotik-lhg-variants.patch