FunKey-OS/FunKey/board/funkey/update_partition

44 lines
714 B
Plaintext
Raw Normal View History

#!/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-16 09:10:47 +00:00
notif " 1/3 EXTRACT FIRMWARE UPDATE..^DO NOT TURN OFF THE CONSOLE"
exit 0
}
do_postinst()
{
2020-11-16 09:10:47 +00:00
notif " 2/3 RESIZE ROOT FILESYSTEM^DO NOT TURN OFF THE CONSOLE"
resize2fs ${root_part}
if [ $? -ne 0 ]; then
2020-11-16 09:10:47 +00:00
notif " CANNOT RESIZE ROOT ^FILESYSTEM"
exit 1
fi
2020-11-16 09:10:47 +00:00
for file in $(ls /mnt/FunKey-*.fwu); do
notif " 3/3 ERASE UPDATE FILE^DO NOT TURN OFF THE CONSOLE"
rm -f "${file}"
done
exit 0
}
echo $0 $1
case "$1" in
preinst)
do_preinst
;;
postinst)
do_postinst
;;
*)
exit 1
;;
esac