2020-10-25 21:04:47 +00:00
|
|
|
#!/bin/sh
|
|
|
|
# Update partition script
|
|
|
|
|
|
|
|
source /usr/local/lib/utils
|
|
|
|
|
|
|
|
root_part_num=2
|
|
|
|
root_part=/dev/mmcblk0p${root_part_num}
|
|
|
|
root_mount=/tmp/rootfs
|
|
|
|
|
|
|
|
do_preinst()
|
|
|
|
{
|
2020-11-10 14:26:11 +00:00
|
|
|
notif " 1/3 EXTRACT FIRMWARE UPDATE.."
|
2020-10-25 21:04:47 +00:00
|
|
|
exit 0
|
|
|
|
}
|
|
|
|
|
|
|
|
do_postinst()
|
|
|
|
{
|
|
|
|
local version
|
|
|
|
|
2020-11-10 14:26:11 +00:00
|
|
|
notif " 2/3 RESIZE ROOT FILESYSTEM"
|
2020-10-31 23:49:56 +00:00
|
|
|
resize2fs ${root_part}
|
2020-10-25 21:04:47 +00:00
|
|
|
if [ $? -ne 0 ]; then
|
2020-11-09 15:11:53 +00:00
|
|
|
notif "CANNOT RESIZE ROOT FILESYSTEM"
|
2020-10-25 21:04:47 +00:00
|
|
|
exit 1
|
|
|
|
fi
|
2020-11-05 13:46:49 +00:00
|
|
|
for file in $(ls /mnt/FunKey-rootfs-*.fwu); do
|
2020-11-10 14:26:11 +00:00
|
|
|
notif "3/3 ERASE UPDATE FILE"
|
2020-10-31 23:49:56 +00:00
|
|
|
rm -f "${file}"
|
|
|
|
done
|
2020-10-25 21:04:47 +00:00
|
|
|
exit 0
|
|
|
|
}
|
|
|
|
|
|
|
|
echo $0 $1
|
|
|
|
|
|
|
|
case "$1" in
|
|
|
|
preinst)
|
|
|
|
do_preinst
|
|
|
|
;;
|
|
|
|
postinst)
|
|
|
|
do_postinst
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
exit 1
|
|
|
|
;;
|
|
|
|
esac
|