coolsnowwolf/openwrt-gl-ax1800

MR7350: resetting bootcount doesnt work

Opened this issue · 1 comments

https://github.com/coolsnowwolf/openwrt-gl-ax1800/blob/master/target/linux/ipq60xx/base-files/etc/init.d/bootcount

Sun Oct  2 17:25:53 2022 daemon.notice procd: /etc/rc.d/S99bootcount: Usage: mtd [<options> ...] <command> [<arguments> ...] <device>[:<device>...]
Sun Oct  2 17:25:53 2022 daemon.notice procd: /etc/rc.d/S99bootcount:
Sun Oct  2 17:25:53 2022 daemon.notice procd: /etc/rc.d/S99bootcount: The device is in the format of mtdX (eg: mtd4) or its label.
Sun Oct  2 17:25:53 2022 daemon.notice procd: /etc/rc.d/S99bootcount: mtd recognizes these commands:
Sun Oct  2 17:25:53 2022 daemon.notice procd: /etc/rc.d/S99bootcount:         unlock                  unlock the device
Sun Oct  2 17:25:53 2022 daemon.notice procd: /etc/rc.d/S99bootcount:         refresh                 refresh mtd partition
Sun Oct  2 17:25:53 2022 daemon.notice procd: /etc/rc.d/S99bootcount:         erase                   erase all data on device
Sun Oct  2 17:25:53 2022 daemon.notice procd: /etc/rc.d/S99bootcount:         verify <imagefile>|-    verify <imagefile> (use - for stdin) to device
Sun Oct  2 17:25:53 2022 daemon.notice procd: /etc/rc.d/S99bootcount:         write <imagefile>|-     write <imagefile> (use - for stdin) to device
Sun Oct  2 17:25:53 2022 daemon.notice procd: /etc/rc.d/S99bootcount:         jffs2write <file>       append <file> to the jffs2 partition on the device
Sun Oct  2 17:25:53 2022 daemon.notice procd: /etc/rc.d/S99bootcount: Following options are available:
Sun Oct  2 17:25:53 2022 daemon.notice procd: /etc/rc.d/S99bootcount:         -q                      quiet mode (once: no [w] on writing,
Sun Oct  2 17:25:53 2022 daemon.notice procd: /etc/rc.d/S99bootcount:                                            twice: no status messages)
Sun Oct  2 17:25:53 2022 daemon.notice procd: /etc/rc.d/S99bootcount:         -n                      write without first erasing the blocks
Sun Oct  2 17:25:53 2022 daemon.notice procd: /etc/rc.d/S99bootcount:         -r                      reboot after successful command
Sun Oct  2 17:25:53 2022 daemon.notice procd: /etc/rc.d/S99bootcount:         -f                      force write without trx checks
Sun Oct  2 17:25:53 2022 daemon.notice procd: /etc/rc.d/S99bootcount:         -e <device>             erase <device> before executing the command
Sun Oct  2 17:25:53 2022 daemon.notice procd: /etc/rc.d/S99bootcount:         -d <name>               directory for jffs2write, defaults to "tmp"
Sun Oct  2 17:25:53 2022 daemon.notice procd: /etc/rc.d/S99bootcount:         -j <name>               integrate <file> into jffs2 data when writing an image
Sun Oct  2 17:25:53 2022 daemon.notice procd: /etc/rc.d/S99bootcount:         -s <number>             skip the first n bytes when appending data to the jffs2 partiton, defaults to "0"
Sun Oct  2 17:25:53 2022 daemon.notice procd: /etc/rc.d/S99bootcount:         -p <number>             write beginning at partition offset
Sun Oct  2 17:25:53 2022 daemon.notice procd: /etc/rc.d/S99bootcount:         -l <length>             the length of data that we want to dump
Sun Oct  2 17:25:53 2022 daemon.notice procd: /etc/rc.d/S99bootcount:
Sun Oct  2 17:25:53 2022 daemon.notice procd: /etc/rc.d/S99bootcount: Example: To write linux.trx to mtd4 labeled as linux and reboot afterwards
Sun Oct  2 17:25:53 2022 daemon.notice procd: /etc/rc.d/S99bootcount:          mtd -r write linux.trx linux
Sun Oct  2 17:25:53 2022 daemon.notice procd: /etc/rc.d/S99bootcount:

now if you reboot 4 times or so you get kicked back to the backup firmware.

hella nice. Thanks man.