From 67e75c0a6e38d03241c3df50c7787235bd946580 Mon Sep 17 00:00:00 2001 From: Jay Freeman Date: Sun, 3 Feb 2008 12:53:13 +0000 Subject: Added dmg2img, with fixes for getting good data out of multi-partition compressed images. git-svn-id: http://svn.telesphoreo.org/trunk@46 514c082c-b64e-11dc-b46d-3d985efe055d --- data/dmg2img/_metadata/description | 1 + data/dmg2img/_metadata/license | 1 + data/dmg2img/_metadata/maintainer | 1 + data/dmg2img/_metadata/priority | 1 + data/dmg2img/_metadata/section | 1 + data/dmg2img/_metadata/version | 1 + data/dmg2img/dmg2img.tar.gz | Bin 0 -> 10916 bytes data/dmg2img/make.sh | 6 ++++++ data/dmg2img/offset.diff | 22 ++++++++++++++++++++++ data/dmg2img/optimizer.diff | 11 +++++++++++ 10 files changed, 45 insertions(+) create mode 100644 data/dmg2img/_metadata/description create mode 120000 data/dmg2img/_metadata/license create mode 120000 data/dmg2img/_metadata/maintainer create mode 100644 data/dmg2img/_metadata/priority create mode 100644 data/dmg2img/_metadata/section create mode 100644 data/dmg2img/_metadata/version create mode 100644 data/dmg2img/dmg2img.tar.gz create mode 100644 data/dmg2img/make.sh create mode 100644 data/dmg2img/offset.diff create mode 100644 data/dmg2img/optimizer.diff diff --git a/data/dmg2img/_metadata/description b/data/dmg2img/_metadata/description new file mode 100644 index 000000000..2a3351074 --- /dev/null +++ b/data/dmg2img/_metadata/description @@ -0,0 +1 @@ +converts compressed dmgs to HFS+ diff --git a/data/dmg2img/_metadata/license b/data/dmg2img/_metadata/license new file mode 120000 index 000000000..9c13a9a0f --- /dev/null +++ b/data/dmg2img/_metadata/license @@ -0,0 +1 @@ +../../../licenses/gpl-2 \ No newline at end of file diff --git a/data/dmg2img/_metadata/maintainer b/data/dmg2img/_metadata/maintainer new file mode 120000 index 000000000..0fa66e077 --- /dev/null +++ b/data/dmg2img/_metadata/maintainer @@ -0,0 +1 @@ +../../../people/saurik \ No newline at end of file diff --git a/data/dmg2img/_metadata/priority b/data/dmg2img/_metadata/priority new file mode 100644 index 000000000..134d9bc32 --- /dev/null +++ b/data/dmg2img/_metadata/priority @@ -0,0 +1 @@ +optional diff --git a/data/dmg2img/_metadata/section b/data/dmg2img/_metadata/section new file mode 100644 index 000000000..f1d43c641 --- /dev/null +++ b/data/dmg2img/_metadata/section @@ -0,0 +1 @@ +archive diff --git a/data/dmg2img/_metadata/version b/data/dmg2img/_metadata/version new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/data/dmg2img/_metadata/version @@ -0,0 +1 @@ +0 diff --git a/data/dmg2img/dmg2img.tar.gz b/data/dmg2img/dmg2img.tar.gz new file mode 100644 index 000000000..de5588362 Binary files /dev/null and b/data/dmg2img/dmg2img.tar.gz differ diff --git a/data/dmg2img/make.sh b/data/dmg2img/make.sh new file mode 100644 index 000000000..430845bef --- /dev/null +++ b/data/dmg2img/make.sh @@ -0,0 +1,6 @@ +pkg:extract +cd * +pkg:patch +make CC=arm-apple-darwin-gcc +pkg: mkdir -p /usr/bin +pkg: mv dmg2img /usr/bin diff --git a/data/dmg2img/offset.diff b/data/dmg2img/offset.diff new file mode 100644 index 000000000..880994251 --- /dev/null +++ b/data/dmg2img/offset.diff @@ -0,0 +1,22 @@ +diff -ru dmg2img/dmg2img.c dmg2img+iPhone/dmg2img.c +--- dmg2img/dmg2img.c 2007-08-07 08:53:45.000000000 +0000 ++++ dmg2img+iPhone/dmg2img.c 2008-01-30 18:54:01.000000000 +0000 +@@ -180,8 +180,9 @@ + if (verbose) + printf("decompressing:\n"); + ++ in_offs = 0; + percent = 0.0; +- for (i = 0; i < partnum; i++) { ++ for (i = 0; i < partnum && in_offs != addr; i++) { + if (verbose) + printf("opening partition %d ...",i); + if (verbose>=3) +@@ -199,6 +200,7 @@ + out_size = convert_char4(parts[i]+offset+20)*0x200; + in_offs = convert_char4(parts[i]+offset+28); + in_size = convert_char4(parts[i]+offset+36); ++ fseek(FOUT, out_offs, SEEK_SET); + if (out_size!=0) { + if (block_type == BT_ZLIB) { + if (verbose>=3) diff --git a/data/dmg2img/optimizer.diff b/data/dmg2img/optimizer.diff new file mode 100644 index 000000000..e2e464236 --- /dev/null +++ b/data/dmg2img/optimizer.diff @@ -0,0 +1,11 @@ +diff -ru dmg2img/Makefile dmg2img+iPhone/Makefile +--- dmg2img/Makefile 2007-08-07 05:43:12.000000000 +0000 ++++ dmg2img+iPhone/Makefile 2008-01-30 18:53:21.000000000 +0000 +@@ -1,6 +1,6 @@ + BIN_DIR = /usr/bin + CC = gcc +-CFLAGS = -O3 ++CFLAGS = -O0 + + all: clean dmg2img + -- cgit v1.2.3