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