blob: 156f711ce01993e144196b118e275ffdd80fbd5e (
plain)
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
|
checkUsbStorage(){
local trigger="/sys/bus/platform/devices/sunxi_hcd_host0/otg_ed_test"
local disk="/dev/sda1"
if [ -f "$trigger" ]; then
echo "1" > "$trigger"
local timeout=5
while [ $timeout -gt 0 ] && ! [ -b "$disk" ]; do
echo "waiting for media $timeout"
let timeout=timeout-1
sleep 1
done
fi
[ -b "$disk" ] || return 1
local ro="defaults,nosuid,nodev,noatime,ro"
local rw="defaults,nosuid,nodev,noatime,rw"
mount -o $ro "$disk" "$mountpoint/media" || return 1
local saves="$modname/saves"
if [ -d "$mountpoint/media/$saves" ]; then
mount -o remount,$rw "$disk"
mount_bind "$mountpoint/media/$saves" "$mountpoint/var/lib/clover/profiles/0"
fi
return 0
}
checkUsbGamepath(){
local disk="/dev/sda1"
[ -b "$disk" ] || return 1
local games="$modname/games"
if containsGames "$mountpoint/media/$games"; then
if ! mkdir -p "$rootfs$gamepath"; then
rm -rf "$rootfs$gamepath"
mkdir -p "$rootfs$gamepath" || return 1
fi
mount_bind "$mountpoint/media/$games" "$rootfs$gamepath"
return 0
else
echo "no romz found at: $disk:/$games"
return 1
fi
}
|