@@ -9,35 +9,27 @@ root_mount=/tmp/rootfs
99
1010do_preinst ()
1111{
12- notif " 1/5 EXTRACT FIRMWARE UPDATE..^DO NOT TURN OFF THE CONSOLE"
12+ notif " 1/4 EXTRACT FIRMWARE UPDATE..^DO NOT TURN OFF THE CONSOLE"
1313 exit 0
1414}
1515
1616do_postinst ()
1717{
18- # ###############
19- # Fix recovery #
20- # ###############
21- notif " 2/5 FIX RECOVERY GPIO MANAGER"
22- rw
23- cp -a /tmp/funkey_gpio_management /usr/local/sbin/
24- chmod +x /usr/local/sbin/funkey_gpio_management
25- ro
26-
18+
2719 # ################
2820 # Resize Rootfs #
2921 # ################
30- notif " 3/5 RESIZE ROOT FILESYSTEM^DO NOT TURN OFF THE CONSOLE"
22+ notif " 2/4 RESIZE ROOT FILESYSTEM^DO NOT TURN OFF THE CONSOLE"
3123 resize2fs ${root_part}
3224 if [ $? -ne 0 ]; then
3325 notif " CANNOT RESIZE ROOT^FILESYSTEM"
3426 exit 1
3527 fi
3628
37- # ############
38- # Copy OPKs #
39- # ############
40- notif " 4/5 COPY OPKS TO USB MOUNT^DO NOT TURN OFF THE CONSOLE"
29+ # #############################
30+ # SHARED PARTITION PROCESSES #
31+ # #############################
32+ notif " 3/4 COPY OPKS TO USB MOUNT^DO NOT TURN OFF THE CONSOLE"
4133
4234 # Mount Rootfs
4335 mkdir -p ${root_mount}
@@ -48,12 +40,10 @@ do_postinst()
4840 fi
4941
5042 # Copy OPKs
51- shared_partition=/mnt/
52- mkdir -p " $shared_partition "
53- cp -r ${root_mount} /usr/local/share/OPKs/* " $shared_partition "
43+ cp -r ${root_mount} /usr/local/share/OPKs/* /mnt
5444
5545 # Fix PCE opk name if necessary
56- mv " $shared_partition " / Emulators/pce_mednaefn_funkey-s.opk " $shared_partition " /Emulators/pce_mednafen_funkey-s.opk 1> /dev/null 2>&1
46+ mv /mnt/ Emulators/pce_mednaefn_funkey-s.opk /mnt /Emulators/pce_mednafen_funkey-s.opk 1> /dev/null 2>&1
5747
5848 # Unmount Rootfs
5949 umount ${root_mount}
@@ -62,11 +52,21 @@ do_postinst()
6252 exit 1
6353 fi
6454
55+ # Change FunKey config files extension from .cfg to .fkcfg
56+ SAVEIFS=$IFS
57+ IFS=$( echo -en " \n\b" )
58+ for FOLDER in " Atari lynx" " Game Boy" " Game Boy Advance" " Game Boy Color" " Game Gear" " Neo Geo Pocket" " NES" " PCE-TurboGrafx" " PS1" " Sega Genesis" " Sega Master System" " SNES" " WonderSwan" ; do
59+ for FILE in $( ls /mnt/" ${FOLDER} " /* .cfg 2> /dev/null) ; do
60+ mv " $FILE " " ${FILE% .cfg} .fkcfg"
61+ done
62+ done
63+ IFS=$SAVEIFS
64+
6565 # ####################
6666 # Erase update file #
6767 # ####################
6868 for file in $( ls /mnt/FunKey-* .fwu) ; do
69- notif " 5/5 ERASE UPDATE FILE^DO NOT TURN OFF THE CONSOLE"
69+ notif " 4/4 ERASE UPDATE FILE^DO NOT TURN OFF THE CONSOLE"
7070 rm -f " ${file} "
7171 done
7272 exit 0
0 commit comments