-
Notifications
You must be signed in to change notification settings - Fork 36
/
Copy pathmount_fs
executable file
·40 lines (33 loc) · 1.06 KB
/
mount_fs
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
#!/bin/bash
source common
if test $UID -ne 0; then
error "You need to be root to run this script."
exit 1
fi
if [[ $OSTYPE == darwin* ]]; then
image="$out_dir"/decrypted.dmg
if ! test -f "$image"; then
error "There is no disk image file in $out_dir"
error "Make sure you unpacked the contents of an .ipsw file and you have unpacked/decrypted the disk image file."
exit 1
fi
else
image="$out_dir"/rootfs.img
if ! test -f "$image"; then
error "There is no rootfs image file in $out_dir"
error "Make sure you unpacked the contents of an .ipsw file and you have unpacked/decrypted the rootfs image file."
exit 1
fi
fi
mount_point="$MOUNT_DIR"/ios/"$base"
mkdir -p "$mount_point"
mount_point=$(realpath "$mount_point")
if mount | grep -qs "$mount_point"; then
error "A volume is already mounted in $mount_point"
error "Unmount it first from $mount_point"
exit 1
fi
debug "Change working directory to bin/"
cd ../bin
debug "./mount_fs $image $mount_point"
./mount_fs "$image" "$mount_point"