mirror of
https://github.com/FunKey-Project/FunKey-OS.git
synced 2025-12-12 15:48:51 +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
|
# Stuff to do before rebooting
|
||||||
::shutdown:/etc/init.d/rcK
|
::shutdown:/etc/init.d/rcK
|
||||||
::shutdown:/sbin/swapoff -a
|
::shutdown:/sbin/swapoff -a
|
||||||
#::shutdown:/bin/umount -a -r
|
|
||||||
::shutdown:/bin/umount -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()
|
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
|
||||||
|
|||||||
@ -38,4 +38,5 @@ null::sysinit:/bin/ln -sf /proc/self/fd/2 /dev/stderr
|
|||||||
|
|
||||||
# Stuff to do before rebooting
|
# Stuff to do before rebooting
|
||||||
::shutdown:/etc/init.d/rcK
|
::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
|
case ${entry} in
|
||||||
0)
|
0)
|
||||||
|
|
||||||
|
# Version
|
||||||
|
message=" VERSION"
|
||||||
|
;;
|
||||||
|
|
||||||
|
1)
|
||||||
# USB mount/unmount
|
# USB mount/unmount
|
||||||
mount | grep -q /dev/mmcblk0p4
|
mount | grep -q /dev/mmcblk0p4
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
@ -25,19 +30,19 @@ menu_display () {
|
|||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
|
|
||||||
1)
|
2)
|
||||||
|
|
||||||
# USB check
|
# USB check
|
||||||
message=" USB CHECK"
|
message=" USB CHECK"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
2)
|
3)
|
||||||
|
|
||||||
# USB format
|
# USB format
|
||||||
message=" USB FORMAT"
|
message=" USB FORMAT"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
3)
|
4)
|
||||||
|
|
||||||
# Network enable/disable
|
# Network enable/disable
|
||||||
if [ -e /mnt/usbnet ]; then
|
if [ -e /mnt/usbnet ]; then
|
||||||
@ -47,13 +52,13 @@ menu_display () {
|
|||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
|
|
||||||
4)
|
5)
|
||||||
|
|
||||||
# QR code
|
# QR code
|
||||||
message=" QR CODE"
|
message=" QR CODE"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
5)
|
6)
|
||||||
|
|
||||||
# Factory tests enable/disable
|
# Factory tests enable/disable
|
||||||
if [ -e /mnt/.assembly_tests ]; then
|
if [ -e /mnt/.assembly_tests ]; then
|
||||||
@ -63,7 +68,7 @@ menu_display () {
|
|||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
|
|
||||||
6)
|
7)
|
||||||
|
|
||||||
# Exit Recovery
|
# Exit Recovery
|
||||||
message=" EXIT RECOVERY"
|
message=" EXIT RECOVERY"
|
||||||
@ -79,6 +84,22 @@ menu_run () {
|
|||||||
case ${entry} in
|
case ${entry} in
|
||||||
0)
|
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
|
# USB mount/unmount
|
||||||
mount | grep -q /dev/mmcblk0p4
|
mount | grep -q /dev/mmcblk0p4
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
@ -109,7 +130,7 @@ menu_run () {
|
|||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
|
|
||||||
1)
|
2)
|
||||||
|
|
||||||
# USB check
|
# USB check
|
||||||
mount | grep -q /dev/mmcblk0p4
|
mount | grep -q /dev/mmcblk0p4
|
||||||
@ -134,7 +155,7 @@ menu_run () {
|
|||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
|
|
||||||
2)
|
3)
|
||||||
|
|
||||||
# USB format
|
# USB format
|
||||||
mount | grep -q /dev/mmcblk0p4
|
mount | grep -q /dev/mmcblk0p4
|
||||||
@ -168,7 +189,7 @@ menu_run () {
|
|||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
|
|
||||||
3)
|
4)
|
||||||
|
|
||||||
# Network enable/disable
|
# Network enable/disable
|
||||||
mount | grep -q /dev/mmcblk0p4
|
mount | grep -q /dev/mmcblk0p4
|
||||||
@ -186,14 +207,14 @@ menu_run () {
|
|||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
|
|
||||||
4)
|
5)
|
||||||
|
|
||||||
# QR code
|
# QR code
|
||||||
qrencode -o /tmp/qrcode.png "https://www.funkey-project.com/_functions/qrcode/$(get_sid)"
|
qrencode -o /tmp/qrcode.png "https://www.funkey-project.com/_functions/qrcode/$(get_sid)"
|
||||||
fbv -e /tmp/qrcode.png -d 1
|
fbv -e /tmp/qrcode.png -d 1
|
||||||
;;
|
;;
|
||||||
|
|
||||||
5)
|
6)
|
||||||
|
|
||||||
# Factory tests enable/disable
|
# Factory tests enable/disable
|
||||||
mount | grep -q /dev/mmcblk0p4
|
mount | grep -q /dev/mmcblk0p4
|
||||||
@ -211,7 +232,7 @@ menu_run () {
|
|||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
|
|
||||||
6)
|
7)
|
||||||
notif "^^^^^^^^ RESTARTING...^^^^^^^^"
|
notif "^^^^^^^^ RESTARTING...^^^^^^^^"
|
||||||
normal_mode
|
normal_mode
|
||||||
;;
|
;;
|
||||||
@ -231,9 +252,9 @@ while true; do
|
|||||||
|
|
||||||
# Key UP pressed or repeat
|
# Key UP pressed or repeat
|
||||||
let entry=${entry}-1
|
let entry=${entry}-1
|
||||||
let entry=${entry}%7
|
let entry=${entry}%8
|
||||||
if [ ${entry} -eq -1 ]; then
|
if [ ${entry} -eq -1 ]; then
|
||||||
entry=6
|
entry=7
|
||||||
fi
|
fi
|
||||||
menu_display ${entry}
|
menu_display ${entry}
|
||||||
;;
|
;;
|
||||||
@ -242,7 +263,7 @@ while true; do
|
|||||||
|
|
||||||
# Key DOWN pressed or repeat
|
# Key DOWN pressed or repeat
|
||||||
let entry=${entry}+1
|
let entry=${entry}+1
|
||||||
let entry=${entry}%7
|
let entry=${entry}%8
|
||||||
menu_display ${entry}
|
menu_display ${entry}
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user