@@ -9,35 +9,27 @@ root_mount=/tmp/rootfs
9
9
10
10
do_preinst ()
11
11
{
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"
13
13
exit 0
14
14
}
15
15
16
16
do_postinst ()
17
17
{
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
+
27
19
# ################
28
20
# Resize Rootfs #
29
21
# ################
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"
31
23
resize2fs ${root_part}
32
24
if [ $? -ne 0 ]; then
33
25
notif " CANNOT RESIZE ROOT^FILESYSTEM"
34
26
exit 1
35
27
fi
36
28
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"
41
33
42
34
# Mount Rootfs
43
35
mkdir -p ${root_mount}
@@ -48,12 +40,10 @@ do_postinst()
48
40
fi
49
41
50
42
# 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
54
44
55
45
# 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
57
47
58
48
# Unmount Rootfs
59
49
umount ${root_mount}
@@ -62,11 +52,21 @@ do_postinst()
62
52
exit 1
63
53
fi
64
54
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
+
65
65
# ####################
66
66
# Erase update file #
67
67
# ####################
68
68
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"
70
70
rm -f " ${file} "
71
71
done
72
72
exit 0
0 commit comments