summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Chapman <dave@dchapman.com>2007-05-22 19:07:45 +0000
committerDave Chapman <dave@dchapman.com>2007-05-22 19:07:45 +0000
commit4df0c7795407966afb468a941aae1ea695d70cae (patch)
tree282e9b90f013efed66723d08a2ce6760319e35a2
parent7d79db2ab22f99dba034fd64af9157eb67aa20e3 (diff)
downloadrockbox-4df0c7795407966afb468a941aae1ea695d70cae.tar.gz
rockbox-4df0c7795407966afb468a941aae1ea695d70cae.zip
Remove the check for ipod-specific magic in the MBR (which caused problems when users repartitioned their ipods and removed that magic) and instead check that the partition layout looks like an ipod.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13469 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--rbutil/ipodpatcher/ipodpatcher.c16
-rw-r--r--rbutil/ipodpatcher/main.c2
2 files changed, 11 insertions, 7 deletions
diff --git a/rbutil/ipodpatcher/ipodpatcher.c b/rbutil/ipodpatcher/ipodpatcher.c
index 331c7f0322..2be6d2333c 100644
--- a/rbutil/ipodpatcher/ipodpatcher.c
+++ b/rbutil/ipodpatcher/ipodpatcher.c
@@ -172,12 +172,6 @@ int read_partinfo(struct ipod_t* ipod, int silent)
172 172
173 if ((sectorbuf[510] == 0x55) && (sectorbuf[511] == 0xaa)) { 173 if ((sectorbuf[510] == 0x55) && (sectorbuf[511] == 0xaa)) {
174 /* DOS partition table */ 174 /* DOS partition table */
175 if ((memcmp(&sectorbuf[71],"iPod",4) != 0) &&
176 (memcmp(&sectorbuf[0x40],"This is your Apple iPod. You probably do not want to boot from it!",66) != 0) ) {
177 if (!silent) fprintf(stderr,"[ERR] Drive is not an iPod, aborting\n");
178 return -1;
179 }
180
181 ipod->macpod = 0; 175 ipod->macpod = 0;
182 /* parse partitions */ 176 /* parse partitions */
183 for ( i = 0; i < 4; i++ ) { 177 for ( i = 0; i < 4; i++ ) {
@@ -259,6 +253,16 @@ int read_partinfo(struct ipod_t* ipod, int silent)
259 return -1; 253 return -1;
260 } 254 }
261 255
256 /* Check that the partition table looks like an ipod:
257 1) Partition 1 is of type 0 (Empty) but isn't empty.
258 2) Partition 2 is of type 0xb (winpod) or -1 (macpod)
259 */
260 if ((ipod->pinfo[0].type != 0) || (ipod->pinfo[0].size == 0) ||
261 ((ipod->pinfo[1].type != 0xb) && (ipod->pinfo[1].type != -1))) {
262 if (!silent) fprintf(stderr,"[ERR] Partition layout is not an ipod\n");
263 return -1;
264 }
265
262 ipod->start = ipod->pinfo[0].start*ipod->sector_size; 266 ipod->start = ipod->pinfo[0].start*ipod->sector_size;
263 return 0; 267 return 0;
264} 268}
diff --git a/rbutil/ipodpatcher/main.c b/rbutil/ipodpatcher/main.c
index 6328e2df99..090dcccb84 100644
--- a/rbutil/ipodpatcher/main.c
+++ b/rbutil/ipodpatcher/main.c
@@ -29,7 +29,7 @@
29#include "ipodpatcher.h" 29#include "ipodpatcher.h"
30#include "ipodio.h" 30#include "ipodio.h"
31 31
32#define VERSION "0.9 with v1.0 bootloaders" 32#define VERSION "0.9svn with v1.0 bootloaders"
33 33
34int verbose = 0; 34int verbose = 0;
35 35