mirror of
https://github.com/Rockbox/rockbox.git
synced 2026-10-10 08:03:04 -04:00
Support ROCKBOX_DIR in HibyOS hosted bootloader
Currently if you want to compile a bootloader like so: $ ../tools/configure --rbdir=/.rockbox.aigoerosq --target=aigoerosq --type=b This won't work because the bootloader is hard coded to look for the rockbox Linux binary in /.rockbox/rockbox.erosq regardless of what is specified by '--rbdir'. This commit adds support for ROCKBOX_DIR in the hosted HibyOS bootloaders. After compiling, they can be installed with adb via (for example): adb push build/bootloader.erosq /usr/bin/bootloader.erosq Change-Id: Ic4ceb75107f608beacfd497998a11a5874e87ac1
This commit is contained in:
parent
4502948cd8
commit
4b8ea97fa9
1 changed files with 5 additions and 9 deletions
|
|
@ -36,6 +36,7 @@
|
||||||
#include "lcd.h"
|
#include "lcd.h"
|
||||||
#include "font.h"
|
#include "font.h"
|
||||||
#include "power.h"
|
#include "power.h"
|
||||||
|
#include "rbpaths.h"
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
@ -143,11 +144,6 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define BASE_DIR PIVOT_ROOT
|
#define BASE_DIR PIVOT_ROOT
|
||||||
//#ifdef FIIO_M3K_LINUX
|
|
||||||
//#define BASE_DIR "/mnt"
|
|
||||||
//#else
|
|
||||||
//#define BASE_DIR "/mnt/sd_0"
|
|
||||||
//#endif
|
|
||||||
|
|
||||||
/* images */
|
/* images */
|
||||||
#include "bitmaps/rockboxicon.h"
|
#include "bitmaps/rockboxicon.h"
|
||||||
|
|
@ -258,7 +254,7 @@ static void mount_storage(int enable)
|
||||||
static enum boot_mode load_boot_mode(enum boot_mode mode)
|
static enum boot_mode load_boot_mode(enum boot_mode mode)
|
||||||
{
|
{
|
||||||
mount_storage(true);
|
mount_storage(true);
|
||||||
int fd = open(BASE_DIR "/.rockbox/rb_bl_mode.txt", O_RDONLY);
|
int fd = open(BASE_DIR ROCKBOX_DIR "/rb_bl_mode.txt", O_RDONLY);
|
||||||
if(fd >= 0)
|
if(fd >= 0)
|
||||||
{
|
{
|
||||||
read(fd, &mode, sizeof(mode));
|
read(fd, &mode, sizeof(mode));
|
||||||
|
|
@ -270,7 +266,7 @@ static enum boot_mode load_boot_mode(enum boot_mode mode)
|
||||||
static void save_boot_mode(enum boot_mode mode)
|
static void save_boot_mode(enum boot_mode mode)
|
||||||
{
|
{
|
||||||
mount_storage(true);
|
mount_storage(true);
|
||||||
int fd = open(BASE_DIR "/.rockbox/rb_bl_mode.txt", O_RDWR | O_CREAT | O_TRUNC);
|
int fd = open(BASE_DIR ROCKBOX_DIR "/rb_bl_mode.txt", O_RDWR | O_CREAT | O_TRUNC);
|
||||||
if(fd >= 0)
|
if(fd >= 0)
|
||||||
{
|
{
|
||||||
write(fd, &mode, sizeof(mode));
|
write(fd, &mode, sizeof(mode));
|
||||||
|
|
@ -720,14 +716,14 @@ int main(int argc, char **argv)
|
||||||
#endif
|
#endif
|
||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
mount_storage(true);
|
mount_storage(true);
|
||||||
system("/bin/cp " BASE_DIR "/.rockbox/" BOOTFILE " /tmp");
|
system("/bin/cp " BASE_DIR ROCKBOX_DIR "/" BOOTFILE " /tmp");
|
||||||
system("/bin/chmod +x /tmp/" BOOTFILE);
|
system("/bin/chmod +x /tmp/" BOOTFILE);
|
||||||
#ifdef HIBY_R1
|
#ifdef HIBY_R1
|
||||||
/* Load libasound from Rockbox directory */
|
/* Load libasound from Rockbox directory */
|
||||||
char *argvr1[] = { "/tmp/" BOOTFILE, 0 };
|
char *argvr1[] = { "/tmp/" BOOTFILE, 0 };
|
||||||
char *envpr1[] =
|
char *envpr1[] =
|
||||||
{
|
{
|
||||||
"LD_LIBRARY_PATH=/data/mnt/sd_0/.rockbox",
|
"LD_LIBRARY_PATH=" BASE_DIR "/" ROCKBOX_DIR,
|
||||||
0
|
0
|
||||||
};
|
};
|
||||||
execve(argvr1[0], &argvr1[0], envpr1);
|
execve(argvr1[0], &argvr1[0], envpr1);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue