mirror of
https://github.com/vivier/EMILE.git
synced 2025-01-20 03:29:57 +00:00
map_read_sector() uses offset from the beginning of the partition, not of the disk
This commit is contained in:
parent
f0a396777c
commit
6d24a5fb5c
@ -168,7 +168,7 @@ static int get_driver(map_t *map, int partition, char* appledriver)
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = map_read_sector(map, block * block_size, (char*)code, bootsize);
|
ret = map_read_sector(map, 0, (char*)code, partition_size * 512);
|
||||||
if (ret == -1)
|
if (ret == -1)
|
||||||
{
|
{
|
||||||
fprintf(stderr, "ERROR: cannot read driver (read())\n");
|
fprintf(stderr, "ERROR: cannot read driver (read())\n");
|
||||||
@ -273,8 +273,7 @@ static int put_driver(map_t *map, int partition, char* appledriver)
|
|||||||
|
|
||||||
/* write file in partition */
|
/* write file in partition */
|
||||||
|
|
||||||
ret = map_write_sector(map, block * block_size, (char*)code,
|
ret = map_write_sector(map, 0, (char*)code, st.st_size);
|
||||||
st.st_size);
|
|
||||||
free(code);
|
free(code);
|
||||||
|
|
||||||
if (ret == -1)
|
if (ret == -1)
|
||||||
@ -436,12 +435,12 @@ int main(int argc, char** argv)
|
|||||||
ret = emile_scsi_get_rdev(dev_name, &driver, &disk, &partition);
|
ret = emile_scsi_get_rdev(dev_name, &driver, &disk, &partition);
|
||||||
else
|
else
|
||||||
ret = emile_scsi_get_rdev(dev_name, &driver, &disk, NULL);
|
ret = emile_scsi_get_rdev(dev_name, &driver, &disk, NULL);
|
||||||
if ( (ret == -1) && (optind < argc))
|
|
||||||
|
if (ret == -1)
|
||||||
{
|
{
|
||||||
disk_name = dev_name;
|
disk_name = dev_name;
|
||||||
driver = 0;
|
driver = 0;
|
||||||
disk = 0;
|
disk = 0;
|
||||||
partition = atoi(argv[optind++]);
|
|
||||||
}
|
}
|
||||||
else if (ret == -1)
|
else if (ret == -1)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user