Revert most of r24361 - it was committed in error.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24362 a1c6a512-1295-4272-9138-f99709370657
diff --git a/rbutil/ipodpatcher/ipodio-posix.c b/rbutil/ipodpatcher/ipodio-posix.c
index e496fa3..065aae6 100644
--- a/rbutil/ipodpatcher/ipodio-posix.c
+++ b/rbutil/ipodpatcher/ipodio-posix.c
@@ -185,7 +185,7 @@
/* Read information about the disk */
if(ioctl(ipod->dh,IPOD_SECTORSIZE_IOCTL,&ipod->sector_size) < 0) {
- ipod->sector_size=2048;
+ ipod->sector_size=512;
if (!silent) {
fprintf(stderr,"[ERR] ioctl() call to get sector size failed, defaulting to %d\n"
,ipod->sector_size);
diff --git a/rbutil/ipodpatcher/ipodio-win32.c b/rbutil/ipodpatcher/ipodio-win32.c
index eec065a..abf7bdf 100644
--- a/rbutil/ipodpatcher/ipodio-win32.c
+++ b/rbutil/ipodpatcher/ipodio-win32.c
@@ -181,7 +181,6 @@
{
unsigned long count;
- printf("[DEBUG] ipod_read - nbytes=%d\n",nbytes);
if (!ReadFile(ipod->dh, buf, nbytes, &count, NULL)) {
ipod_print_error(" Error reading from disk: ");
return -1;
diff --git a/rbutil/ipodpatcher/ipodpatcher.c b/rbutil/ipodpatcher/ipodpatcher.c
index a21ddbd..b2f01b8 100644
--- a/rbutil/ipodpatcher/ipodpatcher.c
+++ b/rbutil/ipodpatcher/ipodpatcher.c
@@ -2080,7 +2080,7 @@
return -1;
}
- if ((n = ipod_read(ipod, ipod_sectorbuf, ipod->sector_size)) < 0) {
+ if ((n = ipod_read(ipod, ipod_sectorbuf, 512)) < 0) {
return -1;
}
diff --git a/rbutil/ipodpatcher/main.c b/rbutil/ipodpatcher/main.c
index 412c873..6ec0566 100644
--- a/rbutil/ipodpatcher/main.c
+++ b/rbutil/ipodpatcher/main.c
@@ -33,7 +33,7 @@
#ifdef RELEASE
#undef VERSION
-#define VERSION "4.1 with v3.0 bootloaders (v1.0 for 2nd Gen Nano)"
+#define VERSION "4.0 with v3.0 bootloaders (v1.0 for 2nd Gen Nano)"
#endif
@@ -398,6 +398,15 @@
if (ipod.ramsize > 0) { printf("(%dMB RAM) ",ipod.ramsize); }
printf("(\"%s\")\n",ipod.macpod ? "macpod" : "winpod");
+ if (ipod.ipod_directory[ipod.ososimage].vers == 0x10000) {
+ fprintf(stderr,"[ERR] *** ipodpatcher does not support the 2nd Generation Nano! ***\n");
+#ifdef WITH_BOOTOBJS
+ printf("Press ENTER to exit ipodpatcher :");
+ fgets(yesno,4,stdin);
+#endif
+ return 0;
+ }
+
if (ipod.macpod) {
print_macpod_warning();
}