mirror of
https://github.com/FunKey-Project/FunKey-OS.git
synced 2025-12-12 15:48:51 +01:00
simplify update_partition script
Signed-off-by: Michel-FK <michel.stempin@funkey-project.com>
This commit is contained in:
parent
0f9b5bc3c3
commit
23d4cb06ae
@ -9,7 +9,7 @@ root_mount=/tmp/rootfs
|
|||||||
|
|
||||||
do_preinst()
|
do_preinst()
|
||||||
{
|
{
|
||||||
notif "1/5 Extract firmware update..."
|
notif " 1/3 EXTRACT FIRMWARE UPDATE.."
|
||||||
exit 0
|
exit 0
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -17,28 +17,14 @@ do_postinst()
|
|||||||
{
|
{
|
||||||
local version
|
local version
|
||||||
|
|
||||||
notif "2/5 RESIZE ROOT FILESYSTEM"
|
notif " 2/3 RESIZE ROOT FILESYSTEM"
|
||||||
resize2fs ${root_part}
|
resize2fs ${root_part}
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
notif "CANNOT RESIZE ROOT FILESYSTEM"
|
notif "CANNOT RESIZE ROOT FILESYSTEM"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
notif "3/5 MOUNT ROOT FILESYSTEM"
|
|
||||||
mkdir -p ${root_mount}
|
|
||||||
mount -t ext4 ${root_part} ${root_mount}
|
|
||||||
if [ $? -ne 0 ]; then
|
|
||||||
notif "CANNOT MOUNT ROOT FILESYSTEM"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
notif "4/5 UNMOUNT ROOT FILESYSTEM"
|
|
||||||
touch "${root_mount}/.first_boot"
|
|
||||||
umount ${root_mount}
|
|
||||||
if [ $? -ne 0 ]; then
|
|
||||||
notif "CANNOT UNMOUNT ROOT FILESYSTEM"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
for file in $(ls /mnt/FunKey-rootfs-*.fwu); do
|
for file in $(ls /mnt/FunKey-rootfs-*.fwu); do
|
||||||
notif "5/5 ERASE UPDATE FILE"
|
notif "3/3 ERASE UPDATE FILE"
|
||||||
rm -f "${file}"
|
rm -f "${file}"
|
||||||
done
|
done
|
||||||
exit 0
|
exit 0
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user