put all notifs in uppercase

Signed-off-by: Michel-FK <michel.stempin@funkey-project.com>
This commit is contained in:
Michel-FK 2020-11-09 16:11:53 +01:00
parent 763e4c230c
commit 60f5e583ab
2 changed files with 38 additions and 41 deletions

View File

@ -17,28 +17,28 @@ do_postinst()
{ {
local version local version
notif "2/5 Resize root filesystem" notif "2/5 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" notif "3/5 MOUNT ROOT FILESYSTEM"
mkdir -p ${root_mount} mkdir -p ${root_mount}
mount -t ext4 ${root_part} ${root_mount} 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/5 Unmount root filesystem" notif "4/5 UNMOUNT ROOT FILESYSTEM"
touch "${root_mount}/.first_boot" touch "${root_mount}/.first_boot"
umount ${root_mount} 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 $(ls /mnt/FunKey-rootfs-*.fwu); do for file in $(ls /mnt/FunKey-rootfs-*.fwu); do
notif "5/5 Erase update file" notif "5/5 ERASE UPDATE FILE"
rm -f "${file}" rm -f "${file}"
done done
exit 0 exit 0
@ -48,15 +48,12 @@ echo $0 $1
case "$1" in case "$1" in
preinst) preinst)
notif "call do_preinst"
do_preinst do_preinst
;; ;;
postinst) postinst)
notif "call do_postinst"
do_postinst do_postinst
;; ;;
*) *)
notif "default"
exit 1 exit 1
;; ;;
esac esac

View File

@ -19,54 +19,54 @@ menu_display () {
# USB mount/unmount # USB mount/unmount
mount | grep -q /dev/mmcblk0p4 mount | grep -q /dev/mmcblk0p4
if [ $? -eq 0 ]; then if [ $? -eq 0 ]; then
message=" USB mount" message=" USB MOUNT"
else else
message=" USB unmount" message=" USB UNMOUNT"
fi fi
;; ;;
1) 1)
# USB check # USB check
message=" USB check" message=" USB CHECK"
;; ;;
2) 2)
# USB format # USB format
message=" USB format" message=" USB FORMAT"
;; ;;
3) 3)
# Network enable/disable # Network enable/disable
if [ -e /mnt/usbnet ]; then if [ -e /mnt/usbnet ]; then
message=" Network disable" message=" NETWORK DISABLE"
else else
message=" Network enable" message=" NETWORK ENABLE"
fi fi
;; ;;
4) 4)
# QR code # QR code
message=" QR code" message=" QR CODE"
;; ;;
5) 5)
# Factory tests enable/disable # Factory tests enable/disable
if [ -e /mnt/.assembly_tests ]; then if [ -e /mnt/.assembly_tests ]; then
message=" Factory tests disable" message=" FACTORY TESTS DISABLE"
else else
message=" Factory tests enable" message=" FACTORY TESTS ENABLE"
fi fi
;; ;;
6) 6)
# Exit Recovery # Exit Recovery
message=" Exit Recovery" message=" EXIT RECOVERY"
;; ;;
esac esac
notif "${message}" notif "${message}"
@ -85,25 +85,25 @@ menu_run () {
notif "${message}..." notif "${message}..."
share start share start
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
notif "${message}...^Cannot mount USB!" notif "${message}...^CANNOT MOUNT USB!"
else else
message=" USB unmount" message=" USB UNMOUNT"
notif "${message}" notif "${message}"
fi fi
else else
notif "${message}..." notif "${message}..."
share stop share stop
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
notif "${message}...^Cannot unmount USB!" notif "${message}...^CANNOT UNMOUNT USB!"
else else
for file in $(ls /mnt/FunKey-*.fwu); do for file in $(ls /mnt/FunKey-*.fwu); do
swupdate -i "${file}" swupdate -i "${file}"
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
notif "${message}...^Cannot update!" notif "${message}...^CANNOT UPDATE!"
break break
fi fi
done done
message=" USB mount" message=" USB MOUNT"
notif "${message}" notif "${message}"
fi fi
fi fi
@ -117,20 +117,20 @@ menu_run () {
notif "${message}..." notif "${message}..."
umount /mnt >/dev/null 2>&1 umount /mnt >/dev/null 2>&1
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
notif "${message}...^Cannot check USB!" notif "${message}...^CANNOT CHECK USB!"
fi fi
fsck.fat -a -v -w /dev/mmcblk0p4 fsck.fat -a -v -w /dev/mmcblk0p4
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
notif "${message}...^Cannot check USB!" notif "${message}...^CANNOT CHECK USB!"
fi fi
mount /mnt mount /mnt
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
notif "${message}...^Cannot check USB!" notif "${message}...^CANNOT CHECK USB!"
else else
notif "${message} done" notif "${message} DONE"
fi fi
else else
notif "${message}...^Cannot check USB when mounted!" notif "${message}...^CANNOT CHECK USB WHEN MOUNTED!"
fi fi
;; ;;
@ -139,7 +139,7 @@ menu_run () {
# USB format # USB format
mount | grep -q /dev/mmcblk0p4 mount | grep -q /dev/mmcblk0p4
if [ $? -eq 0 ]; then if [ $? -eq 0 ]; then
notif "${message}...^Press A to confirm" notif "${message}...^PRESS A TO CONFIRM"
while true; do while true; do
case $(getkey) in case $(getkey) in
1e0001|1e0002) 1e0001|1e0002)
@ -147,9 +147,9 @@ menu_run () {
mkfs.vfat /dev/mmcblk0p4 && mkfs.vfat /dev/mmcblk0p4 &&
mount /mnt mount /mnt
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
notif "${message}...^Cannot format USB!" notif "${message}...^CANNOT FORMAT USB!"
else else
notif "${message} done" notif "${message} DONE"
fi fi
break break
;; ;;
@ -158,13 +158,13 @@ menu_run () {
;; ;;
*) *)
notif "${message}...^Aborted!" notif "${message}...^ABORTED!"
break break
;; ;;
esac esac
done done
else else
notif "${message}...^Cannot format USB when mounted!" notif "${message}...^CANNOT FORMAT USB WHEN MOUNTED!"
fi fi
;; ;;
@ -175,14 +175,14 @@ menu_run () {
if [ $? -eq 0 ]; then if [ $? -eq 0 ]; then
if [ -e /mnt/usbnet ]; then if [ -e /mnt/usbnet ]; then
rm -f /mnt/usbnet rm -f /mnt/usbnet
message=" Network enable" message=" NETWORK ENABLE"
else else
touch /mnt/usbnet touch /mnt/usbnet
message=" Network disable" message=" NETWORK DISABLE"
fi fi
notif "${message}" notif "${message}"
else else
notif "${message}...^Cannot change net if mounted!" notif "${message}...^CANNOT CHANGE NET IF MOUNTED!"
fi fi
;; ;;
@ -200,14 +200,14 @@ menu_run () {
if [ $? -eq 0 ]; then if [ $? -eq 0 ]; then
if [ -e /mnt/.assembly_tests ]; then if [ -e /mnt/.assembly_tests ]; then
rm -f /mnt/.assembly_tests rm -f /mnt/.assembly_tests
message=" Factory tests enable" message=" FACTORY TESTS ENABLE"
else else
touch /mnt/.assembly_tests touch /mnt/.assembly_tests
message=" Factory tests disable" message=" FACTORY TESTS DISABLE"
fi fi
notif "${message}" notif "${message}"
else else
notif "${message}...^Cannot test if mounted!" notif "${message}...^CANNOT TEST IF MOUNTED!"
fi fi
;; ;;