fusee: re-design and fix emummc handling
This commit is contained in:
@@ -77,9 +77,6 @@ static rawdev_device_t *rawdev_find_device(const char *name) {
|
||||
|
||||
int rawdev_mount_device(const char *name, const device_partition_t *devpart, bool initialize_immediately) {
|
||||
rawdev_device_t *device = NULL;
|
||||
char drname[40];
|
||||
strcpy(drname, name);
|
||||
strcat(drname, ":");
|
||||
|
||||
if (name[0] == '\0' || devpart == NULL) {
|
||||
errno = EINVAL;
|
||||
@@ -205,6 +202,19 @@ int rawdev_unmount_device(const char *name) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
int rawdev_register_keys(const char *name, unsigned int target_firmware, BisPartition part) {
|
||||
rawdev_device_t *device = rawdev_find_device(name);
|
||||
|
||||
if (device == NULL) {
|
||||
errno = ENOENT;
|
||||
return -1;
|
||||
}
|
||||
|
||||
derive_bis_key(device->devpart.keys, part, target_firmware);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int rawdev_unmount_all(void) {
|
||||
for (size_t i = 0; i < RAWDEV_MAX_DEVICES; i++) {
|
||||
int rc = rawdev_unmount_device(g_rawdev_devices[i].name);
|
||||
|
||||
Reference in New Issue
Block a user