From 1828bb8ea3f555fba987e1e5664a040c9376b6a6 Mon Sep 17 00:00:00 2001 From: Dominik Riebeling Date: Fri, 16 Dec 2011 20:10:33 +0000 Subject: sansapatcher: allow building without bootloaders. There is no need to always build sansapatcher with embedded bootloaders. Allow building without similar to ipodpatcher. Interactive mode will obviously not be available if built without bootloaders. Fix rules for creating the source files for the embedded bootloaders. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31328 a1c6a512-1295-4272-9138-f99709370657 --- rbutil/sansapatcher/main.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'rbutil/sansapatcher/main.c') diff --git a/rbutil/sansapatcher/main.c b/rbutil/sansapatcher/main.c index 31b690509f..985e1b7262 100644 --- a/rbutil/sansapatcher/main.c +++ b/rbutil/sansapatcher/main.c @@ -31,10 +31,14 @@ #include "sansapatcher.h" #include "sansaio.h" #include "parttypes.h" +#ifdef WITH_BOOTOBJS #include "bootimg_c200.h" #include "bootimg_e200.h" +#endif +#ifndef VERSION #define VERSION "0.8 with v6.0 bootloaders" +#endif enum { NONE, @@ -200,7 +204,9 @@ int main(int argc, char* argv[]) i = 1; } +#ifdef WITH_BOOTOBJS action = INTERACTIVE; +#endif while (i < argc) { if ((strcmp(argv[i],"-l")==0) || (strcmp(argv[i],"--list")==0)) { @@ -279,6 +285,7 @@ int main(int argc, char* argv[]) } else { if (action==LIST_IMAGES) { sansa_list_images(&sansa); +#ifdef WITH_BOOTOBJS } else if (action==INTERACTIVE) { printf("Enter i to install the Rockbox bootloader, u to uninstall\n or c to cancel and do nothing (i/u/c) :"); @@ -314,12 +321,14 @@ int main(int argc, char* argv[]) } } } +#endif } else if (action==READ_FIRMWARE) { if (sansa_read_firmware(&sansa, filename)==0) { fprintf(stderr,"[INFO] Firmware read to file %s.\n",filename); } else { fprintf(stderr,"[ERR] --read-firmware failed.\n"); } +#ifdef WITH_BOOTOBJS } else if (action==INSTALL) { if (sansa_reopen_rw(&sansa) < 0) { return 5; @@ -338,6 +347,7 @@ int main(int argc, char* argv[]) } else { fprintf(stderr,"[ERR] --install failed.\n"); } +#endif } else if (action==ADD_BOOTLOADER) { if (sansa_reopen_rw(&sansa) < 0) { return 5; -- cgit v1.2.3