mirror of
https://github.com/vivier/EMILE.git
synced 2024-06-12 03:29:30 +00:00
emile-map-set: manage only one driver
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
This commit is contained in:
parent
098deb6716
commit
cbe8d0c417
|
@ -295,6 +295,10 @@ static int put_driver(map_t *map, int partition, char* appledriver)
|
||||||
fprintf(stderr, "ERROR: cannot read drivers number\n");
|
fprintf(stderr, "ERROR: cannot read drivers number\n");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
if (driver_number != 1) {
|
||||||
|
fprintf(stderr, "ERROR: cannot manage more than one driver\n");
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
ret = map_get_partition_geometry(map, &block, &count);
|
ret = map_get_partition_geometry(map, &block, &count);
|
||||||
if (ret == -1)
|
if (ret == -1)
|
||||||
|
@ -303,7 +307,7 @@ static int put_driver(map_t *map, int partition, char* appledriver)
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = map_set_driver_info(map, driver_number,
|
ret = map_set_driver_info(map, driver_number - 1,
|
||||||
block / (block_size / 512) ,
|
block / (block_size / 512) ,
|
||||||
count / (block_size / 512), 1);
|
count / (block_size / 512), 1);
|
||||||
if (ret == -1)
|
if (ret == -1)
|
||||||
|
@ -312,13 +316,6 @@ static int put_driver(map_t *map, int partition, char* appledriver)
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = map_set_driver_number(map, driver_number + 1);
|
|
||||||
if (driver_number == -1)
|
|
||||||
{
|
|
||||||
fprintf(stderr, "ERROR: cannot set drivers number\n");
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
ret = map_write(map, partition);
|
ret = map_write(map, partition);
|
||||||
if (ret != partition)
|
if (ret != partition)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue
Block a user