summaryrefslogtreecommitdiff
path: root/bootloader
diff options
context:
space:
mode:
authorMarcin Bukat <marcin.bukat@gmail.com>2018-03-13 21:24:56 +0100
committerMarcin Bukat <marcin.bukat@gmail.com>2018-06-12 10:31:15 +0200
commit7692558674be24dfe51d7be84b4d01995c23e67b (patch)
tree9cf8909c361ea6373ee81d46518cc168c5d60074 /bootloader
parentd5889b3d94c0ff2403c2c6c9c89500b85e050bca (diff)
downloadrockbox-7692558674be24dfe51d7be84b4d01995c23e67b.tar.gz
rockbox-7692558674be24dfe51d7be84b4d01995c23e67b.zip
Agptek Rocker: Implement USB mass storage driver
Agptek uses composite android driver. Change-Id: Iece188ad640f3dfd24c171946c14da4c3516b6d5
Diffstat (limited to 'bootloader')
-rw-r--r--bootloader/rocker_linux.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/bootloader/rocker_linux.c b/bootloader/rocker_linux.c
index dd912ee378..cb0e5b66e5 100644
--- a/bootloader/rocker_linux.c
+++ b/bootloader/rocker_linux.c
@@ -449,6 +449,7 @@ static void tools_screen(void)
449 power_off(); 449 power_off();
450} 450}
451 451
452#if 0
452/* open log file */ 453/* open log file */
453static int open_log(void) 454static int open_log(void)
454{ 455{
@@ -467,11 +468,13 @@ static int open_log(void)
467 /* re-open the file, truncate in case the move was unsuccessful */ 468 /* re-open the file, truncate in case the move was unsuccessful */
468 return open("/mnt/sd_0/rockbox.log", O_RDWR | O_CREAT | O_APPEND | O_TRUNC); 469 return open("/mnt/sd_0/rockbox.log", O_RDWR | O_CREAT | O_APPEND | O_TRUNC);
469} 470}
471#endif
470 472
471int main(int argc, char **argv) 473int main(int argc, char **argv)
472{ 474{
473 (void) argc; 475 (void) argc;
474 (void) argv; 476 (void) argv;
477#if 0
475 /* redirect stdout and stderr to have error messages logged somewhere on the 478 /* redirect stdout and stderr to have error messages logged somewhere on the
476 * user partition */ 479 * user partition */
477 int fd = open_log(); 480 int fd = open_log();
@@ -485,6 +488,7 @@ int main(int argc, char **argv)
485 printf("Rockbox boot loader\n"); 488 printf("Rockbox boot loader\n");
486 printf("Version: %s\n", rbversion); 489 printf("Version: %s\n", rbversion);
487 printf("%s\n", MODEL_NAME); 490 printf("%s\n", MODEL_NAME);
491#endif
488 492
489 system_init(); 493 system_init();
490 core_allocator_init(); 494 core_allocator_init();
@@ -506,10 +510,12 @@ int main(int argc, char **argv)
506 enum boot_mode mode = get_boot_mode(); 510 enum boot_mode mode = get_boot_mode();
507 if(mode == BOOT_USB || mode == BOOT_OF) 511 if(mode == BOOT_USB || mode == BOOT_OF)
508 { 512 {
513#if 0
509 fflush(stdout); 514 fflush(stdout);
510 fflush(stderr); 515 fflush(stderr);
511 close(fileno(stdout)); 516 close(fileno(stdout));
512 close(fileno(stderr)); 517 close(fileno(stderr));
518#endif
513 /* for now the only way we have to trigger USB mode it to run the OF */ 519 /* for now the only way we have to trigger USB mode it to run the OF */
514 /* boot OF */ 520 /* boot OF */
515 execvp("/usr/bin/hiby_player", argv); 521 execvp("/usr/bin/hiby_player", argv);
@@ -522,13 +528,9 @@ int main(int argc, char **argv)
522 } 528 }
523 else if(mode == BOOT_ROCKBOX) 529 else if(mode == BOOT_ROCKBOX)
524 { 530 {
525 /* Rockbox expects /.rockbox to contain themes, rocks, etc, but we
526 * cannot easily create this symlink because the root filesystem is
527 * mounted read-only. Although we could remount it read-write temporarily,
528 * this is neededlessly complicated and we defer this job to the dualboot
529 * install script */
530 fflush(stdout); 531 fflush(stdout);
531 execl("/mnt/sd_0/.rockbox/rockbox.rocker", "rockbox.rocker", NULL); 532 system("/bin/cp /mnt/sd_0/.rockbox/rockbox.rocker /tmp");
533 execl("/tmp/rockbox.rocker", "rockbox.rocker", NULL);
532 printf("execvp failed: %s\n", strerror(errno)); 534 printf("execvp failed: %s\n", strerror(errno));
533 /* fallback to OF in case of failure */ 535 /* fallback to OF in case of failure */
534 error_screen("Cannot boot Rockbox"); 536 error_screen("Cannot boot Rockbox");