linuxrocks123 wrote:I found out the reason for the config not surviving reboots -- the image is too large for the device's flash, so there's no space to save the config left! Specifically, there's not enough space left for the jffs image -- you can see so from typing dmesg. This may be the reason for the soft brick when installing 15.05 as well...
Good catch, linuxrocks123.
For reference, here's my dmesg after a fresh flash (only config I changed was the root password):
[ 0.000000] Linux version 3.18.23 (buildbot@builder1) (gcc version 4.8.3 (OpenWrt/Linaro GCC 4.8-2014.04 r47269) ) #1 Sun Jan 31 18:39:35 CET 2016
[ 0.000000] MyLoader: sysp=f7e5de55, boardp=be3d3bbf, parts=f7edde55
[ 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] Zone ranges:
[ 0.000000] Normal [mem 0x00000000-0x01ffffff]
[ 0.000000] Movable zone start for each node
[ 0.000000] Early memory node ranges
[ 0.000000] node 0: [mem 0x00000000-0x01ffffff]
[ 0.000000] Initmem setup node 0 [mem 0x00000000-0x01ffffff]
[ 0.000000] On node 0 totalpages: 8192
[ 0.000000] free_area_init_node: node 0, pgdat 803762b0, node_mem_map 81000000
[ 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] 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] 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=WNR612V2 console=ttyS0,115200 mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,3712k(firmware),64k(art)ro rootfstype=squashfs,jffs2 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: 28324K/32768K available (2586K kernel code, 128K rwdata, 540K rodata, 256K init, 193K bss, 4444K reserved)
[ 0.000000] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[ 0.000000] NR_IRQS:51
[ 0.000000] Clocks: CPU:400.000MHz, DDR:400.000MHz, AHB:200.000MHz, Ref:5.000MHz
[ 0.000000] Calibrating delay loop... 265.42 BogoMIPS (lpj=1327104)
[ 0.080000] pid_max: default: 32768 minimum: 301
[ 0.080000] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.090000] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.100000] NET: Registered protocol family 16
[ 0.100000] MIPS: machine is NETGEAR WNR612 V2
[ 0.550000] registering PCI controller with io_map_base unset
[ 0.560000] PCI host bridge to bus 0000:00
[ 0.570000] pci_bus 0000:00: root bus resource [mem 0x10000000-0x13ffffff]
[ 0.570000] pci_bus 0000:00: root bus resource [io 0x0000]
[ 0.580000] pci_bus 0000:00: No busn resource found for root bus, will use [bus 00-ff]
[ 0.580000] pci 0000:00:00.0: [168c:002b] type 00 class 0x028000
[ 0.580000] pci 0000:00:00.0: fixup device configuration
[ 0.590000] pci 0000:00:00.0: reg 0x10: [mem 0x00000000-0x0000ffff 64bit]
[ 0.590000] pci 0000:00:00.0: supports D1
[ 0.590000] pci 0000:00:00.0: PME# supported from D0 D1 D3hot
[ 0.590000] pci_bus 0000:00: busn_res: [bus 00-ff] end is updated to 00
[ 0.590000] pci 0000:00:00.0: BAR 0: assigned [mem 0x10000000-0x1000ffff 64bit]
[ 0.590000] pci 0000:00:00.0: using irq 40 for pin 1
[ 0.600000] Switched to clocksource MIPS
[ 0.600000] NET: Registered protocol family 2
[ 0.610000] TCP established hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.610000] TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.620000] TCP: Hash tables configured (established 1024 bind 1024)
[ 0.630000] TCP: reno registered
[ 0.630000] UDP hash table entries: 256 (order: 0, 4096 bytes)
[ 0.640000] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[ 0.640000] NET: Registered protocol family 1
[ 0.650000] PCI: CLS 0 bytes, default 32
[ 0.650000] futex hash table entries: 256 (order: -1, 3072 bytes)
[ 0.660000] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[ 0.670000] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
[ 0.680000] msgmni has been set to 55
[ 0.690000] io scheduler noop registered
[ 0.690000] io scheduler deadline registered (default)
[ 0.690000] Serial: 8250/16550 driver, 16 ports, IRQ sharing enabled
[ 0.700000] console [ttyS0] disabled
[ 0.730000] serial8250.0: ttyS0 at MMIO 0x18020000 (irq = 11, base_baud = 12500000) is a 16550A
[ 0.740000] console [ttyS0] enabled
[ 0.740000] bootconsole [early0] disabled
[ 0.750000] m25p80 spi0.0: found mx25l3205d, expected m25p80
[ 0.760000] m25p80 spi0.0: mx25l3205d (4096 Kbytes)
[ 0.770000] 4 cmdlinepart partitions found on MTD device spi0.0
[ 0.770000] Creating 4 MTD partitions on "spi0.0":
[ 0.780000] 0x000000000000-0x000000040000 : "u-boot"
[ 0.780000] 0x000000040000-0x000000050000 : "u-boot-env"
[ 0.790000] 0x000000050000-0x0000003f0000 : "firmware"
[ 0.800000] 2 netgear-fw partitions found on MTD device firmware
[ 0.800000] 0x000000050000-0x000000172440 : "kernel"
[ 0.810000] 0x000000172440-0x0000003f0000 : "rootfs"
[ 0.820000] mtd: device 4 (rootfs) set to be root filesystem
[ 0.820000] 1 squashfs-split partitions found on MTD device rootfs
[ 0.830000] 0x0000003b0000-0x0000003f0000 : "rootfs_data"
[ 0.840000] 0x0000003f0000-0x000000400000 : "art"
[ 0.880000] libphy: ag71xx_mdio: probed
[ 1.480000] ag71xx ag71xx.0: connected to PHY at ag71xx-mdio.0:04 [uid=004dd041, driver=Generic PHY]
[ 1.490000] eth0: Atheros AG71xx at 0xb9000000, irq 4, mode:MII
[ 2.080000] ag71xx-mdio.0: Found an AR7240/AR9330 built-in switch
[ 2.120000] eth1: Atheros AG71xx at 0xba000000, irq 5, mode:GMII
[ 2.130000] TCP: cubic registered
[ 2.130000] NET: Registered protocol family 17
[ 2.130000] bridge: automatic filtering via arp/ip/ip6tables has been deprecated. Update your scripts to load br_netfilter if you need this.
[ 2.150000] Bridge firewalling registered
[ 2.150000] 8021q: 802.1Q VLAN Support v1.8
[ 2.160000] VFS: Mounted root (squashfs filesystem) readonly on device 31:4.
[ 2.170000] Freeing unused kernel memory: 256K (80390000 - 803d0000)
[ 3.440000] init: Console is alive
[ 3.440000] init: - watchdog -
[ 4.980000] usbcore: registered new interface driver usbfs
[ 4.990000] usbcore: registered new interface driver hub
[ 4.990000] usbcore: registered new device driver usb
[ 5.000000] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[ 5.010000] ehci-platform: EHCI generic platform driver
[ 5.020000] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
[ 5.030000] ohci-platform: OHCI generic platform driver
[ 5.520000] init: - preinit -
[ 6.270000] random: procd urandom read with 9 bits of entropy available
[ 8.330000] eth1: link up (1000Mbps/Full duplex)
[ 8.410000] mount_root: jffs2 not ready yet, using temporary tmpfs overlay
[ 8.460000] eth1: link down
[ 8.480000] procd: - early -
[ 8.480000] procd: - watchdog -
[ 9.200000] procd: - ubus -
[ 10.210000] procd: - init -
[ 11.180000] NET: Registered protocol family 10
[ 11.190000] ip6_tables: (C) 2000-2006 Netfilter Core Team
[ 11.210000] Loading modules backported from Linux version master-2015-03-09-0-g141f155
[ 11.220000] Backport generated by backports.git backports-20150129-0-gdd4a670
[ 11.230000] ip_tables: (C) 2000-2006 Netfilter Core Team
[ 11.250000] nf_conntrack version 0.5.0 (446 buckets, 1784 max)
[ 11.300000] xt_time: kernel timezone is -0000
[ 11.340000] cfg80211: Calling CRDA to update world regulatory domain
[ 11.370000] cfg80211: World regulatory domain updated:
[ 11.370000] cfg80211: DFS Master region: unset
[ 11.380000] cfg80211: (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp), (dfs_cac_time)
[ 11.390000] cfg80211: (2402000 KHz - 2472000 KHz @ 40000 KHz), (N/A, 2000 mBm), (N/A)
[ 11.390000] cfg80211: (2457000 KHz - 2482000 KHz @ 20000 KHz, 92000 KHz AUTO), (N/A, 2000 mBm), (N/A)
[ 11.400000] cfg80211: (2474000 KHz - 2494000 KHz @ 20000 KHz), (N/A, 2000 mBm), (N/A)
[ 11.410000] cfg80211: (5170000 KHz - 5250000 KHz @ 80000 KHz, 160000 KHz AUTO), (N/A, 2000 mBm), (N/A)
[ 11.420000] cfg80211: (5250000 KHz - 5330000 KHz @ 80000 KHz, 160000 KHz AUTO), (N/A, 2000 mBm), (0 s)
[ 11.430000] cfg80211: (5490000 KHz - 5730000 KHz @ 160000 KHz), (N/A, 2000 mBm), (0 s)
[ 11.440000] cfg80211: (5735000 KHz - 5835000 KHz @ 80000 KHz), (N/A, 2000 mBm), (N/A)
[ 11.450000] cfg80211: (57240000 KHz - 63720000 KHz @ 2160000 KHz), (N/A, 0 mBm), (N/A)
[ 11.530000] PPP generic driver version 2.4.2
[ 11.540000] NET: Registered protocol family 24
[ 11.600000] PCI: Enabling device 0000:00:00.0 (0000 -> 0002)
[ 11.610000] ath: phy0: Enable LNA combining
[ 11.610000] ath: phy0: eeprom contains invalid mac address: ff:ff:ff:ff:ff:ff
[ 11.620000] ath: phy0: random mac address will be used: c6:ce:f8:00:9a:da
[ 11.630000] ath: EEPROM regdomain: 0x0
[ 11.630000] ath: EEPROM indicates default country code should be used
[ 11.630000] ath: doing EEPROM country->regdmn map search
[ 11.630000] ath: country maps to regdmn code: 0x3a
[ 11.630000] ath: Country alpha2 being used: US
[ 11.630000] ath: Regpair used: 0x3a
[ 11.640000] ieee80211 phy0: Selected rate control algorithm 'minstrel_ht'
[ 11.640000] ieee80211 phy0: Atheros AR9285 Rev:2 mem=0xb0000000, irq=40
[ 11.650000] cfg80211: Calling CRDA for country: US
[ 11.670000] cfg80211: Regulatory domain changed to country: US
[ 11.670000] cfg80211: DFS Master region: FCC
[ 11.680000] cfg80211: (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp), (dfs_cac_time)
[ 11.690000] cfg80211: (2402000 KHz - 2472000 KHz @ 40000 KHz), (N/A, 3000 mBm), (N/A)
[ 11.700000] cfg80211: (5170000 KHz - 5250000 KHz @ 80000 KHz, 160000 KHz AUTO), (N/A, 2300 mBm), (N/A)
[ 11.710000] cfg80211: (5250000 KHz - 5330000 KHz @ 80000 KHz, 160000 KHz AUTO), (N/A, 2300 mBm), (0 s)
[ 11.720000] cfg80211: (5490000 KHz - 5730000 KHz @ 160000 KHz), (N/A, 2300 mBm), (0 s)
[ 11.720000] cfg80211: (5735000 KHz - 5835000 KHz @ 80000 KHz), (N/A, 3000 mBm), (N/A)
[ 11.730000] cfg80211: (57240000 KHz - 63720000 KHz @ 2160000 KHz), (N/A, 4000 mBm), (N/A)
[ 22.090000] jffs2: Too few erase blocks (4)
[ 24.660000] device eth1 entered promiscuous mode
[ 24.690000] IPv6: ADDRCONF(NETDEV_UP): br-lan: link is not ready
[ 24.720000] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
[ 26.820000] eth1: link up (1000Mbps/Full duplex)
[ 26.820000] br-lan: port 1(eth1) entered forwarding state
[ 26.830000] br-lan: port 1(eth1) entered forwarding state
[ 26.850000] IPv6: ADDRCONF(NETDEV_CHANGE): br-lan: link becomes ready
[ 28.830000] br-lan: port 1(eth1) entered forwarding state
[ 76.530000] random: nonblocking pool is initialized
The relevant part seems to be
[ 0.750000] m25p80 spi0.0: found mx25l3205d, expected m25p80
[ 0.760000] m25p80 spi0.0: mx25l3205d (4096 Kbytes)
[ 0.770000] 4 cmdlinepart partitions found on MTD device spi0.0
[ 0.770000] Creating 4 MTD partitions on "spi0.0":
[ 0.780000] 0x000000000000-0x000000040000 : "u-boot"
[ 0.780000] 0x000000040000-0x000000050000 : "u-boot-env"
[ 0.790000] 0x000000050000-0x0000003f0000 : "firmware"
[ 0.800000] 2 netgear-fw partitions found on MTD device firmware
[ 0.800000] 0x000000050000-0x000000172440 : "kernel"
[ 0.810000] 0x000000172440-0x0000003f0000 : "rootfs"
[ 0.820000] mtd: device 4 (rootfs) set to be root filesystem
[ 0.820000] 1 squashfs-split partitions found on MTD device rootfs
[ 0.830000] 0x0000003b0000-0x0000003f0000 : "rootfs_data"
[ 0.840000] 0x0000003f0000-0x000000400000 : "art"
and
[ 22.090000] jffs2: Too few erase blocks (4)
The "rootfs_data" partition is only from 0x3b0000-0x3f0000 (the only space in the 4MB of flash that isn't taken up by something else), which is 262144 bytes long (if I'm interpreting this correctly), so we only have 256kiB of space for the jffs2 partition to store new and changed files.
Also, df shows:
Filesystem 1K-blocks Used Available Use% Mounted on
rootfs 14288 68 14220 0% /
/dev/root 2304 2304 0 100% /rom
tmpfs 14288 408 13880 3% /tmp
tmpfs 14288 68 14220 0% /tmp/root
overlayfs:/tmp/root 14288 68 14220 0% /
tmpfs 512 0 512 0% /dev
Contrast this with my other router (Buffalo WZR-600DHP) running OpenWRT:
Filesystem 1K-blocks Used Available Use% Mounted on
rootfs 28992 996 27996 3% /
/dev/root 2304 2304 0 100% /rom
tmpfs 63100 1220 61880 2% /tmp
/dev/mtdblock8 28992 996 27996 3% /overlay
overlayfs:/overlay 28992 996 27996 3% /
tmpfs 512 0 512 0% /dev
On the "On Networks N150R", probably because there isn't enough space on the flash for a jffs2 filesystem, a tmpfs filesystem (i.e., a RAM disk) is used instead:
# cat /proc/mounts
rootfs / rootfs rw 0 0
/dev/root /rom squashfs ro,relatime 0 0
proc /proc proc rw,nosuid,nodev,noexec,noatime 0 0
sysfs /sys sysfs rw,nosuid,nodev,noexec,noatime 0 0
tmpfs /tmp tmpfs rw,nosuid,nodev,noatime 0 0
tmpfs /tmp/root tmpfs rw,noatime,mode=755 0 0
overlayfs:/tmp/root / overlay rw,noatime,lowerdir=/,upperdir=/tmp/root/upper,workdir=/tmp/root/work 0 0
tmpfs /dev tmpfs rw,nosuid,relatime,size=512k,mode=755 0 0
devpts /dev/pts devpts rw,nosuid,noexec,relatime,mode=600 0 0
debugfs /sys/kernel/debug debugfs rw,noatime 0 0
I wonder what the minimum requirements for OpenWRT are nowadays (for Chaos Calmer 15.05.1). I suppose we can always make a more barebones flash image? Or perhaps compile OpenWRT to optimize for space? It's been a few years since I've delved into this stuff.
Related: https://wiki.openwrt.org/doc/techref/flash.layout.
(Last edited by jchau on 30 Apr 2016, 19:41)