From 6b964b69935fcc52a1c0a95695ca436e00b6690f Mon Sep 17 00:00:00 2001 From: Jay Freeman Date: Thu, 14 Feb 2008 14:32:59 +0000 Subject: Drastically reworked bootstrap package. git-svn-id: http://svn.telesphoreo.org/trunk@88 514c082c-b64e-11dc-b46d-3d985efe055d --- bootstrap.sh | 22 +++++++++++++++++-- construct.sh | 2 +- data/base/base-1.tgz | Bin 1208 -> 0 bytes data/base/base.tgz | Bin 0 -> 1229 bytes data/base/make.sh | 2 +- data/cydia/install.sh | 37 -------------------------------- data/cydia/make.sh | 6 ------ data/cydia/symlink.c | 7 ------ data/libarmfp/_metadata/description | 1 + data/libarmfp/_metadata/maintainer | 1 + data/libarmfp/_metadata/priority | 1 + data/libarmfp/_metadata/section | 1 + data/libarmfp/_metadata/version | 1 + data/libarmfp/libarmfp.dylib | Bin 0 -> 8704 bytes data/libarmfp/make.sh | 2 ++ data/saurik/make.sh | 2 ++ over/usr/libexec/cydia/boot/godmode | Bin 0 -> 8956 bytes over/usr/libexec/cydia/boot/install.sh | 38 +++++++++++++++++++++++++++++++++ tool/godmode.c | 8 +++++++ tool/symlink.c | 7 ++++++ util/configure.sh | 6 +++++- 21 files changed, 89 insertions(+), 55 deletions(-) delete mode 100644 data/base/base-1.tgz create mode 100644 data/base/base.tgz delete mode 100755 data/cydia/install.sh delete mode 100644 data/cydia/symlink.c create mode 100644 data/libarmfp/_metadata/description create mode 120000 data/libarmfp/_metadata/maintainer create mode 100644 data/libarmfp/_metadata/priority create mode 100644 data/libarmfp/_metadata/section create mode 100644 data/libarmfp/_metadata/version create mode 100755 data/libarmfp/libarmfp.dylib create mode 100644 data/libarmfp/make.sh create mode 100644 data/saurik/make.sh create mode 100755 over/usr/libexec/cydia/boot/godmode create mode 100755 over/usr/libexec/cydia/boot/install.sh create mode 100644 tool/godmode.c create mode 100644 tool/symlink.c diff --git a/bootstrap.sh b/bootstrap.sh index e014e820b..0033e56ad 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -8,9 +8,13 @@ export PKG_BOOT=${PKG_BASE}/Packager rm -rf "${PKG_BOOT}" svn export "${PKG_BASE}/over" "${PKG_BOOT}" +arm-apple-darwin-gcc -o "${PKG_BOOT}/usr/libexec/cydia_/godmode" "${PKG_BASE}/tool/godmode.c" +arm-apple-darwin-gcc -o "${PKG_BOOT}/usr/libexec/cydia_/symlink" "${PKG_BASE}/tool/symlink.c" +chmod +s "${PKG_BOOT}/usr/libexec/cydia_/godmode" + mkdir -p "${PKG_BOOT}/var/lib/dpkg/info" -PKG_REQS=(adv-cmds base bash coreutils cydia gawk grep inetutils nano network-cmds nvi saurik sed shell-cmds system-cmds unzip zip) +PKG_REQS=(adv-cmds base bash coreutils cydia gawk grep inetutils less libarmfp nano network-cmds saurik sed shell-cmds system-cmds unzip zip) cd "${PKG_BASE}/data" PKG_REQS=($(find -L "${PKG_REQS[@]}" | while read -r line; do realpath "${line}"; done | grep "/home/saurik/telesphoreo/data/[^/]*$" | sed -e 's/.*\///' | sort -u)) @@ -37,10 +41,24 @@ cd "${PKG_BOOT}" rm -f ../Packager.xml find * -type l -print -o -name "terminfo" -prune | while read -r link; do - echo "Exec/bin/ln -fs $(readlink "${link}") /${link}" + echo "Exec/usr/libexec/cydia/symlink $(readlink "${link}") /${link}" rm -f "${link}" done >>../Packager.xml +mkdir -p usr/libexec/cydia/boot + +cp -a bin/bash usr/libexec/cydia/boot +cp -a bin/df usr/libexec/cydia/boot +cp -a bin/ln usr/libexec/cydia/boot +cp -a bin/mktemp usr/libexec/cydia/boot +cp -a bin/mv usr/libexec/cydia/boot +cp -a usr/bin/basename usr/libexec/cydia/boot +cp -a usr/bin/du usr/libexec/cydia/boot +cp -a usr/lib/libhistory.5.2.dylib usr/libexec/cydia/boot +cp -a usr/lib/libintl.8.0.2.dylib usr/libexec/cydia/boot +cp -a usr/lib/libncurses.5.dylib usr/libexec/cydia/boot +cp -a usr/lib/libreadline.5.2.dylib usr/libexec/cydia/boot + rm -f ../Packager.zip zip -qry ../Packager.zip * rm -rf "${PKG_BOOT}" diff --git a/construct.sh b/construct.sh index 534db09b5..795bcb672 100755 --- a/construct.sh +++ b/construct.sh @@ -19,7 +19,7 @@ gzip -c "${PKG_PKGS}" >"${PKG_PKGS}.gz" #cp -a debs "${PKG_REPO}" cd "${PKG_REPO}/dists/tangelo" -export PKG_RVSN=13 +export PKG_RVSN=86 cat >main/binary-darwin-arm/Release < - -int main(int argc, const char *argv[]) { - unlink(argv[2]); - symlink(argv[1], argv[2]); - return 0; -} diff --git a/data/libarmfp/_metadata/description b/data/libarmfp/_metadata/description new file mode 100644 index 000000000..c4cbc0947 --- /dev/null +++ b/data/libarmfp/_metadata/description @@ -0,0 +1 @@ +library used by older iPhone software diff --git a/data/libarmfp/_metadata/maintainer b/data/libarmfp/_metadata/maintainer new file mode 120000 index 000000000..0fa66e077 --- /dev/null +++ b/data/libarmfp/_metadata/maintainer @@ -0,0 +1 @@ +../../../people/saurik \ No newline at end of file diff --git a/data/libarmfp/_metadata/priority b/data/libarmfp/_metadata/priority new file mode 100644 index 000000000..134d9bc32 --- /dev/null +++ b/data/libarmfp/_metadata/priority @@ -0,0 +1 @@ +optional diff --git a/data/libarmfp/_metadata/section b/data/libarmfp/_metadata/section new file mode 100644 index 000000000..00b394251 --- /dev/null +++ b/data/libarmfp/_metadata/section @@ -0,0 +1 @@ +System diff --git a/data/libarmfp/_metadata/version b/data/libarmfp/_metadata/version new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/data/libarmfp/_metadata/version @@ -0,0 +1 @@ +0 diff --git a/data/libarmfp/libarmfp.dylib b/data/libarmfp/libarmfp.dylib new file mode 100755 index 000000000..6e49268a8 Binary files /dev/null and b/data/libarmfp/libarmfp.dylib differ diff --git a/data/libarmfp/make.sh b/data/libarmfp/make.sh new file mode 100644 index 000000000..510c1e96c --- /dev/null +++ b/data/libarmfp/make.sh @@ -0,0 +1,2 @@ +pkg: mkdir -p /usr/lib +pkg: cp -a %/libarmfp.dylib /usr/lib diff --git a/data/saurik/make.sh b/data/saurik/make.sh new file mode 100644 index 000000000..c2f48e300 --- /dev/null +++ b/data/saurik/make.sh @@ -0,0 +1,2 @@ +pkg: mkdir -p /etc/apt/sources.list.d +pkg: cp -a %/saurik.list /etc/apt/sources.list.d diff --git a/over/usr/libexec/cydia/boot/godmode b/over/usr/libexec/cydia/boot/godmode new file mode 100755 index 000000000..9ff8ec9eb Binary files /dev/null and b/over/usr/libexec/cydia/boot/godmode differ diff --git a/over/usr/libexec/cydia/boot/install.sh b/over/usr/libexec/cydia/boot/install.sh new file mode 100755 index 000000000..455a27a38 --- /dev/null +++ b/over/usr/libexec/cydia/boot/install.sh @@ -0,0 +1,38 @@ +#!/usr/libexec/cydia/boot/bash + +shopt -s extglob nullglob +export PATH=/usr/libexec/cydia/boot + +function df_() { + free=$(df -B1 "$1") + free=${free% *%*} + free=${free%%*( )} + free=${free##* } + echo "${free}" +} + +for dir in \ + /Applications \ + /Library/Ringtones \ + /Library/Wallpaper \ + /System/Library/Fonts \ + /usr/share +do if [[ -d ${dir} && ! -h ${dir} ]]; then + used=$(du -bs "${dir}") + used=${used%%$'\t'*} + free=$(df_ /var) + + if [[ ${used} -lt ${free} ]]; then + base=$(basename "${dir}") + + new=/var/${base} + if [[ -e ${new} ]]; then + new=$(mktemp -d cydia.XXXXXX) + fi + + godmode mv -T "${dir}" "${new}" + godmode ln -s "${new}" "${dir}" + fi +fi; done + +[[ $(df_ /) -gt 33554432 && $(df_ /var) -gt 33554432 ]] diff --git a/tool/godmode.c b/tool/godmode.c new file mode 100644 index 000000000..363309f95 --- /dev/null +++ b/tool/godmode.c @@ -0,0 +1,8 @@ +#include +#include + +int main(int argc, char *argv[]) { + setuid(0); + setgid(0); + execvp(argv[1], argv + 1); +} diff --git a/tool/symlink.c b/tool/symlink.c new file mode 100644 index 000000000..7ba730d8d --- /dev/null +++ b/tool/symlink.c @@ -0,0 +1,7 @@ +#include + +int main(int argc, const char *argv[]) { + unlink(argv[2]); + symlink(argv[1], argv[2]); + return 0; +} diff --git a/util/configure.sh b/util/configure.sh index 0c1cfba6f..1a7efc6b0 100755 --- a/util/configure.sh +++ b/util/configure.sh @@ -3,4 +3,8 @@ for ltmain in $(find -name ltmain.sh); do patch -N "${ltmain}" "$(dirname "$0")/libtool.diff" || true done -PKG_ROOT=/home/saurik/iphone/sysroot PKG_CONFIG="$(realpath ../../../util/pkg-config.sh) --define-variable=prefix=/home/saurik/iphone/sysroot/usr" PKG_CONFIG_PATH=/home/saurik/iphone/sysroot/usr/lib/pkgconfig ./configure --prefix=/usr --host=arm-apple-darwin --enable-static=no --enable-shared=yes "$@" +if [[ -z $PKG_CONF ]]; then + PKG_CONF=./configure +fi + +PKG_ROOT=/home/saurik/iphone/sysroot PKG_CONFIG="$(realpath ../../../util/pkg-config.sh) --define-variable=prefix=/home/saurik/iphone/sysroot/usr" PKG_CONFIG_PATH=/home/saurik/iphone/sysroot/usr/lib/pkgconfig $PKG_CONF --prefix=/usr --host=arm-apple-darwin --enable-static=no --enable-shared=yes "$@" -- cgit v1.2.3