1 #!/bin/sh /etc/rc.common
10 local part_device
="$(find_mmc_part "$part_label")"
11 if [ "$part_device" = "" ]; then
12 >&2 echo "mmc_resetbc: Unknown partition label: $part_label"
16 local magic_number
="$(hexdump -e '"0x
%02x
\n"' -n 4 "$part_device")"
17 if [ "$magic_number" != "0x20110811" ]; then
18 >&2 echo "mmc_resetbc: Unexpected partition magic: $magic_number"
22 local last_count
=$
(hexdump -e '"0x%02x\n"' -n 4 -s 4 "$part_device")
23 if [ "$last_count" != "0x00" ]; then
24 printf "\x00" |
dd of
="$part_device" bs
=4 seek
=1 count
=1 conv
=notrunc
2>/dev
/null
26 last_count
=$
(hexdump -e '"0x%02x\n"' -n 4 -s 4 "$part_device")
27 if [ "$last_count" != "0x00" ]; then
28 >&2 echo "mmc_resetbc: Unable to reset boot counter"
36 alfa-network
,ap120c-ac
)
37 [ -n "$(fw_printenv bootcount changed 2>/dev/null)" ] &&\
38 echo -e "bootcount\nchanged\n" |
/usr
/sbin
/fw_setenv
-s -
45 mtd resetbc s_env || true
48 mmc_resetbc s_env || true