diff --git a/bootloader/hibyos_linux.c b/bootloader/hibyos_linux.c index d05259536e..f42070d001 100644 --- a/bootloader/hibyos_linux.c +++ b/bootloader/hibyos_linux.c @@ -36,6 +36,7 @@ #include "lcd.h" #include "font.h" #include "power.h" +#include "rbpaths.h" #include #include #include @@ -143,11 +144,6 @@ #endif #define BASE_DIR PIVOT_ROOT -//#ifdef FIIO_M3K_LINUX -//#define BASE_DIR "/mnt" -//#else -//#define BASE_DIR "/mnt/sd_0" -//#endif /* images */ #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) { 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) { 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) { 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) { write(fd, &mode, sizeof(mode)); @@ -720,14 +716,14 @@ int main(int argc, char **argv) #endif fflush(stdout); 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); #ifdef HIBY_R1 /* Load libasound from Rockbox directory */ char *argvr1[] = { "/tmp/" BOOTFILE, 0 }; char *envpr1[] = { - "LD_LIBRARY_PATH=/data/mnt/sd_0/.rockbox", + "LD_LIBRARY_PATH=" BASE_DIR "/" ROCKBOX_DIR, 0 }; execve(argvr1[0], &argvr1[0], envpr1);