mirror of
https://github.com/FunKey-Project/FunKey-OS.git
synced 2025-12-12 15:48:51 +01:00
no more .first_boot file needed
This commit is contained in:
parent
6a3a020402
commit
d26d17c1d5
@ -4,8 +4,19 @@ THIS=$(basename $0)
|
|||||||
|
|
||||||
case "$1" in
|
case "$1" in
|
||||||
start)
|
start)
|
||||||
if [ ! -f /.first_boot ]; then
|
|
||||||
|
# Check is SWAP partition already created
|
||||||
|
sgdisk /dev/mmcblk0 | grep swap
|
||||||
|
if [ $? -ne 0 ]; then
|
||||||
|
first_boot
|
||||||
|
exit $?
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Check is share partition already created
|
||||||
|
sgdisk /dev/mmcblk0 | grep share
|
||||||
|
if [ $? -eq 0 ]; then
|
||||||
first_boot
|
first_boot
|
||||||
|
exit $?
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
stop)
|
stop)
|
||||||
|
|||||||
@ -169,8 +169,6 @@ notif " 9/9 COPY FILES TO ^ USB PARTITION"
|
|||||||
copy_files_to_store_partition
|
copy_files_to_store_partition
|
||||||
|
|
||||||
notif " FIRST BOOT SETUP FINISHED!"
|
notif " FIRST BOOT SETUP FINISHED!"
|
||||||
rw
|
|
||||||
touch /.first_boot
|
|
||||||
ro
|
|
||||||
sleep 1
|
sleep 1
|
||||||
clear_notif
|
clear_notif
|
||||||
|
|||||||
@ -48,7 +48,7 @@ mount_share () {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Create the directory structure if required
|
# Create the directory structure if required
|
||||||
(cd /mnt; mkdir -p "Atari lynx" "Game Boy" "Game Boy Color" "Game Boy Advance" "Game Gear" "Neo Geo Pocket" "NES" "PS1" "Sega Genesis" "Sega Master System" "SNES" "WonderSwan" "PCE-TurboGrafx")
|
(cd /mnt; mkdir -p "Atari lynx" "Game Boy" "Game Boy Color" "Game Boy Advance" "Game Gear" "Neo Geo Pocket" "NES" "PS1" "PS1/bios" "Sega Genesis" "Sega Master System" "SNES" "WonderSwan" "PCE-TurboGrafx")
|
||||||
|
|
||||||
# Check if there is a firmware update file
|
# Check if there is a firmware update file
|
||||||
if [ -f /mnt/FunKey-*.fwu ]; then
|
if [ -f /mnt/FunKey-*.fwu ]; then
|
||||||
|
|||||||
@ -9,44 +9,21 @@ root_mount=/tmp/rootfs
|
|||||||
|
|
||||||
do_preinst()
|
do_preinst()
|
||||||
{
|
{
|
||||||
notif " 1/5 EXTRACT FIRMWARE UPDATE.."
|
notif " 1/3 EXTRACT FIRMWARE UPDATE..^DO NOT TURN OFF THE CONSOLE"
|
||||||
exit 0
|
exit 0
|
||||||
}
|
}
|
||||||
|
|
||||||
do_postinst()
|
do_postinst()
|
||||||
{
|
{
|
||||||
local version
|
notif " 2/3 RESIZE ROOT FILESYSTEM^DO NOT TURN OFF THE CONSOLE"
|
||||||
|
|
||||||
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"
|
for file in $(ls /mnt/FunKey-*.fwu); do
|
||||||
mkdir -p ${root_mount}
|
notif " 3/3 ERASE UPDATE FILE^DO NOT TURN OFF THE CONSOLE"
|
||||||
mount -t ext4 ${root_part} ${root_mount}
|
rm -f "${file}"
|
||||||
if [ $? -ne 0 ]; then
|
|
||||||
notif "CANNOT MOUNT ROOT FILESYSTEM"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
sgdisk /dev/mmcblk0 | grep swap
|
|
||||||
if [ $? -eq 0 ]; then
|
|
||||||
sgdisk /dev/mmcblk0 | grep share
|
|
||||||
if [ $? -eq 0 ]; then
|
|
||||||
touch $[root_mount]/.first_boot
|
|
||||||
fi
|
|
||||||
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"
|
|
||||||
rm -f "${file}"
|
|
||||||
done
|
done
|
||||||
exit 0
|
exit 0
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user