Ipq5018 qsdk cannot reserve configurations when exec sysupgrade

root@AP550:/tmp# cat /proc/mtd

dev:    size   erasesize  name
mtd0: 00030000 00001000 "0:SBL1"
mtd1: 00010000 00001000 "0:MIBIB"
mtd2: 00010000 00001000 "0:BOOTCONFIG"
mtd3: 00010000 00001000 "0:BOOTCONFIG1"
mtd4: 000a0000 00001000 "0:QSEE"
mtd5: 000a0000 00001000 "0:QSEE_1"
mtd6: 00010000 00001000 "0:DEVCFG"
mtd7: 00010000 00001000 "0:DEVCFG_1"
mtd8: 00010000 00001000 "0:CDT"
mtd9: 00010000 00001000 "0:CDT_1"
mtd10: 00010000 00001000 "0:APPSBLENV"
mtd11: 000a0000 00001000 "0:APPSBL"
mtd12: 000a0000 00001000 "0:APPSBL_1"
mtd13: 00080000 00001000 "0:ART"
mtd14: 00080000 00020000 "0:TRAINING"
mtd15: 03e00000 00020000 "rootfs"
mtd16: 03e00000 00020000 "rootfs_1"
mtd17: 00439e80 0001f000 "kernel"
mtd18: 00382000 0001f000 "wifi_fw"
mtd19: 00005000 0001f000 "bt_fw"
mtd20: 00ec6000 0001f000 "ubi_rootfs"
mtd21: 01de9000 0001f000 "rootfs_data"

root@AP550:/tmp# sysupgrade -v -c nand-ipq5018-apps.img

Warning: optional section "sbl1" missing from "nand-ipq5018-apps.img". Continue...
Warning: optional section "sbl2" missing from "nand-ipq5018-apps.img". Continue...
Warning: optional section "u-boot" missing from "nand-ipq5018-apps.img". Continue...
Warning: optional section "lkboot" missing from "nand-ipq5018-apps.img". Continue...
Warning: optional section "ddr-ap-mp03.5-c1" missing from "nand-ipq5018-apps.img". Continue...
Warning: optional section "ssd" missing from "nand-ipq5018-apps.img". Continue...
Warning: optional section "tz" missing from "nand-ipq5018-apps.img". Continue...
Warning: optional section "rpm" missing from "nand-ipq5018-apps.img". Continue...
[ 1251.162990] sh (5066): drop_caches: 3
stat: No such file or directory
Saving config files...
etc/config/cert
etc/config/cnss_diag
etc/config/ddns
etc/config/dhcp
etc/config/dhcrelay
etc/config/dropbear
etc/config/ecm
etc/config/firewall
etc/config/login
etc/config/luci
etc/config/mcproxy
etc/config/mcsd
etc/config/multiwan
etc/config/network
etc/config/nss
etc/config/qcacfg80211
etc/config/router/dhcp
etc/config/router/firewall
etc/config/router/network
etc/config/router/wireless
etc/config/rpcd
etc/config/skb_recycler
etc/config/ssid-steering
etc/config/sysstat
etc/config/system
etc/config/system_4019
etc/config/thermal
etc/config/ubootenv
etc/config/ucitrack
etc/config/uhttpd
etc/config/upnpd
etc/config/wireless
etc/dnsmasq.conf
etc/dropbear/dropbear_rsa_host_key
etc/firewall.user
etc/fw_env.config
etc/group
etc/hosts
etc/inittab
etc/iproute2/rt_tables
etc/mcproxy.conf
etc/opkg.conf
etc/opkg/customfeeds.conf
etc/opkg/keys/141c3812dfd4eb4f
etc/opkg/keys/53bad1233d4c98c5
etc/opkg/keys/de98a2dd1d0f8a07
etc/passwd
etc/profile
etc/protocols
etc/rc.local
etc/services
etc/shadow
etc/shells
etc/ssl/openssl.cnf
etc/sysctl.conf
etc/sysstat/sysstat
etc/sysstat/sysstat.ioconf
etc/sysupgrade.conf
etc/uhttpd.crt
etc/uhttpd.key
lib/wifi/wifi_nss_hk_olnum
lib/wifi/wifi_nss_olcfg
lib/wifi/wifi_nss_olnum
etc/uhttpd.key
etc/uhttpd.crt
Command failed: Method not found
Command failed: Method not found
Sending TERM to remaining processes ... cnssdaemon uhttpd breakpad_report logd rpcd acfg_tool netifd mcsd [ 1252.310126] mc_detach: disabled snooping on br-lan
mcastds: Leaving mcsd executive program
ntpd thermald dnsmasq rngd sleep sleep qrtr-ns web_agent 
Sending KILL to remaining processes ... rngd sleep sleep ping 
Switching to ramdisk...
[ 1257.135333] UBIFS (ubi0:4): background thread "ubifs_bgt0_4" stops
Performing system upgrade...
Section script ignored
[ 1259.458765] ubi0 error: ubi_detach_mtd_dev: ubi0 reference count 2, destroy anyway
[ 1259.580962] ubi0: detaching mtd15
[ 1259.582306] ubi0: mtd15 is detached
ubiformat: mtd16 (nand), size 65011712 bytes (62.0 MiB), 496 eraseblocks of 131072 bytes (128.0 KiB), min. I/O size 2048 bytes
libscan: scanning eraseblock 495 -- 100 % complete  
ubiformat: 496 eraseblocks have valid erase counter, mean value is 114
ubiformat: flashing eraseblock 190 -- 100 % complete  
ubiformat: formatting eraseblock 495 -- 100 % complete  
Flashed ubi-4049e62fbbe3d07598c224c9fe02ea661d241624
grep: /sys/block/mmcblk*/mmcblk*p*/uevent: No such file or directory
[ 1271.707689] ubi0: attaching mtd16
[ 1271.902742] ubi0: scanning is finished
[ 1271.919012] gluebi (pid 5641): gluebi_resized: got update notification for unknown UBI device 0 volume 4
[ 1271.919050] ubi0: volume 4 ("rootfs_data") re-sized from 1 to 247 LEBs
[ 1271.930635] ubi0: attached mtd16 (name "rootfs_1", size 62 MiB)
[ 1271.933888] ubi0: PEB size: 131072 bytes (128 KiB), LEB size: 126976 bytes
[ 1271.939703] ubi0: min./max. I/O unit sizes: 2048/2048, sub-page size 2048
[ 1271.946687] ubi0: VID header offset: 2048 (aligned 2048), data offset: 4096
[ 1271.953529] ubi0: good PEBs: 496, bad PEBs: 0, corrupted PEBs: 0
[ 1271.960292] ubi0: user volume: 5, internal volumes: 1, max. volumes count: 128
[ 1271.966529] ubi0: max/mean erase counter: 218/115, WL threshold: 4096, image sequence number: 1377334676
[ 1271.973625] ubi0: available PEBs: 0, total reserved PEBs: 496, PEBs reserved for bad PEB handling: 20
[ 1271.983248] ubi0: background thread "ubi_bgt0d" started, PID 5642
[ 1272.008305] gluebi (pid 5641): gluebi_create: gluebi MTD device 20 form UBI device 0 volume 3 already exists
UBI device number 0, total 496 LEBs (62980096 bytes, 60.1 MiB), available 0 LEBs (0 bytes), LEB size 126976 bytes (124.0 KiB)
Flashed wifi_fw_ipq5018_qcn6122cs-9d02e4d1248a1e369e0fcf4768eb71fbc49db4ab
Section wifi_fw_ipq5018_qcn9000-013aaac13b0b63d467720a0084be93d34b6303ae ignored
Section wifi_fw_ipq5018_qcn9000_qcn6122-482807a4325a85d1863d2c79e4de4fe98726914f ignored
Unlocking /dev/mtd2 ...
Erasing /dev/mtd2 ...
336+0 records in
336+0 records out
336 bytes (336B) copied, 0.003882 seconds, 84.5KB/s

Writing from <stdin> to /dev/mtd2 ...     
Unlocking /dev/mtd3 ...
Erasing /dev/mtd3 ...
336+0 records in
336+0 records out
336 bytes (336B) copied, 0.001144 seconds, 286.8KB/s

Writing from <stdin> to /dev/mtd3 ...     
> [ 1276.574423] ubi: mtd16 is already attached to ubi0ubiattach: error!: cannot attach "/dev/mtd16"
>            error 17 (File exists)
> mount: mounting ubi0:rootfs_data on /tmp/overlay failed: Resource busy
> umount: can't unmount /tmp/overlay: Invalid argument
Upgrade completed
Rebooting system...

The error is that cannot mount ubi0:rootfs_data to /tmp/overlay at platform_copy_config funciton.

It appears you are using firmware that is not from the official OpenWrt project.

When using forks/offshoots/vendor-specific builds that are "based on OpenWrt", there may be many differences compared to the official versions (hosted by OpenWrt.org). Some of these customizations may fundamentally change the way that OpenWrt works. You might need help from people with specific/specialized knowledge about the firmware you are using, so it is possible that advice you get here may not be useful.

You may find that the best options are:

  1. Install an official version of OpenWrt, if your device is supported (see https://firmware-selector.openwrt.org).
  2. Ask for help from the maintainer(s) or user community of the specific firmware that you are using.
  3. Provide the source code for the firmware so that users on this forum can understand how your firmware works (OpenWrt forum users are volunteers, so somebody might look at the code if they have time and are interested in your issue).

If you believe that this specific issue is common to generic/official OpenWrt and/or the maintainers of your build have indicated as such, please feel free to clarify.

1 Like

As stated earlier, the sdk you are using did not come from the OpenWrt project. It is a QSDK - Qualcomm sdk.

Therefore, you need to reach out to Qualcomm for help. Their sdk is not supported here.

1 Like

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