From 044d2fea8156e7308d26cad7c26f4ebfbeadc824 Mon Sep 17 00:00:00 2001 From: Robert Marko Date: Mon, 2 Dec 2024 11:26:32 +0100 Subject: [PATCH 01/48] rpcd: update to Git HEAD (2024-12-02) cc9a471c32e1 rpc-sys: rework packagelist call for apk Link: https://github.com/openwrt/openwrt/pull/17144 Signed-off-by: Robert Marko --- package/system/rpcd/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package/system/rpcd/Makefile b/package/system/rpcd/Makefile index da031db8498d0f..447bec1ac4e0f6 100644 --- a/package/system/rpcd/Makefile +++ b/package/system/rpcd/Makefile @@ -12,9 +12,9 @@ PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(PROJECT_GIT)/project/rpcd.git -PKG_MIRROR_HASH:=67b2cb985d8712a3e5a17ebf8c74fd35d553c8f9a4197616f9a3649a8740cc33 -PKG_SOURCE_DATE:=2024-09-17 -PKG_SOURCE_VERSION:=9f4b86e70352ab9ca6aa272d096419acc53e2390 +PKG_MIRROR_HASH:=081058ace6445fc8bf67e49f51e1bc87bf36bd0a38b34e6ff8976d7260bf2c9f +PKG_SOURCE_DATE:=2024-12-02 +PKG_SOURCE_VERSION:=cc9a471c32e106fa9ee045540613fefdc31c5cd2 PKG_MAINTAINER:=Jo-Philipp Wich PKG_LICENSE:=ISC From 3b661cfcf9158a3dc5be6f7e1e1340339c9423b5 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Mon, 2 Dec 2024 12:27:35 +0100 Subject: [PATCH 02/48] build: remove targetinfo invalidation based on .config Target info no longer depends on config settings Signed-off-by: Felix Fietkau --- include/toplevel.mk | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/include/toplevel.mk b/include/toplevel.mk index a52c56832eca03..092dff786c9922 100644 --- a/include/toplevel.mk +++ b/include/toplevel.mk @@ -75,22 +75,7 @@ endif _ignore = $(foreach p,$(IGNORE_PACKAGES),--ignore $(p)) -# Config that will invalidate the .targetinfo as they will affect -# DEFAULT_PACKAGES. -# Keep DYNAMIC_DEF_PKG_CONF in sync with target.mk to reflect the same configs -DYNAMIC_DEF_PKG_CONF := CONFIG_USE_APK CONFIG_SELINUX CONFIG_SMALL_FLASH CONFIG_USE_SECCOMP -check-dynamic-def-pkg: FORCE - @+DEF_PKG_CONFS=""; \ - if [ -f $(TOPDIR)/.config ]; then \ - for config in $(DYNAMIC_DEF_PKG_CONF); do \ - DEF_PKG_CONFS="$$DEF_PKG_CONFS "$$(grep "$$config"=y $(TOPDIR)/.config); \ - done; \ - fi; \ - [ ! -f tmp/.packagedynamicdefault ] || OLD_DEF_PKG_CONFS=$$(cat tmp/.packagedynamicdefault); \ - [ "$$DEF_PKG_CONFS" = "$$OLD_DEF_PKG_CONFS" ] || rm -rf tmp/info/.targetinfo*; \ - mkdir -p tmp && echo "$$DEF_PKG_CONFS" > tmp/.packagedynamicdefault; - -prepare-tmpinfo: check-dynamic-def-pkg FORCE +prepare-tmpinfo: FORCE @+$(MAKE) -r -s $(STAGING_DIR_HOST)/.prereq-build $(PREP_MK) mkdir -p tmp/info feeds [ -e $(TOPDIR)/feeds/base ] || ln -sf $(TOPDIR)/package $(TOPDIR)/feeds/base From 1af15e8a2bf4d7ddd87d5f397064a5802eca5d67 Mon Sep 17 00:00:00 2001 From: John Crispin Date: Fri, 9 Feb 2024 18:10:12 +0100 Subject: [PATCH 03/48] base-files: allow forcing all LEDs to on/off/blink state * add a UCI option to disable all LEDs. * add an init.d parameter to blink all LEDs * add on/off parameters to init.d Signed-off-by: John Crispin --- package/base-files/files/etc/init.d/led | 28 +++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/package/base-files/files/etc/init.d/led b/package/base-files/files/etc/init.d/led index 7f05254c2ba3a3..377b9dcf3ebce6 100755 --- a/package/base-files/files/etc/init.d/led +++ b/package/base-files/files/etc/init.d/led @@ -3,6 +3,10 @@ START=96 +extra_command "turnon" "Put the LEDs into their default state" +extra_command "turnoff" "Turn all LEDs off" +extra_command "blink" "Blink all LEDs" + led_color_set() { local cfg="$1" local sysfs="$2" @@ -168,7 +172,31 @@ load_led() { } } +turnoff() { + for led in `ls /sys/class/leds/`; do + echo 0 > /sys/class/leds/$led/brightness + done +} + +turnon() { + turnoff + . /etc/diag.sh + set_state done + start +} + +blink() { + for led in `ls /sys/class/leds/`; do + echo 0 > /sys/class/leds/$led/brightness + echo timer > /sys/class/leds/$led/trigger + done +} + start() { + [ "$(uci -q get system.@system[-1].leds_off)" = '1' ] && { + turnoff + exit 0 + } [ -e /sys/class/leds/ ] && { [ -s /var/run/led.state ] && { local led trigger brightness color From 5af4d4f6b6328e8613661e5806f224539837302e Mon Sep 17 00:00:00 2001 From: John Crispin Date: Fri, 29 Nov 2024 10:58:06 +0100 Subject: [PATCH 04/48] uboot-mediatek: increase USB probe delay on OpenWrt One This solves compatibility issues with some pendrives. Originally reported by "HIDE-r" on the forum. Signed-off-by: John Crispin --- .../boot/uboot-mediatek/patches/453-add-openwrt-one.patch | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/package/boot/uboot-mediatek/patches/453-add-openwrt-one.patch b/package/boot/uboot-mediatek/patches/453-add-openwrt-one.patch index cf5f79f5841996..6c31d88be81825 100644 --- a/package/boot/uboot-mediatek/patches/453-add-openwrt-one.patch +++ b/package/boot/uboot-mediatek/patches/453-add-openwrt-one.patch @@ -469,7 +469,7 @@ +CONFIG_LMB_MAX_REGIONS=64 --- /dev/null +++ b/openwrt-one-nor_env -@@ -0,0 +1,47 @@ +@@ -0,0 +1,48 @@ +ethaddr_factory=mtd read factory 0x46000000 0x0 0x20000 && env readmem -b ethaddr 0x4600002a 0x6 ; setenv ethaddr_factory +bl2_mtd_write=mtd erase bl2-nor && mtd write bl2-nor $loadaddr 0x0 0x40000 +bl2_tftp_write=tftpboot $loadaddr $bootfile_bl2_nor && run bl2_mtd_write @@ -510,6 +510,7 @@ +serverip=192.168.11.23 +tftp_boot=run led_start ; tftpboot $loadaddr $bootfile && bootm $loadaddr#$bootconf +tftp_write=run led_start ; tftpboot $loadaddr $bootfile && mtd erase recovery 0x0 ${filesize} && mtd write recovery $loadaddr 0x0 ${filesize} ++usb_pgood_delay=4000 +usb_recovery=run led_start ; usb start && run usb_recovery_bl2 && run usb_recovery_ubi && run led_loop_done +usb_recovery_bl2=fatload usb 0:1 ${loadaddr} ${recoverfile_bl2} && run recovery_write_bl2 +usb_recovery_ubi=fatload usb 0:1 ${loadaddr} ${recoverfile_ubi} && run recovery_write_ubi @@ -519,7 +520,7 @@ +_bootmenu_update_title=setenv _bootmenu_update_title ; setenv bootmenu_title "$bootmenu_title $ver" --- /dev/null +++ b/openwrt-one-spi-nand_env -@@ -0,0 +1,60 @@ +@@ -0,0 +1,61 @@ +ethaddr_factory=mtd read factory 0x46000000 0x0 0x20000 && env readmem -b ethaddr 0x4600002a 0x6 ; setenv ethaddr_factory +ipaddr=192.168.11.11 +serverip=192.168.11.23 @@ -571,6 +572,7 @@ +ubi_read_production=ubi read $loadaddr fit && iminfo $loadaddr && run ubi_prepare_rootfs +ubi_read_recovery=ubi check recovery && ubi read $loadaddr recovery +ubi_remove_rootfs=ubi check rootfs_data && ubi remove rootfs_data ++usb_pgood_delay=4000 +usb_recover=run led_start ; usb start && run usb_recover_production && run led_loop_done +usb_recover_production=fatload usb 0:1 ${loadaddr} ${bootfile_upg} && iminfo $loadaddr && run ubi_write_production +ubi_write_fip=run ubi_remove_rootfs ; ubi check fip && ubi remove fip ; ubi create fip $filesize static && ubi write $loadaddr fip $filesize From 90d0065f5107024f44927190b057c215db5dbcbc Mon Sep 17 00:00:00 2001 From: John Crispin Date: Mon, 2 Dec 2024 10:33:55 +0100 Subject: [PATCH 05/48] hostapd: enable CONFIG_EAP_PSK Without this option using the eap_server in combination with wifi-station entries will fail. Signed-off-by: John Crispin --- package/network/services/hostapd/files/hostapd-full.config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/network/services/hostapd/files/hostapd-full.config b/package/network/services/hostapd/files/hostapd-full.config index 9076ebc44f95df..a72ad0f3b47c53 100644 --- a/package/network/services/hostapd/files/hostapd-full.config +++ b/package/network/services/hostapd/files/hostapd-full.config @@ -94,7 +94,7 @@ CONFIG_EAP_TTLS=y #CONFIG_EAP_PAX=y # EAP-PSK for the integrated EAP server (this is _not_ needed for WPA-PSK) -#CONFIG_EAP_PSK=y +CONFIG_EAP_PSK=y # EAP-pwd for the integrated EAP server (secure authentication with a password) #CONFIG_EAP_PWD=y From 461d9dca89ea209ab98388d2900efb59b3015581 Mon Sep 17 00:00:00 2001 From: John Crispin Date: Fri, 29 Nov 2024 08:40:08 +0100 Subject: [PATCH 06/48] hostapd: add radius WISPr rate control AVPs This allows a radius server to send AVPs for client rate control inside the accept message. Further add the ratelimits to the sta-authorized ubus notification. Signed-off-by: John Crispin --- .../hostapd/patches/763-radius-wispr.patch | 105 ++++++++++++++++++ .../services/hostapd/src/src/ap/ubus.c | 7 ++ 2 files changed, 112 insertions(+) create mode 100644 package/network/services/hostapd/patches/763-radius-wispr.patch diff --git a/package/network/services/hostapd/patches/763-radius-wispr.patch b/package/network/services/hostapd/patches/763-radius-wispr.patch new file mode 100644 index 00000000000000..da81a623e76c25 --- /dev/null +++ b/package/network/services/hostapd/patches/763-radius-wispr.patch @@ -0,0 +1,105 @@ +--- a/src/ap/ieee802_1x.c ++++ b/src/ap/ieee802_1x.c +@@ -2035,6 +2035,25 @@ static int ieee802_1x_update_vlan(struct + } + #endif /* CONFIG_NO_VLAN */ + ++static int ieee802_1x_update_wispr(struct hostapd_data *hapd, ++ struct sta_info *sta, ++ struct radius_msg *msg) ++{ ++ memset(sta->bandwidth, 0, sizeof(sta->bandwidth)); ++ ++ if (radius_msg_get_wispr(msg, sta->bandwidth)) ++ return 0; ++ ++ if (!sta->bandwidth[0] && !sta->bandwidth[1]) ++ return 0; ++ ++ hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_IEEE8021X, ++ HOSTAPD_LEVEL_INFO, ++ "received wispr bandwidth from RADIUS server %d/%d", ++ sta->bandwidth[0], sta->bandwidth[1]); ++ ++ return 0; ++} + + /** + * ieee802_1x_receive_auth - Process RADIUS frames from Authentication Server +@@ -2151,6 +2170,7 @@ ieee802_1x_receive_auth(struct radius_ms + ieee802_1x_check_hs20(hapd, sta, msg, + session_timeout_set ? + (int) session_timeout : -1); ++ ieee802_1x_update_wispr(hapd, sta, msg); + break; + case RADIUS_CODE_ACCESS_REJECT: + sm->eap_if->aaaFail = true; +--- a/src/ap/sta_info.h ++++ b/src/ap/sta_info.h +@@ -95,6 +95,7 @@ struct sta_info { + u8 supported_rates[WLAN_SUPP_RATES_MAX]; + int supported_rates_len; + u8 qosinfo; /* Valid when WLAN_STA_WMM is set */ ++ u32 bandwidth[2]; + + #ifdef CONFIG_MESH + enum mesh_plink_state plink_state; +--- a/src/radius/radius.c ++++ b/src/radius/radius.c +@@ -1339,6 +1339,35 @@ radius_msg_get_cisco_keys(struct radius_ + return keys; + } + ++#define RADIUS_VENDOR_ID_WISPR 14122 ++#define RADIUS_WISPR_AV_BW_UP 7 ++#define RADIUS_WISPR_AV_BW_DOWN 8 ++ ++int ++radius_msg_get_wispr(struct radius_msg *msg, u32 *bandwidth) ++{ ++ int i; ++ ++ if (msg == NULL || bandwidth == NULL) ++ return 1; ++ ++ for (i = 0; i < 2; i++) { ++ size_t keylen; ++ u8 *key; ++ ++ key = radius_msg_get_vendor_attr(msg, RADIUS_VENDOR_ID_WISPR, ++ RADIUS_WISPR_AV_BW_UP + i, &keylen); ++ if (!key) ++ continue; ++ ++ if (keylen == 4) ++ bandwidth[i] = ntohl(*((u32 *)key)); ++ os_free(key); ++ } ++ ++ return 0; ++} ++ + + int radius_msg_add_mppe_keys(struct radius_msg *msg, + const u8 *req_authenticator, +--- a/src/radius/radius.h ++++ b/src/radius/radius.h +@@ -233,6 +233,10 @@ enum { + RADIUS_VENDOR_ATTR_WFA_HS20_T_C_URL = 10, + }; + ++#define RADIUS_VENDOR_ID_WISPR 14122 ++#define RADIUS_WISPR_AV_BW_UP 7 ++#define RADIUS_WISPR_AV_BW_DOWN 8 ++ + #ifdef _MSC_VER + #pragma pack(pop) + #endif /* _MSC_VER */ +@@ -306,6 +310,7 @@ radius_msg_get_ms_keys(struct radius_msg + struct radius_ms_mppe_keys * + radius_msg_get_cisco_keys(struct radius_msg *msg, struct radius_msg *sent_msg, + const u8 *secret, size_t secret_len); ++int radius_msg_get_wispr(struct radius_msg *msg, u32 *bandwidth); + int radius_msg_add_mppe_keys(struct radius_msg *msg, + const u8 *req_authenticator, + const u8 *secret, size_t secret_len, diff --git a/package/network/services/hostapd/src/src/ap/ubus.c b/package/network/services/hostapd/src/src/ap/ubus.c index 22567207556599..b02615835770d0 100644 --- a/package/network/services/hostapd/src/src/ap/ubus.c +++ b/package/network/services/hostapd/src/src/ap/ubus.c @@ -1876,6 +1876,13 @@ void hostapd_ubus_notify_authorized(struct hostapd_data *hapd, struct sta_info * blobmsg_add_string(&b, "ifname", hapd->conf->iface); if (auth_alg) blobmsg_add_string(&b, "auth-alg", auth_alg); + if (sta->bandwidth[0] || sta->bandwidth[1]) { + void *r = blobmsg_open_array(&b, "rate-limit"); + + blobmsg_add_u32(&b, "", sta->bandwidth[0]); + blobmsg_add_u32(&b, "", sta->bandwidth[1]); + blobmsg_close_array(&b, r); + } ubus_notify(ctx, &hapd->ubus.obj, "sta-authorized", b.head, -1); } From 6365316fab8737f81dddbf5e81e90edb2d285a35 Mon Sep 17 00:00:00 2001 From: John Crispin Date: Mon, 14 Oct 2024 13:11:38 +0200 Subject: [PATCH 07/48] hostapd: add ubus support for wired driver Use and alternate ubus object when the config contains "driver=wired". This commit is in preparation of the ieee8021x-wired daemon. Signed-off-by: John Crispin --- .../hostapd/files/hostapd-full.config | 2 +- .../network/services/hostapd/files/wpad.json | 5 + .../services/hostapd/src/src/ap/ubus.c | 92 ++++++++++++++++++- 3 files changed, 95 insertions(+), 4 deletions(-) diff --git a/package/network/services/hostapd/files/hostapd-full.config b/package/network/services/hostapd/files/hostapd-full.config index a72ad0f3b47c53..2ac2a312d177c6 100644 --- a/package/network/services/hostapd/files/hostapd-full.config +++ b/package/network/services/hostapd/files/hostapd-full.config @@ -97,7 +97,7 @@ CONFIG_EAP_TTLS=y CONFIG_EAP_PSK=y # EAP-pwd for the integrated EAP server (secure authentication with a password) -#CONFIG_EAP_PWD=y +CONFIG_EAP_PWD=y # EAP-SAKE for the integrated EAP server #CONFIG_EAP_SAKE=y diff --git a/package/network/services/hostapd/files/wpad.json b/package/network/services/hostapd/files/wpad.json index c73f3d98bd1d4c..3dc7bd3c988b92 100644 --- a/package/network/services/hostapd/files/wpad.json +++ b/package/network/services/hostapd/files/wpad.json @@ -1,22 +1,27 @@ { "bounding": [ "CAP_NET_ADMIN", + "CAP_NET_BIND_SERVICE", "CAP_NET_RAW" ], "effective": [ "CAP_NET_ADMIN", + "CAP_NET_BIND_SERVICE", "CAP_NET_RAW" ], "ambient": [ "CAP_NET_ADMIN", + "CAP_NET_BIND_SERVICE", "CAP_NET_RAW" ], "permitted": [ "CAP_NET_ADMIN", + "CAP_NET_BIND_SERVICE", "CAP_NET_RAW" ], "inheritable": [ "CAP_NET_ADMIN", + "CAP_NET_BIND_SERVICE", "CAP_NET_RAW" ] } diff --git a/package/network/services/hostapd/src/src/ap/ubus.c b/package/network/services/hostapd/src/src/ap/ubus.c index b02615835770d0..395e2c2dbce3f8 100644 --- a/package/network/services/hostapd/src/src/ap/ubus.c +++ b/package/network/services/hostapd/src/src/ap/ubus.c @@ -369,6 +369,7 @@ hostapd_bss_get_status(struct ubus_context *ctx, struct ubus_object *obj, &op_class, &channel); blob_buf_init(&b, 0); + blobmsg_add_string(&b, "driver", hapd->driver->name); blobmsg_add_string(&b, "status", hostapd_state_text(hapd->iface->state)); blobmsg_printf(&b, "bssid", MACSTR, MAC2STR(hapd->conf->bssid)); @@ -1657,6 +1658,85 @@ static int avl_compare_macaddr(const void *k1, const void *k2, void *ptr) return memcmp(k1, k2, ETH_ALEN); } +static int +hostapd_wired_get_clients(struct ubus_context *ctx, struct ubus_object *obj, + struct ubus_request_data *req, const char *method, + struct blob_attr *msg) +{ + struct hostapd_data *hapd = container_of(obj, struct hostapd_data, ubus.obj); + struct hostap_sta_driver_data sta_driver_data; + struct sta_info *sta; + void *list, *c; + char mac_buf[20]; + static const struct { + const char *name; + uint32_t flag; + } sta_flags[] = { + { "authorized", WLAN_STA_AUTHORIZED }, + }; + + blob_buf_init(&b, 0); + list = blobmsg_open_table(&b, "clients"); + for (sta = hapd->sta_list; sta; sta = sta->next) { + void *r; + int i; + + sprintf(mac_buf, MACSTR, MAC2STR(sta->addr)); + c = blobmsg_open_table(&b, mac_buf); + for (i = 0; i < ARRAY_SIZE(sta_flags); i++) + blobmsg_add_u8(&b, sta_flags[i].name, + !!(sta->flags & sta_flags[i].flag)); + + blobmsg_close_table(&b, c); + } + blobmsg_close_array(&b, list); + ubus_send_reply(ctx, req, b.head); + + return 0; +} + +static int +hostapd_wired_get_status(struct ubus_context *ctx, struct ubus_object *obj, + struct ubus_request_data *req, const char *method, + struct blob_attr *msg) +{ + struct hostapd_data *hapd = container_of(obj, struct hostapd_data, ubus.obj); + char iface_name[17]; + + blob_buf_init(&b, 0); + blobmsg_add_string(&b, "driver", hapd->driver->name); + blobmsg_add_string(&b, "status", hostapd_state_text(hapd->iface->state)); + + snprintf(iface_name, 17, "%s", hapd->iface->phy); + blobmsg_add_string(&b, "iface", iface_name); + + ubus_send_reply(ctx, req, b.head); + + return 0; +} + +static int +hostapd_wired_del_clients(struct ubus_context *ctx, struct ubus_object *obj, + struct ubus_request_data *req, const char *method, + struct blob_attr *msg) +{ + struct hostapd_data *hapd = container_of(obj, struct hostapd_data, ubus.obj); + + hostapd_free_stas(hapd); + + return 0; +} + +static const struct ubus_method wired_methods[] = { + UBUS_METHOD_NOARG("reload", hostapd_bss_reload), + UBUS_METHOD_NOARG("get_clients", hostapd_wired_get_clients), + UBUS_METHOD_NOARG("del_clients", hostapd_wired_del_clients), + UBUS_METHOD_NOARG("get_status", hostapd_wired_get_status), +}; + +static struct ubus_object_type wired_object_type = + UBUS_OBJECT_TYPE("hostapd_wired", wired_methods); + void hostapd_ubus_add_bss(struct hostapd_data *hapd) { struct ubus_object *obj = &hapd->ubus.obj; @@ -1676,9 +1756,15 @@ void hostapd_ubus_add_bss(struct hostapd_data *hapd) avl_init(&hapd->ubus.banned, avl_compare_macaddr, false, NULL); obj->name = name; - obj->type = &bss_object_type; - obj->methods = bss_object_type.methods; - obj->n_methods = bss_object_type.n_methods; + if (!strcmp(hapd->driver->name, "wired")) { + obj->type = &wired_object_type; + obj->methods = wired_object_type.methods; + obj->n_methods = wired_object_type.n_methods; + } else { + obj->type = &bss_object_type; + obj->methods = bss_object_type.methods; + obj->n_methods = bss_object_type.n_methods; + } ret = ubus_add_object(ctx, obj); hostapd_ubus_ref_inc(); } From 304fd40592bed56a64a621a9d1ec5a93a603ddf6 Mon Sep 17 00:00:00 2001 From: John Crispin Date: Tue, 5 Nov 2024 09:41:20 +0100 Subject: [PATCH 08/48] hostapd: expose owe_transition_ifname inside bss_info method This allows iwinfo to match OWE interfaces. Signed-off-by: John Crispin --- package/network/services/hostapd/files/hostapd.uc | 1 + 1 file changed, 1 insertion(+) diff --git a/package/network/services/hostapd/files/hostapd.uc b/package/network/services/hostapd/files/hostapd.uc index 2d9ce2874901d2..c1db91e4d4f944 100644 --- a/package/network/services/hostapd/files/hostapd.uc +++ b/package/network/services/hostapd/files/hostapd.uc @@ -45,6 +45,7 @@ hostapd.data.bss_info_fields = { wpa_pairwise: true, auth_algs: true, ieee80211w: true, + owe_transition_ifname: true, }; function iface_remove(cfg) From ba9cdbeea862fada261b0a874e464b63ffa860ac Mon Sep 17 00:00:00 2001 From: John Crispin Date: Fri, 1 Nov 2024 09:26:15 +0100 Subject: [PATCH 09/48] ucode: update to latest HEAD b0b5d93 Merge pull request #234 from IdWV/fs 60e7a88 Merge pull request #232 from sebastianertz/lib-digest 1752779 digest: implement compile time option to exclude less common algorithms c7268a1 ci: include libmd in MacOS CI builds fcb6f70 lib: introduce digest library 1323a27 Merge pull request #246 from jow-/fix-upvalue-resolve ed5ce8f types: resolve upvalue values in arrays and objects a6e0641 vm: resolve upvalues before pushing them onto the stack ef1baab ci: drop OpenWrt tests for now 63e18ea fs: eliminate the usage of global variables b1bd7b5 types: add ucv_resource_create() helper 3408edf Merge pull request #244 from nbd168/nl80211 8af77e7 nl80211: add new attributes for multi-radio support 1423ad7 nl80211: cover extended feature and EHT rate info attributes ee1d6d8 Merge pull request #237 from sebastianertz/math 4b18a9b Merge pull request #213 from jow-/improve-vector-macros 1f022c0 math: removed global variable for thread safety e5fe6b1 treewide: refactor vector usage code 20307ee utils: improve vector utilities aa18952 Merge pull request #241 from jow-/socket-local-fanout-decl 79ccd9c socket: provide local definition of `struct fanout_args` 402280d Merge pull request #239 from jow-/safe-insert-during-obj-iteration 07afe96 Merge pull request #240 from jow-/stricter-number-conversion 736d450 types: fix potential use after free on adding keys during iteration 4134e71 vallist: more thoroughly check for trailing garbage after numeric string 9cf53dd Merge pull request #226 from jow-/lexer-improvements 2b2e732 lexer: make api functions public 855854f lexer: emit comment and template statement block tokens 328a50f lexer: improve token position reporting fa22732 Merge pull request #225 from jow-/compiler-fix-keyword-property-labels-after-spread 6e88c62 Merge pull request #224 from jow-/lib-fs-readline-leak 94d1211 compiler: properly treat property names after spread expressions 67cd123 fs: fix potential memory leak on i/o errors in .read() Signed-off-by: John Crispin --- package/utils/ucode/Makefile | 16 +++++--- .../patches/100-nl80211_vif_radio_mask.patch | 40 ------------------- 2 files changed, 11 insertions(+), 45 deletions(-) delete mode 100644 package/utils/ucode/patches/100-nl80211_vif_radio_mask.patch diff --git a/package/utils/ucode/Makefile b/package/utils/ucode/Makefile index 6ee0cf2a1d56b9..a68dea81507242 100644 --- a/package/utils/ucode/Makefile +++ b/package/utils/ucode/Makefile @@ -8,17 +8,18 @@ include $(TOPDIR)/rules.mk PKG_NAME:=ucode -PKG_RELEASE:=3 +PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=https://github.com/jow-/ucode.git -PKG_SOURCE_DATE:=2024-07-22 -PKG_SOURCE_VERSION:=b610860dd4a0591ff586dd71a50f556a0ddafced -PKG_MIRROR_HASH:=a5ec51dd989174422d3b19b022ff4f863d57eb559c9f08d54c0d10651f598357 +PKG_SOURCE_DATE:=2024-12-02 +PKG_SOURCE_VERSION:=b0b5d93846a1fb9d1d94992d5fdf508ef345e87d +PKG_MIRROR_HASH:=b43fcb38a85469552d5fb641ade271c346634a52c3628155d3215953ff2c25e1 PKG_MAINTAINER:=Jo-Philipp Wich PKG_LICENSE:=ISC PKG_ABI_VERSION:=20230711 +PKG_BUILD_DEPENDS:=libmd HOST_BUILD_DEPENDS:=libjson-c/host include $(INCLUDE_DIR)/package.mk @@ -51,7 +52,8 @@ CMAKE_HOST_OPTIONS += \ -DUCI_SUPPORT=OFF \ -DULOOP_SUPPORT=OFF \ -DDEBUG_SUPPORT=ON \ - -DLOG_SUPPORT=OFF + -DLOG_SUPPORT=OFF \ + -DDIGEST_SUPPORT=OFF define Package/ucode/default @@ -178,6 +180,10 @@ $(eval $(call UcodeModule, \ uloop, ULOOP_SUPPORT, +libubox, \ The uloop module allows ucode scripts to interact with OpenWrt uloop event loop implementation.)) +$(eval $(call UcodeModule, \ + digest, DIGEST_SUPPORT, , \ + The digest module allows ucode scripts to use libmd digests.)) + $(eval $(call BuildPackage,libucode)) $(eval $(call BuildPackage,ucode)) diff --git a/package/utils/ucode/patches/100-nl80211_vif_radio_mask.patch b/package/utils/ucode/patches/100-nl80211_vif_radio_mask.patch deleted file mode 100644 index 22e05f7c620518..00000000000000 --- a/package/utils/ucode/patches/100-nl80211_vif_radio_mask.patch +++ /dev/null @@ -1,40 +0,0 @@ ---- a/include/linux/nl80211.h -+++ b/include/linux/nl80211.h -@@ -2868,6 +2868,9 @@ enum nl80211_commands { - * nested item, it contains attributes defined in - * &enum nl80211_if_combination_attrs. - * -+ * @NL80211_ATTR_VIF_RADIO_MASK: Bitmask of allowed radios (u32). -+ * A value of 0 means all radios. -+ * - * @NUM_NL80211_ATTR: total number of nl80211_attrs available - * @NL80211_ATTR_MAX: highest attribute number currently defined - * @__NL80211_ATTR_AFTER_LAST: internal use -@@ -3416,6 +3419,8 @@ enum nl80211_attrs { - NL80211_ATTR_WIPHY_RADIOS, - NL80211_ATTR_WIPHY_INTERFACE_COMBINATIONS, - -+ NL80211_ATTR_VIF_RADIO_MASK, -+ - /* add attributes here, update the policy in nl80211.c */ - - __NL80211_ATTR_AFTER_LAST, ---- a/lib/nl80211.c -+++ b/lib/nl80211.c -@@ -829,7 +829,7 @@ static const uc_nl_nested_spec_t nl80211 - - static const uc_nl_nested_spec_t nl80211_msg = { - .headsize = 0, -- .nattrs = 128, -+ .nattrs = 129, - .attrs = { - { NL80211_ATTR_4ADDR, "4addr", DT_U8, 0, NULL }, - { NL80211_ATTR_AIRTIME_WEIGHT, "airtime_weight", DT_U16, 0, NULL }, -@@ -959,6 +959,7 @@ static const uc_nl_nested_spec_t nl80211 - { NL80211_ATTR_MAX_AP_ASSOC_STA, "max_ap_assoc", DT_U16, 0, NULL }, - { NL80211_ATTR_SURVEY_INFO, "survey_info", DT_NESTED, 0, &nl80211_survey_info_nla }, - { NL80211_ATTR_WIPHY_RADIOS, "radios", DT_NESTED, DF_MULTIPLE|DF_AUTOIDX, &nl80211_wiphy_radio_nla }, -+ { NL80211_ATTR_VIF_RADIO_MASK, "vif_radio_mask", DT_U32, 0, NULL }, - } - }; - From 02102798883007afa3d28056fd588e4681f64155 Mon Sep 17 00:00:00 2001 From: John Crispin Date: Tue, 22 Oct 2024 09:58:48 +0200 Subject: [PATCH 10/48] wifi-scripts: add ucode based iwinfo Add an ucode based re-implementation of iwinfo. The tool behaves like the old one with a few minor output differences. It is now possible to add -j to any command resulting in JSON output. The new code is currently opt-in via WIFI_SCRIPTS_UCODE and defaults to EXPERIMENTAL. Signed-off-by: John Crispin --- package/kernel/mac80211/Makefile | 2 +- .../wifi-scripts/files-ucode/usr/bin/iwinfo | 156 +++++ .../files-ucode/usr/share/iso3166.json | 249 +++++++ .../files-ucode/usr/share/ucode/iwinfo.uc | 607 ++++++++++++++++++ .../files-ucode/usr/share/wifi_devices.json | 260 ++++++++ package/network/utils/iwinfo/Makefile | 3 +- 6 files changed, 1275 insertions(+), 2 deletions(-) create mode 100755 package/network/config/wifi-scripts/files-ucode/usr/bin/iwinfo create mode 100644 package/network/config/wifi-scripts/files-ucode/usr/share/iso3166.json create mode 100644 package/network/config/wifi-scripts/files-ucode/usr/share/ucode/iwinfo.uc create mode 100644 package/network/config/wifi-scripts/files-ucode/usr/share/wifi_devices.json diff --git a/package/kernel/mac80211/Makefile b/package/kernel/mac80211/Makefile index 22cd0e97b41770..1c848d1f57ebe1 100644 --- a/package/kernel/mac80211/Makefile +++ b/package/kernel/mac80211/Makefile @@ -100,7 +100,7 @@ PKG_CONFIG_DEPENDS += \ define KernelPackage/cfg80211 $(call KernelPackage/mac80211/Default) TITLE:=cfg80211 - wireless configuration API - DEPENDS+= +iw +iwinfo +wifi-scripts +wireless-regdb +USE_RFKILL:kmod-rfkill + DEPENDS+= +iw +!WIFI_SCRIPTS_UCODE:iwinfo +wifi-scripts +wireless-regdb +USE_RFKILL:kmod-rfkill ABI_VERSION:=$(PKG_VERSION)-$(PKG_RELEASE) FILES:= \ $(PKG_BUILD_DIR)/compat/compat.ko \ diff --git a/package/network/config/wifi-scripts/files-ucode/usr/bin/iwinfo b/package/network/config/wifi-scripts/files-ucode/usr/bin/iwinfo new file mode 100755 index 00000000000000..01285eb385d6de --- /dev/null +++ b/package/network/config/wifi-scripts/files-ucode/usr/bin/iwinfo @@ -0,0 +1,156 @@ +#!/usr/bin/ucode + +'use strict'; + +import * as iwinfo from 'iwinfo'; + +function print_assoclist(stations) { + for (let mac, station in stations) { + printf(`${station.mac} ${station.signal} dBm / ${station.noise} dBm (SNR ${station.snr}) ${station.inactive_time} ms ago\n`); + for (let k in [ 'rx', 'tx' ]) { + let bitrate = station[k]; + let flags = join(', ', bitrate.flags); + + printf(`\t${uc(k)}: ${bitrate.bitrate} MBit/s`); + if (length(bitrate.flags)) + printf(', %s', flags); + printf('%10d Pkts.\n', bitrate.packets); + } + printf(`\texpected throughput: ${station.expected_throughput}\n\n`); + } +} + +function print_countrylist(list) { + for (let k, v in list.countries) + printf(`${k == list.active ? '*' : ' '} ${k} "${v}"\n`); +} + +function print_freqlist(channels) { + for (let channel in channels) { + printf(`${channel.active ? '*' : ' '} ${channel.freq} GHz (Band: ${channel.band} GHz, Channel ${channel.channel})`); + if (length(channel.flags)) + printf(` [${join(', ', channel.flags)}]`); + printf('\n'); + } +} + +function print_htmodelist(htmode) { + printf('%s\n', join(' ', htmode)); +} + +function print_info(list) { + let padding = ' '; + + for (let bss in list) { + printf(`${bss.iface} ESSID: "${bss.ssid}"\n`); + printf(`${padding}Access Point: ${bss.mac}\n`); + printf(`${padding}Mode: ${bss.mode} Channel: ${bss.channel} (${bss.freq} GHz) HT Mode: ${bss.htmode}\n`); + printf(`${padding}Center Channel 1: ${bss.center_freq1} 2: ${bss.center_freq2}\n`); + printf(`${padding}Tx-Power: ${bss.txpower} dBm Link Quality: ${bss.quality}/70\n`); + printf(`${padding}Signal: ${bss.signal} Noise: ${bss.noise}\n`); + printf(`${padding}Bit Rate: ${bss.bitrate ?? 'unknown'} MBit/s\n`); + printf(`${padding}Encryption: ${bss.encryption}\n`); + printf(`${padding}Type: nl80211 HW Mode(s): 802.11${bss.hwmode}\n`); + printf(`${padding}Hardware: ${bss.hw_type} [${bss.hw_id}]\n`); + printf(`${padding}TX power offset: ${bss.power_offset}\n`); + printf(`${padding}Channel offset: ${bss.channel_offset}\n`); + printf(`${padding}Supports VAPs: ${bss.vaps} PHY name: ${bss.phy}\n`); + if (bss.owe_transition_ifname) + printf(`${padding}OWE partner: ${bss.owe_transition_ifname}\n`); + printf('\n'); + } + return 0; +} + +function print_scan(cells) { + let idx = 1; + + for (let cell in cells) { + printf('Cell %02d - Address: %s\n', idx++, cell.bssid); + printf('\t Mode: %s Frequency: %s GHz Band: %s GHz Channel: %d\n', cell.mode, cell.frequency, cell.band, cell.channel); + printf('\t Signal: %d dBm Quality: %2d/70\n', cell.dbm, cell.quality); + + if (!length(cell.crypto.key_mgmt)) + printf('\t Encryption: NONE\n'); + else + printf('\t Encryption: %s (%s)\n', join(' / ', cell.crypto.key_mgmt), join(' / ', cell.crypto.pair)); + + if (cell.ht) { + printf('\t HT Operation:\n'); + printf('\t\tPrimary Channel: %d\n', cell.ht.primary_channel); + printf('\t\tSecondary Channel Offset: %s\n', cell.ht.secondary_chan_off); + printf('\t\tChannel Width: %s\n', cell.ht.chan_width); + } + + if (cell.vht) { + printf('\t VHT Operation:\n'); + printf('\t\tCenter Frequency 1: %d\n', cell.vht.center_chan_1); + printf('\t\tCenter Frequency 2: %s\n', cell.vht.center_chan_2); + printf('\t\tChannel Width: %s\n', cell.vht.chan_width); + } + + printf('\n'); + } +} + +function print_txpowerlist(list) { + for (let power in list) + printf('%s %2d dbm (%4d mW)\n', power.active ? '*' : ' ', power.dbm, power.mw); +} + +let pretty = true; +if (ARGV[0] == '-j') { + pretty = false; + shift(ARGV); +} + +if (!length(ARGV)) { + let info = iwinfo.info(); + if (pretty) + print_info(info); + else + printf('%.J\n', info); + return 0; +} + +const commands = { + assoclist: [ iwinfo.assoclist, print_assoclist ], + countrylist: [ iwinfo.countrylist, print_countrylist ], + freqlist: [ iwinfo.freqlist, print_freqlist ], + htmodelist: [ iwinfo.htmodelist, print_htmodelist ], + info: [ iwinfo.info, print_info ], + scan: [ iwinfo.scan, print_scan ], + txpowerlist: [ iwinfo.txpowerlist, print_txpowerlist ], +}; + +if (length(ARGV) == 2 && iwinfo.ifaces[ARGV[0]]) + for (let cmd, cb in commands) + if (substr(cmd, 0, length(ARGV[1])) == ARGV[1]) { + let ret = cb[0](ARGV[0]); + + if (pretty) + cb[1](ret); + else + printf('%.J\n', ret); + return 0; + } + +switch(ARGV[0]) { +case 'phy': + printf('%.J\n', iwinfo.phys); + return 0; + +case 'iface': + printf('%.J\n', iwinfo.ifaces); + return 0; +} + +printf('Usage:\n' + + '\tiwinfo info\n' + + '\tiwinfo scan\n' + + '\tiwinfo txpowerlist\n' + + '\tiwinfo freqlist\n' + + '\tiwinfo assoclist\n' + + '\tiwinfo countrylist\n' + + '\tiwinfo htmodelist\n' + + '\tiwinfo phyname
\n'); diff --git a/package/network/config/wifi-scripts/files-ucode/usr/share/iso3166.json b/package/network/config/wifi-scripts/files-ucode/usr/share/iso3166.json new file mode 100644 index 00000000000000..ecd0b653839855 --- /dev/null +++ b/package/network/config/wifi-scripts/files-ucode/usr/share/iso3166.json @@ -0,0 +1,249 @@ +{ + "00": "World", + "AD": "Andorra", + "AE": "United Arab Emirates", + "AF": "Afghanistan", + "AG": "Antigua and Barbuda", + "AI": "Anguilla", + "AL": "Albania", + "AM": "Armenia", + "AN": "Netherlands Antilles", + "AO": "Angola", + "AQ": "Antarctica", + "AR": "Argentina", + "AS": "American Samoa", + "AT": "Austria", + "AU": "Australia", + "AW": "Aruba", + "AX": "Aland Islands", + "AZ": "Azerbaijan", + "BA": "Bosnia and Herzegovina", + "BB": "Barbados", + "BD": "Bangladesh", + "BE": "Belgium", + "BF": "Burkina Faso", + "BG": "Bulgaria", + "BH": "Bahrain", + "BI": "Burundi", + "BJ": "Benin", + "BL": "Saint Barthelemy", + "BM": "Bermuda", + "BN": "Brunei Darussalam", + "BO": "Bolivia", + "BR": "Brazil", + "BS": "Bahamas", + "BT": "Bhutan", + "BV": "Bouvet Island", + "BW": "Botswana", + "BY": "Belarus", + "BZ": "Belize", + "CA": "Canada", + "CC": "Cocos (Keeling) Islands", + "CD": "Congo", + "CF": "Central African Republic", + "CG": "Congo", + "CH": "Switzerland", + "CI": "Cote d'Ivoire", + "CK": "Cook Islands", + "CL": "Chile", + "CM": "Cameroon", + "CN": "China", + "CO": "Colombia", + "CR": "Costa Rica", + "CU": "Cuba", + "CV": "Cape Verde", + "CX": "Christmas Island", + "CY": "Cyprus", + "CZ": "Czech Republic", + "DE": "Germany", + "DJ": "Djibouti", + "DK": "Denmark", + "DM": "Dominica", + "DO": "Dominican Republic", + "DZ": "Algeria", + "EC": "Ecuador", + "EE": "Estonia", + "EG": "Egypt", + "EH": "Western Sahara", + "ER": "Eritrea", + "ES": "Spain", + "ET": "Ethiopia", + "FI": "Finland", + "FJ": "Fiji", + "FK": "Falkland Islands", + "FM": "Micronesia", + "FO": "Faroe Islands", + "FR": "France", + "GA": "Gabon", + "GB": "United Kingdom", + "GD": "Grenada", + "GE": "Georgia", + "GF": "French Guiana", + "GG": "Guernsey", + "GH": "Ghana", + "GI": "Gibraltar", + "GL": "Greenland", + "GM": "Gambia", + "GN": "Guinea", + "GP": "Guadeloupe", + "GQ": "Equatorial Guinea", + "GR": "Greece", + "GS": "South Georgia", + "GT": "Guatemala", + "GU": "Guam", + "GW": "Guinea-Bissau", + "GY": "Guyana", + "HK": "Hong Kong", + "HM": "Heard and McDonald Islands", + "HN": "Honduras", + "HR": "Croatia", + "HT": "Haiti", + "HU": "Hungary", + "ID": "Indonesia", + "IE": "Ireland", + "IL": "Israel", + "IM": "Isle of Man", + "IN": "India", + "IO": "Chagos Islands", + "IQ": "Iraq", + "IR": "Iran", + "IS": "Iceland", + "IT": "Italy", + "JE": "Jersey", + "JM": "Jamaica", + "JO": "Jordan", + "JP": "Japan", + "KE": "Kenya", + "KG": "Kyrgyzstan", + "KH": "Cambodia", + "KI": "Kiribati", + "KM": "Comoros", + "KN": "Saint Kitts and Nevis", + "KP": "North Korea", + "KR": "South Korea", + "KW": "Kuwait", + "KY": "Cayman Islands", + "KZ": "Kazakhstan", + "LA": "Laos", + "LB": "Lebanon", + "LC": "Saint Lucia", + "LI": "Liechtenstein", + "LK": "Sri Lanka", + "LR": "Liberia", + "LS": "Lesotho", + "LT": "Lithuania", + "LU": "Luxembourg", + "LV": "Latvia", + "LY": "Libyan Arab Jamahiriya", + "MA": "Morocco", + "MC": "Monaco", + "MD": "Moldova", + "ME": "Montenegro", + "MF": "Saint Martin (French part)", + "MG": "Madagascar", + "MH": "Marshall Islands", + "MK": "Macedonia", + "ML": "Mali", + "MM": "Myanmar", + "MN": "Mongolia", + "MO": "Macao", + "MP": "Northern Mariana Islands", + "MQ": "Martinique", + "MR": "Mauritania", + "MS": "Montserrat", + "MT": "Malta", + "MU": "Mauritius", + "MV": "Maldives", + "MW": "Malawi", + "MX": "Mexico", + "MY": "Malaysia", + "MZ": "Mozambique", + "NA": "Namibia", + "NC": "New Caledonia", + "NE": "Niger", + "NF": "Norfolk Island", + "NG": "Nigeria", + "NI": "Nicaragua", + "NL": "Netherlands", + "NO": "Norway", + "NP": "Nepal", + "NR": "Nauru", + "NU": "Niue", + "NZ": "New Zealand", + "OM": "Oman", + "PA": "Panama", + "PE": "Peru", + "PF": "French Polynesia", + "PG": "Papua New Guinea", + "PH": "Philippines", + "PK": "Pakistan", + "PL": "Poland", + "PM": "Saint Pierre and Miquelon", + "PN": "Pitcairn", + "PR": "Puerto Rico", + "PS": "Palestinian Territory", + "PT": "Portugal", + "PW": "Palau", + "PY": "Paraguay", + "QA": "Qatar", + "RE": "Reunion", + "RO": "Romania", + "RS": "Serbia", + "RU": "Russian Federation", + "RW": "Rwanda", + "SA": "Saudi Arabia", + "SB": "Solomon Islands", + "SC": "Seychelles", + "SD": "Sudan", + "SE": "Sweden", + "SG": "Singapore", + "SH": "St. Helena and Dependencies", + "SI": "Slovenia", + "SJ": "Svalbard and Jan Mayen", + "SK": "Slovakia", + "SL": "Sierra Leone", + "SM": "San Marino", + "SN": "Senegal", + "SO": "Somalia", + "SR": "Suriname", + "ST": "Sao Tome and Principe", + "SV": "El Salvador", + "SY": "Syrian Arab Republic", + "SZ": "Swaziland", + "TC": "Turks and Caicos Islands", + "TD": "Chad", + "TF": "French Southern Territories", + "TG": "Togo", + "TH": "Thailand", + "TJ": "Tajikistan", + "TK": "Tokelau", + "TL": "Timor-Leste", + "TM": "Turkmenistan", + "TN": "Tunisia", + "TO": "Tonga", + "TR": "Turkey", + "TT": "Trinidad and Tobago", + "TV": "Tuvalu", + "TW": "Taiwan", + "TZ": "Tanzania", + "UA": "Ukraine", + "UG": "Uganda", + "UM": "U.S. Minor Outlying Islands", + "US": "United States", + "UY": "Uruguay", + "UZ": "Uzbekistan", + "VA": "Vatican City State", + "VC": "St. Vincent and Grenadines", + "VE": "Venezuela", + "VG": "Virgin Islands, British", + "VI": "Virgin Islands, U.S.", + "VN": "Viet Nam", + "VU": "Vanuatu", + "WF": "Wallis and Futuna", + "WS": "Samoa", + "YE": "Yemen", + "YT": "Mayotte", + "ZA": "South Africa", + "ZM": "Zambia", + "ZW": "Zimbabwe" +} diff --git a/package/network/config/wifi-scripts/files-ucode/usr/share/ucode/iwinfo.uc b/package/network/config/wifi-scripts/files-ucode/usr/share/ucode/iwinfo.uc new file mode 100644 index 00000000000000..71672c23adc423 --- /dev/null +++ b/package/network/config/wifi-scripts/files-ucode/usr/share/ucode/iwinfo.uc @@ -0,0 +1,607 @@ +'use strict'; + +import * as nl80211 from 'nl80211'; +import * as libubus from 'ubus'; +import { readfile, stat } from "fs"; + +let wifi_devices = json(readfile('/usr/share/wifi_devices.json')); +let countries = json(readfile('/usr/share/iso3166.json')); +let board_data = json(readfile('/etc/board.json')); + +export let phys = nl80211.request(nl80211.const.NL80211_CMD_GET_WIPHY, nl80211.const.NLM_F_DUMP, { split_wiphy_dump: true }); +let interfaces = nl80211.request(nl80211.const.NL80211_CMD_GET_INTERFACE, nl80211.const.NLM_F_DUMP); + +let ubus = libubus.connect(); +let wireless_status = ubus.call('network.wireless', 'status'); + +function find_phy(wiphy) { + for (let k, phy in phys) + if (phy.wiphy == wiphy) + return phy; + return null; +} + +function get_noise(iface) { + for (let phy in phys) { + let channels = nl80211.request(nl80211.const.NL80211_CMD_GET_SURVEY, nl80211.const.NLM_F_DUMP, { dev: iface.ifname }); + for (let k, channel in channels) + if (channel.survey_info.frequency == iface.wiphy_freq) + return channel.survey_info.noise; + } + + return -100; +} + +function get_country(iface) { + let reg = nl80211.request(nl80211.const.NL80211_CMD_GET_REG, 0, { dev: iface.ifname }); + + return reg.reg_alpha2 ?? ''; +} + +function get_max_power(iface) { + let phy = find_phy(iface.wiphy); + + for (let k, band in phy.wiphy_bands) + if (band) + for (let freq in band.freqs) + if (freq.freq == iface.wiphy_freq) + return freq.max_tx_power;; + return 0; +} + +function get_hardware_id(iface) { + let hw = { + type: 'nl80211', + id: 'Generic MAC80211', + power_offset: 0, + channel_offset: 0, + }; + + let path = `/sys/class/ieee80211/phy${iface.wiphy}/device/`; + if (stat(path) + 'vendor') { + let data = []; + for (let lookup in [ 'vendor', 'device', 'subsystem_vendor', 'subsystem_device' ]) + push(data, trim(readfile(path + lookup), '\n')); + + for (let device in wifi_devices.pci) { + let match = 0; + for (let i = 0; i < 4; i++) + if (lc(data[i]) == lc(device[i])) + match++; + if (match == 4) { + hw.type = `${data[0]}:${data[1]} ${data[2]}:${data[3]}`; + hw.power_offset = device[4]; + hw.channel_offset = device[5]; + hw.id = `${device[6]} ${device[7]}`; + } + } + } + + let compatible = trim(readfile(`/sys/class/net/${iface.ifname}/device/of_node/compatible`), '\n'); + if (compatible && wifi_devices.compatible[compatible]) { + hw.id = wifi_devices.compatible[compatible][0] + ' ' + wifi_devices.compatible[compatible][1]; + hw.compatible = compatible; + hw.type = 'embedded'; + } + + return hw; +} + +const iftypes = [ + 'Unknown', 'Ad-Hoc', 'Client', 'Master', 'Master (VLAN)', + 'WDS', 'Monitor', 'Mesh Point', 'P2P Client', 'P2P Go', +]; + +export let ifaces = {}; +for (let k, v in interfaces) { + let iface = ifaces[v.ifname] = v; + + iface.mode = iftypes[iface.iftype] ?? 'unknonw', + iface.noise = get_noise(iface); + iface.country = get_country(iface); + iface.max_power = get_max_power(iface); + iface.assoclist = nl80211.request(nl80211.const.NL80211_CMD_GET_STATION, nl80211.const.NLM_F_DUMP, { dev: v.ifname }) ?? []; + iface.hardware = get_hardware_id(iface); + + iface.bss_info = ubus.call('hostapd', 'bss_info', { iface: v.ifname }); + if (!iface.bss_info) + iface.bss_info = ubus.call('wpa_supplicant', 'bss_info', { iface: v.ifname }); +} + +for (let radio, data in wireless_status) + for (let k, v in data.interfaces) { + if (!v.ifname || !ifaces[v.ifname]) + continue; + + ifaces[v.ifname].ssid = v.config.ssid || v.config.mesh_id; + ifaces[v.ifname].radio = data.config; + + let bss_info = ifaces[v.ifname].bss_info; + let owe_transition_ifname = bss_info?.owe_transition_ifname; + + if (v.config.owe_transition && ifaces[owe_transition_ifname]) { + ifaces[v.ifname].owe_transition_ifname = owe_transition_ifname; + ifaces[owe_transition_ifname].ssid = v.config.ssid; + ifaces[owe_transition_ifname].radio = data.config; + ifaces[owe_transition_ifname].owe_transition_ifname = v.ifname + } + } + +function format_channel(freq) { + if (freq < 1000) + return 0; + if (freq == 2484) + return 14; + if (freq == 5935) + return 2; + if (freq < 2484) + return (freq - 2407) / 5; + if (freq >= 4910 && freq <= 4980) + return (freq - 4000) / 5; + if (freq < 5950) + return (freq - 5000) / 5; + if (freq <= 45000) + return (freq - 5950) / 5; + if (freq >= 58320 && freq <= 70200) + return (freq - 56160) / 2160; + + return 'unknown'; +} + +function format_band(freq) { + if (freq == 5935) + return '6'; + if (freq < 2484) + return '2.4'; + if (freq < 5950) + return '5'; + if (freq <= 45000) + return '6'; + + return '60'; +} + +function format_frequency(freq) { + if (!freq) + return 'unknown'; + freq = '' + freq; + return substr(freq, 0, 1) + '.' + substr(freq, 1); +} + +function format_rate(rate) { + if (!rate) + return 'unknown'; + return '' + (rate / 10) + '.' + (rate % 10); +} + +function format_mgmt_key(key) { + switch(+key) { + case 1: + case 11: + case 12: + case 13: + case 14: + case 15: + case 16: + case 17: + return '802.1x'; + + case 2: + return 'WPA PSK'; + + case 4: + return 'FT PSK'; + + case 6: + return 'WPA PSK2'; + + case 8: + return 'SAE'; + + case 18: + return 'OWE'; + } + + return null; +} + +function assoc_flags(data) { + const assoc_mhz = { + width_40: 40, + width_80: 80, + width_80p80: '80+80', + width_160: 160, + width_320: 320, + width_10: 10, + width_5: 5 + }; + + let mhz = 'unknown'; + for (let k, v in assoc_mhz) + if (data[k]) + mhz = v; + + const assoc_flags = { + mcs: { + mcs: 'MCS', + }, + vht_mcs: { + vht_mcs: 'VHT-MCS', + vht_nss: 'VHT-NSS', + }, + he_mcs: { + he_mcs: 'HE-MCS', + he_nss: 'HE-NSS', + he_gi: 'HE-GI', + he_dcm: 'HE-DCM', + }, + eht_mcs: { + eht_mcs: 'EHT-MCS', + eht_nss: 'EHT-NSS', + eht_gi: 'EHT-GI', + }, + }; + + let flags = []; + for (let k, v in assoc_flags) { + if (!data[k]) + continue; + + let first = 0; + for (let name, flag in v) { + if (data[name] == null) + continue; + push(flags, `${flag} ${data[name]}`); + if (!first++) + push(flags, `${mhz}MHz`); + } + } + + return flags; +} + +function dbm2mw(dbm) { + const LOG10_MAGIC = 1.25892541179; + let res = 1.0; + let ip = dbm / 10; + let fp = dbm % 10; + + for (let k = 0; k < ip; k++) + res *= 10; + for (let k = 0; k < fp; k++) + res *= 1.25892541179; + + return int(res); +} + +function dbm2quality(dbm) { + let quality = dbm; + + if (quality < -110) + quality = -110; + else if (quality > -40) + quality = -40; + quality += 110; + + return quality; +} + +function hwmodelist(name) { + const mode = { 'HT*': 'n', 'VHT*': 'ac', 'HE*': 'ax' }; + let iface = ifaces[name]; + let phy = board_data.wlan?.['phy' + iface.wiphy]; + if (!phy) + return ''; + let htmodes = phy.info.bands[uc(iface.radio.band)].modes; + let list = []; + if (iface.radio.band == '2g' && 'NOHT' in htmodes) + push(list, 'g/b'); + for (let k, v in mode) + for (let htmode in htmodes) + if (wildcard(htmode, k)) + push(list, v); + + return join('/', reverse(uniq(list))); +} + +export function assoclist(dev) { + let stations = ifaces[dev].assoclist; + let ret = {}; + + for (let station in stations) { + let sta = { + mac: uc(station.mac), + signal: station.sta_info.signal_avg, + noise: ifaces[dev].noise, + snr: station.sta_info.signal_avg - ifaces[dev].noise, + inactive_time: station.sta_info.inactive_time, + rx: { + bitrate: format_rate(station.sta_info.rx_bitrate.bitrate), + bitrate_raw: station.sta_info.rx_bitrate.bitrate, + packets: station.sta_info.rx_packets, + flags: assoc_flags(station.sta_info.rx_bitrate), + }, + tx: { + bitrate: format_rate(station.sta_info.tx_bitrate.bitrate), + bitrate_raw: station.sta_info.tx_bitrate.bitrate, + packets: station.sta_info.tx_packets, + flags: assoc_flags(station.sta_info.tx_bitrate), + }, + expected_throughput: station.sta_info.expected_throughput ?? 'unknown', + }; + ret[sta.mac] = sta; + } + + return ret; +}; + +export function freqlist(name) { + const freq_flags = { + no_10mhz: 'NO_10MHZ', + no_20mhz: 'NO_20MHZ', + no_ht40_minus: 'NO_HT40-', + no_ht40_plus: 'NO_HT40+', + no_80mhz: 'NO_80MHZ', + no_160mhz: 'NO_160MHZ', + indoor_only: 'INDOOR_ONLY', + no_ir: 'NO_IR', + no_he: 'NO_HE', + radar: 'RADAR_DETECTION', + }; + + let iface = ifaces[name]; + let phy = find_phy(iface.wiphy); + let channels = []; + + for (let k, band in phy.wiphy_bands) { + if (!band) + continue; + + let band_name = format_band(band.freqs[0].freq); + for (let freq in band.freqs) { + if (freq.disabled) + continue; + + let channel = { + freq: format_frequency(freq.freq), + band: band_name, + channel: format_channel(freq.freq), + flags: [], + active: iface.wiphy_freq == freq.freq, + }; + + for (let k, v in freq_flags) + if (freq[k]) + push(channel.flags, v); + + push(channels, channel); + } + } + + return channels; +}; + +export function info(name) { + let order = []; + for (let iface, data in ifaces) + push(order, iface); + + let list = []; + for (let iface in sort(order)) { + if (name && iface != name) + continue; + let data = ifaces[iface]; + let dev = { + iface, + ssid: data.ssid, + mac: data.mac, + mode: data.mode, + channel: format_channel(data.wiphy_freq), + freq: format_frequency(data.wiphy_freq), + htmode: data.radio.htmode, + center_freq1: format_channel(data.center_freq1) || 'unknown', + center_freq2: format_channel(data.center_freq2) || 'unknown', + txpower: data.wiphy_tx_power_level / 100, + noise: data.noise, + signal: 0, + bitrate: 0, + encryption: 'unknown', + hwmode: hwmodelist(iface), + phy: 'phy' + data.wiphy, + vaps: 'no', + hw_type: data.hardware.type, + hw_id: data.hardware.id, + power_offset: data.hardware.power_offset || 'none', + channel_offset: data.hardware.channel_offset || 'none', + }; + + let phy = find_phy(data.wiphy); + for (let limit in phy.interface_combinations[0]?.limits) + if (limit.types?.ap && limit.max > 1) + dev.vaps = 'yes'; + + if (data.bss_info) { + if (data.bss_info.wpa_key_mgmt && data.bss_info.wpa_pairwise) + dev.encryption = `${replace(data.bss_info.wpa_key_mgmt, ' ', ' / ')} (${data.bss_info.wpa_pairwise})`; + else if (data.owe_transition_ifname) + dev.encryption = 'none (OWE transition)'; + else + dev.encryption = 'none'; + } + + let stations = assoclist(iface); + for (let k, station in stations) { + dev.signal += station.signal; + dev.bitrate += station.tx.bitrate_raw; + } + dev.signal /= length(data.assoclist) || 1; + dev.bitrate /= length(data.assoclist) || 1; + dev.bitrate = format_rate(dev.bitrate); + dev.quality = dbm2quality(dev.signal); + + if (data.owe_transition_ifname) + dev.owe_transition_ifname = data.owe_transition_ifname; + + push(list, dev); + } + + return list; +}; + +export function htmodelist(name) { + let iface = ifaces[name]; + let phy = board_data.wlan?.['phy' + iface.wiphy]; + if (!phy) + return []; + + return filter(phy.info.bands[uc(iface.radio.band)].modes, (v) => v != 'NOHT'); +}; + +export function txpowerlist(name) { + let iface = ifaces[name]; + let max_power = iface.max_power / 100; + let match = iface.wiphy_tx_power_level / 100; + let list = []; + + for (let power = 0; power <= max_power; power++) { + let txpower = { + dbm: power, + mw: dbm2mw(power), + active: power == match, + }; + push(list, txpower); + } + + return list; +}; + +export function countrylist(dev) { + let iface = ifaces[dev]; + + let list = { + active: iface.country, + countries, + }; + + return list; +}; + +export function scan(dev) { + const rsn_cipher = [ 'NONE', 'WEP-40', 'TKIP', 'WRAP', 'CCMP', 'WEP-104', 'AES-OCB', 'CKIP', 'GCMP', 'GCMP-256', 'CCMP-256' ]; + const ht_chan_offset = [ 'no secondary', 'above', '[reserved]', 'below' ]; + const vht_chan_width = [ '20 or 40 MHz', '80 MHz', '80+80 MHz', '160 MHz' ]; + const ht_chan_width = [ '20 MHz', '40 MHz or higher' ]; + const SCAN_FLAG_AP = (1<<2); + + let params = { + dev, + scan_flags: SCAN_FLAG_AP, + scan_ssids: [ '' ], + }; + + let res = nl80211.request(nl80211.const.NL80211_CMD_TRIGGER_SCAN, 0, params); + if (res === false) { + printf("Unable to trigger scan: " + nl80211.error() + "\n"); + exit(1); + } + + res = nl80211.waitfor([ + nl80211.const.NL80211_CMD_NEW_SCAN_RESULTS, + nl80211.const.NL80211_CMD_SCAN_ABORTED + ], 5000); + + if (!res) { + printf("Netlink error while awaiting scan results: " + nl80211.error() + "\n"); + exit(1); + } else if (res.cmd == nl80211.const.NL80211_CMD_SCAN_ABORTED) { + printf("Scan aborted by kernel\n"); + exit(1); + } + + let scan = nl80211.request(nl80211.const.NL80211_CMD_GET_SCAN, nl80211.const.NLM_F_DUMP, { dev }); + + let cells = []; + for (let k, bss in scan) { + bss = bss.bss; + let cell = { + bssid: uc(bss.bssid), + frequency: format_frequency(bss.frequency), + band: format_band(bss.frequency), + channel: format_channel(bss.frequency), + dbm: bss.signal_mbm / 100, + + }; + + if (bss.capability & (1 << 1)) + cell.mode = 'Ad-Hoc'; + else if (bss.capability & (1 << 0)) + cell.mode = 'Master'; + else + cell.mode = 'Mesh Point'; + + cell.quality = dbm2quality(cell.dbm); + + for (let ie in bss.information_elements) + switch(ie.type) { + case 0: + case 114: + cell.ssid = ie.data; + break; + + case 7: + cell.country = substr(ie.data, 0, 2); + break; + + case 48: + cell.crypto = { + group: rsn_cipher[+ord(ie.data, 5)] ?? '', + pair: [], + key_mgmt: [], + }; + + let offset = 6; + let count = +ord(ie.data, offset); + offset += 2; + + for (let i = 0; i < count; i++) { + let key = rsn_cipher[+ord(ie.data, offset + 3)]; + if (key) + push(cell.crypto.pair, key); + offset += 4; + } + + count = +ord(ie.data, offset); + offset += 2; + + for (let i = 0; i < count; i++) { + let key = format_mgmt_key(ord(ie.data, offset + 3)); + if (key) + push(cell.crypto.key_mgmt, key); + offset += 4; + } + break; + + case 61: + cell.ht = { + primary_channel: ord(ie.data, 0), + secondary_chan_off: ht_chan_offset[ord(ie.data, 1) & 0x3], + chan_width: ht_chan_width[(ord(ie.data, 1) & 0x4) >> 2], + }; + break; + + case 192: + cell.vht = { + chan_width: vht_chan_width[ord(ie.data, 0)], + center_chan_1: ord(ie.data, 1), + center_chan_2: ord(ie.data, 2), + }; + break; + }; + + + + push(cells, cell); + } + + return cells; +}; diff --git a/package/network/config/wifi-scripts/files-ucode/usr/share/wifi_devices.json b/package/network/config/wifi-scripts/files-ucode/usr/share/wifi_devices.json new file mode 100644 index 00000000000000..5a38ca4b2f5846 --- /dev/null +++ b/package/network/config/wifi-scripts/files-ucode/usr/share/wifi_devices.json @@ -0,0 +1,260 @@ +{ + "pci": [ + [ "0x0777", "0x11ac", "0x0777", "0xe7f9", 0, 0, "Ubiquiti", "LiteBeam, 5AC" ], + [ "0xffff", "0xffff", "0xffff", "0xb102", 0, 0, "Ubiquiti", "PowerStation2, (18V)" ], + [ "0xffff", "0xffff", "0xffff", "0xb202", 0, 0, "Ubiquiti", "PowerStation2, (16D)" ], + [ "0xffff", "0xffff", "0xffff", "0xb302", 0, 0, "Ubiquiti", "PowerStation2, (EXT)" ], + [ "0xffff", "0xffff", "0xffff", "0xb105", 0, 0, "Ubiquiti", "PowerStation5, (22V)" ], + [ "0xffff", "0xffff", "0xffff", "0xb305", 0, 0, "Ubiquiti", "PowerStation5, (EXT)" ], + [ "0xffff", "0xffff", "0xffff", "0xc302", 0, 0, "Ubiquiti", "PicoStation2" ], + [ "0xffff", "0xffff", "0xffff", "0xc3a2", 10, 0, "Ubiquiti", "PicoStation2, HP" ], + [ "0xffff", "0xffff", "0xffff", "0xa105", 0, 0, "Ubiquiti", "WispStation5" ], + [ "0xffff", "0xffff", "0xffff", "0xa002", 10, 0, "Ubiquiti", "LiteStation2" ], + [ "0xffff", "0xffff", "0xffff", "0xa005", 5, 0, "Ubiquiti", "LiteStation5" ], + [ "0xffff", "0xffff", "0xffff", "0xc002", 10, 0, "Ubiquiti", "NanoStation2" ], + [ "0xffff", "0xffff", "0xffff", "0xc005", 5, 0, "Ubiquiti", "NanoStation5" ], + [ "0xffff", "0xffff", "0xffff", "0xc102", 10, 0, "Ubiquiti", "NanoStation, Loco2" ], + [ "0xffff", "0xffff", "0xffff", "0xc105", 5, 0, "Ubiquiti", "NanoStation, Loco5" ], + [ "0xffff", "0xffff", "0xffff", "0xc202", 10, 0, "Ubiquiti", "Bullet2" ], + [ "0xffff", "0xffff", "0xffff", "0xc205", 5, 0, "Ubiquiti", "Bullet5" ], + [ "0x168c", "0xffff", "0x0777", "0xe002", 6, 0, "Ubiquiti", "airOS, XM" ], + [ "0x168c", "0xffff", "0x0777", "0xe003", 3, 0, "Ubiquiti", "airOS, XM" ], + [ "0x168c", "0xffff", "0x0777", "0xe005", 5, 0, "Ubiquiti", "NanoStation, M5" ], + [ "0x168c", "0xffff", "0x0777", "0xe006", 5, 0, "Ubiquiti", "airOS, XM" ], + [ "0x168c", "0xffff", "0x0777", "0xe009", 6, 0, "Ubiquiti", "NanoStation, Loco, M9" ], + [ "0x168c", "0xffff", "0x0777", "0xe012", 10, 0, "Ubiquiti", "NanoStation, M2" ], + [ "0x168c", "0xffff", "0x0777", "0xe035", 3, 0, "Ubiquiti", "NanoStation, M3" ], + [ "0x168c", "0xffff", "0x0777", "0xe0a2", 2, 0, "Ubiquiti", "NanoStation, Loco, M2" ], + [ "0x168c", "0xffff", "0x0777", "0xe0a5", 1, 0, "Ubiquiti", "NanoStation, Loco, M5" ], + [ "0x168c", "0xffff", "0x0777", "0xe102", 6, 0, "Ubiquiti", "airOS, XM" ], + [ "0x168c", "0xffff", "0x0777", "0xe105", 5, 0, "Ubiquiti", "Rocket, M5" ], + [ "0x168c", "0xffff", "0x0777", "0xe112", 10, 0, "Ubiquiti", "airOS, XM" ], + [ "0x168c", "0xffff", "0x0777", "0xe115", 3, 0, "Ubiquiti", "airOS, XM" ], + [ "0x168c", "0xffff", "0x0777", "0xe1a3", 3, 0, "Ubiquiti", "airOS, XM" ], + [ "0x168c", "0xffff", "0x0777", "0xe1a5", 5, 0, "Ubiquiti", "PowerBridge, M5" ], + [ "0x168c", "0xffff", "0x0777", "0xe1b2", 10, 0, "Ubiquiti", "airOS, XM" ], + [ "0x168c", "0xffff", "0x0777", "0xe1b3", 3, 0, "Ubiquiti", "airOS, XM" ], + [ "0x168c", "0xffff", "0x0777", "0xe1b5", 5, 0, "Ubiquiti", "Rocket, M5" ], + [ "0x168c", "0xffff", "0x0777", "0xe1b6", 5, 0, "Ubiquiti", "airOS, XM" ], + [ "0x168c", "0xffff", "0x0777", "0xe1b9", 6, 0, "Ubiquiti", "Rocket, M9" ], + [ "0x168c", "0xffff", "0x0777", "0xe1c2", 10, 0, "Ubiquiti", "airOS, XM" ], + [ "0x168c", "0xffff", "0x0777", "0xe1c3", 3, 0, "Ubiquiti", "Rocket, M3" ], + [ "0x168c", "0xffff", "0x0777", "0xe1c5", 5, 0, "Ubiquiti", "Rocket, M5, GPS" ], + [ "0x168c", "0xffff", "0x0777", "0xe1c5", 5, 0, "Ubiquiti", "airOS, XM" ], + [ "0x168c", "0xffff", "0x0777", "0xe1d2", 10, 0, "Ubiquiti", "Rocket, M2, Titanium" ], + [ "0x168c", "0xffff", "0x0777", "0xe1d3", 3, 0, "Ubiquiti", "airOS, XM" ], + [ "0x168c", "0xffff", "0x0777", "0xe1d5", 5, 0, "Ubiquiti", "airOS, XM/XW" ], + [ "0x168c", "0xffff", "0x0777", "0xe1d9", 6, 0, "Ubiquiti", "airOS, XM" ], + [ "0x168c", "0xffff", "0x0777", "0xe1e3", 3, 0, "Ubiquiti", "airOS, XM" ], + [ "0x168c", "0xffff", "0x0777", "0xe1e5", 5, 0, "Ubiquiti", "airOS, XM" ], + [ "0x168c", "0xffff", "0x0777", "0xe202", 12, 0, "Ubiquiti", "Bullet, M2" ], + [ "0x168c", "0xffff", "0x0777", "0xe205", 6, 0, "Ubiquiti", "Bullet, M5" ], + [ "0x168c", "0xffff", "0x0777", "0xe212", 1, 0, "Ubiquiti", "AirGrid, M2" ], + [ "0x168c", "0xffff", "0x0777", "0xe215", 1, 0, "Ubiquiti", "AirGrid, M5" ], + [ "0x168c", "0xffff", "0x0777", "0xe232", 2, 0, "Ubiquiti", "NanoBridge, M2" ], + [ "0x168c", "0xffff", "0x0777", "0xe233", 3, 0, "Ubiquiti", "airOS, XM" ], + [ "0x168c", "0xffff", "0x0777", "0xe235", 1, 0, "Ubiquiti", "NanoBridge, M5" ], + [ "0x168c", "0xffff", "0x0777", "0xe239", 6, 0, "Ubiquiti", "NanoBridge, M9" ], + [ "0x168c", "0xffff", "0x0777", "0xe242", 9, 0, "Ubiquiti", "AirGrid, M2, HP" ], + [ "0x168c", "0xffff", "0x0777", "0xe243", 3, 0, "Ubiquiti", "NanoBridge, M3" ], + [ "0x168c", "0xffff", "0x0777", "0xe245", 6, 0, "Ubiquiti", "AirGrid, M5, HP" ], + [ "0x168c", "0xffff", "0x0777", "0xe252", 9, 0, "Ubiquiti", "AirGrid, M2, HP" ], + [ "0x168c", "0xffff", "0x0777", "0xe255", 6, 0, "Ubiquiti", "AirGrid, M5, HP" ], + [ "0x168c", "0xffff", "0x0777", "0xe2a3", 3, 0, "Ubiquiti", "airOS, XM" ], + [ "0x168c", "0xffff", "0x0777", "0xe2a5", 5, 0, "Ubiquiti", "airOS, XM" ], + [ "0x168c", "0xffff", "0x0777", "0xe2b2", 10, 0, "Ubiquiti", "airOS, XM" ], + [ "0x168c", "0xffff", "0x0777", "0xe2b5", 1, 0, "Ubiquiti", "NanoBridge, M5" ], + [ "0x168c", "0xffff", "0x0777", "0xe2b9", 6, 0, "Ubiquiti", "airOS, XM" ], + [ "0x168c", "0xffff", "0x0777", "0xe2c2", 10, 0, "Ubiquiti", "NanoBeam, M2, Int" ], + [ "0x168c", "0xffff", "0x0777", "0xe2c3", 6, 0, "Ubiquiti", "Bullet, M2, XW" ], + [ "0x168c", "0xffff", "0x0777", "0xe2c4", 6, 0, "Ubiquiti", "airOS, XW" ], + [ "0x168c", "0xffff", "0x0777", "0xe2d2", 12, 0, "Ubiquiti", "Bullet, M2, Titanium, HP" ], + [ "0x168c", "0xffff", "0x0777", "0xe2d4", 6, 0, "Ubiquiti", "airOS, XW" ], + [ "0x168c", "0xffff", "0x0777", "0xe2d5", 6, 0, "Ubiquiti", "airOS, XM" ], + [ "0x168c", "0xffff", "0x0777", "0xe2e5", 4, 0, "Ubiquiti", "airOS, XM" ], + [ "0x168c", "0xffff", "0x0777", "0xe302", 12, 0, "Ubiquiti", "PicoStation, M2"], + [ "0x168c", "0xffff", "0x0777", "0xe305", 6, 0, "Ubiquiti", "airOS, XM" ], + [ "0x168c", "0xffff", "0x0777", "0xe345", 6, 0, "Ubiquiti", "WispStation, M5" ], + [ "0x168c", "0xffff", "0x0777", "0xe3a5", 5, 0, "Ubiquiti", "airOS, XM" ], + [ "0x168c", "0xffff", "0x0777", "0xe3b5", 6, 0, "Ubiquiti", "airOS, XM/XW" ], + [ "0x168c", "0xffff", "0x0777", "0xe3e5", 4, 0, "Ubiquiti", "PowerBeam, M5, 300" ], + [ "0x168c", "0xffff", "0x0777", "0xe402", 10, 0, "Ubiquiti", "airOS, XM" ], + [ "0x168c", "0xffff", "0x0777", "0xe405", 1, 0, "Ubiquiti", "airOS, XM" ], + [ "0x168c", "0xffff", "0x0777", "0xe4a2", 1, 0, "Ubiquiti", "AirRouter" ], + [ "0x168c", "0xffff", "0x0777", "0xe4a5", 1, 0, "Ubiquiti", "airOS, XM" ], + [ "0x168c", "0xffff", "0x0777", "0xe4b2", 9, 0, "Ubiquiti", "AirRouter, HP" ], + [ "0x168c", "0xffff", "0x0777", "0xe4d5", 5, 0, "Ubiquiti", "Rocket, M5, Titanium" ], + [ "0x168c", "0xffff", "0x0777", "0xe4e5", 4, 0, "Ubiquiti", "PowerBeam, M5, 400" ], + [ "0x168c", "0xffff", "0x0777", "0xe5e5", 4, 0, "Ubiquiti", "airOS, XW" ], + [ "0x168c", "0xffff", "0x0777", "0xe6a2", 1, 0, "Ubiquiti", "airOS, XM" ], + [ "0x168c", "0xffff", "0x0777", "0xe6b2", 1, 0, "Ubiquiti", "airOS, XM" ], + [ "0x168c", "0xffff", "0x0777", "0xe6b5", 5, 0, "Ubiquiti", "Rocket, M5, XW" ], + [ "0x168c", "0xffff", "0x0777", "0xe6c2", 6, 0, "Ubiquiti", "airOS, XM" ], + [ "0x168c", "0xffff", "0x0777", "0xe6e5", 4, 0, "Ubiquiti", "PowerBeam, M5, 400, ISO" ], + [ "0x168c", "0xffff", "0x0777", "0xe7f8", 2, 0, "Ubiquiti", "airOS, XW" ], + [ "0x168c", "0xffff", "0x0777", "0xe805", 5, 0, "Ubiquiti", "airOS, XM" ], + [ "0x168c", "0xffff", "0x0777", "0xe812", 6, 0, "Ubiquiti", "NanoBeam, M2, 13" ], + [ "0x168c", "0xffff", "0x0777", "0xe815", 4, 0, "Ubiquiti", "NanoBeam, M5, 16" ], + [ "0x168c", "0xffff", "0x0777", "0xe825", 4, 0, "Ubiquiti", "NanoBeam, M5, 19" ], + [ "0x168c", "0xffff", "0x0777", "0xe835", 6, 0, "Ubiquiti", "AirGrid, M5, XW" ], + [ "0x168c", "0xffff", "0x0777", "0xe845", 1, 0, "Ubiquiti", "NanoStation, Loco, M5, XW" ], + [ "0x168c", "0xffff", "0x0777", "0xe855", 5, 0, "Ubiquiti", "NanoStation, M5, XW" ], + [ "0x168c", "0xffff", "0x0777", "0xe865", 6, 0, "Ubiquiti", "LiteBeam, M5" ], + [ "0x168c", "0xffff", "0x0777", "0xe866", 6, 0, "Ubiquiti", "NanoStation, M2, XW" ], + [ "0x168c", "0xffff", "0x0777", "0xe867", 2, 0, "Ubiquiti", "NanoStation, Loco, M2, XW" ], + [ "0x168c", "0xffff", "0x0777", "0xe868", 7, 0, "Ubiquiti", "Rocket, M2, XW" ], + [ "0x168c", "0xffff", "0x0777", "0xe869", 2, 0, "Ubiquiti", "airOS, XW" ], + [ "0x168c", "0xffff", "0x0777", "0xe875", 4, 0, "Ubiquiti", "airOS, XW" ], + [ "0x168c", "0xffff", "0x0777", "0xe879", 2, 0, "Ubiquiti", "airOS, XW" ], + [ "0x168c", "0xffff", "0x0777", "0xe885", 4, 0, "Ubiquiti", "PowerBeam, M5, 620, XW" ], + [ "0x168c", "0xffff", "0x0777", "0xe895", 4, 0, "Ubiquiti", "airOS, XW" ], + [ "0x168c", "0xffff", "0x0777", "0xe8a5", 1, 0, "Ubiquiti", "NanoStation, Loco, M5"], + [ "0x168c", "0xffff", "0x0777", "0xe8b5", 5, 0, "Ubiquiti", "airOS, XM" ], + [ "0x168c", "0x001b", "0x0777", "0x3002", 10, 0, "Ubiquiti", "XR2" ], + [ "0x168c", "0x001b", "0x7777", "0x3002", 10, 0, "Ubiquiti", "XR2" ], + [ "0x168c", "0x001b", "0x0777", "0x3b02", 10, 0, "Ubiquiti", "XR2.3" ], + [ "0x168c", "0x001b", "0x0777", "0x3c02", 10, 0, "Ubiquiti", "XR2.6" ], + [ "0x168c", "0x001b", "0x0777", "0x3b03", 10, 0, "Ubiquiti", "XR3-2.8" ], + [ "0x168c", "0x001b", "0x0777", "0x3c03", 10, 0, "Ubiquiti", "XR3-3.6" ], + [ "0x168c", "0x001b", "0x0777", "0x3003", 10, 0, "Ubiquiti", "XR3" ], + [ "0x168c", "0x001b", "0x0777", "0x3004", 10, 0, "Ubiquiti", "XR4" ], + [ "0x168c", "0x001b", "0x0777", "0x3005", 10, 0, "Ubiquiti", "XR5" ], + [ "0x168c", "0x001b", "0x7777", "0x3005", 10, 0, "Ubiquiti", "XR5" ], + [ "0x168c", "0x001b", "0x0777", "0x3007", 10, 0, "Ubiquiti", "XR7" ], + [ "0x168c", "0x001b", "0x0777", "0x3009", 10, -1520, "Ubiquiti", "XR9" ], + [ "0x168c", "0x001b", "0x168c", "0x2063", 0, 0, "Atheros", "AR5413" ], + [ "0x168c", "0x0013", "0x168c", "0x1042", 1, 0, "Ubiquiti", "SRC" ], + [ "0x168c", "0x0013", "0x0777", "0x2041", 10, 0, "Ubiquiti", "SR2" ], + [ "0x168c", "0x0013", "0x0777", "0x2004", 6, 0, "Ubiquiti", "SR4" ], + [ "0x168c", "0x0013", "0x7777", "0x2004", 6, 0, "Ubiquiti", "SR4" ], + [ "0x168c", "0x0013", "0x0777", "0x1004", 6, 0, "Ubiquiti", "SR4C" ], + [ "0x168c", "0x0013", "0x7777", "0x1004", 6, 0, "Ubiquiti", "SR4C" ], + [ "0x168c", "0x0013", "0x168c", "0x2042", 7, 0, "Ubiquiti", "SR5" ], + [ "0x168c", "0x0013", "0x7777", "0x2009", 12, -1500, "Ubiquiti", "SR9" ], + [ "0x168c", "0x0027", "0x168c", "0x2082", 7, 0, "Ubiquiti", "SR71A" ], + [ "0x168c", "0x0027", "0x0777", "0x4082", 7, 0, "Ubiquiti", "SR71" ], + [ "0x168c", "0x0029", "0x0777", "0x4005", 7, 0, "Ubiquiti", "SR71-15" ], + [ "0x168c", "0x002a", "0x0777", "0xe302", 12, 0, "Ubiquiti", "PicoStation, M2" ], + [ "0x168c", "0x002a", "0x0777", "0xe012", 12, 0, "Ubiquiti", "NanoStation, M2" ], + [ "0x168c", "0x002a", "0x0777", "0xe005", 5, 0, "Ubiquiti", "NanoStation, M5" ], + [ "0x168c", "0x002a", "0x0777", "0xe202", 12, 0, "Ubiquiti", "Bullet, M2" ], + [ "0x168c", "0x002a", "0x0777", "0xe805", 5, 0, "Ubiquiti", "Bullet, M5" ], + [ "0x168c", "0x002a", "0x0777", "0xe345", 0, 0, "Ubiquiti", "WispStation, M5" ], + [ "0x168c", "0x0029", "0x168c", "0xa094", 0, 0, "Atheros", "AR9220" ], + [ "0x168c", "0x0029", "0x168c", "0xa095", 0, 0, "Atheros", "AR9223" ], + [ "0x168c", "0x002a", "0x168c", "0xa093", 0, 0, "Atheros", "AR9280" ], + [ "0x168c", "0x002b", "0x168c", "0xa091", 0, 0, "Atheros", "AR9285" ], + [ "0x168c", "0x002d", "0x168c", "0x209a", 0, 0, "Atheros", "AR9287" ], + [ "0x168c", "0x002e", "0x1a3b", "0x1121", 0, 0, "Atheros", "AR9287" ], + [ "0x168c", "0x002e", "0x0777", "0xe0a2", 8, 0, "Ubiquiti", "NanoStation, Loco, M2, (XM)" ], + [ "0x168c", "0x002e", "0x168c", "0x30a4", 0, 0, "Atheros", "AR9287" ], + [ "0x168c", "0x002e", "0x168c", "0xa199", 0, 0, "Atheros", "AR9287" ], + [ "0x168c", "0x0030", "0x168c", "0x3112", 0, 0, "Atheros", "AR9380" ], + [ "0x168c", "0x0030", "0x168c", "0x3114", 0, 0, "Atheros", "AR9390" ], + [ "0x168c", "0x0033", "0x168c", "0xa120", 0, 0, "Atheros", "AR9580" ], + [ "0x168c", "0x0033", "0x168c", "0xa136", 0, 0, "Atheros", "AR9580" ], + [ "0x168c", "0x0033", "0x168c", "0x3123", 0, 0, "Atheros", "AR9590" ], + [ "0x168c", "0x0033", "0x19b6", "0xd014", 0, 0, "MikroTik", "R11e-5HnD" ], + [ "0x168c", "0x0033", "0x19b6", "0xd057", 0, 0, "MikroTik", "R11e-5HnDr2" ], + [ "0x168c", "0x0033", "0x19b6", "0xd016", 0, 0, "MikroTik", "R11e-2HPnD" ], + [ "0x168c", "0x0034", "0x17aa", "0x3214", 0, 0, "Atheros", "AR9462" ], + [ "0x168c", "0x003c", "0x0000", "0x0000", 0, 0, "Qualcomm, Atheros", "QCA9880" ], + [ "0x168c", "0x003c", "0x168c", "0x3223", 0, 0, "Qualcomm, Atheros", "QCA9880" ], + [ "0x168c", "0x003c", "0x1a56", "0x1420", 0, 0, "Qualcomm, Atheros", "QCA9862" ], + [ "0x168c", "0x003c", "0x19b6", "0xd03c", 0, 0, "Mikrotik", "R11e-5HacT" ], + [ "0x168c", "0x003c", "0x19b6", "0xd075", 0, 0, "Mikrotik", "R11e-5HacD" ], + [ "0x168c", "0x003e", "0x168c", "0x3361", 0, 0, "Qualcomm, Atheros", "QCA6174" ], + [ "0x168c", "0x0040", "0x168c", "0x0002", 0, 0, "Qualcomm, Atheros", "QCA9990" ], + [ "0x168c", "0x0046", "0x0777", "0xe535", 0, 0, "Qualcomm, Atheros", "QCA9994" ], + [ "0x168c", "0x0046", "0x0777", "0xe5a2", 0, 0, "Qualcomm, Atheros", "QCA9994" ], + [ "0x168c", "0x0050", "0x0000", "0x0000", 0, 0, "Qualcomm, Atheros", "QCA9887" ], + [ "0x168c", "0x0056", "0x0000", "0x0000", 0, 0, "Qualcomm, Atheros", "QCA9886" ], + [ "0x17cb", "0x1104", "0x17cb", "0x1104", 0, 0, "Qualcomm, Atheros", "QCN6024/9024/9074" ], + [ "0x1814", "0x3051", "0x1814", "0x0007", 0, 0, "Ralink", "Rt3051" ], + [ "0x1814", "0x3052", "0x1814", "0x0008", 0, 0, "Ralink", "Rt3052" ], + [ "0x1814", "0x3350", "0x1814", "0x000b", 0, 0, "Ralink", "Rt3350" ], + [ "0x1814", "0x3662", "0x1814", "0x000d", 0, 0, "Ralink", "Rt3662" ], + [ "0x11ab", "0x2a55", "0x11ab", "0x0000", 0, 0, "Marvell", "88W8864" ], + [ "0x02df", "0x9135", "0x0000", "0x0000", 0, 0, "Marvell", "88W8887" ], + [ "0x11ab", "0x2b40", "0x11ab", "0x0000", 0, 0, "Marvell", "88W8964" ], + [ "0x02df", "0x9141", "0x0000", "0x0000", 0, 0, "Marvell", "88W8997" ], + [ "0x14c3", "0x0608", "0x14c3", "0x0608", 0, 0, "AMD", "RZ608" ], + [ "0x14c3", "0x7603", "0x14c3", "0x7603", 0, 0, "MediaTek", "MT7603E" ], + [ "0x14c3", "0x7610", "0x14c3", "0x7610", 0, 0, "MediaTek", "MT7610E" ], + [ "0x14c3", "0x7612", "0x14c3", "0x7612", 0, 0, "MediaTek", "MT7612E" ], + [ "0x14c3", "0x7663", "0x14c3", "0x7663", 0, 0, "MediaTek", "MT7613BE" ], + [ "0x14c3", "0x7615", "0x7615", "0x14c3", 0, 0, "MediaTek", "MT7615E" ], + [ "0x14c3", "0x7628", "0x14c3", "0x0004", 0, 0, "MediaTek", "MT76x8" ], + [ "0x14c3", "0x7650", "0x14c3", "0x7650", 0, 0, "MediaTek", "MT7610E" ], + [ "0x14c3", "0x7662", "0x14c3", "0x7662", 0, 0, "MediaTek", "MT76x2E" ], + [ "0x14c3", "0x7915", "0x14c3", "0x7915", 0, 0, "MediaTek", "MT7915E" ], + [ "0x14c3", "0x7906", "0x14c3", "0x7906", 0, 0, "MediaTek", "MT7916AN" ], + [ "0x14c3", "0x7990", "0x14C3", "0x6639", 0, 0, "MediaTek", "MT7996E" ], + [ "0x14c3", "0x7992", "0x14C3", "0x7992", 0, 0, "MediaTek", "MT7992E" ], + [ "0x14e4", "0xaa52", "0x14e4", "0xaa52", 0, 0, "Broadcom", "BCM43602" ], + [ "0x02d0", "0xa9a6", "0x0000", "0x0000", 0, 0, "Cypress", "CYW43455" ], + [ "0x02d0", "0x4345", "0x0000", "0x0000", 0, 0, "Cypress", "CYW43455" ], + [ "0x1ae9", "0x0310", "0x1ae9", "0x0000", 0, 0, "Wilocity", "Wil6210" ], + [ "0x0000", "0x0000", "0x148f", "0x7601", 0, 0, "MediaTek", "MT7601U" ], + [ "0x0000", "0x0000", "0x0e8d", "0x7961", 0, 0, "MediaTek", "MT7921AU" ], + [ "0x0000", "0x0000", "0x0b05", "0x1833", 0, 0, "ASUS", "USB-AC54" ], + [ "0x0000", "0x0000", "0x0b05", "0x17eb", 0, 0, "ASUS", "USB-AC55" ], + [ "0x0000", "0x0000", "0x0b05", "0x180b", 0, 0, "ASUS", "USB-N53, B1" ], + [ "0x0000", "0x0000", "0x0e8d", "0x7612", 0, 0, "Aukey", "USBAC1200" ], + [ "0x0000", "0x0000", "0x057c", "0x8503", 0, 0, "AVM", "FRITZ!WLAN, AC860" ], + [ "0x0000", "0x0000", "0x7392", "0xb711", 0, 0, "Edimax", "EW-7722UAC" ], + [ "0x0000", "0x0000", "0x0e8d", "0x7632", 0, 0, "High, Cloud", "HC-M7662BU1" ], + [ "0x0000", "0x0000", "0x2c4e", "0x0103", 0, 0, "Mercury", "UD13" ], + [ "0x0000", "0x0000", "0x0846", "0x9053", 0, 0, "Netgear", "A6210" ], + [ "0x0000", "0x0000", "0x045e", "0x02e6", 0, 0, "Microsoft", "XBox, One, Wireless, Adapter" ], + [ "0x0000", "0x0000", "0x045e", "0x02fe", 0, 0, "Microsoft", "XBox, One, Wireless, Adapter" ], + [ "0x0000", "0x0000", "0x148f", "0x7610", 0, 0, "MediaTek", "MT7610U" ], + [ "0x0000", "0x0000", "0x13b1", "0x003e", 0, 0, "Linksys", "AE6000" ], + [ "0x0000", "0x0000", "0x0e8d", "0x7610", 0, 0, "Sabrent", "NTWLAC" ], + [ "0x0000", "0x0000", "0x7392", "0xa711", 0, 0, "Edimax", "7711MAC" ], + [ "0x0000", "0x0000", "0x148f", "0x761a", 0, 0, "TP-Link", "TL-WDN5200" ], + [ "0x0000", "0x0000", "0x0b05", "0x17d1", 0, 0, "ASUS", "USB-AC51" ], + [ "0x0000", "0x0000", "0x0b05", "0x17db", 0, 0, "ASUS", "USB-AC50" ], + [ "0x0000", "0x0000", "0x0df6", "0x0075", 0, 0, "Sitecom", "WLA-3100" ], + [ "0x0000", "0x0000", "0x2019", "0xab31", 0, 0, "Planex", "GW-450D" ], + [ "0x0000", "0x0000", "0x2001", "0x3d02", 0, 0, "D-Link", "DWA-171, rev, B1" ], + [ "0x0000", "0x0000", "0x0586", "0x3425", 0, 0, "Zyxel", "NWD6505" ], + [ "0x0000", "0x0000", "0x07b8", "0x7610", 0, 0, "AboCom", "AU7212" ], + [ "0x0000", "0x0000", "0x04bb", "0x0951", 0, 0, "I-O, DATA", "WN-AC433UK" ], + [ "0x0000", "0x0000", "0x057c", "0x8502", 0, 0, "AVM", "FRITZ!WLAN, AC430" ], + [ "0x0000", "0x0000", "0x293c", "0x5702", 0, 0, "Comcast", "Xfinity, KXW02AAA" ], + [ "0x0000", "0x0000", "0x20f4", "0x806b", 0, 0, "TRENDnet", "TEW-806UBH" ], + [ "0x0000", "0x0000", "0x7392", "0xc711", 0, 0, "Devolo", "WiFi, Stick, ac" ], + [ "0x0000", "0x0000", "0x0df6", "0x0079", 0, 0, "Sitecom", "WL-356" ], + [ "0x0000", "0x0000", "0x2357", "0x0123", 0, 0, "TP-Link", "T2UHP, US, v1" ], + [ "0x0000", "0x0000", "0x2357", "0x010b", 0, 0, "TP-Link", "T2UHP, UN, v1" ], + [ "0x0000", "0x0000", "0x2357", "0x0105", 0, 0, "TP-Link", "Archer, T1U" ], + [ "0x0000", "0x0000", "0x0e8d", "0x7630", 0, 0, "MediaTek", "MT7630U" ], + [ "0x0000", "0x0000", "0x0e8d", "0x7650", 0, 0, "MediaTek", "MT7650U" ], + [ "0x0000", "0x0000", "0x0e8d", "0x7663", 0, 0, "MediaTek", "MT7663U" ], + [ "0x0000", "0x0000", "0x043e", "0x310c", 0, 0, "LG", "LGSBWAC02" ], + [ "0x0000", "0x0000", "0x0bda", "0x8176", 0, 0, "Realtek", "RTL8188CU" ], + [ "0x0000", "0x0000", "0x0bda", "0xf179", 0, 0, "Realtek", "RTL8188FTV" ] + ], + "compatible": { + "qca,ar9130-wmac": [ "Atheros", "AR9130" ], + "qca,ar9330-wmac": [ "Atheros", "AR9330" ], + "qca,ar9340-wmac": [ "Atheros", "AR9340" ], + "qca,qca9530-wmac": [ "Qualcomm Atheros", "QCA9530" ], + "qca,qca9550-wmac": [ "Qualcomm Atheros", "QCA9550" ], + "qca,qca9560-wmac": [ "Qualcomm Atheros", "QCA9560" ], + "qcom,ipq4019-wifi": [ "Qualcomm Atheros", "IPQ4019" ], + "qcom,ipq6018-wifi": [ "Qualcomm Atheros", "IPQ6018" ], + "qcom,ipq8074-wifi": [ "Qualcomm Atheros", "IPQ8074" ], + "mediatek,mt7622-wmac": [ "MediaTek", "MT7622" ], + "mediatek,mt7628-wmac": [ "MediaTek", "MT7628" ], + "mediatek,mt7981-wmac": [ "MediaTek", "MT7981" ], + "mediatek,mt7986-wmac": [ "MediaTek", "MT7986" ], + "ralink,rt2880-wmac": [ "Ralink", "Rt2880" ], + "ralink,rt3050-wmac": [ "Ralink", "Rt3050" ], + "ralink,rt3352-wmac": [ "Ralink", "Rt3352" ], + "ralink,rt3883-wmac": [ "Ralink", "Rt3883" ], + "ralink,rt5350-wmac": [ "Ralink", "Rt5350" ], + "ralink,rt7620-wmac": [ "MediaTek", "MT7620" ] + } +} diff --git a/package/network/utils/iwinfo/Makefile b/package/network/utils/iwinfo/Makefile index d81ed62620afd6..fe160f6ef326aa 100644 --- a/package/network/utils/iwinfo/Makefile +++ b/package/network/utils/iwinfo/Makefile @@ -18,6 +18,7 @@ PKG_MAINTAINER:=Jo-Philipp Wich PKG_LICENSE:=GPL-2.0 PKG_BUILD_FLAGS:=no-lto +PKG_CONFIG_DEPENDS:=CONFIG_WIFI_SCRIPTS_UCODE IWINFO_ABI_VERSION:=20230701 @@ -62,7 +63,7 @@ define Package/iwinfo SECTION:=utils CATEGORY:=Utilities TITLE:=Generalized Wireless Information utility - DEPENDS:=+libiwinfo + DEPENDS:=+libiwinfo @!WIFI_SCRIPTS_UCODE endef define Package/iwinfo/description From 218f3884d2fb8badaaa0fa5643143a668713bad8 Mon Sep 17 00:00:00 2001 From: John Crispin Date: Thu, 17 Oct 2024 15:12:55 +0200 Subject: [PATCH 11/48] wifi-scripts: add ucode based scripts Add an ucode based re-implementation of the shell script based wifi code. The new code is jsonschema driven. The code has been refactored into several files making it easier to follow. The new scripts are also way faster than the previous sh implementation. The new code is currently opt-in via WIFI_SCRIPTS_UCODE and defaults to EXPERIMENTAL. Signed-off-by: John Crispin --- package/network/config/wifi-scripts/Config.in | 3 + package/network/config/wifi-scripts/Makefile | 10 +- .../lib/netifd/wireless/mac80211.sh | 347 +++++ .../share/schema/wireless.wifi-device.json | 717 ++++++++++ .../usr/share/schema/wireless.wifi-iface.json | 1157 +++++++++++++++++ .../share/schema/wireless.wifi-station.json | 20 + .../usr/share/schema/wireless.wifi-vlan.json | 16 + .../files-ucode/usr/share/ucode/wifi/ap.uc | 480 +++++++ .../usr/share/ucode/wifi/common.uc | 124 ++ .../usr/share/ucode/wifi/hostapd.uc | 577 ++++++++ .../files-ucode/usr/share/ucode/wifi/iface.uc | 194 +++ .../usr/share/ucode/wifi/netifd.uc | 49 + .../usr/share/ucode/wifi/supplicant.uc | 237 ++++ .../usr/share/ucode/wifi/validate.uc | 121 ++ 14 files changed, 4051 insertions(+), 1 deletion(-) create mode 100644 package/network/config/wifi-scripts/Config.in create mode 100755 package/network/config/wifi-scripts/files-ucode/lib/netifd/wireless/mac80211.sh create mode 100644 package/network/config/wifi-scripts/files-ucode/usr/share/schema/wireless.wifi-device.json create mode 100644 package/network/config/wifi-scripts/files-ucode/usr/share/schema/wireless.wifi-iface.json create mode 100644 package/network/config/wifi-scripts/files-ucode/usr/share/schema/wireless.wifi-station.json create mode 100644 package/network/config/wifi-scripts/files-ucode/usr/share/schema/wireless.wifi-vlan.json create mode 100644 package/network/config/wifi-scripts/files-ucode/usr/share/ucode/wifi/ap.uc create mode 100644 package/network/config/wifi-scripts/files-ucode/usr/share/ucode/wifi/common.uc create mode 100644 package/network/config/wifi-scripts/files-ucode/usr/share/ucode/wifi/hostapd.uc create mode 100644 package/network/config/wifi-scripts/files-ucode/usr/share/ucode/wifi/iface.uc create mode 100644 package/network/config/wifi-scripts/files-ucode/usr/share/ucode/wifi/netifd.uc create mode 100644 package/network/config/wifi-scripts/files-ucode/usr/share/ucode/wifi/supplicant.uc create mode 100644 package/network/config/wifi-scripts/files-ucode/usr/share/ucode/wifi/validate.uc diff --git a/package/network/config/wifi-scripts/Config.in b/package/network/config/wifi-scripts/Config.in new file mode 100644 index 00000000000000..92e661246491e7 --- /dev/null +++ b/package/network/config/wifi-scripts/Config.in @@ -0,0 +1,3 @@ +config WIFI_SCRIPTS_UCODE + bool "Use new ucode based scripts" + default n diff --git a/package/network/config/wifi-scripts/Makefile b/package/network/config/wifi-scripts/Makefile index ae41f749498624..52edd1b56764da 100644 --- a/package/network/config/wifi-scripts/Makefile +++ b/package/network/config/wifi-scripts/Makefile @@ -13,17 +13,22 @@ PKG_RELEASE:=1 PKG_LICENSE:=GPL-2.0 PKG_MAINTAINER:=Felix Fietkau +PKG_CONFIG_DEPENDS:=CONFIG_WIFI_SCRIPTS_UCODE include $(INCLUDE_DIR)/package.mk define Package/wifi-scripts SECTION:=utils CATEGORY:=Base system - DEPENDS:=+netifd +ucode +ucode-mod-nl80211 +ucode-mod-rtnl +ucode-mod-ubus +ucode-mod-uci + DEPENDS:=+netifd +ucode +ucode-mod-nl80211 +ucode-mod-rtnl +ucode-mod-ubus +ucode-mod-uci +ucode-mod-digest TITLE:=Wi-Fi configuration scripts PKGARCH:=all endef +define Package/wifi-scripts/config + source "$(SOURCE)/Config.in" +endef + define Package/wifi-scripts/description A set of scripts that handle setup and configuration of Wi-Fi devices. endef @@ -40,6 +45,9 @@ endef define Package/wifi-scripts/install $(INSTALL_DIR) $(1) $(CP) ./files/* $(1)/ +ifeq ($(CONFIG_WIFI_SCRIPTS_UCODE),y) + $(CP) ./files-ucode/* $(1)/ +endif endef $(eval $(call BuildPackage,wifi-scripts)) diff --git a/package/network/config/wifi-scripts/files-ucode/lib/netifd/wireless/mac80211.sh b/package/network/config/wifi-scripts/files-ucode/lib/netifd/wireless/mac80211.sh new file mode 100755 index 00000000000000..fe364b8f48e689 --- /dev/null +++ b/package/network/config/wifi-scripts/files-ucode/lib/netifd/wireless/mac80211.sh @@ -0,0 +1,347 @@ +#!/usr/bin/ucode + +'use strict'; + +import { set_default, log } from 'wifi.common'; +import { validate, dump_options } from 'wifi.validate'; +import * as supplicant from 'wifi.supplicant'; +import * as hostapd from 'wifi.hostapd'; +import * as netifd from 'wifi.netifd'; +import * as iface from 'wifi.iface'; +import * as fs from 'fs'; + +global.radio = ARGV[2]; + +const mesh_param_list = [ + "mesh_retry_timeout", "mesh_confirm_timeout", "mesh_holding_timeout", "mesh_max_peer_links", + "mesh_max_retries", "mesh_ttl", "mesh_element_ttl", "mesh_hwmp_max_preq_retries", + "mesh_path_refresh_time", "mesh_min_discovery_timeout", "mesh_hwmp_active_path_timeout", + "mesh_hwmp_preq_min_interval", "mesh_hwmp_net_diameter_traversal_time", "mesh_hwmp_rootmode", + "mesh_hwmp_rann_interval", "mesh_gate_announcements", "mesh_sync_offset_max_neighor", + "mesh_rssi_threshold", "mesh_hwmp_active_path_to_root_timeout", "mesh_hwmp_root_interval", + "mesh_hwmp_confirmation_interval", "mesh_awake_window", "mesh_plink_timeout", + "mesh_auto_open_plinks", "mesh_fwding", "mesh_power_mode" +]; + +function phy_suffix(radio, sep) { + if (radio == null || radio < 0) + return ""; + return sep + radio; +} + +function reset_config(phy, radio) { + let name = phy + phy_suffix(radio, "."); + let prev_config = `/var/run/hostapd-${name}.conf`; + + global.ubus.call('hostapd', 'config_set', { phy, radio, config: '', prev_config }); + global.ubus.call('wpa_supplicant', 'config_set', { phy, radio, config: []}); + + name = phy + phy_suffix(radio, ":"); + system(`ucode /usr/share/hostap/wdev.uc ${name} set_config '{}'`); +} + +function phy_filename(phy, name) { + return `/sys/class/ieee80211/${phy}/${name}`; +} + +function phy_file(phy, name) { + return fs.readfile(phy_filename(phy, name)); +} + +function phy_index(phy) { + return +phy_file(phy, "index"); +} + +function phy_path_match(phy, path) { + let phy_path = fs.realpath(phy_filename(phy, "device")); + return substr(phy_path, -length(path)) == path; +} + +function find_phy_by_path(phys, path) { + if (!path) + return null; + + path = split(path, "+"); + phys = filter(phys, (phy) => phy_path_match(phy, path[0])); + phys = sort(phys, (a, b) => phy_index(a) - phy_index(b)); + + return phys[+path[1]]; +} + +function find_phy_by_macaddr(phys, macaddr) { + macaddr = lc(macaddr); + return filter(phys, (phy) => phy_file(phy, "macaddr") == macaddr)[0]; +} + +function find_phy_by_name(phys, name) { + return index(phys, name) < 0 ? null : name; +} + +function find_phy(config) { + let phys = fs.lsdir("/sys/class/ieee80211"); + + return find_phy_by_path(phys, config.path) ?? + find_phy_by_macaddr(phys, config.macaddr) ?? + find_phy_by_name(phys, config.phy); +} + +function get_channel_frequency(band, channel) { + if (channel < 1) + return null; + + switch (band) { + case '2g': + if (channel == 14) + return 2484; + return 2407 + channel * 5; + case '5g': + if (channel >= 182 && channel <= 196) + return 4000 + channel * 5; + return 5000 + channel * 5; + case '6g': + if (channel == 2) + return 5935; + return 5950 + channel * 5; + case '60g': + return 56160 + channel * 2160; + } +} + +function setup_phy(phy, config, data) { + if (config.channel == "auto") + config.channel = 0; + config.channel = +config.channel; + config.frequency = get_channel_frequency(config.band, config.channel); + + if (config.country) { + log(`Setting country code to ${config.country}`); + system(`iw reg set ${config.country}`); + } + + set_default(config, 'rxantenna', 0xffffffff); + set_default(config, 'txantenna', 0xffffffff); + + if (config.txantenna == 'all') + config.txantenna = 0xffffffff; + if (config.rxantenna == 'all') + config.rxantenna = 0xffffffff; + + if (config.txantenna != data?.txantenna || config.rxantenna != data?.rxantenna) + reset_config(phy, config.radio); + + netifd.set_data({ + phy, + radio: config.radio, + txantenna: config.txantenna, + rxantenna: config.rxantenna + }); + + if (config.txpower) + config.txpower = 'fixed ' + config.txpower + '00'; + else + config.txpower = 'auto'; + + log(`Configuring '${phy}' txantenna: ${config.txantenna}, rxantenna: ${config.rxantenna} distance: ${config.distance}`); + system(`iw phy ${phy} set antenna ${config.txantenna} ${config.rxantenna}`); + system(`iw phy ${phy} set distance ${config.distance}`); + + if (config.frag) + system(`iw phy ${phy} set frag ${frag}`); + if (config.rts) + system(`iw phy ${phy} set rts ${rts}`); +} + +function iw_htmode(config) { + let suffix = substr(config.htmode, 3); + if (suffix == "40+" || suffix == "40-") + return "HT" + suffix; + + switch (config.htmode ?? "NONE") { + case "HT20": + case "VHT20": + case "HE20": + case "EHT20": + return "HT20"; + case "VHT80": + case "HE80": + case "EHT80": + case "HE160": + case "EHT160": + case "EHT320": + return "80MHZ"; + case "NONE": + case "NOHT": + return "NOHT"; + } + + if (substr(config.htmode, 2) == "40") { + switch (config.band) { + case "2g": + if (+config.channel < 7) + return "HT40+"; + else + return "HT40-"; + default: + return ((+config.channel / 4) % 2) ? "HT40+" : "HT40-"; + } + } + + return null; +} + +function config_add(config, name, val) { + if (val != null) + config[name] = val; +} + +function config_add_mesh_params(config, data) { + for (let param in mesh_param_list) + config_add(config, param, data[param]); +} + +function setup() { + let data = json(ARGV[3]); + + data.phy = find_phy(data.config); + if (!data.phy) { + log('Bug: PHY is undefined for device'); + netifd.set_retry(false); + return 1; + } + data.phy_suffix = phy_suffix(data.config.radio, ":"); + data.vif_phy_suffix = phy_suffix(data.config.radio, "."); + let active_ifnames = []; + + log('Starting'); + + validate('device', data.config); + setup_phy(data.phy, data.config, data.data); + + let supplicant_mesh; + let has_ap = false; + let idx = {}; + let supplicant_data = []; + let wdev_data = {}; + + for (let k, v in data.interfaces) { + let mode = v.config.mode; + idx[mode] ??= 0; + let mode_idx = idx[mode]++; + + if (!v.config.ifname) + v.config.ifname = data.phy + data.vif_phy_suffix + "-" + mode + mode_idx; + push(active_ifnames, v.config.ifname); + + if (v.config.encryption == 'owe' && v.config.owe_transition) { + mode_idx = idx[mode]++; + v.config.owe_transition_ifname = data.phy + data.vif_phy_suffix + "-" + mode + mode_idx; + push(active_ifnames, v.config.ifname); + } + + switch (mode) { + case 'ap': + has_ap = true; + // fallthrough + case 'sta': + case 'adhoc': + case 'mesh': + if (mode != "ap") + data.config.noscan = true; + validate('iface', v.config); + iface.prepare(v.config, data.phy + data.phy_suffix, data.config.num_global_macaddr); + netifd.set_vif(k, v.config.ifname); + break; + } + + switch (mode) { + case 'adhoc': + if (config.frequency && !v.config.wpa) + break; + // fallthrough + case 'mesh': + supplicant_mesh ??= !system("wpa_supplicant -vmesh"); + if (mode == "mesh" && !supplicant_mesh) + break; + // fallthrough + case 'sta': + let config = supplicant.generate(supplicant_data, data, v); + if (mode == "mesh") + config_add_mesh_params(config, v.config); + continue; + case 'monitor': + break; + default: + continue; + } + + // fallback to wdev setup + let config = { + mode, + ssid: v.config.ssid, + }; + + if (!v.config.default_macaddr) + config.macaddr = v.config.macaddr; + + config_add(config, "htmode", wdev_htmode(data.config)); + if (mode != "monitor") { + config_add(config, "basic-rates", supplicant.ratelist(data.config.basic_rate)); + config_add(config, "mcast-rate", supplicant.ratestr(v.config.mcast_rate)); + config_add(config, "beacon-interval", data.config.beacon_int); + if (mode == "mesh") { + config_add(config, "ssid", v.config.mesh_id); + config_add_mesh_params(config, v.config); + } + } + + wdev_data[v.config.ifname] = config; + } + + if (length(supplicant_data) > 0) + supplicant.setup(supplicant_data, data); + + if (has_ap) + hostapd.setup(data); + + system(`ucode /usr/share/hostap/wdev.uc ${data.phy}${data.phy_suffix} set_config '${printf("%J", wdev_data)}' ${join(' ', active_ifnames)}`); + + if (length(supplicant_data) > 0) + supplicant.start(data); + + netifd.set_up(); + + return 0 +} + +function teardown() { + let data = json(ARGV[3]); + + if (!data.data?.phy) { + log('Bug: PHY is undefined for device'); + return 1; + } + + log(`Tearing down ${data.data.phy}`); + + reset_config(data.data.phy, data.data.radio); + + return 0; +} + +let ret = 1; + +switch(ARGV[1]) { +case 'dump': + ret = dump_options(); + break; + +case 'setup': + ret = setup(); + break; + +case 'teardown': + ret = teardown(); + break; +} + +exit(ret); diff --git a/package/network/config/wifi-scripts/files-ucode/usr/share/schema/wireless.wifi-device.json b/package/network/config/wifi-scripts/files-ucode/usr/share/schema/wireless.wifi-device.json new file mode 100644 index 00000000000000..9a7e777b633a83 --- /dev/null +++ b/package/network/config/wifi-scripts/files-ucode/usr/share/schema/wireless.wifi-device.json @@ -0,0 +1,717 @@ +{ + "$id": "https://openwrt.org/wifi.device.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "description": "OpenWrt WiFi Device Schema", + "type": "object", + "properties": { + "acs_chan_bias": { + "description": "Can be used to increase (or decrease) the likelihood of a specific channel to be selected by the ACS algorithm", + "type": "string" + }, + "acs_exclude_dfs": { + "description": "Exclude DFS channels from ACS", + "type": "boolean", + "default": false + }, + "airtime_mode": { + "description": "Set the airtime policy operating mode", + "type": "number", + "default": 0, + "minimum": 0, + "maximum": 3 + }, + "antenna_gain": { + "description": "Reduction in antenna gain from regulatory maximum in dBi", + "type": "number", + "default": 0 + }, + "assoc_sa_query_max_timeout": { + "description": "Association SA Query maximum timeout", + "type": "number" + }, + "assoc_sa_query_retry_timeout": { + "description": "Association SA Query retry timeout", + "type": "number" + }, + "auth_cache": { + "type": "alias", + "default": "okc" + }, + "background_radar": { + "type": "alias", + "default": "enable_background_radar" + }, + "band": { + "description": "The wireless band thatthe radio shall operate on", + "type": "string", + "enum": [ + "2g", + "5g", + "6g", + "60g" + ] + }, + "basic_rate": { + "type": "alias", + "default": "basic_rates" + }, + "basic_rates": { + "description": "Set the supported basic rates. Each basic_rate is measured in kb/s. This option only has an effect on ap and adhoc wifi-ifaces. ", + "type": "array", + "items": { + "type": "number" + } + }, + "beacon_int": { + "description": "Set the beacon interval. This is the time interval between beacon frames, measured in units of 1.024 ms. hostapd permits this to be set between 15 and 65535. This option only has an effect on ap and adhoc wifi-ifaces", + "type": "number", + "default": 100, + "minimum": 15, + "maximum": 65535 + }, + "beacon_rate": { + "description": "Beacon frame TX rate configuration", + "type": "string" + }, + "beamformee_antennas": { + "description": "Beamformee antenna override", + "type": "number", + "default": 4 + }, + "beamformer_antennas": { + "description": "Beamformer antenna override", + "type": "number", + "default": 4 + }, + "bssid": { + "description": "Overrides the MAC address used for the Wi-Fi interface. Warning: if the MAC address specified is a multicast address, this override will fail silently. To avoid this problem, ensure that the mac address specified is a valid unicast mac address", + "type": "string" + }, + "cell_density": { + "description": "Configures data rates based on the coverage cell density. Normal configures basic rates to 6, 12, 24 Mbps if legacy_rates is 0, else to 5.5, 11 Mbps. High configures basic rates to 12, 24 Mbps if legacy_rates is 0, else to the 11 Mbps rate. Very High configures 24 Mbps as the basic rate. Supported rates lower than the minimum basic rate are not offered. The basic_rate and supported_rates options overrides this option. 0 = Disabled, 1 = Normal, 2 = High, 3 = Very High", + "type": "number", + "default": 0, + "minimum": 0, + "maximum": 3 + }, + "chanbw": { + "description": "Specifies a narrow channel width in MHz, possible values are: 5, 10, 20", + "type": "number", + "enum": [ 5, 10, 20 ] + }, + "channel": { + "description": "Specifies the wireless channel. “auto” defaults to the lowest available channel, or utilizes the ACS algorithm depending on hardware/driver support", + "type": "string" + }, + "channels": { + "type": "alias", + "default": "chanlist" + }, + "channel_list": { + "type": "alias", + "default": "chanlist" + }, + "chanlist": { + "description": "Use specific channels, when channel is in “auto” mode. This option allows hostapd to select one of the provided channels when a channel should be automatically selected. Channels can be provided as range using hyphen ('-') or individual channels can be specified by space (' ') separated values", + "type": "array", + "items": { + "type": "number" + } + }, + "country": { + "type": "alias", + "default": "country_code" + }, + "country3": { + "description": "The third octet of the Country String (dot11CountryString)", + "type": "string" + }, + "country_code": { + "description": "Specifies the country code, affects the available channels and transmission powers. For types mac80211 and broadcom a two letter country code is used (EN or DE). The madwifi driver expects a numeric code", + "type": "string" + }, + "country_ie": { + "type": "alias", + "default": "ieee80211d" + }, + "disabled": { + "description": "When set to 1, wireless network is disabled", + "type": "boolean", + "default": false + }, + "distance": { + "description": "Distance between the ap and the furthest client in meters", + "type": "number", + "default": 0 + }, + "doth": { + "type": "alias", + "default": "ieee80211h" + }, + "dsss_cck_40": { + "description": "DSSS/CCK Mode in 40 MHz allowed in Beacon, Measurement Pilot and Probe Response frames", + "type": "boolean", + "default": true + }, + "enable_background_radar": { + "description": "This feature allows CAC to be run on dedicated radio RF chains", + "type": "boolean" + }, + "frag": { + "description": "Fragmentation threshold", + "type": "number" + }, + "greenfield": { + "description": "Receive Greenfield - treats pre-80211n traffic as noise", + "type": "boolean", + "default": false + }, + "he_bss_color": { + "description": "BSS color to be announced", + "type": "number", + "minimum": 1, + "maximum": 128, + "default": 128 + }, + "he_bss_color_enabled": { + "description": "Enable BSS color", + "type": "boolean", + "default": true + }, + "he_default_pe_duration": { + "description": "The duration of PE field in an HE PPDU in us", + "type": "number", + "default": 4, + "enum": [ 4, 8, 12, 16 ] + }, + "he_mu_beamformer": { + "description": "HE multiple user beamformer support", + "type": "boolean", + "default": true + }, + "he_mu_edca_ac_be_aci": { + "type": "number", + "default": 0 + }, + "he_mu_edca_ac_be_aifsn": { + "type": "number", + "default": 8 + }, + "he_mu_edca_ac_be_ecwmax": { + "type": "number", + "default": 10 + }, + "he_mu_edca_ac_be_ecwmin": { + "type": "number", + "default": 9 + }, + "he_mu_edca_ac_be_timer": { + "type": "number", + "default": 255 + }, + "he_mu_edca_ac_bk_aci": { + "type": "number", + "default": 1 + }, + "he_mu_edca_ac_bk_aifsn": { + "type": "number", + "default": 15 + }, + "he_mu_edca_ac_bk_ecwmax": { + "type": "number", + "default": 10 + }, + "he_mu_edca_ac_bk_ecwmin": { + "type": "number", + "default": 9 + }, + "he_mu_edca_ac_bk_timer": { + "type": "number", + "default": 255 + }, + "he_mu_edca_ac_vi_aci": { + "type": "number", + "default": 2 + }, + "he_mu_edca_ac_vi_aifsn": { + "type": "number", + "default": 5 + }, + "he_mu_edca_ac_vi_ecwmax": { + "type": "number", + "default": 7 + }, + "he_mu_edca_ac_vi_ecwmin": { + "type": "number", + "default": 5 + }, + "he_mu_edca_ac_vi_timer": { + "type": "number", + "default": 255 + }, + "he_mu_edca_ac_vo_aci": { + "type": "number", + "default": 3 + }, + "he_mu_edca_ac_vo_aifsn": { + "type": "number", + "default": 5 + }, + "he_mu_edca_ac_vo_ecwmax": { + "type": "number", + "default": 7 + }, + "he_mu_edca_ac_vo_ecwmin": { + "type": "number", + "default": 5 + }, + "he_mu_edca_ac_vo_timer": { + "type": "number", + "default": 255 + }, + "he_mu_edca_qos_info_param_count": { + "type": "number", + "default": 0 + }, + "he_mu_edca_qos_info_q_ack": { + "type": "number", + "default": 0 + }, + "he_mu_edca_qos_info_queue_request": { + "type": "number", + "default": 0 + }, + "he_mu_edca_qos_info_txop_request": { + "type": "number", + "default": 0 + }, + "he_oper_centr_freq_seg0_idx": { + "description": "", + "type": "string" + }, + "he_oper_chwidth": { + "description": "", + "type": "string" + }, + "he_6ghz_reg_pwr_type": { + "description": "This config is to set the 6 GHz Access Point type.", + "type": "number", + "minimum": 0, + "maximum": 4, + "default": 0 + }, + "he_rts_threshold": { + "description": "Duration of STA transmission", + "type": "number", + "default": 1023 + }, + "he_spr_non_srg_obss_pd_max_offset": { + "description": "", + "type": "number" + }, + "he_spr_psr_enabled": { + "description": "", + "type": "boolean", + "default": false + }, + "he_spr_sr_control": { + "description": "", + "type": "number", + "default": 3 + }, + "he_su_beamformee": { + "description": "", + "type": "boolean", + "default": true + }, + "he_su_beamformer": { + "description": "", + "type": "boolean", + "default": true + }, + "he_twt_required": { + "description": "", + "type": "boolean", + "default": false + }, + "hostapd_options": { + "type": "array", + "items": { + "type": "string" + } + }, + "ht_coex": { + "description": "Disable honoring 40 MHz intolerance in coexistence flags of stations", + "type": "boolean", + "default": false + }, + "htc_vht": { + "description": "STA supports receiving a VHT variant HT Control field", + "type": "boolean", + "default": true + }, + "htmode": { + "description": "Specifies the high throughput mode", + "type": "string", + "enum": [ + "NOHT", "HT20", "HT40-", "HT40+", "HT40", + "VHT20", "VHT40", "VHT80", "VHT160", + "HE20", "HE40", "HE80", "HE160", + "EHT20", "EHT40", "EHT80", "EHT160", "EHT320" ] + }, + "hwmode": { + "type": "alias", + "default": "hw_mode" + }, + "hw_mode": { + "description": "Legacy way, use the band property instead", + "type": "string", + "enum": [ "11a", "11b", "11g", "11ad" ] + }, + "ieee80211d": { + "description": "Enables IEEE 802.11d country IE (information element) advertisement in beacon and probe response frames. This IE contains the country code and channel/power map. Requires country", + "type": "boolean", + "default": true + }, + "ieee80211h": { + "description": "This enables radar detection and DFS support", + "type": "boolean", + "default": true + }, + "ieee80211w": { + "description": "Whether management frame protection (MFP) is enabled", + "type": "number", + "minimum": 0, + "maximum": 2 + }, + "ieee80211w_max_timeout": { + "type": "alias", + "default": "assoc_sa_query_max_timeout" + }, + "ieee80211w_mgmt_cipher": { + "description": "Cypher used for MFP", + "type": "string" + }, + "ieee80211w_retry_timeout": { + "type": "alias", + "default": "assoc_sa_query_retry_timeout" + }, + "iface_max_num_sta": { + "description": "Limits the maximum allowed number of associated clients", + "type": "number" + }, + "ldpc": { + "description": " LDPC (Low-Density Parity-Check code) capability ", + "type": "boolean", + "default": true + }, + "legacy_rates": { + "description": "Allow legacy 802.11b data rates (used by cell_density)", + "type": "boolean", + "default": false + }, + "local_pwr_constraint": { + "description": "Add Power Constraint element to Beacon and Probe Response frame", + "type": "number", + "minimum": 0, + "maximum": 255 + }, + "log_80211": { + "description": "Enable IEEE 802.11 logging", + "type": "boolean", + "default": true + }, + "log_8021x": { + "description": "Enable IEEE 802.1X logging", + "type": "boolean", + "default": true + }, + "log_driver": { + "description": "Enable driver interface logging", + "type": "boolean", + "default": true + }, + "log_iapp": { + "description": "Enable iapp logging", + "type": "boolean", + "default": true + }, + "log_level": { + "description": "Log severity", + "type": "number", + "default": 2, + "minimum": 0, + "maximum": 4 + }, + "log_mlme": { + "description": "Enable MLME logging", + "type": "boolean", + "default": true + }, + "log_radius": { + "description": "Enable Radius logging", + "type": "boolean", + "default": true + }, + "log_wpa": { + "description": "Enable WPA logging", + "type": "boolean", + "default": true + }, + "logger_stdout": { + "description": "Log to stdout", + "type": "boolean", + "default": true + }, + "logger_stdout_level": { + "description": "Log severity", + "type": "number", + "default": 2, + "minimum": 0, + "maximum": 4 + }, + "logger_syslog": { + "description": "Log to syslog", + "type": "boolean", + "default": true + }, + "logger_syslog_level": { + "description": "Syslog severity", + "type": "number", + "default": 2, + "minimum": 0, + "maximum": 4 + }, + "macaddr": { + "type": "alias", + "default": "bssid" + }, + "max_amsdu": { + "description": "Maximum A-MSDU length of 7935 octects (3839 octets if option set to 0)", + "type": "boolean", + "default": true + }, + "maxassoc": { + "type": "alias", + "default": "iface_max_num_sta" + }, + "mbssid": { + "description": "Multiple BSSID Advertisement in IEEE 802.11ax IEEE Std 802.11ax-2021 added a feature where instead of multiple interfaces on a common radio transmitting individual Beacon frames, those interfaces can form a set with a common Beacon frame transmitted for all Set minimum permitted max TX power (in dBm) for ACS and DFS channel selection", + "type": "number", + "default": 0, + "minimum": 0, + "maximum": 2 + }, + "min_tx_power": { + "description": "Set minimum permitted max TX power (in dBm) for ACS and DFS channel selection", + "type": "number", + "default": 0 + }, + "mu_beamformee": { + "description": "Supports operation as an MU beamformee", + "type": "boolean", + "default": true + }, + "mu_beamformer": { + "description": " Supports operation as an MU beamformer", + "type": "boolean", + "default": true + }, + "multiple_bssid": { + "type": "alias", + "default": "mbssid" + }, + "num_global_macaddr": { + "description": "The number of MACs that this radio can use", + "type": "number", + "default": 1 + }, + "no_probe_resp_if_max_sta": { + "description": "Do not answer probe requests if iface_max_num_sta was reached", + "type": "boolean" + }, + "noscan": { + "description": "Do not scan for overlapping BSSs in HT40+/- mode.", + "type": "boolean", + "default": false + }, + "okc": { + "description": "Enable Opportunistic Key Caching", + "type": "boolean" + }, + "path": { + "description": "Alternative to phy used to identify the device based paths in /sys/devices", + "type": "string" + }, + "radio": { + "description": "Index of the phy radio (for multi-radio PHYs)", + "type": "number", + "default": -1 + }, + "reg_power_type": { + "type": "alias", + "default": "he_6ghz_reg_pwr_type" + }, + "require_mode": { + "description": "Sets the minimum client capability level mode that connecting clients must support to be allowed to connect", + "type": "string", + "enum": [ "ht", "ac", "ax" ] + }, + "rnr_beacon": { + "description": "", + "type": "string" + }, + "rsn_preauth": { + "description": "Enable IEEE 802.11i/RSN/WPA2 pre-authentication", + "type": "boolean" + }, + "rssi_ignore_probe_request": { + "description": "Ignore Probe Request frames if RSSI is below given threshold (in dBm)", + "type": "number", + "default": 0 + }, + "rssi_reject_assoc_rssi": { + "description": "Reject STA association if RSSI is below given threshold (in dBm)", + "type": "number", + "default": 0 + }, + "rts": { + "description": "Override the RTS/CTS threshold", + "type": "number" + }, + "rts_threshold": { + "description": "RTS/CTS threshold", + "type": "number", + "minimum": -1, + "maximum": 65535 + }, + "rx_antenna_pattern": { + "description": "Rx antenna pattern does not change during the lifetime of an association", + "type": "boolean", + "default": true + }, + "rx_stbc": { + "description": "Supports reception of PPDUs using STBC", + "type": "number", + "default": 3, + "minimum": 0, + "maximum": 4 + }, + "rxantenna": { + "description": "Specifies the antenna for receiving, the value may be driver specific, usually it is 1 for the first and 2 for the second antenna. Specifying 0 enables automatic selection by the driver if supported. This option has no effect if diversity is enabled", + "type": "number" + }, + "rxldpc": { + "description": "Supports receiving LDPC coded pkts", + "type": "boolean", + "default": true + }, + "short_gi_160": { + "description": "Short GI for 160 MHz", + "type": "boolean", + "default": true + }, + "short_gi_20": { + "description": "Short GI for 20 MHz", + "type": "boolean", + "default": true + }, + "short_gi_40": { + "description": "Short GI for 40 MHz", + "type": "boolean", + "default": true + }, + "short_gi_80": { + "description": "Short GI for 80 MHz", + "type": "boolean" + }, + "spectrum_mgmt_required": { + "description": "Set Spectrum Management subfield in the Capability Information field", + "type": "boolean", + "default": false + }, + "stationary_ap": { + "description": "Stationary AP config indicates that the AP doesn't move hence location data can be considered as always up to date.", + "type": "boolean", + "default": true + }, + "su_beamformee": { + "description": "Single user beamformee", + "type": "boolean", + "default": true + }, + "su_beamformer": { + "description": "Single user beamformer", + "type": "boolean", + "default": true + }, + "supported_rates": { + "description": "Set the supported data rates. Each supported rate is measured in kb/s. This option only has an effect on ap and adhoc wifi-ifaces. This must be a superset of the rates set in basic_rate. The minimum basic rate should also be the minimum supported rate. It is recommended to use the cell_density option instead", + "type": "array", + "items": { + "type": "number" + } + }, + "tx_antenna_pattern": { + "description": "Tx antenna pattern does not change during the lifetime of an association", + "type": "boolean", + "default": true + }, + "tx_burst": { + "type": "alias", + "default": "tx_queue_data2_burst" + }, + "tx_queue_data2_burst": { + "description": "", + "type": "number" + }, + "tx_stbc": { + "description": "Transmit STBC (Space-Time Block Coding)", + "type": "boolean", + "default": true + }, + "tx_stbc_2by1": { + "description": "Supports transmission of at least 2×1 STBC", + "type": "boolean", + "default": true + }, + "txantenna": { + "description": "Specifies the antenna for transmitting, values are identical to rxantenna", + "type": "number" + }, + "txpower": { + "description": "Specifies the maximum desired transmission power in dBm. The actual txpower used depends on regulatory requirements", + "type": "number" + }, + "vht160": { + "description": "Supported channel widths. 0 == 160MHz and 80+80 MHz not supported, 1 == 160 MHz supported, 2 == 160MHz and 80+80 MHz supported", + "type": "number", + "minimum": 0, + "maximum": 2, + "default": 2 + }, + "vht_link_adapt": { + "description": "TA supports link adaptation using VHT variant HT Control field", + "type": "number", + "minimum": 0, + "maximum": 3 + }, + "vht_max_a_mpdu_len_exp": { + "description": "Indicates the maximum length of A-MPDU pre-EOF padding that the STA can recv", + "type": "number", + "minimum": 0, + "maximum": 7 + }, + "vht_max_mpdu": { + "description": "Maximum MPDU length", + "type": "number", + "enum": [ 3895, 7991, 11454 ], + "default": 11454 + }, + "vht_txop_ps": { + "description": "VHT TXOP PS mode", + "type": "boolean", + "default": true + } + } +} diff --git a/package/network/config/wifi-scripts/files-ucode/usr/share/schema/wireless.wifi-iface.json b/package/network/config/wifi-scripts/files-ucode/usr/share/schema/wireless.wifi-iface.json new file mode 100644 index 00000000000000..3964098b5712dd --- /dev/null +++ b/package/network/config/wifi-scripts/files-ucode/usr/share/schema/wireless.wifi-iface.json @@ -0,0 +1,1157 @@ +{ + "$id": "https://openwrt.org/wifi.iface.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "description": "OpenWrt WiFi Interface Schema", + "type": "object", + "properties": { + "access_network_type": { + "description": "Interworking Access Network Type", + "type": "number", + "minimum": 0, + "maximum": 15 + }, + "acct_interval": { + "type": "alias", + "default": "radius_acct_interim_interval" + }, + "acct_port": { + "type": "alias", + "default": "acct_server_port" + }, + "acct_secret": { + "type": "alias", + "default": "acct_server_shared_secret" + }, + "acct_server": { + "type": "alias", + "default": "acct_server_addr" + }, + "acct_server_addr": { + "description": "RADIUS accounting server to handle client authentication", + "type": "array", + "items": { + "type": "string" + } + }, + "acct_server_port": { + "description": "RADIUS accounting port", + "type": "number", + "default": 1813 + }, + "acct_server_shared_secret": { + "description": "Shared accounting RADIUS secret", + "type": "string" + }, + "airtime_bss_limit": { + "description": "Whether the current BSS should be limited (when airtime_mode=3)", + "type": "boolean" + }, + "airtime_bss_weight": { + "description": "Per-BSS airtime weight. In multi-BSS mode, set for each BSS and hostapd will configure station weights to enforce the correct ratio between BSS weights depending on the number of active stations", + "type": "number" + }, + "airtime_sta_weight": { + "description": "Static configuration of station weights (when airtime_mode=1). Kernel default weight is 256", + "type": "array", + "items": { + "type": "string" + } + }, + "altsubject_match": { + "description": "Semicolon separated string of entries to be matched against the alternative subject name of the authentication server certificate", + "type": "array", + "items": { + "type": "string" + } + }, + "altsubject_match2": { + "type": "array" + }, + "anonymous_identity": { + "description": "Anonymous identity string for EAP", + "type": "string" + }, + "anqp_3gpp_cell_net": { + "description": "3GPP Cellular Network information", + "type": "array", + "items": { + "type": "string" + } + }, + "anqp_domain_id": { + "description": "An identifier for a set of APs in an ESS that share the same common ANQP information", + "type": "number", + "minimum": 0, + "maximum": 65535, + "default": 0 + }, + "ap_isolate": { + "description": "Isolates wireless clients from each other, only applicable in ap mode", + "type": "boolean", + "default": false + }, + "ap_max_inactivity": { + "description": "Station inactivity limit in seconds: If a station does not send anything in ap_max_inactivity seconds, an empty data frame is sent to it in order to verify whether it is still in range. If this frame is not ACKed, the station will be disassociated and then deauthenticated", + "type": "number" + }, + "ap_pin": { + "description": "Static access point PIN for WPS", + "type": "string" + }, + "ap_setup_locked": { + "description": "AP can be configured into a locked state where new WPS Registrar are not accepted", + "type": "boolean" + }, + "anqp_elem": { + "description": "Arbitrary ANQP-element configuration", + "type": "array", + "items": { + "type": "string" + } + }, + "asra": { + "description": "Additional Step Required for Access", + "type": "boolean", + "default": false + }, + "assoc_sa_query_max_timeout": { + "description": "Specifies the 802.11w Association SA Query maximum timeout.", + "type": "number", + "minimum": 1, + "maximum": 4294967295 + }, + "assoc_sa_query_retry_timeout": { + "description": "Association SA Query retry timeout", + "type": "number", + "minimum": 1, + "maximum": 4294967295 + }, + "auth": { + "description": "Defines the phase 2 (inner) authentication method, only applicable if eap_type is peap or ttl", + "type": "string" + }, + "auth_cache": { + "type": "alias", + "default": "okc" + }, + "auth_port": { + "type": "alias", + "default": "auth_server_port" + }, + "auth_secret": { + "type": "alias", + "default": "auth_server_shared_secret" + }, + "auth_server": { + "type": "alias", + "default": "auth_server_addr" + }, + "auth_server_addr": { + "description": "RADIUS authentication server to handle client authentication", + "type": "array", + "items": { + "type": "string" + } + }, + "auth_server_port": { + "description": "RADIUS authentication port", + "type": "number", + "default": 1812 + }, + "auth_server_shared_secret": { + "description": "Shared authentication RADIUS secret", + "type": "string" + }, + "basic_rate": { + "type": "array" + }, + "bss_load_update_period": { + "description": "BSS Load update period (in BUs)", + "type": "number", + "default": 60 + }, + "bss_transition": { + "description": "BSS Transition Management", + "type": "boolean" + }, + "bssid": { + "description": "Override the BSSID of the network", + "type": "string" + }, + "bssid_blacklist": { + "type": "array" + }, + "bssid_whitelist": { + "type": "array" + }, + "ca_cert": { + "description": "Specifies the path the CA certificate used for authentication", + "type": "string" + }, + "ca_cert2_usesystem": { + "type": "boolean" + }, + "ca_cert_usesystem": { + "type": "boolean" + }, + "chan_util_avg_period": { + "description": "Channel utilization averaging period (in BUs)", + "type": "number", + "default": 600 + }, + "civic": { + "description": "The content of a location civic measurement subelement", + "type": "string" + }, + "client_cert": { + "description": "File path to client certificate file (PEM/DER)", + "type": "string" + }, + "dae_client": { + "type": "alias", + "default": "radius_das_client" + }, + "dae_port": { + "type": "alias", + "default": "radius_das_port" + }, + "dae_secret": { + "type": "alias", + "default": "radius_das_secret" + }, + "default_disabled": { + "type": "alias", + "default": "disabled" + }, + "device_name": { + "description": "Primary Device Name used by WPS", + "type": "string", + "default": "OpenWrt AP" + }, + "device_type": { + "description": "Primary Device Type used by WPS", + "type": "string", + "default": "6-0050F204-1" + }, + "disabled": { + "description": "Do not bring the interface up automatically", + "type": "boolean" + }, + "disable_dgaf": { + "description": "Disable Downstream Group-Addressed Forwarding", + "type": "boolean", + "default": false + }, + "disassoc_low_ack": { + "description": "Disassociate stations based on excessive transmission failures or other indications of connection loss. This depends on the driver capabilities and may not be available with all drivers.", + "type": "boolean", + "default": true + }, + "domain_match": { + "type": "array", + "items": { + "type": "string" + } + }, + "domain_match2": { + "type": "array" + }, + "domain_name" : { + "type": "array", + "items": { + "type": "string" + } + }, + "domain_suffix_match": { + "type": "array", + "items": { + "type": "string" + } + }, + "domain_suffix_match2": { + "type": "array" + }, + "dtim_period": { + "description": "Set the DTIM (delivery traffic information message) period. There will be one DTIM per this many beacon frames. This may be set between 1 and 255. This option only has an effect on ap wifi-ifaces.", + "type": "number", + "default": 2, + "minimum": 1, + "maximum": 255 + }, + "dynamic_ownip": { + "type": "alias", + "default": "dynamic_own_ip_addr" + }, + "dynamic_own_ip_addr": { + "type": "boolean" + }, + "dynamic_vlan": { + "description": "Allow RADIUS authentication server to decide which VLAN is used for the stations", + "type": "boolean" + }, + "eap_reauth_period": { + "description": "EAP reauthentication period in seconds", + "type": "number" + }, + "eap_server": { + "description": "Use integrated EAP server instead of external RADIUS authentication server", + "type": "boolean" + }, + "eap_type": { + "type": "string" + }, + "eap_user_file": { + "description": "Path for EAP server user database", + "type": "string" + }, + "eapol_version": { + "description": "IEEE 802.1X/EAPOL version", + "type": "number", + "enum": [ 1, 2 ] + }, + "enable": { + "description": "Enable the interface", + "type": "boolean", + "default": true + }, + "encryption": { + "type": "string" + }, + "esr": { + "description": "Emergency services reachable", + "type": "boolean", + "default": false + }, + "ext_registrar": { + "description": "WPS UPnP interface", + "type": "boolean" + }, + "fils": { + "description": "Enable FILS", + "type": "boolean" + }, + "fils_dhcp": { + "description": "DHCP server for FILS HLP. Set to '*' for automatic lookup.", + "type": "string" + }, + "ft_over_ds": { + "description": "Whether to enable FT-over-DS", + "type": "boolean", + "default": false + }, + "ft_psk_generate_local": { + "description": "Whether to generate FT response locally for PSK networks. This avoids use of PMK-R1 push/pull from other APs with FT-PSK networks as the required information (PSK and other session data) is already locally available.", + "type": "boolean" + }, + "ftm_responder": { + "description": "Publish fine timing measurement (FTM) responder functionality", + "type": "boolean" + }, + "gas_address3": { + "type": "string" + }, + "hidden": { + "type": "alias", + "default": "ignore_broadcast_ssid" + }, + "hessid": { + "description": "Homogeneous ESS identifier", + "type": "string" + }, + "hostapd_bss_options": { + "description": "Additional raw options to be added", + "type": "array", + "items": { + "type": "string" + } + }, + "hs20": { + "description": "Enable Hotspot 2.0 support", + "type": "boolean" + }, + "hs20_conn_capab": { + "description": "Connection Capability", + "type": "array", + "items": { + "type": "string" + } + }, + "hs20_deauth_req_timeout": { + "description": "Deauthentication request timeout", + "type": "number", + "default": 60 + }, + "hs20_oper_friendly_name": { + "description": "Operator Friendly Name", + "type": "array", + "items": { + "type": "string" + } + }, + "hs20_operating_class": { + "description": "Operating Class Indication", + "type": "string" + }, + "hs20_t_c_filename": { + "description": "Terms and Conditions information", + "type": "string" + }, + "hs20_t_c_server_url": { + "description": "Terms and Conditions server", + "type": "string" + }, + "hs20_t_c_timestamp": { + "description": "Terms and Conditions timestamp", + "type": "string" + }, + "hs20_wan_metrics": { + "description": "WAN Metrics", + "type": "string" + }, + "identity": { + "description": "Identity string for EAP", + "type": "string" + }, + "ieee80211k": { + "description": "Enables Radio Resource Measurement (802.11k) support", + "type": "boolean", + "default": true + }, + "ieee80211r": { + "description": "Enables fast BSS transition (802.11r) support.", + "type": "boolean" + }, + "ieee80211w": { + "description": "Enables MFP (802.11w) support (0 = disabled, 1 = optional, 2 = required). Requires the 'full' version of wpad/hostapd and support from the Wi-Fi driver", + "type": "number", + "enum": [ 0, 1, 2 ], + "default": 0 + }, + "ieee80211w_max_timeout": { + "type": "alias", + "default": "assoc_sa_query_max_timeout" + }, + "ieee80211w_mgmt_cipher": { + "description": "Group Management cypher", + "type": "string" + }, + "ieee80211w_retry_timeout": { + "type": "alias", + "default": "assoc_sa_query_retry_timeout" + }, + "ifname": { + "description": "Specifies a custom name for the Wi-Fi interface, which is otherwise automatically named. Maximum length: 15 characters", + "type": "string" + }, + "ignore_broadcast_ssid": { + "description": "Disables the broadcasting of beacon frames if set to 1 and, in doing so, hides the ESSID. Where the ESSID is hidden, clients may fail to roam and airtime efficiency may be significantly reduced.", + "type": "boolean", + "default": false + }, + "internet": { + "description": "Whether the network provides connectivity to the Internet", + "type": "boolean", + "default": true + }, + "isolate": { + "type": "alias", + "default": "ap_isolate" + }, + + "iw_access_network_type": { + "type": "alias", + "default": "access_network_type" + }, + "iw_anqp_3gpp_cell_net": { + "type": "alias", + "default": "anqp_3gpp_cell_net" + }, + "iw_anqp_elem": { + "type": "alias", + "default": "anqp_elem" + }, + "iw_asra": { + "type": "alias", + "default": "asra" + }, + "iw_domain_name": { + "type": "alias", + "default": "domain_name" + }, + "iw_enabled": { + "type": "boolean", + "default": false + }, + "iw_esr": { + "type": "alias", + "default": "esr" + }, + "iw_gas_address3": { + "type": "alias", + "default": "gas_address3" + }, + "iw_hessid": { + "type": "alias", + "default": "hessid" + }, + "iw_internet": { + "type": "alias", + "default": "internet" + }, + "iw_ipaddr_type_availability": { + "type": "number" + }, + "iw_nai_realm": { + "type": "alias", + "default": "nai_realm" + }, + "iw_network_auth_type": { + "type": "alias", + "default": "network_auth_type" + }, + "iw_qos_map_set": { + "type": "alias", + "default": "qos_map_set" + }, + "roaming_consortium": { + "type": "alias", + "default": "roaming_consortium" + }, + "iw_uesa": { + "type": "alias", + "default": "uesa" + }, + "iw_venue_group": { + "type": "alias", + "default": "venue_group" + }, + "iw_venue_name": { + "type": "alias", + "default": "venue_name" + }, + "iw_venue_type": { + "type": "alias", + "default": "venue_type" + }, + "iw_venue_url": { + "type": "alias", + "default": "venue_url" + }, + "key": { + "description": "Encryption key", + "type": "string" + }, + "lci": { + "description": "The content of a LCI measurement subelement", + "type": "string" + }, + "macaddr": { + "description": "Override the BSSID of the network", + "type": "string" + }, + "macfile": { + "description": "File containing a list MACs used by the macfilter", + "type": "string" + }, + "macfilter": { + "description": "Allow/deny associations based on the clients MAC", + "type": "string", + "enum": [ "allow", "deny" ] + }, + "maclist": { + "description": "List of MACs used by the macfilter option", + "type": "array", + "items": { + "type": "string" + } + }, + "manufacturer": { + "description": "Manufacturer used by WPS", + "type": "string", + "default": "www.openwrt.org" + }, + "max_inactivity": { + "type": "alias", + "default": "ap_max_inactivity" + }, + "max_listen_int": { + "type": "alias", + "default": "max_listen_interval" + }, + "max_listen_interval": { + "description": "How many Beacon periods STAs are allowed to remain asleep", + "type": "number" + }, + "max_num_sta": { + "description": "Maximum number of stations allowed in station table", + "type": "number" + }, + "maxassoc": { + "type": "alias", + "default": "max_num_sta" + }, + "mbo": { + "description": "Multiband Operation", + "type": "boolean" + }, + "mcast_rate": { + "description": "Allowed multicast rates", + "type": "array", + "items": { + "type": "number" + } + }, + "mesh_auto_open_plinks": { + "type": "boolean" + }, + "mesh_awake_window": { + "type": "number" + }, + "mesh_confirm_timeout": { + "type": "number" + }, + "mesh_element_ttl": { + "type": "number" + }, + "mesh_fwding": { + "description": "Enable 802.11s layer-2 routing and forwarding", + "type": "boolean" + }, + "mesh_gate_announcements": { + "type": "number" + }, + "mesh_holding_timeout": { + "type": "number" + }, + "mesh_hwmp_active_path_timeout": { + "type": "number" + }, + "mesh_hwmp_active_path_to_root_timeout": { + "type": "number" + }, + "mesh_hwmp_confirmation_interval": { + "type": "number" + }, + "mesh_hwmp_max_preq_retries": { + "type": "number" + }, + "mesh_hwmp_net_diameter_traversal_time": { + "type": "number" + }, + "mesh_hwmp_preq_min_interval": { + "type": "number" + }, + "mesh_hwmp_rann_interval": { + "type": "number" + }, + "mesh_hwmp_root_interval": { + "type": "number" + }, + "mesh_hwmp_rootmode": { + "type": "number" + }, + "mesh_id": { + "type": "string" + }, + "mesh_max_peer_links": { + "type": "number" + }, + "mesh_max_retries": { + "type": "number" + }, + "mesh_min_discovery_timeout": { + "type": "number" + }, + "mesh_path_refresh_time": { + "type": "number" + }, + "mesh_plink_timeout": { + "type": "number" + }, + "mesh_power_mode": { + "type": "string" + }, + "mesh_retry_timeout": { + "type": "number" + }, + "mesh_rssi_threshold": { + "type": "number" + }, + "mesh_sync_offset_max_neighor": { + "type": "number" + }, + "mesh_ttl": { + "type": "number" + }, + "mobility_domain": { + "description": "DID is used to indicate a group of APs between which a STA can use Fast BSS Transition.", + "type": "string" + }, + "mode": { + "type": "string" + }, + "multi_ap": { + "description": "Enable Multi-AP functionality", + "type": "number" + }, + "multi_ap_backhaul_key": { + "type": "string" + }, + "multi_ap_backhaul_ssid": { + "description": "Multi-AP backhaul BSS SSID", + "type": "string" + }, + "multicast_to_unicast": { + "description": "Request that the AP will do multicast-to-unicast conversion for ARP, IPv4, and IPv6 frames ", + "type": "boolean" + }, + "multicast_to_unicast_all": { + "type": "alias", + "default": "multicast_to_unicast" + }, + "nas_identifier": { + "description": "NAS-Identifier string for RADIUS messages", + "type": "string" + }, + "nai_realm": { + "description": "NAI Realm information", + "type": "array", + "items": { + "type": "string" + } + }, + "nasid": { + "type": "alias", + "default": "nas_identifier" + }, + "network_auth_type": { + "description": "Network Authentication Type", + "type": "string" + }, + "ocv": { + "description": "Operating Channel Validation", + "type": "number", + "minimum": 0, + "maximum": 15 + }, + "okc": { + "description": "PMKSA and Opportunistic Key Caching", + "type": "boolean" + }, + "operator_icon": { + "type": "array" + }, + "osen": { + "description": "OSU Server-Only Authenticated L2 Encryption Network", + "type": "boolean", + "default": false + }, + "osu_provider": { + "type": "array", + "items": { + "type": "string" + } + }, + "osu_ssid": { + "type": "string" + }, + "owe_transition": { + "description": "Indicate that an OWE BSS shall automatically add an unencrypted transition interface", + "type": "boolean" + }, + "owe_transition_bssid": { + "description": "Pointer to the matching open/OWE BSS", + "type": "string" + }, + "owe_transition_ifname": { + "description": "Alternatively, OWE transition mode BSSID/SSID can be configured with a reference to a BSS operated by this hostapd process.", + "type": "string" + }, + "owe_transition_ssid": { + "description": "The SSID used by the OWE transition device", + "type": "string" + }, + "ownip": { + "type": "alias", + "default": "own_ip_addr" + }, + "own_ip_addr": { + "description": "The own IP address of the access point", + "type": "string" + }, + "password:wpakey": { + "type": "string" + }, + "pbc_in_m1": { + "description": "WPS capability discovery workaround for PBC with Windows 7", + "type": "boolean" + }, + "per_sta_vif": { + "description": "Per-Station AP_VLAN interface mode", + "type": "boolean" + }, + "pmk_r1_push": { + "description": "Whether PMK-R1 push is enabled at R0KH", + "type": "boolean", + "default": false + }, + "port:port": { + "type": "number" + }, + "powersave": { + "type": "boolean" + }, + "ppsk": { + "description": "Lookup PSK2 Keys up via a Radius server", + "type": "boolean" + }, + "preamble": { + "description": "Short Preamble", + "type": "boolean", + "default": true + }, + "priv_key": { + "type": "string" + }, + "priv_key_pwd": { + "type": "string" + }, + "private_key": { + "description": "Private key matching with the server certificate for EAP-TLS/PEAP/TTLS", + "type": "string" + }, + "private_key_passwd": { + "description": "Passphrase for private key", + "type": "string" + }, + "proxy_arp": { + "description": "Proxy ARP", + "type": "boolean" + }, + "qos_map_set": { + "description": "QoS Map Set configuration", + "type": "string", + "default": "0,0,2,16,1,1,255,255,18,22,24,38,40,40,44,46,48,56" + }, + "r0_key_lifetime": { + "description": "Default lifetime of the PMK-R0 in seconds", + "type": "number" + }, + "r0kh": { + "description": "List of R0KHs in the same Mobility Domain", + "type": "array", + "items": { + "type": "string" + } + }, + "r1_key_holder": { + "description": "PMK-R1 Key Holder identifier", + "type": "string" + }, + "r1kh": { + "description": "List of R1KHs in the same Mobility Domain", + "type": "array", + "items": { + "type": "string" + } + }, + "radius_acct_interim_interval": { + "description": "Interim accounting update interval", + "type": "number" + }, + "radius_acct_req_attr": { + "description": "Additional Accounting-Request attributes", + "type": "array", + "items": { + "type": "string" + } + }, + "radius_auth_req_attr": { + "description": "Additional Access-Request attributes", + "type": "array", + "items": { + "type": "string" + } + }, + "radius_client_addr": { + "description": "RADIUS client forced local IP address for the access point", + "type": "string" + }, + "radius_das_client": { + "description": "DAS client (the host that can send Disconnect/CoA requests)", + "type": "string" + }, + "radius_das_port": { + "description": "Dynamic Authorization Extensions port", + "type": "number" + }, + "radius_das_secret": { + "description": "Dynamic Authorization Extensions secret", + "type": "string" + }, + "radius_request_cui" :{ + "description": "Request Chargeable-User-Identity (RFC 4372)", + "type": "boolean" + }, + "reassociation_deadline": { + "description": "Reassociation deadline in time units", + "type": "number", + "minimum": 1000, + "maximum": 65535, + "default": 1000 + }, + "request_cui": { + "type": "alias", + "default": "radius_request_cui" + }, + "rrm_beacon_report": { + "description": "Enable beacon report via radio measurements", + "type": "boolean", + "default": true + }, + "rrm_neighbor_report": { + "description": "Enable neighbor report via radio measurements", + "type": "boolean", + "default": true + }, + "rnr": { + "description": "Enable reduced neighbor reporting", + "type": "boolean", + "default": true + }, + "roaming_consortium": { + "description": "Roaming Consortium List", + "type": "array", + "items": { + "type": "string" + } + }, + "rsn_preauth": { + "type": "boolean" + }, + "sae_pwe": { + "description": "SAE mechanism for PWE derivation", + "type": "number", + "enum": [ 0, 1, 2 ] + }, + "sae_require_mfp": { + "description": "Require MFP for all associations using SAE", + "type": "boolean" + }, + "server:host": { + "type": "string" + }, + "server_cert": { + "description": "Server certificate (PEM or DER file) for EAP-TLS/PEAP/TTLS", + "type": "string" + }, + "server_id": { + "description": "Server identity", + "type": "string" + }, + "short_preamble": { + "type": "alias", + "default": "preamble" + }, + "skip_inactivity_poll": { + "description": "The inactivity polling can be disabled to disconnect stations based on inactivity timeout so that idle stations are more likely to be disconnected even if they are still in range of the AP", + "type": "boolean", + "default": false + }, + "ssid": { + "type": "string" + }, + "ssid:string": { + "type": "string" + }, + "start_disabled": { + "type": "number" + }, + "subject_match": { + "description": "Substring to be matched against the subject of the authentication server certificate", + "type": "string" + }, + "subject_match2": { + "type": "string" + }, + "supported_rates": { + "type": "array" + }, + "tdls_prohibit": { + "description": "Prohibit use of TDLS in this BSS", + "type": "boolean" + }, + "time_advertisement": { + "description": "Time advertisement", + "type": "number", + "enum": [ 0, 2 ] + }, + "time_zone": { + "description": "Local time zone as specified in 8.3 of IEEE Std 1003.1-2004", + "type": "string" + }, + "uapsd": { + "type": "alias", + "default": "uapsd_advertisement_enabled" + }, + "uapsd_advertisement_enabled": { + "description": "WMM-PS Unscheduled Automatic Power Save Delivery [U-APSD]", + "type": "boolean", + "default": true + }, + "uesa": { + "description": "Unauthenticated emergency service accessible", + "type": "boolean", + "default": false + }, + "utf8_ssid": { + "description": "Whether the SSID is to be interpreted using UTF-8 encoding", + "type": "boolean", + "default": true + }, + "vendor_elements": { + "description": "Additional vendor specific elements for Beacon and Probe Response frames", + "type": "array", + "items": { + "type": "string" + } + }, + "venue_group": { + "type": "string" + }, + "venue_name": { + "description": "Venue Name information", + "type": "array", + "items": { + "type": "string" + } + }, + "venue_type": { + "type": "string" + }, + "venue_url": { + "description": "Venue URL information", + "type": "array", + "items": { + "type": "string" + } + }, + "vlan_bridge": { + "description": "Bridge (prefix) to add the wifi and the tagged interface to.", + "type": "string" + }, + "vlan_file": { + "type": "string" + }, + "vlan_naming": { + "description": "When hostapd creates a VLAN interface on vlan_tagged_interfaces, it needs to know how to name it.", + "type": "boolean", + "default": true + }, + "vlan_no_bridge": { + "description": "To not setup a bridge for dynamic vlans", + "type": "boolean" + }, + "vlan_tagged_interface": { + "type": "string" + }, + "wds": { + "type": "boolean" + }, + "wds_bridge": { + "description": "If bridge parameter is set, the WDS STA interface will be added to the same bridge by default", + "type": "string" + }, + "wds_sta": { + "description": "If bridge parameter is set, the WDS STA interface will be added to the same bridge by default", + "type": "boolean" + }, + "wmm": { + "type": "alias", + "default": "wmm_enabled" + }, + "wmm_enabled": { + "description": "Default WMM parameters (IEEE 802.11 draft; 11-03-0504-03-000e)", + "type": "boolean", + "default": true + }, + "wnm_sleep_mode": { + "description": "WNM-Sleep Mode (extended sleep mode for stations)", + "type": "boolean" + }, + "wnm_sleep_mode_no_keys": { + "description": "WNM-Sleep Mode GTK/IGTK workaround", + "type": "boolean" + }, + "wpa_disable_eapol_key_retries": { + "description": "Workaround for key reinstallation attacks", + "type": "boolean", + "default": false + }, + "wpa_gmk_rekey": { + "description": "Time interval for rekeying GMK (master key used internally to generate GTKs)", + "type": "number" + }, + "wpa_group_rekey": { + "description": "Time interval for rekeying GTK (broadcast/multicast encryption keys)", + "type": "number" + }, + "wpa_master_rekey": { + "type": "alias", + "default": "wpa_gmk_rekey" + }, + "wpa_pair_rekey": { + "type": "alias", + "default": "wpa_ptk_rekey" + }, + "wpa_psk_file": { + "description": "External file conatining VLAN PSK MAC address triplets", + "type": "string" + }, + "wpa_ptk_rekey": { + "description": "Maximum lifetime for PTK in seconds", + "type": "number" + }, + "wpa_strict_rekey": { + "description": "Rekey GTK when any STA that possesses the current GTK is leaving the BSS", + "type": "boolean" + }, + "wps_ap_setup_locked": { + "type": "alias", + "default": "ap_setup_locked" + }, + "wps_device_name": { + "type": "alias", + "default": "device_name" + }, + "wps_device_type": { + "type": "alias", + "default": "device_type" + }, + "wps_independent": { + "description": "Whether to manage this interface independently from other WPS interfaces", + "type": "number", + "default": true + }, + "wps_label": { + "description": "Support WPS labels", + "type": "boolean" + }, + "wps_manufacturer": { + "type": "alias", + "default": "manufacturer" + }, + "wps_pbc_in_m1": { + "type": "alias", + "default": "pbc_in_m1" + }, + "wps_pin": { + "type": "alias", + "default": "ap_pin" + }, + "wps_pushbutton": { + "description": "Support WPS pushbutton", + "type": "boolean" + } + } +} diff --git a/package/network/config/wifi-scripts/files-ucode/usr/share/schema/wireless.wifi-station.json b/package/network/config/wifi-scripts/files-ucode/usr/share/schema/wireless.wifi-station.json new file mode 100644 index 00000000000000..dbad47abf4b0a7 --- /dev/null +++ b/package/network/config/wifi-scripts/files-ucode/usr/share/schema/wireless.wifi-station.json @@ -0,0 +1,20 @@ +{ + "$id": "https://openwrt.org/wifi.station.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "description": "OpenWrt WiFi Station Schema", + "type": "object", + "properties": { + "mac": { + "description": "The stations MAC", + "type": "string" + }, + "key": { + "description": "The passphrase that shall be used", + "type": "string" + }, + "vid": { + "description": "The VLAN Id used by the station", + "type": "string" + } + } +} diff --git a/package/network/config/wifi-scripts/files-ucode/usr/share/schema/wireless.wifi-vlan.json b/package/network/config/wifi-scripts/files-ucode/usr/share/schema/wireless.wifi-vlan.json new file mode 100644 index 00000000000000..a06c8dabf0b78a --- /dev/null +++ b/package/network/config/wifi-scripts/files-ucode/usr/share/schema/wireless.wifi-vlan.json @@ -0,0 +1,16 @@ +{ + "$id": "https://openwrt.org/wifi.vlan.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "description": "OpenWrt WiFi VLAN Schema", + "type": "object", + "properties": { + "name": { + "description": "VLAN name", + "type": "string" + }, + "vid": { + "description": "VLAN ID", + "type": "string" + } + } +} diff --git a/package/network/config/wifi-scripts/files-ucode/usr/share/ucode/wifi/ap.uc b/package/network/config/wifi-scripts/files-ucode/usr/share/ucode/wifi/ap.uc new file mode 100644 index 00000000000000..cc2900de9da7ea --- /dev/null +++ b/package/network/config/wifi-scripts/files-ucode/usr/share/ucode/wifi/ap.uc @@ -0,0 +1,480 @@ +'use strict'; + +import * as libuci from 'uci'; +import * as fs from 'fs'; + +import { append, append_raw, append_value, append_vars, comment, push_config, set_default, touch_file } from 'wifi.common'; +import * as netifd from 'wifi.netifd'; +import * as iface from 'wifi.iface'; + +function iface_setup(config) { + switch(config.fixup) { + case 'owe': + config.ignore_broadcast_ssid = true; + config.ssid = config.ssid + 'OWE'; + break; + + case 'owe-transition': + let ifname = config.ifname; + config.ifname = config.owe_transition_ifname; + config.owe_transition_ifname = ifname; + config.owe_transition_ssid = config.ssid + 'OWE'; + config.encryption = 'none'; + config.ignore_broadcast_ssid = false; + iface.prepare(config); + break; + } + + comment('Setup interface: ' + config.ifname); + + config.bridge = config.network_bridge; + config.snoop_iface = config.network_ifname; + if (!config.wds) + config.wds_bridge = null; + else + config.wds_sta = true; + + if (!config.idx) + append('interface', config.ifname); + else + append('bss', config.ifname); + + if (config.multicast_to_unicast || config.proxy_arp) + config.ap_isolate = 1; + + append('bssid', config.macaddr); + +append_vars(config, [ + 'ctrl_interface', 'ap_isolate', 'max_num_sta', 'ap_max_inactivity', 'airtime_bss_weight', + 'airtime_bss_limit', 'airtime_sta_weight', 'bss_load_update_period', 'chan_util_avg_period', + 'disassoc_low_ack', 'skip_inactivity_poll', 'ignore_broadcast_ssid', 'uapsd_advertisement_enabled', + 'utf8_ssid', 'multi_ap', 'ssid', 'tdls_prohibit', 'bridge', 'wds_sta', 'wds_bridge', + 'snoop_iface', 'vendor_elements', 'nas_identifier', 'radius_acct_interim_interval', + 'ocv', 'multicast_to_unicast', 'preamble', 'wmm_enabled', 'proxy_arp', 'per_sta_vif', 'mbo', + 'bss_transition', 'wnm_sleep_mode', 'wnm_sleep_mode_no_keys', 'qos_map_set', 'max_listen_int', + 'dtim_period', + ]); +} + +function iface_authentication_server(config) { + for (let server in config.auth_server_addr) { + append('auth_server_addr', server); + append_vars(config, [ 'auth_server_port', 'auth_server_shared_secret' ]); + } + + append_vars(config, [ 'radius_auth_req_attr' ]); +} + +function iface_accounting_server(config) { + for (let server in config.acct_server_addr) { + append('acct_server_addr', server); + append_vars(config, [ 'acct_server_port', 'acct_server_shared_secret' ]); + } + + append_vars(config, [ 'radius_acct_req_attr' ]); +} + +function iface_auth_type(config) { + iface.parse_encryption(config); + + if (config.auth_type in [ 'sae', 'owe', 'eap2', 'eap192' ]) { + config.ieee80211w = 2; + config.sae_require_mfp = 1; + config.sae_pwe = 2; + } + + if (config.auth_type in [ 'psk-sae', 'eap-eap2' ]) { + config.ieee80211w = 1; + config.sae_require_mfp = 1; + config.sae_pwe = 2; + } + + if (config.own_ip_addr) + config.dynamic_own_ip_addr = null; + + if (!config.wpa) + config.wpa_disable_eapol_key_retries = null; + + switch(config.auth_type) { + case 'none': + case 'owe': + config.wps_possible = 1; + config.wps_state = 1; + + if (config.owe_transition_ssid) + config.owe_transition_ssid = `"${config.owe_transition_ssid}"`; + + append_vars(config, [ + 'owe_transition_ssid', 'owe_transition_bssid', 'owe_transition_ifname', + ]); + break; + + case 'psk': + case 'psk2': + case 'sae': + case 'psk-sae': + config.vlan_possible = 1; + config.wps_possible = 1; + + if (config.auth_type == 'psk' && config.ppsk) { + iface_authentication_server(config); + config.macaddr_acl = 2; + config.wpa_psk_radius = 2; + } else if (length(config.key) == 64) { + config.wpa_psk = key; + } else if (length(config.key) >= 8) { + config.wpa_passphrase = config.key; + } else if (!config.wpa_psk_file) { + netifd.setup_failed('INVALID_WPA_PSK'); + } + + set_default(config, 'wpa_psk_file', `/var/run/hostapd-${config.ifname}.psk`); + touch_file(config.wpa_psk_file); + set_default(config, 'dynamic_vlan', 0); + break; + + case 'eap': + case 'eap2': + case 'eap-eap2': + case 'eap192': + config.vlan_possible = 1; + + if (config.fils) { + set_default(config, 'erp_domain', substr(digest.md5(config.ssid), 0, 4)); + set_default(config, 'fils_realm', config.erp_domain); + set_default(config, 'erp_send_reauth_start', 1); + set_default(config, 'fils_cache_id', substr(digest.md5(config.fils_realm), 0, 4)); + } + + if (!config.eap_server) { + iface_authentication_server(config); + iface_accounting_server(config); + } + + if (config.radius_das_client && config.radius_das_secret) { + set_default(config, 'radius_das_port', 3799); + set_default(config, 'radius_das_client', `${config.radius_das_client} ${config.radius_das_secret}`); + } + + set_default(config, 'eapol_version', config.wpa & 1); + if (!config.eapol_version) + config.eapol_version = null; + append('eapol_key_index_workaround', '1'); + append('ieee8021x', '1'); + + break; + } + + append_vars(config, [ + 'sae_require_mfp', 'sae_pwe', 'time_advertisement', 'time_zone', + 'wpa_group_rekey', 'wpa_ptk_rekey', 'wpa_gmk_rekey', 'wpa_strict_rekey', + 'macaddr_acl', 'wpa_psk_radius', 'wpa_psk', 'wpa_passphrase', 'wpa_psk_file', + 'eapol_version', 'dynamic_vlan', 'radius_request_cui', 'eap_reauth_period', + 'radius_das_client', 'radius_das_port', 'own_ip_addr', 'dynamic_own_ip_addr', + 'wpa_disable_eapol_key_retries', 'auth_algs', 'wpa', 'wpa_pairwise', + 'erp_domain', 'fils_realm', 'erp_send_reauth_start', 'fils_cache_id' + ]); +} + +function iface_ppsk(config) { + if (!(config.auth_type in [ 'none', 'owe', 'psk', 'sae', 'psk-sae', 'wep' ]) || !config.auth_server_addr) + return; + + iface_authentication_server(config); + append('macaddr_acl', '2'); +} + +function iface_wps(config) { + push_config(config, 'config_methods', 'wps_pushbutton', 'push_button'); + push_config(config, 'config_methods', 'wps_label', 'label'); + + if (config.multi_ap == 1) + config.wps_possible = false; + + if (config.wps_possible && length(config.config_methods)) { + config.eap_server = 1; + set_default(config, 'wps_state', 2); + + if (config.ext_registrar && config.network_bridge) + set_default(config, 'upnp_iface', config.network_bridge); + + if (config.multi_ap && config.multi_ap_backhaul_ssid) { + append_vars(config, [ 'multi_ap_backhaul_ssid' ]); + if (length(config.multi_ap_backhaul_key) == 64) + append('multi_ap_backhaul_wpa_psk', config.multi_ap_backhaul_key); + else if (length(config.multi_ap_backhaul_key) > 8) + append('multi_ap_backhaul_wpa_passphrase', config.multi_ap_backhaul_key); + else + netifd.setup_failed('INVALID_WPA_PSK'); + } + + append_vars(config, [ + 'wps_state', 'device_type', 'device_name', 'config_methods', 'wps_independent', 'eap_server', + 'ap_pin', 'ap_setup_locked', 'upnp_iface' + ]); + } +} + +function iface_rrm(config) { + set_default(config, 'rrm_neighbor_report', config.ieee80211k); + set_default(config, 'rrm_beacon_report', config.ieee80211k); + + append_vars(config, [ + 'rrm_neighbor_report', 'rrm_beacon_report', 'rnr', 'ftm_responder', + ]); +} + +function iface_ftm(config, phy_features) { + if (!phy_features.ftm_responder || !config.ftm_responder) + return; + + append_vars(config, [ + 'ftm_responder', 'lci', 'civic' + ]); +} + +function iface_macfilter(config) { + let path = `/var/run/hostapd-${config.ifname}.maclist`; + + switch(config.macfilter) { + case 'allow': + append('accept_mac_file', path); + append('macaddr_acl', 1); + config.vlan_possible = 1; + break; + + case 'deny': + append('deny_mac_file', path); + append('macaddr_acl', 0); + break; + + default: + return; + } + + let file = fs.open(path, 'w'); + if (!file) { + warn(`Failed to open ${path}`); + return; + } + + if (config.maclist) + file.write(join('\n', config.maclist)); + + let macfile = fs.readfile(config.macfile); + if (macfile) + file.write(macfile); + file.close(); +} + +function iface_vlan(interface, config, vlans) { + let path = `/var/run/hostapd-${config.ifname}.vlan`; + + let file = fs.open(path, 'w'); + for (let k, vlan in vlans) + if (vlan.config.name && vlan.config.vid) { + let ifname = `${config.ifname}-${vlan.config.name}`; + file.write(`${vlan.config.vid} ${ifname}\n`); + netifd.set_vlan(interface, k, ifname); + } + file.close(); + + set_default(config, 'vlan_file', path); + append_vars(config, [ 'vlan_file' ]); + + if (!config.vlan_possible || !config.dynamic_vlan) + return; + + config.vlan_no_bridge = !config.vlan_bridge; + + append_vars(config, [ + 'dynamic_vlan', 'vlan_naming', 'vlan_bridge', 'vlan_no_bridge', + 'vlan_tagged_interface' + ]); +} + +function iface_stations(config, stas) { + if (!length(stas)) + return; + + let path = `/var/run/hostapd-${config.ifname}.psk`; + + let file = fs.open(path, 'w'); + for (let k, sta in stas) + if (sta.config.mac && sta.config.key) { + let station = `${sta.config.mac} ${sta.config.key}\n`; + if (sta.config.vid) + station = `vlanid=${sta.config.vid} ` + station; + file.write(station); + } + file.close(); + + set_default(config, 'wpa_psk_file', path); +} + +function iface_eap_server(config) { + if (!config.eap_server) + return; + + set_default(config, 'eap_server', true); + set_default(config, 'eap_server_erp', true); + + append_vars(config, [ + 'eap_server', 'eap_server_erp', 'eap_user_file', 'ca_cert', 'server_cert', + 'private_key', 'private_key_passwd', 'server_id', + ]); +} + +function iface_roaming(config) { + if (!config.ieee80211r || config.wpa < 2) + return; + + set_default(config, 'mobility_domain', substr(digest.md5(config.ssid), 0, 4)); + set_default(config, 'ft_psk_generate_local', config.auth_type == 'psk'); + set_default(config, 'ft_iface', config.network_ifname); + + if (config.ft_psk_generate_local) { + if (!config.r0kh || !config.r1kh) { + if (!config.auth_secret && !config.key) + netifd.setup_failed('FT_KEY_CANT_BE_DERIVED'); + + let ft_key = digest.md5(`${mobility_domain}/${auth_secret ?? key}`); + + set_default(config, 'r0kh', 'ff:ff:ff:ff:ff:ff,*,' + ft_key); + set_default(config, 'r1kh', '00:00:00:00:00:00,00:00:00:00:00:00,' + ft_key); + } + + append_vars(config, [ + 'r0kh', 'r1kh', 'r1_key_holder', 'r0_key_lifetime', 'pmk_r1_push' + ]); + } + + append_vars(config, [ + 'mobility_domain', 'ft_psk_generate_local', 'ft_over_ds', 'reassociation_deadline', + 'ft_iface' + ]); +} + +function iface_mfp(config) { + if (!config.ieee80211w || config.wpa < 2) { + append('ieee80211w', 0); + return; + } + + if (config.auth_type == 'eap192') + config.group_mgmt_cipher = 'BIP-GMAC-256'; + else + config.group_mgmt_cipher = config.ieee80211w_mgmt_cipher ?? 'AES-128-CMAC'; + + append_vars(config, [ + 'ieee80211w', 'group_mgmt_cipher', 'assoc_sa_query_max_timeout', 'assoc_sa_query_retry_timeout' + ]); +} + +function iface_key_caching(config) { + if (config.wpa < 2) + return; + + if (config.network_bridge && config.rsn_preauth) { + set_default(config, 'okc', true); + config.rsn_preauth_interfaces = config.network_bridge; + + append_vars(config, [ + 'rsn_preauth', 'rsn_preauth_interfaces' + ]); + } else { + set_default(config, 'okc', (config.auth_type in [ 'sae', 'psk-sae', 'owe' ])); + } + + if (!config.okc && !config.fils) + config.disable_pmksa_caching = 1; + + append_vars(config, [ + 'okc', 'disable_pmksa_caching' + ]); +} + +function iface_hs20(config) { + if (!config.hs20) + return; + + let uci = libuci.cursor(); + let icons = uci.get_all('wireless'); + for (let k, icon in icons) + if (icon['.type'] == 'hs20-icon') + append('hs20_icon', `${icon.width}:${icon.heigth}:${icon.lang}:${icon.type}:${k}:${icon.path}`); + + append_vars(config, [ + 'hs20', 'disable_dgaf', 'osen', 'anqp_domain_id', 'hs20_deauth_req_timeout', 'osu_ssid', + 'hs20_wan_metrics', 'hs20_operating_class', 'hs20_t_c_filename', 'hs20_t_c_timestamp', + 'hs20_t_c_server_url', 'hs20_oper_friendly_name', 'hs20_conn_capab', 'osu_provider', + 'operator_icon' + ]); +} + +function iface_interworking(config) { + if (!config.iw_enabled) + return; + + config.interworking = true; + + if (config.domain_name) + config.domain_name = join(',', config.domain_name); + + if (config.anqp_3gpp_cell_net) + config.domain_name = join(',', config.anqp_3gpp_cell_net); + + append_vars(config, [ + 'interworking', 'internet', 'asra', 'uesa', 'access_network_type', 'hessid', 'venue_group', + 'venue_type', 'network_auth_type', 'gas_address3', 'roaming_consortium', 'anqp_elem', 'nai_realm', + 'venue_name', 'venue_url', 'domain_name', 'anqp_3gpp_cell_net', + ]); +} + +export function generate(interface, config, vlans, stas, phy_features) { + config.ctrl_interface = '/var/run/hostapd'; + + iface_stations(config, stas); + + iface_setup(config); + + iface_auth_type(config); + + iface_accounting_server(config); + + iface_ppsk(config); + + iface_wps(config); + + iface_rrm(config); + + iface_ftm(config, phy_features); + + iface_macfilter(config); + + iface_vlan(interface, config, vlans); + + iface_eap_server(config); + + iface_roaming(config); + + iface_mfp(config); + + iface_key_caching(config); + + iface_hs20(config); + + iface_interworking(config); + + iface.wpa_key_mgmt(config); + append_vars(config, [ + 'wpa_key_mgmt' + ]); + + /* raw options */ + for (let raw in config.hostapd_options) + append_raw(raw); + + if (config.default_macaddr) + append_raw('#default_macaddr'); +}; diff --git a/package/network/config/wifi-scripts/files-ucode/usr/share/ucode/wifi/common.uc b/package/network/config/wifi-scripts/files-ucode/usr/share/ucode/wifi/common.uc new file mode 100644 index 00000000000000..a4d7eb3ed75892 --- /dev/null +++ b/package/network/config/wifi-scripts/files-ucode/usr/share/ucode/wifi/common.uc @@ -0,0 +1,124 @@ +'use strict'; + +import * as libubus from 'ubus'; +import * as fs from 'fs'; + +global.ubus = libubus.connect(); + +let config_data = ''; +let network_data = ''; + +export function log(msg) { + printf(`wifi-scripts: ${msg}\n`); +}; + +export function append_raw(value) { + config_data += value + '\n'; +}; + +export function append(key, value) { + if (value == null) + return; + + switch (type(value)) { + case 'array': + value = join(' ', value); + break; + case 'bool': + value = value ? 1 : 0; + break; + } + + append_raw(key + '=' + value); +}; + +export function append_vars(dict, keys) { + for (let key in keys) + append(key, dict[key]); +}; + +export function network_append_raw(value) { + network_data += value + '\n'; +}; + +export function network_append(key, value) { + if (value == null) + return; + + switch (type(value)) { + case 'array': + value = join(' ', value); + break; + case 'bool': + value = value ? 1 : 0; + break; + } + + network_append_raw('\t' + key + '=' + value); +}; + +export function network_append_vars(dict, keys) { + for (let key in keys) + network_append(key, dict[key]); +}; + +export function set_default(dict, key, value) { + if (dict[key] == null) + dict[key] = value; +}; + +export function push_config(dict, key, option, value) { + if (!dict[option]) + return; + + dict[key] ??= []; + push(dict[key], value); +}; + +export function touch_file(filename) { + let file = fs.open(filename, "a"); + if (file) + file.close(); + else + log('Failed to touch ' + filename); +}; + +export function append_value(config, key, value) { + if (!config[key]) + config[key] = value; + else + config[key] += ' ' + value; +}; + +export function comment(comment) { + append_raw('\n# ' + comment); +}; + +export function dump_config(file) { + if (file) + fs.writefile(file, config_data); + + return config_data; +}; + +export function dump_network(file) { + config_data += 'network={\n'; + config_data += network_data;; + config_data += '}\n'; + + if (file) + fs.writefile(file, config_data); + + printf('%s\n', config_data); + + return config_data; +}; + +export function flush_config() { + config_data = ''; +}; + +export function flush_network() { + config_data = ''; + network_data = ''; +}; diff --git a/package/network/config/wifi-scripts/files-ucode/usr/share/ucode/wifi/hostapd.uc b/package/network/config/wifi-scripts/files-ucode/usr/share/ucode/wifi/hostapd.uc new file mode 100644 index 00000000000000..a17f6b547435d3 --- /dev/null +++ b/package/network/config/wifi-scripts/files-ucode/usr/share/ucode/wifi/hostapd.uc @@ -0,0 +1,577 @@ +'use strict'; + +import { append, append_raw, append_vars, dump_config, flush_config, set_default } from 'wifi.common'; +import { validate } from 'wifi.validate'; +import * as netifd from 'wifi.netifd'; +import * as iface from 'wifi.iface'; +import * as nl80211 from 'nl80211'; +import * as ap from 'wifi.ap'; +import * as fs from 'fs'; + +const NL80211_EXT_FEATURE_ENABLE_FTM_RESPONDER = 33; +const NL80211_EXT_FEATURE_RADAR_BACKGROUND = 61; + +let phy_features = {}; +let phy_capabilities = {}; + +/* make sure old style UCI and hwmode and newer band properties are correctly resolved */ +function set_device_defaults(config) { + /* validate the hw mode */ + if (config.hwmode in [ '11a', '11b', '11g', '11ad' ]) + config.hw_mode = substr(config.hwmode, 2); + else if (config.channel > 14) + config.hw_mode = 'a'; + else + config.hw_mode = 'g'; + + /* validate band */ + if (config.band == '2g') + config.hw_mode = 'g'; + else if (config.band in [ '5g', '6g', '60g' ]) + config.hw_mode = 'a'; + else + switch (config.hw_mode) { + case 'a': + config.band = '5g'; + break; + + case 'ad': + config.band = '60g'; + break; + + default: + config.band = '2g'; + break; + } +} + +/* setup sylog / stdout */ +function device_log_append(config) { + let log_mask = 0; + + for (let k in [ 'log_mlme', 'log_iapp', 'log_driver', 'log_wpa', 'log_radius', 'log_8021x', 'log_80211' ]) { + log_mask <<= 1; + log_mask |= config[k] ? 1 : 0; + } + + append('logger_syslog', log_mask); + append('logger_syslog_level', config.log_level); + append('logger_stdout', log_mask); + append('logger_stdout_level', config.log_level); +} + +/* setup country code */ +function device_country_code(config) { + let status = global.ubus.call('network.wireless', 'status'); + for (let name, radio in status) { + if (!radio.config.country) + continue; + config.country_code = radio.config.country; + } + + if (!exists(config, 'country_code')) + return; + + if (config.hw_mode != 'a') + delete config.ieee80211h; + append_vars(config, [ 'country_code', 'country3', 'ieee80211h' ]); + if (config.ieee80211d) + append_vars(config, [ 'ieee80211d', 'local_pwr_constraint', 'spectrum_mgmt_required' ]); +} + + +/* setup cell density */ +function device_cell_density_append(config) { + switch (config.hw_mode) { + case 'b': + if (config.cell_density == 1) { + config.supported_rates = [ 5500, 11000 ]; + config.basic_rates = [ 5500, 11000 ]; + } else if (config.cell_density > 2) { + config.supported_rates = [ 11000 ]; + config.basic_rates = [ 11000 ]; + } + ;; + case 'g': + if (config.cell_density in [ 0, 1 ]) { + if (!config.legacy_rates) { + config.supported_rates = [ 6000, 9000, 12000, 18000, 24000, 36000, 48000, 54000 ]; + config.basic_rates = [ 6000, 12000, 24000 ]; + } else if (config.cell_density == 1) { + config.supported_rates = [ 5500, 6000, 9000, 11000, 12000, 18000, 24000, 36000, 48000, 54000 ]; + config.basic_rates = [ 5500, 11000 ]; + } + } else if (config.cell_density == 2 || (config.cell_density > 3 && config.legacy_rates)) { + if (!config.legacy_rates) { + config.supported_rates = [ 12000, 18000, 24000, 36000, 48000, 54000 ]; + config.basic_rates = [ 12000, 24000 ]; + } else { + config.supported_rates = [ 11000, 12000, 18000, 24000, 36000, 48000, 54000 ]; + config.basic_rates = [ 11000 ]; + } + } else if (config.cell_density > 2) { + config.supported_rates = [ 24000, 36000, 48000, 54000 ]; + config.basic_rates = [ 24000 ]; + } + ;; + case 'a': + switch (config.cell_density) { + case 1: + config.supported_rates = [ 6000, 9000, 12000, 18000, 24000, 36000, 48000, 54000 ]; + config.basic_rates = [ 6000, 12000, 24000 ]; + break; + + case 2: + config.supported_rates = [ 12000, 18000, 24000, 36000, 48000, 54000 ]; + config.basic_rates = [ 12000, 24000 ]; + break; + + case 3: + config.supported_rates = [ 24000, 36000, 48000, 54000 ]; + config.basic_rates = [ 24000 ]; + break; + } + } +} + +function device_rates(config) { + for (let key in [ 'supported_rates', 'basic_rates' ]) + config[key] = map(config[key], x => x / 100); + + append_vars(config, [ 'beacon_rate', 'supported_rates', 'basic_rates' ]); +} + +function device_htmode_append(config) { + config.channel_offset = config.band == '6g' ? 1 : 0; + + /* 802.11n */ + config.ieee80211n = 0; + if (config.band != '6g') { + if (config.htmode in [ 'VHT20', 'HT20', 'HE20', 'EHT20' ]) + config.ieee80211n = 1; + if (config.htmode in [ 'HT40', 'HT40+', 'HT40-', 'VHT40', 'VHT80', 'VHT160', 'HE40', 'HE80', 'HE160', 'EHT40', 'EHT80', 'EHT160' ]) { + config.ieee80211n = 1; + if (!config.channel) + config.ht_capab = '[HT40+]'; + else + switch (config.hw_mode) { + case 'a': + switch (((config.channel / 4) + config.channel_offset) % 2) { + case 0: + config.ht_capab = '[HT40-]'; + break; + + case 1: + config.ht_capab = '[HT40+]'; + break; + } + break; + + default: + switch (config.htmode) { + case 'HT40+': + case 'HT40-': + config.ht_capab = '[' + config.htmode + ']'; + break; + + default: + if (config.channel < 7) + config.ht_capab = '[HT40+]'; + else + config.ht_capab = '[HT40-]'; + break; + } + } + } + + if (config.ieee80211n) { + let ht_capab = phy_capabilities.ht_capa; + + if (ht_capab & 0x1 && config.ldpc) + config.ht_capab += '[LDPC]'; + if (ht_capab & 0x10 && config.greenfield) + config.ht_capab += '[GF]'; + if (ht_capab & 0x20 && config.short_gi_20) + config.ht_capab += '[SHORT-GI-20]'; + if (ht_capab & 0x40 && config.short_gi_40) + config.ht_capab += '[SHORT-GI-40]'; + if (ht_capab & 0x80 && config.tx_stbc) + config.ht_capab += '[TX-STBC]'; + if (ht_capab & 0x800 && config.max_amsdu) + config.ht_capab += '[MAX-AMSDU-7935]'; + if (ht_capab & 0x1000 && config.dsss_cck_40) + config.ht_capab += '[DSSS_CCK-40]'; + let rx_stbc = [ '', '[RX-STBC1]', '[RX-STBC12]', '[RX-STBC123]' ]; + config.ht_capab += rx_stbc[min(config.rx_stbc, (ht_capab >> 8) & 3)]; + + append_vars(config, [ 'ieee80211n', 'ht_coex', 'ht_capab' ]); + } + } + + /* 802.11ac */ + config.ieee80211ac = 1; + config.vht_oper_centr_freq_seg0_idx = 0; + config.vht_oper_chwidth = 0; + + switch (config.htmode) { + case 'VHT20': + case 'HE20': + case 'EHT20': + break; + + case 'VHT40': + case 'HE40': + case 'EHT40': + config.vht_oper_centr_freq_seg0_idx = config.channel + (((config.channel / 4) + config.channel_offset) % 2 ? 2 : -2); + break; + + case 'VHT80': + case 'HE80': + case 'EHT80': + let delta = [ -6, 6, 2, -2 ]; + config.vht_oper_centr_freq_seg0_idx = config.channel + delta[((config.channel / 4) + config.channel_offset) % 4]; + config.vht_oper_chwidth = 1; + break; + + case 'VHT160': + case 'HE160': + case 'EHT160': + let vht_oper_centr_freq_seg0_idx_map = [[ 64, 50 ], [ 128, 114 ], [ 177, 163 ]]; + if (config.band == '6g') + vht_oper_centr_freq_seg0_idx_map = [ + [ 29, 15 ], [ 61, 47 ], [ 93, 79 ], [ 125, 111 ], + [ 157, 143 ], [ 189, 175 ], [ 221, 207 ]]; + for (let k, v in vht_oper_centr_freq_seg0_idx_map) + if (v[0] <= config.channel) { + config.vht_oper_centr_freq_seg0_idx = v[1]; + break; + } + config.vht_oper_chwidth = 2; + break; + + default: + config.ieee80211ac = 0; + break; + } + + config.eht_oper_chwidth = config.vht_oper_chwidth; + config.eht_oper_centr_freq_seg0_idx = config.vht_oper_centr_freq_seg0_idx; + + if (config.band == '6g') { + config.ieee80211ac = 0; + + switch(config.htmode) { + case 'HE20': + case 'EHT20': + config.op_class = 131; + break; + + case 'EHT320': + let eht_center_seg0_map = [ + [ 61, 31 ], [ 125, 95 ], [ 189, 159 ], [ 221, 191 ] + ]; + + for (let k, v in eht_center_seg0_map) + if (v[0] <= config.channel) { + config.eht_oper_centr_freq_seg0_idx = v[1]; + break; + } + config.op_class = 137; + config.eht_oper_chwidth = 7; + break; + + case 'HE40': + case 'HE80': + case 'HE160': + case 'EHT40': + case 'EHT80': + case 'EHT160': + config.op_class = 132 + config.eht_oper_chwidth; + break; + } + + append_vars(config, [ 'op_class' ]); + } + + if (config.ieee80211ac && config.hw_mode == 'a') { + /* VHT capab */ + if (config.vht_oper_chwidth < 2) { + config.vht160 = 0; + config.short_gi_160 = 0; + } + + config.tx_queue_data2_burst = '2.0'; + + let vht_capab = phy_capabilities.vht_capa; + + config.vht_capab = ''; + if (vht_capab & 0x10 && config.rxldpc) + config.vht_capab += '[RXLDPC]'; + if (vht_capab & 0x20 && config.short_gi_80) + config.vht_capab += '[SHORT-GI-80]'; + if (vht_capab & 0x40 && config.short_gi_160) + config.vht_capab += '[SHORT-GI-160]'; + if (vht_capab & 0x80 && config.tx_stbc_2by1) + config.vht_capab += '[TX-STBC-2BY1]'; + if (vht_capab & 0x800 && config.su_beamformer) + config.vht_capab += '[SU-BEAMFORMER]'; + if (vht_capab & 0x1000 && config.su_beamformee) + config.vht_capab += '[SU-BEAMFORMEE]'; + if (vht_capab & 0x80000 && config.mu_beamformer) + config.vht_capab += '[MU-BEAMFORMER]'; + if (vht_capab & 0x100000 && config.mu_beamformee) + config.vht_capab += '[MU-BEAMFORMEE]'; + if (vht_capab & 0x200000 && config.vht_txop_ps) + config.vht_capab += '[VHT-TXOP-PS]'; + if (vht_capab & 0x400000 && config.htc_vht) + config.vht_capab += '[HTC-VHT]'; + if (vht_capab & 0x10000000 && config.rx_antenna_pattern) + config.vht_capab += '[RX-ANTENNA-PATTERN]'; + if (vht_capab & 0x20000000 && config.tx_antenna_pattern) + config.vht_capab += '[TX-ANTENNA-PATTERN]'; + let rx_stbc = [ '', '[RX-STBC1]', '[RX-STBC12]', '[RX-STBC123]', '[RX-STBC-1234]' ]; + config.vht_capab += rx_stbc[min(config.rx_stbc, (vht_capab >> 8) & 7)]; + + if (vht_capab & 0x800 && config.su_beamformer) + config.vht_capab += '[SOUNDING-DIMENSION' + min(((vht_capab >> 16) & 3) + 1, config.beamformer_antennas) + ']'; + if (vht_capab & 0x1000 && config.su_beamformee) + config.vht_capab += '[BF-ANTENNA-' + min(((vht_capab >> 13) & 3) + 1, config.beamformer_antennas) + ']'; + + /* supported Channel widths */ + if (vht_capab & 0xc == 8 && config.vht160 <= 2) + config.vht_capab += '[VHT160-80PLUS80]'; + else if (vht_capab & 0xc == 4 && config.vht160 <= 1) + config.vht_capab += '[VHT160]'; + + /* maximum MPDU length */ + if (vht_capab & 3 > 1 && config.vht_max_mpdu > 11454) + config.vht_capab += '[MAX-MPDU-11454]'; + else if (vht_capab & 3 && config.vht_max_mpdu > 7991) + config.vht_capab += '[MAX-MPDU-7991]'; + + /* maximum A-MPDU length exponent */ + let max_a_mpdu_len_exp = (vht_capab >> 20) & 0x38; + for (let exp = 7; exp; exp--) + if (max_a_mpdu_len_exp >= (0x8 * exp) && exp <= config.vht_max_a_mpdu_len_exp) { + config.vht_capab += '[MAX-A-MPDU-LEN-EXP' + exp + ']'; + break; + } + + /* whether or not the STA supports link adaptation using VHT variant */ + let vht_link_adapt = vht_capab & 0xC000000; + if (vht_link_adapt >= 0xC000000 && config.vht_link_adapt > 3) + config.vht_capab += '[VHT-LINK-ADAPT-3]'; + if (vht_link_adapt >= 0x8000000 && config.vht_link_adapt > 2) + config.vht_capab += '[VHT-LINK-ADAPT-2]'; + + append_vars(config, [ + 'ieee80211ac', 'vht_oper_chwidth', 'vht_oper_centr_freq_seg0_idx', + 'vht_capab' + ]); + } + + /* 802.11ax */ + if (wildcard(config.htmode, 'HE*') || wildcard(config.htmode, 'EHT*')) { + let he_phy_cap = phy_capabilities.he_phy_cap; + let he_mac_cap = phy_capabilities.he_mac_cap; + + config.ieee80211ax = true; + + if (config.hw_mode == 'a') { + config.he_oper_chwidth = config.vht_oper_chwidth; + config.he_oper_centr_freq_seg0_idx = config.vht_oper_centr_freq_seg0_idx; + } + + if (config.he_bss_color_enabled) { + if (config.he_spr_non_srg_obss_pd_max_offset) + config.he_spr_sr_control |= 1 << 2; + if (!config.he_spr_psr_enabled) + config.he_spr_sr_control |= 1; + append_vars(config, [ 'he_bss_color', 'he_spr_non_srg_obss_pd_max_offset', 'he_spr_sr_control' ]); + } + + if (!(he_phy_cap[3] & 0x80)) + config.he_su_beamformer = false; + if (!(he_phy_cap[4] & 0x1)) + config.he_su_beamformee = false; + if (!(he_phy_cap[4] & 0x2)) + config.he_mu_beamformer = false; + if (!(he_phy_cap[7] & 0x1)) + config.he_spr_psr_enabled = false; + if (!(he_mac_cap[0] & 0x1)) + config.he_twt_required= false; + + append_vars(config, [ + 'ieee80211ax', 'he_oper_chwidth', 'he_oper_centr_freq_seg0_idx', + 'he_su_beamformer', 'he_su_beamformee', 'he_mu_beamformer', 'he_twt_required', + 'he_default_pe_duration', 'he_rts_threshold', 'he_mu_edca_qos_info_param_count', + 'he_mu_edca_qos_info_q_ack', 'he_mu_edca_qos_info_queue_request', 'he_mu_edca_qos_info_txop_request', + 'he_mu_edca_ac_be_aifsn', 'he_mu_edca_ac_be_aci', 'he_mu_edca_ac_be_ecwmin', + 'he_mu_edca_ac_be_ecwmax', 'he_mu_edca_ac_be_timer', 'he_mu_edca_ac_bk_aifsn', + 'he_mu_edca_ac_bk_aci', 'he_mu_edca_ac_bk_ecwmin', 'he_mu_edca_ac_bk_ecwmax', + 'he_mu_edca_ac_bk_timer', 'he_mu_edca_ac_vi_ecwmin', 'he_mu_edca_ac_vi_ecwmax', + 'he_mu_edca_ac_vi_aifsn', 'he_mu_edca_ac_vi_aci', 'he_mu_edca_ac_vi_timer', + 'he_mu_edca_ac_vo_aifsn', 'he_mu_edca_ac_vo_aci', 'he_mu_edca_ac_vo_ecwmin', + 'he_mu_edca_ac_vo_ecwmax', 'he_mu_edca_ac_vo_timer', + ]); + } + + if (wildcard(config.htmode, 'EHT*')) { + config.ieee80211be = true; + append_vars(config, [ 'ieee80211be' ]); + + if (config.hw_mode == 'a') + append_vars(config, [ 'eht_oper_chwidth', 'eht_oper_centr_freq_seg0_idx' ]); + + if (config.band == "6g") { + config.stationary_ap = true; + append_vars(config, [ 'he_6ghz_reg_pwr_type', ]); + } + } + + append_vars(config, [ 'tx_queue_data2_burst', 'stationary_ap' ]); +} + +function device_extended_features(data, flag) { + return !!(data[flag / 8] | (1 << (flag % 8))); +} + +function device_capabilities(phy) { + let idx = +substr(phy, 3, 1);; + let phys = nl80211.request(nl80211.const.NL80211_CMD_GET_WIPHY, nl80211.const.NLM_F_DUMP, { wiphy: idx, split_wiphy_dump: true }); + + for (let phy in phys) { + if (!phy || phy.wiphy != idx) + continue; + for (let band in phy.wiphy_bands) { + if (!band) + continue; + phy_capabilities.ht_capa = band.ht_capa ?? 0; + phy_capabilities.vht_capa = band.vht_capa ?? 0; + for (let iftype in band.iftype_data) { + if (!iftype.iftypes.ap) + continue; + phy_capabilities.he_mac_cap = iftype.he_cap_mac; + phy_capabilities.he_phy_cap = iftype.he_cap_phy; + } + break; + } + + phy_features.ftm_responder = device_extended_features(phy.extended_features, NL80211_EXT_FEATURE_ENABLE_FTM_RESPONDER); + phy_features.radar_background = device_extended_features(phy.extended_features, NL80211_EXT_FEATURE_RADAR_BACKGROUND); + break; + } +} + +function generate(config) { + if (!config.phy) + die(`${config.path} is an unknown phy`); + + device_capabilities(config.phy); + + append('driver', 'nl80211'); + + set_device_defaults(config); + + device_log_append(config); + + device_country_code(config); + + device_cell_density_append(config); + + device_rates(config); + + /* beacon */ + append_vars(config, [ 'beacon_int', 'beacon_rate', 'rnr_beacon', 'mbssid' ]); + + /* wpa_supplicant co-exist */ + append_vars(config, [ 'noscan' ]); + + /* airtime */ + append_vars(config, [ 'airtime_mode' ]); + + /* assoc/thresholds */ + append_vars(config, [ 'rssi_reject_assoc_rssi', 'rssi_ignore_probe_request', 'iface_max_num_sta', 'no_probe_resp_if_max_sta' ]); + + /* ACS / Radar*/ + if (!phy_features.radar_background || config.band != '5g') + delete config.enable_background_radar; + else + set_default(config, 'enable_background_radar', phy_features.radar_background); + + append_vars(config, [ 'acs_chan_bias', 'acs_exclude_dfs', 'enable_background_radar' ]); + + /* TX Power */ + append_vars(config, [ 'min_tx_power' ]); + + /* hwmode, channel, op_class, ... */ + append_vars(config, [ 'hw_mode', 'channel', 'rts_threshold', 'chanlist' ]); + if (config.hw_mode in [ 'a', 'g' ] && config.require_mode in [ 'n', 'ac', 'ax' ]) { + let require_mode = { n: 'require_ht', ac: 'require_vht', ax: 'require_he' }; + + config.legacy_rates = false; + append(require_mode[config.require_mode], 1); + } + device_htmode_append(config); + + /* 6G power mode */ + if (config.band != '6g') + append_vars(config, [ 'reg_power_type' ]); + + /* raw options */ + for (let raw in config.hostapd_options) + append_raw(raw); +} + +let iface_idx = 0; +function setup_interface(interface, config, vlans, stas, phy_features, fixup) { + config = { ...config, fixup }; + + config.idx = iface_idx++; + ap.generate(interface, config, vlans, stas, phy_features); +} + +export function setup(data) { + let file_name = `/var/run/hostapd-${data.phy}${data.vif_phy_suffix}.conf`; + + flush_config(); + + if (fs.stat(file_name)) + fs.rename(file_name, file_name + '.prev'); + + data.config.phy = data.phy; + + generate(data.config); + + if (data.config.num_global_macaddr) + append('\n#num_global_macaddr', data.config.num_global_macaddr); + + for (let k, interface in data.interfaces) { + if (interface.config.mode != 'ap') + continue; + + interface.config.network_bridge = interface.bridge; + interface.config.network_ifname = interface['bridge-ifname']; + + let owe = interface.config.encryption == 'owe' && interface.config.owe_transition; + + setup_interface(k, interface.config, interface.vlans, interface.stas, phy_features, owe ? 'owe' : null ); + if (owe) + setup_interface(k, interface.config, interface.vlans, interface.stas, phy_features, 'owe-transition'); + } + + let config = dump_config(file_name); + + let msg = { + phy: data.phy, + radio: data.config.radio, + config: file_name, + prev_config: file_name + '.prev' + }; + let ret = global.ubus.call('hostapd', 'config_set', msg); + + if (ret) + netifd.add_process('/usr/sbin/hostapd', ret.pid, true, true); + else + netifd.setup_failed('HOSTAPD_START_FAILED'); +}; diff --git a/package/network/config/wifi-scripts/files-ucode/usr/share/ucode/wifi/iface.uc b/package/network/config/wifi-scripts/files-ucode/usr/share/ucode/wifi/iface.uc new file mode 100644 index 00000000000000..3c15d87d003f84 --- /dev/null +++ b/package/network/config/wifi-scripts/files-ucode/usr/share/ucode/wifi/iface.uc @@ -0,0 +1,194 @@ +'use strict'; + +import { append_value, log } from 'wifi.common'; +import * as fs from 'fs'; + +export function parse_encryption(config) { + let encryption = split(config.encryption, '+', 2); + + config.wpa_pairwise = (config.hwmode == 'ad') ? 'GCMP' : 'CCMP'; + + switch(encryption[1]){ + case 'tkip+aes': + case 'tkip+ccmp': + case 'aes+tkip': + case 'ccmp+tkip': + config.wpa_pairwise = 'CCMP TKIP'; + break; + + case 'ccmp256': + config.wpa_pairwise = 'CCMP-256'; + break; + + case 'aes': + case 'ccmp': + config.wpa_pairwise = 'CCMP'; + break; + + case 'tkip': + config.wpa_pairwise = 'TKIP'; + break; + + case 'gcmp256': + config.wpa_pairwise = 'GCMP-256'; + break; + + case 'gcmp': + config.wpa_pairwise = 'GCMP'; + break; + + default: + if (config.encryption == 'wpa3-192') + config.wpa_pairwise = 'GCMP-256'; + break; + } + + config.wpa = 0; + for (let k, v in { 'wpa2*': 2, 'wpa3*': 2, '*psk2*': 2, 'psk3*': 2, 'sae*': 2, + 'owe*': 2, 'wpa*mixed*': 3, '*psk*mixed*': 3, 'wpa*': 1, '*psk*': 1, }) + if (wildcard(config.encryption, k)) { + config.wpa = v; + break; + } + if (!config.wpa) + config.wpa_pairwise = null; + + config.auth_type = encryption[0] ?? 'none'; + switch(config.auth_type) { + case 'owe': + config.auth_type = 'owe'; + break; + + case 'wpa3-192': + config.auth_type = 'eap192'; + break; + + case 'wpa3-mixed': + config.auth_type = 'eap-eap2'; + break; + + case 'wpa3': + config.auth_type = 'eap2'; + break; + + case 'sae-mixed': + config.auth_type = 'psk-sae'; + break; + + case 'wpa': + case 'wpa2': + config.auth_type = 'eap'; + break; + } +}; + +export function wpa_key_mgmt(config) { + if (!config.wpa) + return; + + switch(config.auth_type) { + case 'psk': + case 'psk2': + append_value(config, 'wpa_key_mgmt', 'WPA-PSK'); + if (config.wpa >= 2 && config.ieee80211r) + append_value(config, 'wpa_key_mgmt', 'FT-PSK'); + if (config.ieee80211w) + append_value(config, 'wpa_key_mgmt', 'WPA-PSK-SHA256'); + break; + + case 'eap': + append_value(config, 'wpa_key_mgmt', 'WPA-EAP'); + if (config.wpa >= 2 && config.ieee80211r) + append_value(config, 'wpa_key_mgmt', 'FT-EAP'); + if (config.ieee80211w) + append_value(config, 'wpa_key_mgmt', 'WPA-EAP--SHA256'); + break; + + case 'eap192': + append_value(config, 'wpa_key_mgmt', 'WPA-EAP-SUITE-B-192'); + if (config.ieee80211r) + append_value(config, 'wpa_key_mgmt', 'FT-EAP-SHA384'); + break; + + case 'eap-eap2': + append_value(config, 'wpa_key_mgmt', 'WPA-EAP'); + append_value(config, 'wpa_key_mgmt', 'WPA-EAP-SHA256'); + if (config.ieee80211r) + append_value(config, 'wpa_key_mgmt', 'FT-EAP'); + break; + + case 'eap2': + append_value(config, 'wpa_key_mgmt', 'WPA-EAP-SHA256'); + if (config.ieee80211r) + append_value(config, 'wpa_key_mgmt', 'FT-EAP'); + break; + + case 'sae': + append_value(config, 'wpa_key_mgmt', 'SAE'); + if (config.ieee80211r) + append_value(config, 'wpa_key_mgmt', 'FT-SAE'); + break; + + case 'psk-sae': + append_value(config, 'wpa_key_mgmt', 'WPA-PSK'); + append_value(config, 'wpa_key_mgmt', 'SAE'); + if (config.ieee80211w) + append_value(config, 'wpa_key_mgmt', 'WPA-PSK-SHA256'); + if (config.ieee80211r) { + append_value(config, 'wpa_key_mgmt', 'FT-PSK'); + append_value(config, 'wpa_key_mgmt', 'FT-SAE'); + } + break; + + case 'owe': + append_value(config, 'wpa_key_mgmt', 'OWE'); + break; + } + + if (config.fils) { + switch(config.auth_type) { + case 'eap192': + append_value(config, 'wpa_key_mgmt', 'FILS-SHA384'); + if (config.ieee80211r) + append_value(config, 'wpa_key_mgmt', 'FT-FILS-SHA384'); + break; + + case 'eap-eap2': + case 'eap2': + case 'eap': + append_value(config, 'wpa_key_mgmt', 'FILS-SHA256'); + if (config.ieee80211r) + append_value(config, 'wpa_key_mgmt', 'FT-FILS-SHA256'); + break; + } + } + + config.key_mgmt = config.wpa_key_mgmt; +}; + +function macaddr_random() { + let f = open("/dev/urandom", "r"); + let addr = f.read(6); + + addr = map(split(addr, ""), (v) => ord(v)); + addr[0] &= ~1; + addr[0] |= 2; + + return join(":", map(addr, (v) => sprintf("%02x", v))); +} + +let mac_idx = 0; +export function prepare(data, phy, num_global_macaddr) { + if (!data.macaddr) { + let pipe = fs.popen(`ucode /usr/share/hostap/wdev.uc ${phy} get_macaddr id=${mac_idx} num_global=${num_global_macaddr} mbssid=${data.mbssid ?? 0}`); + + data.macaddr = trim(pipe.read("all"), '\n'); + pipe.close(); + + data.default_macaddr = true; + mac_idx++; + } else if (data.macaddr == 'random') + data.macaddr = macaddr_random(); + + log(`Preparing interface: ${data.ifname} with MAC: ${data.macaddr}`); +}; diff --git a/package/network/config/wifi-scripts/files-ucode/usr/share/ucode/wifi/netifd.uc b/package/network/config/wifi-scripts/files-ucode/usr/share/ucode/wifi/netifd.uc new file mode 100644 index 00000000000000..5a4a9fafb37f25 --- /dev/null +++ b/package/network/config/wifi-scripts/files-ucode/usr/share/ucode/wifi/netifd.uc @@ -0,0 +1,49 @@ +'use strict'; + +import { log } from 'wifi.common'; +import * as fs from 'fs'; + +const CMD_UP = 0; +const CMD_SET_DATA = 1; +const CMD_PROCESS_ADD = 2; +const CMD_PROCESS_KILL_ALL = 3; +const CMD_SET_RETRY = 4; + +export function notify(command, params, data) { + params ??= {}; + data ??= {}; + + global.ubus.call('network.wireless', 'notify', { command, device: global.radio, ...params, data }); +}; + +export function set_up() { + notify(CMD_UP); +}; + +export function set_data(data) { + notify(CMD_SET_DATA, null, data); +}; + +export function add_process(exe, pid, required, keep) { + exe = fs.realpath(exe); + + notify(CMD_PROCESS_ADD, null, { pid, exe, required, keep }); +}; + +export function set_retry(retry) { + notify(CMD_SET_RETRY, null, { retry }); +}; + +export function set_vif(interface, ifname) { + notify(CMD_SET_DATA, { interface }, { ifname }); +}; + +export function set_vlan(interface, ifname, vlan) { + notify(CMD_SET_DATA, { interface, vlan }, { ifname }); +}; + +export function setup_failed(reason) { + log(`Device setup failed: ${reason}`); + printf('%s\n', reason); + set_retry(false); +}; diff --git a/package/network/config/wifi-scripts/files-ucode/usr/share/ucode/wifi/supplicant.uc b/package/network/config/wifi-scripts/files-ucode/usr/share/ucode/wifi/supplicant.uc new file mode 100644 index 00000000000000..04d7f216aa68a7 --- /dev/null +++ b/package/network/config/wifi-scripts/files-ucode/usr/share/ucode/wifi/supplicant.uc @@ -0,0 +1,237 @@ +'use strict'; + +import { append, append_raw, append_vars, network_append, network_append_raw, network_append_vars, + set_default, dump_network, flush_network } from 'wifi.common'; +import * as netifd from 'wifi.netifd'; +import * as iface from 'wifi.iface'; +import * as fs from 'fs'; + +function set_fixed_freq(data, config) { + if (!data.frequency) + return; + + set_default(config, 'fixed_freq', 1); + set_default(config, 'frequency', data.frequency); + + if (data.htmode in [ 'VHT80', 'HE80' ]) + set_default(config, 'max_oper_chwidth', 1); + else if (data.htmode in [ 'VHT160', 'HE160' ]) + set_default(config, 'max_oper_chwidth', 2); + else if (data.htmode in [ 'VHT20', 'VHT40', 'HE20', 'HE40' ]) + set_default(config, 'max_oper_chwidth', 0); + else + set_default(config, 'disable_vht', true); + + if (data.htmode in [ 'NOHT' ]) + set_default(config, 'disable_ht', true); + else if (data.htmode in [ 'HT20', 'VHT20', 'HE20' ]) + set_default(config, 'disable_ht40', true); + else if (data.htmode in [ 'VHT40', 'VHT80', 'VHT160', 'HE40', 'HE80', 'HE160' ]) + set_default(config, 'ht40', true); + + if (wildcard(data.htmode, 'VHT*')) + set_default(config, 'vht', 1); +} + +export function ratestr(rate) { + if (rate == null) + return rate; + + let rem = (rate / 100) % 10; + rate = int(rate / 1000); + if (rem > 0) + rate += "." + rem; + + return "" + rate; +}; + +export function ratelist(rates) { + if (length(rates) < 1) + return null; + + return join(",", map(rates, (rate) => ratestr(rate))); +}; + +function setup_sta(data, config) { + iface.parse_encryption(config); + + if (config.auth_type in [ 'sae', 'owe', 'eap2', 'eap192' ]) + set_default(config, 'ieee80211w', 2); + else if (config.auth_type in [ 'psk-sae' ]) + set_default(config, 'ieee80211w', 1); + + set_default(config, 'ieee80211r', 0); + set_default(config, 'multi_ap', 0); + set_default(config, 'default_disabled', 0); + +//multiap_flag_file="${_config}.is_multiap" + config.scan_ssid = 1; + + switch(config.mode) { + case 'sta': + set_default(config, 'multi_ap_backhaul_sta', config.multi_ap); + break; + + case 'adhoc': + config.ap_scan = 2; + config.scan_ssid = 0; + network_append('mode', 1); + set_fixed_freq(data, config); + break; + + case 'mesh': + config.ssid = config.mesh_id; + config.scan_ssid = null; + network_append('mode', 5); + + set_fixed_freq(data, config); + + if (config.encryption && config.encryption != 'none') + config.key_mgmt = 'SAE'; + + config.ieee80211w = null; + break; + } + + if (config.mode != 'mesh' ) { + switch(config.wpa) { + case 1: + config.proto = 'WPA'; + break; + + case 2: + config.proto = 'RSN'; + break; + } + } + + switch(config.auth_type) { + case 'none': + break; + + case 'owe': + iface.wpa_key_mgmt(config); + break; + + case 'psk': + case 'psk2': + case 'sae': + case 'psk-sae': + if (config.mode != 'mesh') + iface.wpa_key_mgmt(config); + + if (config.mode == 'mesh' || config.auth_type == 'sae') + config.sae_password = `"${config.key}"`; + else + config.psk = `"${config.key}"`; + + break; + + case 'eap': + case 'eap2': + case 'eap192': + iface.wpa_key_mgmt(config); + set_default(config, 'erp', config.fils); + + if (config.ca_cert_usesystem && fs.stat('/etc/ssl/certs/ca-certificates.crt')) + config.ca_cert = '/etc/ssl/certs/ca-certificates.crt'; + + switch(config.eap_type) { + case 'fast': + case 'peap': + case 'ttls': + set_default(config, 'auth', 'MSCHAPV2'); + if (config.auth == 'EAP-TLS') { + if (config.ca_cert2_usesystem && fs.stat('/etc/ssl/certs/ca-certificates.crt')) + config.ca_cert2 = '/etc/ssl/certs/ca-certificates.crt'; + } + break; + } + + } + + if (config.wpa_pairwise == 'GCMP') { + config.pairwise = 'GCMP'; + config.group = 'GCMP'; + } + + config.basic_rate = ratelist(config.basic_rate); + config.mcast_rate = ratestr(config.mcast_rate); + config.ssid = `"${config.ssid}"`; + + network_append_vars(config, [ + 'scan_ssid', 'noscan', 'disabled', 'multi_ap_backhaul_sta', + 'ocv', 'key_mgmt', 'psk', 'sae_password', 'pairwise', 'group', 'bssid', + 'proto', 'mesh_fwding', 'mesh_rssi_threshold', 'frequency', 'fixed_freq', + 'disable_ht', 'disable_ht40', 'disable_vht', 'vht', 'max_oper_chwidth', + 'ht40', 'ssid', 'beacon_int', 'ieee80211w', 'basic_rate', 'mcast_rate', + 'bssid_blacklist', 'bssid_whitelist', 'erp', 'ca_cert', 'identity', + 'anonymous_identity', 'client_cert', 'private_key', 'private_key_passwd', + 'subject_match', 'altsubject_match', 'domain_match', 'domain_suffix_match', + 'ca_cert2', 'client_cert2', 'private_key2', 'private_key2_passwd', 'password' + ]); +} + +export function generate(config_list, data, interface) { + flush_network(); + + if (interface.bridge && + (interface.config.mode == 'adhoc' || + (interface.config.mode == 'sta' && !interface.config.wds && !interface.config.multi_ap))){ + netifd.setup_failed('BRIDGE_NOT_ALLOWED'); + return 1; + } + + interface.config.country = data.config.country; + interface.config.beacon_int = data.config.beacon_int; + + setup_sta(data.config, interface.config); + + let file_name = `/var/run/wpa-supplicant-${interface.config.ifname}.conf`; + if (fs.stat(file_name)) + fs.rename(file_name, file_name + '.prev'); + dump_network(file_name); + + let config = { + mode: interface.config.mode, + ctrl: '/var/run/wpa_supplicant', + iface: interface.config.ifname, + config: file_name, + '4addr': !!interface.config.wds, + powersave: false + }; + + if (!interface.config.default_macaddr) + config.macaddr = interface.config.macaddr; + + if (interface.config.wds) + config.bridge = interface.bridge; + + push(config_list, config); + + return config; +}; + +export function setup(config, data) { + let ret = global.ubus.call('wpa_supplicant', 'config_set', { + phy: data.phy, + radio: data.config.radio, + config, + defer: true, + num_global_macaddr: data.config.num_global_macaddr, + }); + + if (ret) + netifd.add_process('/usr/sbin/wpa_supplicant', ret.pid, true, true); + else + netifd.setup_failed('SUPPLICANT_START_FAILED'); +}; + + +export function start(data) { + global.ubus.call('wpa_supplicant', 'config_set', { + phy: data.phy, + radio: data.config.radio, + num_global_macaddr: data.config.num_global_macaddr, + }); +}; diff --git a/package/network/config/wifi-scripts/files-ucode/usr/share/ucode/wifi/validate.uc b/package/network/config/wifi-scripts/files-ucode/usr/share/ucode/wifi/validate.uc new file mode 100644 index 00000000000000..e675b7a6ca0893 --- /dev/null +++ b/package/network/config/wifi-scripts/files-ucode/usr/share/ucode/wifi/validate.uc @@ -0,0 +1,121 @@ +'use strict'; + +import { log } from 'wifi.common'; +import * as fs from 'fs'; + +const schemas = { + device: json(fs.readfile('/usr/share/schema/wireless.wifi-device.json')).properties, + iface: json(fs.readfile('/usr/share/schema/wireless.wifi-iface.json')).properties, + vlan: json(fs.readfile('/usr/share/schema/wireless.wifi-vlan.json')).properties, + station: json(fs.readfile('/usr/share/schema/wireless.wifi-station.json')).properties, +}; + +const types = { + "array": 1, + "string": 3, + "number": 5, + "boolean": 7, +}; + +function dump_option(schema, key) { + let _key = (schema[key].type == 'alias') ? schema[key].default : key; + + return [ + key, + types[schema[_key].type] + ]; +} + +export function dump_options() { + let dump = { + "name": "mac80211", + }; + + for (let k, v in schemas) { + dump[k] = []; + for (let option in v) + push(dump[k], dump_option(v, option)); + }; + + printf('%J\n', dump); + + return 0; +}; + +function abort(msg) { + log(msg); + die(); +} + +function validate_value(schema, key, value) { + switch(schema.type) { + case 'number': + value = +value; + if (schema.minimum && value < schema.minimum) + abort(`${key}: ${value} is lower than the minimum value`); + if (schema.maximum && value > schema.maximum) + abort(`${key}: ${value} is larger than the maximum value`); + if (schema.enum && !(value in schema.enum)) + abort(`${key}: ${value} has to be one of ${schema.enum}`); + break; + + case 'boolean': + value = !!+value; + break; + + case 'string': + if (schema.enum && !(value in schema.enum)) + abort(`${key}: ${value} has to be one of ${schema.enum}`); + break; + + case 'array': + if (type(value) != 'array') + value = [ value ]; + if (schema.items?.type) + for (let k, v in value) + value[k] = validate_value(schema.items, key, v); + break; + } + + return value; +} + +export function validate(schema, dict) { + schema = schemas[schema]; + + /* complain about anything that is not in the schema */ + for (let k, v in dict) { + if (substr(k, 0, 1) == '.') + continue; + if (schema[k]) + continue; + log(`${k} is not present in the schema`); + } + + /* convert all aliases */ + for (let k, v in dict) { + if (schema[k]?.type != 'alias') + continue; + if (schema[k].default == null) + abort(`${k} alias does not have a default value`); + + dict[schema[k].default] = v; + delete dict[k]; + } + + /* set defaults */ + for (let k, v in schema) { + if (schema[k]?.type == 'alias') + continue; + if (dict[k] != null || schema[k].default == null) + continue; + dict[k] = schema[k].default; + } + + /* validate value constraints */ + for (let k, v in dict) { + if (!schema[k]) + continue; + dict[k] = validate_value(schema[k], k, v); + } +}; From f342255025e323626cb5887605a1f2eb609b206c Mon Sep 17 00:00:00 2001 From: John Crispin Date: Mon, 2 Dec 2024 12:37:52 +0100 Subject: [PATCH 12/48] mediatek: filogic: enable CONFIG_LEDS_TRIGGER_PATTERN The boot LED on OpenWrt One is PWM driven and sets the pattern trigger as the default inside its devicetree. Signed-off-by: John Crispin --- target/linux/mediatek/filogic/config-6.6 | 1 + 1 file changed, 1 insertion(+) diff --git a/target/linux/mediatek/filogic/config-6.6 b/target/linux/mediatek/filogic/config-6.6 index 85e7367f41cfe5..e0a715a56b187d 100644 --- a/target/linux/mediatek/filogic/config-6.6 +++ b/target/linux/mediatek/filogic/config-6.6 @@ -226,6 +226,7 @@ CONFIG_JBD2=y CONFIG_JUMP_LABEL=y CONFIG_LEDS_PWM=y CONFIG_LEDS_SMARTRG_LED=y +CONFIG_LEDS_TRIGGER_PATTERN=y CONFIG_LIBFDT=y CONFIG_LOCK_DEBUGGING_SUPPORT=y CONFIG_LOCK_SPIN_ON_OWNER=y From 5c12fe45b98d9edab88b580b23dbe3528b025fd5 Mon Sep 17 00:00:00 2001 From: John Crispin Date: Fri, 29 Nov 2024 09:13:52 +0100 Subject: [PATCH 13/48] target/metadata: set OpenWrt One as the default menuconfig target/profile Signed-off-by: John Crispin --- include/target.mk | 1 + scripts/metadata.pm | 1 + scripts/target-metadata.pl | 10 +++++++++- target/linux/mediatek/filogic/target.mk | 1 + 4 files changed, 12 insertions(+), 1 deletion(-) diff --git a/include/target.mk b/include/target.mk index 02ea68b15c8121..a4428efab710dd 100644 --- a/include/target.mk +++ b/include/target.mk @@ -375,6 +375,7 @@ define BuildTargets/DumpCurrent echo 'Target-Description:'; \ echo "$$$$DESCRIPTION"; \ echo '@@'; \ + $(if $(DEFAULT_PROFILE),echo 'Target-Default-Profile: $(DEFAULT_PROFILE)';) \ echo 'Default-Packages: $(DEFAULT_PACKAGES) $(call extra_packages,$(DEFAULT_PACKAGES))'; \ $(DUMPINFO) $(if $(CUR_SUBTARGET),$(SUBMAKE) -r --no-print-directory -C image -s DUMP=1 SUBTARGET=$(CUR_SUBTARGET)) diff --git a/scripts/metadata.pm b/scripts/metadata.pm index ecfe42c0bc926c..dec9e62dff1295 100644 --- a/scripts/metadata.pm +++ b/scripts/metadata.pm @@ -136,6 +136,7 @@ sub parse_target_metadata($) { /^Linux-Kernel-Arch:\s*(.+)\s*$/ and $target->{karch} = $1; /^Default-Subtarget:\s*(.+)\s*$/ and $target->{def_subtarget} = $1; /^Default-Packages:\s*(.+)\s*$/ and $target->{packages} = [ split(/\s+/, $1) ]; + /^Target-Default-Profile:\s*(.+)\s*$/ and $target->{default_profile} = $1; /^Target-Profile:\s*(.+)\s*$/ and do { $profile = { id => $1, diff --git a/scripts/target-metadata.pl b/scripts/target-metadata.pl index 0c17e2e3273df6..ce96d1e7d538a1 100755 --- a/scripts/target-metadata.pl +++ b/scripts/target-metadata.pl @@ -179,7 +179,7 @@ () print <{profiles}->[0]; + foreach my $p (@{$target->{profiles}}) { + last unless $target->{default_profile}; + my $name = $p->{id}; + $name =~ s/^DEVICE_//; + next unless $name eq $target->{default_profile}; + $profile = $p; + last; + } $profile or next; print <{conf}_$profile->{id} if TARGET_$target->{conf} && !BUILDBOT diff --git a/target/linux/mediatek/filogic/target.mk b/target/linux/mediatek/filogic/target.mk index d1637e06af700e..52ce25de1ee2f8 100644 --- a/target/linux/mediatek/filogic/target.mk +++ b/target/linux/mediatek/filogic/target.mk @@ -4,6 +4,7 @@ BOARDNAME:=Filogic 8x0 (MT798x) CPU_TYPE:=cortex-a53 DEFAULT_PACKAGES += fitblk kmod-phy-aquantia kmod-crypto-hw-safexcel wpad-basic-mbedtls uboot-envtools KERNELNAME:=Image dtbs +DEFAULT_PROFILE:=openwrt_one define Target/Description Build firmware images for MediaTek Filogic ARM based boards. From 83491965715eea103c9386494e2643ba644ad248 Mon Sep 17 00:00:00 2001 From: John Crispin Date: Tue, 5 Nov 2024 09:40:24 +0100 Subject: [PATCH 14/48] fstools: update to latest HEAD Rename jffs2reset to factoryreset. Convert all scripts to using the new command line. Print a deprecation notice when jffs2reset is invoked. 49d36ba jffs2reset: rename to factoryreset b135064 jffs2reset: print deprecation message Signed-off-by: John Crispin --- package/base-files/files/etc/rc.button/reset | 2 +- package/base-files/files/sbin/firstboot | 2 +- package/system/fstools/Makefile | 11 ++++++----- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/package/base-files/files/etc/rc.button/reset b/package/base-files/files/etc/rc.button/reset index 2403122ad21d1a..84651334710dce 100755 --- a/package/base-files/files/etc/rc.button/reset +++ b/package/base-files/files/etc/rc.button/reset @@ -23,7 +23,7 @@ released) elif [ "$SEEN" -ge 5 -a -n "$OVERLAY" ] then echo "FACTORY RESET" > /dev/console - jffs2reset -y && reboot & + factoryreset -y && reboot & fi ;; esac diff --git a/package/base-files/files/sbin/firstboot b/package/base-files/files/sbin/firstboot index d9af57d59645bc..3dd6f1e7d24676 100755 --- a/package/base-files/files/sbin/firstboot +++ b/package/base-files/files/sbin/firstboot @@ -1,3 +1,3 @@ #!/bin/sh -/sbin/jffs2reset $@ +/sbin/factoryreset $@ diff --git a/package/system/fstools/Makefile b/package/system/fstools/Makefile index 419cdfff9aea2c..2f30915bf98525 100644 --- a/package/system/fstools/Makefile +++ b/package/system/fstools/Makefile @@ -12,9 +12,9 @@ PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(PROJECT_GIT)/project/fstools.git -PKG_MIRROR_HASH:=5f04ce2b346d9a48468180dd9601ca0fcc83896ebf5466855578e766646e14a1 -PKG_SOURCE_DATE:=2024-07-14 -PKG_SOURCE_VERSION:=408c2cc48e6694446c89da7f8121b399063e1067 +PKG_MIRROR_HASH:=b0de38a758cccdb234d909eda3bf4de40d260f75000f27d30e7d1bc4158b1094 +PKG_SOURCE_DATE:=2024-12-02 +PKG_SOURCE_VERSION:=49d36ba2d1ada4ca177612cfbe904beb286dcab7 CMAKE_INSTALL:=1 PKG_LICENSE:=GPL-2.0 @@ -95,9 +95,10 @@ endef define Package/fstools/install $(INSTALL_DIR) $(1)/sbin $(1)/lib - $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/{mount_root,jffs2reset} $(1)/sbin/ + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/{mount_root,factoryreset} $(1)/sbin/ $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/libfstools.so $(1)/lib/ - $(LN) jffs2reset $(1)/sbin/jffs2mark + $(LN) factoryreset $(1)/sbin/jffs2mark + $(LN) factoryreset $(1)/sbin/jffs2reset endef define Package/snapshot-tool/install From 41f7322853621ea14a2d057cd6322014307acc02 Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Mon, 2 Dec 2024 01:05:01 +0000 Subject: [PATCH 15/48] meson: allow using staging python Introduce package flag MESON_USE_STAGING_PYTHON which allows packages to be built with the OpenWrt-built python3/host instead of relying on the buildhost's Python distribution. This is useful for packages using Meson which require additional Python modules during build. Signed-off-by: Daniel Golle --- include/meson.mk | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/include/meson.mk b/include/meson.mk index fdb94b65425ab3..62dc7bd5dec30b 100644 --- a/include/meson.mk +++ b/include/meson.mk @@ -55,8 +55,14 @@ else MESON_CPU:="$(CPU_TYPE)$(if $(CPU_SUBTYPE),+$(CPU_SUBTYPE))" endif +ifeq ($(MESON_USE_STAGING_PYTHON),) +PYTHON_BIN:=$(STAGING_DIR_HOST)/bin/$(PYTHON) +else +PYTHON_BIN:=$(STAGING_DIR_HOSTPKG)/bin/$(PYTHON) +endif + define Meson - $(2) $(STAGING_DIR_HOST)/bin/$(PYTHON) $(STAGING_DIR_HOST)/bin/meson.py $(1) + $(2) $(PYTHON_BIN) $(STAGING_DIR_HOST)/bin/meson.py $(1) endef define Meson/CreateNativeFile @@ -65,7 +71,7 @@ define Meson/CreateNativeFile -e "s|@CXX@|$(foreach BIN,$(HOSTCXX),'$(BIN)',)|" \ -e "s|@PKGCONFIG@|$(PKG_CONFIG)|" \ -e "s|@CMAKE@|$(STAGING_DIR_HOST)/bin/cmake|" \ - -e "s|@PYTHON@|$(STAGING_DIR_HOST)/bin/python3|" \ + -e "s|@PYTHON@|$(PYTHON_BIN)|" \ -e "s|@CFLAGS@|$(foreach FLAG,$(HOST_CFLAGS) $(HOST_CPPFLAGS),'$(FLAG)',)|" \ -e "s|@CXXFLAGS@|$(foreach FLAG,$(HOST_CXXFLAGS) $(HOST_CPPFLAGS),'$(FLAG)',)|" \ -e "s|@LDFLAGS@|$(foreach FLAG,$(HOST_LDFLAGS),'$(FLAG)',)|" \ @@ -84,7 +90,7 @@ define Meson/CreateCrossFile -e "s|@NM@|$(TARGET_NM)|" \ -e "s|@PKGCONFIG@|$(PKG_CONFIG)|" \ -e "s|@CMAKE@|$(STAGING_DIR_HOST)/bin/cmake|" \ - -e "s|@PYTHON@|$(STAGING_DIR_HOST)/bin/python3|" \ + -e "s|@PYTHON@|$(PYTHON_BIN)|" \ -e "s|@CFLAGS@|$(foreach FLAG,$(TARGET_CFLAGS) $(EXTRA_CFLAGS) $(TARGET_CPPFLAGS) $(EXTRA_CPPFLAGS),'$(FLAG)',)|" \ -e "s|@CXXFLAGS@|$(foreach FLAG,$(TARGET_CXXFLAGS) $(EXTRA_CXXFLAGS) $(TARGET_CPPFLAGS) $(EXTRA_CPPFLAGS),'$(FLAG)',)|" \ -e "s|@LDFLAGS@|$(foreach FLAG,$(TARGET_LDFLAGS) $(EXTRA_LDFLAGS),'$(FLAG)',)|" \ From 53ee2e8c0339c1d7ace47b8cf390147b86ea8d1d Mon Sep 17 00:00:00 2001 From: Christian Marangi Date: Tue, 3 Dec 2024 11:30:18 +0100 Subject: [PATCH 16/48] build: Unconditionally append kmod feed for BuildBot Recent changes to BuildBot config moved the kmods to a dedicated directory and dropped them from the packages dir. This was needed as both OPKG and APK gets confused if both entry are present. To fix this, unconditionally append the kmod feed line if CONFIG_BUILDBOT is enabled. Fixes: #17146 Link: https://github.com/openwrt/openwrt/pull/17151 Signed-off-by: Christian Marangi --- include/feeds.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/feeds.mk b/include/feeds.mk index 87b1562c3edbf7..c3a47cf5f92252 100644 --- a/include/feeds.mk +++ b/include/feeds.mk @@ -37,7 +37,7 @@ define FeedSourcesAppendOPKG echo 'src/gz %d_core %U/targets/%S/packages'; \ $(strip $(if $(CONFIG_PER_FEED_REPO), \ echo 'src/gz %d_base %U/packages/%A/base'; \ - $(if $(filter %SNAPSHOT-y,$(VERSION_NUMBER)-$(CONFIG_BUILDBOT)), \ + $(if $(CONFIG_BUILDBOT), \ echo 'src/gz %d_kmods %U/targets/%S/kmods/$(LINUX_VERSION)-$(LINUX_RELEASE)-$(LINUX_VERMAGIC)';) \ $(foreach feed,$(FEEDS_AVAILABLE), \ $(if $(CONFIG_FEED_$(feed)), \ @@ -51,7 +51,7 @@ define FeedSourcesAppendAPK echo '%U/targets/%S/packages/packages.adb'; \ $(strip $(if $(CONFIG_PER_FEED_REPO), \ echo '%U/packages/%A/base/packages.adb'; \ - $(if $(filter %SNAPSHOT-y,$(VERSION_NUMBER)-$(CONFIG_BUILDBOT)), \ + $(if $(CONFIG_BUILDBOT), \ echo '%U/targets/%S/kmods/$(LINUX_VERSION)-$(LINUX_RELEASE)-$(LINUX_VERMAGIC)/packages.adb';) \ $(foreach feed,$(FEEDS_AVAILABLE), \ $(if $(CONFIG_FEED_$(feed)), \ From 3ba6737f2f4750e4f7c2b921ff023a99b9a27318 Mon Sep 17 00:00:00 2001 From: John Crispin Date: Tue, 3 Dec 2024 14:22:26 +0100 Subject: [PATCH 17/48] wifi-scripts: various minor fixes to the new ucode scripts * cosmetic clean up * properly import the digest module * typo fixes Signed-off-by: John Crispin --- .../files-ucode/usr/share/ucode/iwinfo.uc | 21 +++++++------------ .../files-ucode/usr/share/ucode/wifi/ap.uc | 9 ++++---- .../usr/share/ucode/wifi/hostapd.uc | 2 +- 3 files changed, 14 insertions(+), 18 deletions(-) diff --git a/package/network/config/wifi-scripts/files-ucode/usr/share/ucode/iwinfo.uc b/package/network/config/wifi-scripts/files-ucode/usr/share/ucode/iwinfo.uc index 71672c23adc423..a266092bea3ad6 100644 --- a/package/network/config/wifi-scripts/files-ucode/usr/share/ucode/iwinfo.uc +++ b/package/network/config/wifi-scripts/files-ucode/usr/share/ucode/iwinfo.uc @@ -58,7 +58,7 @@ function get_hardware_id(iface) { }; let path = `/sys/class/ieee80211/phy${iface.wiphy}/device/`; - if (stat(path) + 'vendor') { + if (stat(path + 'vendor')) { let data = []; for (let lookup in [ 'vendor', 'device', 'subsystem_vendor', 'subsystem_device' ]) push(data, trim(readfile(path + lookup), '\n')); @@ -162,16 +162,11 @@ function format_band(freq) { } function format_frequency(freq) { - if (!freq) - return 'unknown'; - freq = '' + freq; - return substr(freq, 0, 1) + '.' + substr(freq, 1); + return freq ? sprintf('%.03f', freq / 1000.0) : 'unknown'; } function format_rate(rate) { - if (!rate) - return 'unknown'; - return '' + (rate / 10) + '.' + (rate % 10); + return rate ? sprintf('%.01f', rate / 10.0) : 'unknown'; } function format_mgmt_key(key) { @@ -269,7 +264,7 @@ function dbm2mw(dbm) { for (let k = 0; k < ip; k++) res *= 10; for (let k = 0; k < fp; k++) - res *= 1.25892541179; + res *= LOG10_MAGIC; return int(res); } @@ -554,23 +549,23 @@ export function scan(dev) { case 48: cell.crypto = { - group: rsn_cipher[+ord(ie.data, 5)] ?? '', + group: rsn_cipher[ord(ie.data, 5)] ?? '', pair: [], key_mgmt: [], }; let offset = 6; - let count = +ord(ie.data, offset); + let count = ord(ie.data, offset); offset += 2; for (let i = 0; i < count; i++) { - let key = rsn_cipher[+ord(ie.data, offset + 3)]; + let key = rsn_cipher[ord(ie.data, offset + 3)]; if (key) push(cell.crypto.pair, key); offset += 4; } - count = +ord(ie.data, offset); + count = ord(ie.data, offset); offset += 2; for (let i = 0; i < count; i++) { diff --git a/package/network/config/wifi-scripts/files-ucode/usr/share/ucode/wifi/ap.uc b/package/network/config/wifi-scripts/files-ucode/usr/share/ucode/wifi/ap.uc index cc2900de9da7ea..37864487c310ab 100644 --- a/package/network/config/wifi-scripts/files-ucode/usr/share/ucode/wifi/ap.uc +++ b/package/network/config/wifi-scripts/files-ucode/usr/share/ucode/wifi/ap.uc @@ -1,6 +1,7 @@ 'use strict'; import * as libuci from 'uci'; +import { md5 } from 'digest'; import * as fs from 'fs'; import { append, append_raw, append_value, append_vars, comment, push_config, set_default, touch_file } from 'wifi.common'; @@ -140,10 +141,10 @@ function iface_auth_type(config) { config.vlan_possible = 1; if (config.fils) { - set_default(config, 'erp_domain', substr(digest.md5(config.ssid), 0, 4)); + set_default(config, 'erp_domain', substr(md5(config.ssid), 0, 4)); set_default(config, 'fils_realm', config.erp_domain); set_default(config, 'erp_send_reauth_start', 1); - set_default(config, 'fils_cache_id', substr(digest.md5(config.fils_realm), 0, 4)); + set_default(config, 'fils_cache_id', substr(md5(config.fils_realm), 0, 4)); } if (!config.eap_server) { @@ -329,7 +330,7 @@ function iface_roaming(config) { if (!config.ieee80211r || config.wpa < 2) return; - set_default(config, 'mobility_domain', substr(digest.md5(config.ssid), 0, 4)); + set_default(config, 'mobility_domain', substr(md5(config.ssid), 0, 4)); set_default(config, 'ft_psk_generate_local', config.auth_type == 'psk'); set_default(config, 'ft_iface', config.network_ifname); @@ -338,7 +339,7 @@ function iface_roaming(config) { if (!config.auth_secret && !config.key) netifd.setup_failed('FT_KEY_CANT_BE_DERIVED'); - let ft_key = digest.md5(`${mobility_domain}/${auth_secret ?? key}`); + let ft_key = md5(`${mobility_domain}/${auth_secret ?? key}`); set_default(config, 'r0kh', 'ff:ff:ff:ff:ff:ff,*,' + ft_key); set_default(config, 'r1kh', '00:00:00:00:00:00,00:00:00:00:00:00,' + ft_key); diff --git a/package/network/config/wifi-scripts/files-ucode/usr/share/ucode/wifi/hostapd.uc b/package/network/config/wifi-scripts/files-ucode/usr/share/ucode/wifi/hostapd.uc index a17f6b547435d3..78b38ff63334fb 100644 --- a/package/network/config/wifi-scripts/files-ucode/usr/share/ucode/wifi/hostapd.uc +++ b/package/network/config/wifi-scripts/files-ucode/usr/share/ucode/wifi/hostapd.uc @@ -333,7 +333,7 @@ function device_htmode_append(config) { config.vht_capab += rx_stbc[min(config.rx_stbc, (vht_capab >> 8) & 7)]; if (vht_capab & 0x800 && config.su_beamformer) - config.vht_capab += '[SOUNDING-DIMENSION' + min(((vht_capab >> 16) & 3) + 1, config.beamformer_antennas) + ']'; + config.vht_capab += '[SOUNDING-DIMENSION-' + min(((vht_capab >> 16) & 3) + 1, config.beamformer_antennas) + ']'; if (vht_capab & 0x1000 && config.su_beamformee) config.vht_capab += '[BF-ANTENNA-' + min(((vht_capab >> 13) & 3) + 1, config.beamformer_antennas) + ']'; From ce663856fbfd4bdfdc5e6dca07acda01f87cb7c3 Mon Sep 17 00:00:00 2001 From: Robert Marko Date: Mon, 2 Dec 2024 19:54:36 +0100 Subject: [PATCH 18/48] apk: update to Git HEAD (2024-11-30) 3da6c104f0f5 database: use APK_DB_LAYER_ROOT in more places 5437e3abada1 audit: add usr/lib/apk to the list of protected paths under --full de9baf912245 change default db location to /usr, but detect and use /lib if exists 218fdaa1a1a2 context: close root_fd on free d33294236cb4 database: add support for only-when-modified trigger paths 36935db0ef3b package: fix memfd_create warnings on Linux kernels < 6.7 1c3fc36051a3 blob: add and use apk_blob_trim_{start,end} af5f9e3f93b0 pkg: fix v3 package size setting to installeddb 9428e34694c8 version: allow --check and --test to work without database 4b4add5326a8 test: fix unit test registration function to be unique eac18cb200d4 test: add testlib.sh for user tests 20dae205b006 mkpkg: fix creation of package with hardlinks 7bdecdca6a95 pkg: only allow tags in world and some commands 76de228bcc0b commit: show tags of world constrains 9a1b1cf68420 test: use testlib for solver.sh 99fc2a2a5efc test: remove dependency on GNU tar 6927746b9a10 Revert usrmerge/LFS related changes to apk used paths 5d287a9b06e9 apk-tools-3.0.0_pre5 8d93a79fb895 mkpkg: fix hardlink on big-endian system Link: https://github.com/openwrt/openwrt/pull/17148 Signed-off-by: Robert Marko --- package/system/apk/Makefile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/package/system/apk/Makefile b/package/system/apk/Makefile index a8d4f0b050b306..6d8bf6e1bcf2f8 100644 --- a/package/system/apk/Makefile +++ b/package/system/apk/Makefile @@ -1,13 +1,13 @@ include $(TOPDIR)/rules.mk PKG_NAME:=apk -PKG_RELEASE:=2 +PKG_RELEASE:=1 PKG_SOURCE_URL=https://gitlab.alpinelinux.org/alpine/apk-tools.git PKG_SOURCE_PROTO:=git -PKG_SOURCE_DATE:=2024-11-13 -PKG_SOURCE_VERSION:=e3464d096708b270138653ef93db59134bb24813 -PKG_MIRROR_HASH:=cc633e5c294c9d92391fba5537dfe2f12f82011b55d282beb0d5d7ceba212962 +PKG_SOURCE_DATE:=2024-11-30 +PKG_SOURCE_VERSION:=8d93a79fb8958607f097be2c4ac97f4596faf91d +PKG_MIRROR_HASH:=565c87fac26e696c362c2fe85159cc3ed2fd27153f244c2e9dc0fd7fa67a4173 PKG_VERSION=3.0.0_pre$(subst -,,$(PKG_SOURCE_DATE)) From 557a7ca70ddc29177e45f0c120b6ae21fc38abbb Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Wed, 4 Dec 2024 13:31:24 +0100 Subject: [PATCH 19/48] build: add locking around dtc call after running mkits.sh mkits.sh creates a root.*.pagesync file with padding, which is global, and the generated .its files reference it. Since dtc reads this file, it must not run at the same time as mkits.sh Fixes generating itb images with broken rootfs. Signed-off-by: Felix Fietkau --- include/image-commands.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/image-commands.mk b/include/image-commands.mk index a627ffc202cc0a..2e129e0347d703 100644 --- a/include/image-commands.mk +++ b/include/image-commands.mk @@ -391,8 +391,8 @@ define Build/fit $(if $(DEVICE_DTS_OVERLAY),$(foreach dtso,$(DEVICE_DTS_OVERLAY), -O $(dtso):$(KERNEL_BUILD_DIR)/image-$(dtso).dtbo)) \ -c $(if $(DEVICE_DTS_CONFIG),$(DEVICE_DTS_CONFIG),"config-1") \ -A $(LINUX_KARCH) -v $(LINUX_VERSION), gen-cpio$(if $(TARGET_PER_DEVICE_ROOTFS),.$(ROOTFS_ID/$(DEVICE_NAME)))) - PATH=$(LINUX_DIR)/scripts/dtc:$(PATH) mkimage $(if $(findstring external,$(word 3,$(1))),\ - -E -B 0x1000 $(if $(findstring static,$(word 3,$(1))),-p 0x1000)) -f $@.its $@.new + $(call locked,PATH=$(LINUX_DIR)/scripts/dtc:$(PATH) mkimage $(if $(findstring external,$(word 3,$(1))),\ + -E -B 0x1000 $(if $(findstring static,$(word 3,$(1))),-p 0x1000)) -f $@.its $@.new) @mv $@.new $@ endef From d1275392916522d664e710752c517246540cbf73 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Tue, 19 Nov 2024 14:08:38 +0100 Subject: [PATCH 20/48] wifi-scripts: remove leftover legacy (non-netifd) wifi script support cfg80211 is the only supported wireless API Signed-off-by: Felix Fietkau --- .../config/wifi-scripts/files/sbin/wifi | 180 ------------------ 1 file changed, 180 deletions(-) diff --git a/package/network/config/wifi-scripts/files/sbin/wifi b/package/network/config/wifi-scripts/files/sbin/wifi index f937dba7e6d92d..c70723560b767d 100755 --- a/package/network/config/wifi-scripts/files/sbin/wifi +++ b/package/network/config/wifi-scripts/files/sbin/wifi @@ -37,135 +37,22 @@ wifi_isup() { return 0 } -find_net_config() {( - local vif="$1" - local cfg - local ifname - - config_get cfg "$vif" network - - [ -z "$cfg" ] && { - include /lib/network - scan_interfaces - - config_get ifname "$vif" ifname - - cfg="$(find_config "$ifname")" - } - [ -z "$cfg" ] && return 0 - echo "$cfg" -)} - - -bridge_interface() {( - local cfg="$1" - [ -z "$cfg" ] && return 0 - - include /lib/network - scan_interfaces - - for cfg in $cfg; do - config_get iftype "$cfg" type - [ "$iftype" = bridge ] && config_get "$cfg" ifname - prepare_interface_bridge "$cfg" - return $? - done -)} - -prepare_key_wep() { - local key="$1" - local hex=1 - - echo -n "$key" | grep -qE "[^a-fA-F0-9]" && hex=0 - [ "${#key}" -eq 10 -a $hex -eq 1 ] || \ - [ "${#key}" -eq 26 -a $hex -eq 1 ] || { - [ "${key:0:2}" = "s:" ] && key="${key#s:}" - key="$(echo -n "$key" | hexdump -ve '1/1 "%02x" ""')" - } - echo "$key" -} - -wifi_fixup_hwmode() { - local device="$1" - local default="$2" - local hwmode hwmode_11n - - config_get channel "$device" channel - config_get hwmode "$device" hwmode - case "$hwmode" in - 11bg) hwmode=bg;; - 11a) hwmode=a;; - 11ad) hwmode=ad;; - 11b) hwmode=b;; - 11g) hwmode=g;; - 11n*) - hwmode_11n="${hwmode##11n}" - case "$hwmode_11n" in - a|g) ;; - default) hwmode_11n="$default" - esac - config_set "$device" hwmode_11n "$hwmode_11n" - ;; - *) - hwmode= - if [ "${channel:-0}" -gt 0 ]; then - if [ "${channel:-0}" -gt 14 ]; then - hwmode=a - else - hwmode=g - fi - else - hwmode="$default" - fi - ;; - esac - config_set "$device" hwmode "$hwmode" -} - -_wifi_updown() { - for device in ${2:-$DEVICES}; do ( - config_get disabled "$device" disabled - [ "$disabled" = "1" ] && { - echo "'$device' is disabled" - set disable - } - config_get iftype "$device" type - if eval "type ${1}_$iftype" 2>/dev/null >/dev/null; then - eval "scan_$iftype '$device'" - eval "${1}_$iftype '$device'" || echo "$device($iftype): ${1} failed" - elif [ ! -f /lib/netifd/wireless/$iftype.sh ]; then - echo "$device($iftype): Interface type not supported" - fi - ); done -} - wifi_updown() { cmd=down [ enable = "$1" ] && { - _wifi_updown disable "$2" ubus_wifi_cmd "$cmd" "$2" ubus call network reload - scan_wifi cmd=up } [ reconf = "$1" ] && { ubus call network reload - scan_wifi cmd=reconf } ubus_wifi_cmd "$cmd" "$2" - _wifi_updown "$@" -} - -wifi_reload_legacy() { - _wifi_updown "disable" "$1" - scan_wifi - _wifi_updown "enable" "$1" } wifi_reload() { ubus call network reload - wifi_reload_legacy } wifi_detect_notice() { @@ -189,75 +76,9 @@ wifi_config() { ); done } -start_net() {( - local iface="$1" - local config="$2" - local vifmac="$3" - - [ -f "/var/run/$iface.pid" ] && kill "$(cat /var/run/${iface}.pid)" 2>/dev/null - [ -z "$config" ] || { - include /lib/network - scan_interfaces - for config in $config; do - setup_interface "$iface" "$config" "" "$vifmac" - done - } -)} - -set_wifi_up() { - local cfg="$1" - local ifname="$2" - uci_set_state wireless "$cfg" up 1 - uci_set_state wireless "$cfg" ifname "$ifname" -} - -set_wifi_down() { - local cfg="$1" - local vifs vif vifstr - - [ -f "/var/run/wifi-${cfg}.pid" ] && - kill "$(cat "/var/run/wifi-${cfg}.pid")" 2>/dev/null - uci_revert_state wireless "$cfg" - config_get vifs "$cfg" vifs - for vif in $vifs; do - uci_revert_state wireless "$vif" - done -} - -scan_wifi() { - local cfgfile="$1" - DEVICES= - config_cb() { - local type="$1" - local section="$2" - - # section start - case "$type" in - wifi-device) - append DEVICES "$section" - config_set "$section" vifs "" - config_set "$section" ht_capab "" - ;; - esac - - # section end - config_get TYPE "$CONFIG_SECTION" TYPE - case "$TYPE" in - wifi-iface) - config_get device "$CONFIG_SECTION" device - config_get vifs "$device" vifs - append vifs "$CONFIG_SECTION" - config_set "$device" vifs "$vifs" - ;; - esac - } - config_load "${cfgfile:-wireless}" -} - DEVICES= DRIVERS= include /lib/wifi -scan_wifi case "$1" in down) wifi_updown "disable" "$2";; @@ -266,7 +87,6 @@ case "$1" in status) ubus_wifi_cmd "status" "$2";; isup) wifi_isup "$2"; exit $?;; reload) wifi_reload "$2";; - reload_legacy) wifi_reload_legacy "$2";; --help|help) usage;; reconf) wifi_updown "reconf" "$2";; ''|up) wifi_updown "enable" "$2";; From a9ff3ba24b9466d9c06b9a9e1c2e9672bdd9f6f9 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Wed, 4 Dec 2024 11:59:14 +0100 Subject: [PATCH 21/48] wifi-scripts: add option to set per-device ifname prefix Simplifies setting ifname to a different pattern for all affected interfaces. Signed-off-by: Felix Fietkau --- .../files-ucode/lib/netifd/wireless/mac80211.sh | 7 +++++-- .../usr/share/schema/wireless.wifi-device.json | 4 ++++ .../files/lib/netifd/wireless/mac80211.sh | 14 +++++++++----- 3 files changed, 18 insertions(+), 7 deletions(-) diff --git a/package/network/config/wifi-scripts/files-ucode/lib/netifd/wireless/mac80211.sh b/package/network/config/wifi-scripts/files-ucode/lib/netifd/wireless/mac80211.sh index fe364b8f48e689..8b55d01e7a8b51 100755 --- a/package/network/config/wifi-scripts/files-ucode/lib/netifd/wireless/mac80211.sh +++ b/package/network/config/wifi-scripts/files-ucode/lib/netifd/wireless/mac80211.sh @@ -210,6 +210,9 @@ function setup() { } data.phy_suffix = phy_suffix(data.config.radio, ":"); data.vif_phy_suffix = phy_suffix(data.config.radio, "."); + data.ifname_prefix = data.config.ifname_prefix; + if (!data.ifname_prefix) + data.ifname_prefix = data.phy + data.vif_phy_suffix + "-"; let active_ifnames = []; log('Starting'); @@ -229,12 +232,12 @@ function setup() { let mode_idx = idx[mode]++; if (!v.config.ifname) - v.config.ifname = data.phy + data.vif_phy_suffix + "-" + mode + mode_idx; + v.config.ifname = data.ifname_prefix + mode + mode_idx; push(active_ifnames, v.config.ifname); if (v.config.encryption == 'owe' && v.config.owe_transition) { mode_idx = idx[mode]++; - v.config.owe_transition_ifname = data.phy + data.vif_phy_suffix + "-" + mode + mode_idx; + v.config.owe_transition_ifname = data.ifname_prefix + mode + mode_idx; push(active_ifnames, v.config.ifname); } diff --git a/package/network/config/wifi-scripts/files-ucode/usr/share/schema/wireless.wifi-device.json b/package/network/config/wifi-scripts/files-ucode/usr/share/schema/wireless.wifi-device.json index 9a7e777b633a83..0588401c99e639 100644 --- a/package/network/config/wifi-scripts/files-ucode/usr/share/schema/wireless.wifi-device.json +++ b/package/network/config/wifi-scripts/files-ucode/usr/share/schema/wireless.wifi-device.json @@ -396,6 +396,10 @@ "type": "alias", "default": "assoc_sa_query_retry_timeout" }, + "ifname_prefix": { + "description": "Default ifname prefix for this radio", + "type": "string" + }, "iface_max_num_sta": { "description": "Limits the maximum allowed number of associated clients", "type": "number" diff --git a/package/network/config/wifi-scripts/files/lib/netifd/wireless/mac80211.sh b/package/network/config/wifi-scripts/files/lib/netifd/wireless/mac80211.sh index 3d953eff74d2fa..f65128783fa5bb 100755 --- a/package/network/config/wifi-scripts/files/lib/netifd/wireless/mac80211.sh +++ b/package/network/config/wifi-scripts/files/lib/netifd/wireless/mac80211.sh @@ -29,6 +29,7 @@ drv_mac80211_init_device_config() { config_add_string path phy 'macaddr:macaddr' config_add_string tx_burst config_add_string distance + config_add_string ifname_prefix config_add_int radio beacon_int chanbw frag rts config_add_int rxantenna txantenna txpower min_tx_power config_add_int num_global_macaddr multiple_bssid @@ -660,9 +661,9 @@ mac80211_check_ap() { } mac80211_set_ifname() { - local phy="$1" - local prefix="$2" - eval "ifname=\"$phy-$prefix\${idx_$prefix:-0}\"; idx_$prefix=\$((\${idx_$prefix:-0 } + 1))" + local prefix="$1" + local type="$2" + eval "ifname=\"$prefix$type\${idx_$type:-0}\"; idx_$type=\$((\${idx_$type:-0 } + 1))" } mac80211_prepare_vif() { @@ -679,7 +680,7 @@ mac80211_prepare_vif() { monitor) prefix=mon;; esac - mac80211_set_ifname "$phy$vif_phy_suffix" "$prefix" + mac80211_set_ifname "$ifname_prefix" "$prefix" } append active_ifnames "$ifname" @@ -1105,7 +1106,8 @@ drv_mac80211_setup() { txpower \ rxantenna txantenna \ frag rts beacon_int:100 htmode \ - num_global_macaddr:1 multiple_bssid + num_global_macaddr:1 multiple_bssid \ + ifname_prefix json_get_values basic_rate_list basic_rate json_get_values scan_list scan_list json_select .. @@ -1124,6 +1126,8 @@ drv_mac80211_setup() { return 1 } + set_default ifname_prefix "$phy$vif_phy_suffix-" + local wdev local cwdev local found From d92d14c64ce0baed9fd00e347baa111ecc1cdeab Mon Sep 17 00:00:00 2001 From: Robert Marko Date: Wed, 4 Dec 2024 15:09:23 +0100 Subject: [PATCH 22/48] hostapd: enable EAP-pwd support only for the SSL variants The internal hostapd version cannot be built with EAP-pwd support, so enable it only for the SSL variants. Fixes: #17163 Fixes: 6365316fab87 ("hostapd: add ubus support for wired driver") Link: https://github.com/openwrt/openwrt/pull/17164 Signed-off-by: Robert Marko --- package/network/services/hostapd/Makefile | 8 ++++---- .../network/services/hostapd/files/hostapd-full.config | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package/network/services/hostapd/Makefile b/package/network/services/hostapd/Makefile index 16dfbff2b06d5c..44c73586cac49a 100644 --- a/package/network/services/hostapd/Makefile +++ b/package/network/services/hostapd/Makefile @@ -5,7 +5,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=hostapd -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE_URL:=https://w1.fi/hostap.git PKG_SOURCE_PROTO:=git @@ -110,7 +110,7 @@ ifeq ($(SSL_VARIANT),openssl) DRIVER_MAKEOPTS += CONFIG_AP=y CONFIG_MESH=y endif ifeq ($(LOCAL_VARIANT),full) - DRIVER_MAKEOPTS += CONFIG_OWE=y CONFIG_SUITEB192=y CONFIG_AP=y CONFIG_MESH=y + DRIVER_MAKEOPTS += CONFIG_OWE=y CONFIG_SUITEB192=y CONFIG_AP=y CONFIG_MESH=y CONFIG_EAP_PWD=y endif endif @@ -125,7 +125,7 @@ ifeq ($(SSL_VARIANT),wolfssl) DRIVER_MAKEOPTS += CONFIG_AP=y CONFIG_MESH=y CONFIG_WPS_NFC=1 endif ifeq ($(LOCAL_VARIANT),full) - DRIVER_MAKEOPTS += CONFIG_OWE=y CONFIG_SUITEB192=y CONFIG_AP=y CONFIG_MESH=y CONFIG_WPS_NFC=1 + DRIVER_MAKEOPTS += CONFIG_OWE=y CONFIG_SUITEB192=y CONFIG_AP=y CONFIG_MESH=y CONFIG_WPS_NFC=1 CONFIG_EAP_PWD=y endif endif @@ -140,7 +140,7 @@ ifeq ($(SSL_VARIANT),mbedtls) DRIVER_MAKEOPTS += CONFIG_AP=y CONFIG_MESH=y CONFIG_WPS_NFC=1 endif ifeq ($(LOCAL_VARIANT),full) - DRIVER_MAKEOPTS += CONFIG_OWE=y CONFIG_SUITEB192=y CONFIG_AP=y CONFIG_MESH=y CONFIG_WPS_NFC=1 + DRIVER_MAKEOPTS += CONFIG_OWE=y CONFIG_SUITEB192=y CONFIG_AP=y CONFIG_MESH=y CONFIG_WPS_NFC=1 CONFIG_EAP_PWD=y endif endif diff --git a/package/network/services/hostapd/files/hostapd-full.config b/package/network/services/hostapd/files/hostapd-full.config index 2ac2a312d177c6..a72ad0f3b47c53 100644 --- a/package/network/services/hostapd/files/hostapd-full.config +++ b/package/network/services/hostapd/files/hostapd-full.config @@ -97,7 +97,7 @@ CONFIG_EAP_TTLS=y CONFIG_EAP_PSK=y # EAP-pwd for the integrated EAP server (secure authentication with a password) -CONFIG_EAP_PWD=y +#CONFIG_EAP_PWD=y # EAP-SAKE for the integrated EAP server #CONFIG_EAP_SAKE=y From b4cc5743d90103a0536b07c618f21bfd5685fbe2 Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Thu, 5 Dec 2024 01:32:00 +0000 Subject: [PATCH 23/48] feeds.conf.default: enable video feed by default As discussed in the previous OpenWrt meeting the easiest way to have regular builds of packages on the video feed without adding additional complexity is by enabling the video feed by default. If that slows down the buildbots beyond being useful we can always disable it again and find another way to only sporadically build packages of the video feed. Signed-off-by: Daniel Golle --- feeds.conf.default | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/feeds.conf.default b/feeds.conf.default index fc679335e0e47f..05f5c8c47c7ae4 100644 --- a/feeds.conf.default +++ b/feeds.conf.default @@ -2,7 +2,7 @@ src-git packages https://git.openwrt.org/feed/packages.git src-git luci https://git.openwrt.org/project/luci.git src-git routing https://git.openwrt.org/feed/routing.git src-git telephony https://git.openwrt.org/feed/telephony.git -#src-git video https://github.com/openwrt/video.git +src-git video https://github.com/openwrt/video.git #src-git targets https://github.com/openwrt/targets.git #src-git oldpackages http://git.openwrt.org/packages.git #src-link custom /usr/src/openwrt/custom-feed From 1aa2695620891afe718ed38930a7a8305871b86c Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Thu, 5 Dec 2024 14:17:32 +0100 Subject: [PATCH 24/48] wifi-scripts: fix roaming setup with ucode scripts - fix variable references for ft key - add r0kh and r1kh if ft_generate_local is not set (logic inversion bug) Signed-off-by: Felix Fietkau --- .../wifi-scripts/files-ucode/usr/share/ucode/wifi/ap.uc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/package/network/config/wifi-scripts/files-ucode/usr/share/ucode/wifi/ap.uc b/package/network/config/wifi-scripts/files-ucode/usr/share/ucode/wifi/ap.uc index 37864487c310ab..8db3fc34b31530 100644 --- a/package/network/config/wifi-scripts/files-ucode/usr/share/ucode/wifi/ap.uc +++ b/package/network/config/wifi-scripts/files-ucode/usr/share/ucode/wifi/ap.uc @@ -334,15 +334,15 @@ function iface_roaming(config) { set_default(config, 'ft_psk_generate_local', config.auth_type == 'psk'); set_default(config, 'ft_iface', config.network_ifname); - if (config.ft_psk_generate_local) { + if (!config.ft_psk_generate_local) { if (!config.r0kh || !config.r1kh) { if (!config.auth_secret && !config.key) netifd.setup_failed('FT_KEY_CANT_BE_DERIVED'); - let ft_key = md5(`${mobility_domain}/${auth_secret ?? key}`); + let ft_key = md5(`${config.mobility_domain}/${config.auth_secret ?? config.key}`); - set_default(config, 'r0kh', 'ff:ff:ff:ff:ff:ff,*,' + ft_key); - set_default(config, 'r1kh', '00:00:00:00:00:00,00:00:00:00:00:00,' + ft_key); + set_default(config, 'r0kh', 'ff:ff:ff:ff:ff:ff * ' + ft_key); + set_default(config, 'r1kh', '00:00:00:00:00:00 00:00:00:00:00:00 ' + ft_key); } append_vars(config, [ From 89bb4050f7c555db4738f52d22f51ddb94875d4f Mon Sep 17 00:00:00 2001 From: Rui Salvaterra Date: Thu, 28 Nov 2024 20:41:37 +0200 Subject: [PATCH 25/48] busybox: update to 1.37.0 Add a patch to fix non-x86 builds, refresh patches and update/fix the configuration as described in 98b09ba250 (cited here for future reference). Config refresh: Refresh commands, run after busybox is first built once: cd package/utils/busybox/config/ ../convert_menuconfig.pl ../../../../build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/busybox-default/busybox-1.37.0 cd .. ./convert_defaults.pl ../../../build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/busybox-default/busybox-1.37.0/.config > Config-defaults.in Manual edits needed after config refresh: * Config-defaults.in: OpenWrt config symbol IPV6 logic applied to BUSYBOX_DEFAULT_FEATURE_IPV6 * Config-defaults.in: OpenWrt config TARGET_bcm53xx logic applied to BUSYBOX_DEFAULT_TRUNCATE (commit 547f1ec) * Config-defaults.in: OpenWrt logic applied to BUSYBOX_DEFAULT_LOGIN_SESSION_AS_CHILD (commit dc92917) * Config-defaults.in: correct the default ports that get reset BUSYBOX_DEFAULT_FEATURE_HTTPD_PORT_DEFAULT 80 BUSYBOX_DEFAULT_FEATURE_TELNETD_PORT_DEFAULT 23 * config/editors/Config.in: Add USE_GLIBC dependency to BUSYBOX_CONFIG_FEATURE_VI_REGEX_SEARCH (commit f141090) * config/shell/Config.in: change at "Options common to all shells" the conditional symbol SHELL_ASH --> BUSYBOX_CONFIG_SHELL_ASH (discussion in http://lists.openwrt.org/pipermail/openwrt-devel/2021-January/033140.html Apparently our script does not see the hidden option while prepending config options with "BUSYBOX_CONFIG_" which leads to a missed dependency when the options are later evaluated.) * Edit a few Config.in files by adding quotes to sourced items in config/Config.in, config/networking/Config.in and config/util-linux/Config.in (commit 1da014fcca) Signed-off-by: Rui Salvaterra [rebased with the change download line commit] [corrected version in the refresh example in commit message] Signed-off-by: Hannu Nyman Link: https://github.com/openwrt/openwrt/pull/17107 Signed-off-by: Hauke Mehrtens --- package/utils/busybox/Config-defaults.in | 18 +- package/utils/busybox/Makefile | 6 +- package/utils/busybox/config/Config.in | 11 ++ .../utils/busybox/config/archival/Config.in | 12 +- .../busybox/config/console-tools/Config.in | 30 +-- .../utils/busybox/config/coreutils/Config.in | 187 +++++++++--------- .../busybox/config/debianutils/Config.in | 6 +- .../utils/busybox/config/e2fsprogs/Config.in | 6 +- .../utils/busybox/config/editors/Config.in | 12 +- .../utils/busybox/config/findutils/Config.in | 17 +- package/utils/busybox/config/init/Config.in | 6 +- .../busybox/config/klibc-utils/Config.in | 4 +- .../utils/busybox/config/loginutils/Config.in | 26 +-- .../utils/busybox/config/mailutils/Config.in | 6 +- .../utils/busybox/config/miscutils/Config.in | 89 +++++---- .../utils/busybox/config/modutils/Config.in | 6 +- .../utils/busybox/config/networking/Config.in | 64 +++--- .../busybox/config/networking/udhcp/Config.in | 11 +- .../utils/busybox/config/printutils/Config.in | 6 +- package/utils/busybox/config/procps/Config.in | 42 ++-- package/utils/busybox/config/runit/Config.in | 20 +- package/utils/busybox/config/shell/Config.in | 11 +- .../utils/busybox/config/sysklogd/Config.in | 8 +- .../utils/busybox/config/util-linux/Config.in | 117 +++++------ .../patches/001-fix-non-x86-build.patch | 14 ++ .../patches/200-udhcpc_reduce_msgs.patch | 4 +- .../patches/201-udhcpc_changed_ifindex.patch | 2 +- .../301-ip-link-fix-netlink-msg-size.patch | 2 +- ...-transaction-IDs-for-the-DNS-queries.patch | 2 +- 29 files changed, 402 insertions(+), 343 deletions(-) create mode 100644 package/utils/busybox/patches/001-fix-non-x86-build.patch diff --git a/package/utils/busybox/Config-defaults.in b/package/utils/busybox/Config-defaults.in index f88f395e2cb5c9..26d3e642ce7b89 100644 --- a/package/utils/busybox/Config-defaults.in +++ b/package/utils/busybox/Config-defaults.in @@ -28,6 +28,9 @@ config BUSYBOX_DEFAULT_FEATURE_COMPRESS_USAGE config BUSYBOX_DEFAULT_LFS bool default y +config BUSYBOX_DEFAULT_TIME64 + bool + default n config BUSYBOX_DEFAULT_PAM bool default n @@ -1181,6 +1184,9 @@ config BUSYBOX_DEFAULT_FEATURE_FIND_EXEC config BUSYBOX_DEFAULT_FEATURE_FIND_EXEC_PLUS bool default n +config BUSYBOX_DEFAULT_FEATURE_FIND_EXEC_OK + bool + default n config BUSYBOX_DEFAULT_FEATURE_FIND_USER bool default y @@ -2051,6 +2057,9 @@ config BUSYBOX_DEFAULT_FLASH_UNLOCK config BUSYBOX_DEFAULT_FLASHCP bool default n +config BUSYBOX_DEFAULT_GETFATTR + bool + default n config BUSYBOX_DEFAULT_HDPARM bool default n @@ -2457,6 +2466,9 @@ config BUSYBOX_DEFAULT_FEATURE_IP_ADDRESS config BUSYBOX_DEFAULT_FEATURE_IP_LINK bool default y +config BUSYBOX_DEFAULT_FEATURE_IP_LINK_CAN + bool + default n config BUSYBOX_DEFAULT_FEATURE_IP_ROUTE bool default y @@ -2682,6 +2694,9 @@ config BUSYBOX_DEFAULT_ZCIP config BUSYBOX_DEFAULT_UDHCPD bool default n +config BUSYBOX_DEFAULT_FEATURE_UDHCPD_BOOTP + bool + default n config BUSYBOX_DEFAULT_FEATURE_UDHCPD_BASE_IP_ON_MAC bool default n @@ -3042,9 +3057,6 @@ config BUSYBOX_DEFAULT_ASH_PRINTF config BUSYBOX_DEFAULT_ASH_TEST bool default y -config BUSYBOX_DEFAULT_ASH_SLEEP - bool - default n config BUSYBOX_DEFAULT_ASH_HELP bool default n diff --git a/package/utils/busybox/Makefile b/package/utils/busybox/Makefile index 4ef470df755890..7094b1e22db212 100644 --- a/package/utils/busybox/Makefile +++ b/package/utils/busybox/Makefile @@ -5,14 +5,14 @@ include $(TOPDIR)/rules.mk PKG_NAME:=busybox -PKG_VERSION:=1.36.1 -PKG_RELEASE:=2 +PKG_VERSION:=1.37.0 +PKG_RELEASE:=1 PKG_FLAGS:=essential PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 PKG_SOURCE_URL:=https://www.busybox.net/downloads \ https://sources.buildroot.net/$(PKG_NAME) -PKG_HASH:=b8cc24c9574d809e7279c3be349795c5d5ceb6fdf19ca709f80cde50e47de314 +PKG_HASH:=3311dff32e746499f4df0d5df04d7eb396382d7e108bb9250e7b519b837043a4 PKG_BUILD_DEPENDS:=BUSYBOX_CONFIG_PAM:libpam PKG_BUILD_PARALLEL:=1 diff --git a/package/utils/busybox/config/Config.in b/package/utils/busybox/config/Config.in index f30629839e0d86..f1bd8ef12fda9e 100644 --- a/package/utils/busybox/config/Config.in +++ b/package/utils/busybox/config/Config.in @@ -107,6 +107,17 @@ config BUSYBOX_CONFIG_LFS programs that can benefit from large file support include dd, gzip, cp, mount, tar. +config BUSYBOX_CONFIG_TIME64 + bool "Support 64bit wide time types" + default BUSYBOX_DEFAULT_TIME64 + depends on BUSYBOX_CONFIG_LFS + help + Make times later than 2038 representable for several libc syscalls + (stat, clk_gettime etc.). Note this switch is specific to glibc + and has no effect on platforms that already use 64bit wide time types + (i.e. all 64bit archs and some selected 32bit archs (currently riscv + and x32)). + config BUSYBOX_CONFIG_PAM bool "Support PAM (Pluggable Authentication Modules)" default BUSYBOX_DEFAULT_PAM diff --git a/package/utils/busybox/config/archival/Config.in b/package/utils/busybox/config/archival/Config.in index ac2b3d20562e03..a3eebdce0f003d 100644 --- a/package/utils/busybox/config/archival/Config.in +++ b/package/utils/busybox/config/archival/Config.in @@ -80,7 +80,7 @@ config BUSYBOX_CONFIG_FEATURE_GUNZIP_LONG_OPTIONS default BUSYBOX_DEFAULT_FEATURE_GUNZIP_LONG_OPTIONS depends on (BUSYBOX_CONFIG_GUNZIP || BUSYBOX_CONFIG_ZCAT) && BUSYBOX_CONFIG_LONG_OPTS config BUSYBOX_CONFIG_BUNZIP2 - bool "bunzip2 (8.7 kb)" + bool "bunzip2 (9.1 kb)" default BUSYBOX_DEFAULT_BUNZIP2 select BUSYBOX_CONFIG_FEATURE_BZIP2_DECOMPRESS help @@ -94,13 +94,13 @@ config BUSYBOX_CONFIG_BUNZIP2 should probably say N here. config BUSYBOX_CONFIG_BZCAT - bool "bzcat (8.7 kb)" + bool "bzcat (9 kb)" default BUSYBOX_DEFAULT_BZCAT select BUSYBOX_CONFIG_FEATURE_BZIP2_DECOMPRESS help Alias to "bunzip2 -c". config BUSYBOX_CONFIG_UNLZMA - bool "unlzma (7.5 kb)" + bool "unlzma (7.8 kb)" default BUSYBOX_DEFAULT_UNLZMA help unlzma is a compression utility using the Lempel-Ziv-Markov chain @@ -109,7 +109,7 @@ config BUSYBOX_CONFIG_UNLZMA compressors. config BUSYBOX_CONFIG_LZCAT - bool "lzcat (7.5 kb)" + bool "lzcat (7.8 kb)" default BUSYBOX_DEFAULT_LZCAT help Alias to "unlzma -c". @@ -229,7 +229,7 @@ config BUSYBOX_CONFIG_DPKG This implementation of dpkg has a number of limitations, you should use the official dpkg if possible. config BUSYBOX_CONFIG_DPKG_DEB - bool "dpkg-deb (30 kb)" + bool "dpkg-deb (29 kb)" default BUSYBOX_DEFAULT_DPKG_DEB select BUSYBOX_CONFIG_FEATURE_SEAMLESS_GZ help @@ -282,7 +282,7 @@ config BUSYBOX_CONFIG_FEATURE_GZIP_DECOMPRESS This will be automatically selected if gunzip or zcat is enabled. config BUSYBOX_CONFIG_LZOP - bool "lzop (12 kb)" + bool "lzop (13 kb)" default BUSYBOX_DEFAULT_LZOP help Lzop compression/decompresion. diff --git a/package/utils/busybox/config/console-tools/Config.in b/package/utils/busybox/config/console-tools/Config.in index cf224e5e2e8dc6..35161782123c7e 100644 --- a/package/utils/busybox/config/console-tools/Config.in +++ b/package/utils/busybox/config/console-tools/Config.in @@ -7,39 +7,39 @@ menu "Console Utilities" config BUSYBOX_CONFIG_CHVT - bool "chvt (2 kb)" + bool "chvt (2.2 kb)" default BUSYBOX_DEFAULT_CHVT help This program is used to change to another terminal. Example: chvt 4 (change to terminal /dev/tty4) config BUSYBOX_CONFIG_CLEAR - bool "clear (tiny)" + bool "clear (371 bytes)" default BUSYBOX_DEFAULT_CLEAR help This program clears the terminal screen. config BUSYBOX_CONFIG_DEALLOCVT - bool "deallocvt (1.9 kb)" + bool "deallocvt (2.2 kb)" default BUSYBOX_DEFAULT_DEALLOCVT help This program deallocates unused virtual consoles. config BUSYBOX_CONFIG_DUMPKMAP - bool "dumpkmap (1.6 kb)" + bool "dumpkmap (1.9 kb)" default BUSYBOX_DEFAULT_DUMPKMAP help This program dumps the kernel's keyboard translation table to stdout, in binary format. You can then use loadkmap to load it. config BUSYBOX_CONFIG_FGCONSOLE - bool "fgconsole (1.5 kb)" + bool "fgconsole (1.8 kb)" default BUSYBOX_DEFAULT_FGCONSOLE help This program prints active (foreground) console number. config BUSYBOX_CONFIG_KBD_MODE - bool "kbd_mode (4.1 kb)" + bool "kbd_mode (4.3 kb)" default BUSYBOX_DEFAULT_KBD_MODE help This program reports and sets keyboard mode. config BUSYBOX_CONFIG_LOADFONT - bool "loadfont (5.2 kb)" + bool "loadfont (5.4 kb)" default BUSYBOX_DEFAULT_LOADFONT help This program loads a console font from standard input. @@ -78,25 +78,25 @@ config BUSYBOX_CONFIG_FEATURE_LOADFONT_RAW default BUSYBOX_DEFAULT_FEATURE_LOADFONT_RAW depends on BUSYBOX_CONFIG_LOADFONT || BUSYBOX_CONFIG_SETFONT config BUSYBOX_CONFIG_LOADKMAP - bool "loadkmap (1.8 kb)" + bool "loadkmap (2.1 kb)" default BUSYBOX_DEFAULT_LOADKMAP help This program loads a keyboard translation table from standard input. config BUSYBOX_CONFIG_OPENVT - bool "openvt (7.2 kb)" + bool "openvt (7.4 kb)" default BUSYBOX_DEFAULT_OPENVT help This program is used to start a command on an unused virtual terminal. config BUSYBOX_CONFIG_RESET - bool "reset (345 bytes)" + bool "reset (676 bytes)" default BUSYBOX_DEFAULT_RESET help This program is used to reset the terminal screen, if it gets messed up. config BUSYBOX_CONFIG_RESIZE - bool "resize (903 bytes)" + bool "resize (1.2 kb)" default BUSYBOX_DEFAULT_RESIZE help This program is used to (re)set the width and height of your current @@ -112,7 +112,7 @@ config BUSYBOX_CONFIG_FEATURE_RESIZE_PRINT E.g.: COLUMNS=80;LINES=44;export COLUMNS LINES; config BUSYBOX_CONFIG_SETCONSOLE - bool "setconsole (3.6 kb)" + bool "setconsole (3.8 kb)" default BUSYBOX_DEFAULT_SETCONSOLE help Redirect writes to /dev/console to another device, @@ -125,18 +125,18 @@ config BUSYBOX_CONFIG_FEATURE_SETCONSOLE_LONG_OPTIONS default BUSYBOX_DEFAULT_FEATURE_SETCONSOLE_LONG_OPTIONS depends on BUSYBOX_CONFIG_SETCONSOLE && BUSYBOX_CONFIG_LONG_OPTS config BUSYBOX_CONFIG_SETKEYCODES - bool "setkeycodes (2.1 kb)" + bool "setkeycodes (2.4 kb)" default BUSYBOX_DEFAULT_SETKEYCODES help This program loads entries into the kernel's scancode-to-keycode map, allowing unusual keyboards to generate usable keycodes. config BUSYBOX_CONFIG_SETLOGCONS - bool "setlogcons (1.8 kb)" + bool "setlogcons (2 kb)" default BUSYBOX_DEFAULT_SETLOGCONS help This program redirects the output console of kernel messages. config BUSYBOX_CONFIG_SHOWKEY - bool "showkey (4.7 kb)" + bool "showkey (4.9 kb)" default BUSYBOX_DEFAULT_SHOWKEY help Shows keys pressed. diff --git a/package/utils/busybox/config/coreutils/Config.in b/package/utils/busybox/config/coreutils/Config.in index 983740be6ed12b..8ba5afc5e4c67b 100644 --- a/package/utils/busybox/config/coreutils/Config.in +++ b/package/utils/busybox/config/coreutils/Config.in @@ -48,14 +48,14 @@ config BUSYBOX_CONFIG_FEATURE_HUMAN_READABLE Allow df, du, and ls to have human readable output. config BUSYBOX_CONFIG_BASENAME - bool "basename (438 bytes)" + bool "basename (3.7 kb)" default BUSYBOX_DEFAULT_BASENAME help basename is used to strip the directory and suffix from filenames, leaving just the filename itself. Enable this option if you wish to enable the 'basename' utility. config BUSYBOX_CONFIG_CAT - bool "cat (5.6 kb)" + bool "cat (5.8 kb)" default BUSYBOX_DEFAULT_CAT help cat is used to concatenate files and print them to the standard @@ -96,20 +96,20 @@ config BUSYBOX_CONFIG_FEATURE_CHOWN_LONG_OPTIONS default BUSYBOX_DEFAULT_FEATURE_CHOWN_LONG_OPTIONS depends on BUSYBOX_CONFIG_CHOWN && BUSYBOX_CONFIG_LONG_OPTS config BUSYBOX_CONFIG_CHROOT - bool "chroot (3.7 kb)" + bool "chroot (4 kb)" default BUSYBOX_DEFAULT_CHROOT help chroot is used to change the root directory and run a command. The default command is '/bin/sh'. config BUSYBOX_CONFIG_CKSUM - bool "cksum (4.1 kb)" + bool "cksum (4.3 kb)" default BUSYBOX_DEFAULT_CKSUM config BUSYBOX_CONFIG_CRC32 - bool "crc32 (4.1 kb)" + bool "crc32 (4.2 kb)" default BUSYBOX_DEFAULT_CRC32 config BUSYBOX_CONFIG_COMM - bool "comm (4.2 kb)" + bool "comm (4.4 kb)" default BUSYBOX_DEFAULT_COMM help comm is used to compare two files line by line and return @@ -133,7 +133,7 @@ config BUSYBOX_CONFIG_FEATURE_CP_REFLINK default BUSYBOX_DEFAULT_FEATURE_CP_REFLINK depends on BUSYBOX_CONFIG_FEATURE_CP_LONG_OPTIONS config BUSYBOX_CONFIG_CUT - bool "cut (5.8 kb)" + bool "cut (6.7 kb)" default BUSYBOX_DEFAULT_CUT help cut is used to print selected parts of lines from @@ -146,7 +146,7 @@ config BUSYBOX_CONFIG_FEATURE_CUT_REGEX help Allow regex based delimiters. config BUSYBOX_CONFIG_DATE - bool "date (7 kb)" + bool "date (7.2 kb)" default BUSYBOX_DEFAULT_DATE help date is used to set the system date or display the @@ -183,7 +183,7 @@ config BUSYBOX_CONFIG_FEATURE_DATE_COMPAT the same format. With it on, 'date DATE' additionally supports MMDDhhmm[[YY]YY][.ss] format. config BUSYBOX_CONFIG_DD - bool "dd (7.5 kb)" + bool "dd (8.3 kb)" default BUSYBOX_DEFAULT_DD help dd copies a file (from standard input to standard output, @@ -227,7 +227,7 @@ config BUSYBOX_CONFIG_FEATURE_DD_STATUS help Enable support for status=noxfer/none option. config BUSYBOX_CONFIG_DF - bool "df (6.8 kb)" + bool "df (7.1 kb)" default BUSYBOX_DEFAULT_DF help df reports the amount of disk space used and available @@ -262,26 +262,26 @@ config BUSYBOX_CONFIG_FEATURE_SKIP_ROOTFS Otherwise, choose Y. config BUSYBOX_CONFIG_DIRNAME - bool "dirname (329 bytes)" + bool "dirname (611 bytes)" default BUSYBOX_DEFAULT_DIRNAME help dirname is used to strip a non-directory suffix from a file name. config BUSYBOX_CONFIG_DOS2UNIX - bool "dos2unix (5.2 kb)" + bool "dos2unix (5.5 kb)" default BUSYBOX_DEFAULT_DOS2UNIX help dos2unix is used to convert a text file from DOS format to UNIX format, and vice versa. config BUSYBOX_CONFIG_UNIX2DOS - bool "unix2dos (5.2 kb)" + bool "unix2dos (5.5 kb)" default BUSYBOX_DEFAULT_UNIX2DOS help unix2dos is used to convert a text file from UNIX format to DOS format, and vice versa. config BUSYBOX_CONFIG_DU - bool "du (6.3 kb)" + bool "du (6.5 kb)" default BUSYBOX_DEFAULT_DU help du is used to report the amount of disk space used @@ -292,7 +292,7 @@ config BUSYBOX_CONFIG_FEATURE_DU_DEFAULT_BLOCKSIZE_1K default BUSYBOX_DEFAULT_FEATURE_DU_DEFAULT_BLOCKSIZE_1K depends on BUSYBOX_CONFIG_DU config BUSYBOX_CONFIG_ECHO - bool "echo (1.8 kb)" + bool "echo (2 kb)" default BUSYBOX_DEFAULT_ECHO help echo prints a specified string to stdout. @@ -303,25 +303,25 @@ config BUSYBOX_CONFIG_FEATURE_FANCY_ECHO default BUSYBOX_DEFAULT_FEATURE_FANCY_ECHO depends on BUSYBOX_CONFIG_ECHO || BUSYBOX_CONFIG_ASH_ECHO || BUSYBOX_CONFIG_HUSH_ECHO config BUSYBOX_CONFIG_ENV - bool "env (4 kb)" + bool "env (4.3 kb)" default BUSYBOX_DEFAULT_ENV help env is used to set an environment variable and run a command; without options it displays the current environment. config BUSYBOX_CONFIG_EXPAND - bool "expand (5.1 kb)" + bool "expand (5.3 kb)" default BUSYBOX_DEFAULT_EXPAND help By default, convert all tabs to spaces. config BUSYBOX_CONFIG_UNEXPAND - bool "unexpand (5.3 kb)" + bool "unexpand (5.5 kb)" default BUSYBOX_DEFAULT_UNEXPAND help By default, convert only leading sequences of blanks to tabs. config BUSYBOX_CONFIG_EXPR - bool "expr (6.6 kb)" + bool "expr (6.8 kb)" default BUSYBOX_DEFAULT_EXPR help expr is used to calculate numbers and print the result @@ -336,22 +336,22 @@ config BUSYBOX_CONFIG_EXPR_MATH_SUPPORT_64 the applet slightly larger, but will allow computation with very large numbers. config BUSYBOX_CONFIG_FACTOR - bool "factor (2.7 kb)" + bool "factor (3.2 kb)" default BUSYBOX_DEFAULT_FACTOR help factor factorizes integers config BUSYBOX_CONFIG_FALSE - bool "false (tiny)" + bool "false (314 bytes)" default BUSYBOX_DEFAULT_FALSE help false returns an exit code of FALSE (1). config BUSYBOX_CONFIG_FOLD - bool "fold (4.6 kb)" + bool "fold (4.8 kb)" default BUSYBOX_DEFAULT_FOLD help Wrap text to fit a specific width. config BUSYBOX_CONFIG_HEAD - bool "head (3.8 kb)" + bool "head (4 kb)" default BUSYBOX_DEFAULT_HEAD help head is used to print the first specified number of lines @@ -362,19 +362,19 @@ config BUSYBOX_CONFIG_FEATURE_FANCY_HEAD default BUSYBOX_DEFAULT_FEATURE_FANCY_HEAD depends on BUSYBOX_CONFIG_HEAD config BUSYBOX_CONFIG_HOSTID - bool "hostid (286 bytes)" + bool "hostid (566 bytes)" default BUSYBOX_DEFAULT_HOSTID help hostid prints the numeric identifier (in hexadecimal) for the current host. config BUSYBOX_CONFIG_ID - bool "id (7 kb)" + bool "id (7.1 kb)" default BUSYBOX_DEFAULT_ID help id displays the current user and group ID names. config BUSYBOX_CONFIG_GROUPS - bool "groups (6.7 kb)" + bool "groups (6.8 kb)" default BUSYBOX_DEFAULT_GROUPS help Print the group names associated with current user id. @@ -389,17 +389,17 @@ config BUSYBOX_CONFIG_FEATURE_INSTALL_LONG_OPTIONS default BUSYBOX_DEFAULT_FEATURE_INSTALL_LONG_OPTIONS depends on BUSYBOX_CONFIG_INSTALL && BUSYBOX_CONFIG_LONG_OPTS config BUSYBOX_CONFIG_LINK - bool "link (3.2 kb)" + bool "link (3.5 kb)" default BUSYBOX_DEFAULT_LINK help link creates hard links between files. config BUSYBOX_CONFIG_LN - bool "ln (4.9 kb)" + bool "ln (5.1 kb)" default BUSYBOX_DEFAULT_LN help ln is used to create hard or soft links between files. config BUSYBOX_CONFIG_LOGNAME - bool "logname (1.1 kb)" + bool "logname (1.4 kb)" default BUSYBOX_DEFAULT_LOGNAME help logname is used to print the current user's login name. @@ -468,31 +468,31 @@ config BUSYBOX_CONFIG_FEATURE_LS_COLOR_IS_DEFAULT configurable, and the output may not be legible on many output screens. config BUSYBOX_CONFIG_MD5SUM - bool "md5sum (6.5 kb)" + bool "md5sum (6.7 kb)" default BUSYBOX_DEFAULT_MD5SUM help Compute and check MD5 message digest config BUSYBOX_CONFIG_SHA1SUM - bool "sha1sum (5.9 kb)" + bool "sha1sum (6.7 kb)" default BUSYBOX_DEFAULT_SHA1SUM help Compute and check SHA1 message digest config BUSYBOX_CONFIG_SHA256SUM - bool "sha256sum (7 kb)" + bool "sha256sum (8.2 kb)" default BUSYBOX_DEFAULT_SHA256SUM help Compute and check SHA256 message digest config BUSYBOX_CONFIG_SHA512SUM - bool "sha512sum (7.4 kb)" + bool "sha512sum (7.3 kb)" default BUSYBOX_DEFAULT_SHA512SUM help Compute and check SHA512 message digest config BUSYBOX_CONFIG_SHA3SUM - bool "sha3sum (6.1 kb)" + bool "sha3sum (6.3 kb)" default BUSYBOX_DEFAULT_SHA3SUM help Compute and check SHA3 message digest @@ -509,24 +509,24 @@ config BUSYBOX_CONFIG_FEATURE_MD5_SHA1_SUM_CHECK against pre-calculated hash values. -s and -w are useful options when verifying checksums. config BUSYBOX_CONFIG_MKDIR - bool "mkdir (4.5 kb)" + bool "mkdir (4.7 kb)" default BUSYBOX_DEFAULT_MKDIR help mkdir is used to create directories with the specified names. config BUSYBOX_CONFIG_MKFIFO - bool "mkfifo (3.8 kb)" + bool "mkfifo (4 kb)" default BUSYBOX_DEFAULT_MKFIFO help mkfifo is used to create FIFOs (named pipes). The 'mknod' program can also create FIFOs. config BUSYBOX_CONFIG_MKNOD - bool "mknod (4.5 kb)" + bool "mknod (4.6 kb)" default BUSYBOX_DEFAULT_MKNOD help mknod is used to create FIFOs or block/character special files with the specified names. config BUSYBOX_CONFIG_MKTEMP - bool "mktemp (4.2 kb)" + bool "mktemp (4.5 kb)" default BUSYBOX_DEFAULT_MKTEMP help mktemp is used to create unique temporary files @@ -536,22 +536,22 @@ config BUSYBOX_CONFIG_MV help mv is used to move or rename files or directories. config BUSYBOX_CONFIG_NICE - bool "nice (2.1 kb)" + bool "nice (2.3 kb)" default BUSYBOX_DEFAULT_NICE help nice runs a program with modified scheduling priority. config BUSYBOX_CONFIG_NL - bool "nl (4.6 kb)" + bool "nl (4.9 kb)" default BUSYBOX_DEFAULT_NL help nl is used to number lines of files. config BUSYBOX_CONFIG_NOHUP - bool "nohup (2 kb)" + bool "nohup (2.2 kb)" default BUSYBOX_DEFAULT_NOHUP help run a command immune to hangups, with output to a non-tty. config BUSYBOX_CONFIG_NPROC - bool "nproc (3.7 kb)" + bool "nproc (3.9 kb)" default BUSYBOX_DEFAULT_NPROC help Print number of CPUs @@ -561,29 +561,29 @@ config BUSYBOX_CONFIG_OD help od is used to dump binary files in octal and other formats. config BUSYBOX_CONFIG_PASTE - bool "paste (4.9 kb)" + bool "paste (5.1 kb)" default BUSYBOX_DEFAULT_PASTE help paste is used to paste lines of different files together and write the result to stdout config BUSYBOX_CONFIG_PRINTENV - bool "printenv (1.3 kb)" + bool "printenv (1.6 kb)" default BUSYBOX_DEFAULT_PRINTENV help printenv is used to print all or part of environment. config BUSYBOX_CONFIG_PRINTF - bool "printf (3.8 kb)" + bool "printf (4.1 kb)" default BUSYBOX_DEFAULT_PRINTF help printf is used to format and print specified strings. It's similar to 'echo' except it has more options. config BUSYBOX_CONFIG_PWD - bool "pwd (3.7 kb)" + bool "pwd (4 kb)" default BUSYBOX_DEFAULT_PWD help pwd is used to print the current directory. config BUSYBOX_CONFIG_READLINK - bool "readlink (4 kb)" + bool "readlink (4.8 kb)" default BUSYBOX_DEFAULT_READLINK help This program reads a symbolic link and returns the name @@ -596,49 +596,50 @@ config BUSYBOX_CONFIG_FEATURE_READLINK_FOLLOW help Enable the readlink option (-f). config BUSYBOX_CONFIG_REALPATH - bool "realpath (1.6 kb)" + bool "realpath (2.5 kb)" default BUSYBOX_DEFAULT_REALPATH help Return the canonicalized absolute pathname. This isn't provided by GNU shellutils, but where else does it belong. config BUSYBOX_CONFIG_RM - bool "rm (5.4 kb)" + bool "rm (5.5 kb)" default BUSYBOX_DEFAULT_RM help rm is used to remove files or directories. config BUSYBOX_CONFIG_RMDIR - bool "rmdir (3.5 kb)" + bool "rmdir (3.8 kb)" default BUSYBOX_DEFAULT_RMDIR help rmdir is used to remove empty directories. config BUSYBOX_CONFIG_SEQ - bool "seq (3.8 kb)" + bool "seq (4 kb)" default BUSYBOX_DEFAULT_SEQ help print a sequence of numbers config BUSYBOX_CONFIG_SHRED - bool "shred (4.9 kb)" + bool "shred (5.5 kb)" default BUSYBOX_DEFAULT_SHRED help Overwrite a file to hide its contents, and optionally delete it config BUSYBOX_CONFIG_SHUF - bool "shuf (5.4 kb)" + bool "shuf (6 kb)" default BUSYBOX_DEFAULT_SHUF help Generate random permutations config BUSYBOX_CONFIG_SLEEP - bool "sleep (2 kb)" + bool "sleep (2.4 kb)" default BUSYBOX_DEFAULT_SLEEP help sleep is used to pause for a specified number of seconds. - It comes in 3 versions: + It comes in 2 versions: - small: takes one integer parameter - - fancy: takes multiple integer arguments with suffixes: - sleep 1d 2h 3m 15s - - fancy with fractional numbers: - sleep 2.3s 4.5h sleeps for 16202.3 seconds - Last one is "the most compatible" with coreutils sleep, - but it adds around 1k of code. + - fancy: + * takes multiple integer arguments with suffixes: + sleep 1d 2h 3m 15s + * allows fractional numbers: + sleep 2.3s 4.5h sleeps for 16202.3 seconds + fancy is more compatible with coreutils sleep, but it adds around + 1k of code. config BUSYBOX_CONFIG_FEATURE_FANCY_SLEEP bool "Enable multiple arguments and s/m/h/d suffixes" @@ -647,7 +648,7 @@ config BUSYBOX_CONFIG_FEATURE_FANCY_SLEEP help Allow sleep to pause for specified minutes, hours, and days. config BUSYBOX_CONFIG_SORT - bool "sort (7.7 kb)" + bool "sort (8.1 kb)" default BUSYBOX_DEFAULT_SORT help sort is used to sort lines of text in specified files. @@ -672,7 +673,7 @@ config BUSYBOX_CONFIG_FEATURE_SORT_OPTIMIZE_MEMORY Attempt to use less memory (by storing only one copy of duplicated lines, and such). Useful if you work on huge files. config BUSYBOX_CONFIG_SPLIT - bool "split (5 kb)" + bool "split (5.2 kb)" default BUSYBOX_DEFAULT_SPLIT help Split a file into pieces. @@ -708,17 +709,17 @@ config BUSYBOX_CONFIG_FEATURE_STAT_FILESYSTEM Without this, stat will not support the '-f' option to display information about filesystem status. config BUSYBOX_CONFIG_STTY - bool "stty (8.9 kb)" + bool "stty (9.2 kb)" default BUSYBOX_DEFAULT_STTY help stty is used to change and print terminal line settings. config BUSYBOX_CONFIG_SUM - bool "sum (4 kb)" + bool "sum (4.2 kb)" default BUSYBOX_DEFAULT_SUM help checksum and count the blocks in a file config BUSYBOX_CONFIG_SYNC - bool "sync (3.8 kb)" + bool "sync (4 kb)" default BUSYBOX_DEFAULT_SYNC help sync is used to flush filesystem buffers. @@ -730,17 +731,17 @@ config BUSYBOX_CONFIG_FEATURE_SYNC_FANCY sync -d FILE... executes fdatasync() on each FILE. sync -f FILE... executes syncfs() on each FILE. config BUSYBOX_CONFIG_FSYNC - bool "fsync (3.6 kb)" + bool "fsync (3.8 kb)" default BUSYBOX_DEFAULT_FSYNC help fsync is used to flush file-related cached blocks to disk. config BUSYBOX_CONFIG_TAC - bool "tac (3.9 kb)" + bool "tac (4.1 kb)" default BUSYBOX_DEFAULT_TAC help tac is used to concatenate and print files in reverse. config BUSYBOX_CONFIG_TAIL - bool "tail (6.8 kb)" + bool "tail (7.2 kb)" default BUSYBOX_DEFAULT_TAIL help tail is used to print the last specified number of lines @@ -758,7 +759,7 @@ config BUSYBOX_CONFIG_FEATURE_FANCY_TAIL -v Always output headers giving file names -F Same as -f, but keep retrying config BUSYBOX_CONFIG_TEE - bool "tee (4.2 kb)" + bool "tee (4.4 kb)" default BUSYBOX_DEFAULT_TEE help tee is used to read from standard input and write @@ -771,7 +772,7 @@ config BUSYBOX_CONFIG_FEATURE_TEE_USE_BLOCK_IO help Enable this option for a faster tee, at expense of size. config BUSYBOX_CONFIG_TEST - bool "test (4.1 kb)" + bool "test (4.4 kb)" default BUSYBOX_DEFAULT_TEST help test is used to check file types and compare values, @@ -797,13 +798,13 @@ config BUSYBOX_CONFIG_FEATURE_TEST_64 help Enable 64-bit support in test. config BUSYBOX_CONFIG_TIMEOUT - bool "timeout (6 kb)" + bool "timeout (6.5 kb)" default BUSYBOX_DEFAULT_TIMEOUT help Runs a program and watches it. If it does not terminate in specified number of seconds, it is sent a signal. config BUSYBOX_CONFIG_TOUCH - bool "touch (5.9 kb)" + bool "touch (6.1 kb)" default BUSYBOX_DEFAULT_TOUCH help touch is used to create or change the access and/or @@ -816,7 +817,7 @@ config BUSYBOX_CONFIG_FEATURE_TOUCH_SUSV3 help Enable touch to use a reference file or a given date/time argument. config BUSYBOX_CONFIG_TR - bool "tr (5.1 kb)" + bool "tr (5.3 kb)" default BUSYBOX_DEFAULT_TR help tr is used to squeeze, and/or delete characters from standard @@ -841,29 +842,29 @@ config BUSYBOX_CONFIG_FEATURE_TR_EQUIV useful for cases when no other way of expressing a character is possible. config BUSYBOX_CONFIG_TRUE - bool "true (tiny)" + bool "true (311 bytes)" default BUSYBOX_DEFAULT_TRUE help true returns an exit code of TRUE (0). config BUSYBOX_CONFIG_TRUNCATE - bool "truncate (4.2 kb)" + bool "truncate (4.4 kb)" default BUSYBOX_DEFAULT_TRUNCATE help truncate truncates files to a given size. If a file does not exist, it is created unless told otherwise. config BUSYBOX_CONFIG_TSORT - bool "tsort (0.7 kb)" + bool "tsort (2.6 kb)" default BUSYBOX_DEFAULT_TSORT help tsort performs a topological sort. config BUSYBOX_CONFIG_TTY - bool "tty (3.6 kb)" + bool "tty (3.9 kb)" default BUSYBOX_DEFAULT_TTY help tty is used to print the name of the current terminal to standard output. config BUSYBOX_CONFIG_UNAME - bool "uname (3.9 kb)" + bool "uname (4.2 kb)" default BUSYBOX_DEFAULT_UNAME help uname is used to print system information. @@ -877,47 +878,47 @@ config BUSYBOX_CONFIG_UNAME_OSNAME default BUSYBOX_DEFAULT_UNAME_OSNAME "GNU/Linux". config BUSYBOX_CONFIG_BB_ARCH - bool "arch (1.1 kb)" + bool "arch (1.4 kb)" default BUSYBOX_DEFAULT_BB_ARCH help Same as uname -m. config BUSYBOX_CONFIG_UNIQ - bool "uniq (4.9 kb)" + bool "uniq (5.1 kb)" default BUSYBOX_DEFAULT_UNIQ help uniq is used to remove duplicate lines from a sorted file. config BUSYBOX_CONFIG_UNLINK - bool "unlink (3.2 kb)" + bool "unlink (3.5 kb)" default BUSYBOX_DEFAULT_UNLINK help unlink deletes a file by calling unlink() config BUSYBOX_CONFIG_USLEEP - bool "usleep (1.3 kb)" + bool "usleep (1.6 kb)" default BUSYBOX_DEFAULT_USLEEP help usleep is used to pause for a specified number of microseconds. config BUSYBOX_CONFIG_UUDECODE - bool "uudecode (5.8 kb)" + bool "uudecode (5.9 kb)" default BUSYBOX_DEFAULT_UUDECODE help uudecode is used to decode a uuencoded file. config BUSYBOX_CONFIG_BASE32 - bool "base32 (4.9 kb)" + bool "base32 (5.5 kb)" default BUSYBOX_DEFAULT_BASE32 help Base32 encode and decode config BUSYBOX_CONFIG_BASE64 - bool "base64 (4.9 kb)" + bool "base64 (5.3 kb)" default BUSYBOX_DEFAULT_BASE64 help Base64 encode and decode config BUSYBOX_CONFIG_UUENCODE - bool "uuencode (4.4 kb)" + bool "uuencode (4.7 kb)" default BUSYBOX_DEFAULT_UUENCODE help uuencode is used to uuencode a file. config BUSYBOX_CONFIG_WC - bool "wc (4.5 kb)" + bool "wc (4.7 kb)" default BUSYBOX_DEFAULT_WC help wc is used to print the number of bytes, words, and lines, @@ -930,33 +931,33 @@ config BUSYBOX_CONFIG_FEATURE_WC_LARGE help Use "unsigned long long" for counter variables. config BUSYBOX_CONFIG_WHO - bool "who (3.9 kb)" + bool "who (5.6 kb)" default BUSYBOX_DEFAULT_WHO depends on BUSYBOX_CONFIG_FEATURE_UTMP help Print users currently logged on. config BUSYBOX_CONFIG_W - bool "w (3.8 kb)" + bool "w (5.5 kb)" default BUSYBOX_DEFAULT_W depends on BUSYBOX_CONFIG_FEATURE_UTMP help Print users currently logged on. config BUSYBOX_CONFIG_USERS - bool "users (3.4 kb)" + bool "users (3.6 kb)" default BUSYBOX_DEFAULT_USERS depends on BUSYBOX_CONFIG_FEATURE_UTMP help Print users currently logged on. config BUSYBOX_CONFIG_WHOAMI - bool "whoami (3.2 kb)" + bool "whoami (3.5 kb)" default BUSYBOX_DEFAULT_WHOAMI help whoami is used to print the username of the current user id (same as id -un). config BUSYBOX_CONFIG_YES - bool "yes (1.2 kb)" + bool "yes (1.5 kb)" default BUSYBOX_DEFAULT_YES help yes is used to repeatedly output a specific string, or diff --git a/package/utils/busybox/config/debianutils/Config.in b/package/utils/busybox/config/debianutils/Config.in index 15abb08e6326d3..69bdbb654d9dc9 100644 --- a/package/utils/busybox/config/debianutils/Config.in +++ b/package/utils/busybox/config/debianutils/Config.in @@ -7,12 +7,12 @@ menu "Debian Utilities" config BUSYBOX_CONFIG_PIPE_PROGRESS - bool "pipe_progress (275 bytes)" + bool "pipe_progress (576 bytes)" default BUSYBOX_DEFAULT_PIPE_PROGRESS help Display a dot to indicate pipe activity. config BUSYBOX_CONFIG_RUN_PARTS - bool "run-parts (6.1 kb)" + bool "run-parts (6.2 kb)" default BUSYBOX_DEFAULT_RUN_PARTS help run-parts is a utility designed to run all the scripts in a directory. @@ -61,7 +61,7 @@ config BUSYBOX_CONFIG_FEATURE_START_STOP_DAEMON_FANCY -v|--verbose -N|--nicelevel N config BUSYBOX_CONFIG_WHICH - bool "which (3.8 kb)" + bool "which (4 kb)" default BUSYBOX_DEFAULT_WHICH help which is used to find programs in your PATH and diff --git a/package/utils/busybox/config/e2fsprogs/Config.in b/package/utils/busybox/config/e2fsprogs/Config.in index 4a9aa2ab4e2f07..ed6220a2d10ef8 100644 --- a/package/utils/busybox/config/e2fsprogs/Config.in +++ b/package/utils/busybox/config/e2fsprogs/Config.in @@ -7,19 +7,19 @@ menu "Linux Ext2 FS Progs" config BUSYBOX_CONFIG_CHATTR - bool "chattr (3.8 kb)" + bool "chattr (4.1 kb)" default BUSYBOX_DEFAULT_CHATTR help chattr changes the file attributes on a second extended file system. config BUSYBOX_CONFIG_FSCK - bool "fsck (7.4 kb)" + bool "fsck (7.6 kb)" default BUSYBOX_DEFAULT_FSCK help fsck is used to check and optionally repair one or more filesystems. In actuality, fsck is simply a front-end for the various file system checkers (fsck.fstype) available under Linux. config BUSYBOX_CONFIG_LSATTR - bool "lsattr (5.5 kb)" + bool "lsattr (5.7 kb)" default BUSYBOX_DEFAULT_LSATTR help lsattr lists the file attributes on a second extended file system. diff --git a/package/utils/busybox/config/editors/Config.in b/package/utils/busybox/config/editors/Config.in index dc80a4ec0df6f6..0e9bda0fbab425 100644 --- a/package/utils/busybox/config/editors/Config.in +++ b/package/utils/busybox/config/editors/Config.in @@ -7,7 +7,7 @@ menu "Editors" config BUSYBOX_CONFIG_AWK - bool "awk (23 kb)" + bool "awk (24 kb)" default BUSYBOX_DEFAULT_AWK help Awk is used as a pattern scanning and processing language. @@ -31,7 +31,7 @@ config BUSYBOX_CONFIG_FEATURE_AWK_GNU_EXTENSIONS This enables the use of awk library files. Example: awk -f mylib.awk -e '{print myfunction($1);}' ... config BUSYBOX_CONFIG_CMP - bool "cmp (4.9 kb)" + bool "cmp (5.3 kb)" default BUSYBOX_DEFAULT_CMP help cmp is used to compare two files and returns the result @@ -57,14 +57,14 @@ config BUSYBOX_CONFIG_FEATURE_DIFF_DIR This option enables support for directory and subdirectory comparison. config BUSYBOX_CONFIG_ED - bool "ed (21 kb)" + bool "ed (16 kb)" default BUSYBOX_DEFAULT_ED help The original 1970's Unix text editor, from the days of teletypes. Small, simple, evil. Part of SUSv3. If you're not already using this, you don't need it. config BUSYBOX_CONFIG_PATCH - bool "patch (9.4 kb)" + bool "patch (9.6 kb)" default BUSYBOX_DEFAULT_PATCH help Apply a unified diff formatted patch. @@ -75,7 +75,7 @@ config BUSYBOX_CONFIG_SED sed is used to perform text transformations on a file or input from a pipeline. config BUSYBOX_CONFIG_VI - bool "vi (23 kb)" + bool "vi (26 kb)" default BUSYBOX_DEFAULT_VI help 'vi' is a text editor. More specifically, it is the One True @@ -134,7 +134,7 @@ config BUSYBOX_CONFIG_FEATURE_VI_SEARCH config BUSYBOX_CONFIG_FEATURE_VI_REGEX_SEARCH bool "Enable regex in search and replace" - default BUSYBOX_DEFAULT_FEATURE_VI_REGEX_SEARCH # Uses GNU regex, which may be unavailable. FIXME + default BUSYBOX_DEFAULT_FEATURE_VI_REGEX_SEARCH depends on BUSYBOX_CONFIG_FEATURE_VI_SEARCH depends on USE_GLIBC help diff --git a/package/utils/busybox/config/findutils/Config.in b/package/utils/busybox/config/findutils/Config.in index 805d44f149e35c..8ea35b7c553de5 100644 --- a/package/utils/busybox/config/findutils/Config.in +++ b/package/utils/busybox/config/findutils/Config.in @@ -7,7 +7,7 @@ menu "Finding Utilities" config BUSYBOX_CONFIG_FIND - bool "find (14 kb)" + bool "find (16 kb)" default BUSYBOX_DEFAULT_FIND help find is used to search your system to find specified files. @@ -136,6 +136,13 @@ config BUSYBOX_CONFIG_FEATURE_FIND_EXEC_PLUS Without this option, -exec + is a synonym for -exec ; (IOW: it works correctly, but without expected speedup) +config BUSYBOX_CONFIG_FEATURE_FIND_EXEC_OK + bool "Enable -ok: execute confirmed commands" + default BUSYBOX_DEFAULT_FEATURE_FIND_EXEC_OK + depends on BUSYBOX_CONFIG_FEATURE_FIND_EXEC + help + Support the 'find -ok' option which prompts before executing. + config BUSYBOX_CONFIG_FEATURE_FIND_USER bool "Enable -user: username/uid matching" default BUSYBOX_DEFAULT_FEATURE_FIND_USER @@ -234,19 +241,19 @@ config BUSYBOX_CONFIG_FEATURE_FIND_LINKS help Support the 'find -links' option for matching number of links. config BUSYBOX_CONFIG_GREP - bool "grep (8.6 kb)" + bool "grep (8.9 kb)" default BUSYBOX_DEFAULT_GREP help grep is used to search files for a specified pattern. config BUSYBOX_CONFIG_EGREP - bool "egrep (7.8 kb)" + bool "egrep (8 kb)" default BUSYBOX_DEFAULT_EGREP help Alias to "grep -E". config BUSYBOX_CONFIG_FGREP - bool "fgrep (7.8 kb)" + bool "fgrep (8 kb)" default BUSYBOX_DEFAULT_FGREP help Alias to "grep -F". @@ -260,7 +267,7 @@ config BUSYBOX_CONFIG_FEATURE_GREP_CONTEXT context surrounding our matching lines. Print the specified number of context lines (-C). config BUSYBOX_CONFIG_XARGS - bool "xargs (7.2 kb)" + bool "xargs (7.6 kb)" default BUSYBOX_DEFAULT_XARGS help xargs is used to execute a specified command for diff --git a/package/utils/busybox/config/init/Config.in b/package/utils/busybox/config/init/Config.in index fc6c916a682758..56cc2ef1da645d 100644 --- a/package/utils/busybox/config/init/Config.in +++ b/package/utils/busybox/config/init/Config.in @@ -45,19 +45,19 @@ config BUSYBOX_CONFIG_FEATURE_BOOTCHARTD_CONFIG_FILE Enable reading and parsing of $PWD/bootchartd.conf and /etc/bootchartd.conf files. config BUSYBOX_CONFIG_HALT - bool "halt (4 kb)" + bool "halt (4.3 kb)" default BUSYBOX_DEFAULT_HALT help Stop all processes and halt the system. config BUSYBOX_CONFIG_POWEROFF - bool "poweroff (4 kb)" + bool "poweroff (4.3 kb)" default BUSYBOX_DEFAULT_POWEROFF help Stop all processes and power off the system. config BUSYBOX_CONFIG_REBOOT - bool "reboot (4 kb)" + bool "reboot (4.3 kb)" default BUSYBOX_DEFAULT_REBOOT help Stop all processes and reboot the system. diff --git a/package/utils/busybox/config/klibc-utils/Config.in b/package/utils/busybox/config/klibc-utils/Config.in index 06b9681bc92833..6fb5bbf6691054 100644 --- a/package/utils/busybox/config/klibc-utils/Config.in +++ b/package/utils/busybox/config/klibc-utils/Config.in @@ -17,12 +17,12 @@ config BUSYBOX_CONFIG_NUKE help Alias to "rm -rf". config BUSYBOX_CONFIG_RESUME - bool "resume (3.2 kb)" + bool "resume (3.6 kb)" default BUSYBOX_DEFAULT_RESUME help Resume from saved "suspend-to-disk" image config BUSYBOX_CONFIG_RUN_INIT - bool "run-init (7.7 kb)" + bool "run-init (8 kb)" default BUSYBOX_DEFAULT_RUN_INIT help The run-init utility is used from initramfs to select a new diff --git a/package/utils/busybox/config/loginutils/Config.in b/package/utils/busybox/config/loginutils/Config.in index 465fa519cb19f6..95422f1037eab3 100644 --- a/package/utils/busybox/config/loginutils/Config.in +++ b/package/utils/busybox/config/loginutils/Config.in @@ -93,18 +93,18 @@ config BUSYBOX_CONFIG_USE_BB_CRYPT_SHA user which has password encrypted with these algorithms. config BUSYBOX_CONFIG_ADD_SHELL - bool "add-shell (3.1 kb)" + bool "add-shell (3.3 kb)" default BUSYBOX_DEFAULT_ADD_SHELL if BUSYBOX_CONFIG_DESKTOP help Add shells to /etc/shells. config BUSYBOX_CONFIG_REMOVE_SHELL - bool "remove-shell (3 kb)" + bool "remove-shell (3.3 kb)" default BUSYBOX_DEFAULT_REMOVE_SHELL if BUSYBOX_CONFIG_DESKTOP help Remove shells from /etc/shells. config BUSYBOX_CONFIG_ADDGROUP - bool "addgroup (8.6 kb)" + bool "addgroup (8.8 kb)" default BUSYBOX_DEFAULT_ADDGROUP select BUSYBOX_CONFIG_LONG_OPTS help @@ -160,7 +160,7 @@ config BUSYBOX_CONFIG_LAST_SYSTEM_ID help Last valid system uid or gid for adduser and addgroup config BUSYBOX_CONFIG_CHPASSWD - bool "chpasswd (18 kb)" + bool "chpasswd (19 kb)" default BUSYBOX_DEFAULT_CHPASSWD help Reads a file of user name and password pairs from standard input @@ -173,27 +173,27 @@ config BUSYBOX_CONFIG_FEATURE_DEFAULT_PASSWD_ALGO help Possible choices are "d[es]", "m[d5]", "s[ha256]" or "sha512". config BUSYBOX_CONFIG_CRYPTPW - bool "cryptpw (14 kb)" + bool "cryptpw (15 kb)" default BUSYBOX_DEFAULT_CRYPTPW help Encrypts the given password with the crypt(3) libc function using the given salt. config BUSYBOX_CONFIG_MKPASSWD - bool "mkpasswd (15 kb)" + bool "mkpasswd (16 kb)" default BUSYBOX_DEFAULT_MKPASSWD help Encrypts the given password with the crypt(3) libc function using the given salt. Debian has this utility under mkpasswd name. Busybox provides mkpasswd as an alias for cryptpw. config BUSYBOX_CONFIG_DELUSER - bool "deluser (9.1 kb)" + bool "deluser (9.3 kb)" default BUSYBOX_DEFAULT_DELUSER help Utility for deleting a user account. config BUSYBOX_CONFIG_DELGROUP - bool "delgroup (6.4 kb)" + bool "delgroup (6.6 kb)" default BUSYBOX_DEFAULT_DELGROUP help Utility for deleting a group account. @@ -206,7 +206,7 @@ config BUSYBOX_CONFIG_FEATURE_DEL_USER_FROM_GROUP If called with two non-option arguments, deluser or delgroup will remove an user from a specified group. config BUSYBOX_CONFIG_GETTY - bool "getty (10 kb)" + bool "getty (11 kb)" default BUSYBOX_DEFAULT_GETTY select BUSYBOX_CONFIG_FEATURE_SYSLOG help @@ -224,7 +224,7 @@ config BUSYBOX_CONFIG_GETTY read -r login exec /bin/login "$login" config BUSYBOX_CONFIG_LOGIN - bool "login (24 kb)" + bool "login (25 kb)" default BUSYBOX_DEFAULT_LOGIN select BUSYBOX_CONFIG_FEATURE_SYSLOG help @@ -269,7 +269,7 @@ config BUSYBOX_CONFIG_FEATURE_SECURETTY The file contains the device names of tty lines (one per line, without leading /dev/) on which root is allowed to login. config BUSYBOX_CONFIG_PASSWD - bool "passwd (21 kb)" + bool "passwd (22 kb)" default BUSYBOX_DEFAULT_PASSWD select BUSYBOX_CONFIG_FEATURE_SYSLOG help @@ -312,14 +312,14 @@ config BUSYBOX_CONFIG_FEATURE_SU_BLANK_PW_NEEDS_SECURE_TTY default BUSYBOX_DEFAULT_FEATURE_SU_BLANK_PW_NEEDS_SECURE_TTY depends on BUSYBOX_CONFIG_SU config BUSYBOX_CONFIG_SULOGIN - bool "sulogin (17 kb)" + bool "sulogin (18 kb)" default BUSYBOX_DEFAULT_SULOGIN select BUSYBOX_CONFIG_FEATURE_SYSLOG help sulogin is invoked when the system goes into single user mode (this is done through an entry in inittab). config BUSYBOX_CONFIG_VLOCK - bool "vlock (17 kb)" + bool "vlock (18 kb)" default BUSYBOX_DEFAULT_VLOCK help Build the "vlock" applet which allows you to lock (virtual) terminals. diff --git a/package/utils/busybox/config/mailutils/Config.in b/package/utils/busybox/config/mailutils/Config.in index ea7ae6d6495f71..146478a87221ce 100644 --- a/package/utils/busybox/config/mailutils/Config.in +++ b/package/utils/busybox/config/mailutils/Config.in @@ -9,12 +9,12 @@ config BUSYBOX_CONFIG_FEATURE_MIME_CHARSET Default charset of the message. config BUSYBOX_CONFIG_MAKEMIME - bool "makemime (5.4 kb)" + bool "makemime (5.6 kb)" default BUSYBOX_DEFAULT_MAKEMIME help Create MIME-formatted messages. config BUSYBOX_CONFIG_POPMAILDIR - bool "popmaildir (10 kb)" + bool "popmaildir (11 kb)" default BUSYBOX_DEFAULT_POPMAILDIR help Simple yet powerful POP3 mail popper. Delivers content @@ -30,7 +30,7 @@ config BUSYBOX_CONFIG_FEATURE_POPMAILDIR_DELIVERY Allow to use a custom program for message actual delivery (-M "prog [args...]"). config BUSYBOX_CONFIG_REFORMIME - bool "reformime (7.5 kb)" + bool "reformime (7.6 kb)" default BUSYBOX_DEFAULT_REFORMIME help Parse MIME-formatted messages. diff --git a/package/utils/busybox/config/miscutils/Config.in b/package/utils/busybox/config/miscutils/Config.in index e15e318fe07585..3d3a6d86fd1709 100644 --- a/package/utils/busybox/config/miscutils/Config.in +++ b/package/utils/busybox/config/miscutils/Config.in @@ -7,13 +7,13 @@ menu "Miscellaneous Utilities" config BUSYBOX_CONFIG_ADJTIMEX - bool "adjtimex (4.7 kb)" + bool "adjtimex (4.9 kb)" default BUSYBOX_DEFAULT_ADJTIMEX help Adjtimex reads and optionally sets adjustment parameters for the Linux clock adjustment algorithm. config BUSYBOX_CONFIG_ASCII - bool "ascii" + bool "ascii (784 bytes)" default BUSYBOX_DEFAULT_ASCII help Print ascii table. @@ -39,7 +39,7 @@ config BUSYBOX_CONFIG_FEATURE_COMPRESS_BBCONFIG and have very little memory, this might not be a win. Otherwise, you probably want this. config BUSYBOX_CONFIG_BC - bool "bc (45 kb)" + bool "bc (38 kb)" default BUSYBOX_DEFAULT_BC select BUSYBOX_CONFIG_FEATURE_DC_BIG help @@ -63,7 +63,7 @@ config BUSYBOX_CONFIG_BC 5) "read()" accepts expressions, not only numeric literals. config BUSYBOX_CONFIG_DC - bool "dc (36 kb)" + bool "dc (29 kb)" default BUSYBOX_DEFAULT_DC help dc is a reverse-polish notation command-line calculator which @@ -125,7 +125,7 @@ config BUSYBOX_CONFIG_FEATURE_BC_LONG_OPTIONS endif config BUSYBOX_CONFIG_BEEP - bool "beep (2.4 kb)" + bool "beep (2.7 kb)" default BUSYBOX_DEFAULT_BEEP help The beep applets beeps in a given freq/Hz. @@ -146,7 +146,7 @@ config BUSYBOX_CONFIG_FEATURE_BEEP_LENGTH_MS help Length in ms for default beep. config BUSYBOX_CONFIG_CHAT - bool "chat (6.3 kb)" + bool "chat (6.7 kb)" default BUSYBOX_DEFAULT_CHAT help Simple chat utility. @@ -220,7 +220,7 @@ config BUSYBOX_CONFIG_CONSPY or conspy -nd NUM screenshot of console num or conspy -cs NUM poor man's GNU screen like config BUSYBOX_CONFIG_CROND - bool "crond (14 kb)" + bool "crond (15 kb)" default BUSYBOX_DEFAULT_CROND select BUSYBOX_CONFIG_FEATURE_SYSLOG help @@ -330,7 +330,7 @@ config BUSYBOX_CONFIG_FEATURE_DEVFS /dev/loop0. If your /dev directory has normal names instead of devfs names, you don't want this. config BUSYBOX_CONFIG_DEVMEM - bool "devmem (2.5 kb)" + bool "devmem (2.7 kb)" default BUSYBOX_DEFAULT_DEVMEM help devmem is a small program that reads and writes from physical @@ -380,6 +380,11 @@ config BUSYBOX_CONFIG_FLASHCP help The flashcp binary, inspired by mtd-utils as of git head 5eceb74f7. This utility is used to copy images into a MTD device. +config BUSYBOX_CONFIG_GETFATTR + bool "getfattr (12.3 kb)" + default BUSYBOX_DEFAULT_GETFATTR + help + Get extended attributes on files config BUSYBOX_CONFIG_HDPARM bool "hdparm (25 kb)" default BUSYBOX_DEFAULT_HDPARM @@ -437,36 +442,36 @@ config BUSYBOX_CONFIG_FEATURE_HDPARM_HDIO_GETSET_DMA help Enable the 'hdparm -d' option to get/set using_dma flag. config BUSYBOX_CONFIG_HEXEDIT - bool "hexedit (21 kb)" + bool "hexedit (15 kb)" default BUSYBOX_DEFAULT_HEXEDIT help Edit file in hexadecimal. config BUSYBOX_CONFIG_I2CGET - bool "i2cget (5.5 kb)" + bool "i2cget (5.7 kb)" default BUSYBOX_DEFAULT_I2CGET help Read from I2C/SMBus chip registers. config BUSYBOX_CONFIG_I2CSET - bool "i2cset (6.7 kb)" + bool "i2cset (6.9 kb)" default BUSYBOX_DEFAULT_I2CSET help Set I2C registers. config BUSYBOX_CONFIG_I2CDUMP - bool "i2cdump (7.1 kb)" + bool "i2cdump (7.2 kb)" default BUSYBOX_DEFAULT_I2CDUMP help Examine I2C registers. config BUSYBOX_CONFIG_I2CDETECT - bool "i2cdetect (7.1 kb)" + bool "i2cdetect (7.3 kb)" default BUSYBOX_DEFAULT_I2CDETECT help Detect I2C chips. config BUSYBOX_CONFIG_I2CTRANSFER - bool "i2ctransfer (4.0 kb)" + bool "i2ctransfer (5.5 kb)" default BUSYBOX_DEFAULT_I2CTRANSFER help Send user-defined I2C messages in one transfer. @@ -579,7 +584,7 @@ config BUSYBOX_CONFIG_LOCK help Small utility for using locks in scripts config BUSYBOX_CONFIG_LSSCSI - bool "lsscsi (2.5 kb)" + bool "lsscsi (2.9 kb)" default BUSYBOX_DEFAULT_LSSCSI help lsscsi is a utility for displaying information about SCSI buses in the @@ -587,7 +592,7 @@ config BUSYBOX_CONFIG_LSSCSI This version uses sysfs (/sys/bus/scsi/devices) only. config BUSYBOX_CONFIG_MAKEDEVS - bool "makedevs (9.2 kb)" + bool "makedevs (9.4 kb)" default BUSYBOX_DEFAULT_MAKEDEVS help 'makedevs' is a utility used to create a batch of devices with @@ -623,7 +628,7 @@ config BUSYBOX_CONFIG_MAN help Format and display manual pages. config BUSYBOX_CONFIG_MICROCOM - bool "microcom (5.7 kb)" + bool "microcom (5.9 kb)" default BUSYBOX_DEFAULT_MICROCOM help The poor man's minicom utility for chatting with serial port devices. @@ -635,36 +640,36 @@ config BUSYBOX_CONFIG_MIM Run a script from a Makefile-like specification file. Unlike 'make' dependencies aren't supported. config BUSYBOX_CONFIG_MT - bool "mt (2.5 kb)" + bool "mt (2.7 kb)" default BUSYBOX_DEFAULT_MT help mt is used to control tape devices. You can use the mt utility to advance or rewind a tape past a specified number of archive files on the tape. config BUSYBOX_CONFIG_NANDWRITE - bool "nandwrite (4.8 kb)" + bool "nandwrite (5 kb)" default BUSYBOX_DEFAULT_NANDWRITE help Write to the specified MTD device, with bad blocks awareness config BUSYBOX_CONFIG_NANDDUMP - bool "nanddump (5.2 kb)" + bool "nanddump (5.4 kb)" default BUSYBOX_DEFAULT_NANDDUMP help Dump the content of raw NAND chip config BUSYBOX_CONFIG_PARTPROBE - bool "partprobe (3.5 kb)" + bool "partprobe (3.7 kb)" default BUSYBOX_DEFAULT_PARTPROBE help Ask kernel to rescan partition table. config BUSYBOX_CONFIG_RAIDAUTORUN - bool "raidautorun (1.3 kb)" + bool "raidautorun (1.6 kb)" default BUSYBOX_DEFAULT_RAIDAUTORUN help raidautorun tells the kernel md driver to search and start RAID arrays. config BUSYBOX_CONFIG_READAHEAD - bool "readahead (1.5 kb)" + bool "readahead (1.7 kb)" default BUSYBOX_DEFAULT_READAHEAD depends on BUSYBOX_CONFIG_LFS help @@ -691,7 +696,7 @@ config BUSYBOX_CONFIG_RFKILL rfkill block|unblock wlan : block/unblock all wlan(wifi) devices config BUSYBOX_CONFIG_RUNLEVEL - bool "runlevel (559 bytes)" + bool "runlevel (837 bytes)" default BUSYBOX_DEFAULT_RUNLEVEL depends on BUSYBOX_CONFIG_FEATURE_UTMP help @@ -700,50 +705,50 @@ config BUSYBOX_CONFIG_RUNLEVEL This applet uses utmp but does not rely on busybox supporing utmp on purpose. It is used by e.g. emdebian via /etc/init.d/rc. config BUSYBOX_CONFIG_RX - bool "rx (2.9 kb)" + bool "rx (3.2 kb)" default BUSYBOX_DEFAULT_RX help Receive files using the Xmodem protocol. config BUSYBOX_CONFIG_SEEDRNG - bool "seedrng (1.3 kb)" + bool "seedrng (9.1 kb)" default BUSYBOX_DEFAULT_SEEDRNG help Seed the kernel RNG from seed files, meant to be called once during startup, once during shutdown, and optionally at some periodic interval in between. config BUSYBOX_CONFIG_SETFATTR - bool "setfattr (3.7 kb)" + bool "setfattr (3.9 kb)" default BUSYBOX_DEFAULT_SETFATTR help Set/delete extended attributes on files config BUSYBOX_CONFIG_SETSERIAL - bool "setserial (6.9 kb)" + bool "setserial (7.1 kb)" default BUSYBOX_DEFAULT_SETSERIAL help Retrieve or set Linux serial port. config BUSYBOX_CONFIG_STRINGS - bool "strings (4.6 kb)" + bool "strings (4.8 kb)" default BUSYBOX_DEFAULT_STRINGS help strings prints the printable character sequences for each file specified. config BUSYBOX_CONFIG_TIME - bool "time (6.8 kb)" + bool "time (8.1 kb)" default BUSYBOX_DEFAULT_TIME help The time command runs the specified program with the given arguments. When the command finishes, time writes a message to standard output giving timing statistics about this program run. config BUSYBOX_CONFIG_TREE - bool "tree (0.6 kb)" + bool "tree (2.5 kb)" default BUSYBOX_DEFAULT_TREE help List files and directories in a tree structure. config BUSYBOX_CONFIG_TS - bool "ts (450 bytes)" + bool "ts (4.4 kb)" default BUSYBOX_DEFAULT_TS config BUSYBOX_CONFIG_TTYSIZE - bool "ttysize (432 bytes)" + bool "ttysize (718 bytes)" default BUSYBOX_DEFAULT_TTYSIZE help A replacement for "stty size". Unlike stty, can report only width, @@ -751,52 +756,52 @@ config BUSYBOX_CONFIG_TTYSIZE error, but returns default 80x24. Usage in shell scripts: width=`ttysize w`. config BUSYBOX_CONFIG_UBIATTACH - bool "ubiattach (4.2 kb)" + bool "ubiattach (4.5 kb)" default BUSYBOX_DEFAULT_UBIATTACH help Attach MTD device to an UBI device. config BUSYBOX_CONFIG_UBIDETACH - bool "ubidetach (4.1 kb)" + bool "ubidetach (4.3 kb)" default BUSYBOX_DEFAULT_UBIDETACH help Detach MTD device from an UBI device. config BUSYBOX_CONFIG_UBIMKVOL - bool "ubimkvol (5.3 kb)" + bool "ubimkvol (5.5 kb)" default BUSYBOX_DEFAULT_UBIMKVOL help Create a UBI volume. config BUSYBOX_CONFIG_UBIRMVOL - bool "ubirmvol (4.9 kb)" + bool "ubirmvol (5.1 kb)" default BUSYBOX_DEFAULT_UBIRMVOL help Delete a UBI volume. config BUSYBOX_CONFIG_UBIRSVOL - bool "ubirsvol (4.2 kb)" + bool "ubirsvol (4.4 kb)" default BUSYBOX_DEFAULT_UBIRSVOL help Resize a UBI volume. config BUSYBOX_CONFIG_UBIUPDATEVOL - bool "ubiupdatevol (5.2 kb)" + bool "ubiupdatevol (5.6 kb)" default BUSYBOX_DEFAULT_UBIUPDATEVOL help Update a UBI volume. config BUSYBOX_CONFIG_UBIRENAME - bool "ubirename (2.4 kb)" + bool "ubirename (2.7 kb)" default BUSYBOX_DEFAULT_UBIRENAME help Utility to rename UBI volumes config BUSYBOX_CONFIG_VOLNAME - bool "volname (1.6 kb)" + bool "volname (1.9 kb)" default BUSYBOX_DEFAULT_VOLNAME help Prints a CD-ROM volume name. config BUSYBOX_CONFIG_WATCHDOG - bool "watchdog (5.3 kb)" + bool "watchdog (5.7 kb)" default BUSYBOX_DEFAULT_WATCHDOG help The watchdog utility is used with hardware or software watchdog diff --git a/package/utils/busybox/config/modutils/Config.in b/package/utils/busybox/config/modutils/Config.in index e3538081ea8cf1..58a0e5b7673def 100644 --- a/package/utils/busybox/config/modutils/Config.in +++ b/package/utils/busybox/config/modutils/Config.in @@ -47,7 +47,7 @@ config BUSYBOX_CONFIG_INSMOD help insmod is used to load specified modules in the running kernel. config BUSYBOX_CONFIG_LSMOD - bool "lsmod (1.9 kb)" + bool "lsmod (2.1 kb)" default BUSYBOX_DEFAULT_LSMOD help lsmod is used to display a list of loaded modules. @@ -66,7 +66,7 @@ config BUSYBOX_CONFIG_MODINFO help Show information about a Linux Kernel module config BUSYBOX_CONFIG_MODPROBE - bool "modprobe (28 kb)" + bool "modprobe (27 kb)" default BUSYBOX_DEFAULT_MODPROBE help Handle the loading of modules, and their dependencies on a high @@ -83,7 +83,7 @@ config BUSYBOX_CONFIG_FEATURE_MODPROBE_BLACKLIST hardware autodetection scripts to load modules like evdev, frame buffer drivers etc. config BUSYBOX_CONFIG_RMMOD - bool "rmmod (3.3 kb)" + bool "rmmod (3.5 kb)" default BUSYBOX_DEFAULT_RMMOD help rmmod is used to unload specified modules from the kernel. diff --git a/package/utils/busybox/config/networking/Config.in b/package/utils/busybox/config/networking/Config.in index 861e4f9bbfa966..fd2b4efd854e4d 100644 --- a/package/utils/busybox/config/networking/Config.in +++ b/package/utils/busybox/config/networking/Config.in @@ -90,12 +90,12 @@ config BUSYBOX_CONFIG_ARP help Manipulate the system ARP cache. config BUSYBOX_CONFIG_ARPING - bool "arping (9 kb)" + bool "arping (9.1 kb)" default BUSYBOX_DEFAULT_ARPING help Ping hosts by ARP packets. config BUSYBOX_CONFIG_BRCTL - bool "brctl (4.7 kb)" + bool "brctl (9.9 kb)" default BUSYBOX_DEFAULT_BRCTL help Manage ethernet bridges. @@ -120,12 +120,12 @@ config BUSYBOX_CONFIG_FEATURE_BRCTL_SHOW Add support for option which prints the current config: show config BUSYBOX_CONFIG_DNSD - bool "dnsd (9.8 kb)" + bool "dnsd (10 kb)" default BUSYBOX_DEFAULT_DNSD help Small and static DNS server daemon. config BUSYBOX_CONFIG_ETHER_WAKE - bool "ether-wake (4.9 kb)" + bool "ether-wake (5.2 kb)" default BUSYBOX_DEFAULT_ETHER_WAKE help Send a magic packet to wake up sleeping machines. @@ -167,13 +167,13 @@ config BUSYBOX_CONFIG_FEATURE_FTPD_AUTHENTICATION of the user it was started under, and does not require login. Take care to not launch it under root. config BUSYBOX_CONFIG_FTPGET - bool "ftpget (7.8 kb)" + bool "ftpget (7.9 kb)" default BUSYBOX_DEFAULT_FTPGET help Retrieve a remote file via FTP. config BUSYBOX_CONFIG_FTPPUT - bool "ftpput (7.5 kb)" + bool "ftpput (7.6 kb)" default BUSYBOX_DEFAULT_FTPPUT help Store a remote file via FTP. @@ -183,13 +183,13 @@ config BUSYBOX_CONFIG_FEATURE_FTPGETPUT_LONG_OPTIONS default BUSYBOX_DEFAULT_FEATURE_FTPGETPUT_LONG_OPTIONS depends on BUSYBOX_CONFIG_LONG_OPTS && (BUSYBOX_CONFIG_FTPGET || BUSYBOX_CONFIG_FTPPUT) config BUSYBOX_CONFIG_HOSTNAME - bool "hostname (5.5 kb)" + bool "hostname (5.8 kb)" default BUSYBOX_DEFAULT_HOSTNAME help Show or set the system's host name. config BUSYBOX_CONFIG_DNSDOMAINNAME - bool "dnsdomainname (3.6 kb)" + bool "dnsdomainname (3.8 kb)" default BUSYBOX_DEFAULT_DNSDOMAINNAME help Alias to "hostname -d". @@ -408,7 +408,7 @@ config BUSYBOX_CONFIG_IFENSLAVE Userspace application to bind several interfaces to a logical interface (use with kernel bonding driver). config BUSYBOX_CONFIG_IFPLUGD - bool "ifplugd (10 kb)" + bool "ifplugd (11 kb)" default BUSYBOX_DEFAULT_IFPLUGD help Network interface plug detection daemon. @@ -569,7 +569,7 @@ config BUSYBOX_CONFIG_IP trying to be portable, it's better to use "ip CMD" forms. config BUSYBOX_CONFIG_IPADDR - bool "ipaddr (14 kb)" + bool "ipaddr (15 kb)" default BUSYBOX_DEFAULT_IPADDR select BUSYBOX_CONFIG_FEATURE_IP_ADDRESS help @@ -590,7 +590,7 @@ config BUSYBOX_CONFIG_IPROUTE Short form of "ip route" config BUSYBOX_CONFIG_IPTUNNEL - bool "iptunnel (9.6 kb)" + bool "iptunnel (9.8 kb)" default BUSYBOX_DEFAULT_IPTUNNEL select BUSYBOX_CONFIG_FEATURE_IP_TUNNEL help @@ -604,7 +604,7 @@ config BUSYBOX_CONFIG_IPRULE Short form of "ip rule" config BUSYBOX_CONFIG_IPNEIGH - bool "ipneigh (8.3 kb)" + bool "ipneigh (8.6 kb)" default BUSYBOX_DEFAULT_IPNEIGH select BUSYBOX_CONFIG_FEATURE_IP_NEIGH help @@ -624,6 +624,12 @@ config BUSYBOX_CONFIG_FEATURE_IP_LINK help Configure network devices with "ip". +config BUSYBOX_CONFIG_FEATURE_IP_LINK_CAN + bool "ip link set type can" + default BUSYBOX_DEFAULT_FEATURE_IP_LINK_CAN + help + Configure CAN devices with "ip". + config BUSYBOX_CONFIG_FEATURE_IP_ROUTE bool "ip route" default BUSYBOX_DEFAULT_FEATURE_IP_ROUTE @@ -669,7 +675,7 @@ config BUSYBOX_CONFIG_FEATURE_IP_RARE_PROTOCOLS Ethernet, wireless, infrared, ppp/slip, ip tunnelling link types are supported without this option selected. config BUSYBOX_CONFIG_IPCALC - bool "ipcalc (4.4 kb)" + bool "ipcalc (4.6 kb)" default BUSYBOX_DEFAULT_IPCALC help ipcalc takes an IP address and netmask and calculates the @@ -688,14 +694,14 @@ config BUSYBOX_CONFIG_FEATURE_IPCALC_FANCY Adds the options hostname, prefix and silent to the output of "ipcalc". config BUSYBOX_CONFIG_FAKEIDENTD - bool "fakeidentd (8.7 kb)" + bool "fakeidentd (9 kb)" default BUSYBOX_DEFAULT_FAKEIDENTD select BUSYBOX_CONFIG_FEATURE_SYSLOG help fakeidentd listens on the ident port and returns a predefined fake value on any query. config BUSYBOX_CONFIG_NAMEIF - bool "nameif (6.6 kb)" + bool "nameif (6.9 kb)" default BUSYBOX_DEFAULT_NAMEIF select BUSYBOX_CONFIG_FEATURE_SYSLOG help @@ -723,7 +729,7 @@ config BUSYBOX_CONFIG_FEATURE_NAMEIF_EXTENDED new_interface_name mac=00:80:C8:38:91:B5 new_interface_name 00:80:C8:38:91:B5 config BUSYBOX_CONFIG_NBDCLIENT - bool "nbd-client (6 kb)" + bool "nbd-client (6.3 kb)" default BUSYBOX_DEFAULT_NBDCLIENT help Network block device client @@ -792,7 +798,7 @@ config BUSYBOX_CONFIG_FEATURE_NETSTAT_PRG Add support for -p flag to print out PID and program name. +700 bytes of code. config BUSYBOX_CONFIG_NSLOOKUP - bool "nslookup (9.7 kb)" + bool "nslookup (10 kb)" default BUSYBOX_DEFAULT_NSLOOKUP help nslookup is a tool to query Internet name servers. @@ -807,7 +813,7 @@ config BUSYBOX_CONFIG_FEATURE_NSLOOKUP_LONG_OPTIONS default BUSYBOX_DEFAULT_FEATURE_NSLOOKUP_LONG_OPTIONS depends on BUSYBOX_CONFIG_FEATURE_NSLOOKUP_BIG && BUSYBOX_CONFIG_LONG_OPTS config BUSYBOX_CONFIG_NTPD - bool "ntpd (22 kb)" + bool "ntpd (23 kb)" default BUSYBOX_DEFAULT_NTPD help The NTP client/server daemon. @@ -855,22 +861,22 @@ config BUSYBOX_CONFIG_FEATURE_FANCY_PING or terminate with SIGALRM in 5 seconds otherwise. No command-line options will be recognized. config BUSYBOX_CONFIG_PSCAN - bool "pscan (6 kb)" + bool "pscan (6.2 kb)" default BUSYBOX_DEFAULT_PSCAN help Simple network port scanner. config BUSYBOX_CONFIG_ROUTE - bool "route (8.7 kb)" + bool "route (9 kb)" default BUSYBOX_DEFAULT_ROUTE help Route displays or manipulates the kernel's IP routing tables. config BUSYBOX_CONFIG_SLATTACH - bool "slattach (6.2 kb)" + bool "slattach (6.3 kb)" default BUSYBOX_DEFAULT_SLATTACH help slattach configures serial line as SLIP network interface. config BUSYBOX_CONFIG_SSL_CLIENT - bool "ssl_client (25 kb)" + bool "ssl_client (28 kb)" default BUSYBOX_DEFAULT_SSL_CLIENT select BUSYBOX_CONFIG_TLS help @@ -929,7 +935,7 @@ config BUSYBOX_CONFIG_FEATURE_TELNET_WIDTH default BUSYBOX_DEFAULT_FEATURE_TELNET_WIDTH depends on BUSYBOX_CONFIG_TELNET config BUSYBOX_CONFIG_TELNETD - bool "telnetd (12 kb)" + bool "telnetd (13 kb)" default BUSYBOX_DEFAULT_TELNETD select BUSYBOX_CONFIG_FEATURE_SYSLOG help @@ -1076,7 +1082,7 @@ config BUSYBOX_CONFIG_TRACEROUTE Utility to trace the route of IP packets. config BUSYBOX_CONFIG_TRACEROUTE6 - bool "traceroute6 (13 kb)" + bool "traceroute6 (12 kb)" default BUSYBOX_DEFAULT_TRACEROUTE6 depends on BUSYBOX_CONFIG_FEATURE_IPV6 help @@ -1095,7 +1101,7 @@ config BUSYBOX_CONFIG_FEATURE_TRACEROUTE_USE_ICMP default BUSYBOX_DEFAULT_FEATURE_TRACEROUTE_USE_ICMP depends on BUSYBOX_CONFIG_TRACEROUTE || BUSYBOX_CONFIG_TRACEROUTE6 config BUSYBOX_CONFIG_TUNCTL - bool "tunctl (6.2 kb)" + bool "tunctl (6.4 kb)" default BUSYBOX_DEFAULT_TUNCTL help tunctl creates or deletes tun devices. @@ -1108,12 +1114,12 @@ config BUSYBOX_CONFIG_FEATURE_TUNCTL_UG Allow to specify owner and group of newly created interface. 340 bytes of pure bloat. Say no here. config BUSYBOX_CONFIG_VCONFIG - bool "vconfig (2.3 kb)" + bool "vconfig (2.6 kb)" default BUSYBOX_DEFAULT_VCONFIG help Creates, removes, and configures VLAN interfaces config BUSYBOX_CONFIG_WGET - bool "wget (38 kb)" + bool "wget (41 kb)" default BUSYBOX_DEFAULT_WGET help wget is a utility for non-interactive download of files from HTTP @@ -1233,12 +1239,12 @@ config BUSYBOX_CONFIG_FEATURE_WGET_OPENSSL By default TLS verification is performed, unless --no-check-certificate option is passed. config BUSYBOX_CONFIG_WHOIS - bool "whois (6.3 kb)" + bool "whois (6.5 kb)" default BUSYBOX_DEFAULT_WHOIS help whois is a client for the whois directory service config BUSYBOX_CONFIG_ZCIP - bool "zcip (8.4 kb)" + bool "zcip (8.7 kb)" default BUSYBOX_DEFAULT_ZCIP select BUSYBOX_CONFIG_FEATURE_SYSLOG help diff --git a/package/utils/busybox/config/networking/udhcp/Config.in b/package/utils/busybox/config/networking/udhcp/Config.in index 6757f1efc9c9a6..3c88e285a1ec40 100644 --- a/package/utils/busybox/config/networking/udhcp/Config.in +++ b/package/utils/busybox/config/networking/udhcp/Config.in @@ -11,6 +11,13 @@ config BUSYBOX_CONFIG_UDHCPD udhcpd is a DHCP server geared primarily toward embedded systems, while striving to be fully functional and RFC compliant. +config BUSYBOX_CONFIG_FEATURE_UDHCPD_BOOTP + bool "Answer to BOOTP requests as well" + default BUSYBOX_DEFAULT_FEATURE_UDHCPD_BOOTP + depends on BUSYBOX_CONFIG_UDHCPD + help + Support old BOOTP protocol too. + config BUSYBOX_CONFIG_FEATURE_UDHCPD_BASE_IP_ON_MAC bool "Select IP address based on client MAC" default BUSYBOX_DEFAULT_FEATURE_UDHCPD_BASE_IP_ON_MAC @@ -44,7 +51,7 @@ config BUSYBOX_CONFIG_DHCPD_LEASES_FILE of the file. Normally it is safe to leave it untouched. config BUSYBOX_CONFIG_DUMPLEASES - bool "dumpleases (5.1 kb)" + bool "dumpleases (5.3 kb)" default BUSYBOX_DEFAULT_DUMPLEASES help dumpleases displays the leases written out by the udhcpd. @@ -52,7 +59,7 @@ config BUSYBOX_CONFIG_DUMPLEASES by the absolute time that it expires in seconds from epoch. config BUSYBOX_CONFIG_DHCPRELAY - bool "dhcprelay (5.2 kb)" + bool "dhcprelay (5.5 kb)" default BUSYBOX_DEFAULT_DHCPRELAY help dhcprelay listens for DHCP requests on one or more interfaces diff --git a/package/utils/busybox/config/printutils/Config.in b/package/utils/busybox/config/printutils/Config.in index c53ee19d4eacc6..a320c87ebca237 100644 --- a/package/utils/busybox/config/printutils/Config.in +++ b/package/utils/busybox/config/printutils/Config.in @@ -7,18 +7,18 @@ menu "Print Utilities" config BUSYBOX_CONFIG_LPD - bool "lpd (5.5 kb)" + bool "lpd (5.7 kb)" default BUSYBOX_DEFAULT_LPD help lpd is a print spooling daemon. config BUSYBOX_CONFIG_LPR - bool "lpr (9.9 kb)" + bool "lpr (10 kb)" default BUSYBOX_DEFAULT_LPR help lpr sends files (or standard input) to a print spooling daemon. config BUSYBOX_CONFIG_LPQ - bool "lpq (9.9 kb)" + bool "lpq (10 kb)" default BUSYBOX_DEFAULT_LPQ help lpq is a print spool queue examination and manipulation program. diff --git a/package/utils/busybox/config/procps/Config.in b/package/utils/busybox/config/procps/Config.in index 0501daf8fd2de1..1524f61dc74ec1 100644 --- a/package/utils/busybox/config/procps/Config.in +++ b/package/utils/busybox/config/procps/Config.in @@ -22,26 +22,26 @@ config BUSYBOX_CONFIG_FEATURE_SHOW_THREADS and 'h' command in top. config BUSYBOX_CONFIG_FREE - bool "free (3.1 kb)" + bool "free (3.8 kb)" default BUSYBOX_DEFAULT_FREE help free displays the total amount of free and used physical and swap memory in the system, as well as the buffers used by the kernel. The shared memory column should be ignored; it is obsolete. config BUSYBOX_CONFIG_FUSER - bool "fuser (7 kb)" + bool "fuser (7.3 kb)" default BUSYBOX_DEFAULT_FUSER help fuser lists all PIDs (Process IDs) that currently have a given file open. fuser can also list all PIDs that have a given network (TCP or UDP) port open. config BUSYBOX_CONFIG_IOSTAT - bool "iostat (7.6 kb)" + bool "iostat (8 kb)" default BUSYBOX_DEFAULT_IOSTAT help Report CPU and I/O statistics config BUSYBOX_CONFIG_KILL - bool "kill (3.1 kb)" + bool "kill (3.4 kb)" default BUSYBOX_DEFAULT_KILL help The command kill sends the specified signal to the specified @@ -49,7 +49,7 @@ config BUSYBOX_CONFIG_KILL signal is sent. config BUSYBOX_CONFIG_KILLALL - bool "killall (5.6 kb)" + bool "killall (5.9 kb)" default BUSYBOX_DEFAULT_KILLALL help killall sends a signal to all processes running any of the @@ -57,7 +57,7 @@ config BUSYBOX_CONFIG_KILLALL sent. config BUSYBOX_CONFIG_KILLALL5 - bool "killall5 (5.3 kb)" + bool "killall5 (5.6 kb)" default BUSYBOX_DEFAULT_KILLALL5 help The SystemV killall command. killall5 sends a signal @@ -65,34 +65,34 @@ config BUSYBOX_CONFIG_KILLALL5 in its own session, so it won't kill the shell that is running the script it was called from. config BUSYBOX_CONFIG_LSOF - bool "lsof (3.4 kb)" + bool "lsof (3.7 kb)" default BUSYBOX_DEFAULT_LSOF help Show open files in the format of: PID /path/to/executable /path/to/opened/file config BUSYBOX_CONFIG_MPSTAT - bool "mpstat (9.8 kb)" + bool "mpstat (10 kb)" default BUSYBOX_DEFAULT_MPSTAT help Per-processor statistics config BUSYBOX_CONFIG_NMETER - bool "nmeter (11 kb)" + bool "nmeter (12 kb)" default BUSYBOX_DEFAULT_NMETER help Prints selected system stats continuously, one line per update. config BUSYBOX_CONFIG_PGREP - bool "pgrep (6.5 kb)" + bool "pgrep (6.8 kb)" default BUSYBOX_DEFAULT_PGREP help Look for processes by name. config BUSYBOX_CONFIG_PKILL - bool "pkill (7.5 kb)" + bool "pkill (7.8 kb)" default BUSYBOX_DEFAULT_PKILL help Send signals to processes by name. config BUSYBOX_CONFIG_PIDOF - bool "pidof (6.3 kb)" + bool "pidof (6.5 kb)" default BUSYBOX_DEFAULT_PIDOF help Pidof finds the process id's (pids) of the named programs. It prints @@ -114,12 +114,12 @@ config BUSYBOX_CONFIG_FEATURE_PIDOF_OMIT The special pid %PPID can be used to name the parent process of the pidof, in other words the calling shell or shell script. config BUSYBOX_CONFIG_PMAP - bool "pmap (6 kb)" + bool "pmap (6.2 kb)" default BUSYBOX_DEFAULT_PMAP help Display processes' memory mappings. config BUSYBOX_CONFIG_POWERTOP - bool "powertop (9.6 kb)" + bool "powertop (9.9 kb)" default BUSYBOX_DEFAULT_POWERTOP help Analyze power consumption on Intel-based laptops @@ -132,7 +132,7 @@ config BUSYBOX_CONFIG_FEATURE_POWERTOP_INTERACTIVE Without this, powertop will only refresh display every 10 seconds. No keyboard commands will work, only ^C to terminate. config BUSYBOX_CONFIG_PS - bool "ps (11 kb)" + bool "ps (12 kb)" default BUSYBOX_DEFAULT_PS help ps gives a snapshot of the current processes. @@ -172,23 +172,23 @@ config BUSYBOX_CONFIG_FEATURE_PS_ADDITIONAL_COLUMNS default BUSYBOX_DEFAULT_FEATURE_PS_ADDITIONAL_COLUMNS depends on (BUSYBOX_CONFIG_PS || BUSYBOX_CONFIG_MINIPS) && BUSYBOX_CONFIG_DESKTOP config BUSYBOX_CONFIG_PSTREE - bool "pstree (9.3 kb)" + bool "pstree (9.4 kb)" default BUSYBOX_DEFAULT_PSTREE help Display a tree of processes. config BUSYBOX_CONFIG_PWDX - bool "pwdx (3.7 kb)" + bool "pwdx (3.9 kb)" default BUSYBOX_DEFAULT_PWDX help Report current working directory of a process config BUSYBOX_CONFIG_SMEMCAP - bool "smemcap (2.5 kb)" + bool "smemcap (3 kb)" default BUSYBOX_DEFAULT_SMEMCAP help smemcap is a tool for capturing process data for smem, a memory usage statistic tool. config BUSYBOX_CONFIG_BB_SYSCTL - bool "sysctl (7.4 kb)" + bool "sysctl (7.9 kb)" default BUSYBOX_DEFAULT_BB_SYSCTL help Configure kernel parameters at runtime. @@ -254,7 +254,7 @@ config BUSYBOX_CONFIG_FEATURE_TOPMEM help Enable 's' in top (gives lots of memory info). config BUSYBOX_CONFIG_UPTIME - bool "uptime (3.7 kb)" + bool "uptime (4 kb)" default BUSYBOX_DEFAULT_UPTIME help uptime gives a one line display of the current time, how long @@ -268,7 +268,7 @@ config BUSYBOX_CONFIG_FEATURE_UPTIME_UTMP_SUPPORT help Display the number of users currently logged on. config BUSYBOX_CONFIG_WATCH - bool "watch (4.4 kb)" + bool "watch (5.2 kb)" default BUSYBOX_DEFAULT_WATCH help watch is used to execute a program periodically, showing diff --git a/package/utils/busybox/config/runit/Config.in b/package/utils/busybox/config/runit/Config.in index 2c701f2136e85d..3a95619bde9bf9 100644 --- a/package/utils/busybox/config/runit/Config.in +++ b/package/utils/busybox/config/runit/Config.in @@ -7,44 +7,44 @@ menu "Runit Utilities" config BUSYBOX_CONFIG_CHPST - bool "chpst (9 kb)" + bool "chpst (9.2 kb)" default BUSYBOX_DEFAULT_CHPST help chpst changes the process state according to the given options, and execs specified program. config BUSYBOX_CONFIG_SETUIDGID - bool "setuidgid (4 kb)" + bool "setuidgid (4.2 kb)" default BUSYBOX_DEFAULT_SETUIDGID help Sets soft resource limits as specified by options config BUSYBOX_CONFIG_ENVUIDGID - bool "envuidgid (3.9 kb)" + bool "envuidgid (4.1 kb)" default BUSYBOX_DEFAULT_ENVUIDGID help Sets $UID to account's uid and $GID to account's gid config BUSYBOX_CONFIG_ENVDIR - bool "envdir (2.5 kb)" + bool "envdir (2.9 kb)" default BUSYBOX_DEFAULT_ENVDIR help Sets various environment variables as specified by files in the given directory config BUSYBOX_CONFIG_SOFTLIMIT - bool "softlimit (4.5 kb)" + bool "softlimit (4.7 kb)" default BUSYBOX_DEFAULT_SOFTLIMIT help Sets soft resource limits as specified by options config BUSYBOX_CONFIG_RUNSV - bool "runsv (7.8 kb)" + bool "runsv (8.2 kb)" default BUSYBOX_DEFAULT_RUNSV help runsv starts and monitors a service and optionally an appendant log service. config BUSYBOX_CONFIG_RUNSVDIR - bool "runsvdir (6.3 kb)" + bool "runsvdir (6.6 kb)" default BUSYBOX_DEFAULT_RUNSVDIR help runsvdir starts a runsv process for each subdirectory, or symlink to @@ -60,7 +60,7 @@ config BUSYBOX_CONFIG_FEATURE_RUNSVDIR_LOG message (viewable via top/ps). Otherwise (feature is off or no parameter), error messages go to stderr only. config BUSYBOX_CONFIG_SV - bool "sv (8.5 kb)" + bool "sv (8.7 kb)" default BUSYBOX_DEFAULT_SV help sv reports the current status and controls the state of services @@ -75,14 +75,14 @@ config BUSYBOX_CONFIG_SV_DEFAULT_SERVICE_DIR Defaults to "/var/service" config BUSYBOX_CONFIG_SVC - bool "svc (8.4 kb)" + bool "svc (8.7 kb)" default BUSYBOX_DEFAULT_SVC help svc controls the state of services monitored by the runsv supervisor. It is compatible with daemontools command with the same name. config BUSYBOX_CONFIG_SVOK - bool "svok (1.5 kb)" + bool "svok (1.8 kb)" default BUSYBOX_DEFAULT_SVOK help svok checks whether runsv supervisor is running. diff --git a/package/utils/busybox/config/shell/Config.in b/package/utils/busybox/config/shell/Config.in index a68e9114ef7761..848609a8409f32 100644 --- a/package/utils/busybox/config/shell/Config.in +++ b/package/utils/busybox/config/shell/Config.in @@ -87,7 +87,7 @@ config BUSYBOX_CONFIG_SHELL_ASH depends on !BUSYBOX_CONFIG_NOMMU config BUSYBOX_CONFIG_ASH - bool "ash (78 kb)" + bool "ash (80 kb)" default BUSYBOX_DEFAULT_ASH depends on !BUSYBOX_CONFIG_NOMMU select BUSYBOX_CONFIG_SHELL_ASH @@ -201,11 +201,6 @@ config BUSYBOX_CONFIG_ASH_TEST default BUSYBOX_DEFAULT_ASH_TEST depends on BUSYBOX_CONFIG_SHELL_ASH -config BUSYBOX_CONFIG_ASH_SLEEP - bool "sleep builtin" - default BUSYBOX_DEFAULT_ASH_SLEEP - depends on BUSYBOX_CONFIG_SHELL_ASH - config BUSYBOX_CONFIG_ASH_HELP bool "help builtin" default BUSYBOX_DEFAULT_ASH_HELP @@ -227,7 +222,7 @@ config BUSYBOX_CONFIG_ASH_CMDCMD endif # ash options config BUSYBOX_CONFIG_CTTYHACK - bool "cttyhack (2.4 kb)" + bool "cttyhack (2.7 kb)" default BUSYBOX_DEFAULT_CTTYHACK help One common problem reported on the mailing list is the "can't @@ -270,7 +265,7 @@ config BUSYBOX_CONFIG_CTTYHACK # getty 115200 $(cttyhack) config BUSYBOX_CONFIG_HUSH - bool "hush (68 kb)" + bool "hush (70 kb)" default BUSYBOX_DEFAULT_HUSH select BUSYBOX_CONFIG_SHELL_HUSH help diff --git a/package/utils/busybox/config/sysklogd/Config.in b/package/utils/busybox/config/sysklogd/Config.in index 1aa2ea005fdcf2..5f982ed9c22e89 100644 --- a/package/utils/busybox/config/sysklogd/Config.in +++ b/package/utils/busybox/config/sysklogd/Config.in @@ -7,7 +7,7 @@ menu "System Logging Utilities" config BUSYBOX_CONFIG_KLOGD - bool "klogd (5.7 kb)" + bool "klogd (6.2 kb)" default BUSYBOX_DEFAULT_KLOGD help klogd is a utility which intercepts and logs all @@ -35,7 +35,7 @@ config BUSYBOX_CONFIG_FEATURE_KLOGD_KLOGCTL If in doubt, say 'Y'. config BUSYBOX_CONFIG_LOGGER - bool "logger (6.3 kb)" + bool "logger (6.5 kb)" default BUSYBOX_DEFAULT_LOGGER select BUSYBOX_CONFIG_FEATURE_SYSLOG help @@ -44,7 +44,7 @@ config BUSYBOX_CONFIG_LOGGER they can be logged. This is generally used to help locate problems that occur within programs and scripts. config BUSYBOX_CONFIG_LOGREAD - bool "logread (4.8 kb)" + bool "logread (5 kb)" default BUSYBOX_DEFAULT_LOGREAD help If you enabled Circular Buffer support, you almost @@ -64,7 +64,7 @@ config BUSYBOX_CONFIG_FEATURE_LOGREAD_REDUCED_LOCKING contention at some minor memory expense. config BUSYBOX_CONFIG_SYSLOGD - bool "syslogd (13 kb)" + bool "syslogd (14 kb)" default BUSYBOX_DEFAULT_SYSLOGD help The syslogd utility is used to record logs of all the diff --git a/package/utils/busybox/config/util-linux/Config.in b/package/utils/busybox/config/util-linux/Config.in index e3e59f1506d9a9..18ba619db023cc 100644 --- a/package/utils/busybox/config/util-linux/Config.in +++ b/package/utils/busybox/config/util-linux/Config.in @@ -7,7 +7,7 @@ menu "Linux System Utilities" config BUSYBOX_CONFIG_ACPID - bool "acpid (9 kb)" + bool "acpid (9.3 kb)" default BUSYBOX_DEFAULT_ACPID help acpid listens to ACPI events coming either in textual form from @@ -28,7 +28,7 @@ config BUSYBOX_CONFIG_FEATURE_ACPID_COMPAT help Accept and ignore compatibility options -g -m -s -S -v. config BUSYBOX_CONFIG_BLKDISCARD - bool "blkdiscard (4.3 kb)" + bool "blkdiscard (4.6 kb)" default BUSYBOX_DEFAULT_BLKDISCARD help blkdiscard discards sectors on a given device. @@ -46,23 +46,23 @@ config BUSYBOX_CONFIG_FEATURE_BLKID_TYPE help Show TYPE="filesystem type" config BUSYBOX_CONFIG_BLOCKDEV - bool "blockdev (2.3 kb)" + bool "blockdev (2.6 kb)" default BUSYBOX_DEFAULT_BLOCKDEV help Performs some ioctls with block devices. config BUSYBOX_CONFIG_CAL - bool "cal (5.8 kb)" + bool "cal (6.1 kb)" default BUSYBOX_DEFAULT_CAL help cal is used to display a monthly calendar. config BUSYBOX_CONFIG_CHRT - bool "chrt (4.7 kb)" + bool "chrt (5.1 kb)" default BUSYBOX_DEFAULT_CHRT help Manipulate real-time attributes of a process. This requires sched_{g,s}etparam support in your libc. config BUSYBOX_CONFIG_DMESG - bool "dmesg (3.7 kb)" + bool "dmesg (3.9 kb)" default BUSYBOX_DEFAULT_DMESG help dmesg is used to examine or control the kernel ring buffer. When the @@ -94,7 +94,7 @@ config BUSYBOX_CONFIG_FEATURE_DMESG_PRETTY <6>BIOS-provided physical RAM map: <6> BIOS-e820: 0000000000000000 - 000000000009f000 (usable) config BUSYBOX_CONFIG_EJECT - bool "eject (4 kb)" + bool "eject (4.3 kb)" default BUSYBOX_DEFAULT_EJECT help Used to eject cdroms. (defaults to /dev/cdrom) @@ -107,17 +107,17 @@ config BUSYBOX_CONFIG_FEATURE_EJECT_SCSI Add the -s option to eject, this allows to eject SCSI-Devices and usb-storage devices. config BUSYBOX_CONFIG_FALLOCATE - bool "fallocate (4.1 kb)" + bool "fallocate (4.3 kb)" default BUSYBOX_DEFAULT_FALLOCATE help Preallocate space for files. config BUSYBOX_CONFIG_FATATTR - bool "fatattr (1.9 kb)" + bool "fatattr (2.2 kb)" default BUSYBOX_DEFAULT_FATATTR help fatattr lists or changes the file attributes on a fat file system. config BUSYBOX_CONFIG_FBSET - bool "fbset (5.9 kb)" + bool "fbset (6.2 kb)" default BUSYBOX_DEFAULT_FBSET help fbset is used to show or change the settings of a Linux frame buffer @@ -144,12 +144,12 @@ config BUSYBOX_CONFIG_FEATURE_FBSET_READMODE default BUSYBOX_DEFAULT_FEATURE_FBSET_READMODE /etc/fb.modes, which can be used to set frame buffer device to pre-defined video modes. config BUSYBOX_CONFIG_FDFORMAT - bool "fdformat (4.4 kb)" + bool "fdformat (4.7 kb)" default BUSYBOX_DEFAULT_FDFORMAT help fdformat is used to low-level format a floppy disk. config BUSYBOX_CONFIG_FDISK - bool "fdisk (37 kb)" + bool "fdisk (31 kb)" default BUSYBOX_DEFAULT_FDISK help The fdisk utility is used to divide hard disks into one or more @@ -222,18 +222,18 @@ config BUSYBOX_CONFIG_FEATURE_FDISK_ADVANCED partition, and similarly evil things. Unless you have a very good reason you would be wise to leave this disabled. config BUSYBOX_CONFIG_FINDFS - bool "findfs (12 kb)" + bool "findfs (11 kb)" default BUSYBOX_DEFAULT_FINDFS select BUSYBOX_CONFIG_VOLUMEID help Prints the name of a filesystem with given label or UUID. config BUSYBOX_CONFIG_FLOCK - bool "flock (6.3 kb)" + bool "flock (6.5 kb)" default BUSYBOX_DEFAULT_FLOCK help Manage locks from shell scripts config BUSYBOX_CONFIG_FDFLUSH - bool "fdflush (1.3 kb)" + bool "fdflush (1.6 kb)" default BUSYBOX_DEFAULT_FDFLUSH help fdflush is only needed when changing media on slightly-broken @@ -245,7 +245,7 @@ config BUSYBOX_CONFIG_FDFLUSH leave this disabled. config BUSYBOX_CONFIG_FREERAMDISK - bool "freeramdisk (1.3 kb)" + bool "freeramdisk (1.6 kb)" default BUSYBOX_DEFAULT_FREERAMDISK help Linux allows you to create ramdisks. This utility allows you to @@ -265,18 +265,18 @@ config BUSYBOX_CONFIG_FSCK_MINIX check for and attempt to repair any corruption that occurs to a minix filesystem. config BUSYBOX_CONFIG_FSFREEZE - bool "fsfreeze (3.5 kb)" + bool "fsfreeze (3.7 kb)" default BUSYBOX_DEFAULT_FSFREEZE select BUSYBOX_CONFIG_LONG_OPTS help Halt new accesses and flush writes on a mounted filesystem. config BUSYBOX_CONFIG_FSTRIM - bool "fstrim (4.4 kb)" + bool "fstrim (4.6 kb)" default BUSYBOX_DEFAULT_FSTRIM help Discard unused blocks on a mounted filesystem. config BUSYBOX_CONFIG_GETOPT - bool "getopt (5.8 kb)" + bool "getopt (6 kb)" default BUSYBOX_DEFAULT_GETOPT help The getopt utility is used to break up (parse) options in command @@ -293,26 +293,27 @@ config BUSYBOX_CONFIG_FEATURE_GETOPT_LONG help Enable support for long options (option -l). config BUSYBOX_CONFIG_HEXDUMP - bool "hexdump (8.6 kb)" + bool "hexdump (8.7 kb)" default BUSYBOX_DEFAULT_HEXDUMP help The hexdump utility is used to display binary data in a readable way that is comparable to the output from most hex editors. config BUSYBOX_CONFIG_HD - bool "hd (7.8 kb)" + bool "hd (8.3 kb)" default BUSYBOX_DEFAULT_HD help hd is an alias to hexdump -C. config BUSYBOX_CONFIG_XXD - bool "xxd (8.9 kb)" + bool "xxd (11 kb)" default BUSYBOX_DEFAULT_XXD help The xxd utility is used to display binary data in a readable way that is comparable to the output from most hex editors. config BUSYBOX_CONFIG_HWCLOCK - bool "hwclock (5.8 kb)" + bool "hwclock (5.9 kb)" default BUSYBOX_DEFAULT_HWCLOCK + select BUSYBOX_CONFIG_LONG_OPTS help The hwclock utility is used to read and set the hardware clock on a system. This is primarily used to set the current time on @@ -331,26 +332,26 @@ config BUSYBOX_CONFIG_FEATURE_HWCLOCK_ADJTIME_FHS pathname.com/fhs/pub/fhs-2.3.html#VARLIBHWCLOCKSTATEDIRECTORYFORHWCLO config BUSYBOX_CONFIG_IONICE - bool "ionice (3.8 kb)" + bool "ionice (4 kb)" default BUSYBOX_DEFAULT_IONICE help Set/set program io scheduling class and priority Requires kernel >= 2.6.13 config BUSYBOX_CONFIG_IPCRM - bool "ipcrm (3.2 kb)" + bool "ipcrm (3.5 kb)" default BUSYBOX_DEFAULT_IPCRM help The ipcrm utility allows the removal of System V interprocess communication (IPC) objects and the associated data structures from the system. config BUSYBOX_CONFIG_IPCS - bool "ipcs (11 kb)" + bool "ipcs (12 kb)" default BUSYBOX_DEFAULT_IPCS help The ipcs utility is used to provide information on the currently allocated System V interprocess (IPC) objects in the system. config BUSYBOX_CONFIG_LAST - bool "last (6.1 kb)" + bool "last (7.4 kb)" default BUSYBOX_DEFAULT_LAST depends on BUSYBOX_CONFIG_FEATURE_WTMP help @@ -364,14 +365,14 @@ config BUSYBOX_CONFIG_FEATURE_LAST_FANCY 'last' displays detailed information about the last users that logged into the system (mimics sysvinit last). +900 bytes. config BUSYBOX_CONFIG_LOSETUP - bool "losetup (5.5 kb)" + bool "losetup (6.2 kb)" default BUSYBOX_DEFAULT_LOSETUP help losetup is used to associate or detach a loop device with a regular file or block device, and to query the status of a loop device. This version does not currently support enabling data encryption. config BUSYBOX_CONFIG_LSPCI - bool "lspci (6.3 kb)" + bool "lspci (6.4 kb)" default BUSYBOX_DEFAULT_LSPCI help lspci is a utility for displaying information about PCI buses in the @@ -379,7 +380,7 @@ config BUSYBOX_CONFIG_LSPCI This version uses sysfs (/sys/bus/pci/devices) only. config BUSYBOX_CONFIG_LSUSB - bool "lsusb (4.2 kb)" + bool "lsusb (4.4 kb)" default BUSYBOX_DEFAULT_LSUSB help lsusb is a utility for displaying information about USB buses in the @@ -387,7 +388,7 @@ config BUSYBOX_CONFIG_LSUSB This version uses sysfs (/sys/bus/usb/devices) only. config BUSYBOX_CONFIG_MDEV - bool "mdev (17 kb)" + bool "mdev (20 kb)" default BUSYBOX_DEFAULT_MDEV help mdev is a mini-udev implementation for dynamically creating device @@ -454,7 +455,7 @@ config BUSYBOX_CONFIG_FEATURE_MDEV_DAEMON resources than registering mdev as hotplug helper or using the uevent applet. config BUSYBOX_CONFIG_MESG - bool "mesg (1.4 kb)" + bool "mesg (1.8 kb)" default BUSYBOX_DEFAULT_MESG help Mesg controls access to your terminal by others. It is typically @@ -505,18 +506,18 @@ config BUSYBOX_CONFIG_MKFS_REISER Utility to create ReiserFS filesystems. Note: this applet needs a lot of testing and polishing. config BUSYBOX_CONFIG_MKDOSFS - bool "mkdosfs (7.2 kb)" + bool "mkdosfs (7.6 kb)" default BUSYBOX_DEFAULT_MKDOSFS help Utility to create FAT32 filesystems. config BUSYBOX_CONFIG_MKFS_VFAT - bool "mkfs.vfat (7.2 kb)" + bool "mkfs.vfat (7.6 kb)" default BUSYBOX_DEFAULT_MKFS_VFAT help Alias to "mkdosfs". config BUSYBOX_CONFIG_MKSWAP - bool "mkswap (6.3 kb)" + bool "mkswap (6.6 kb)" default BUSYBOX_DEFAULT_MKSWAP help The mkswap utility is used to configure a file or disk partition as @@ -535,7 +536,7 @@ config BUSYBOX_CONFIG_FEATURE_MKSWAP_UUID help Generate swap spaces with universally unique identifiers. config BUSYBOX_CONFIG_MORE - bool "more (7 kb)" + bool "more (7.2 kb)" default BUSYBOX_DEFAULT_MORE help more is a simple utility which allows you to read text one screen @@ -544,7 +545,7 @@ config BUSYBOX_CONFIG_MORE you will probably find this utility very helpful. If you don't have any need to reading text files, you can leave this disabled. config BUSYBOX_CONFIG_MOUNT - bool "mount (23 kb)" + bool "mount (24 kb)" default BUSYBOX_DEFAULT_MOUNT help All files and filesystems in Unix are arranged into one big directory @@ -634,7 +635,7 @@ config BUSYBOX_CONFIG_FEATURE_MOUNT_OTHERTAB help Support mount -T (specifying an alternate fstab) config BUSYBOX_CONFIG_MOUNTPOINT - bool "mountpoint (4.9 kb)" + bool "mountpoint (5.1 kb)" default BUSYBOX_DEFAULT_MOUNTPOINT help mountpoint checks if the directory is a mountpoint. @@ -659,12 +660,12 @@ config BUSYBOX_CONFIG_NOLOGIN_DEPENDENCIES If you know these will be available externally you can disable this option. config BUSYBOX_CONFIG_NSENTER - bool "nsenter (6.5 kb)" + bool "nsenter (6.8 kb)" default BUSYBOX_DEFAULT_NSENTER help Run program with namespaces of other processes. config BUSYBOX_CONFIG_PIVOT_ROOT - bool "pivot_root (1.1 kb)" + bool "pivot_root (1.4 kb)" default BUSYBOX_DEFAULT_PIVOT_ROOT help The pivot_root utility swaps the mount points for the root filesystem @@ -675,7 +676,7 @@ config BUSYBOX_CONFIG_PIVOT_ROOT Note: This is for initrd in linux 2.4. Under initramfs (introduced in linux 2.6) use switch_root instead. config BUSYBOX_CONFIG_RDATE - bool "rdate (5.6 kb)" + bool "rdate (5.9 kb)" default BUSYBOX_DEFAULT_RDATE help The rdate utility allows you to synchronize the date and time of your @@ -683,44 +684,44 @@ config BUSYBOX_CONFIG_RDATE the RFC868 protocol, which is built into the inetd daemon on most systems. config BUSYBOX_CONFIG_RDEV - bool "rdev (1.8 kb)" + bool "rdev (2.1 kb)" default BUSYBOX_DEFAULT_RDEV help Print the device node associated with the filesystem mounted at '/'. config BUSYBOX_CONFIG_READPROFILE - bool "readprofile (7.1 kb)" + bool "readprofile (7.5 kb)" default BUSYBOX_DEFAULT_READPROFILE help This allows you to parse /proc/profile for basic profiling. config BUSYBOX_CONFIG_RENICE - bool "renice (4.2 kb)" + bool "renice (4.4 kb)" default BUSYBOX_DEFAULT_RENICE help Renice alters the scheduling priority of one or more running processes. config BUSYBOX_CONFIG_REV - bool "rev (4.4 kb)" + bool "rev (4.6 kb)" default BUSYBOX_DEFAULT_REV help Reverse lines of a file or files. config BUSYBOX_CONFIG_RTCWAKE - bool "rtcwake (6.8 kb)" + bool "rtcwake (7.5 kb)" default BUSYBOX_DEFAULT_RTCWAKE help Enter a system sleep state until specified wakeup time. config BUSYBOX_CONFIG_SCRIPT - bool "script (8.6 kb)" + bool "script (8.8 kb)" default BUSYBOX_DEFAULT_SCRIPT help The script makes typescript of terminal session. config BUSYBOX_CONFIG_SCRIPTREPLAY - bool "scriptreplay (2.4 kb)" + bool "scriptreplay (2.6 kb)" default BUSYBOX_DEFAULT_SCRIPTREPLAY help This program replays a typescript, using timing information given by script -t. config BUSYBOX_CONFIG_SETARCH - bool "setarch (3.6 kb)" + bool "setarch (3.8 kb)" default BUSYBOX_DEFAULT_SETARCH help The linux32 utility is used to create a 32bit environment for the @@ -729,18 +730,18 @@ config BUSYBOX_CONFIG_SETARCH (like amd64/x86, ppc64/ppc, sparc64/sparc, etc...). config BUSYBOX_CONFIG_LINUX32 - bool "linux32 (3.3 kb)" + bool "linux32 (3.6 kb)" default BUSYBOX_DEFAULT_LINUX32 help Alias to "setarch linux32". config BUSYBOX_CONFIG_LINUX64 - bool "linux64 (3.3 kb)" + bool "linux64 (3.5 kb)" default BUSYBOX_DEFAULT_LINUX64 help Alias to "setarch linux64". config BUSYBOX_CONFIG_SETPRIV - bool "setpriv (6.6 kb)" + bool "setpriv (6.9 kb)" default BUSYBOX_DEFAULT_SETPRIV select BUSYBOX_CONFIG_LONG_OPTS help @@ -775,7 +776,7 @@ config BUSYBOX_CONFIG_FEATURE_SETPRIV_CAPABILITY_NAMES this option allows using the human-readable names in addition to the index-based names. config BUSYBOX_CONFIG_SETSID - bool "setsid (3.6 kb)" + bool "setsid (3.8 kb)" default BUSYBOX_DEFAULT_SETSID help setsid runs a program in a new session @@ -818,7 +819,7 @@ config BUSYBOX_CONFIG_FEATURE_SWAPONOFF_LABEL This allows for specifying a device by label or uuid, rather than by name. This feature utilizes the same functionality as blkid/findfs. config BUSYBOX_CONFIG_SWITCH_ROOT - bool "switch_root (5.5 kb)" + bool "switch_root (5.7 kb)" default BUSYBOX_DEFAULT_SWITCH_ROOT help The switch_root utility is used from initramfs to select a new @@ -837,7 +838,7 @@ config BUSYBOX_CONFIG_SWITCH_ROOT list of active mount points. That's why. config BUSYBOX_CONFIG_TASKSET - bool "taskset (4.2 kb)" + bool "taskset (5.6 kb)" default BUSYBOX_DEFAULT_TASKSET help Retrieve or set a processes's CPU affinity. @@ -860,7 +861,7 @@ config BUSYBOX_CONFIG_FEATURE_TASKSET_CPULIST Add support for taking/printing affinity as CPU list when '-c' option is used. For example, it prints '0-3,7' instead of mask '8f'. config BUSYBOX_CONFIG_UEVENT - bool "uevent (3.1 kb)" + bool "uevent (3.5 kb)" default BUSYBOX_DEFAULT_UEVENT help uevent is a netlink listener for kernel uevent notifications @@ -881,14 +882,14 @@ config BUSYBOX_CONFIG_FEATURE_UMOUNT_ALL help Support -a option to unmount all currently mounted filesystems. config BUSYBOX_CONFIG_UNSHARE - bool "unshare (7.2 kb)" + bool "unshare (7.3 kb)" default BUSYBOX_DEFAULT_UNSHARE depends on !BUSYBOX_CONFIG_NOMMU select BUSYBOX_CONFIG_LONG_OPTS help Run program with some namespaces unshared from parent. config BUSYBOX_CONFIG_WALL - bool "wall (2.6 kb)" + bool "wall (2.9 kb)" default BUSYBOX_DEFAULT_WALL depends on BUSYBOX_CONFIG_FEATURE_UTMP help diff --git a/package/utils/busybox/patches/001-fix-non-x86-build.patch b/package/utils/busybox/patches/001-fix-non-x86-build.patch new file mode 100644 index 00000000000000..b33ec98bf29968 --- /dev/null +++ b/package/utils/busybox/patches/001-fix-non-x86-build.patch @@ -0,0 +1,14 @@ +Index: busybox-1.37.0/libbb/hash_md5_sha.c +=================================================================== +--- busybox-1.37.0.orig/libbb/hash_md5_sha.c ++++ busybox-1.37.0/libbb/hash_md5_sha.c +@@ -1313,7 +1313,9 @@ unsigned FAST_FUNC sha1_end(sha1_ctx_t * + hash_size = 8; + if (ctx->process_block == sha1_process_block64 + #if ENABLE_SHA1_HWACCEL ++# if defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__)) + || ctx->process_block == sha1_process_block64_shaNI ++# endif + #endif + ) { + hash_size = 5; diff --git a/package/utils/busybox/patches/200-udhcpc_reduce_msgs.patch b/package/utils/busybox/patches/200-udhcpc_reduce_msgs.patch index c0f234ee421ecb..595eaa6afe3883 100644 --- a/package/utils/busybox/patches/200-udhcpc_reduce_msgs.patch +++ b/package/utils/busybox/patches/200-udhcpc_reduce_msgs.patch @@ -1,6 +1,6 @@ --- a/networking/udhcp/dhcpc.c +++ b/networking/udhcp/dhcpc.c -@@ -722,6 +722,7 @@ static int bcast_or_ucast(struct dhcp_pa +@@ -711,6 +711,7 @@ static int bcast_or_ucast(struct dhcp_pa static NOINLINE int send_discover(uint32_t requested) { struct dhcp_packet packet; @@ -8,7 +8,7 @@ /* Fill in: op, htype, hlen, cookie, chaddr fields, * xid field, message type option: -@@ -736,6 +737,7 @@ static NOINLINE int send_discover(uint32 +@@ -725,6 +726,7 @@ static NOINLINE int send_discover(uint32 */ add_client_options(&packet); diff --git a/package/utils/busybox/patches/201-udhcpc_changed_ifindex.patch b/package/utils/busybox/patches/201-udhcpc_changed_ifindex.patch index a4bda992c42b22..94745cf8d93340 100644 --- a/package/utils/busybox/patches/201-udhcpc_changed_ifindex.patch +++ b/package/utils/busybox/patches/201-udhcpc_changed_ifindex.patch @@ -1,6 +1,6 @@ --- a/networking/udhcp/dhcpc.c +++ b/networking/udhcp/dhcpc.c -@@ -1384,6 +1384,12 @@ int udhcpc_main(int argc UNUSED_PARAM, c +@@ -1374,6 +1374,12 @@ int udhcpc_main(int argc UNUSED_PARAM, c struct pollfd pfds[2]; struct dhcp_packet packet; diff --git a/package/utils/busybox/patches/301-ip-link-fix-netlink-msg-size.patch b/package/utils/busybox/patches/301-ip-link-fix-netlink-msg-size.patch index f4c0a8092257e9..9a3ddb52fd67a6 100644 --- a/package/utils/busybox/patches/301-ip-link-fix-netlink-msg-size.patch +++ b/package/utils/busybox/patches/301-ip-link-fix-netlink-msg-size.patch @@ -1,6 +1,6 @@ --- a/networking/libiproute/iplink.c +++ b/networking/libiproute/iplink.c -@@ -683,7 +683,7 @@ static int do_add_or_delete(char **argv, +@@ -953,7 +953,7 @@ static int do_add_or_delete(char **argv, } xrtnl_open(&rth); ll_init_map(&rth); diff --git a/package/utils/busybox/patches/530-nslookup-ensure-unique-transaction-IDs-for-the-DNS-queries.patch b/package/utils/busybox/patches/530-nslookup-ensure-unique-transaction-IDs-for-the-DNS-queries.patch index caa5ee78f35ad3..bbd7b277fe9b09 100644 --- a/package/utils/busybox/patches/530-nslookup-ensure-unique-transaction-IDs-for-the-DNS-queries.patch +++ b/package/utils/busybox/patches/530-nslookup-ensure-unique-transaction-IDs-for-the-DNS-queries.patch @@ -29,7 +29,7 @@ Forwarded: http://lists.busybox.net/pipermail/busybox/2022-October/089911.html --- --- a/networking/nslookup.c +++ b/networking/nslookup.c -@@ -978,6 +978,10 @@ int nslookup_main(int argc UNUSED_PARAM, +@@ -1370,6 +1370,10 @@ int nslookup_main(int argc UNUSED_PARAM, } } From fc0c518a88e68d3deef04bec73b33d35186d6546 Mon Sep 17 00:00:00 2001 From: Hannu Nyman Date: Sun, 1 Dec 2024 13:07:05 +0200 Subject: [PATCH 26/48] busybox: Fix cron log level to match previous behavior Change the cron log level in init script from 5 to 7 in order to match previous log behavior and to avoid log spam every minute. Busybox cron only uses levels 5,7,8, where 5 is debug and 7 and 8 are normal logging. Use 7 as default. (Fun note: this is needed because upstream corrected an ancient bug in their own log level handling and now 5 actually means something.) Signed-off-by: Hannu Nyman Link: https://github.com/openwrt/openwrt/pull/17107 Signed-off-by: Hauke Mehrtens --- package/utils/busybox/Makefile | 2 +- package/utils/busybox/files/cron | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package/utils/busybox/Makefile b/package/utils/busybox/Makefile index 7094b1e22db212..4f155b7a2503b2 100644 --- a/package/utils/busybox/Makefile +++ b/package/utils/busybox/Makefile @@ -6,7 +6,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=busybox PKG_VERSION:=1.37.0 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_FLAGS:=essential PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 diff --git a/package/utils/busybox/files/cron b/package/utils/busybox/files/cron index 4efdfa52cad32b..2ddffa61e48359 100755 --- a/package/utils/busybox/files/cron +++ b/package/utils/busybox/files/cron @@ -28,7 +28,7 @@ start_service() { ln -s /etc/crontabs /var/spool/cron/ 2>/dev/null procd_open_instance - procd_set_param command "$PROG" -f -c /etc/crontabs -l "${loglevel:-5}" + procd_set_param command "$PROG" -f -c /etc/crontabs -l "${loglevel:-7}" for crontab in /etc/crontabs/*; do procd_set_param file "$crontab" done From c268ae674d01dbd2215b6e3aefdbc763f17b8d0f Mon Sep 17 00:00:00 2001 From: Eric Fahlgren Date: Thu, 5 Dec 2024 07:06:46 -0800 Subject: [PATCH 27/48] apk: add dependency on wget provider The apk-* packages contain no declared dependencies on a wget provider, which is required for proper operation. Let's add it. Fixes: https://github.com/openwrt/openwrt/issues/17173 Signed-off-by: Eric Fahlgren Link: https://github.com/openwrt/openwrt/pull/17176 Signed-off-by: Robert Marko --- package/system/apk/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/system/apk/Makefile b/package/system/apk/Makefile index 6d8bf6e1bcf2f8..c045a990f0aa5d 100644 --- a/package/system/apk/Makefile +++ b/package/system/apk/Makefile @@ -27,7 +27,7 @@ define Package/apk/default SECTION:=base CATEGORY:=Base system TITLE:=apk package manager - DEPENDS:=+zlib + DEPENDS:=+zlib +wget URL:=$(PKG_SOURCE_URL) PROVIDES:=apk endef From 1c274227b0263795ef07bc1248f16046b3915941 Mon Sep 17 00:00:00 2001 From: Ivan Davydov Date: Mon, 2 Dec 2024 15:47:08 +0300 Subject: [PATCH 28/48] ramips: mt76x8: add support for Keenetic KN-3211 Keenetic KN-3211 is a 2.4 Ghz band 11n (Wi-Fi 4) Wi-Fi repeater, based on MT7628AN. Specification: - System-On-Chip: MT7628AN - CPU/Speed: 575 MHz - Flash-Chip: Winbond w25q256 - Flash size: 32768 KiB - RAM: 64 MiB - 1x 10/100 Mbps Ethernet - 2x external, non-detachable antennas - UART (J1) header on PCB (115200 8n1) - Wireless No1 (2T2R): SoC Built-in 2.4 GHz 802.11bgn - 3x LED, 1x button, 1x mode switch Notes: - The device supports dual boot mode - The firmware partitions were concatenated into one - The status button has been reassigned as the WPS button. Flash instruction: This device doesn't support sysupgrade, so the only way to flash OpenWrt image is to use tftp recovery mode in U-Boot: 1. Configure PC with static IP 192.168.1.2/24 and tftp server. 2. Rename "openwrt-ramips-mt76x8-keenetic_kn-3211-squashfs-factory.bin" to "KN-3211_recovery.bin" and place it in tftp server directory. 3. Connect PC with the ethernet port, press the reset button, power up the router and keep button pressed until power led starts blinking. 4. Router will download file from server, write it to flash and reboot. Signed-off-by: Ivan Davydov Link: https://github.com/openwrt/openwrt/pull/17080 Signed-off-by: Hauke Mehrtens --- .../ramips/dts/mt7628an_keenetic_kn-3211.dts | 218 ++++++++++++++++++ target/linux/ramips/image/mt76x8.mk | 10 + .../mt76x8/base-files/etc/board.d/02_network | 5 + 3 files changed, 233 insertions(+) create mode 100644 target/linux/ramips/dts/mt7628an_keenetic_kn-3211.dts diff --git a/target/linux/ramips/dts/mt7628an_keenetic_kn-3211.dts b/target/linux/ramips/dts/mt7628an_keenetic_kn-3211.dts new file mode 100644 index 00000000000000..1a06cd94bc6bd1 --- /dev/null +++ b/target/linux/ramips/dts/mt7628an_keenetic_kn-3211.dts @@ -0,0 +1,218 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +#include "mt7628an.dtsi" + +#include +#include +#include + +/ { + compatible = "keenetic,kn-3211", "mediatek,mt7628an-soc"; + model = "Keenetic KN-3211"; + + aliases { + led-boot = &led_status_green; + led-failsafe = &led_status_red; + led-running = &led_status_green; + led-upgrade = &led_status_blue; + }; + + chosen { + bootargs = "console=ttyS0,115200"; + }; + + leds { + compatible = "gpio-leds"; + + led_status_blue: status_blue { + function = LED_FUNCTION_STATUS; + color = ; + gpios = <&gpio 4 GPIO_ACTIVE_LOW>; + }; + + led_status_green: status_green { + function = LED_FUNCTION_STATUS; + color = ; + gpios = <&gpio 11 GPIO_ACTIVE_HIGH>; + }; + + led_status_red: status_red { + function = LED_FUNCTION_STATUS; + color = ; + gpios = <&gpio 38 GPIO_ACTIVE_LOW>; + }; + }; + + keys { + compatible = "gpio-keys"; + + wps { + label = "wps"; + gpios = <&gpio 37 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; + + virtual_flash { + compatible = "mtd-concat"; + devices = <&firmware1 &firmware2>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + compatible = "denx,uimage"; + label = "firmware"; + reg = <0x0 0x1ec0000>; + }; + }; + }; +}; + +&state_default { + gpio { + groups = "i2s", "i2c", "gpio", "refclk", "wdt", "wled_an"; + function = "gpio"; + }; +}; + +&usbphy { + status = "disabled"; +}; + +&ehci { + status = "disabled"; +}; + +&ohci { + status = "disabled"; +}; + +&spi0 { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <32000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "u-boot"; + reg = <0x0 0x30000>; + read-only; + }; + + partition@30000 { + label = "u-config"; + reg = <0x30000 0x10000>; + read-only; + }; + + partition@40000 { + label = "rf-eeprom"; + reg = <0x40000 0x10000>; + read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + eeprom_factory_400: eeprom@400 { + reg = <0x400 0x4da8>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; + }; + }; + + firmware1: partition@50000 { + label = "firmware_1"; + reg = <0x50000 0xf60000>; + }; + + partition@fb0000 { + label = "config_1"; + reg = <0xfb0000 0x40000>; + read-only; + }; + + partition@ff0000 { + label = "dump"; + reg = <0xff0000 0x10000>; + read-only; + }; + + partition@1000000 { + label = "u-state"; + reg = <0x1000000 0x30000>; + read-only; + }; + + partition@1030000 { + label = "u-config_res"; + reg = <0x1030000 0x10000>; + read-only; + }; + + partition@1040000 { + label = "rf-eeprom_res"; + reg = <0x1040000 0x10000>; + read-only; + }; + + firmware2: partition@1050000 { + label = "firmware_2"; + reg = <0x1050000 0xf60000>; + }; + + partition@1fb0000 { + label = "config_2"; + reg = <0x1fb0000 0x40000>; + read-only; + }; + }; + }; +}; + +ðernet { + nvmem-cells = <&macaddr_factory_4>; + nvmem-cell-names = "mac-address"; +}; + +&esw { + mediatek,portmap = <0x3e>; +}; + +&wmac { + status = "okay"; + + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; +}; + +&pcie { + status = "okay"; +}; + +&pcie0 { + wifi@0,0 { + compatible = "mediatek,mt76"; + reg = <0x0000 0 0 0 0>; + nvmem-cells = <&eeprom_factory_400>; + nvmem-cell-names = "eeprom"; + ieee80211-freq-limit = <5000000 6000000>; + }; +}; diff --git a/target/linux/ramips/image/mt76x8.mk b/target/linux/ramips/image/mt76x8.mk index 7e343bf0164fb0..25a7344afbe5e1 100644 --- a/target/linux/ramips/image/mt76x8.mk +++ b/target/linux/ramips/image/mt76x8.mk @@ -365,6 +365,16 @@ define Device/keenetic_kn-1613 endef TARGET_DEVICES += keenetic_kn-1613 +define Device/keenetic_kn-3211 + IMAGE_SIZE := 31488k + DEVICE_VENDOR := Keenetic + DEVICE_MODEL := KN-3211 + IMAGES += factory.bin + IMAGE/factory.bin := $$(sysupgrade_bin) | pad-to $$$$(BLOCKSIZE) | \ + check-size | zyimage -d 0x803211 -v "KN-3211" +endef +TARGET_DEVICES += keenetic_kn-3211 + define Device/kroks_kndrt31r16 IMAGE_SIZE := 16064k DEVICE_VENDOR := Kroks diff --git a/target/linux/ramips/mt76x8/base-files/etc/board.d/02_network b/target/linux/ramips/mt76x8/base-files/etc/board.d/02_network index 616baa80c055c7..e57643690a172c 100644 --- a/target/linux/ramips/mt76x8/base-files/etc/board.d/02_network +++ b/target/linux/ramips/mt76x8/base-files/etc/board.d/02_network @@ -134,6 +134,10 @@ ramips_setup_interfaces() ucidef_add_switch "switch0" \ "1:lan" "2:lan" "3:lan" "0:wan" "6@eth0" ;; + keenetic,kn-3211) + ucidef_add_switch "switch0" \ + "2:lan" "6@eth0" + ;; kroks,kndrt31r19) ucidef_add_switch "switch0" \ "0:lan" "6@eth0" @@ -280,6 +284,7 @@ ramips_setup_macs() wan_mac=$(mtd_get_mac_binary factory 0x2e) ;; keenetic,kn-1613|\ + keenetic,kn-3211|\ zyxel,keenetic-extra-ii) wan_mac=$(mtd_get_mac_binary rf-eeprom 0x28) ;; From 9ab03a1e3e060ca44d6f953943603ed3014abd28 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Mon, 25 Nov 2024 15:09:28 -0800 Subject: [PATCH 29/48] ipq40xx: remove default MAC assignments 1006 and 5006 are defaults that get set based on the calibration data. There's no need to explicitly specify them. Signed-off-by: Rosen Penev Link: https://github.com/openwrt/openwrt/pull/17128 Signed-off-by: Robert Marko --- .../arm/boot/dts/qcom/qcom-ipq40x9-dr40x9.dts | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/target/linux/ipq40xx/files-6.6/arch/arm/boot/dts/qcom/qcom-ipq40x9-dr40x9.dts b/target/linux/ipq40xx/files-6.6/arch/arm/boot/dts/qcom/qcom-ipq40x9-dr40x9.dts index 271a97209255a4..a549f034074d08 100644 --- a/target/linux/ipq40xx/files-6.6/arch/arm/boot/dts/qcom/qcom-ipq40x9-dr40x9.dts +++ b/target/linux/ipq40xx/files-6.6/arch/arm/boot/dts/qcom/qcom-ipq40x9-dr40x9.dts @@ -254,17 +254,9 @@ reg = <0x1000 0x2f20>; }; - macaddr_art_1006: mac-address@1006 { - reg = <0x1006 0x6>; - }; - precal_art_5000: precal@5000 { reg = <0x5000 0x2f20>; }; - - macaddr_art_5006: mac-address@5006 { - reg = <0x5006 0x6>; - }; }; }; @@ -382,15 +374,15 @@ &wifi0 { status = "okay"; - nvmem-cells = <&precal_art_1000>, <&macaddr_art_1006>; - nvmem-cell-names = "pre-calibration", "mac-address"; + nvmem-cells = <&precal_art_1000>; + nvmem-cell-names = "pre-calibration"; qcom,ath10k-calibration-variant = "Wallys-DR40X9"; }; &wifi1 { status = "okay"; - nvmem-cell-names = "pre-calibration", "mac-address"; - nvmem-cells = <&precal_art_5000>, <&macaddr_art_5006>; + nvmem-cell-names = "pre-calibration"; + nvmem-cells = <&precal_art_5000>; qcom,ath10k-calibration-variant = "Wallys-DR40X9"; }; From 14ff787f2ce34f4a0ad68ac11166a2089e28c5b7 Mon Sep 17 00:00:00 2001 From: Chukun Pan Date: Thu, 28 Nov 2024 22:26:10 +0800 Subject: [PATCH 30/48] ipq-wifi: update to version 2024-11-28 Contains following updates: * ipq8074: add TP-Link_deco-x80-5g BDF * ipq6018: add BDF for Qihoo 360V6 Signed-off-by: Chukun Pan Link: https://github.com/openwrt/openwrt/pull/15940 Signed-off-by: Robert Marko --- package/firmware/ipq-wifi/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package/firmware/ipq-wifi/Makefile b/package/firmware/ipq-wifi/Makefile index 4732a14b1b4e1b..af2a62b1588615 100644 --- a/package/firmware/ipq-wifi/Makefile +++ b/package/firmware/ipq-wifi/Makefile @@ -6,9 +6,9 @@ PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(PROJECT_GIT)/project/firmware/qca-wireless.git -PKG_SOURCE_DATE:=2024-10-08 -PKG_SOURCE_VERSION:=dcbab62272bf5cab2ed857bc655d240970e14f2a -PKG_MIRROR_HASH:=e53a3872abf5e35db6baaceb56e6ffa289f8dd9b6226cf8a4d5b87b541179175 +PKG_SOURCE_DATE:=2024-11-28 +PKG_SOURCE_VERSION:=e1f6c9ac9e1508852f292a2b8167823e180db4e8 +PKG_MIRROR_HASH:=cc7ef25d43bbea4d521e0cb69887b975295be98ddf83b29f52c3c0e7d1ceeb25 PKG_FLAGS:=nonshared include $(INCLUDE_DIR)/package.mk From 7e18e27e2ff7c15c5acb94581606aea052b1f82f Mon Sep 17 00:00:00 2001 From: Chukun Pan Date: Wed, 10 Jul 2024 23:18:15 +0800 Subject: [PATCH 31/48] qualcommax: image: cleanup whitespace Replace whitespaces with tab. Signed-off-by: Chukun Pan Link: https://github.com/openwrt/openwrt/pull/15940 Signed-off-by: Robert Marko --- target/linux/qualcommax/image/ipq60xx.mk | 59 ++++++++++++------------ target/linux/qualcommax/image/ipq807x.mk | 2 +- 2 files changed, 30 insertions(+), 31 deletions(-) diff --git a/target/linux/qualcommax/image/ipq60xx.mk b/target/linux/qualcommax/image/ipq60xx.mk index 41cfd164ee7d46..75a69d3c6b31c6 100644 --- a/target/linux/qualcommax/image/ipq60xx.mk +++ b/target/linux/qualcommax/image/ipq60xx.mk @@ -12,43 +12,42 @@ endef TARGET_DEVICES += 8devices_mango-dvk define Device/cambiumnetworks_xe3-4 - $(call Device/FitImage) - $(call Device/UbiFit) - DEVICE_VENDOR := Cambium Networks - DEVICE_MODEL := XE3-4 - BLOCKSIZE := 128k - PAGESIZE := 2048 - DEVICE_DTS_CONFIG := config@cp01-c3-xv3-4 - SOC := ipq6010 - DEVICE_PACKAGES := ipq-wifi-cambiumnetworks_xe34 ath11k-firmware-qcn9074 kmod-ath11k-pci + $(call Device/FitImage) + $(call Device/UbiFit) + DEVICE_VENDOR := Cambium Networks + DEVICE_MODEL := XE3-4 + BLOCKSIZE := 128k + PAGESIZE := 2048 + DEVICE_DTS_CONFIG := config@cp01-c3-xv3-4 + SOC := ipq6010 + DEVICE_PACKAGES := ipq-wifi-cambiumnetworks_xe34 ath11k-firmware-qcn9074 kmod-ath11k-pci endef TARGET_DEVICES += cambiumnetworks_xe3-4 define Device/netgear_wax214 - $(call Device/FitImage) - $(call Device/UbiFit) - DEVICE_VENDOR := Netgear - DEVICE_MODEL := WAX214 - BLOCKSIZE := 128k - PAGESIZE := 2048 - DEVICE_DTS_CONFIG := config@cp03-c1 - SOC := ipq6010 - DEVICE_PACKAGES := ipq-wifi-netgear_wax214 + $(call Device/FitImage) + $(call Device/UbiFit) + DEVICE_VENDOR := Netgear + DEVICE_MODEL := WAX214 + BLOCKSIZE := 128k + PAGESIZE := 2048 + DEVICE_DTS_CONFIG := config@cp03-c1 + SOC := ipq6010 + DEVICE_PACKAGES := ipq-wifi-netgear_wax214 endef TARGET_DEVICES += netgear_wax214 define Device/yuncore_fap650 - $(call Device/FitImage) - $(call Device/UbiFit) - DEVICE_VENDOR := Yuncore - DEVICE_MODEL := FAP650 - BLOCKSIZE := 128k - PAGESIZE := 2048 - DEVICE_DTS_CONFIG := config@cp03-c1 - SOC := ipq6018 - DEVICE_PACKAGES := ipq-wifi-yuncore_fap650 - IMAGES := factory.ubi factory.ubin sysupgrade.bin - IMAGE/factory.ubin := append-ubi | qsdk-ipq-factory-nand + $(call Device/FitImage) + $(call Device/UbiFit) + DEVICE_VENDOR := Yuncore + DEVICE_MODEL := FAP650 + BLOCKSIZE := 128k + PAGESIZE := 2048 + DEVICE_DTS_CONFIG := config@cp03-c1 + SOC := ipq6018 + DEVICE_PACKAGES := ipq-wifi-yuncore_fap650 + IMAGES := factory.ubi factory.ubin sysupgrade.bin + IMAGE/factory.ubin := append-ubi | qsdk-ipq-factory-nand endef TARGET_DEVICES += yuncore_fap650 - diff --git a/target/linux/qualcommax/image/ipq807x.mk b/target/linux/qualcommax/image/ipq807x.mk index 60af8654593a46..34fe92ed54c138 100644 --- a/target/linux/qualcommax/image/ipq807x.mk +++ b/target/linux/qualcommax/image/ipq807x.mk @@ -46,7 +46,7 @@ endef TARGET_DEVICES += arcadyan_aw1000 define Device/asus_rt-ax89x - DEVICE_VENDOR := Asus + DEVICE_VENDOR := Asus DEVICE_MODEL := RT-AX89X BLOCKSIZE := 128k PAGESIZE := 2048 From 025dbeb70cf8cbbd51fe4eb9c836f0d65e41a874 Mon Sep 17 00:00:00 2001 From: Chukun Pan Date: Fri, 21 Jun 2024 23:18:21 +0800 Subject: [PATCH 32/48] qualcommax: ipq60xx: add Qihoo 360V6 support Specifications: SoC: Qualcomm IPQ6000 1.5GHz RAM: NTCC256M16ER-EK 512MiB Flash: W29N01HZSINA 128MiB ETH: QCA8075 (3x LAN, 1x WAN) WLAN1: 2.4GHz 802.11b/g/n/ax 2x2 WLAN2: 5GHz 802.11a/n/ac/ax 2x2 Power: DC 12V 1.5A Button: Reset, Wps USB: 1x 2.0 Flash instructions: 1. Download the initramfs image, rename it to initramfs.itb, host it with the tftp server. 2. Interrupt U-Boot and run these commands: tftpboot initramfs.itb bootm 3. After openwrt boots up, use scp or luci web to upload sysupgrade.bin to upgrade. Signed-off-by: Chukun Pan Link: https://github.com/openwrt/openwrt/pull/15940 Signed-off-by: Robert Marko --- package/firmware/ipq-wifi/Makefile | 2 + .../arm64/boot/dts/qcom/ipq6000-360v6.dts | 219 ++++++++++++++++++ target/linux/qualcommax/image/ipq60xx.mk | 13 ++ .../ipq60xx/base-files/etc/board.d/02_network | 24 ++ .../etc/hotplug.d/firmware/11-ath11-caldata | 7 + .../base-files/lib/upgrade/platform.sh | 3 +- 6 files changed, 267 insertions(+), 1 deletion(-) create mode 100644 target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq6000-360v6.dts diff --git a/package/firmware/ipq-wifi/Makefile b/package/firmware/ipq-wifi/Makefile index af2a62b1588615..b80665efdb050d 100644 --- a/package/firmware/ipq-wifi/Makefile +++ b/package/firmware/ipq-wifi/Makefile @@ -49,6 +49,7 @@ ALLWIFIBOARDS:= \ netgear_wax620 \ netgear_wax630 \ prpl_haze \ + qihoo_360v6 \ qnap_301w \ redmi_ax6 \ skspruce_wia3300-20 \ @@ -175,6 +176,7 @@ $(eval $(call generate-ipq-wifi-package,netgear_wax214,Netgear WAX214)) $(eval $(call generate-ipq-wifi-package,netgear_wax218,Netgear WAX218)) $(eval $(call generate-ipq-wifi-package,netgear_wax620,Netgear WAX620)) $(eval $(call generate-ipq-wifi-package,netgear_wax630,Netgear WAX630)) +$(eval $(call generate-ipq-wifi-package,qihoo_360v6,Qihoo 360V6)) $(eval $(call generate-ipq-wifi-package,qnap_301w,QNAP 301w)) $(eval $(call generate-ipq-wifi-package,prpl_haze,prpl Haze)) $(eval $(call generate-ipq-wifi-package,redmi_ax6,Redmi AX6)) diff --git a/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq6000-360v6.dts b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq6000-360v6.dts new file mode 100644 index 00000000000000..07aabe045a6906 --- /dev/null +++ b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq6000-360v6.dts @@ -0,0 +1,219 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +/dts-v1/; + +#include "ipq6018-512m.dtsi" +#include "ipq6018-ess.dtsi" +#include "ipq6018-cp-cpu.dtsi" + +#include +#include +#include + +/ { + model = "Qihoo 360V6"; + compatible = "qihoo,360v6", "qcom,ipq6018"; + + aliases { + serial0 = &blsp1_uart3; + led-boot = &led_status_red; + led-failsafe = &led_status_red; + led-running = &led_status_green; + led-upgrade = &led_status_orange; + }; + + chosen { + stdout-path = "serial0:115200n8"; + bootargs-append = " root=/dev/ubiblock0_1"; + }; + + keys { + compatible = "gpio-keys"; + + wps { + label = "wps"; + linux,code = ; + gpios = <&tlmm 19 GPIO_ACTIVE_LOW>; + }; + + reset { + label = "reset"; + linux,code = ; + gpios = <&tlmm 68 GPIO_ACTIVE_LOW>; + }; + }; + + leds { + compatible = "gpio-leds"; + + led_status_red: red { + color = ; + function = LED_FUNCTION_STATUS; + gpios = <&tlmm 71 GPIO_ACTIVE_HIGH>; + }; + + led_status_orange: orange { + color = ; + function = LED_FUNCTION_STATUS; + gpios = <&tlmm 72 GPIO_ACTIVE_HIGH>; + }; + + led_status_green: green { + color = ; + function = LED_FUNCTION_STATUS; + gpios = <&tlmm 73 GPIO_ACTIVE_HIGH>; + }; + }; +}; + +&tlmm { + mdio_pins: mdio-pins { + mdc { + pins = "gpio64"; + function = "mdc"; + drive-strength = <8>; + bias-pull-up; + }; + + mdio { + pins = "gpio65"; + function = "mdio"; + drive-strength = <8>; + bias-pull-up; + }; + }; +}; + +&blsp1_uart3 { + pinctrl-0 = <&serial_3_pins>; + pinctrl-names = "default"; + status = "okay"; +}; + +&qpic_bam { + status = "okay"; +}; + +&qpic_nand { + status = "okay"; + + nand@0 { + reg = <0>; + nand-ecc-strength = <4>; + nand-ecc-step-size = <512>; + nand-bus-width = <8>; + + partitions { + compatible = "qcom,smem-part"; + }; + }; +}; + +&qusb_phy_0 { + status = "okay"; +}; + +&ssphy_0 { + status = "okay"; +}; + +&usb3 { + status = "okay"; +}; + +&mdio { + status = "okay"; + + pinctrl-0 = <&mdio_pins>; + pinctrl-names = "default"; + reset-gpios = <&tlmm 75 GPIO_ACTIVE_LOW>; + + ethernet-phy-package@0 { + compatible = "qcom,qca8075-package"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0>; + + qca8075_0: ethernet-phy@0 { + compatible = "ethernet-phy-ieee802.3-c22"; + reg = <0>; + }; + + qca8075_1: ethernet-phy@1 { + compatible = "ethernet-phy-ieee802.3-c22"; + reg = <1>; + }; + + qca8075_2: ethernet-phy@2 { + compatible = "ethernet-phy-ieee802.3-c22"; + reg = <2>; + }; + + qca8075_3: ethernet-phy@3 { + compatible = "ethernet-phy-ieee802.3-c22"; + reg = <3>; + }; + }; +}; + +&switch { + status = "okay"; + + switch_lan_bmp = <(ESS_PORT1 | ESS_PORT2 | ESS_PORT3)>; + switch_wan_bmp = ; + switch_mac_mode = ; + + qcom,port_phyinfo { + port@1 { + port_id = <1>; + phy_address = <0>; + }; + port@2 { + port_id = <2>; + phy_address = <1>; + }; + port@3 { + port_id = <3>; + phy_address = <2>; + }; + port@4 { + port_id = <4>; + phy_address = <3>; + }; + }; +}; + +&edma { + status = "okay"; +}; + +&dp1 { + status = "okay"; + phy-handle = <&qca8075_0>; + label = "lan1"; +}; + +&dp2 { + status = "okay"; + phy-handle = <&qca8075_1>; + label = "lan2"; +}; + +&dp3 { + status = "okay"; + phy-handle = <&qca8075_2>; + label = "lan3"; +}; + +&dp4 { + status = "okay"; + phy-handle = <&qca8075_3>; + label = "wan"; +}; + +&wifi { + status = "okay"; + + qcom,ath11k-fw-memory-mode = <1>; + qcom,ath11k-calibration-variant = "Qihoo-360V6"; +}; diff --git a/target/linux/qualcommax/image/ipq60xx.mk b/target/linux/qualcommax/image/ipq60xx.mk index 75a69d3c6b31c6..d861f82d1c693d 100644 --- a/target/linux/qualcommax/image/ipq60xx.mk +++ b/target/linux/qualcommax/image/ipq60xx.mk @@ -37,6 +37,19 @@ define Device/netgear_wax214 endef TARGET_DEVICES += netgear_wax214 +define Device/qihoo_360v6 + $(call Device/FitImage) + $(call Device/UbiFit) + DEVICE_VENDOR := Qihoo + DEVICE_MODEL := 360V6 + BLOCKSIZE := 128k + PAGESIZE := 2048 + SOC := ipq6000 + DEVICE_DTS_CONFIG := config@cp03-c1 + DEVICE_PACKAGES := ipq-wifi-qihoo_360v6 +endef +TARGET_DEVICES += qihoo_360v6 + define Device/yuncore_fap650 $(call Device/FitImage) $(call Device/UbiFit) diff --git a/target/linux/qualcommax/ipq60xx/base-files/etc/board.d/02_network b/target/linux/qualcommax/ipq60xx/base-files/etc/board.d/02_network index 86d55de7b8dd17..86ed04f34bbfc6 100644 --- a/target/linux/qualcommax/ipq60xx/base-files/etc/board.d/02_network +++ b/target/linux/qualcommax/ipq60xx/base-files/etc/board.d/02_network @@ -20,6 +20,9 @@ ipq60xx_setup_interfaces() netgear,wax214) ucidef_set_interfaces_lan_wan "lan" ;; + qihoo,360v6) + ucidef_set_interfaces_lan_wan "lan1 lan2 lan3" "wan" + ;; yuncore,fap650) ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4" "wan" ;; @@ -29,9 +32,30 @@ ipq60xx_setup_interfaces() esac } +ipq60xx_setup_macs() +{ + local board="$1" + local lan_mac="" + local wan_mac="" + local label_mac="" + + case "$board" in + qihoo,360v6) + lan_mac=$(mtd_get_mac_ascii factory lanMac) + wan_mac=$(macaddr_add "$lan_mac" 1) + label_mac=$lan_mac + ;; + esac + + [ -n "$lan_mac" ] && ucidef_set_interface_macaddr "lan" $lan_mac + [ -n "$wan_mac" ] && ucidef_set_interface_macaddr "wan" $wan_mac + [ -n "$label_mac" ] && ucidef_set_label_macaddr $label_mac +} + board_config_update board=$(board_name) ipq60xx_setup_interfaces $board +ipq60xx_setup_macs $board board_config_flush exit 0 diff --git a/target/linux/qualcommax/ipq60xx/base-files/etc/hotplug.d/firmware/11-ath11-caldata b/target/linux/qualcommax/ipq60xx/base-files/etc/hotplug.d/firmware/11-ath11-caldata index cc2de7514e8879..e35413e1e039b1 100644 --- a/target/linux/qualcommax/ipq60xx/base-files/etc/hotplug.d/firmware/11-ath11-caldata +++ b/target/linux/qualcommax/ipq60xx/base-files/etc/hotplug.d/firmware/11-ath11-caldata @@ -18,6 +18,13 @@ case "$FIRMWARE" in netgear,wax214) caldata_extract "0:art" 0x1000 0x10000 ;; + qihoo,360v6) + caldata_extract "0:art" 0x1000 0x10000 + label_mac=$(mtd_get_mac_ascii factory lanMac) + ath11k_patch_mac $(macaddr_add $label_mac 3) 0 + ath11k_patch_mac $(macaddr_add $label_mac 2) 1 + ath11k_set_macflag + ;; yuncore,fap650) caldata_extract "0:art" 0x1000 0x20000 ;; diff --git a/target/linux/qualcommax/ipq60xx/base-files/lib/upgrade/platform.sh b/target/linux/qualcommax/ipq60xx/base-files/lib/upgrade/platform.sh index cbc6292978bf2d..c545746b31ff79 100644 --- a/target/linux/qualcommax/ipq60xx/base-files/lib/upgrade/platform.sh +++ b/target/linux/qualcommax/ipq60xx/base-files/lib/upgrade/platform.sh @@ -37,7 +37,8 @@ platform_do_upgrade() { fw_setenv bootcount 0 nand_do_upgrade "$1" ;; - netgear,wax214) + netgear,wax214|\ + qihoo,360v6) nand_do_upgrade "$1" ;; yuncore,fap650) From 5348e2e81ad9d6cc34bee1511bff7805386205d4 Mon Sep 17 00:00:00 2001 From: Bohdan Chubuk Date: Mon, 11 Nov 2024 01:57:31 +0200 Subject: [PATCH 33/48] generic: mtd: spinand: add support for FORESEE F35SQA002G Add support for FORESEE F35SQA002G SPI NAND. Datasheet: https://www.longsys.com/uploads/LM-00006FORESEEF35SQA002GDatasheet_1650183701.pdf Refresh all affected patch with make target/linux/refresh. Signed-off-by: Martin Kurbanov Signed-off-by: Miquel Raynal Signed-off-by: Bohdan Chubuk Link: https://github.com/openwrt/openwrt/pull/16915 Signed-off-by: Christian Marangi --- ...d-add-support-for-FORESEE-F35SQA002G.patch | 146 ++++++++++++++++++ ...flip_threshold-to-75-of-ECC-strength.patch | 2 +- ...nd-Add-support-for-Etron-EM73D044VCx.patch | 8 +- .../330-snand-mtk-bmt-support.patch | 6 +- ...Add-support-for-the-Fidelix-FM35X1GA.patch | 12 +- ...and-Add-calibration-support-for-spin.patch | 4 +- ...nor-Add-calibration-support-for-spi-.patch | 2 +- 7 files changed, 163 insertions(+), 17 deletions(-) create mode 100644 target/linux/generic/backport-6.6/411-v6.7-mtd-spinand-add-support-for-FORESEE-F35SQA002G.patch diff --git a/target/linux/generic/backport-6.6/411-v6.7-mtd-spinand-add-support-for-FORESEE-F35SQA002G.patch b/target/linux/generic/backport-6.6/411-v6.7-mtd-spinand-add-support-for-FORESEE-F35SQA002G.patch new file mode 100644 index 00000000000000..90672b99797c3c --- /dev/null +++ b/target/linux/generic/backport-6.6/411-v6.7-mtd-spinand-add-support-for-FORESEE-F35SQA002G.patch @@ -0,0 +1,146 @@ +From 49c8e854869d673df8452f24dfa8989cd0f615a8 Mon Sep 17 00:00:00 2001 +From: Martin Kurbanov +Date: Mon, 2 Oct 2023 17:04:58 +0300 +Subject: [PATCH] mtd: spinand: add support for FORESEE F35SQA002G + +Add support for FORESEE F35SQA002G SPI NAND. +Datasheet: + https://www.longsys.com/uploads/LM-00006FORESEEF35SQA002GDatasheet_1650183701.pdf + +Signed-off-by: Martin Kurbanov +Signed-off-by: Miquel Raynal +Link: https://lore.kernel.org/linux-mtd/20231002140458.147605-1-mmkurbanov@salutedevices.com +--- + drivers/mtd/nand/spi/Makefile | 2 +- + drivers/mtd/nand/spi/core.c | 1 + + drivers/mtd/nand/spi/foresee.c | 95 ++++++++++++++++++++++++++++++++++ + include/linux/mtd/spinand.h | 1 + + 4 files changed, 98 insertions(+), 1 deletion(-) + create mode 100644 drivers/mtd/nand/spi/foresee.c + +--- a/drivers/mtd/nand/spi/Makefile ++++ b/drivers/mtd/nand/spi/Makefile +@@ -1,4 +1,4 @@ + # SPDX-License-Identifier: GPL-2.0 +-spinand-objs := core.o alliancememory.o ato.o esmt.o gigadevice.o macronix.o ++spinand-objs := core.o alliancememory.o ato.o esmt.o foresee.o gigadevice.o macronix.o + spinand-objs += micron.o paragon.o toshiba.o winbond.o xtx.o + obj-$(CONFIG_MTD_SPI_NAND) += spinand.o +--- a/drivers/mtd/nand/spi/core.c ++++ b/drivers/mtd/nand/spi/core.c +@@ -940,6 +940,7 @@ static const struct spinand_manufacturer + &alliancememory_spinand_manufacturer, + &ato_spinand_manufacturer, + &esmt_c8_spinand_manufacturer, ++ &foresee_spinand_manufacturer, + &gigadevice_spinand_manufacturer, + ¯onix_spinand_manufacturer, + µn_spinand_manufacturer, +--- /dev/null ++++ b/drivers/mtd/nand/spi/foresee.c +@@ -0,0 +1,95 @@ ++// SPDX-License-Identifier: (GPL-2.0+ OR MIT) ++/* ++ * Copyright (c) 2023, SberDevices. All Rights Reserved. ++ * ++ * Author: Martin Kurbanov ++ */ ++ ++#include ++#include ++#include ++ ++#define SPINAND_MFR_FORESEE 0xCD ++ ++static SPINAND_OP_VARIANTS(read_cache_variants, ++ SPINAND_PAGE_READ_FROM_CACHE_X4_OP(0, 1, NULL, 0), ++ SPINAND_PAGE_READ_FROM_CACHE_X2_OP(0, 1, NULL, 0), ++ SPINAND_PAGE_READ_FROM_CACHE_OP(true, 0, 1, NULL, 0), ++ SPINAND_PAGE_READ_FROM_CACHE_OP(false, 0, 1, NULL, 0)); ++ ++static SPINAND_OP_VARIANTS(write_cache_variants, ++ SPINAND_PROG_LOAD_X4(true, 0, NULL, 0), ++ SPINAND_PROG_LOAD(true, 0, NULL, 0)); ++ ++static SPINAND_OP_VARIANTS(update_cache_variants, ++ SPINAND_PROG_LOAD_X4(false, 0, NULL, 0), ++ SPINAND_PROG_LOAD(false, 0, NULL, 0)); ++ ++static int f35sqa002g_ooblayout_ecc(struct mtd_info *mtd, int section, ++ struct mtd_oob_region *region) ++{ ++ return -ERANGE; ++} ++ ++static int f35sqa002g_ooblayout_free(struct mtd_info *mtd, int section, ++ struct mtd_oob_region *region) ++{ ++ if (section) ++ return -ERANGE; ++ ++ /* Reserve 2 bytes for the BBM. */ ++ region->offset = 2; ++ region->length = 62; ++ ++ return 0; ++} ++ ++static const struct mtd_ooblayout_ops f35sqa002g_ooblayout = { ++ .ecc = f35sqa002g_ooblayout_ecc, ++ .free = f35sqa002g_ooblayout_free, ++}; ++ ++static int f35sqa002g_ecc_get_status(struct spinand_device *spinand, u8 status) ++{ ++ struct nand_device *nand = spinand_to_nand(spinand); ++ ++ switch (status & STATUS_ECC_MASK) { ++ case STATUS_ECC_NO_BITFLIPS: ++ return 0; ++ ++ case STATUS_ECC_HAS_BITFLIPS: ++ return nanddev_get_ecc_conf(nand)->strength; ++ ++ default: ++ break; ++ } ++ ++ /* More than 1-bit error was detected in one or more sectors and ++ * cannot be corrected. ++ */ ++ return -EBADMSG; ++} ++ ++static const struct spinand_info foresee_spinand_table[] = { ++ SPINAND_INFO("F35SQA002G", ++ SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0x72, 0x72), ++ NAND_MEMORG(1, 2048, 64, 64, 2048, 40, 1, 1, 1), ++ NAND_ECCREQ(1, 512), ++ SPINAND_INFO_OP_VARIANTS(&read_cache_variants, ++ &write_cache_variants, ++ &update_cache_variants), ++ SPINAND_HAS_QE_BIT, ++ SPINAND_ECCINFO(&f35sqa002g_ooblayout, ++ f35sqa002g_ecc_get_status)), ++}; ++ ++static const struct spinand_manufacturer_ops foresee_spinand_manuf_ops = { ++}; ++ ++const struct spinand_manufacturer foresee_spinand_manufacturer = { ++ .id = SPINAND_MFR_FORESEE, ++ .name = "FORESEE", ++ .chips = foresee_spinand_table, ++ .nchips = ARRAY_SIZE(foresee_spinand_table), ++ .ops = &foresee_spinand_manuf_ops, ++}; +--- a/include/linux/mtd/spinand.h ++++ b/include/linux/mtd/spinand.h +@@ -263,6 +263,7 @@ struct spinand_manufacturer { + extern const struct spinand_manufacturer alliancememory_spinand_manufacturer; + extern const struct spinand_manufacturer ato_spinand_manufacturer; + extern const struct spinand_manufacturer esmt_c8_spinand_manufacturer; ++extern const struct spinand_manufacturer foresee_spinand_manufacturer; + extern const struct spinand_manufacturer gigadevice_spinand_manufacturer; + extern const struct spinand_manufacturer macronix_spinand_manufacturer; + extern const struct spinand_manufacturer micron_spinand_manufacturer; diff --git a/target/linux/generic/pending-6.6/410-mtd-spinand-set-bitflip_threshold-to-75-of-ECC-strength.patch b/target/linux/generic/pending-6.6/410-mtd-spinand-set-bitflip_threshold-to-75-of-ECC-strength.patch index aeac79c02383a3..84c6c4ae13b850 100644 --- a/target/linux/generic/pending-6.6/410-mtd-spinand-set-bitflip_threshold-to-75-of-ECC-strength.patch +++ b/target/linux/generic/pending-6.6/410-mtd-spinand-set-bitflip_threshold-to-75-of-ECC-strength.patch @@ -53,7 +53,7 @@ Signed-off-by: Daniel Golle --- a/drivers/mtd/nand/spi/core.c +++ b/drivers/mtd/nand/spi/core.c -@@ -1286,6 +1286,7 @@ static int spinand_init(struct spinand_d +@@ -1287,6 +1287,7 @@ static int spinand_init(struct spinand_d /* Propagate ECC information to mtd_info */ mtd->ecc_strength = nanddev_get_ecc_conf(nand)->strength; mtd->ecc_step_size = nanddev_get_ecc_conf(nand)->step_size; diff --git a/target/linux/generic/pending-6.6/487-mtd-spinand-Add-support-for-Etron-EM73D044VCx.patch b/target/linux/generic/pending-6.6/487-mtd-spinand-Add-support-for-Etron-EM73D044VCx.patch index 8fd136595262da..7a3a0f33adb74a 100644 --- a/target/linux/generic/pending-6.6/487-mtd-spinand-Add-support-for-Etron-EM73D044VCx.patch +++ b/target/linux/generic/pending-6.6/487-mtd-spinand-Add-support-for-Etron-EM73D044VCx.patch @@ -42,9 +42,9 @@ Submitted-by: Daniel Danzberger +++ b/drivers/mtd/nand/spi/Makefile @@ -1,4 +1,4 @@ # SPDX-License-Identifier: GPL-2.0 --spinand-objs := core.o alliancememory.o ato.o esmt.o gigadevice.o macronix.o +-spinand-objs := core.o alliancememory.o ato.o esmt.o foresee.o gigadevice.o macronix.o -spinand-objs += micron.o paragon.o toshiba.o winbond.o xtx.o -+spinand-objs := core.o alliancememory.o ato.o esmt.o etron.o gigadevice.o ++spinand-objs := core.o alliancememory.o ato.o esmt.o etron.o foresee.o gigadevice.o +spinand-objs += macronix.o micron.o paragon.o toshiba.o winbond.o xtx.o obj-$(CONFIG_MTD_SPI_NAND) += spinand.o --- a/drivers/mtd/nand/spi/core.c @@ -54,9 +54,9 @@ Submitted-by: Daniel Danzberger &ato_spinand_manufacturer, &esmt_c8_spinand_manufacturer, + &etron_spinand_manufacturer, + &foresee_spinand_manufacturer, &gigadevice_spinand_manufacturer, ¯onix_spinand_manufacturer, - µn_spinand_manufacturer, --- /dev/null +++ b/drivers/mtd/nand/spi/etron.c @@ -0,0 +1,98 @@ @@ -165,6 +165,6 @@ Submitted-by: Daniel Danzberger extern const struct spinand_manufacturer ato_spinand_manufacturer; extern const struct spinand_manufacturer esmt_c8_spinand_manufacturer; +extern const struct spinand_manufacturer etron_spinand_manufacturer; + extern const struct spinand_manufacturer foresee_spinand_manufacturer; extern const struct spinand_manufacturer gigadevice_spinand_manufacturer; extern const struct spinand_manufacturer macronix_spinand_manufacturer; - extern const struct spinand_manufacturer micron_spinand_manufacturer; diff --git a/target/linux/mediatek/patches-6.6/330-snand-mtk-bmt-support.patch b/target/linux/mediatek/patches-6.6/330-snand-mtk-bmt-support.patch index de8e8806433c60..939ec048555787 100644 --- a/target/linux/mediatek/patches-6.6/330-snand-mtk-bmt-support.patch +++ b/target/linux/mediatek/patches-6.6/330-snand-mtk-bmt-support.patch @@ -8,7 +8,7 @@ static int spinand_read_reg_op(struct spinand_device *spinand, u8 reg, u8 *val) { -@@ -1346,6 +1347,7 @@ static int spinand_probe(struct spi_mem +@@ -1347,6 +1348,7 @@ static int spinand_probe(struct spi_mem if (ret) return ret; @@ -16,7 +16,7 @@ ret = mtd_device_register(mtd, NULL, 0); if (ret) goto err_spinand_cleanup; -@@ -1353,6 +1355,7 @@ static int spinand_probe(struct spi_mem +@@ -1354,6 +1356,7 @@ static int spinand_probe(struct spi_mem return 0; err_spinand_cleanup: @@ -24,7 +24,7 @@ spinand_cleanup(spinand); return ret; -@@ -1371,6 +1374,7 @@ static int spinand_remove(struct spi_mem +@@ -1372,6 +1375,7 @@ static int spinand_remove(struct spi_mem if (ret) return ret; diff --git a/target/linux/mediatek/patches-6.6/340-mtd-spinand-Add-support-for-the-Fidelix-FM35X1GA.patch b/target/linux/mediatek/patches-6.6/340-mtd-spinand-Add-support-for-the-Fidelix-FM35X1GA.patch index 22408b9273dfcc..e06e125c462e2b 100644 --- a/target/linux/mediatek/patches-6.6/340-mtd-spinand-Add-support-for-the-Fidelix-FM35X1GA.patch +++ b/target/linux/mediatek/patches-6.6/340-mtd-spinand-Add-support-for-the-Fidelix-FM35X1GA.patch @@ -18,18 +18,18 @@ Signed-off-by: Davide Fioravanti +++ b/drivers/mtd/nand/spi/Makefile @@ -1,4 +1,4 @@ # SPDX-License-Identifier: GPL-2.0 --spinand-objs := core.o alliancememory.o ato.o esmt.o etron.o gigadevice.o -+spinand-objs := core.o alliancememory.o ato.o esmt.o etron.o fidelix.o gigadevice.o +-spinand-objs := core.o alliancememory.o ato.o esmt.o etron.o foresee.o gigadevice.o ++spinand-objs := core.o alliancememory.o ato.o esmt.o etron.o fidelix.o foresee.o gigadevice.o spinand-objs += macronix.o micron.o paragon.o toshiba.o winbond.o xtx.o obj-$(CONFIG_MTD_SPI_NAND) += spinand.o --- a/drivers/mtd/nand/spi/core.c +++ b/drivers/mtd/nand/spi/core.c -@@ -941,6 +941,7 @@ static const struct spinand_manufacturer - &alliancememory_spinand_manufacturer, +@@ -942,6 +942,7 @@ static const struct spinand_manufacturer &ato_spinand_manufacturer, &esmt_c8_spinand_manufacturer, -+ &fidelix_spinand_manufacturer, &etron_spinand_manufacturer, ++ &fidelix_spinand_manufacturer, + &foresee_spinand_manufacturer, &gigadevice_spinand_manufacturer, ¯onix_spinand_manufacturer, --- /dev/null @@ -118,6 +118,6 @@ Signed-off-by: Davide Fioravanti extern const struct spinand_manufacturer esmt_c8_spinand_manufacturer; extern const struct spinand_manufacturer etron_spinand_manufacturer; +extern const struct spinand_manufacturer fidelix_spinand_manufacturer; + extern const struct spinand_manufacturer foresee_spinand_manufacturer; extern const struct spinand_manufacturer gigadevice_spinand_manufacturer; extern const struct spinand_manufacturer macronix_spinand_manufacturer; - extern const struct spinand_manufacturer micron_spinand_manufacturer; diff --git a/target/linux/mediatek/patches-6.6/435-drivers-mtd-spinand-Add-calibration-support-for-spin.patch b/target/linux/mediatek/patches-6.6/435-drivers-mtd-spinand-Add-calibration-support-for-spin.patch index bd8e738a37cc6a..50149fd819608e 100644 --- a/target/linux/mediatek/patches-6.6/435-drivers-mtd-spinand-Add-calibration-support-for-spin.patch +++ b/target/linux/mediatek/patches-6.6/435-drivers-mtd-spinand-Add-calibration-support-for-spin.patch @@ -11,7 +11,7 @@ Signed-off-by: SkyLake.Huang --- a/drivers/mtd/nand/spi/core.c +++ b/drivers/mtd/nand/spi/core.c -@@ -979,6 +979,56 @@ static int spinand_manufacturer_match(st +@@ -980,6 +980,56 @@ static int spinand_manufacturer_match(st return -ENOTSUPP; } @@ -68,7 +68,7 @@ Signed-off-by: SkyLake.Huang static int spinand_id_detect(struct spinand_device *spinand) { u8 *id = spinand->id.data; -@@ -1229,6 +1279,10 @@ static int spinand_init(struct spinand_d +@@ -1230,6 +1280,10 @@ static int spinand_init(struct spinand_d if (!spinand->scratchbuf) return -ENOMEM; diff --git a/target/linux/mediatek/patches-6.6/436-drivers-mtd-spi-nor-Add-calibration-support-for-spi-.patch b/target/linux/mediatek/patches-6.6/436-drivers-mtd-spi-nor-Add-calibration-support-for-spi-.patch index 744042ae1aa56e..27c5dfd5d66b66 100644 --- a/target/linux/mediatek/patches-6.6/436-drivers-mtd-spi-nor-Add-calibration-support-for-spi-.patch +++ b/target/linux/mediatek/patches-6.6/436-drivers-mtd-spi-nor-Add-calibration-support-for-spi-.patch @@ -12,7 +12,7 @@ Signed-off-by: SkyLake.Huang --- a/drivers/mtd/nand/spi/core.c +++ b/drivers/mtd/nand/spi/core.c -@@ -1020,7 +1020,10 @@ int spinand_cal_read(void *priv, u32 *ad +@@ -1021,7 +1021,10 @@ int spinand_cal_read(void *priv, u32 *ad if (ret) return ret; From 1269a836edc45a42ab1e76dcd20e8cd8325529da Mon Sep 17 00:00:00 2001 From: Bohdan Chubuk Date: Fri, 6 Dec 2024 00:17:56 +0200 Subject: [PATCH 34/48] generic: mtd: spinand: add support for FORESEE F35SQA001G Add support for FORESEE F35SQA001G SPI NAND. Similar to F35SQA002G, but differs in capacity. Datasheet: - https://cdn.ozdisan.com/ETicaret_Dosya/704795_871495.pdf Tested on Xiaomi AX3000T flashed with OpenWRT. Signed-off-by: Bohdan Chubuk Signed-off-by: Miquel Raynal Link: https://github.com/openwrt/openwrt/pull/16915 Signed-off-by: Christian Marangi --- ...d-add-support-for-FORESEE-F35SQA001G.patch | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 target/linux/generic/backport-6.6/412-v6.14-mtd-spinand-add-support-for-FORESEE-F35SQA001G.patch diff --git a/target/linux/generic/backport-6.6/412-v6.14-mtd-spinand-add-support-for-FORESEE-F35SQA001G.patch b/target/linux/generic/backport-6.6/412-v6.14-mtd-spinand-add-support-for-FORESEE-F35SQA001G.patch new file mode 100644 index 00000000000000..84b3b2afee57a0 --- /dev/null +++ b/target/linux/generic/backport-6.6/412-v6.14-mtd-spinand-add-support-for-FORESEE-F35SQA001G.patch @@ -0,0 +1,38 @@ +From ae461cde5c559675fc4c0ba351c7c31ace705f56 Mon Sep 17 00:00:00 2001 +From: Bohdan Chubuk +Date: Sun, 10 Nov 2024 22:50:47 +0200 +Subject: [PATCH] mtd: spinand: add support for FORESEE F35SQA001G + +Add support for FORESEE F35SQA001G SPI NAND. + +Similar to F35SQA002G, but differs in capacity. +Datasheet: + - https://cdn.ozdisan.com/ETicaret_Dosya/704795_871495.pdf + +Tested on Xiaomi AX3000T flashed with OpenWRT. + +Signed-off-by: Bohdan Chubuk +Signed-off-by: Miquel Raynal +--- + drivers/mtd/nand/spi/foresee.c | 10 ++++++++++ + 1 file changed, 10 insertions(+) + +--- a/drivers/mtd/nand/spi/foresee.c ++++ b/drivers/mtd/nand/spi/foresee.c +@@ -81,6 +81,16 @@ static const struct spinand_info foresee + SPINAND_HAS_QE_BIT, + SPINAND_ECCINFO(&f35sqa002g_ooblayout, + f35sqa002g_ecc_get_status)), ++ SPINAND_INFO("F35SQA001G", ++ SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0x71, 0x71), ++ NAND_MEMORG(1, 2048, 64, 64, 1024, 20, 1, 1, 1), ++ NAND_ECCREQ(1, 512), ++ SPINAND_INFO_OP_VARIANTS(&read_cache_variants, ++ &write_cache_variants, ++ &update_cache_variants), ++ SPINAND_HAS_QE_BIT, ++ SPINAND_ECCINFO(&f35sqa002g_ooblayout, ++ f35sqa002g_ecc_get_status)), + }; + + static const struct spinand_manufacturer_ops foresee_spinand_manuf_ops = { From af6f1a90bbc824bd22814568c5b6990aa082ce8b Mon Sep 17 00:00:00 2001 From: Robert Marko Date: Fri, 6 Dec 2024 18:21:20 +0100 Subject: [PATCH 35/48] ucode: update to Git HEAD (2024-12-06) 47b54cf5a4b6 types: introduce `ucv_array_sort_r()` and `ucv_object_sort_r()` efeb57806552 types, vm: refactor usage of global variables f9d2faf67de6 vm: reset signals when freeing VM 4e86847d802d lib: utilize `ucv_array_sort_r()` and `ucv_object_sort_r()` c71444ea301f types: ucv_resource_create(): rename `typename` parameter to `type` 373df7299c79 nl80211: properly support split_wiphy_dump for single phys 9bcd25f54708 lexer: Preserve keyword, regexp flags until processing non-comment tokens 0a7ff4715cb8 main: pretty-print `-p` output by default 4c3d5b469156 struct: Add new buffer API for incremental packing/unpacking efc4122124cb struct: do not use global variables for caching types Fixes: https://github.com/jow-/ucode/issues/248 Fixes: https://github.com/jow-/ucode/issues/250 Fixes: https://github.com/efahl/owut/issues/25 Link: https://github.com/openwrt/openwrt/pull/17191 Signed-off-by: Robert Marko --- package/utils/ucode/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package/utils/ucode/Makefile b/package/utils/ucode/Makefile index a68dea81507242..8cc5d36a74201b 100644 --- a/package/utils/ucode/Makefile +++ b/package/utils/ucode/Makefile @@ -12,9 +12,9 @@ PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=https://github.com/jow-/ucode.git -PKG_SOURCE_DATE:=2024-12-02 -PKG_SOURCE_VERSION:=b0b5d93846a1fb9d1d94992d5fdf508ef345e87d -PKG_MIRROR_HASH:=b43fcb38a85469552d5fb641ade271c346634a52c3628155d3215953ff2c25e1 +PKG_SOURCE_DATE:=2024-12-06 +PKG_SOURCE_VERSION:=209f041f3193b55702fadefca51888a62d38cc28 +PKG_MIRROR_HASH:=432a7566e9536b6d0e99f924fcf2e6aaf45b88f87ed58d1e5d1dd1154307a8b7 PKG_MAINTAINER:=Jo-Philipp Wich PKG_LICENSE:=ISC From 3fbc7400082fcfbeacf2fbd24742a3c8439c4297 Mon Sep 17 00:00:00 2001 From: Robert Marko Date: Sun, 17 Nov 2024 20:40:48 +0100 Subject: [PATCH 36/48] qualcommax: refresh config Refresh the kernel config via kernel_menuconfig. Link: https://github.com/openwrt/openwrt/pull/14807 Signed-off-by: Robert Marko --- target/linux/qualcommax/config-6.6 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target/linux/qualcommax/config-6.6 b/target/linux/qualcommax/config-6.6 index ac5059682a5cdf..6f3c9e725d2caa 100644 --- a/target/linux/qualcommax/config-6.6 +++ b/target/linux/qualcommax/config-6.6 @@ -33,7 +33,6 @@ CONFIG_ARM64_PA_BITS=48 CONFIG_ARM64_PA_BITS_48=y CONFIG_ARM64_PTR_AUTH=y CONFIG_ARM64_PTR_AUTH_KERNEL=y -CONFIG_ARM64_SME=y CONFIG_ARM64_SVE=y CONFIG_ARM64_TAGGED_ADDR_ABI=y CONFIG_ARM64_VA_BITS=39 @@ -91,6 +90,7 @@ CONFIG_CPU_IDLE=y CONFIG_CPU_IDLE_GOV_MENU=y CONFIG_CPU_IDLE_MULTIPLE_DRIVERS=y CONFIG_CPU_LITTLE_ENDIAN=y +CONFIG_CPU_MITIGATIONS=y CONFIG_CPU_PM=y CONFIG_CPU_RMAP=y CONFIG_CPU_THERMAL=y @@ -149,7 +149,6 @@ CONFIG_FUNCTION_ALIGNMENT_4B=y CONFIG_FWNODE_MDIO=y CONFIG_FW_LOADER_PAGED_BUF=y CONFIG_FW_LOADER_SYSFS=y -CONFIG_GCC_ASM_GOTO_OUTPUT_WORKAROUND=y CONFIG_GCC_SUPPORTS_DYNAMIC_FTRACE_WITH_ARGS=y CONFIG_GENERIC_ALLOCATOR=y CONFIG_GENERIC_ARCH_TOPOLOGY=y @@ -277,6 +276,7 @@ CONFIG_NR_CPUS=4 CONFIG_NVIDIA_CARMEL_CNP_ERRATUM=y CONFIG_NVMEM=y CONFIG_NVMEM_LAYOUTS=y +CONFIG_NVMEM_LAYOUT_U_BOOT_ENV=y CONFIG_NVMEM_QCOM_QFPROM=y # CONFIG_NVMEM_QCOM_SEC_QFPROM is not set CONFIG_NVMEM_SYSFS=y From 2e4a0ebdde52c0e3791694dc3156934eb94b8f96 Mon Sep 17 00:00:00 2001 From: Robert Marko Date: Sun, 17 Nov 2024 20:41:11 +0100 Subject: [PATCH 37/48] qualcommax: enable userspace regulator for ipq60xx as well Userspace regulator consumer is rather usefull so enable it for ipq60xx as well and remove from ipq807x only kernel config. Link: https://github.com/openwrt/openwrt/pull/14807 Signed-off-by: Robert Marko --- target/linux/qualcommax/config-6.6 | 2 +- target/linux/qualcommax/ipq807x/config-default | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/target/linux/qualcommax/config-6.6 b/target/linux/qualcommax/config-6.6 index 6f3c9e725d2caa..05e2f51bf20a67 100644 --- a/target/linux/qualcommax/config-6.6 +++ b/target/linux/qualcommax/config-6.6 @@ -444,7 +444,7 @@ CONFIG_REGMAP_MMIO=y CONFIG_REGULATOR=y # CONFIG_REGULATOR_CPR3 is not set CONFIG_REGULATOR_FIXED_VOLTAGE=y -# CONFIG_REGULATOR_QCOM_REFGEN is not set +CONFIG_REGULATOR_USERSPACE_CONSUMER=y # CONFIG_REGULATOR_VQMMC_IPQ4019 is not set CONFIG_RELOCATABLE=y CONFIG_REMOTEPROC=y diff --git a/target/linux/qualcommax/ipq807x/config-default b/target/linux/qualcommax/ipq807x/config-default index f4942c32ccff71..1fa8d84ad69999 100644 --- a/target/linux/qualcommax/ipq807x/config-default +++ b/target/linux/qualcommax/ipq807x/config-default @@ -32,7 +32,6 @@ CONFIG_REGULATOR_CPR4_APSS=y # CONFIG_REGULATOR_QCOM_LABIBB is not set CONFIG_REGULATOR_QCOM_SPMI=y # CONFIG_REGULATOR_QCOM_USB_VBUS is not set -CONFIG_REGULATOR_USERSPACE_CONSUMER=y CONFIG_RTC_DRV_PM8XXX=y CONFIG_SPMI=y # CONFIG_SPMI_HISI3670 is not set From 9c55866fada91c45679f75d03e6d13e1e0cd4202 Mon Sep 17 00:00:00 2001 From: Vladyslav Andreichykov Date: Thu, 7 Mar 2024 11:47:04 +0200 Subject: [PATCH 38/48] qualcommax: ipq60xx: add Linksys MR7350 support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Linksys MR7350 is a 802.11ax Dual-band router/AP. Specifications: * CPU: Qualcomm IPQ6000 Quad core Cortex-A53(A73) 1.5GHz * RAM: 512MB of DDR3 * Storage: 256Mb NAND * Ethernet: 5x1G RJ45 ports (QCA8075) * WLAN: * 2.4GHz: Qualcomm QCN5022 2x2 802.11b/g/n/ax 574 Mbps PHY rate * 5GHz: Qualcomm QCN5052 2x2@80MHz or 802.11a/b/g/n/ac/ax 1201 Mbps PHY rate * LED-s: * RGB system led * USB blue led * Buttons: 1x Soft reset 1x WPS * Power: 12V DC Jack Installation instructions: Open Linksys Web UI - http://192.168.1.1/ca or http://10.65.1.1/ca depending on your setup. Login with your admin password. The default password can be found on a sticker under the device. To enter into the support mode, click on the “CA” link and the bottom of the page. Open the “Connectivity” menu and upload the squash-factory image with the “Choose file” button. Click start. Ignore all the prompts and warnings by click “yes” in all the popups. The Wifi radios are turned off by default. To configure the router, you will need to connect your computer to the LAN port of the device. Then you would need to write openwrt to the other partition for it to work - First Check booted partition: fw_printenv -n boot_part - Change the partition: fw_setenv boot_part 1 or fw_setenv boot_part 2 depending on the current partition - Then install Openwrt to the other partition if booted in slot 1: mtd -r -e alt_kernel -n write openwrt-qualcommax-ipq60xx-linksys_mr7350-squashfs-factory.bin alt_kernel - If in slot 2: mtd -r -e kernel -n write openwrt-qualcommax-ipq60xx-linksys_mr7350-squashfs-factory.bin kernel Co-Authored-by: Chukun Pan Co-Authored-by: Robert Marko Signed-off-by: Vladyslav Andreichykov Link: https://github.com/openwrt/openwrt/pull/14807 Signed-off-by: Robert Marko --- .../uboot-envtools/files/qualcommax_ipq60xx | 5 + package/firmware/ipq-wifi/Makefile | 2 + .../arm64/boot/dts/qcom/ipq6000-mr7350.dts | 465 ++++++++++++++++++ target/linux/qualcommax/image/ipq60xx.mk | 18 + .../ipq60xx/base-files/etc/board.d/01_leds | 12 + .../ipq60xx/base-files/etc/board.d/02_network | 8 +- .../etc/hotplug.d/firmware/11-ath11-caldata | 1 + .../etc/hotplug.d/ieee80211/11_fix_wifi_mac | 18 + .../ipq60xx/base-files/etc/init.d/bootcount | 3 + .../base-files/lib/upgrade/platform.sh | 14 + 10 files changed, 545 insertions(+), 1 deletion(-) create mode 100644 target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq6000-mr7350.dts create mode 100644 target/linux/qualcommax/ipq60xx/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac mode change 100755 => 100644 target/linux/qualcommax/ipq60xx/base-files/etc/init.d/bootcount diff --git a/package/boot/uboot-envtools/files/qualcommax_ipq60xx b/package/boot/uboot-envtools/files/qualcommax_ipq60xx index 853037b77609d7..ccc74e2df6e92c 100644 --- a/package/boot/uboot-envtools/files/qualcommax_ipq60xx +++ b/package/boot/uboot-envtools/files/qualcommax_ipq60xx @@ -15,6 +15,11 @@ cambiumnetworks,xe3-4) [ -n "$idx" ] && \ ubootenv_add_uci_config "/dev/mtd$idx" "0x0" "0x10000" "0x10000" ;; +linksys,mr7350) + idx="$(find_mtd_index u_env)" + [ -n "$idx" ] && \ + ubootenv_add_uci_config "/dev/mtd$idx" "0x0" "0x40000" "0x20000" "2" + ;; netgear,wax214) idx="$(find_mtd_index 0:appsblenv)" [ -n "$idx" ] && \ diff --git a/package/firmware/ipq-wifi/Makefile b/package/firmware/ipq-wifi/Makefile index b80665efdb050d..fe17484d851a17 100644 --- a/package/firmware/ipq-wifi/Makefile +++ b/package/firmware/ipq-wifi/Makefile @@ -37,6 +37,7 @@ ALLWIFIBOARDS:= \ dynalink_dl-wrx36 \ edgecore_eap102 \ edimax_cax1800 \ + linksys_mr7350 \ linksys_mx4200 \ linksys_mx5300 \ linksys_mx8500 \ @@ -165,6 +166,7 @@ $(eval $(call generate-ipq-wifi-package,compex_wpq873,Compex WPQ-873)) $(eval $(call generate-ipq-wifi-package,dynalink_dl-wrx36,Dynalink DL-WRX36)) $(eval $(call generate-ipq-wifi-package,edgecore_eap102,Edgecore EAP102)) $(eval $(call generate-ipq-wifi-package,edimax_cax1800,Edimax CAX1800)) +$(eval $(call generate-ipq-wifi-package,linksys_mr7350,Linksys MR7350)) $(eval $(call generate-ipq-wifi-package,linksys_mx4200,Linksys MX4200)) $(eval $(call generate-ipq-wifi-package,linksys_mx5300,Linksys MX5300)) $(eval $(call generate-ipq-wifi-package,linksys_mx8500,Linksys MX8500)) diff --git a/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq6000-mr7350.dts b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq6000-mr7350.dts new file mode 100644 index 00000000000000..5761c3b582738f --- /dev/null +++ b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq6000-mr7350.dts @@ -0,0 +1,465 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +/dts-v1/; + +#include "ipq6018.dtsi" +#include "ipq6018-cp-cpu.dtsi" +#include "ipq6018-ess.dtsi" +#include +#include +#include + +/ { + model = "Linksys MR7350"; + compatible = "linksys,mr7350", "qcom,ipq6018"; + + aliases { + serial0 = &blsp1_uart3; + serial1 = &blsp1_uart2; + led-boot = &led_system_blue; + led-running = &led_system_blue; + led-failsafe = &led_system_red; + led-upgrade = &led_system_green; + }; + + chosen { + stdout-path = "serial0:115200n8"; + bootargs-append = " root=/dev/ubiblock0_0"; + }; + + keys { + compatible = "gpio-keys"; + + wps-button { + label = "wps"; + linux,code = ; + gpios = <&tlmm 56 GPIO_ACTIVE_LOW>; + }; + + reset-button { + label = "reset"; + linux,code = ; + gpios = <&tlmm 57 GPIO_ACTIVE_LOW>; + }; + }; + + leds { + compatible = "gpio-leds"; + + /*lan1-amber { + label = "amber:lan1"; + color = ; + gpios = <&qca8075_0 0 GPIO_ACTIVE_HIGH>; + }; + + lan1-green { + label = "green:lan1"; + color = ; + gpios = <&qca8075_0 1 GPIO_ACTIVE_HIGH>; + }; + + lan2-amber { + label = "amber:lan2"; + color = ; + gpios = <&qca8075_1 0 GPIO_ACTIVE_HIGH>; + }; + + lan2-green { + label = "green:lan2"; + color = ; + gpios = <&qca8075_1 1 GPIO_ACTIVE_HIGH>; + }; + + lan3-amber { + label = "amber:lan3"; + color = ; + gpios = <&qca8075_2 0 GPIO_ACTIVE_HIGH>; + }; + + lan3-green { + label = "green:lan3"; + color = ; + gpios = <&qca8075_2 1 GPIO_ACTIVE_HIGH>; + }; + + lan4-amber { + label = "amber:lan4"; + color = ; + gpios = <&qca8075_3 0 GPIO_ACTIVE_HIGH>; + }; + + lan4-green { + label = "green:lan4"; + color = ; + gpios = <&qca8075_3 1 GPIO_ACTIVE_HIGH>; + }; + + wan-amber { + color = ; + function = LED_FUNCTION_WAN; + gpios = <&qca8075_4 0 GPIO_ACTIVE_HIGH>; + }; + + wan-green { + color = ; + function = LED_FUNCTION_WAN; + gpios = <&qca8075_4 1 GPIO_ACTIVE_HIGH>; + };*/ + + usb { + color = ; + function = LED_FUNCTION_USB; + gpios = <&tlmm 60 GPIO_ACTIVE_HIGH>; + trigger-sources = <&usb3_port1>, <&usb3_port2>; + linux,default-trigger = "usbport"; + }; + }; + + reg_usb_vbus: regulator-usb-vbus { + compatible = "regulator-fixed"; + regulator-name = "usb_vbus"; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + gpio = <&tlmm 61 GPIO_ACTIVE_LOW>; + regulator-boot-on; + }; + + output-usb0-power { + compatible = "regulator-output"; + vout-supply = <®_usb_vbus>; + }; +}; + +&tlmm { + hsuart_pins: hsuart-pins { + mux { + pins = "gpio69", "gpio70", + "gpio71", "gpio72"; + function = "blsp1_uart"; + drive-strength = <8>; + bias-disable; + }; + }; + + i2c_pins: i2c-pins { + mux { + pins = "gpio42", "gpio43"; + function = "blsp2_i2c"; + drive-strength = <8>; + bias-pull-down; + }; + }; + + mdio_pins: mdio-state { + mdc-pins { + pins = "gpio64"; + function = "mdc"; + drive-strength = <8>; + bias-pull-up; + }; + + mdio-pins { + pins = "gpio65"; + function = "mdio"; + drive-strength = <8>; + bias-pull-up; + }; + }; +}; + +&blsp1_i2c3 { + pinctrl-0 = <&i2c_pins>; + pinctrl-names = "default"; + status = "okay"; + + led-controller@62 { + compatible = "nxp,pca9633"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0x62>; + + led_system_red: led@0 { + reg = <0>; + color = ; + function = LED_FUNCTION_STATUS; + }; + + led_system_green: led@1 { + reg = <1>; + color = ; + function = LED_FUNCTION_STATUS; + }; + + led_system_blue: led@2 { + reg = <2>; + color = ; + function = LED_FUNCTION_STATUS; + }; + }; +}; + +&blsp1_uart2 { + pinctrl-0 = <&hsuart_pins>; + pinctrl-names = "default"; + status = "okay"; +}; + +&blsp1_uart3 { + pinctrl-0 = <&serial_3_pins>; + pinctrl-names = "default"; + status = "okay"; +}; + +&dwc_0 { + #address-cells = <1>; + #size-cells = <0>; + + usb3_port1: port@1 { + reg = <1>; + #trigger-source-cells = <0>; + }; + + usb3_port2: port@2 { + reg = <2>; + #trigger-source-cells = <0>; + }; +}; + +&qpic_bam { + status = "okay"; +}; + +&qpic_nand { + status = "okay"; + + nand@0 { + reg = <0>; + nand-ecc-strength = <4>; + nand-ecc-step-size = <512>; + nand-bus-width = <8>; + + partitions { + compatible = "qcom,smem-part"; + }; + }; +}; + +&qusb_phy_0 { + status = "okay"; +}; + +&ssphy_0 { + status = "okay"; +}; + +&usb3 { + vbus-supply = <®_usb_vbus>; + status = "okay"; +}; + +&mdio { + status = "okay"; + + pinctrl-0 = <&mdio_pins>; + pinctrl-names = "default"; + reset-gpios = <&tlmm 75 GPIO_ACTIVE_LOW>; + + ethernet-phy-package@0 { + compatible = "qcom,qca8075-package"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0>; + + qca8075_0: ethernet-phy@0 { + compatible = "ethernet-phy-ieee802.3-c22"; + reg = <0>; + + leds { + #address-cells = <1>; + #size-cells = <0>; + + led@0 { + reg = <0>; + color = ; + function = LED_FUNCTION_LAN; + default-state = "keep"; + }; + + led@1 { + reg = <1>; + color = ; + function = LED_FUNCTION_LAN; + default-state = "keep"; + }; + }; + }; + + qca8075_1: ethernet-phy@1 { + compatible = "ethernet-phy-ieee802.3-c22"; + reg = <1>; + + leds { + #address-cells = <1>; + #size-cells = <0>; + + led@0 { + reg = <0>; + color = ; + function = LED_FUNCTION_LAN; + default-state = "keep"; + }; + + led@1 { + reg = <1>; + color = ; + function = LED_FUNCTION_LAN; + default-state = "keep"; + }; + }; + }; + + qca8075_2: ethernet-phy@2 { + compatible = "ethernet-phy-ieee802.3-c22"; + reg = <2>; + + leds { + #address-cells = <1>; + #size-cells = <0>; + + led@0 { + reg = <0>; + color = ; + function = LED_FUNCTION_LAN; + default-state = "keep"; + }; + + led@1 { + reg = <1>; + color = ; + function = LED_FUNCTION_LAN; + default-state = "keep"; + }; + }; + }; + + qca8075_3: ethernet-phy@3 { + compatible = "ethernet-phy-ieee802.3-c22"; + reg = <3>; + + leds { + #address-cells = <1>; + #size-cells = <0>; + + led@0 { + reg = <0>; + color = ; + function = LED_FUNCTION_LAN; + default-state = "keep"; + }; + + led@1 { + reg = <1>; + color = ; + function = LED_FUNCTION_LAN; + default-state = "keep"; + }; + }; + }; + + qca8075_4: ethernet-phy@4 { + compatible = "ethernet-phy-ieee802.3-c22"; + reg = <4>; + + leds { + #address-cells = <1>; + #size-cells = <0>; + + led@0 { + reg = <0>; + color = ; + function = LED_FUNCTION_WAN; + default-state = "keep"; + }; + + led@1 { + reg = <1>; + color = ; + function = LED_FUNCTION_WAN; + default-state = "keep"; + }; + }; + }; + }; +}; + +&switch { + status = "okay"; + + switch_lan_bmp = <(ESS_PORT1 | ESS_PORT2 | ESS_PORT3 | ESS_PORT4)>; + switch_wan_bmp = ; + switch_mac_mode = ; + + qcom,port_phyinfo { + port@1 { + port_id = <1>; + phy_address = <0>; + }; + port@2 { + port_id = <2>; + phy_address = <1>; + }; + port@3 { + port_id = <3>; + phy_address = <2>; + }; + port@4 { + port_id = <4>; + phy_address = <3>; + }; + port@5 { + port_id = <5>; + phy_address = <4>; + }; + }; +}; + +&edma { + status = "okay"; +}; + +&dp1 { + status = "okay"; + phy-handle = <&qca8075_0>; + label = "lan1"; +}; + +&dp2 { + status = "okay"; + phy-handle = <&qca8075_1>; + label = "lan2"; +}; + +&dp3 { + status = "okay"; + phy-handle = <&qca8075_2>; + label = "lan3"; +}; + +&dp4 { + status = "okay"; + phy-handle = <&qca8075_3>; + label = "lan4"; +}; + +&dp5 { + status = "okay"; + phy-handle = <&qca8075_4>; + label = "wan"; +}; + +&wifi { + status = "okay"; + + qcom,ath11k-calibration-variant = "Linksys-MR7350"; + qcom,ath11k-fw-memory-mode = <1>; +}; diff --git a/target/linux/qualcommax/image/ipq60xx.mk b/target/linux/qualcommax/image/ipq60xx.mk index d861f82d1c693d..0b7cd413c36a66 100644 --- a/target/linux/qualcommax/image/ipq60xx.mk +++ b/target/linux/qualcommax/image/ipq60xx.mk @@ -24,6 +24,24 @@ define Device/cambiumnetworks_xe3-4 endef TARGET_DEVICES += cambiumnetworks_xe3-4 +define Device/linksys_mr7350 + $(call Device/FitImage) + DEVICE_VENDOR := Linksys + DEVICE_MODEL := MR7350 + SOC := ipq6000 + NAND_SIZE := 256m + KERNEL_SIZE := 8192k + BLOCKSIZE := 128k + PAGESIZE := 2048 + IMAGE_SIZE := 75776k + IMAGES += factory.bin + IMAGE/factory.bin := append-kernel | pad-to $$$$(KERNEL_SIZE) | \ + append-ubi | linksys-image type=MR7350 + DEVICE_PACKAGES := ipq-wifi-linksys_mr7350 \ + kmod-leds-pca963x kmod-usb-ledtrig-usbport +endef +TARGET_DEVICES += linksys_mr7350 + define Device/netgear_wax214 $(call Device/FitImage) $(call Device/UbiFit) diff --git a/target/linux/qualcommax/ipq60xx/base-files/etc/board.d/01_leds b/target/linux/qualcommax/ipq60xx/base-files/etc/board.d/01_leds index 189822157f3c79..a9575eb4efc162 100644 --- a/target/linux/qualcommax/ipq60xx/base-files/etc/board.d/01_leds +++ b/target/linux/qualcommax/ipq60xx/base-files/etc/board.d/01_leds @@ -7,6 +7,18 @@ board_config_update board=$(board_name) case "$board" in +linksys,mr7350) + ucidef_set_led_netdev "lan1-port-link" "LAN1-PORT-LINK" "90000.mdio-1:00:green:lan" "lan1" "link_10 link_100 link_1000" + ucidef_set_led_netdev "lan1-port-traffic" "LAN1-PORT-TRAFFIC" "90000.mdio-1:00:orange:lan" "lan1" "tx rx link_10 link_100 link_1000" + ucidef_set_led_netdev "lan2-port-link" "LAN2-PORT-LINK" "90000.mdio-1:01:green:lan" "lan2" "link_10 link_100 link_1000" + ucidef_set_led_netdev "lan2-port-traffic" "LAN2-PORT-TRAFFIC" "90000.mdio-1:01:orange:lan" "lan2" "tx rx link_10 link_100 link_1000" + ucidef_set_led_netdev "lan3-port-link" "LAN3-PORT-LINK" "90000.mdio-1:02:green:lan" "lan3" "link_10 link_100 link_1000" + ucidef_set_led_netdev "lan3-port-traffic" "LAN3-PORT-TRAFFIC" "90000.mdio-1:02:orange:lan" "lan3" "tx rx link_10 link_100 link_1000" + ucidef_set_led_netdev "lan4-port-link" "LAN4-PORT-LINK" "90000.mdio-1:03:green:lan" "lan4" "link_10 link_100 link_1000" + ucidef_set_led_netdev "lan4-port-traffic" "LAN4-PORT-TRAFFIC" "90000.mdio-1:03:orange:lan" "lan4" "tx rx link_10 link_100 link_1000" + ucidef_set_led_netdev "wan-port-link" "WAN-PORT-LINK" "90000.mdio-1:04:green:wan" "wan" "link_10 link_100 link_1000" + ucidef_set_led_netdev "wan-port-traffic" "WAN-PORT-TRAFFIC" "90000.mdio-1:04:orange:wan" "wan" "tx rx link_10 link_100 link_1000" + ;; yuncore,fap650) ucidef_set_led_netdev "wlan5ghz" "WLAN 5GHz LED" "blue:wlan-5ghz" "wlan0" "tx rx" ucidef_set_led_netdev "wlan2ghz" "WLAN 2.4GHz LED" "green:wlan-2ghz" "wlan1" "tx rx" diff --git a/target/linux/qualcommax/ipq60xx/base-files/etc/board.d/02_network b/target/linux/qualcommax/ipq60xx/base-files/etc/board.d/02_network index 86ed04f34bbfc6..ecc9e57117b98f 100644 --- a/target/linux/qualcommax/ipq60xx/base-files/etc/board.d/02_network +++ b/target/linux/qualcommax/ipq60xx/base-files/etc/board.d/02_network @@ -23,6 +23,7 @@ ipq60xx_setup_interfaces() qihoo,360v6) ucidef_set_interfaces_lan_wan "lan1 lan2 lan3" "wan" ;; + linksys,mr7350|\ yuncore,fap650) ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4" "wan" ;; @@ -39,7 +40,12 @@ ipq60xx_setup_macs() local wan_mac="" local label_mac="" - case "$board" in + case $board in + linksys,mr7350) + label_mac=$(mtd_get_mac_ascii devinfo hw_mac_addr) + lan_mac=$label_mac + wan_mac=$label_mac + ;; qihoo,360v6) lan_mac=$(mtd_get_mac_ascii factory lanMac) wan_mac=$(macaddr_add "$lan_mac" 1) diff --git a/target/linux/qualcommax/ipq60xx/base-files/etc/hotplug.d/firmware/11-ath11-caldata b/target/linux/qualcommax/ipq60xx/base-files/etc/hotplug.d/firmware/11-ath11-caldata index e35413e1e039b1..a5e843ee7b5d02 100644 --- a/target/linux/qualcommax/ipq60xx/base-files/etc/hotplug.d/firmware/11-ath11-caldata +++ b/target/linux/qualcommax/ipq60xx/base-files/etc/hotplug.d/firmware/11-ath11-caldata @@ -15,6 +15,7 @@ case "$FIRMWARE" in cambiumnetworks,xe3-4) caldata_extract "0:ART" 0x1000 0x10000 ;; + linksys,mr7350|\ netgear,wax214) caldata_extract "0:art" 0x1000 0x10000 ;; diff --git a/target/linux/qualcommax/ipq60xx/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac b/target/linux/qualcommax/ipq60xx/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac new file mode 100644 index 00000000000000..a67cc7262b3cac --- /dev/null +++ b/target/linux/qualcommax/ipq60xx/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac @@ -0,0 +1,18 @@ +[ "$ACTION" == "add" ] || exit 0 + +PHYNBR=${DEVPATH##*/phy} + +[ -n $PHYNBR ] || exit 0 + +. /lib/functions.sh +. /lib/functions/system.sh + +board=$(board_name) + +case "$board" in + linksys,mr7350) + addr=$(mtd_get_mac_ascii devinfo hw_mac_addr) + [ "$PHYNBR" = "0" ] && macaddr_add $addr 2 > /sys${DEVPATH}/macaddress + [ "$PHYNBR" = "1" ] && macaddr_add $addr 1 > /sys${DEVPATH}/macaddress + ;; +esac diff --git a/target/linux/qualcommax/ipq60xx/base-files/etc/init.d/bootcount b/target/linux/qualcommax/ipq60xx/base-files/etc/init.d/bootcount old mode 100755 new mode 100644 index b34fbd82d7b3be..e8ff90122b2772 --- a/target/linux/qualcommax/ipq60xx/base-files/etc/init.d/bootcount +++ b/target/linux/qualcommax/ipq60xx/base-files/etc/init.d/bootcount @@ -4,6 +4,9 @@ START=99 boot() { case $(board_name) in + linksys,mr7350) + mtd resetbc s_env || true + ;; yuncore,fap650) fw_setenv owrt_bootcount 0 ;; diff --git a/target/linux/qualcommax/ipq60xx/base-files/lib/upgrade/platform.sh b/target/linux/qualcommax/ipq60xx/base-files/lib/upgrade/platform.sh index c545746b31ff79..411570715c20ff 100644 --- a/target/linux/qualcommax/ipq60xx/base-files/lib/upgrade/platform.sh +++ b/target/linux/qualcommax/ipq60xx/base-files/lib/upgrade/platform.sh @@ -37,6 +37,20 @@ platform_do_upgrade() { fw_setenv bootcount 0 nand_do_upgrade "$1" ;; + linksys,mr7350) + boot_part="$(fw_printenv -n boot_part)" + if [ "$boot_part" -eq "1" ]; then + fw_setenv boot_part 2 + CI_KERNPART="alt_kernel" + CI_UBIPART="alt_rootfs" + else + fw_setenv boot_part 1 + CI_UBIPART="rootfs" + fi + fw_setenv boot_part_ready 3 + fw_setenv auto_recovery yes + nand_do_upgrade "$1" + ;; netgear,wax214|\ qihoo,360v6) nand_do_upgrade "$1" From 1b6f7ec6794233fbf7c1cf17dcee34053c08fa9c Mon Sep 17 00:00:00 2001 From: Robert Marko Date: Sat, 7 Dec 2024 22:08:18 +0100 Subject: [PATCH 39/48] qualcommax: ipq807x: add Netgear DEVICE_VARS Add NETGEAR_BOARD_ID and NETGEAR_HW_ID to DEVICE_VARS as multiple devices set them in their recipes, so without them being added to DEVICE_VARS then simply the value from last recipe that gets evaluated is used and images are generated with the wrong ID-s. Link: https://github.com/openwrt/openwrt/pull/17203 Signed-off-by: Robert Marko --- target/linux/qualcommax/image/ipq807x.mk | 2 ++ 1 file changed, 2 insertions(+) diff --git a/target/linux/qualcommax/image/ipq807x.mk b/target/linux/qualcommax/image/ipq807x.mk index 34fe92ed54c138..ff6963405c61e9 100644 --- a/target/linux/qualcommax/image/ipq807x.mk +++ b/target/linux/qualcommax/image/ipq807x.mk @@ -1,3 +1,5 @@ +DEVICE_VARS += NETGEAR_BOARD_ID NETGEAR_HW_ID + define Build/asus-fake-ramdisk rm -rf $(KDIR)/tmp/fakerd dd if=/dev/zero bs=32 count=1 > $(KDIR)/tmp/fakerd From 22d2aa65e87130a597e9f9c970bfece4232dba72 Mon Sep 17 00:00:00 2001 From: Mieczyslaw Nalewaj Date: Sun, 1 Dec 2024 19:17:13 +0100 Subject: [PATCH 40/48] kernel: fallback-sprom: create separate header files Create a separate header files fallback-sprom.h for BCMA and SSB Fallback SPROM Driver to add function prototypes to fallback-sprom.c as well. This prevents missing function prototype errors. Signed-off-by: Mieczyslaw Nalewaj Link: https://github.com/openwrt/openwrt/pull/17138 Signed-off-by: Robert Marko --- .../files/drivers/bcma/fallback-sprom.c | 1 + .../files/drivers/bcma/fallback-sprom.h | 7 ++++ .../files/drivers/ssb/fallback-sprom.c | 1 + .../files/drivers/ssb/fallback-sprom.h | 7 ++++ .../810-bcma-ssb-fallback-sprom.patch | 41 ++++++++----------- 5 files changed, 34 insertions(+), 23 deletions(-) create mode 100644 target/linux/generic/files/drivers/bcma/fallback-sprom.h create mode 100644 target/linux/generic/files/drivers/ssb/fallback-sprom.h diff --git a/target/linux/generic/files/drivers/bcma/fallback-sprom.c b/target/linux/generic/files/drivers/bcma/fallback-sprom.c index db583fca9cc2a7..6932c3c8f574be 100644 --- a/target/linux/generic/files/drivers/bcma/fallback-sprom.c +++ b/target/linux/generic/files/drivers/bcma/fallback-sprom.c @@ -16,6 +16,7 @@ #include #include #include +#include "fallback-sprom.h" #define BCMA_FBS_MAX_SIZE 468 diff --git a/target/linux/generic/files/drivers/bcma/fallback-sprom.h b/target/linux/generic/files/drivers/bcma/fallback-sprom.h new file mode 100644 index 00000000000000..363663413dc445 --- /dev/null +++ b/target/linux/generic/files/drivers/bcma/fallback-sprom.h @@ -0,0 +1,7 @@ +#ifndef _FALLBACK_SPROM_H +#define _FALLBACK_SPROM_H + +int __init bcma_fbs_register(void); +int bcma_get_fallback_sprom(struct bcma_bus *dev, struct ssb_sprom *out); + +#endif /* _FALLBACK_SPROM_H */ diff --git a/target/linux/generic/files/drivers/ssb/fallback-sprom.c b/target/linux/generic/files/drivers/ssb/fallback-sprom.c index b8a4dcedcf4f1c..9c2511febe181a 100644 --- a/target/linux/generic/files/drivers/ssb/fallback-sprom.c +++ b/target/linux/generic/files/drivers/ssb/fallback-sprom.c @@ -16,6 +16,7 @@ #include #include #include +#include "fallback-sprom.h" #define SSB_FBS_MAX_SIZE 440 diff --git a/target/linux/generic/files/drivers/ssb/fallback-sprom.h b/target/linux/generic/files/drivers/ssb/fallback-sprom.h new file mode 100644 index 00000000000000..3966a18b86de63 --- /dev/null +++ b/target/linux/generic/files/drivers/ssb/fallback-sprom.h @@ -0,0 +1,7 @@ +#ifndef _FALLBACK_SPROM_H +#define _FALLBACK_SPROM_H + +int __init ssb_fbs_register(void); +int ssb_get_fallback_sprom(struct ssb_bus *dev, struct ssb_sprom *out); + +#endif /* _FALLBACK_SPROM_H */ diff --git a/target/linux/generic/hack-6.6/810-bcma-ssb-fallback-sprom.patch b/target/linux/generic/hack-6.6/810-bcma-ssb-fallback-sprom.patch index a011cf8ffa6d0e..08085d957aeb02 100644 --- a/target/linux/generic/hack-6.6/810-bcma-ssb-fallback-sprom.patch +++ b/target/linux/generic/hack-6.6/810-bcma-ssb-fallback-sprom.patch @@ -6,15 +6,15 @@ Subject: [PATCH] ssb_sprom: add generic kernel support for Broadcom Fallback SP --- drivers/bcma/Kconfig | 4 ++++ drivers/bcma/Makefile | 1 + - drivers/bcma/bcma_private.h | 4 ++++ + drivers/bcma/bcma_private.h | 1 + drivers/bcma/main.c | 8 ++++++++ drivers/bcma/sprom.c | 23 ++++++++++++++--------- drivers/ssb/Kconfig | 5 +++++ drivers/ssb/Makefile | 1 + drivers/ssb/main.c | 8 ++++++++ drivers/ssb/sprom.c | 12 +++++++++++- - drivers/ssb/ssb_private.h | 4 ++++ - 10 files changed, 60 insertions(+), 10 deletions(-) + drivers/ssb/ssb_private.h | 2 +- + 10 files changed, 54 insertions(+), 11 deletions(-) --- a/drivers/bcma/Kconfig +++ b/drivers/bcma/Kconfig @@ -41,17 +41,14 @@ Subject: [PATCH] ssb_sprom: add generic kernel support for Broadcom Fallback SP obj-$(CONFIG_BCMA) += bcma.o --- a/drivers/bcma/bcma_private.h +++ b/drivers/bcma/bcma_private.h -@@ -38,6 +38,10 @@ int bcma_bus_resume(struct bcma_bus *bus - void bcma_detect_chip(struct bcma_bus *bus); - int bcma_bus_scan(struct bcma_bus *bus); +@@ -8,6 +8,7 @@ -+/* fallback-sprom.c */ -+int __init bcma_fbs_register(void); -+int bcma_get_fallback_sprom(struct bcma_bus *dev, struct ssb_sprom *out); -+ - /* sprom.c */ - int bcma_sprom_get(struct bcma_bus *bus); + #include + #include ++#include "fallback-sprom.h" + #define bcma_err(bus, fmt, ...) \ + dev_err((bus)->dev, "bus%d: " fmt, (bus)->num, ##__VA_ARGS__) --- a/drivers/bcma/main.c +++ b/drivers/bcma/main.c @@ -671,6 +671,14 @@ static int __init bcma_modinit(void) @@ -174,14 +171,12 @@ Subject: [PATCH] ssb_sprom: add generic kernel support for Broadcom Fallback SP /* https://bcm-v4.sipsolutions.net/802.11/IsSpromAvailable */ --- a/drivers/ssb/ssb_private.h +++ b/drivers/ssb/ssb_private.h -@@ -143,6 +143,10 @@ extern int ssb_bus_scan(struct ssb_bus * - extern void ssb_iounmap(struct ssb_bus *ssb); - - -+/* fallback-sprom.c */ -+int __init ssb_fbs_register(void); -+int ssb_get_fallback_sprom(struct ssb_bus *dev, struct ssb_sprom *out); -+ - /* sprom.c */ - extern - ssize_t ssb_attr_sprom_show(struct ssb_bus *bus, char *buf, +@@ -8,7 +8,7 @@ + #include + #include + #include +- ++#include "fallback-sprom.h" + + /* pci.c */ + #ifdef CONFIG_SSB_PCIHOST From 0286dfe394cbad2a736160fec784b024ce4040bd Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Sun, 8 Dec 2024 13:36:41 +0100 Subject: [PATCH 41/48] wifi-scripts: fix regression with ucode update nl80211.request with GET_WIPHY for a single wiphy no longer returns an array Signed-off-by: Felix Fietkau --- .../usr/share/ucode/wifi/hostapd.uc | 32 ++++++++----------- 1 file changed, 14 insertions(+), 18 deletions(-) diff --git a/package/network/config/wifi-scripts/files-ucode/usr/share/ucode/wifi/hostapd.uc b/package/network/config/wifi-scripts/files-ucode/usr/share/ucode/wifi/hostapd.uc index 78b38ff63334fb..2f6c4ddc40e95d 100644 --- a/package/network/config/wifi-scripts/files-ucode/usr/share/ucode/wifi/hostapd.uc +++ b/package/network/config/wifi-scripts/files-ucode/usr/share/ucode/wifi/hostapd.uc @@ -438,29 +438,25 @@ function device_extended_features(data, flag) { function device_capabilities(phy) { let idx = +substr(phy, 3, 1);; - let phys = nl80211.request(nl80211.const.NL80211_CMD_GET_WIPHY, nl80211.const.NLM_F_DUMP, { wiphy: idx, split_wiphy_dump: true }); - - for (let phy in phys) { - if (!phy || phy.wiphy != idx) + phy = nl80211.request(nl80211.const.NL80211_CMD_GET_WIPHY, nl80211.const.NLM_F_DUMP, { wiphy: idx, split_wiphy_dump: true }); + if (!phy) + return; + for (let band in phy.wiphy_bands) { + if (!band) continue; - for (let band in phy.wiphy_bands) { - if (!band) + phy_capabilities.ht_capa = band.ht_capa ?? 0; + phy_capabilities.vht_capa = band.vht_capa ?? 0; + for (let iftype in band.iftype_data) { + if (!iftype.iftypes.ap) continue; - phy_capabilities.ht_capa = band.ht_capa ?? 0; - phy_capabilities.vht_capa = band.vht_capa ?? 0; - for (let iftype in band.iftype_data) { - if (!iftype.iftypes.ap) - continue; - phy_capabilities.he_mac_cap = iftype.he_cap_mac; - phy_capabilities.he_phy_cap = iftype.he_cap_phy; - } - break; + phy_capabilities.he_mac_cap = iftype.he_cap_mac; + phy_capabilities.he_phy_cap = iftype.he_cap_phy; } - - phy_features.ftm_responder = device_extended_features(phy.extended_features, NL80211_EXT_FEATURE_ENABLE_FTM_RESPONDER); - phy_features.radar_background = device_extended_features(phy.extended_features, NL80211_EXT_FEATURE_RADAR_BACKGROUND); break; } + + phy_features.ftm_responder = device_extended_features(phy.extended_features, NL80211_EXT_FEATURE_ENABLE_FTM_RESPONDER); + phy_features.radar_background = device_extended_features(phy.extended_features, NL80211_EXT_FEATURE_RADAR_BACKGROUND); } function generate(config) { From ed34e337a959919048e393f4b80d22aceffc3218 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Sun, 8 Dec 2024 13:55:33 +0100 Subject: [PATCH 42/48] wifi-scripts: fix ucode support for referencing wifi devices by phy name Rename phys according to board.json Signed-off-by: Felix Fietkau --- .../lib/netifd/wireless/mac80211.sh | 53 ++++++++++++++++++- .../share/schema/wireless.wifi-device.json | 4 ++ 2 files changed, 56 insertions(+), 1 deletion(-) diff --git a/package/network/config/wifi-scripts/files-ucode/lib/netifd/wireless/mac80211.sh b/package/network/config/wifi-scripts/files-ucode/lib/netifd/wireless/mac80211.sh index 8b55d01e7a8b51..cfd74240611fc0 100755 --- a/package/network/config/wifi-scripts/files-ucode/lib/netifd/wireless/mac80211.sh +++ b/package/network/config/wifi-scripts/files-ucode/lib/netifd/wireless/mac80211.sh @@ -8,6 +8,7 @@ import * as supplicant from 'wifi.supplicant'; import * as hostapd from 'wifi.hostapd'; import * as netifd from 'wifi.netifd'; import * as iface from 'wifi.iface'; +import * as nl80211 from 'nl80211'; import * as fs from 'fs'; global.radio = ARGV[2]; @@ -57,7 +58,7 @@ function phy_path_match(phy, path) { return substr(phy_path, -length(path)) == path; } -function find_phy_by_path(phys, path) { +function __find_phy_by_path(phys, path) { if (!path) return null; @@ -73,7 +74,57 @@ function find_phy_by_macaddr(phys, macaddr) { return filter(phys, (phy) => phy_file(phy, "macaddr") == macaddr)[0]; } +function rename_phy_by_name(phys, name) { + let data = json(fs.readfile("/etc/board.json")).wlan; + if (!data) + return; + + data = data[name]; + if (!data) + return; + + let prev_name = __find_phy_by_path(phys, data.path); + if (!prev_name) + return; + + let idx = phy_index(prev_name); + nl80211.request(nl80211.const.NL80211_CMD_SET_WIPHY, 0, { + wiphy: idx, + wiphy_name: name + }); + return true; +} + +function find_phy_by_path(phys, path) { + let name = __find_phy_by_path(phys, path); + if (!name) + return; + + let data = json(fs.readfile("/etc/board.json")).wlan; + if (!data || data[name]) + return name; + + for (let cur_name, cur_data in data) { + if (!phy_path_match(name, cur_data.path)) + continue; + + let idx = phy_index(name); + nl80211.request(nl80211.const.NL80211_CMD_SET_WIPHY, 0, { + wiphy: idx, + wiphy_name: cur_name + }); + + return cur_name; + } + + return name; +} + function find_phy_by_name(phys, name) { + if (index(phys, name) >= 0) + return name; + + rename_phy_by_name(phys, name); return index(phys, name) < 0 ? null : name; } diff --git a/package/network/config/wifi-scripts/files-ucode/usr/share/schema/wireless.wifi-device.json b/package/network/config/wifi-scripts/files-ucode/usr/share/schema/wireless.wifi-device.json index 0588401c99e639..65d33989fe636a 100644 --- a/package/network/config/wifi-scripts/files-ucode/usr/share/schema/wireless.wifi-device.json +++ b/package/network/config/wifi-scripts/files-ucode/usr/share/schema/wireless.wifi-device.json @@ -547,6 +547,10 @@ "description": "Alternative to phy used to identify the device based paths in /sys/devices", "type": "string" }, + "phy": { + "description": "Name of the phy, as described in board.json", + "type": "string" + }, "radio": { "description": "Index of the phy radio (for multi-radio PHYs)", "type": "number", From cf1909a024a7db28a43dd799dea09358d0ecee87 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Sun, 8 Dec 2024 15:10:51 +0100 Subject: [PATCH 43/48] wifi-scripts: fix channels array property parsing in ucode script Since the channels array can contain ranges, its type needs to be string, not number. Signed-off-by: Felix Fietkau --- .../files-ucode/usr/share/schema/wireless.wifi-device.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/network/config/wifi-scripts/files-ucode/usr/share/schema/wireless.wifi-device.json b/package/network/config/wifi-scripts/files-ucode/usr/share/schema/wireless.wifi-device.json index 65d33989fe636a..77b7adada891ea 100644 --- a/package/network/config/wifi-scripts/files-ucode/usr/share/schema/wireless.wifi-device.json +++ b/package/network/config/wifi-scripts/files-ucode/usr/share/schema/wireless.wifi-device.json @@ -115,7 +115,7 @@ "description": "Use specific channels, when channel is in “auto” mode. This option allows hostapd to select one of the provided channels when a channel should be automatically selected. Channels can be provided as range using hyphen ('-') or individual channels can be specified by space (' ') separated values", "type": "array", "items": { - "type": "number" + "type": "string" } }, "country": { From 0826b224b5210fc6f0681c9324dca974d507a8f7 Mon Sep 17 00:00:00 2001 From: Pavel Shirov Date: Sat, 7 Dec 2024 15:29:28 +0300 Subject: [PATCH 44/48] kernel: packages: fix building package/devel/perf with -O3 Add patch to fix failure to build package/devel/perf when CONFIG_TARGET_OPTIMIZATION has -O3 enabled with this error: ``` In function 'elf_close', inlined from 'elf_close' at elf.c:41:6, inlined from 'elf_find_func_offset_from_file' at elf.c:267:2: elf.c:45:9: error: 'elf_fd.elf' may be used uninitialized [-Werror=maybe-uninitialized] 45 | elf_end(elf_fd->elf); | ^~~~~~~~~~~~~~~~~~~~ elf.c: In function 'elf_find_func_offset_from_file': elf.c:260:23: note: 'elf_fd.elf' was declared here 260 | struct elf_fd elf_fd; | ^~~~~~ In function 'elf_close', inlined from 'elf_close' at elf.c:41:6, inlined from 'elf_find_func_offset_from_file' at elf.c:267:2: elf.c:46:9: error: 'elf_fd.fd' may be used uninitialized [-Werror=maybe-uninitialized] 46 | close(elf_fd->fd); | ^~~~~~~~~~~~~~~~~ elf.c: In function 'elf_find_func_offset_from_file': elf.c:260:23: note: 'elf_fd.fd' was declared here 260 | struct elf_fd elf_fd; | ^~~~~~ ``` Link: https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git/commit/?id=fab45b962749 Signed-off-by: Pavel Shirov Link: https://github.com/openwrt/openwrt/pull/17141 Signed-off-by: Hauke Mehrtens --- ...6.12-fix-libbpf-Wmaybe-uninitialized.patch | 59 +++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 target/linux/generic/backport-6.6/192-v6.12-fix-libbpf-Wmaybe-uninitialized.patch diff --git a/target/linux/generic/backport-6.6/192-v6.12-fix-libbpf-Wmaybe-uninitialized.patch b/target/linux/generic/backport-6.6/192-v6.12-fix-libbpf-Wmaybe-uninitialized.patch new file mode 100644 index 00000000000000..638fe4bc4ad5f7 --- /dev/null +++ b/target/linux/generic/backport-6.6/192-v6.12-fix-libbpf-Wmaybe-uninitialized.patch @@ -0,0 +1,59 @@ +From fab45b962749184e1a1a57c7c583782b78fad539 Mon Sep 17 00:00:00 2001 +From: Sam James +Date: Tue, 13 Aug 2024 20:49:06 +0100 +Subject: [PATCH] libbpf: Workaround -Wmaybe-uninitialized false positive +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +In `elf_close`, we get this with GCC 15 -O3 (at least): +``` +In function ‘elf_close’, + inlined from ‘elf_close’ at elf.c:53:6, + inlined from ‘elf_find_func_offset_from_file’ at elf.c:384:2: +elf.c:57:9: warning: ‘elf_fd.elf’ may be used uninitialized [-Wmaybe-uninitialized] + 57 | elf_end(elf_fd->elf); + | ^~~~~~~~~~~~~~~~~~~~ +elf.c: In function ‘elf_find_func_offset_from_file’: +elf.c:377:23: note: ‘elf_fd.elf’ was declared here + 377 | struct elf_fd elf_fd; + | ^~~~~~ +In function ‘elf_close’, + inlined from ‘elf_close’ at elf.c:53:6, + inlined from ‘elf_find_func_offset_from_file’ at elf.c:384:2: +elf.c:58:9: warning: ‘elf_fd.fd’ may be used uninitialized [-Wmaybe-uninitialized] + 58 | close(elf_fd->fd); + | ^~~~~~~~~~~~~~~~~ +elf.c: In function ‘elf_find_func_offset_from_file’: +elf.c:377:23: note: ‘elf_fd.fd’ was declared here + 377 | struct elf_fd elf_fd; + | ^~~~~~ +``` + +In reality, our use is fine, it's just that GCC doesn't model errno +here (see linked GCC bug). Suppress -Wmaybe-uninitialized accordingly +by initializing elf_fd.fd to -1 and elf_fd.elf to NULL. + +I've done this in two other functions as well given it could easily +occur there too (same access/use pattern). + +Signed-off-by: Sam James +Signed-off-by: Andrii Nakryiko +Link: https://gcc.gnu.org/PR114952 +Link: https://lore.kernel.org/bpf/14ec488a1cac02794c2fa2b83ae0cef1bce2cb36.1723578546.git.sam@gentoo.org +--- + tools/lib/bpf/elf.c | 3 +++ + 1 file changed, 3 insertions(+) + +--- a/tools/lib/bpf/elf.c ++++ b/tools/lib/bpf/elf.c +@@ -16,6 +16,9 @@ int elf_open(const char *binary_path, st + int fd, ret; + Elf *elf; + ++ elf_fd->elf = NULL; ++ elf_fd->fd = -1; ++ + if (elf_version(EV_CURRENT) == EV_NONE) { + pr_warn("elf: failed to init libelf for %s\n", binary_path); + return -LIBBPF_ERRNO__LIBELF; From e23b37b2d9a2e766b1ad151f59a04eb68b6a3341 Mon Sep 17 00:00:00 2001 From: Hannu Nyman Date: Thu, 5 Dec 2024 22:28:45 +0200 Subject: [PATCH 45/48] busybox: Save shell history into /tmp Enable the busybox feature to save shell command history. (.apk size increase 0.5 kB) To prevent flash wear, * save history only at the exit from a shell session, and * set /tmp as the default location for the history file. The history is kept on ramdisk until a reboot, when the history is then lost. If the user wants to save history onto flash, he can change the location definition in /etc/profile.d/busybox-history-file.sh Signed-off-by: Hannu Nyman Link: https://github.com/openwrt/openwrt/pull/17179 Signed-off-by: Hauke Mehrtens --- package/utils/busybox/Config-defaults.in | 4 ++-- package/utils/busybox/Makefile | 4 +++- package/utils/busybox/files/busybox-history-file.sh | 2 ++ 3 files changed, 7 insertions(+), 3 deletions(-) create mode 100644 package/utils/busybox/files/busybox-history-file.sh diff --git a/package/utils/busybox/Config-defaults.in b/package/utils/busybox/Config-defaults.in index 26d3e642ce7b89..820c498eeade56 100644 --- a/package/utils/busybox/Config-defaults.in +++ b/package/utils/busybox/Config-defaults.in @@ -255,10 +255,10 @@ config BUSYBOX_DEFAULT_FEATURE_EDITING_HISTORY default 256 config BUSYBOX_DEFAULT_FEATURE_EDITING_SAVEHISTORY bool - default n + default y config BUSYBOX_DEFAULT_FEATURE_EDITING_SAVE_ON_EXIT bool - default n + default y config BUSYBOX_DEFAULT_FEATURE_REVERSE_SEARCH bool default n diff --git a/package/utils/busybox/Makefile b/package/utils/busybox/Makefile index 4f155b7a2503b2..c2fc609610e80a 100644 --- a/package/utils/busybox/Makefile +++ b/package/utils/busybox/Makefile @@ -6,7 +6,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=busybox PKG_VERSION:=1.37.0 -PKG_RELEASE:=2 +PKG_RELEASE:=3 PKG_FLAGS:=essential PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 @@ -143,6 +143,8 @@ define Package/busybox/install $(INSTALL_DIR) $(1)/etc/init.d $(INSTALL_DIR) $(1)/usr/sbin $(CP) $(PKG_INSTALL_DIR)/* $(1)/ + $(INSTALL_DIR) $(1)/etc/profile.d + $(INSTALL_BIN) ./files/busybox-history-file.sh $(1)/etc/profile.d ifneq ($(CONFIG_BUSYBOX_$(BUSYBOX_SYM)_FEATURE_SYSLOG)$(CONFIG_BUSYBOX_$(BUSYBOX_SYM)_FEATURE_SYSLOGD_CFG),) touch $(1)/etc/syslog.conf endif diff --git a/package/utils/busybox/files/busybox-history-file.sh b/package/utils/busybox/files/busybox-history-file.sh new file mode 100644 index 00000000000000..f28600962721a6 --- /dev/null +++ b/package/utils/busybox/files/busybox-history-file.sh @@ -0,0 +1,2 @@ +export HISTFILE=/tmp/.busybox_ash_history + From d087a79b7b03fe93a221fd6246ce437c5c5325c3 Mon Sep 17 00:00:00 2001 From: Maxim Anisimov Date: Wed, 13 Nov 2024 17:17:17 +0300 Subject: [PATCH 46/48] mediatek/filogic: add Keenetic KN-3811 support Specification: * Mediatek MT7981BA * 256 MB SPI-NAND * 512 MB DDR4 RAM * MT7976CN DBDC AX Wi-Fi * MediaTek MT7531AE (3x LAN Gigabit ports) + Internal Gbe Phy (1x WAN Gigabit port) * 4x LED (power, internet, fn, wifi) * 3x buttons (wps, fn, reset) * 1x USB 3.0 port Serial Interface: * 3 Pins GND, RX, TX * Settings: 115200, 8N1 Notes: * The device supports dual boot mode * Fn led reassigned to wlan 2.4 Flash instruction: The only way to flash OpenWrt image is to use tftp recovery mode in U-Boot: 1. Configure PC with static IP 192.168.1.2/24 and tftp server. 2. Rename "openwrt-mediatek-filogic-keenetic_kn-3811-squashfs-factory.bin" to "KN-3811_recovery.bin" and place it in tftp server directory. 3. Connect PC with ethernet port, press the reset button, power up the device and keep button pressed until status led start blinking. 4. Device will download file from server, write it to flash and reboot. Signed-off-by: Maxim Anisimov Link: https://github.com/openwrt/openwrt/pull/17135 Signed-off-by: Hauke Mehrtens --- .../mediatek/dts/mt7981b-keenetic-kn-3811.dts | 368 ++++++++++++++++++ .../filogic/base-files/etc/board.d/02_network | 1 + .../etc/hotplug.d/ieee80211/11_fix_wifi_mac | 1 + target/linux/mediatek/image/filogic.mk | 20 + 4 files changed, 390 insertions(+) create mode 100644 target/linux/mediatek/dts/mt7981b-keenetic-kn-3811.dts diff --git a/target/linux/mediatek/dts/mt7981b-keenetic-kn-3811.dts b/target/linux/mediatek/dts/mt7981b-keenetic-kn-3811.dts new file mode 100644 index 00000000000000..87043ec907a46f --- /dev/null +++ b/target/linux/mediatek/dts/mt7981b-keenetic-kn-3811.dts @@ -0,0 +1,368 @@ +// SPDX-License-Identifier: GPL-2.0-only OR MIT + +/dts-v1/; + +#include "mt7981.dtsi" + +/ { + model = "Keenetic KN-3811"; + compatible = "keenetic,kn-3811", "mediatek,mt7981"; + + aliases { + label-mac-device = &gmac0; + led-boot = &power_led; + led-failsafe = &power_led; + led-running = &power_led; + led-upgrade = &power_led; + serial0 = &uart0; + }; + + chosen { + stdout-path = "serial0:115200n8"; + }; + + gpio-keys { + compatible = "gpio-keys"; + + button-fn { + label = "fn"; + linux,code = ; + gpios = <&pio 5 GPIO_ACTIVE_LOW>; + }; + + button-reset { + label = "reset"; + linux,code = ; + gpios = <&pio 24 GPIO_ACTIVE_LOW>; + }; + + button-wps { + label = "wps"; + linux,code = ; + gpios = <&pio 29 GPIO_ACTIVE_LOW>; + }; + }; + + gpio-leds { + compatible = "gpio-leds"; + + /* fn led reassigned to wlan 2.4 */ + led-0 { + color = ; + function = LED_FUNCTION_WLAN_2GHZ; + gpios = <&pio 9 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy0tpt"; + }; + + power_led: led-1 { + color = ; + function = LED_FUNCTION_POWER; + gpios = <&pio 11 GPIO_ACTIVE_HIGH>; + }; + + led-2 { + color = ; + function = LED_FUNCTION_WAN; + gpios = <&pio 12 GPIO_ACTIVE_LOW>; + }; + + led-3 { + color = ; + function = LED_FUNCTION_WLAN_5GHZ; + gpios = <&pio 34 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy1tpt"; + }; + }; + + usb_vbus: regulator-usb-vbus { + compatible = "regulator-fixed"; + regulator-name = "usb_vbus"; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + gpios = <&pio 6 GPIO_ACTIVE_HIGH>; + enable-active-high; + regulator-boot-on; + }; + + virtual_flash { + compatible = "mtd-concat"; + devices = <&firmware1 &storage1 &firmware2 &storage2>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "kernel"; + reg = <0x0 0x600000>; + }; + + partition@400000 { + label = "ubi"; + reg = <0x600000 0x0>; + }; + }; + }; +}; + +&uart0 { + status = "okay"; +}; + +&watchdog { + status = "okay"; +}; + +ð { + status = "okay"; + + gmac0: mac@0 { + compatible = "mediatek,eth-mac"; + reg = <0>; + phy-mode = "2500base-x"; + + nvmem-cell-names = "mac-address"; + nvmem-cells = <&macaddr_factory_4 0>; + + fixed-link { + speed = <2500>; + full-duplex; + pause; + }; + }; + + gmac1: mac@1 { + compatible = "mediatek,eth-mac"; + reg = <1>; + phy-mode = "gmii"; + phy-handle = <&int_gbe_phy>; + label = "wan"; + + nvmem-cell-names = "mac-address"; + nvmem-cells = <&macaddr_factory_a 0>; + }; +}; + +&mdio_bus { + switch: switch@1f { + compatible = "mediatek,mt7531"; + reg = <0x1f>; + reset-gpios = <&pio 22 GPIO_ACTIVE_HIGH>; + interrupt-controller; + #interrupt-cells = <1>; + interrupt-parent = <&pio>; + interrupts = <38 IRQ_TYPE_LEVEL_HIGH>; + }; +}; + +&switch { + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + label = "lan1"; + }; + + port@1 { + reg = <1>; + label = "lan2"; + }; + + port@2 { + reg = <2>; + label = "lan3"; + }; + + port@6 { + reg = <6>; + ethernet = <&gmac0>; + phy-mode = "2500base-x"; + + fixed-link { + speed = <2500>; + full-duplex; + pause; + }; + }; + }; +}; + +&pio { + spi0_flash_pins: spi0-pins { + mux { + function = "spi"; + groups = "spi0", "spi0_wp_hold"; + }; + + conf-pu { + pins = "SPI0_CS", "SPI0_HOLD", "SPI0_WP"; + drive-strength = ; + bias-pull-up = ; + }; + + conf-pd { + pins = "SPI0_CLK", "SPI0_MOSI", "SPI0_MISO"; + drive-strength = ; + bias-pull-down = ; + }; + }; +}; + +&spi0 { + pinctrl-names = "default"; + pinctrl-0 = <&spi0_flash_pins>; + status = "okay"; + + /* Winbond W25N02KV (256M) */ + spi_nand@0 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "spi-nand"; + reg = <0>; + + spi-max-frequency = <52000000>; + spi-tx-buswidth = <4>; + spi-rx-buswidth = <4>; + + spi-cal-enable; + spi-cal-mode = "read-data"; + spi-cal-datalen = <7>; + spi-cal-data = /bits/ 8 <0x53 0x50 0x49 0x4e 0x41 0x4e 0x44>; + spi-cal-addrlen = <5>; + spi-cal-addr = /bits/ 32 <0x0 0x0 0x0 0x0 0x0>; + + mediatek,nmbm; + mediatek,bmt-max-ratio = <1>; + mediatek,bmt-max-reserved-blocks = <64>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + /* bl2 */ + partition@0 { + label = "preloader"; + reg = <0x0 0x80000>; + read-only; + }; + + /* fip */ + partition@80000 { + label = "u-boot"; + reg = <0x80000 0x200000>; + read-only; + }; + + partition@280000 { + label = "u-config"; + reg = <0x280000 0x80000>; + read-only; + }; + + partition@300000 { + label = "rf-eeprom"; + reg = <0x300000 0x200000>; + read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x1000>; + }; + + /* lan mac */ + macaddr_factory_4: macaddr@4 { + compatible = "mac-base"; + reg = <0x4 0x6>; + #nvmem-cell-cells = <1>; + }; + + /* wan mac */ + macaddr_factory_a: macaddr@a { + compatible = "mac-base"; + reg = <0xa 0x6>; + #nvmem-cell-cells = <1>; + }; + }; + }; + + firmware1: partition@500000 { + label = "firmware_1"; + reg = <0x500000 0x3a00000>; + }; + + partition@3f00000 { + label = "config_1"; + reg = <0x3f00000 0x80000>; + read-only; + }; + + partition@3f80000 { + label = "dump"; + reg = <0x3f80000 0x80000>; + read-only; + }; + + storage1: partition@4000000 { + label = "storage_a"; + reg = <0x4000000 0x3800000>; + }; + + partition@7800000 { + label = "u-state"; + reg = <0x7800000 0x20000>; + read-only; + }; + + partition@7a80000 { + label = "u-config_res"; + reg = <0x7a80000 0x80000>; + read-only; + }; + + partition@7b00000 { + label = "rf-eeprom_res"; + reg = <0x7b00000 0x200000>; + read-only; + }; + + firmware2: partition@7d00000 { + label = "firmware_2"; + reg = <0x7d00000 0x3a00000>; + }; + + partition@b700000 { + label = "config_2"; + reg = <0xb700000 0x80000>; + read-only; + }; + + storage2: partition@b780000 { + label = "storage_b"; + reg = <0xb780000 0x3880000>; + }; + }; + }; +}; + +&wifi { + nvmem-cell-names = "eeprom"; + nvmem-cells = <&eeprom_factory_0>; + status = "okay"; +}; + +&usb_phy { + status = "okay"; +}; + +&xhci { + status = "okay"; + vbus-supply = <&usb_vbus>; +}; diff --git a/target/linux/mediatek/filogic/base-files/etc/board.d/02_network b/target/linux/mediatek/filogic/base-files/etc/board.d/02_network index ba785644022cdf..78483442d764f7 100644 --- a/target/linux/mediatek/filogic/base-files/etc/board.d/02_network +++ b/target/linux/mediatek/filogic/base-files/etc/board.d/02_network @@ -33,6 +33,7 @@ mediatek_setup_interfaces() confiabits,mt7981|\ cudy,wr3000-v1|\ jcg,q30-pro|\ + keenetic,kn-3811|\ qihoo,360t7|\ routerich,ax3000|\ routerich,ax3000-ubootmod) diff --git a/target/linux/mediatek/filogic/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac b/target/linux/mediatek/filogic/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac index a3b76712232936..fb67323e7b089c 100644 --- a/target/linux/mediatek/filogic/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac +++ b/target/linux/mediatek/filogic/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac @@ -115,6 +115,7 @@ case "$board" in jdcloud,re-cp-03) [ "$PHYNBR" = "1" ] && mmc_get_mac_binary factory 0xa > /sys${DEVPATH}/macaddress ;; + keenetic,kn-3811|\ keenetic,kn-3911) [ "$PHYNBR" = "1" ] && \ macaddr_setbit_la "$(mtd_get_mac_binary rf-eeprom 0x4)" > /sys${DEVPATH}/macaddress diff --git a/target/linux/mediatek/image/filogic.mk b/target/linux/mediatek/image/filogic.mk index 5498922f6edf6b..c1b38403a65180 100644 --- a/target/linux/mediatek/image/filogic.mk +++ b/target/linux/mediatek/image/filogic.mk @@ -887,6 +887,26 @@ define Device/jdcloud_re-cp-03 endef TARGET_DEVICES += jdcloud_re-cp-03 +define Device/keenetic_kn-3811 + DEVICE_VENDOR := Keenetic + DEVICE_MODEL := KN-3811 + DEVICE_DTS := mt7981b-keenetic-kn-3811 + DEVICE_DTS_DIR := ../dts + DEVICE_PACKAGES := kmod-mt7915e kmod-mt7981-firmware mt7981-wo-firmware kmod-usb3 + UBINIZE_OPTS := -E 5 + BLOCKSIZE := 128k + PAGESIZE := 2048 + KERNEL_SIZE := 6144k + IMAGE_SIZE := 233984k + KERNEL := kernel-bin | lzma | fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb | \ + append-squashfs4-fakeroot + IMAGES += factory.bin + IMAGE/factory.bin := append-kernel | pad-to $$(KERNEL_SIZE) | \ + append-ubi | check-size | zyimage -d 0x803811 -v "KN-3811" + IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata +endef +TARGET_DEVICES += keenetic_kn-3811 + define Device/keenetic_kn-3911 DEVICE_VENDOR := Keenetic DEVICE_MODEL := KN-3911 From 477c8a5101f0a6215201d66be25cf11e9803fe2b Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Sun, 16 Jun 2024 12:48:40 -0700 Subject: [PATCH 47/48] ath79: gl-e750: use nvmem for mac addresses This is a simple conversion to dts. 68ac3f2cddab states that the 5ghz wifi address is calculated from ART 0 + 2. Signed-off-by: Rosen Penev Link: https://github.com/openwrt/openwrt/pull/17066 Signed-off-by: Hauke Mehrtens --- target/linux/ath79/dts/qca9531_glinet_gl-e750.dts | 11 ++++++++++- .../etc/hotplug.d/ieee80211/10-fix-wifi-mac | 5 ----- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/target/linux/ath79/dts/qca9531_glinet_gl-e750.dts b/target/linux/ath79/dts/qca9531_glinet_gl-e750.dts index ba1291557039f6..e4b5f1ea6c31f3 100644 --- a/target/linux/ath79/dts/qca9531_glinet_gl-e750.dts +++ b/target/linux/ath79/dts/qca9531_glinet_gl-e750.dts @@ -45,6 +45,13 @@ &pcie0 { status = "okay"; + + wifi@0,0 { + compatible = "qcom,ath10k"; + reg = <0x0000 0 0 0 0>; + nvmem-cells = <&macaddr_art_0 2>; + nvmem-cell-names = "mac-address"; + }; }; &usb0 { @@ -90,7 +97,9 @@ #size-cells = <1>; macaddr_art_0: macaddr@0 { + compatible = "mac-base"; reg = <0x0 0x6>; + #nvmem-cell-cells = <1>; }; cal_art_1000: calibration@1000 { @@ -134,7 +143,7 @@ phy-handle = <&swphy4>; - nvmem-cells = <&macaddr_art_0>; + nvmem-cells = <&macaddr_art_0 0>; nvmem-cell-names = "mac-address"; }; diff --git a/target/linux/ath79/nand/base-files/etc/hotplug.d/ieee80211/10-fix-wifi-mac b/target/linux/ath79/nand/base-files/etc/hotplug.d/ieee80211/10-fix-wifi-mac index 5a933df501a7ab..989791b64fc64f 100644 --- a/target/linux/ath79/nand/base-files/etc/hotplug.d/ieee80211/10-fix-wifi-mac +++ b/target/linux/ath79/nand/base-files/etc/hotplug.d/ieee80211/10-fix-wifi-mac @@ -10,11 +10,6 @@ PHYNBR=${DEVPATH##*/phy} board=$(board_name) case $board in - glinet,gl-e750) - # Set mac address for 5g device - [ "$PHYNBR" -eq 0 ] && \ - macaddr_add $(mtd_get_mac_binary art 0x0) 2 > /sys${DEVPATH}/macaddress - ;; zyxel,emg2926-q10a|\ zyxel,nbg6716) ethaddr=$(mtd_get_mac_ascii u-boot-env ethaddr) From 3d8d81883fb2e607590bcb523587e37e1485b3b8 Mon Sep 17 00:00:00 2001 From: Eric Long Date: Mon, 25 Nov 2024 21:26:47 +0800 Subject: [PATCH 48/48] bpftool: turn off libbfd feature in host build libbfd feature is not used when building eBPF program, and it makes bpftool fail to build in a clean environment, since binutils in toolchain have libbfd disabled. Signed-off-by: Eric Long Link: https://github.com/openwrt/openwrt/pull/17073 Signed-off-by: Robert Marko --- package/network/utils/bpftool/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/network/utils/bpftool/Makefile b/package/network/utils/bpftool/Makefile index f2726d18969090..c6cc92e18d16c4 100644 --- a/package/network/utils/bpftool/Makefile +++ b/package/network/utils/bpftool/Makefile @@ -97,7 +97,7 @@ HOST_MAKE_FLAGS += \ $(if $(findstring c,$(OPENWRT_VERBOSE)),V=1,V='') \ check_feat=0 \ feature-clang-bpf-co-re=0 \ - feature-libbfd=1 \ + feature-libbfd=0 \ feature-llvm=0 \ feature-libcap=0 \ feature-disassembler-four-args=1 \