Xiaomi/Chuangmi ipc017 kept on its vendor U-Boot. A kernel fragment appends mtdparts= with the vendor MXP offsets under OpenIPC's names plus panic=20, and carves a separate 64 KB env out of the end of the vendor DATA partition, because the vendor environment shares its erase block with the end of U-Boot. S01fwenv points fw_env.config at that partition. wireless/usb powers the MT7601U on GPIO 14 and bind-mounts a /tmp copy of MT7601USTA.dat with the factory MAC from FACTORY. S41eth0 takes the connector-less eth0 down so ONVIF discovery goes out on wlan0. Tested on hardware.
28 lines
671 B
Bash
Executable File
28 lines
671 B
Bash
Executable File
#!/bin/sh
|
|
#
|
|
# The vendor U-Boot keeps its environment in the erase block that also holds the
|
|
# end of U-Boot, so fw_setenv must never reach it. This profile's mtdparts gives
|
|
# the environment a 64 KB partition of its own: point fw_printenv and fw_setenv
|
|
# at it, and at nothing while the vendor partitions are still in use.
|
|
|
|
case "$1" in
|
|
start)
|
|
env=$(awk -F: '/"env"/ {print $1}' /proc/mtd)
|
|
if [ -n "$env" ]; then
|
|
line="/dev/$env 0x0 0x10000 0x10000"
|
|
[ "$(cat /etc/fw_env.config 2>/dev/null)" = "$line" ] ||
|
|
echo "$line" > /etc/fw_env.config
|
|
else
|
|
rm -f /etc/fw_env.config
|
|
fi
|
|
;;
|
|
|
|
stop)
|
|
;;
|
|
|
|
*)
|
|
echo "Usage: $0 {start|stop}"
|
|
exit 1
|
|
;;
|
|
esac
|