Provisory new API calls isoburn_igopt_set_prep_partition, isoburn_igopt_set_efi_bootp

This commit is contained in:
2012-06-12 11:33:46 +00:00
parent 9e497e369f
commit 8bff64f692
5 changed files with 115 additions and 1 deletions

View File

@@ -571,6 +571,22 @@ int isoburn_prepare_disc_aux(struct burn_drive *in_d, struct burn_drive *out_d,
opts->partition_secs_per_head,
opts->partition_heads_per_cyl);
iso_write_opts_set_tail_blocks(wopts, opts->tail_blocks);
if(opts->prep_partition != NULL) {
ret = iso_write_opts_set_prep_img(wopts, opts->prep_partition, 0);
if(ret < 0) {
isoburn_report_iso_error(ret, "Cannot set path for PreP partition",
0, "FAILURE", 0);
{ret= -1; goto ex;}
}
}
if(opts->efi_boot_partition != NULL) {
ret = iso_write_opts_set_efi_bootp(wopts, opts->efi_boot_partition, 0);
if(ret < 0) {
isoburn_report_iso_error(ret, "Cannot set path for EFI system partition",
0, "FAILURE", 0);
{ret= -1; goto ex;}
}
}
for(i= 0; i < Libisoburn_max_appended_partitionS; i++) {
if(opts->appended_partitions[i] == NULL)
continue;
@@ -1072,6 +1088,8 @@ int isoburn_igopt_new(struct isoburn_imgen_opts **new_o, int flag)
o->vol_effective_time= 0;
o->libjte_handle= NULL;
o->tail_blocks= 0;
o->prep_partition= NULL;
o->efi_boot_partition= NULL;
for(i= 0; i < Libisoburn_max_appended_partitionS; i++) {
o->appended_partitions[i]= NULL;
o->appended_part_types[i]= 0;
@@ -1089,6 +1107,10 @@ int isoburn_igopt_destroy(struct isoburn_imgen_opts **o, int flag)
return(0);
if((*o)->rr_reloc_dir != NULL)
free((*o)->rr_reloc_dir);
if((*o)->prep_partition != NULL)
free((*o)->prep_partition);
if((*o)->efi_boot_partition != NULL)
free((*o)->efi_boot_partition);
for(i= 0; i < Libisoburn_max_appended_partitionS; i++)
if((*o)->appended_partitions[i] != NULL)
free((*o)->appended_partitions[i]);
@@ -1513,6 +1535,56 @@ int isoburn_igopt_get_tail_blocks(struct isoburn_imgen_opts *opts,
}
int isoburn_igopt_set_prep_partition(struct isoburn_imgen_opts *o,
char *path, int flag)
{
if(o->prep_partition != NULL)
free(o->prep_partition);
o->prep_partition= NULL;
if(path != NULL) {
o->prep_partition= strdup(path);
if(o->prep_partition == NULL) {
isoburn_report_iso_error(ISO_OUT_OF_MEM, "Out of memory", 0, "FATAL", 0);
return(-1);
}
}
return(1);
}
int isoburn_igopt_get_prep_partition(struct isoburn_imgen_opts *opts,
char **path, int flag)
{
*path= opts->prep_partition;
return(1);
}
int isoburn_igopt_set_efi_bootp(struct isoburn_imgen_opts *o,
char *path, int flag)
{
if(o->efi_boot_partition != NULL)
free(o->efi_boot_partition);
o->efi_boot_partition= NULL;
if(path != NULL) {
o->efi_boot_partition= strdup(path);
if(o->efi_boot_partition == NULL) {
isoburn_report_iso_error(ISO_OUT_OF_MEM, "Out of memory", 0, "FATAL", 0);
return(-1);
}
}
return(1);
}
int isoburn_igopt_get_efi_bootp(struct isoburn_imgen_opts *opts,
char **path, int flag)
{
*path= opts->efi_boot_partition;
return(1);
}
int isoburn_igopt_set_partition_img(struct isoburn_imgen_opts *opts,
int partition_number, uint8_t partition_type,
char *image_path)