This repository has been archived by the owner on Aug 2, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathupdate_odb.sh
executable file
·129 lines (115 loc) · 4.69 KB
/
update_odb.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
#!/bin/sh
VERSION=`cat v`
INSTALL_CONF=false
INSTALL_UNOFF=false
# Screen determination
if grep -q "640x480" /sys/devices/platform/13050000.lcd-controller/graphics/fb0/modes; then
MODEL="RG350M"
else
MODEL="RG350P"
fi
export DIALOGOPTS="--colors --backtitle \"RetroArch installer v${VERSION}\""
echo "screen_color = (RED,RED,ON)" > /tmp/dialog_err.rc
TEXTO="
Choose if you want to install preset configurations of cores (if you have an old installation and made changes, they will be overwritten) and if you want to install unofficial cores.
Use \Zb\Z3X\Zn control to check options and \Zb\Z3OK\Zn to proceed with installation."
# Ask options
result=$(dialog --stdout --title "RA Installer config" --checklist "$TEXTO" 0 0 0 1 "Install config" off 2 "Install unofficial cores" off)
if [ $? -eq 1 ] ; then
exit 1
fi
if echo $result|grep -q "1"; then
INSTALL_CONF=true
fi
if echo $result|grep -q "2"; then
INSTALL_UNOFF=true
fi
clear
echo "Installing cores, please wait (about 1 minute)..."
sleep 5
# Copying retroarch icon to all GMenu2X skins
if [[ "$MODEL" == "RG350P" ]] ; then
for filename in /usr/share/gmenu2x/skins/320x240/*; do
skin=`basename $filename`
mkdir -p "/media/data/local/home/.gmenu2x/skins/320x240/${skin}/sections"
done
for filename in /media/data/local/home/.gmenu2x/skins/320x240/*; do
skin=`basename $filename`
mkdir -p "/media/data/local/home/.gmenu2x/skins/320x240/${skin}/sections"
if [[ "$skin" == "Pixel" ]] ; then
cp -f files_odb/retroarch_pixel.png "/media/data/local/home/.gmenu2x/skins/320x240/${skin}/sections/retroarch.png"
else
cp -f files_odb/retroarch.png "/media/data/local/home/.gmenu2x/skins/320x240/${skin}/sections"
fi
done
fi
if [[ "$MODEL" == "RG350M" ]] ; then
for filename in /usr/share/gmenu2x/skins/640x480/*; do
skin=`basename $filename`
mkdir -p "/media/data/local/home/.gmenu2x/skins/640x480/${skin}/sections"
done
for filename in /media/data/local/home/.gmenu2x/skins/640x480/*; do
skin=`basename $filename`
mkdir -p "/media/data/local/home/.gmenu2x/skins/640x480/${skin}/sections"
if [[ "$skin" == "Pixel" ]] ; then
cp -f files_odb/retroarch_pixel.png "/media/data/local/home/.gmenu2x/skins/640x480/${skin}/sections/retroarch.png"
else
cp -f files_odb/retroarch.png "/media/data/local/home/.gmenu2x/skins/640x480/${skin}/sections"
fi
done
fi
# Installing OPK and executable
cp -f files_odb/retroarch_rg350_odbeta.opk /media/data/apps
if [ -f /media/data/local/bin/retroarch ] ; then
rm /media/data/local/bin/retroarch
fi
if [ -f /media/data/local/bin ] ; then
rm /media/data/local/bin
fi
if [ ! -d /media/data/local/bin ] ; then
mkdir /media/data/local/bin
fi
cp -f files_odb/retroarch_rg350_odbeta /media/data/local/bin
# Installing OPK wrappers for cores
tar -xzf files_odb/apps_ra.tgz -C /media/data/apps
# Installing home files
mkdir -p /media/data/local/home/.retroarch
tar -xzf files_odb/retroarch.tgz -C /media/data/local/home/.retroarch
# Installing GMenu2X links
mkdir -p /media/data/local/home/.gmenu2x/sections/retroarch
tar -xzf files_odb/links.tgz -C /media/data/local/home/.gmenu2x/sections/retroarch
# Installing BIOS?
if [ -f bios.tgz ] ; then
tar -xzf bios.tgz -C /media/data/local/home/.retroarch/system
fi
sync
echo " DONE"
if [ ${INSTALL_CONF} = true ] ; then
echo "Installing configs, please wait..."
sleep 5
# Installing configs
if [[ "$MODEL" == "RG350P" ]] ; then
tar -xzf files_odb/configs_P.tgz -C /media/data/local/home/.retroarch
fi
if [[ "$MODEL" == "RG350M" ]] ; then
tar -xzf files_odb/configs_M.tgz -C /media/data/local/home/.retroarch
fi
sync
echo " DONE"
fi
if [ ${INSTALL_UNOFF} = true ] ; then
echo "Installing unofficial cores, please wait..."
sleep 5
tar -xzf files_odb/odbeta_cores_unoff.tgz -C /media/data/local/home/.retroarch/cores
tar -xzf files_odb/configs_unoff_new.tgz -C /media/data/local/home/.retroarch/config
tar -xzf files_odb/apps_unoff.tgz -C /media/data/apps
tar -xzf files_odb/links_unoff.tgz -C /media/data/local/home/.gmenu2x/sections/retroarch
if [ ${INSTALL_CONF} = true ] ; then
tar -xzf files_odb/configs_unoff.tgz -C /media/data/local/home/.retroarch/config
fi
sync
echo " DONE"
fi
sleep 3
dialog --msgbox "Installation completed!\n\nRemember that following cores need BIOS files to run (LYNX, PC ENGINE CD, SEGA CD, VIDEOPAC, CHANNELF, ATARI ST, AMIGA, BK) or data files (DOOM, QUAKE, OUTRUN, CAVESTORY, FLASHBACK).\n\nNow we are going to reboot. After pressing \Zb\Z3OK\Zn, let the console reboot itself, don't force it manually." 16 0
reboot