mirror of
https://github.com/FunKey-Project/FunKey-OS.git
synced 2025-12-12 07:38:50 +01:00
Merge branch 'master' of github.com:FunKey-Project/FunKey-OS
This commit is contained in:
commit
9bbd7f5557
@ -40,6 +40,5 @@ null::sysinit:/bin/ln -sf /proc/self/fd/2 /dev/stderr
|
||||
# Stuff to do before rebooting
|
||||
::shutdown:/etc/init.d/rcK
|
||||
::shutdown:/sbin/swapoff -a
|
||||
#::shutdown:/bin/umount -a -r
|
||||
::shutdown:/bin/umount -r /
|
||||
::shutdown:/bin/umount -r /mnt
|
||||
::shutdown:/bin/umount -r /mnt
|
||||
|
||||
@ -9,7 +9,7 @@ root_mount=/tmp/rootfs
|
||||
|
||||
do_preinst()
|
||||
{
|
||||
notif "1/5 Extract firmware update..."
|
||||
notif " 1/3 EXTRACT FIRMWARE UPDATE.."
|
||||
exit 0
|
||||
}
|
||||
|
||||
@ -17,28 +17,14 @@ do_postinst()
|
||||
{
|
||||
local version
|
||||
|
||||
notif "2/5 RESIZE ROOT FILESYSTEM"
|
||||
notif " 2/3 RESIZE ROOT FILESYSTEM"
|
||||
resize2fs ${root_part}
|
||||
if [ $? -ne 0 ]; then
|
||||
notif "CANNOT RESIZE ROOT FILESYSTEM"
|
||||
exit 1
|
||||
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
|
||||
notif "5/5 ERASE UPDATE FILE"
|
||||
notif "3/3 ERASE UPDATE FILE"
|
||||
rm -f "${file}"
|
||||
done
|
||||
exit 0
|
||||
|
||||
@ -38,4 +38,5 @@ null::sysinit:/bin/ln -sf /proc/self/fd/2 /dev/stderr
|
||||
|
||||
# Stuff to do before rebooting
|
||||
::shutdown:/etc/init.d/rcK
|
||||
::shutdown:/bin/umount -a -r
|
||||
::shutdown:/bin/umount -r /
|
||||
::shutdown:/bin/umount -r /mnt
|
||||
|
||||
@ -16,6 +16,11 @@ menu_display () {
|
||||
case ${entry} in
|
||||
0)
|
||||
|
||||
# Version
|
||||
message=" VERSION"
|
||||
;;
|
||||
|
||||
1)
|
||||
# USB mount/unmount
|
||||
mount | grep -q /dev/mmcblk0p4
|
||||
if [ $? -eq 0 ]; then
|
||||
@ -25,19 +30,19 @@ menu_display () {
|
||||
fi
|
||||
;;
|
||||
|
||||
1)
|
||||
2)
|
||||
|
||||
# USB check
|
||||
message=" USB CHECK"
|
||||
;;
|
||||
|
||||
2)
|
||||
3)
|
||||
|
||||
# USB format
|
||||
message=" USB FORMAT"
|
||||
;;
|
||||
|
||||
3)
|
||||
4)
|
||||
|
||||
# Network enable/disable
|
||||
if [ -e /mnt/usbnet ]; then
|
||||
@ -47,13 +52,13 @@ menu_display () {
|
||||
fi
|
||||
;;
|
||||
|
||||
4)
|
||||
5)
|
||||
|
||||
# QR code
|
||||
message=" QR CODE"
|
||||
;;
|
||||
|
||||
5)
|
||||
6)
|
||||
|
||||
# Factory tests enable/disable
|
||||
if [ -e /mnt/.assembly_tests ]; then
|
||||
@ -63,7 +68,7 @@ menu_display () {
|
||||
fi
|
||||
;;
|
||||
|
||||
6)
|
||||
7)
|
||||
|
||||
# Exit Recovery
|
||||
message=" EXIT RECOVERY"
|
||||
@ -79,6 +84,22 @@ menu_run () {
|
||||
case ${entry} in
|
||||
0)
|
||||
|
||||
# Version
|
||||
rootfs_mount=/tmp/rootfs
|
||||
mkdir -p ${rootfs_mount}
|
||||
mount -t ext4 -o ro /dev/mmcblk0p2 ${rootfs_mount}
|
||||
if [ $? -ne 0 ]; then
|
||||
version_rootfs="???"
|
||||
else
|
||||
version_rootfs=$(grep rootfs ${rootfs_mount}/etc/sw-versions | cut -f 2)
|
||||
fi
|
||||
umount ${mount_rootfs}
|
||||
version_recovery=$(grep Recovery /etc/sw-versions | cut -f 2)
|
||||
notif "${message}^^ Recovery: ${version_recovery}^ rootfs : ${version_rootfs}"
|
||||
;;
|
||||
|
||||
1)
|
||||
|
||||
# USB mount/unmount
|
||||
mount | grep -q /dev/mmcblk0p4
|
||||
if [ $? -eq 0 ]; then
|
||||
@ -109,7 +130,7 @@ menu_run () {
|
||||
fi
|
||||
;;
|
||||
|
||||
1)
|
||||
2)
|
||||
|
||||
# USB check
|
||||
mount | grep -q /dev/mmcblk0p4
|
||||
@ -134,7 +155,7 @@ menu_run () {
|
||||
fi
|
||||
;;
|
||||
|
||||
2)
|
||||
3)
|
||||
|
||||
# USB format
|
||||
mount | grep -q /dev/mmcblk0p4
|
||||
@ -168,7 +189,7 @@ menu_run () {
|
||||
fi
|
||||
;;
|
||||
|
||||
3)
|
||||
4)
|
||||
|
||||
# Network enable/disable
|
||||
mount | grep -q /dev/mmcblk0p4
|
||||
@ -186,14 +207,14 @@ menu_run () {
|
||||
fi
|
||||
;;
|
||||
|
||||
4)
|
||||
5)
|
||||
|
||||
# QR code
|
||||
qrencode -o /tmp/qrcode.png "https://www.funkey-project.com/_functions/qrcode/$(get_sid)"
|
||||
fbv -e /tmp/qrcode.png -d 1
|
||||
;;
|
||||
|
||||
5)
|
||||
6)
|
||||
|
||||
# Factory tests enable/disable
|
||||
mount | grep -q /dev/mmcblk0p4
|
||||
@ -211,7 +232,7 @@ menu_run () {
|
||||
fi
|
||||
;;
|
||||
|
||||
6)
|
||||
7)
|
||||
notif "^^^^^^^^ RESTARTING...^^^^^^^^"
|
||||
normal_mode
|
||||
;;
|
||||
@ -231,9 +252,9 @@ while true; do
|
||||
|
||||
# Key UP pressed or repeat
|
||||
let entry=${entry}-1
|
||||
let entry=${entry}%7
|
||||
let entry=${entry}%8
|
||||
if [ ${entry} -eq -1 ]; then
|
||||
entry=6
|
||||
entry=7
|
||||
fi
|
||||
menu_display ${entry}
|
||||
;;
|
||||
@ -242,7 +263,7 @@ while true; do
|
||||
|
||||
# Key DOWN pressed or repeat
|
||||
let entry=${entry}+1
|
||||
let entry=${entry}%7
|
||||
let entry=${entry}%8
|
||||
menu_display ${entry}
|
||||
;;
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user