forked from opa334/Dopamine
-
Notifications
You must be signed in to change notification settings - Fork 922
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
58 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
libkrw-provider/libkrw-plugin.* | ||
libroot/libroot.* | ||
libroot/libroot.deb | ||
basebin-link/basebin-link.* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
#include <roothide.h> | ||
#include <uuid/uuid.h> | ||
#include <limits.h> | ||
|
||
static char g_jbroot_prefix[PATH_MAX] = {0}; | ||
static uuid_string_t g_boot_uuid = {0}; | ||
|
||
__attribute__((constructor)) static void initializer(void) | ||
{ | ||
uint64_t jbranduuid[2] = {jbrand(), jbrand()}; | ||
uuid_unparse(*(uuid_t*)&jbranduuid, g_boot_uuid); | ||
|
||
strcpy(g_jbroot_prefix, jbroot("/")); | ||
size_t len = strlen(g_jbroot_prefix); | ||
if(g_jbroot_prefix[len]=='/') g_jbroot_prefix[len]='\0'; | ||
} | ||
|
||
const char *libroot_get_root_prefix(void) | ||
{ | ||
return "/rootfs/"; | ||
} | ||
|
||
const char *libroot_get_jbroot_prefix(void) | ||
{ | ||
return g_jbroot_prefix; | ||
} | ||
|
||
const char *libroot_get_boot_uuid(void) | ||
{ | ||
return g_boot_uuid; | ||
} | ||
|
||
char *libroot_dyn_rootfspath(const char *path, char *resolvedPath) | ||
{ | ||
const char* newpath = rootfs(path); | ||
if(!newpath) return NULL; | ||
strcpy(resolvedPath, newpath); | ||
return resolvedPath; | ||
} | ||
|
||
char *libroot_dyn_jbrootpath(const char *path, char *resolvedPath) | ||
{ | ||
const char* newpath = jbroot(path); | ||
if(!newpath) return NULL; | ||
strcpy(resolvedPath, newpath); | ||
return resolvedPath; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#ifndef LIBROOT_PATHS_H | ||
#define LIBROOT_PATHS_H | ||
|
||
const char *libroot_get_root_prefix(void); | ||
const char *libroot_get_jbroot_prefix(void); | ||
const char *libroot_get_boot_uuid(void); | ||
char *libroot_dyn_rootfspath(const char *path, char *resolvedPath); | ||
char *libroot_dyn_jbrootpath(const char *path, char *resolvedPath); | ||
|
||
#endif |