linkpi_firmware_history/rootfs/link/shell/update.sh

65 lines
1.7 KiB
Bash
Raw Normal View History

2024-02-15 22:07:35 +01:00
if [ ! -z "$(ls -A /link/update)" ]; then
2024-02-15 22:07:39 +01:00
cp -rd /link/config /tmp/history_config
rm -rf /tmp/history_config/misc/timezone/zoneinfo
2024-02-15 22:07:35 +01:00
mv /link/update/* /link/update/update.tar
2024-02-15 22:07:37 +01:00
tar -xof /link/update/update.tar -C /
2024-02-15 22:07:35 +01:00
sleep 1
if [ -c "/dev/mtd1" ]; then
if [ -f "/link/update/kernel" ]; then
flash_erase /dev/mtd1 0 0
nandwrite -p /dev/mtd1 /link/update/kernel
fi
if [ -f "/link/update/logo.bin" ]; then
flash_erase /dev/mtd2 0 0
nandwrite -p /dev/mtd2 /link/update/logo.bin
fi
if [ -f "/link/update/logo.jpg" ]; then
flash_erase /dev/mtd3 0 0
nandwrite -p /dev/mtd3 /link/update/logo.jpg
fi
else
if [ -f "/link/update/kernel" ]; then
dd if=/link/update/kernel of=/dev/mmcblk0p2
fi
if [ -f "/link/update/logo.bin" ]; then
dd if=/link/update/logo.bin of=/dev/mmcblk0p3
fi
if [ -f "/link/update/logo.jpg" ]; then
dd if=/link/update/logo.jpg of=/dev/mmcblk0p4
fi
fi
rm /link/update/*
2024-02-15 22:07:39 +01:00
if [ ! -f "/link/config/auto/no_user_setting" ]; then
/usr/php/bin/php /link/web/link/timer/healConf.php
fi
rm -rf /tmp/history_config
rm /link/config/auto/no_user_setting
2024-02-15 22:07:44 +01:00
if [ -f "/link/config/uboot_env.txt" ]; then
fw_setenv -s /link/config/uboot_env.txt
rm /link/config/uboot_env.txt
fi
2024-02-15 22:07:39 +01:00
2024-02-15 22:07:35 +01:00
if [ -f "/link/config/reboot" ]; then
rm /link/config/reboot
reboot
fi
2024-02-15 22:07:30 +01:00
fi
2024-02-15 22:07:35 +01:00
if [ -f "/link/shell/runOnce.sh" ]; then
chmod 777 /link/shell/runOnce.sh
/link/shell/runOnce.sh
rm /link/shell/runOnce.sh
2024-02-15 22:07:30 +01:00
fi
2024-02-15 22:07:35 +01:00
2024-02-15 22:07:44 +01:00