diff options
Diffstat (limited to 'firmware/target')
-rw-r--r-- | firmware/target/hosted/rolo.c | 23 |
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)); |