mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-12-09 05:05:20 -05:00
hosted: ROLO: Fixes for PIVOT_ROOT targets
Change-Id: I4888bd5db6f8a419d312c6b017f676ba6c749d89
This commit is contained in:
parent
012908e064
commit
0a4a920029
1 changed files with 20 additions and 3 deletions
|
|
@ -18,6 +18,10 @@
|
||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
|
#include <unistd.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#include "lcd.h"
|
#include "lcd.h"
|
||||||
#ifdef HAVE_REMOTE_LCD
|
#ifdef HAVE_REMOTE_LCD
|
||||||
|
|
@ -30,8 +34,8 @@
|
||||||
#include "rolo.h"
|
#include "rolo.h"
|
||||||
#include "rbpaths.h"
|
#include "rbpaths.h"
|
||||||
|
|
||||||
#include <unistd.h>
|
//#define LOGF_ENABLE
|
||||||
#include <stdio.h>
|
#include "logf.h"
|
||||||
|
|
||||||
#if defined(HAVE_BOOTDATA) && !defined(SIMULATOR)
|
#if defined(HAVE_BOOTDATA) && !defined(SIMULATOR)
|
||||||
#include "bootdata.h"
|
#include "bootdata.h"
|
||||||
|
|
@ -92,13 +96,26 @@ int rolo_load(const char* filename)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef PIVOT_ROOT
|
#ifdef PIVOT_ROOT
|
||||||
#define EXECDIR PIVOT_ROOT
|
#define EXECDIR "/tmp"
|
||||||
#else
|
#else
|
||||||
#define EXECDIR HOME_DIR
|
#define EXECDIR HOME_DIR
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
char buf[256];
|
char buf[256];
|
||||||
|
#ifdef PIVOT_ROOT
|
||||||
|
snprintf(buf, sizeof(buf), "/bin/cp " PIVOT_ROOT "/%s " EXECDIR "/" BOOTFILE, filename);
|
||||||
|
logf("system: %s", buf);
|
||||||
|
system(buf);
|
||||||
|
snprintf(buf, sizeof(buf), "/bin/chmod +x " EXECDIR "/" BOOTFILE);
|
||||||
|
logf("system: %s", buf);
|
||||||
|
system(buf);
|
||||||
|
|
||||||
|
snprintf(buf, sizeof(buf), "%s/%s", EXECDIR, BOOTFILE);
|
||||||
|
#else
|
||||||
snprintf(buf, sizeof(buf), "%s/%s", EXECDIR, filename);
|
snprintf(buf, sizeof(buf), "%s/%s", EXECDIR, filename);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
logf("execl: %s", buf);
|
||||||
execl(buf, BOOTFILE, NULL);
|
execl(buf, BOOTFILE, NULL);
|
||||||
|
|
||||||
rolo_error("Failed to launch!", strerror(errno));
|
rolo_error("Failed to launch!", strerror(errno));
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue