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