forked from len0rd/rockbox
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
This commit is contained in:
parent
7d79db2ab2
commit
4df0c77954
2 changed files with 11 additions and 7 deletions
|
|
@ -172,12 +172,6 @@ int read_partinfo(struct ipod_t* ipod, int silent)
|
|||
|
||||
if ((sectorbuf[510] == 0x55) && (sectorbuf[511] == 0xaa)) {
|
||||
/* DOS partition table */
|
||||
if ((memcmp(§orbuf[71],"iPod",4) != 0) &&
|
||||
(memcmp(§orbuf[0x40],"This is your Apple iPod. You probably do not want to boot from it!",66) != 0) ) {
|
||||
if (!silent) fprintf(stderr,"[ERR] Drive is not an iPod, aborting\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
ipod->macpod = 0;
|
||||
/* parse partitions */
|
||||
for ( i = 0; i < 4; i++ ) {
|
||||
|
|
@ -259,6 +253,16 @@ int read_partinfo(struct ipod_t* ipod, int silent)
|
|||
return -1;
|
||||
}
|
||||
|
||||
/* Check that the partition table looks like an ipod:
|
||||
1) Partition 1 is of type 0 (Empty) but isn't empty.
|
||||
2) Partition 2 is of type 0xb (winpod) or -1 (macpod)
|
||||
*/
|
||||
if ((ipod->pinfo[0].type != 0) || (ipod->pinfo[0].size == 0) ||
|
||||
((ipod->pinfo[1].type != 0xb) && (ipod->pinfo[1].type != -1))) {
|
||||
if (!silent) fprintf(stderr,"[ERR] Partition layout is not an ipod\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
ipod->start = ipod->pinfo[0].start*ipod->sector_size;
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@
|
|||
#include "ipodpatcher.h"
|
||||
#include "ipodio.h"
|
||||
|
||||
#define VERSION "0.9 with v1.0 bootloaders"
|
||||
#define VERSION "0.9svn with v1.0 bootloaders"
|
||||
|
||||
int verbose = 0;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue