summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSolomon Peachy <pizza@shaftnet.org>2020-10-17 17:50:36 -0400
committerSolomon Peachy <pizza@shaftnet.org>2020-10-17 18:38:46 -0400
commit0a4a920029bfb8194c37870b7e6d8e60cd7c8ef9 (patch)
treefde794bf72260a2cd9b09dc8b557bf8920b1d5a2
parent012908e0641f0581ee2d0515596db287ee5edf4c (diff)
downloadrockbox-0a4a920029bfb8194c37870b7e6d8e60cd7c8ef9.tar.gz
rockbox-0a4a920029bfb8194c37870b7e6d8e60cd7c8ef9.zip
hosted: ROLO: Fixes for PIVOT_ROOT targets
Change-Id: I4888bd5db6f8a419d312c6b017f676ba6c749d89
-rw-r--r--firmware/target/hosted/rolo.c23
1 files changed, 20 insertions, 3 deletions
diff --git a/firmware/target/hosted/rolo.c b/firmware/target/hosted/rolo.c
index 229a928c84..04b21d553e 100644
--- a/firmware/target/hosted/rolo.c
+++ b/firmware/target/hosted/rolo.c
@@ -18,6 +18,10 @@
18 * 18 *
19 ****************************************************************************/ 19 ****************************************************************************/
20 20
21#include <unistd.h>
22#include <stdio.h>
23#include <stdlib.h>
24
21#include "config.h" 25#include "config.h"
22#include "lcd.h" 26#include "lcd.h"
23#ifdef HAVE_REMOTE_LCD 27#ifdef HAVE_REMOTE_LCD
@@ -30,8 +34,8 @@
30#include "rolo.h" 34#include "rolo.h"
31#include "rbpaths.h" 35#include "rbpaths.h"
32 36
33#include <unistd.h> 37//#define LOGF_ENABLE
34#include <stdio.h> 38#include "logf.h"
35 39
36#if defined(HAVE_BOOTDATA) && !defined(SIMULATOR) 40#if defined(HAVE_BOOTDATA) && !defined(SIMULATOR)
37#include "bootdata.h" 41#include "bootdata.h"
@@ -92,13 +96,26 @@ int rolo_load(const char* filename)
92#endif 96#endif
93 97
94#ifdef PIVOT_ROOT 98#ifdef PIVOT_ROOT
95#define EXECDIR PIVOT_ROOT 99#define EXECDIR "/tmp"
96#else 100#else
97#define EXECDIR HOME_DIR 101#define EXECDIR HOME_DIR
98#endif 102#endif
99 103
100 char buf[256]; 104 char buf[256];
105#ifdef PIVOT_ROOT
106 snprintf(buf, sizeof(buf), "/bin/cp " PIVOT_ROOT "/%s " EXECDIR "/" BOOTFILE, filename);
107 logf("system: %s", buf);
108 system(buf);
109 snprintf(buf, sizeof(buf), "/bin/chmod +x " EXECDIR "/" BOOTFILE);
110 logf("system: %s", buf);
111 system(buf);
112
113 snprintf(buf, sizeof(buf), "%s/%s", EXECDIR, BOOTFILE);
114#else
101 snprintf(buf, sizeof(buf), "%s/%s", EXECDIR, filename); 115 snprintf(buf, sizeof(buf), "%s/%s", EXECDIR, filename);
116#endif
117
118 logf("execl: %s", buf);
102 execl(buf, BOOTFILE, NULL); 119 execl(buf, BOOTFILE, NULL);
103 120
104 rolo_error("Failed to launch!", strerror(errno)); 121 rolo_error("Failed to launch!", strerror(errno));