summaryrefslogtreecommitdiffstats
path: root/rbutil/ipodpatcher/main.c
diff options
context:
space:
mode:
authorDave Chapman <dave@dchapman.com>2007-02-10 20:09:23 +0000
committerDave Chapman <dave@dchapman.com>2007-02-10 20:09:23 +0000
commita6d68bd7409b3f54de8e02ec37e369167f55a50c (patch)
treec7475f07d5122ec09e38009bd1977c0274baf14b /rbutil/ipodpatcher/main.c
parent955afed1b74793a3f06f98f3c259ec98f26a0b82 (diff)
downloadrockbox-a6d68bd7409b3f54de8e02ec37e369167f55a50c.tar.gz
rockbox-a6d68bd7409b3f54de8e02ec37e369167f55a50c.tar.bz2
rockbox-a6d68bd7409b3f54de8e02ec37e369167f55a50c.zip
Changes to aid incorporation into rbutil, based on part of FS #6643 from Dominik Wenger. Move display_partinfo() function into main.c (where it belongs) and export get_parttype() function from ipodpatcher.c. Also add a targetname variable to struct ipod_t to enable bootloader URLs to be constructed.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12264 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'rbutil/ipodpatcher/main.c')
-rw-r--r--rbutil/ipodpatcher/main.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/rbutil/ipodpatcher/main.c b/rbutil/ipodpatcher/main.c
index d183b9bc52..476aeff9d2 100644
--- a/rbutil/ipodpatcher/main.c
+++ b/rbutil/ipodpatcher/main.c
@@ -102,6 +102,26 @@ void print_usage(void)
#endif
}
+void display_partinfo(struct ipod_t* ipod)
+{
+ int i;
+ double sectors_per_MB = (1024.0*1024.0)/ipod->sector_size;
+
+ printf("[INFO] Part Start Sector End Sector Size (MB) Type\n");
+ for ( i = 0; i < 4; i++ ) {
+ if (ipod->pinfo[i].start != 0) {
+ printf("[INFO] %d %10ld %10ld %10.1f %s (0x%02x)\n",
+ i,
+ ipod->pinfo[i].start,
+ ipod->pinfo[i].start+ipod->pinfo[i].size-1,
+ ipod->pinfo[i].size/sectors_per_MB,
+ get_parttype(ipod->pinfo[i].type),
+ ipod->pinfo[i].type);
+ }
+ }
+}
+
+
int main(int argc, char* argv[])
{
#ifdef WITH_BOOTOBJS