Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(re)add previously readonly ubiquiti airmax #3141

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

herbetom
Copy link
Contributor

@herbetom herbetom commented Jan 3, 2024

closes #2939

I've installed a firmware build from the branch on a Ubiquiti NanoBeam AC Gen1 (XC).

I'm able to store the /etc/dropbear/authorized_keys file accross reboots.

I haven't validated that the device was actually affected and haven't checked anything else.

dmesg
[    0.000000] Linux version 5.15.139 ([email protected]) (mips-openwrt-linux-musl-gcc (OpenWrt GCC 12.3.0 r23673+8-59fd8f08cf) 12.3.0, GNU ld (GNU Binutils) 2.40.0) #0 Sun Dec 17 17:25:55 2023
[    0.000000] printk: bootconsole [early0] enabled
[    0.000000] CPU0 revision is: 00019750 (MIPS 74Kc)
[    0.000000] MIPS: machine is Ubiquiti NanoBeam AC Gen1 (XC)
[    0.000000] SoC: Qualcomm Atheros QCA9558 ver 1 rev 0
[    0.000000] Initrd not found or empty - disabling initrd
[    0.000000] Primary instruction cache 64kB, VIPT, 4-way, linesize 32 bytes.
[    0.000000] Primary data cache 32kB, 4-way, VIPT, cache aliases, linesize 32 bytes
[    0.000000] Zone ranges:
[    0.000000]   Normal   [mem 0x0000000000000000-0x0000000007ffffff]
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x0000000000000000-0x0000000007ffffff]
[    0.000000] Initmem setup node 0 [mem 0x0000000000000000-0x0000000007ffffff]
[    0.000000] pcpu-alloc: s0 r0 d32768 u32768 alloc=1*32768
[    0.000000] pcpu-alloc: [0] 0 
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 32512
[    0.000000] Kernel command line: console=ttyS0,115200n8 rootfstype=squashfs,jffs2
[    0.000000] Dentry cache hash table entries: 16384 (order: 4, 65536 bytes, linear)
[    0.000000] Inode-cache hash table entries: 8192 (order: 3, 32768 bytes, linear)
[    0.000000] Writing ErrCtl register=00000000
[    0.000000] Readback ErrCtl register=00000000
[    0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
[    0.000000] Memory: 120956K/131072K available (5658K kernel code, 573K rwdata, 1264K rodata, 1200K init, 211K bss, 10116K reserved, 0K cma-reserved)
[    0.000000] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[    0.000000] NR_IRQS: 51
[    0.000000] CPU clock: 720.000 MHz
[    0.000000] clocksource: MIPS: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 5309056796 ns
[    0.000001] sched_clock: 32 bits at 360MHz, resolution 2ns, wraps every 5965232126ns
[    0.008378] Calibrating delay loop... 358.80 BogoMIPS (lpj=1794048)
[    0.075041] pid_max: default: 32768 minimum: 301
[    0.080753] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.088547] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.102371] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.112894] futex hash table entries: 256 (order: -1, 3072 bytes, linear)
[    0.120182] pinctrl core: initialized pinctrl subsystem
[    0.127540] NET: Registered PF_NETLINK/PF_ROUTE protocol family
[    0.134427] thermal_sys: Registered thermal governor 'step_wise'
[    0.150016] clocksource: Switched to clocksource MIPS
[    0.163154] NET: Registered PF_INET protocol family
[    0.168595] IP idents hash table entries: 2048 (order: 2, 16384 bytes, linear)
[    0.177203] tcp_listen_portaddr_hash hash table entries: 512 (order: 0, 4096 bytes, linear)
[    0.186185] Table-perturb hash table entries: 65536 (order: 6, 262144 bytes, linear)
[    0.194444] TCP established hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.202612] TCP bind hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.210140] TCP: Hash tables configured (established 1024 bind 1024)
[    0.217054] UDP hash table entries: 256 (order: 0, 4096 bytes, linear)
[    0.224080] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes, linear)
[    0.231823] NET: Registered PF_UNIX/PF_LOCAL protocol family
[    0.237890] PCI: CLS 0 bytes, default 32
[    0.245164] workingset: timestamp_bits=30 max_order=15 bucket_order=0
[    0.255829] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    0.262107] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
[    0.273957] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 252)
[    0.285059] pinctrl-single 1804002c.pinmux: 544 pins, size 68
[    0.292413] Serial: 8250/16550 driver, 16 ports, IRQ sharing enabled
[    0.301726] printk: console [ttyS0] disabled
[    0.306344] 18020000.uart: ttyS0 at MMIO 0x18020000 (irq = 9, base_baud = 2500000) is a 16550A
[    0.315589] printk: console [ttyS0] enabled
[    0.324494] printk: bootconsole [early0] disabled
[    0.350136] led_gpio@0 enforce active low on chipselect handle
[    0.368275] spi-nor spi0.0: mx25l12805d (16384 Kbytes)
[    0.373613] 5 fixed-partitions partitions found on MTD device spi0.0
[    0.380116] OF: Bad cell count for /ahb/spi@1f000000/flash@0/partitions
[    0.386865] OF: Bad cell count for /ahb/spi@1f000000/flash@0/partitions
[    0.393875] OF: Bad cell count for /ahb/spi@1f000000/flash@0/partitions
[    0.400650] OF: Bad cell count for /ahb/spi@1f000000/flash@0/partitions
[    0.407683] Creating 5 MTD partitions on "spi0.0":
[    0.412597] 0x000000000000-0x000000040000 : "u-boot"
[    0.420312] 0x000000040000-0x000000050000 : "u-boot-env"
[    0.426705] 0x000000050000-0x000000fb0000 : "firmware"
[    0.434541] 2 uimage-fw partitions found on MTD device firmware
[    0.440616] Creating 2 MTD partitions on "firmware":
[    0.445653] 0x000000000000-0x000000240000 : "kernel"
[    0.451690] 0x000000240000-0x000000f60000 : "rootfs"
[    0.458935] mtd: setting mtd4 (rootfs) as root device
[    0.464210] 1 squashfs-split partitions found on MTD device rootfs
[    0.470517] 0x0000006b0000-0x000000f60000 : "rootfs_data"
[    0.477716] 0x000000fb0000-0x000000ff0000 : "cfg"
[    0.483609] 0x000000ff0000-0x000001000000 : "art"
[    0.950811] ag71xx 19000000.eth: connected to PHY at mdio.0:04 [uid=004dd074, driver=Qualcomm Atheros AR8031/AR8033]
[    0.962182] eth0: Atheros AG71xx at 0xb9000000, irq 4, mode: sgmii
[    0.968866] i2c_dev: i2c /dev entries driver
[    0.979871] NET: Registered PF_INET6 protocol family
[    0.989632] Segment Routing with IPv6
[    0.993510] In-situ OAM (IOAM) with IPv6
[    0.997610] NET: Registered PF_PACKET protocol family
[    1.002821] bridge: filtering via arp/ip/ip6tables is no longer available by default. Update your scripts to load br_netfilter if you need this.
[    1.016256] 8021q: 802.1Q VLAN Support v1.8
[    1.021839] PCI host bridge to bus 0000:00
[    1.026015] pci_bus 0000:00: root bus resource [mem 0x10000000-0x11ffffff]
[    1.033046] pci_bus 0000:00: root bus resource [io  0x0000]
[    1.038699] pci_bus 0000:00: No busn resource found for root bus, will use [bus 00-ff]
[    1.046788] pci 0000:00:00.0: [0777:11ac] type 00 class 0x028000
[    1.052932] pci 0000:00:00.0: reg 0x10: [mem 0x00000000-0x001fffff 64bit]
[    1.059874] pci 0000:00:00.0: reg 0x30: [mem 0x00000000-0x0000ffff pref]
[    1.066759] pci 0000:00:00.0: supports D1 D2
[    1.072150] pci_bus 0000:00: busn_res: [bus 00-ff] end is updated to 00
[    1.078899] pci 0000:00:00.0: BAR 0: assigned [mem 0x10000000-0x101fffff 64bit]
[    1.086378] pci 0000:00:00.0: BAR 6: assigned [mem 0x10200000-0x1020ffff pref]
[    1.104577] VFS: Mounted root (squashfs filesystem) readonly on device 31:4.
[    1.118385] Freeing unused kernel image (initmem) memory: 1200K
[    1.124435] This architecture does not have kernel memory protection.
[    1.130984] Run /sbin/init as init process
[    1.135136]   with arguments:
[    1.135141]     /sbin/init
[    1.135146]   with environment:
[    1.135150]     HOME=/
[    1.135155]     TERM=linux
[    1.881448] init: Console is alive
[    1.885389] init: - watchdog -
[    3.663435] kmodloader: loading kernel modules from /etc/modules-boot.d/*
[    3.766527] usbcore: registered new interface driver usbfs
[    3.772278] usbcore: registered new interface driver hub
[    3.777756] usbcore: registered new device driver usb
[    3.798195] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    3.807094] fsl-ehci: Freescale EHCI Host controller driver
[    3.814547] ehci-platform: EHCI generic platform driver
[    3.823446] kmodloader: done loading kernel modules from /etc/modules-boot.d/*
[    3.841319] init: - preinit -
[    5.411477] random: jshn: uninitialized urandom read (4 bytes read)
[    5.900223] random: jshn: uninitialized urandom read (4 bytes read)
[    6.007088] random: jshn: uninitialized urandom read (4 bytes read)
[    8.654757] mount_root: jffs2 not ready yet, using temporary tmpfs overlay
[    8.672689] urandom-seed: Seed file not found (/etc/urandom.seed)
[    8.886127] procd: - early -
[    8.889374] procd: - watchdog -
[    9.528985] procd: - watchdog -
[    9.537374] procd: - ubus -
[    9.622458] random: ubusd: uninitialized urandom read (4 bytes read)
[    9.631284] random: ubusd: uninitialized urandom read (4 bytes read)
[    9.638303] random: ubusd: uninitialized urandom read (4 bytes read)
[    9.661649] procd: - init -
[   10.404123] kmodloader: loading kernel modules from /etc/modules.d/*
[   10.660999] tun: Universal TUN/TAP device driver, 1.6
[   10.677293] l2tp_core: L2TP core driver, V2.0
[   10.684361] l2tp_netlink: L2TP netlink interface
[   10.692154] l2tp_eth: L2TP ethernet pseudowire support (L2TPv3)
[   10.787383] GACT probability on
[   10.792830] Mirror/redirect action on
[   10.810774] u32 classifier
[   10.813547]     input device check on
[   10.817257]     Actions configured
[   10.858157] Loading modules backported from Linux version v6.1.24-0-g0102425ac76b
[   10.865811] Backport generated by backports.git v5.15.92-1-44-gd6ea70fafd36
[   11.131430] usbcore: registered new interface driver usbserial_generic
[   11.138134] usbserial: USB Serial support registered for generic
[   11.188809] xt_time: kernel timezone is -0000
[   11.544403] usbcore: registered new interface driver ch341
[   11.550142] usbserial: USB Serial support registered for ch341-uart
[   11.596175] usbcore: registered new interface driver cp210x
[   11.601966] usbserial: USB Serial support registered for cp210x
[   11.655971] usbcore: registered new interface driver ftdi_sio
[   11.661932] usbserial: USB Serial support registered for FTDI USB Serial Device
[   11.884010] usbcore: registered new interface driver pl2303
[   11.889744] usbserial: USB Serial support registered for pl2303
[   11.944555] ath10k_pci 0000:00:00.0: enabling device (0000 -> 0002)
[   11.951139] ath10k_pci 0000:00:00.0: pci irq legacy oper_irq_mode 1 irq_mode 0 reset_mode 0
[   13.169197] ath10k_pci 0000:00:00.0: qca988x hw2.0 ubiquiti target 0x4100016c chip_id 0x043222ff sub 0777:e4f5
[   13.179424] ath10k_pci 0000:00:00.0: kconfig debug 1 debugfs 1 tracing 0 dfs 1 testmode 0
[   13.192295] ath10k_pci 0000:00:00.0: firmware ver 10.2.4-1.0-00047 api 5 features no-p2p,raw-mode,mfp,allows-mesh-bcast crc32 35bd9258
[   14.094868] ath10k_pci 0000:00:00.0: board_file api 1 bmi_id N/A crc32 bebc7c08
[   15.320255] ath10k_pci 0000:00:00.0: htt-ver 2.1 wmi-op 5 htt-op 2 cal file max-sta 128 raw 0 hwcrypto 1
[   15.464186] ath: EEPROM regdomain: 0x0
[   15.464210] ath: EEPROM indicates default country code should be used
[   15.464215] ath: doing EEPROM country->regdmn map search
[   15.464230] ath: country maps to regdmn code: 0x3a
[   15.464237] ath: Country alpha2 being used: US
[   15.464244] ath: Regpair used: 0x3a
[   15.540237] batman_adv: B.A.T.M.A.N. advanced 2023.1-openwrt-4 (compatibility version 15) loaded
[   15.580601] kmodloader: done loading kernel modules from /etc/modules.d/*
[   16.846603] random: jshn: uninitialized urandom read (4 bytes read)
[   17.004463] random: jshn: uninitialized urandom read (4 bytes read)
[   17.112203] random: jshn: uninitialized urandom read (4 bytes read)
[   18.336193] random: dd: uninitialized urandom read (1 bytes read)
[   30.530170] ath: EEPROM regdomain: 0x8114
[   30.530198] ath: EEPROM indicates we should expect a country code
[   30.530205] ath: doing EEPROM country->regdmn map search
[   30.530211] ath: country maps to regdmn code: 0x37
[   30.530218] ath: Country alpha2 being used: DE
[   30.530225] ath: Regpair used: 0x37
[   30.530231] ath: regdomain 0x8114 dynamically updated by user
[   32.447184] urngd: v1.0.2 started.
[   34.954763] random: crng init done
[   34.958238] random: 115 urandom warning(s) missed due to ratelimiting
[   40.840656] br-setup: port 1(eth0) entered blocking state
[   40.846159] br-setup: port 1(eth0) entered disabled state
[   40.851957] device eth0 entered promiscuous mode
[   44.981483] eth0: link up (1000Mbps/Full duplex)
[   44.986225] br-setup: port 1(eth0) entered blocking state
[   44.991741] br-setup: port 1(eth0) entered forwarding state
[   45.040094] IPv6: ADDRCONF(NETDEV_CHANGE): br-setup: link becomes ready
[   76.462824] jffs2_scan_eraseblock(): End of filesystem marker found at 0x0
[   76.469852] jffs2_build_filesystem(): unlocking the mtd device... 
[   76.469877] done.
[   76.478139] jffs2_build_filesystem(): erasing all blocks after the end marker... 
[  117.833919] done.
[  117.843514] jffs2: notice: (1913) jffs2_build_xattr_subsystem: complete building xattr subsystem, 0 of xdatum (0 unchecked, 0 orphan) and 0 of xref (0 dead, 0 orphan) found.
[  118.198817] overlayfs: upper fs does not support tmpfile.

@github-actions github-actions bot added 3. topic: docs Topic: Documentation 3. topic: hardware Topic: Hardware Support labels Jan 3, 2024
@blocktrron
Copy link
Member

At the OpenWrt developer meetup, we've talked about this patch and while it doesn't matter for this backport, the patch should be replaced by a more selective patch based on DT-properties, as this approach might break future devices if upstream deprecates the unlock-all Kconfig symbol.

@herbetom
Copy link
Contributor Author

herbetom commented Jan 3, 2024

A quick test seems promising (see updated initial post). I'm not too keen to brick (and attempt to restore the device). What tests do we want to do before readding them? I'll take the device home and can to those then.

@herbetom herbetom marked this pull request as ready for review January 3, 2024 17:21
@herbetom
Copy link
Contributor Author

herbetom commented Jan 3, 2024

it appears as if those devices haven't been marked as outdoor devices. I will have to look into that.

ah, okay #3070 / d6dd629

@herbetom herbetom force-pushed the fix-readonly-ubiquiti-airmax branch from ebea824 to f18f517 Compare January 3, 2024 17:42
@github-actions github-actions bot added the 3. topic: package Topic: Gluon Packages label Jan 3, 2024
@blocktrron
Copy link
Member

@herbetom Please try with this patch and add the property to the node of the nor flash:

From 5c8bbd7b7f8881a6f22ebcef7ce57655ab8ec603 Mon Sep 17 00:00:00 2001
From: David Bauer <[email protected]>
Date: Thu, 4 Jan 2024 12:56:10 +0100
Subject: [PATCH] mtd: spi-nor: add property to unlock entire chip

Add a new device-tree porperty "swp-disable" which can be added to
spi-nor OF-nodes to indicate the whole flash-chip should be unlocked.

This avoids changing the default behavior of all SPI-NOR chips and helps
to indicate devices which require the old kernel behavior explicitly.

Signed-off-by: David Bauer <[email protected]>
---
 ...r-add-property-to-unlock-entire-chip.patch |  9 ++---
 ...r-add-property-to-unlock-entire-chip.patch | 35 +++++++++++++++++++
 2 files changed, 37 insertions(+), 7 deletions(-)
 create mode 100644 target/linux/generic/hack-6.1/400-mtd-spi-nor-add-property-to-unlock-entire-chip.patch

diff --git a/target/linux/generic/hack-5.15/400-mtd-spi-nor-add-property-to-unlock-entire-chip.patch b/target/linux/generic/hack-5.15/400-mtd-spi-nor-add-property-to-unlock-entire-chip.patch
index 9ea757ad8a..c8eb9122e6 100644
--- a/target/linux/generic/hack-5.15/400-mtd-spi-nor-add-property-to-unlock-entire-chip.patch
+++ b/target/linux/generic/hack-5.15/400-mtd-spi-nor-add-property-to-unlock-entire-chip.patch
@@ -14,11 +14,9 @@ Signed-off-by: David Bauer <[email protected]>
  drivers/mtd/spi-nor/core.c | 3 +++
  1 file changed, 3 insertions(+)
 
-diff --git a/drivers/mtd/spi-nor/core.c b/drivers/mtd/spi-nor/core.c
-index eb5d7b3d1860..9ec21461b058 100644
 --- a/drivers/mtd/spi-nor/core.c
 +++ b/drivers/mtd/spi-nor/core.c
-@@ -2799,6 +2799,7 @@ static int spi_nor_quad_enable(struct spi_nor *nor)
+@@ -2820,6 +2820,7 @@ static int spi_nor_quad_enable(struct sp
  
  static int spi_nor_init(struct spi_nor *nor)
  {
@@ -26,7 +24,7 @@ index eb5d7b3d1860..9ec21461b058 100644
  	int err;
  
  	err = spi_nor_octal_dtr_enable(nor, true);
-@@ -2824,6 +2825,8 @@ static int spi_nor_init(struct spi_nor *nor)
+@@ -2845,6 +2846,8 @@ static int spi_nor_init(struct spi_nor *
  	 * SNOR_F_SWP_IS_VOLATILE.
  	 */
  	if (IS_ENABLED(CONFIG_MTD_SPI_NOR_SWP_DISABLE) ||
@@ -35,6 +33,3 @@ index eb5d7b3d1860..9ec21461b058 100644
  	    (IS_ENABLED(CONFIG_MTD_SPI_NOR_SWP_DISABLE_ON_VOLATILE) &&
  	     nor->flags & SNOR_F_SWP_IS_VOLATILE))
  		spi_nor_try_unlock_all(nor);
--- 
-2.39.2
-
diff --git a/target/linux/generic/hack-6.1/400-mtd-spi-nor-add-property-to-unlock-entire-chip.patch b/target/linux/generic/hack-6.1/400-mtd-spi-nor-add-property-to-unlock-entire-chip.patch
new file mode 100644
index 0000000000..c8eb9122e6
--- /dev/null
+++ b/target/linux/generic/hack-6.1/400-mtd-spi-nor-add-property-to-unlock-entire-chip.patch
@@ -0,0 +1,35 @@
+From 228fcb0738a9e582a15666e717bb2fc5078c694c Mon Sep 17 00:00:00 2001
+From: David Bauer <[email protected]>
+Date: Thu, 4 Jan 2024 12:44:06 +0100
+Subject: [PATCH] mtd: spi-nor: add property to unlock entire chip
+
+Add a new device-tree porperty "swp-disable" which can be added to
+spi-nor OF-nodes to indicate the whole flash-chip should be unlocked.
+
+This avoids changing the default behavior of all SPI-NOR chips and helps
+to indicate devices which require the old kernel behavior explicitly.
+
+Signed-off-by: David Bauer <[email protected]>
+---
+ drivers/mtd/spi-nor/core.c | 3 +++
+ 1 file changed, 3 insertions(+)
+
+--- a/drivers/mtd/spi-nor/core.c
++++ b/drivers/mtd/spi-nor/core.c
+@@ -2820,6 +2820,7 @@ static int spi_nor_quad_enable(struct sp
+ 
+ static int spi_nor_init(struct spi_nor *nor)
+ {
++	struct of_node *np = spi_nor_get_flash_node(nor);
+ 	int err;
+ 
+ 	err = spi_nor_octal_dtr_enable(nor, true);
+@@ -2845,6 +2846,8 @@ static int spi_nor_init(struct spi_nor *
+ 	 * SNOR_F_SWP_IS_VOLATILE.
+ 	 */
+ 	if (IS_ENABLED(CONFIG_MTD_SPI_NOR_SWP_DISABLE) ||
++		of_property_read_bool(nor->dev->of_node,
++				      "swp-disable") ||
+ 	    (IS_ENABLED(CONFIG_MTD_SPI_NOR_SWP_DISABLE_ON_VOLATILE) &&
+ 	     nor->flags & SNOR_F_SWP_IS_VOLATILE))
+ 		spi_nor_try_unlock_all(nor);
-- 
2.39.2


@herbetom herbetom marked this pull request as draft January 4, 2024 14:39
@herbetom herbetom force-pushed the fix-readonly-ubiquiti-airmax branch from f18f517 to cb6a2ee Compare January 4, 2024 14:40
@blocktrron
Copy link
Member

Okay, My patch was not the best. Please apply the patches from my staging tree and see if this fixes the WP. Also remember to revert the kernel configuration update which enabled this behavior target-wide.

@herbetom herbetom force-pushed the fix-readonly-ubiquiti-airmax branch 2 times, most recently from 12afa0d to 2dbb134 Compare January 7, 2024 23:40
@herbetom
Copy link
Contributor Author

herbetom commented Jan 8, 2024

I've tried it and the device didn't came back up. Don't know what's gone wrong. A Power Cycle didn't change anything.
Will have to look into how recovery could work.

@blocktrron
Copy link
Member

Tried on a TL-WR842N v3 with and without the DT property. So the patch itself seems fine.

@herbetom herbetom force-pushed the fix-readonly-ubiquiti-airmax branch 2 times, most recently from 08717ce to c39b4ca Compare January 22, 2024 20:46
@herbetom
Copy link
Contributor Author

herbetom commented Feb 7, 2024

The current state seems to work regarding resolvig the read only problem.

Hoewer, in my tests with an Ubiquiti NanoBeam AC Gen1 (XC) i've had the problem that the device became unresponsive after some upgrades (Ethernet up, but no response).

The "solution" was to power it down for an extended period of time. (A few days, haven't attempted to narrow it down. Just unpluging it for a few seconds didn't seem to help.)

I'm not eaxtly sure what triggers it, but larger upgrades (upgrading from OpenWrt v2023.1.x) seems like something that should be tested a bit more.

@herbetom herbetom force-pushed the fix-readonly-ubiquiti-airmax branch from c39b4ca to 1d81c97 Compare February 7, 2024 12:33
@herbetom
Copy link
Contributor Author

herbetom commented Feb 7, 2024

I've rebased this onto #3184

@rotanid
Copy link
Member

rotanid commented Mar 26, 2024

@herbetom needs an update or rebase, doesn't it?

@rotanid
Copy link
Member

rotanid commented Jul 28, 2024

@herbetom if it is still relevant und you want to go on with this, can you please rebase and test your code again?

@herbetom herbetom force-pushed the fix-readonly-ubiquiti-airmax branch from 1d81c97 to ec0e2d9 Compare July 31, 2024 12:45
@rotanid
Copy link
Member

rotanid commented Nov 8, 2024

@herbetom i just noticed you rebased your code back then but didn't remove the DRAFT - maybe you want to think about this again?

@Djfe
Copy link
Contributor

Djfe commented Nov 27, 2024

I just verified this PR on a NanoStation XW on Sunday.
ec0e2d987df03faa86a59bb41b6ad369271e9d9c works fine on it's own. (due to the OpenWrt kernel config change)

Both commits together also work :) (as intended)
Now onto the final test (I just started the build):

# CONFIG_MTD_SPI_NOR_SWP_DISABLE_ON_VOLATILE is not set

In order to test whether the device would still be broken without this change (very likely).
This allows me to compare whether my tests for the previous commits were sufficient to proof, that this PR fixes the NanoStation xw support.

@herbetom
Copy link
Contributor Author

@rotanid Sorry for never responding! 🙈 My motivation to do anything related to ubiquiti is quite low atm. I think i've asked in #gluon at the point of rebasing something on how to procceed. But there wasn't any feedback and then i never got back to it ...


@Djfe I agree, at this point we should probably drop the attempt of the arguably better targeted unlocking. With it beeing unlocked on OpenWrt now for quite some time i wouldn't be too confident that other devices won't also rely on this and it would cause further disruption turning that back.

@Djfe
Copy link
Contributor

Djfe commented Nov 27, 2024

What are you agreeing with? ^^
That's your opinion, I like the approach of enabling this on a per device basis, especially since it doesn't rely on the legacy kconfig to stay available. => if the kconfig ever gets removed without us knowing about it we won't run into bricks by accident (like it could have happened with 23.05) because the driver side still handles unlocking the flash :)
Yes, there's some risk involved with bricking other devices if we introduce this into the next release, but there are still release candidates up ahead for people to test for this. The good thing about a dts entry is that it clearly shows us and other OS developers out there which devices are affected and which ones aren't.

Since Ubiquiti has a working tftp recovery we are less likely to run into a bricking typo like this one, that is hard/impossible to recover from:
openwrt/openwrt#13699
Sure there are other vendors out there that might have implemented a locked flash.

In the end this is up to the committer (possibly blocktrron) whether we want to merge this into the next release or not.
Hauke just announced the proposal to rebase the next release once (only leave apk out), so if we merge this in the next days it will likely end up in the next release without requiring a backport. https://lists.openwrt.org/pipermail/openwrt-devel/2024-November/043431.html

PS:
Thanks for the person at the FFRL MV on sunday that lended me their NanoStation XW for testing purposes.

@herbetom
Copy link
Contributor Author

ec0e2d987df03faa86a59bb41b6ad369271e9d9c works fine on it's own. (due to the OpenWrt kernel config change)

@Djfe
Copy link
Contributor

Djfe commented Nov 27, 2024

About your post in february:
ffac/peers-wg@438b214
When I received the device we couldn't get it into config mode and had to recover it. (could have a different cause but the person had tried to flash a "fixed" version beforehand, the one I built in Aachen worked just fine, I haven't looked at their site, yet)
I'm going to keep an eye on it whether the nanostation becomes unresponsive at some point and test it for a while.

@Djfe
Copy link
Contributor

Djfe commented Dec 10, 2024

I tested an image without the kconfig and it effectively resets the device into config mode:

Logread after sysupgrading to an image without the kconfig or the fix from this PR

The device reboots into config mode and resets all settings (or rather can't restore them during sysupgrade, I guess). I used sysupgrade without the argument -n
but the result looks like I would've done that (or run firstboot and then reboot)

Tue Feb 28 04:21:31 2023 kern.notice kernel: [    0.000000] Linux version 5.15.171 (ffac@ffac-build) (mips-openwrt-linux-musl-gcc (OpenWrt GCC 12.3.0 r24138+10-cd9998ef1b) 12.3.0, GNU ld (GNU Binutils) 2.40.0) #0 Tue Feb 28 03:21:07 2023
Tue Feb 28 04:21:31 2023 kern.info kernel: [    0.000000] printk: bootconsole [early0] enabled
Tue Feb 28 04:21:31 2023 kern.info kernel: [    0.000000] CPU0 revision is: 0001974c (MIPS 74Kc)
Tue Feb 28 04:21:31 2023 kern.info kernel: [    0.000000] MIPS: machine is Ubiquiti Nanostation M (XW)
Tue Feb 28 04:21:31 2023 kern.info kernel: [    0.000000] SoC: Atheros AR9342 rev 3
Tue Feb 28 04:21:31 2023 kern.info kernel: [    0.000000] Initrd not found or empty - disabling initrd
Tue Feb 28 04:21:31 2023 kern.info kernel: [    0.000000] Primary instruction cache 64kB, VIPT, 4-way, linesize 32 bytes.
Tue Feb 28 04:21:31 2023 kern.info kernel: [    0.000000] Primary data cache 32kB, 4-way, VIPT, cache aliases, linesize 32 bytes
Tue Feb 28 04:21:31 2023 kern.info kernel: [    0.000000] Zone ranges:
Tue Feb 28 04:21:31 2023 kern.info kernel: [    0.000000]   Normal   [mem 0x0000000000000000-0x0000000003ffffff]
Tue Feb 28 04:21:31 2023 kern.info kernel: [    0.000000] Movable zone start for each node
Tue Feb 28 04:21:31 2023 kern.info kernel: [    0.000000] Early memory node ranges
Tue Feb 28 04:21:31 2023 kern.info kernel: [    0.000000]   node   0: [mem 0x0000000000000000-0x0000000003ffffff]
Tue Feb 28 04:21:31 2023 kern.info kernel: [    0.000000] Initmem setup node 0 [mem 0x0000000000000000-0x0000000003ffffff]
Tue Feb 28 04:21:31 2023 kern.debug kernel: [    0.000000] pcpu-alloc: s0 r0 d32768 u32768 alloc=1*32768
Tue Feb 28 04:21:31 2023 kern.debug kernel: [    0.000000] pcpu-alloc: [0] 0
Tue Feb 28 04:21:31 2023 kern.info kernel: [    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 16256
Tue Feb 28 04:21:31 2023 kern.notice kernel: [    0.000000] Kernel command line: console=ttyS0,115200 rootfstype=squashfs,jffs2
Tue Feb 28 04:21:31 2023 kern.info kernel: [    0.000000] Dentry cache hash table entries: 8192 (order: 3, 32768 bytes, linear)
Tue Feb 28 04:21:31 2023 kern.info kernel: [    0.000000] Inode-cache hash table entries: 4096 (order: 2, 16384 bytes, linear)
Tue Feb 28 04:21:31 2023 kern.info kernel: [    0.000000] Writing ErrCtl register=00000000
Tue Feb 28 04:21:31 2023 kern.info kernel: [    0.000000] Readback ErrCtl register=00000000
Tue Feb 28 04:21:31 2023 kern.info kernel: [    0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
Tue Feb 28 04:21:31 2023 kern.info kernel: [    0.000000] Memory: 55980K/65536K available (5634K kernel code, 576K rwdata, 1264K rodata, 1220K init, 210K bss, 9556K reserved, 0K cma-reserved)
Tue Feb 28 04:21:31 2023 kern.info kernel: [    0.000000] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
Tue Feb 28 04:21:31 2023 kern.info kernel: [    0.000000] NR_IRQS: 51
Tue Feb 28 04:21:31 2023 kern.info kernel: [    0.000000] CPU clock: 535.000 MHz
Tue Feb 28 04:21:31 2023 kern.info kernel: [    0.000000] clocksource: MIPS: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7144898866 ns
Tue Feb 28 04:21:31 2023 kern.info kernel: [    0.000002] sched_clock: 32 bits at 267MHz, resolution 3ns, wraps every 8027976190ns
Tue Feb 28 04:21:31 2023 kern.info kernel: [    0.008436] Calibrating delay loop... 266.64 BogoMIPS (lpj=1333248)
Tue Feb 28 04:21:31 2023 kern.info kernel: [    0.095027] pid_max: default: 32768 minimum: 301
Tue Feb 28 04:21:31 2023 kern.info kernel: [    0.101027] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
Tue Feb 28 04:21:31 2023 kern.info kernel: [    0.108851] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
Tue Feb 28 04:21:31 2023 kern.info kernel: [    0.124322] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
Tue Feb 28 04:21:31 2023 kern.info kernel: [    0.134877] futex hash table entries: 256 (order: -1, 3072 bytes, linear)
Tue Feb 28 04:21:31 2023 kern.info kernel: [    0.142186] pinctrl core: initialized pinctrl subsystem
Tue Feb 28 04:21:31 2023 kern.info kernel: [    0.150163] NET: Registered PF_NETLINK/PF_ROUTE protocol family
Tue Feb 28 04:21:31 2023 kern.info kernel: [    0.157272] thermal_sys: Registered thermal governor 'step_wise'
Tue Feb 28 04:21:31 2023 kern.info kernel: [    0.177427] clocksource: Switched to clocksource MIPS
Tue Feb 28 04:21:31 2023 kern.info kernel: [    0.191066] NET: Registered PF_INET protocol family
Tue Feb 28 04:21:31 2023 kern.info kernel: [    0.196573] IP idents hash table entries: 2048 (order: 2, 16384 bytes, linear)
Tue Feb 28 04:21:31 2023 kern.info kernel: [    0.205486] tcp_listen_portaddr_hash hash table entries: 1024 (order: 0, 4096 bytes, linear)
Tue Feb 28 04:21:31 2023 kern.info kernel: [    0.214595] Table-perturb hash table entries: 65536 (order: 6, 262144 bytes, linear)
Tue Feb 28 04:21:31 2023 kern.info kernel: [    0.222864] TCP established hash table entries: 1024 (order: 0, 4096 bytes, linear)
Tue Feb 28 04:21:31 2023 kern.info kernel: [    0.231048] TCP bind hash table entries: 1024 (order: 0, 4096 bytes, linear)
Tue Feb 28 04:21:31 2023 kern.info kernel: [    0.238584] TCP: Hash tables configured (established 1024 bind 1024)
Tue Feb 28 04:21:31 2023 kern.info kernel: [    0.245580] UDP hash table entries: 256 (order: 0, 4096 bytes, linear)
Tue Feb 28 04:21:31 2023 kern.info kernel: [    0.252632] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes, linear)
Tue Feb 28 04:21:31 2023 kern.info kernel: [    0.260489] NET: Registered PF_UNIX/PF_LOCAL protocol family
Tue Feb 28 04:21:31 2023 kern.info kernel: [    0.266577] PCI: CLS 0 bytes, default 32
Tue Feb 28 04:21:31 2023 kern.info kernel: [    0.274883] workingset: timestamp_bits=30 max_order=14 bucket_order=0
Tue Feb 28 04:21:31 2023 kern.info kernel: [    0.287048] squashfs: version 4.0 (2009/01/31) Phillip Lougher
Tue Feb 28 04:21:31 2023 kern.info kernel: [    0.293356] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
Tue Feb 28 04:21:31 2023 kern.info kernel: [    0.305646] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 252)
Tue Feb 28 04:21:31 2023 kern.info kernel: [    0.317829] pinctrl-single 1804002c.pinmux: 544 pins, size 68
Tue Feb 28 04:21:31 2023 kern.info kernel: [    0.325302] Serial: 8250/16550 driver, 16 ports, IRQ sharing enabled
Tue Feb 28 04:21:31 2023 kern.info kernel: [    0.335540] printk: console [ttyS0] disabled
Tue Feb 28 04:21:31 2023 kern.info kernel: [    0.340259] 18020000.uart: ttyS0 at MMIO 0x18020000 (irq = 9, base_baud = 2500000) is a 16550A
Tue Feb 28 04:21:31 2023 kern.info kernel: [    0.349499] printk: console [ttyS0] enabled
Tue Feb 28 04:21:31 2023 kern.info kernel: [    0.358412] printk: bootconsole [early0] disabled
Tue Feb 28 04:21:31 2023 kern.info kernel: [    0.389834] spi-nor spi0.0: mx25l6405d (8192 Kbytes)
Tue Feb 28 04:21:31 2023 kern.notice kernel: [    0.395021] 5 fixed-partitions partitions found on MTD device spi0.0
Tue Feb 28 04:21:31 2023 kern.err kernel: [    0.401575] OF: Bad cell count for /ahb/spi@1f000000/flash@0/partitions
Tue Feb 28 04:21:31 2023 kern.err kernel: [    0.408369] OF: Bad cell count for /ahb/spi@1f000000/flash@0/partitions
Tue Feb 28 04:21:31 2023 kern.err kernel: [    0.415479] OF: Bad cell count for /ahb/spi@1f000000/flash@0/partitions
Tue Feb 28 04:21:31 2023 kern.err kernel: [    0.422297] OF: Bad cell count for /ahb/spi@1f000000/flash@0/partitions
Tue Feb 28 04:21:31 2023 kern.notice kernel: [    0.429487] Creating 5 MTD partitions on "spi0.0":
Tue Feb 28 04:21:31 2023 kern.notice kernel: [    0.434378] 0x000000000000-0x000000040000 : "u-boot"
Tue Feb 28 04:21:31 2023 kern.notice kernel: [    0.444948] 0x000000040000-0x000000050000 : "u-boot-env"
Tue Feb 28 04:21:31 2023 kern.notice kernel: [    0.451703] 0x000000050000-0x0000007b0000 : "firmware"
Tue Feb 28 04:21:31 2023 kern.notice kernel: [    0.460409] 2 uimage-fw partitions found on MTD device firmware
Tue Feb 28 04:21:31 2023 kern.notice kernel: [    0.466450] Creating 2 MTD partitions on "firmware":
Tue Feb 28 04:21:31 2023 kern.notice kernel: [    0.471547] 0x000000000000-0x000000240000 : "kernel"
Tue Feb 28 04:21:31 2023 kern.notice kernel: [    0.478024] 0x000000240000-0x000000760000 : "rootfs"
Tue Feb 28 04:21:31 2023 kern.info kernel: [    0.485870] mtd: setting mtd4 (rootfs) as root device
Tue Feb 28 04:21:31 2023 kern.notice kernel: [    0.491185] 1 squashfs-split partitions found on MTD device rootfs
Tue Feb 28 04:21:31 2023 kern.notice kernel: [    0.497524] 0x0000006c0000-0x000000760000 : "rootfs_data"
Tue Feb 28 04:21:31 2023 kern.notice kernel: [    0.505128] 0x0000007b0000-0x0000007f0000 : "cfg"
Tue Feb 28 04:21:31 2023 kern.notice kernel: [    0.511395] 0x0000007f0000-0x000000800000 : "art"
Tue Feb 28 04:21:31 2023 kern.info kernel: [    0.923648] switch0: Atheros AR8236 rev. 1 switch registered on mdio.0
Tue Feb 28 04:21:31 2023 kern.info kernel: [    0.980741] ag71xx 19000000.eth: connected to PHY at mdio.0:00 [uid=004dd043, driver=Atheros AR8216/AR8236/AR8316]
Tue Feb 28 04:21:31 2023 kern.info kernel: [    0.992191] eth0: Atheros AG71xx at 0xb9000000, irq 4, mode: mii
Tue Feb 28 04:21:31 2023 kern.info kernel: [    0.998903] i2c_dev: i2c /dev entries driver
Tue Feb 28 04:21:31 2023 kern.info kernel: [    1.006571] NET: Registered PF_INET6 protocol family
Tue Feb 28 04:21:31 2023 kern.info kernel: [    1.022327] Segment Routing with IPv6
Tue Feb 28 04:21:31 2023 kern.info kernel: [    1.026203] In-situ OAM (IOAM) with IPv6
Tue Feb 28 04:21:31 2023 kern.info kernel: [    1.030428] NET: Registered PF_PACKET protocol family
Tue Feb 28 04:21:31 2023 kern.info kernel: [    1.035635] bridge: filtering via arp/ip/ip6tables is no longer available by default. Update your scripts to load br_netfilter if you need this.
Tue Feb 28 04:21:31 2023 kern.info kernel: [    1.049204] 8021q: 802.1Q VLAN Support v1.8
Tue Feb 28 04:21:31 2023 kern.info kernel: [    1.055219] clk: Disabling unused clocks
Tue Feb 28 04:21:31 2023 kern.info kernel: [    1.070129] VFS: Mounted root (squashfs filesystem) readonly on device 31:4.
Tue Feb 28 04:21:31 2023 kern.info kernel: [    1.085296] Freeing unused kernel image (initmem) memory: 1220K
Tue Feb 28 04:21:31 2023 kern.warn kernel: [    1.091362] This architecture does not have kernel memory protection.
Tue Feb 28 04:21:31 2023 kern.info kernel: [    1.097921] Run /sbin/init as init process
Tue Feb 28 04:21:31 2023 kern.debug kernel: [    1.102077]   with arguments:
Tue Feb 28 04:21:31 2023 kern.debug kernel: [    1.102083]     /sbin/init
Tue Feb 28 04:21:31 2023 kern.debug kernel: [    1.102090]   with environment:
Tue Feb 28 04:21:31 2023 kern.debug kernel: [    1.102096]     HOME=/
Tue Feb 28 04:21:31 2023 kern.debug kernel: [    1.102102]     TERM=linux
Tue Feb 28 04:21:31 2023 user.info kernel: [    2.009325] init: Console is alive
Tue Feb 28 04:21:31 2023 user.info kernel: [    2.013413] init: - watchdog -
Tue Feb 28 04:21:31 2023 user.info kernel: [    3.704069] kmodloader: loading kernel modules from /etc/modules-boot.d/*
Tue Feb 28 04:21:31 2023 kern.info kernel: [    3.828601] usbcore: registered new interface driver usbfs
Tue Feb 28 04:21:31 2023 kern.info kernel: [    3.834266] usbcore: registered new interface driver hub
Tue Feb 28 04:21:31 2023 kern.info kernel: [    3.839893] usbcore: registered new device driver usb
Tue Feb 28 04:21:31 2023 kern.info kernel: [    3.865436] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
Tue Feb 28 04:21:31 2023 kern.info kernel: [    3.874970] fsl-ehci: Freescale EHCI Host controller driver
Tue Feb 28 04:21:31 2023 kern.info kernel: [    3.883789] ehci-platform: EHCI generic platform driver
Tue Feb 28 04:21:31 2023 user.info kernel: [    3.893888] kmodloader: done loading kernel modules from /etc/modules-boot.d/*
Tue Feb 28 04:21:31 2023 user.info kernel: [    3.903596] init: - preinit -
Tue Feb 28 04:21:31 2023 kern.notice kernel: [    5.711445] random: jshn: uninitialized urandom read (4 bytes read)
Tue Feb 28 04:21:31 2023 kern.notice kernel: [    6.210367] random: jshn: uninitialized urandom read (4 bytes read)
Tue Feb 28 04:21:31 2023 kern.notice kernel: [    6.449822] random: jshn: uninitialized urandom read (4 bytes read)
Tue Feb 28 04:21:31 2023 kern.notice kernel: [    6.731187] random: jshn: uninitialized urandom read (4 bytes read)
Tue Feb 28 04:21:31 2023 kern.notice kernel: [    6.822353] random: jshn: uninitialized urandom read (4 bytes read)
Tue Feb 28 04:21:31 2023 kern.notice kernel: [    7.040966] random: jshn: uninitialized urandom read (4 bytes read)
Tue Feb 28 04:21:31 2023 kern.info kernel: [    8.116661] Atheros AR8216/AR8236/AR8316 mdio.0:00: Port 1 is up
Tue Feb 28 04:21:31 2023 kern.info kernel: [    8.124725] eth0: link up (100Mbps/Full duplex)
Tue Feb 28 04:21:31 2023 kern.info kernel: [    8.129428] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
Tue Feb 28 04:21:31 2023 kern.info kernel: [    8.213248] IPv6: ADDRCONF(NETDEV_CHANGE): eth0.1: link becomes ready
Tue Feb 28 04:21:31 2023 kern.notice kernel: [    8.268352] random: procd: uninitialized urandom read (4 bytes read)
Tue Feb 28 04:21:31 2023 kern.warn kernel: [   10.624061] jffs2_scan_eraseblock(): End of filesystem marker found at 0x10000
Tue Feb 28 04:21:31 2023 kern.warn kernel: [   10.631452] jffs2_build_filesystem(): unlocking the mtd device...
Tue Feb 28 04:21:31 2023 kern.warn kernel: [   10.631496] done.
Tue Feb 28 04:21:31 2023 kern.warn kernel: [   10.639737] jffs2_build_filesystem(): erasing all blocks after the end marker...
Tue Feb 28 04:21:31 2023 kern.warn kernel: [   10.642136] jffs2: Newly-erased block contained word 0x19852003 at offset 0x00090000
Tue Feb 28 04:21:31 2023 kern.warn kernel: [   10.660004] jffs2: Newly-erased block contained word 0x19852003 at offset 0x00080000
Tue Feb 28 04:21:31 2023 kern.warn kernel: [   10.670293] jffs2: Newly-erased block contained word 0x19852003 at offset 0x00070000
Tue Feb 28 04:21:31 2023 kern.warn kernel: [   10.680567] jffs2: Newly-erased block contained word 0x19852003 at offset 0x00060000
Tue Feb 28 04:21:31 2023 kern.warn kernel: [   10.690863] jffs2: Newly-erased block contained word 0x19852003 at offset 0x00050000
Tue Feb 28 04:21:31 2023 kern.warn kernel: [   10.701139] jffs2: Newly-erased block contained word 0x19852003 at offset 0x00040000
Tue Feb 28 04:21:31 2023 kern.warn kernel: [   10.711406] jffs2: Newly-erased block contained word 0x19852003 at offset 0x00030000
Tue Feb 28 04:21:31 2023 kern.warn kernel: [   10.721676] jffs2: Newly-erased block contained word 0x19852003 at offset 0x00020000
Tue Feb 28 04:21:31 2023 kern.warn kernel: [   10.731947] jffs2: Newly-erased block contained word 0xdeadc0de at offset 0x00010000
Tue Feb 28 04:21:31 2023 kern.warn kernel: [   10.739839] done.
Tue Feb 28 04:21:31 2023 kern.notice kernel: [   10.741808] jffs2: notice: (402) jffs2_build_xattr_subsystem: complete building xattr subsystem, 0 of xdatum (0 unchecked, 0 orphan) and 0 of xref (0 dead, 0 orphan) found.
Tue Feb 28 04:21:31 2023 user.err kernel: [   10.758867] mount_root: unable to set filesystem state
Tue Feb 28 04:21:31 2023 user.info kernel: [   10.764582] mount_root: switching to jffs2 overlay
Tue Feb 28 04:21:31 2023 user.err kernel: [   10.775111] mount_root: switching to jffs2 failed - fallback to ramoverlay
Tue Feb 28 04:21:31 2023 user.warn kernel: [   10.787597] urandom-seed: Seed file not found (/etc/urandom.seed)
Tue Feb 28 04:21:31 2023 kern.info kernel: [   10.988864] eth0: link down
Tue Feb 28 04:21:31 2023 user.info kernel: [   11.023335] procd: - early -
Tue Feb 28 04:21:31 2023 user.info kernel: [   11.026670] procd: - watchdog -
Tue Feb 28 04:21:31 2023 user.info kernel: [   11.711823] procd: - watchdog -
Tue Feb 28 04:21:31 2023 user.info kernel: [   11.719904] procd: - ubus -
Tue Feb 28 04:21:31 2023 kern.notice kernel: [   11.813195] random: ubusd: uninitialized urandom read (4 bytes read)
Tue Feb 28 04:21:31 2023 kern.notice kernel: [   11.822920] random: ubusd: uninitialized urandom read (4 bytes read)
Tue Feb 28 04:21:31 2023 kern.notice kernel: [   11.830242] random: ubusd: uninitialized urandom read (4 bytes read)
Tue Feb 28 04:21:31 2023 user.info kernel: [   11.846537] procd: - init -
Tue Feb 28 04:21:31 2023 user.info kernel: [   12.564793] kmodloader: loading kernel modules from /etc/modules.d/*
Tue Feb 28 04:21:31 2023 kern.info kernel: [   13.006942] GACT probability on
Tue Feb 28 04:21:31 2023 kern.info kernel: [   13.013040] Mirror/redirect action on
Tue Feb 28 04:21:31 2023 kern.info kernel: [   13.034958] u32 classifier
Tue Feb 28 04:21:31 2023 kern.info kernel: [   13.037816]     input device check on
Tue Feb 28 04:21:31 2023 kern.info kernel: [   13.041530]     Actions configured
Tue Feb 28 04:21:31 2023 kern.info kernel: [   13.099352] Loading modules backported from Linux version v6.1.110-0-g5f55cad62cc9d
Tue Feb 28 04:21:31 2023 kern.info kernel: [   13.107154] Backport generated by backports.git v6.1.110-1-0-g965f73fc
Tue Feb 28 04:21:31 2023 kern.info kernel: [   13.455228] xt_time: kernel timezone is -0000
Tue Feb 28 04:21:31 2023 kern.info kernel: [   13.853904] wireguard: WireGuard 1.0.0 loaded. See www.wireguard.com for information.
Tue Feb 28 04:21:31 2023 kern.info kernel: [   13.861926] wireguard: Copyright (C) 2015-2019 Jason A. Donenfeld <[email protected]>. All Rights Reserved.
Tue Feb 28 04:21:31 2023 kern.info kernel: [   13.936216] batman_adv: B.A.T.M.A.N. advanced 2023.1-openwrt-8 (compatibility version 15) loaded
Tue Feb 28 04:21:31 2023 kern.debug kernel: [   13.974086] ath: EEPROM regdomain: 0x0
Tue Feb 28 04:21:31 2023 kern.debug kernel: [   13.974121] ath: EEPROM indicates default country code should be used
Tue Feb 28 04:21:31 2023 kern.debug kernel: [   13.974129] ath: doing EEPROM country->regdmn map search
Tue Feb 28 04:21:31 2023 kern.debug kernel: [   13.974149] ath: country maps to regdmn code: 0x3a
Tue Feb 28 04:21:31 2023 kern.debug kernel: [   13.974160] ath: Country alpha2 being used: US
Tue Feb 28 04:21:31 2023 kern.debug kernel: [   13.974169] ath: Regpair used: 0x3a
Tue Feb 28 04:21:31 2023 kern.debug kernel: [   13.989614] ieee80211 phy0: Selected rate control algorithm 'minstrel_ht'
Tue Feb 28 04:21:31 2023 kern.info kernel: [   13.992758] ieee80211 phy0: Atheros AR9340 Rev:3 mem=0x(ptrval), irq=12
Tue Feb 28 04:21:31 2023 user.info kernel: [   14.028157] kmodloader: done loading kernel modules from /etc/modules.d/*
Tue Feb 28 04:21:31 2023 kern.notice kernel: [   33.667449] random: crng init done
Tue Feb 28 04:21:31 2023 kern.notice kernel: [   33.670932] random: 71 urandom warning(s) missed due to ratelimiting
Tue Feb 28 04:21:33 2023 kern.debug kernel: [   38.917594] ath: EEPROM regdomain: 0x8114
Tue Feb 28 04:21:33 2023 kern.debug kernel: [   38.917631] ath: EEPROM indicates we should expect a country code
Tue Feb 28 04:21:33 2023 kern.debug kernel: [   38.917642] ath: doing EEPROM country->regdmn map search
Tue Feb 28 04:21:33 2023 kern.debug kernel: [   38.917650] ath: country maps to regdmn code: 0x37
Tue Feb 28 04:21:33 2023 kern.debug kernel: [   38.917660] ath: Country alpha2 being used: DE
Tue Feb 28 04:21:33 2023 kern.debug kernel: [   38.917669] ath: Regpair used: 0x37
Tue Feb 28 04:21:33 2023 kern.debug kernel: [   38.917677] ath: regdomain 0x8114 dynamically updated by user
Tue Feb 28 04:21:34 2023 user.notice : Added device handler type: bonding
Tue Feb 28 04:21:34 2023 user.notice : Added device handler type: 8021ad
Tue Feb 28 04:21:34 2023 user.notice : Added device handler type: 8021q
Tue Feb 28 04:21:34 2023 user.notice : Added device handler type: macvlan
Tue Feb 28 04:21:34 2023 user.notice : Added device handler type: veth
Tue Feb 28 04:21:34 2023 user.notice : Added device handler type: bridge
Tue Feb 28 04:21:34 2023 user.notice : Added device handler type: Network device
Tue Feb 28 04:21:34 2023 user.notice : Added device handler type: tunnel
Tue Feb 28 04:21:35 2023 user.info kernel: [   40.941926] urngd: v1.0.2 started.
Tue Feb 28 04:21:48 2023 kern.info kernel: [   53.535000] eth0: link up (100Mbps/Full duplex)
Tue Feb 28 04:21:48 2023 kern.info kernel: [   53.542968] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
Tue Feb 28 04:21:48 2023 kern.info kernel: [   53.565238] br-setup: port 1(eth0.1) entered blocking state
Tue Feb 28 04:21:48 2023 kern.info kernel: [   53.571014] br-setup: port 1(eth0.1) entered disabled state
Tue Feb 28 04:21:48 2023 kern.info kernel: [   53.577024] device eth0.1 entered promiscuous mode
Tue Feb 28 04:21:48 2023 kern.info kernel: [   53.581978] device eth0 entered promiscuous mode
Tue Feb 28 04:21:48 2023 kern.info kernel: [   53.643334] br-setup: port 1(eth0.1) entered blocking state
Tue Feb 28 04:21:48 2023 kern.info kernel: [   53.649086] br-setup: port 1(eth0.1) entered forwarding state
Tue Feb 28 04:21:48 2023 daemon.notice netifd: Interface 'setup' is enabled
Tue Feb 28 04:21:48 2023 daemon.notice netifd: Interface 'setup' is setting up now
Tue Feb 28 04:21:48 2023 daemon.notice netifd: Interface 'setup' is now up
Tue Feb 28 04:21:48 2023 daemon.notice netifd: bridge 'br-setup' link is up
Tue Feb 28 04:21:48 2023 daemon.notice netifd: Interface 'setup' has link connectivity
Tue Feb 28 04:21:48 2023 daemon.notice netifd: Interface 'loopback' is enabled
Tue Feb 28 04:21:48 2023 daemon.notice netifd: Interface 'loopback' is setting up now
Tue Feb 28 04:21:48 2023 daemon.notice netifd: Interface 'loopback' is now up
Tue Feb 28 04:21:48 2023 daemon.notice netifd: bridge 'br-setup' link is down
Tue Feb 28 04:21:48 2023 daemon.notice netifd: Interface 'setup' has link connectivity loss
Tue Feb 28 04:21:48 2023 daemon.notice netifd: Network device 'eth0' link is up
Tue Feb 28 04:21:48 2023 daemon.notice netifd: VLAN 'eth0.1' link is up
Tue Feb 28 04:21:48 2023 daemon.notice netifd: bridge 'br-setup' link is up
Tue Feb 28 04:21:48 2023 daemon.notice netifd: Interface 'setup' has link connectivity
Tue Feb 28 04:21:48 2023 daemon.notice netifd: Network device 'lo' link is up
Tue Feb 28 04:21:48 2023 daemon.notice netifd: Interface 'loopback' has link connectivity
Tue Feb 28 04:21:49 2023 kern.info kernel: [   54.587981] IPv6: ADDRCONF(NETDEV_CHANGE): br-setup: link becomes ready
Tue Feb 28 04:22:17 2023 authpriv.info dropbear[1489]: Not backgrounding
Tue Feb 28 04:22:19 2023 user.notice led-trigger: LED trigger rssi is handled by /etc/init.d/rssileds
Tue Feb 28 04:22:19 2023 user.notice led-trigger: LED trigger rssi is handled by /etc/init.d/rssileds
Tue Feb 28 04:22:19 2023 user.notice led-trigger: LED trigger rssi is handled by /etc/init.d/rssileds
Tue Feb 28 04:22:20 2023 user.notice led-trigger: LED trigger rssi is handled by /etc/init.d/rssileds
Tue Feb 28 04:22:20 2023 daemon.info dnsmasq[1545]: started, version 2.90 DNS disabled
Tue Feb 28 04:22:20 2023 daemon.info dnsmasq[1545]: compile time options: IPv6 GNU-getopt no-DBus UBus no-i18n no-IDN DHCP no-DHCPv6 no-Lua TFTP no-conntrack no-ipset no-nftset no-auth cryptohash DNSSEC loop-detect inotify dumpfile
Tue Feb 28 04:22:20 2023 daemon.info dnsmasq-dhcp[1545]: DHCP, IP range 192.168.1.2 -- 192.168.1.254, lease time 1h
Tue Feb 28 04:22:20 2023 daemon.info procd: - init complete -
Tue Feb 28 04:25:14 2023 kern.info kernel: [  259.468010] Atheros AR8216/AR8236/AR8316 mdio.0:00: Port 1 is down
Tue Feb 28 04:25:16 2023 kern.info kernel: [  261.547725] Atheros AR8216/AR8236/AR8316 mdio.0:00: Port 1 is up
Tue Feb 28 04:26:51 2023 kern.info kernel: [  356.188007] Atheros AR8216/AR8236/AR8316 mdio.0:00: Port 1 is down
Tue Feb 28 04:27:00 2023 kern.info kernel: [  365.548321] Atheros AR8216/AR8236/AR8316 mdio.0:00: Port 5 is up
Tue Feb 28 04:27:21 2023 daemon.info dnsmasq-dhcp[1545]: DHCPDISCOVER(br-setup) 10.14.3.161 d4:be:d9:1f:48:ac
Tue Feb 28 04:27:21 2023 daemon.info dnsmasq-dhcp[1545]: DHCPOFFER(br-setup) 192.168.1.47 d4:be:d9:1f:48:ac
Tue Feb 28 04:27:21 2023 daemon.info dnsmasq-dhcp[1545]: DHCPDISCOVER(br-setup) 10.14.3.161 d4:be:d9:1f:48:ac
Tue Feb 28 04:27:21 2023 daemon.info dnsmasq-dhcp[1545]: DHCPOFFER(br-setup) 192.168.1.47 d4:be:d9:1f:48:ac
Tue Feb 28 04:27:21 2023 daemon.info dnsmasq-dhcp[1545]: DHCPREQUEST(br-setup) 192.168.1.47 d4:be:d9:1f:48:ac
Tue Feb 28 04:27:21 2023 daemon.info dnsmasq-dhcp[1545]: DHCPACK(br-setup) 192.168.1.47 d4:be:d9:1f:48:ac dell
Tue Feb 28 04:27:37 2023 authpriv.info dropbear[1625]: Child connection from 192.168.1.47:50220
Tue Feb 28 04:27:38 2023 authpriv.info dropbear[1625]: Exit before auth from <192.168.1.47:50220>: Exited normally
Tue Feb 28 04:27:49 2023 authpriv.info dropbear[1626]: Child connection from 192.168.1.47:44054
Tue Feb 28 04:27:49 2023 authpriv.notice dropbear[1626]: Auth succeeded with blank password for 'root' from 192.168.1.47:44054

There is one good thing though:
While saving in config mode will just reboot you into config mode again.
Sysupgrading in config mode works just fine even without the kconfig change.

Conclusion:
I approve of this commit and suggest merging it into main and backporting it into 23.05
The fix is required to not brick current installations and we want to readd support for the Ubiquiti devices after all :)
The risk is minimal, since sysupgrade was never broken and the devices have a working tftp recovery. also: everyone can access these devices via wan over ssh without any key if this were to happen again (due to a reset config). (so even if there were issues noone would have to climb any roofs or so. unless the device is just accessible via a wifi mesh)

TL;DR
There is no reason to not merge this :)

A fix has been found for the read-only filesystems after upgrades on Ubiquiti airmax devices.

This reverts commit a0f5b4e.
This reverts commit d6dd629 partially.
@herbetom herbetom force-pushed the fix-readonly-ubiquiti-airmax branch from ec0e2d9 to 49089c2 Compare December 11, 2024 18:17
@herbetom herbetom marked this pull request as ready for review December 11, 2024 18:18
@herbetom herbetom changed the title Fix readonly ubiquiti airmax (re)add previously readonly ubiquiti airmax Dec 11, 2024
@Djfe
Copy link
Contributor

Djfe commented Dec 11, 2024

okay good to know building openwrt 24.10 fails. on ath79-generic.
I'll check why later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3. topic: docs Topic: Documentation 3. topic: hardware Topic: Hardware Support 3. topic: package Topic: Gluon Packages
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Read-Only filesystem on Ubiquiti airmax devices
4 participants