]>
Commit | Line | Data |
---|---|---|
1ca3a01a JF |
1 | #!/bin/bash |
2 | ||
f641a0e5 JF |
3 | # XXX: FIX THIS!! |
4 | architecture=iphoneos-arm | |
1ca3a01a JF |
5 | version=$(sw_vers -productVersion) |
6 | ||
7 | if grep '^Package: firmware$' /var/lib/dpkg/status >/dev/null; then | |
36bb2ca2 | 8 | cat /var/lib/dpkg/status | while IFS= read -r line; do |
1ca3a01a JF |
9 | if [[ ${line} == 'Package: firmware' ]]; then |
10 | firmware= | |
11 | elif [[ ${line} == '' ]]; then | |
12 | unset firmware | |
f641a0e5 JF |
13 | elif [[ ${line} == Architecture:* && "${firmware+@}" ]]; then |
14 | echo "Architecture: ${architecture}" | |
15 | continue | |
1ca3a01a JF |
16 | elif [[ ${line} == Version:* && "${firmware+@}" ]]; then |
17 | echo "Version: ${version}" | |
18 | continue | |
19 | fi | |
20 | ||
21 | echo "${line}" | |
22 | done >/var/lib/dpkg/status_ | |
23 | else | |
24 | cat /var/lib/dpkg/status - >/var/lib/dpkg/status_ <<EOF | |
25 | Package: firmware | |
26 | Essential: yes | |
27 | Status: install ok installed | |
28 | Priority: required | |
29 | Section: System | |
30 | Installed-Size: 0 | |
31 | Maintainer: Jay Freeman (saurik) <saurik@saurik.com> | |
f641a0e5 | 32 | Architecture: ${architecture} |
1ca3a01a JF |
33 | Version: ${version} |
34 | Description: almost impressive Apple frameworks | |
b88731cd | 35 | Name: iPhone Firmware |
1ca3a01a JF |
36 | |
37 | EOF | |
38 | fi && mv -f /var/lib/dpkg/status{_,} | |
39 | ||
fda0e863 JF |
40 | echo "/." >/var/lib/dpkg/info/firmware.list |
41 | ||
1ca3a01a JF |
42 | if [[ ${version} = 1.0* || ${version} = 1.1.[012] ]]; then |
43 | user=root | |
44 | else | |
45 | user=mobile | |
46 | fi | |
47 | ||
48 | if [[ ! -h /User && -d /User ]]; then | |
49 | cp -afT /User /var/"${user}" | |
50 | fi && rm -rf /User && ln -s "/var/${user}" /User |