Broken installation, missing rootfs and overlayfs

Hi,

I have a GL.iNet GL-S1300. It comes with a fork of OpenWrt made by Gl.iNet.
To put stock OpenWrt on you first have to flash s1300-factory-to-openwrt.img (it has two flash storage chips, this makes openwrt install on the correct one) and then flash OpenWrt. This is done via UBoot web interface.

see: https://openwrt.org/toh/gl.inet/gl.inet_gl-s1300

I had done that and broke something with the overlay partition as it was mounting the wrong device.
Reflashing:
openwrt-ipq40xx-generic-glinet_gl-s1300-squashfs-sysupgrade.bin
didn't fix my issue so I flashed:
openwrt-ipq40xx-generic-glinet_gl-s1300-initramfs-fit-uImage.itb

OpenWrt is working, I can ssh (and scp) to it and install packages via opkg. However, it is running as tmpfs so nothing I do is persistent after reboot.

Am I missing an installation step to get the rootfs, rootfs_data and overlay working again?
Thanks for your help

root@OpenWrt:~# mount
tmpfs on / type tmpfs (rw,relatime)
proc on /proc type proc (rw,nosuid,nodev,noexec,noatime)
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,noatime)
cgroup2 on /sys/fs/cgroup type cgroup2 (rw,nosuid,nodev,noexec,relatime,nsdelegate)
tmpfs on /tmp type tmpfs (rw,nosuid,nodev,noatime)
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)
none on /sys/fs/bpf type bpf (rw,nosuid,nodev,noexec,noatime,mode=700)

root@OpenWrt:~# df -T
Filesystem           Type       1K-blocks      Used Available Use% Mounted on
tmpfs                tmpfs         254132     30416    223716  12% /
tmpfs                tmpfs         254132      1000    253132   0% /tmp
tmpfs                tmpfs            512         0       512   0% /dev

root@OpenWrt:~# df -h
Filesystem                Size      Used Available Use% Mounted on
tmpfs                   248.2M     29.7M    218.5M  12% /
tmpfs                   248.2M   1000.0K    247.2M   0% /tmp
tmpfs                   512.0K         0    512.0K   0% /dev

root@OpenWrt:~# cat /proc/mtd 
dev:    size   erasesize  name
mtd0: 00040000 00010000 "SBL1"
mtd1: 00020000 00010000 "MIBIB"
mtd2: 00060000 00010000 "QSEE"
mtd3: 00010000 00010000 "CDT"
mtd4: 00010000 00010000 "DDRPARAMS"
mtd5: 00010000 00010000 "APPSBLENV"
mtd6: 00080000 00010000 "APPSBL"
mtd7: 00010000 00010000 "ART"
mtd8: 00e80000 00010000 "firmware"

root@OpenWrt:~# cat /proc/partitions
major minor  #blocks  name

  31        0        256 mtdblock0
  31        1        128 mtdblock1
  31        2        384 mtdblock2
  31        3         64 mtdblock3
  31        4         64 mtdblock4
  31        5         64 mtdblock5
  31        6        512 mtdblock6
  31        7         64 mtdblock7
  31        8      14848 mtdblock8
 179        0    7634944 mmcblk0
 179        1      32768 mmcblk0p1
 179        2     131072 mmcblk0p2
 179        3     524288 mmcblk0p3
 179        4    6936576 mmcblk0p4

The initramfs image is supposed to run from RAM only, it won't allow you flash access for your overlay - you need to use the sysupgrade image instead. Make sure to flash it from the running initramfs image with sysupgrade -n /tmp/openwrt-ipq40xx-generic-glinet_gl-s1300-squashfs-sysupgrade.bin, to make sure that GL-Inet's non-OpenWrt overlay gets deleted. If the release image doesn't work, try a snapshot or vice versa.

3 Likes

In general sysupgrade -n /tmp/openwrt-ipq40xx-generic-glinet_gl-s1300-squashfs-sysupgrade.bin is the correct solution.

In my case what was leading to the issues was that every time I ran this, my router booted up but then didn't give me an IP via dhcp.
After countless flashing, reflashing and trying to do things in different orders I plugged the ethernet cable into the WAN port and noticed I was getting an IP of 192.168.8.XXX. This is the default for the GL.Inet fork of openwrt. This still had my old root password set so I knew it was definitely the old config files. I'm not sure how it ended up switching the interfaces around.
The solution to clear the old configs was to run
'firstboot -y && reboot now'
then switch the ethernet cable back into one of the LAN ports and voila we get an IP 192.168.1.XXX assigned.

Thanks very much for your help :smiley:

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.