mirror of
https://github.com/hzyitc/openwrt-redmi-ax3000.git
synced 2025-12-16 08:22:16 +00:00
36 lines
754 B
Bash
Executable File
36 lines
754 B
Bash
Executable File
#!/bin/sh /etc/rc.common
|
|
|
|
START=99
|
|
|
|
. /lib/functions.sh
|
|
|
|
boot() {
|
|
case $(board_name) in
|
|
redmi,ax3000|\
|
|
xiaomi,cr881x)
|
|
fw_printenv >/dev/null || return 0
|
|
|
|
local flag_ota_reboot="$(fw_printenv flag_ota_reboot | cut -d'=' -f2)"
|
|
if [[ "$flag_ota_reboot" == 1 ]]; then
|
|
local mtd="$(grep -oE 'ubi.mtd=[a-zA-Z0-9\-\_]*' /proc/cmdline | cut -d'=' -f2)"
|
|
case $mtd in
|
|
rootfs)
|
|
fw_setenv flag_last_success 0
|
|
fw_setenv flag_ota_reboot 0
|
|
fw_setenv flag_boot_success 1
|
|
;;
|
|
rootfs_1)
|
|
fw_setenv flag_last_success 1
|
|
fw_setenv flag_ota_reboot 0
|
|
fw_setenv flag_boot_success 1
|
|
;;
|
|
*)
|
|
echo "Unable to determine UBIPART: ubi.mtd=$mtd"
|
|
return 1
|
|
;;
|
|
esac
|
|
fi
|
|
;;
|
|
esac
|
|
}
|