Good Afternoon folks. I have been having a hard time trying to get openwrt running on a ubiquiti nanostation M5. I remember doing similar work a number of years ago, and most things went smoothly, but it seems they have really been making it more difficult recently.
Anyway, after some help from the ubnt forums I was able to get openwrt version installed on the nanostation M5 (XM chip version). Now the problem is that I am not able to persist settings across reboots. I have tried installing the 'factory' and 'sysupgrade' versions of the firmware listed here: https://openwrt.org/toh/ubiquiti/nanostationm5. In both cases I arrive back to the 'please set a root password' stage after any reboot. My searching for a solution has found two possible relevant articles. First there is a mention of having to do something in SSH before loading the 'second' sysupgrade image. (http://lede-ac58u.zyxmon.org/HowToFlashENG.html) However, these instructions are not dated and it seems they may no longer apply - my device does not seem to have the suggested binaries (ubirmvol, ubinfo) for example. The second scarier possibility had to do with some type of hardware bug, which it seems was fixed in DD-WRT but not openwrt? (https://dev.archive.openwrt.org/ticket/20982) The comments stop a couple years ago seemingly without any resolution? I think that this latter issue is the one, because the DMESG output I get is filled with lines like "jffs2: Newly-erased block contained word 0x19852003 at offset 0x003b0000".
Hopefully someone with more experience can help to shed some light on what the problem could be.
Relevant debug info:
Mount:
/dev/root on /rom type squashfs (ro,relatime)
proc on /proc type proc (rw,nosuid,nodev,noexec,noatime)
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,noatime)
tmpfs on /tmp type tmpfs (rw,nosuid,nodev,noatime)
tmpfs on /tmp/root type tmpfs (rw,noatime,mode=755)
overlayfs:/tmp/root on / type overlay (rw,noatime,lowerdir=/,upperdir=/tmp/root/upper,workdir=/tmp/root/work)
tmpfs on /dev type tmpfs (rw,nosuid,relatime,size=512k,mode=755)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,mode=600,ptmxmode=000)
debugfs on /sys/kernel/debug type debugfs (rw,noatime)
/dev/mtdblock5 on /rom/overlay type jffs2 (rw,noatime)
df -h:
Filesystem Size Used Available Use% Mounted on
/dev/root 2.5M 2.5M 0 100% /rom
tmpfs 13.6M 400.0K 13.2M 3% /tmp
tmpfs 13.6M 56.0K 13.5M 0% /tmp/root
overlayfs:/tmp/root 13.6M 56.0K 13.5M 0% /
tmpfs 512.0K 0 512.0K 0% /dev
/dev/mtdblock5 3.8M 3.8M 0 100% /rom/overlay
full DMESG:
[ 0.000000] Linux version 4.9.120 (buildbot@builds-03.infra.lede-project.org) (gcc version 7.3.0 (OpenWrt GCC 7.3.0 r7102-3f3a2c9) ) #0 Thu Aug 16 07:51:15 2018
[ 0.000000] MyLoader: sysp=dd027720, boardp=ff30ff90, parts=f00ff00f
[ 0.000000] bootconsole [early0] enabled
[ 0.000000] CPU0 revision is: 00019374 (MIPS 24Kc)
[ 0.000000] SoC: Atheros AR7240 rev 2
[ 0.000000] Determined physical RAM map:
[ 0.000000] memory: 02000000 @ 00000000 (usable)
[ 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-0x0000000001ffffff]
[ 0.000000] Movable zone start for each node
[ 0.000000] Early memory node ranges
[ 0.000000] node 0: [mem 0x0000000000000000-0x0000000001ffffff]
[ 0.000000] Initmem setup node 0 [mem 0x0000000000000000-0x0000000001ffffff]
[ 0.000000] On node 0 totalpages: 8192
[ 0.000000] free_area_init_node: node 0, pgdat 80442044, node_mem_map 81000020
[ 0.000000] Normal zone: 64 pages used for memmap
[ 0.000000] Normal zone: 0 pages reserved
[ 0.000000] Normal zone: 8192 pages, LIFO batch:0
[ 0.000000] pcpu-alloc: s0 r0 d32768 u32768 alloc=1*32768
[ 0.000000] pcpu-alloc: [0] 0
[ 0.000000] Built 1 zonelists in Zone order, mobility grouping on. Total pages: 8128
[ 0.000000] Kernel command line: board=UBNT-NM mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,7552k(firmware),256k(cfg)ro,64k(EEPROM)ro console=ttyS0,115200 rootfstype=squashfs noinitrd
[ 0.000000] PID hash table entries: 128 (order: -3, 512 bytes)
[ 0.000000] Dentry cache hash table entries: 4096 (order: 2, 16384 bytes)
[ 0.000000] Inode-cache hash table entries: 2048 (order: 1, 8192 bytes)
[ 0.000000] Writing ErrCtl register=00000000
[ 0.000000] Readback ErrCtl register=00000000
[ 0.000000] Memory: 27532K/32768K available (3363K kernel code, 172K rwdata, 444K rodata, 300K init, 219K bss, 5236K 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] Clocks: CPU:390.000MHz, DDR:390.000MHz, AHB:195.000MHz, Ref:40.000MHz
[ 0.000000] clocksource: MIPS: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 9801335621 ns
[ 0.000013] sched_clock: 32 bits at 195MHz, resolution 5ns, wraps every 11012737021ns
[ 0.007903] Calibrating delay loop... 259.27 BogoMIPS (lpj=1296384)
[ 0.080549] pid_max: default: 32768 minimum: 301
[ 0.085321] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.091918] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.103054] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[ 0.112887] futex hash table entries: 256 (order: -1, 3072 bytes)
[ 0.120758] NET: Registered protocol family 16
[ 0.127437] MIPS: machine is Ubiquiti Nanostation M
[ 0.134409] registering PCI controller with io_map_base unset
[ 0.620745] Can't analyze schedule() prologue at 803a5594
[ 0.641316] PCI host bridge to bus 0000:00
[ 0.645420] pci_bus 0000:00: root bus resource [mem 0x10000000-0x13ffffff]
[ 0.652306] pci_bus 0000:00: root bus resource [io 0x0000]
[ 0.657847] pci_bus 0000:00: root bus resource [??? 0x00000000 flags 0x0]
[ 0.664605] pci_bus 0000:00: No busn resource found for root bus, will use [bus 00-ff]
[ 0.672526] pci 0000:00:00.0: [168c:ff1c] type 00 class 0x020000
[ 0.672540] pci 0000:00:00.0: fixup device configuration
[ 0.679092] pci 0000:00:00.0: reg 0x10: [mem 0x00000000-0x0000ffff 64bit]
[ 0.679241] pci 0000:00:00.0: supports D1
[ 0.679256] pci 0000:00:00.0: PME# supported from D0 D1 D3hot
[ 0.679567] pci_bus 0000:00: busn_res: [bus 00-ff] end is updated to 00
[ 0.679606] pci 0000:00:00.0: BAR 0: assigned [mem 0x10000000-0x1000ffff 64bit]
[ 0.686899] pci 0000:00:00.0: using irq 40 for pin 1
[ 0.696499] clocksource: Switched to clocksource MIPS
[ 0.703137] NET: Registered protocol family 2
[ 0.708893] TCP established hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.715848] TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.722258] TCP: Hash tables configured (established 1024 bind 1024)
[ 0.728757] UDP hash table entries: 256 (order: 0, 4096 bytes)
[ 0.734597] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[ 0.741226] NET: Registered protocol family 1
[ 0.745618] PCI: CLS 0 bytes, default 32
[ 0.749835] Crashlog allocated RAM at address 0x1f00000
[ 0.756628] workingset: timestamp_bits=30 max_order=13 bucket_order=0
[ 0.774196] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[ 0.780047] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
[ 0.803261] io scheduler noop registered
[ 0.807232] io scheduler deadline registered (default)
[ 0.812935] Serial: 8250/16550 driver, 16 ports, IRQ sharing enabled
[ 0.823325] console [ttyS0] disabled
[ 0.846987] serial8250.0: ttyS0 at MMIO 0x18020000 (irq = 11, base_baud = 12187500) is a 16550A
[ 0.855651] console [ttyS0] enabled
[ 0.862655] bootconsole [early0] disabled
[ 0.879247] m25p80 spi0.0: found m25p64, expected m25p80
[ 0.884609] m25p80 spi0.0: m25p64 (8192 Kbytes)
[ 0.889263] 5 cmdlinepart partitions found on MTD device spi0.0
[ 0.895195] Creating 5 MTD partitions on "spi0.0":
[ 0.900043] 0x000000000000-0x000000040000 : "u-boot"
[ 0.908389] 0x000000040000-0x000000050000 : "u-boot-env"
[ 0.916622] 0x000000050000-0x0000007b0000 : "firmware"
[ 0.934280] 2 uimage-fw partitions found on MTD device firmware
[ 0.940297] 0x000000050000-0x0000001a0000 : "kernel"
[ 0.947349] 0x0000001a0000-0x0000007b0000 : "rootfs"
[ 0.954726] mtd: device 4 (rootfs) set to be root filesystem
[ 0.960530] 1 squashfs-split partitions found on MTD device rootfs
[ 0.966756] 0x0000003f0000-0x0000007b0000 : "rootfs_data"
[ 0.975183] 0x0000007b0000-0x0000007f0000 : "cfg"
[ 0.982852] 0x0000007f0000-0x000000800000 : "EEPROM"
[ 0.992202] libphy: Fixed MDIO Bus: probed
[ 1.019124] libphy: ag71xx_mdio: probed
[ 1.650232] ag71xx ag71xx.0: connected to PHY at ag71xx-mdio.0:04 [uid=004dd041, driver=Generic PHY]
[ 1.660428] eth0: Atheros AG71xx at 0xb9000000, irq 4, mode:MII
[ 2.300024] ag71xx-mdio.0: Found an AR7240/AR9330 built-in switch
[ 2.350093] eth1: Atheros AG71xx at 0xba000000, irq 5, mode:GMII
[ 2.358701] NET: Registered protocol family 10
[ 2.368840] NET: Registered protocol family 17
[ 2.373374] bridge: filtering via arp/ip/ip6tables is no longer available by default. Update your scripts to load br_netfilter if you need this.
[ 2.386589] 8021q: 802.1Q VLAN Support v1.8
[ 2.393361] hctosys: unable to open rtc device (rtc0)
[ 2.404716] VFS: Mounted root (squashfs filesystem) readonly on device 31:4.
[ 2.414342] Freeing unused kernel memory: 300K
[ 2.418848] This architecture does not have kernel memory protection.
[ 2.486519] random: fast init done
[ 3.355754] init: Console is alive
[ 3.359571] init: - watchdog -
[ 4.692650] kmodloader: loading kernel modules from /etc/modules-boot.d/*
[ 4.785770] usbcore: registered new interface driver usbfs
[ 4.791501] usbcore: registered new interface driver hub
[ 4.797008] usbcore: registered new device driver usb
[ 4.809142] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[ 4.817883] ehci-platform: EHCI generic platform driver
[ 4.826707] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
[ 4.834588] ohci-platform: OHCI generic platform driver
[ 4.840888] kmodloader: done loading kernel modules from /etc/modules-boot.d/*
[ 4.858765] init: - preinit -
[ 5.915253] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
[ 5.950506] random: procd: uninitialized urandom read (4 bytes read)
[ 8.028126] eth0: link up (100Mbps/Full duplex)
[ 8.035179] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
[ 9.133058] mount_root: jffs2 not ready yet, using temporary tmpfs overlay
[ 9.174773] urandom-seed: Seed file not found (/etc/urandom.seed)
[ 9.445558] eth0: link down
[ 9.464524] procd: - early -
[ 9.467723] procd: - watchdog -
[ 10.152697] procd: - watchdog -
[ 10.156224] procd: - ubus -
[ 10.298625] random: ubusd: uninitialized urandom read (4 bytes read)
[ 10.375719] random: ubusd: uninitialized urandom read (4 bytes read)
[ 10.382780] random: ubusd: uninitialized urandom read (4 bytes read)
[ 10.390548] procd: - init -
[ 10.867900] kmodloader: loading kernel modules from /etc/modules.d/*
[ 10.880615] ip6_tables: (C) 2000-2006 Netfilter Core Team
[ 10.900776] Loading modules backported from Linux version wt-2017-11-01-0-gfe248fc2c180
[ 10.908887] Backport generated by backports.git v4.14-rc2-1-31-g86cf0e5d
[ 10.919781] ip_tables: (C) 2000-2006 Netfilter Core Team
[ 10.937346] nf_conntrack version 0.5.0 (1024 buckets, 4096 max)
[ 11.019495] xt_time: kernel timezone is -0000
[ 11.098982] PPP generic driver version 2.4.2
[ 11.106742] NET: Registered protocol family 24
[ 11.160148] PCI: Enabling device 0000:00:00.0 (0000 -> 0002)
[ 11.171085] ath: phy0: Ignoring endianness difference in EEPROM magic bytes.
[ 11.179741] ath: EEPROM regdomain: 0x0
[ 11.179749] ath: EEPROM indicates default country code should be used
[ 11.179754] ath: doing EEPROM country->regdmn map search
[ 11.179774] ath: country maps to regdmn code: 0x3a
[ 11.179782] ath: Country alpha2 being used: US
[ 11.179787] ath: Regpair used: 0x3a
[ 11.197195] ieee80211 phy0: Selected rate control algorithm 'minstrel_ht'
[ 11.203667] ieee80211 phy0: Atheros AR9280 Rev:2 mem=0xb0000000, irq=40
[ 11.374529] kmodloader: done loading kernel modules from /etc/modules.d/*
[ 12.782534] urandom_read: 5 callbacks suppressed
[ 12.782545] random: jshn: uninitialized urandom read (4 bytes read)
[ 31.008762] jffs2_scan_eraseblock(): End of filesystem marker found at 0x0
[ 31.015692] jffs2_build_filesystem(): unlocking the mtd device...
[ 31.076536] done.
[ 31.078495] jffs2_build_filesystem(): erasing all blocks after the end marker...
[ 31.098329] jffs2: Newly-erased block contained word 0x19852003 at offset 0x003b0000
[ 31.148440] jffs2: Newly-erased block contained word 0x19852003 at offset 0x003a0000
[ 31.181079] jffs2: Newly-erased block contained word 0x19852003 at offset 0x00390000
[ 31.218311] jffs2: Newly-erased block contained word 0x19852003 at offset 0x00380000
[ 31.248264] jffs2: Newly-erased block contained word 0x0 at offset 0x00370000
[ 31.268328] jffs2: Newly-erased block contained word 0xdeadc0de at offset 0x00360000
[ 31.308313] jffs2: Newly-erased block contained word 0x0 at offset 0x00350000
[ 31.338411] jffs2: Newly-erased block contained word 0xdeadc0de at offset 0x00340000
[ 31.368372] jffs2: Newly-erased block contained word 0xdeadc0de at offset 0x00330000
[ 31.398358] jffs2: Newly-erased block contained word 0x36022256 at offset 0x00320000
[ 31.428421] jffs2: Newly-erased block contained word 0xc3166a7c at offset 0x00310000
[ 31.451098] jffs2: Newly-erased block contained word 0x96e3d04e at offset 0x00300000
[ 31.488377] jffs2: Newly-erased block contained word 0xe8658243 at offset 0x002f0000
[ 31.518363] jffs2: Newly-erased block contained word 0xbab10521 at offset 0x002e0000
[ 31.538008] jffs2: Newly-erased block contained word 0x930b86d at offset 0x002d0000
[ 31.574884] jffs2: Newly-erased block contained word 0xca6b0330 at offset 0x002c0000
[ 31.601964] br-lan: port 1(eth0) entered blocking state
[ 31.607302] br-lan: port 1(eth0) entered disabled state
[ 31.613069] device eth0 entered promiscuous mode
[ 31.622047] jffs2: Newly-erased block contained word 0xc0d70ee at offset 0x002b0000
[ 31.652183] jffs2: Newly-erased block contained word 0xedc1df2e at offset 0x002a0000
[ 31.676811] IPv6: ADDRCONF(NETDEV_UP): br-lan: link is not ready
[ 31.690752] jffs2: Newly-erased block contained word 0xacfce56b at offset 0x00290000
[ 31.719401] eth0: link up (1000Mbps/Full duplex)
[ 31.724110] br-lan: port 1(eth0) entered blocking state
[ 31.729412] br-lan: port 1(eth0) entered forwarding state
[ 31.783813] jffs2: Newly-erased block contained word 0x7c54d41f at offset 0x00280000
[ 31.841604] jffs2: Newly-erased block contained word 0xa6be5ae3 at offset 0x00270000
[ 31.860680] IPv6: ADDRCONF(NETDEV_UP): eth1: link is not ready
[ 31.866888] IPv6: ADDRCONF(NETDEV_CHANGE): br-lan: link becomes ready
[ 31.901688] jffs2: Newly-erased block contained word 0x553b90b5 at offset 0x00260000
[ 32.060096] jffs2: Newly-erased block contained word 0x452176e5 at offset 0x00250000
[ 32.095884] jffs2: Newly-erased block contained word 0x3e84602f at offset 0x00240000
[ 32.124616] jffs2: Newly-erased block contained word 0x6b50fbef at offset 0x00230000
[ 32.148394] jffs2: Newly-erased block contained word 0x5049684f at offset 0x00220000
[ 32.168244] jffs2: Newly-erased block contained word 0x3740ffe4 at offset 0x00210000
[ 32.188257] jffs2: Newly-erased block contained word 0xe0498149 at offset 0x00200000
[ 32.208256] jffs2: Newly-erased block contained word 0x518153ae at offset 0x001f0000
[ 32.228227] jffs2: Newly-erased block contained word 0x675f92bf at offset 0x001e0000
[ 32.248241] jffs2: Newly-erased block contained word 0x1c101cd2 at offset 0x001d0000
[ 32.268259] jffs2: Newly-erased block contained word 0x63a17200 at offset 0x001c0000
[ 32.278514] jffs2: Newly-erased block contained word 0xbcb077e4 at offset 0x001b0000
[ 32.318341] jffs2: Newly-erased block contained word 0xe17f5692 at offset 0x001a0000
[ 32.348275] jffs2: Newly-erased block contained word 0x8b355e73 at offset 0x00190000
[ 32.367652] jffs2: Newly-erased block contained word 0x867c788f at offset 0x00180000
[ 32.398123] jffs2: Newly-erased block contained word 0x20468295 at offset 0x00170000
[ 32.439213] jffs2: Newly-erased block contained word 0xf2980404 at offset 0x00160000
[ 32.478410] jffs2: Newly-erased block contained word 0xea9a0ea1 at offset 0x00150000
[ 32.508340] jffs2: Newly-erased block contained word 0x38e99ec4 at offset 0x00140000
[ 32.537661] jffs2: Newly-erased block contained word 0x4bd099e at offset 0x00130000
[ 32.547146] jffs2: Newly-erased block contained word 0x10143be3 at offset 0x00120000
[ 32.557065] jffs2: Newly-erased block contained word 0xffc89ce at offset 0x00110000
[ 32.588917] jffs2: Newly-erased block contained word 0x91d14ae at offset 0x00100000
[ 32.618391] jffs2: Newly-erased block contained word 0x605837e7 at offset 0x000f0000
[ 32.645648] jffs2: Newly-erased block contained word 0xd71f115 at offset 0x000e0000
[ 32.678432] jffs2: Newly-erased block contained word 0x73646e62 at offset 0x000d0000
[ 32.707215] jffs2: Newly-erased block contained word 0xe9f6e9cb at offset 0x000c0000
[ 32.718769] jffs2: Newly-erased block contained word 0x663a298b at offset 0x000b0000
[ 32.751259] jffs2: Newly-erased block contained word 0xa393ad1a at offset 0x000a0000
[ 32.785910] jffs2: Newly-erased block contained word 0xc1dc5641 at offset 0x00090000
[ 32.818287] jffs2: Newly-erased block contained word 0xd001e13e at offset 0x00080000
[ 32.848341] jffs2: Newly-erased block contained word 0x17fd9773 at offset 0x00070000
[ 32.878383] jffs2: Newly-erased block contained word 0xc5e8d501 at offset 0x00060000
[ 32.903981] jffs2: Newly-erased block contained word 0x9e3d727b at offset 0x00050000
[ 32.948393] jffs2: Newly-erased block contained word 0x3863d15a at offset 0x00040000
[ 32.978377] jffs2: Newly-erased block contained word 0x88fae75a at offset 0x00030000
[ 33.028353] jffs2: Newly-erased block contained word 0xfa68a9e6 at offset 0x00020000
[ 33.069808] jffs2: Newly-erased block contained word 0x5efd3b93 at offset 0x00010000
[ 33.108372] jffs2: Newly-erased block contained word 0xdeadc0de at offset 0x00000000
[ 33.116156] done.
[ 33.118350] jffs2: notice: (1159) jffs2_build_xattr_subsystem: complete building xattr subsystem, 0 of xdatum (0 unchecked, 0 orphan) and 0 of xref (0 dead, 0 orphan) found.
[ 33.788185] eth0: link up (100Mbps/Full duplex)
[ 118.636579] random: crng init done