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