From de0dbbab58b40c0b4a2ce2b420acffb4a643f1c3 Mon Sep 17 00:00:00 2001 From: "Jay Freeman (saurik)" Date: Sun, 2 Mar 2008 10:54:28 +0000 Subject: [PATCH] Added firmware management scripts. --- Library/com.saurik.Cydia.Firmware | 12 +++++++++ Library/firmware.sh | 43 +++++++++++++++++++++++++++++++ 2 files changed, 55 insertions(+) create mode 100644 Library/com.saurik.Cydia.Firmware create mode 100755 Library/firmware.sh diff --git a/Library/com.saurik.Cydia.Firmware b/Library/com.saurik.Cydia.Firmware new file mode 100644 index 00000000..6fdcf33e --- /dev/null +++ b/Library/com.saurik.Cydia.Firmware @@ -0,0 +1,12 @@ + + + + + Label + com.saurik.Cydia.Firmware + Program + /usr/libexec/cydia/firmware.sh + RunAtLoad + + + diff --git a/Library/firmware.sh b/Library/firmware.sh new file mode 100755 index 00000000..e0ef0ab8 --- /dev/null +++ b/Library/firmware.sh @@ -0,0 +1,43 @@ +#!/bin/bash + +version=$(sw_vers -productVersion) + +if grep '^Package: firmware$' /var/lib/dpkg/status >/dev/null; then + cat /var/lib/dpkg/status | while read -r line; do + if [[ ${line} == 'Package: firmware' ]]; then + firmware= + elif [[ ${line} == '' ]]; then + unset firmware + elif [[ ${line} == Version:* && "${firmware+@}" ]]; then + echo "Version: ${version}" + continue + fi + + echo "${line}" + done >/var/lib/dpkg/status_ +else + cat /var/lib/dpkg/status - >/var/lib/dpkg/status_ < +Architecture: darwin-arm +Version: ${version} +Description: almost impressive Apple frameworks +Name: Apple iPhone Firmware + +EOF +fi && mv -f /var/lib/dpkg/status{_,} + +if [[ ${version} = 1.0* || ${version} = 1.1.[012] ]]; then + user=root +else + user=mobile +fi + +if [[ ! -h /User && -d /User ]]; then + cp -afT /User /var/"${user}" +fi && rm -rf /User && ln -s "/var/${user}" /User -- 2.45.2