mirror of
https://github.com/FunKey-Project/FunKey-OS.git
synced 2026-01-21 07:14:43 +01:00
changed update file naming scheme
Signed-off-by: Michel-FK <michel.stempin@funkey-project.com>
This commit is contained in:
parent
6c20eca4ea
commit
56be24a117
@ -9,7 +9,7 @@ root_mount=/tmp/rootfs
|
|||||||
|
|
||||||
do_preinst()
|
do_preinst()
|
||||||
{
|
{
|
||||||
notif "1/7 Extract update"
|
notif "1/6 Extract update"
|
||||||
exit 0
|
exit 0
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -17,20 +17,20 @@ do_postinst()
|
|||||||
{
|
{
|
||||||
local version
|
local version
|
||||||
|
|
||||||
notif "2/7 Resize root filesystem"
|
notif "2/6 Resize root filesystem"
|
||||||
resize2fs ${root_part} >/dev/null 2>&1
|
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/7 Mount root filesystem"
|
notif "3/6 Mount root filesystem"
|
||||||
mkdir -p ${root_mount}
|
mkdir -p ${root_mount}
|
||||||
mount -t ext4 ${root_part} ${root_mount} >/dev/null 2>&1
|
mount -t ext4 ${root_part} ${root_mount}
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
notif "Cannot mount root filesystem"
|
notif "Cannot mount root filesystem"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
notif "4/7 Create swap"
|
notif "4/6 Create swap"
|
||||||
|
|
||||||
# Create an empty 128MB /swap file, change its permissions and format it as swap
|
# Create an empty 128MB /swap file, change its permissions and format it as swap
|
||||||
dd if=/dev/zero of=${root_mount}/swap bs=32M count=4 &&
|
dd if=/dev/zero of=${root_mount}/swap bs=32M count=4 &&
|
||||||
@ -38,24 +38,20 @@ do_postinst()
|
|||||||
mkswap ${root_mount}/swap
|
mkswap ${root_mount}/swap
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
rm ${root_mount}/swap
|
rm ${root_mount}/swap
|
||||||
umount ${root_mount} >/dev/null 2>&1
|
umount ${root_mount}
|
||||||
notif "Cannot create swap file"
|
notif "Cannot create swap file"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
notif "5/7 Unmount root filesystem"
|
for file in $(ls /mnt/FunKey-rootfs-*.swu); do
|
||||||
umount ${root_mount} >/dev/null 2>&1
|
notif "5/6 Erase update file"
|
||||||
|
rm -f "${file}"
|
||||||
|
done
|
||||||
|
notif "6/6 Unmount root filesystem"
|
||||||
|
umount ${root_mount}
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
notif "Cannot unmount root filesystem"
|
notif "Cannot unmount root filesystem"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
for file in /mnt/FunKey-*.swu; do
|
|
||||||
version=$(basename "${file}" .swu | cut -d '-' -f 2)
|
|
||||||
notif "6/7 Setting rootfs version to ${version}"
|
|
||||||
sed -i '/^rootfs/d' /etc/sw-versions
|
|
||||||
notif "7/7 Erase update file"
|
|
||||||
echo -e "rootfs\t${version}" >> /etc/sw-versions
|
|
||||||
rm -f "${file}"
|
|
||||||
done
|
|
||||||
exit 0
|
exit 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
2
Makefile
2
Makefile
@ -94,7 +94,7 @@ update: fun
|
|||||||
@cd tmp && \
|
@cd tmp && \
|
||||||
echo sw-description rootfs.ext2.gz update_partition | \
|
echo sw-description rootfs.ext2.gz update_partition | \
|
||||||
tr " " "\n" | \
|
tr " " "\n" | \
|
||||||
cpio -o -H crc --quiet > ../images/FunKey-$(shell cat FunKey/board/funkey/rootfs-overlay/etc/sw-versions | cut -f 2).swu
|
cpio -o -H crc --quiet > ../images/FunKey-rootfs-$(shell cat FunKey/board/funkey/rootfs-overlay/etc/sw-versions | cut -f 2).swu
|
||||||
@rm -rf tmp
|
@rm -rf tmp
|
||||||
|
|
||||||
defconfig:
|
defconfig:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user