"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "xorriso/iso_img.c" between
xorriso-1.4.6.tar.gz and xorriso-1.4.8.tar.gz

About: GNU xorriso creates, loads, manipulates and writes ISO 9660 filesystem images with Rock Ridge extensions. It is suitable for incremental data backup and for production of bootable ISO 9660 images. GNU xorriso is a statical compilation of the libraries libburn, libisofs, libisoburn, and libjte.

iso_img.c  (xorriso-1.4.6):iso_img.c  (xorriso-1.4.8)
skipping to change at line 362 skipping to change at line 362
volid[32]= 0; volid[32]= 0;
return(1); return(1);
} }
/* /*
bit0= do only report non-default settings bit0= do only report non-default settings
bit1= do only report to fp bit1= do only report to fp
bit2= is_default bit2= is_default
bit3= append -boot_image any next bit3= append -boot_image any next
bit4= concentrate boot options bit4= concentrate boot options
bit5= override load_size by "full"
*/ */
int Xorriso_boot_item_status(struct XorrisO *xorriso, char *cat_path, int Xorriso_boot_item_status(struct XorrisO *xorriso, char *cat_path,
char *bin_path, int platform_id, char *bin_path, int platform_id,
int patch_isolinux, int emul, off_t load_size, int patch_isolinux, int emul, off_t load_size,
unsigned char *id_string, unsigned char *id_string,
unsigned char *selection_crit, char *form, unsigned char *selection_crit, char *form,
char *filter, FILE *fp, int flag) char *filter, FILE *fp, int flag)
{ {
int is_default, no_defaults, i, is_default_id= 0, ret; int is_default, no_defaults, i, is_default_id= 0, ret;
char *line, *bspec= NULL, zeros[28], *partition_entry; char *line, *bspec= NULL, zeros[28], *partition_entry;
off_t file_size; off_t file_size;
struct stat stbuf; struct stat stbuf;
Xorriso_alloc_meM(bspec, char, SfileadrL + 80); Xorriso_alloc_meM(bspec, char, SfileadrL + 80);
no_defaults= flag & 1; no_defaults= flag & 1;
line= xorriso->result_line; line= xorriso->result_line;
if(flag & 32)
load_size= -1;
if((flag & 16) && bin_path[0] != 0) { if((flag & 16) && bin_path[0] != 0) {
/* Concentrate boot options. */ /* Concentrate boot options. */
memset(zeros, 0, 28); memset(zeros, 0, 28);
if(memcmp(id_string, zeros, 28) == 0 && if(memcmp(id_string, zeros, 28) == 0 &&
memcmp(selection_crit, zeros, 20) == 0) memcmp(selection_crit, zeros, 20) == 0)
is_default_id= 1; is_default_id= 1;
/* -boot_image isolinux dir= ... */ /* -boot_image isolinux dir= ... */
bspec[0]= 0; bspec[0]= 0;
skipping to change at line 412 skipping to change at line 415
memset(zeros, 0, 28); memset(zeros, 0, 28);
if(bspec[0] && platform_id == 0 && (patch_isolinux & 0x3ff) == 1 && if(bspec[0] && platform_id == 0 && (patch_isolinux & 0x3ff) == 1 &&
load_size == 2048 && is_default_id && emul == 0) { load_size == 2048 && is_default_id && emul == 0) {
sprintf(line, "-boot_image isolinux %s\n", bspec); sprintf(line, "-boot_image isolinux %s\n", bspec);
Xorriso_status_result(xorriso,filter,fp,flag&2); Xorriso_status_result(xorriso,filter,fp,flag&2);
{ret= 1; goto ex;}; {ret= 1; goto ex;};
} }
file_size= 0; file_size= 0;
ret= Xorriso_iso_lstat(xorriso, bin_path, &stbuf, 2 | 4); ret= Xorriso_iso_lstat(xorriso, bin_path, &stbuf, 2 | 4);
if(ret == 0) if(ret == 0) {
file_size= ((stbuf.st_size / (off_t) 512) + file_size= ((stbuf.st_size / (off_t) 512) +
!!(stbuf.st_size % (off_t) 512)) * 512; !!(stbuf.st_size % (off_t) 512)) * 512;
if(flag & 32)
load_size= file_size * 512;
}
if(platform_id == 0xef && (patch_isolinux & 0x3ff) == 0 && if(platform_id == 0xef && (patch_isolinux & 0x3ff) == 0 &&
load_size == file_size && is_default_id && emul == 0) { load_size / 512 == file_size && is_default_id && emul == 0) {
sprintf(line, "-boot_image any efi_path="); sprintf(line, "-boot_image any efi_path=");
Text_shellsafe(bin_path, line, 1); Text_shellsafe(bin_path, line, 1);
strcat(line, "\n"); strcat(line, "\n");
Xorriso_status_result(xorriso,filter,fp,flag&2); Xorriso_status_result(xorriso,filter,fp,flag&2);
{ret= 1; goto ex;}; {ret= 1; goto ex;};
} }
} }
is_default= (bin_path[0] == 0) || (flag & 4); is_default= (bin_path[0] == 0) || (flag & 4);
sprintf(line, "-boot_image %s bin_path=", form); sprintf(line, "-boot_image %s bin_path=", form);
skipping to change at line 456 skipping to change at line 462
(patch_isolinux & 1) ? "on" : "off"); (patch_isolinux & 1) ? "on" : "off");
if(!(is_default && no_defaults)) if(!(is_default && no_defaults))
Xorriso_status_result(xorriso,filter,fp,flag&2); Xorriso_status_result(xorriso,filter,fp,flag&2);
is_default= ((patch_isolinux & 512) == 0 || bin_path[0] == 0 || (flag & 4)); is_default= ((patch_isolinux & 512) == 0 || bin_path[0] == 0 || (flag & 4));
sprintf(line, "-boot_image grub grub2_boot_info=%s\n", sprintf(line, "-boot_image grub grub2_boot_info=%s\n",
(patch_isolinux & 512) ? "on" : "off"); (patch_isolinux & 512) ? "on" : "off");
if(!(is_default && no_defaults)) if(!(is_default && no_defaults))
Xorriso_status_result(xorriso,filter,fp,flag&2); Xorriso_status_result(xorriso,filter,fp,flag&2);
is_default= (load_size == 2048 || (flag & 4)); if(flag & 32) {
sprintf(line, "-boot_image %s load_size=%lu\n", is_default= 0;
form, (unsigned long) load_size); sprintf(line, "-boot_image %s load_size=full", form);
} else {
is_default= (load_size == 2048 || (flag & 4));
sprintf(line, "-boot_image %s load_size=%lu\n",
form, (unsigned long) load_size);
}
if(!(is_default && no_defaults)) if(!(is_default && no_defaults))
Xorriso_status_result(xorriso,filter,fp,flag&2); Xorriso_status_result(xorriso,filter,fp,flag&2);
is_default= 1; is_default= 1;
if(!(flag & 4)) if(!(flag & 4))
for(i= 0; i < 20; i++) for(i= 0; i < 20; i++)
if(selection_crit[i]) if(selection_crit[i])
is_default= 0; is_default= 0;
sprintf(line, "-boot_image %s sel_crit=", form); sprintf(line, "-boot_image %s sel_crit=", form);
for(i= 0; i < 20; i++) for(i= 0; i < 20; i++)
skipping to change at line 1149 skipping to change at line 1160
"-mount : Will not perform mount command which stems from command template.", "-mount : Will not perform mount command which stems from command template.",
0, "SORRY", 0); 0, "SORRY", 0);
sprintf(xorriso->result_line, "%s\n", mount_command); sprintf(xorriso->result_line, "%s\n", mount_command);
Xorriso_result(xorriso,0); Xorriso_result(xorriso,0);
} else { } else {
ret= Xorriso_execv(xorriso, mount_command, 0, NULL, "/bin:/sbin", ret= Xorriso_execv(xorriso, mount_command, 0, NULL, "/bin:/sbin",
NULL, NULL, NULL, &status, 1); NULL, NULL, NULL, &status, 1);
if(WIFEXITED(status) && WEXITSTATUS(status) != 0) { if(WIFEXITED(status) && WEXITSTATUS(status) != 0) {
sprintf(xorriso->info_text, sprintf(xorriso->info_text,
"-mount : mount command failed with exit value %d", "-mount : mount command failed with exit value %d",
(int) WEXITSTATUS(ret)); (int) WEXITSTATUS(status));
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
ret= 0; goto ex; ret= 0; goto ex;
} }
sprintf(xorriso->info_text, "\nMounted session %d of device ", session); sprintf(xorriso->info_text, "\nMounted session %d of device ", session);
Text_shellsafe(dev_path, xorriso->info_text, 1); Text_shellsafe(dev_path, xorriso->info_text, 1);
dpt= strchr(cmd, ':'); dpt= strchr(cmd, ':');
if(dpt == NULL) if(dpt == NULL)
dpt= cmd ; dpt= cmd ;
else else
dpt++; dpt++;
skipping to change at line 1602 skipping to change at line 1613
char **sa_lines, int sa_line_count, char **sa_lines, int sa_line_count,
char **cmds, int *cmd_count, int flag) char **cmds, int *cmd_count, int flag)
{ {
int ret= 0, i, num_count, mkisofs, line_count, idx, et_idx, isohybrid= 0; int ret= 0, i, num_count, mkisofs, line_count, idx, et_idx, isohybrid= 0;
int ptype, gpt_idx, j, pad, mbr_idx; int ptype, gpt_idx, j, pad, mbr_idx;
int efi_boot_part= 0, full_sparc_part= 0, have_sparc_part= 0, fe_dummy= 1; int efi_boot_part= 0, full_sparc_part= 0, have_sparc_part= 0, fe_dummy= 1;
int appended_as_gpt= 0, have_prep= 0, did_sysarea= 0, cared_for_apm= 0; int appended_as_gpt= 0, have_prep= 0, did_sysarea= 0, cared_for_apm= 0;
int cared_for_sparc= 0, have_hfsplus= 0; int cared_for_sparc= 0, have_hfsplus= 0;
int have_sysarea= 0, ptable_killer, imported_iso, have_alpha_ldr_path= 0; int have_sysarea= 0, ptable_killer, imported_iso, have_alpha_ldr_path= 0;
int have_protective_msdos= 0, appended_partition= 0, part_like_isohybrid= 0; int have_protective_msdos= 0, appended_partition= 0, part_like_isohybrid= 0;
int iso_mbr_part_type= -1;
unsigned int prev_pltf= 0;
unsigned long int sa_options= 0, partno, id_tag, perms, start_cyl, num_blocks; unsigned long int sa_options= 0, partno, id_tag, perms, start_cyl, num_blocks;
unsigned long int part_status, part_type, start_block; unsigned long int part_status, part_type, start_block, partition_offset= 0;
uint32_t high_block= 0; uint32_t high_block= 0;
char name[24], *textpt, *contentpt, *buf= NULL; char name[24], *textpt, *contentpt, *buf= NULL;
char **lines= NULL; char **lines= NULL;
double num[8]; double num[8];
char *cat_path= ""; char *cat_path= "";
struct elto_img_par *et_imgs= NULL; struct elto_img_par *et_imgs= NULL;
int elto_count= 0; int elto_count= 0;
uint32_t img_blocks= 0, mbr_parts_end= 0; uint32_t img_blocks= 0, mbr_parts_end= 0;
struct FindjoB *job= NULL; struct FindjoB *job= NULL;
struct stat dir_stbuf; struct stat dir_stbuf;
IsoImage *image; IsoImage *image;
char *volid, *crt, *mdt, *ext, *eft, uuid[17]; char *volid, *crt, *mdt, *ext, *eft, uuid[17], *uuid_time;
char **app_pseudo_paths= NULL; char **app_pseudo_paths= NULL;
struct tm tm_erg;
struct mbr_par { struct mbr_par {
uint8_t ptype; uint8_t ptype;
uint64_t start_block; uint64_t start_block;
uint64_t block_count; uint64_t block_count;
int appended; int appended;
int has_path; int has_path;
}; };
struct mbr_par *mbrpts= NULL; struct mbr_par *mbrpts= NULL;
int mbr_count= 0; int mbr_count= 0;
skipping to change at line 1701 skipping to change at line 1715
if(num[0] > gpt_count) if(num[0] > gpt_count)
gpt_count= num[0]; gpt_count= num[0];
} else if(strcmp(name, "APM partition name :") == 0) { } else if(strcmp(name, "APM partition name :") == 0) {
if(num[0] > apm_count) if(num[0] > apm_count)
apm_count= num[0]; apm_count= num[0];
} else if(strcmp(name, "ISO image size/512 :") == 0) { } else if(strcmp(name, "ISO image size/512 :") == 0) {
img_blocks= num[0]; img_blocks= num[0];
} else if(strcmp(name, "Partition offset :") == 0 &&
(num[0] == 0 || num[0] == 16)) {
partition_offset= num[0];
} }
} }
ret= Xorriso_highest_data_block(xorriso, &high_block, 0); ret= Xorriso_highest_data_block(xorriso, &high_block, 0);
if(ret < 0) if(ret < 0)
goto ex; goto ex;
if(ret == 0) if(ret == 0)
high_block = img_blocks - 1; high_block = img_blocks - 1;
if(elto_count > 0) { if(elto_count > 0) {
skipping to change at line 1753 skipping to change at line 1771
goto ex; goto ex;
if(mkisofs) if(mkisofs)
sprintf(buf, "-V "); sprintf(buf, "-V ");
else else
sprintf(buf, "-volid "); sprintf(buf, "-volid ");
volid= (char *) un0(iso_image_get_volume_id(image)); volid= (char *) un0(iso_image_get_volume_id(image));
Text_shellsafe(volid, buf, 1); Text_shellsafe(volid, buf, 1);
Xorriso_record_cmd_linE Xorriso_record_cmd_linE
ret= iso_image_get_pvd_times(image, &crt, &mdt, &ext, &eft); ret= iso_image_get_pvd_times(image, &crt, &mdt, &ext, &eft);
if(ret == ISO_SUCCESS) { if(ret == ISO_SUCCESS) {
if(mkisofs) uuid_time= crt;
sprintf(buf, "--modification-date="); /* If Creation Time is bad and Modification Time is ok: use the latter */
else ret= Decode_ecma119_format(&tm_erg, crt, 0);
sprintf(buf, "-volume_date uuid "); if(ret <= 0 || strlen(crt) != 16) {
ret= Decode_ecma119_format(&tm_erg, mdt, 0);
if(!(ret <= 0 || strlen(mdt) != 16))
uuid_time= mdt;
}
pad= 0; pad= 0;
for(j= 0; j < 16; j++) { for(j= 0; j < 16; j++) {
if(pad) { if(pad) {
uuid[j]= '0'; uuid[j]= '0';
} else if(crt[j] == 0) { } else if(uuid_time[j] == 0) {
pad= 1; pad= 1;
uuid[j]= '0'; uuid[j]= '0';
} else if(crt[j] < '0' || crt[j] > '9') { } else if(uuid_time[j] < '0' || uuid_time[j] > '9') {
uuid[j]= '0'; uuid[j]= '0';
} else { } else {
uuid[j]= crt[j]; uuid[j]= uuid_time[j];
} }
} }
uuid[16]= 0; uuid[16]= 0;
Text_shellsafe(uuid, buf, 1); ret= Decode_ecma119_format(&tm_erg, uuid, 0);
if(!(ret <= 0 || strlen(uuid) != 16)) {
if(mkisofs)
sprintf(buf, "--modification-date=");
else
sprintf(buf, "-volume_date uuid ");
Text_shellsafe(uuid, buf, 1);
Xorriso_record_cmd_linE
}
} }
Xorriso_record_cmd_linE
/* First pass: set up objects, record El Torito and info needed in 2nd pass */ /* First pass: set up objects, record El Torito and info needed in 2nd pass */
for(i= 0; i < line_count; i++) { for(i= 0; i < line_count; i++) {
buf[0]= 0; buf[0]= 0;
ret= Xorriso_split_report_line(xorriso, lines[i], 8, name, &contentpt, ret= Xorriso_split_report_line(xorriso, lines[i], 8, name, &contentpt,
num, &num_count, &textpt, 0); num, &num_count, &textpt, 0);
if(ret <= 0) if(ret <= 0)
goto ex; goto ex;
if(strcmp(name, "El Torito cat path :") == 0) { if(strcmp(name, "El Torito cat path :") == 0) {
skipping to change at line 1849 skipping to change at line 1878
} else if(strcmp(name, "MBR partition :") == 0) { } else if(strcmp(name, "MBR partition :") == 0) {
sscanf(contentpt, "%lu 0x%lx 0x%lx %lu %lu", sscanf(contentpt, "%lu 0x%lx 0x%lx %lu %lu",
&partno, &part_status, &part_type, &start_block, &num_blocks); &partno, &part_status, &part_type, &start_block, &num_blocks);
idx= partno - 1; idx= partno - 1;
mbrpts[idx].ptype= part_type; mbrpts[idx].ptype= part_type;
mbrpts[idx].start_block= start_block; mbrpts[idx].start_block= start_block;
mbrpts[idx].block_count= num_blocks; mbrpts[idx].block_count= num_blocks;
if(num_blocks > 0 && start_block + num_blocks > mbr_parts_end) if(num_blocks > 0 && start_block + num_blocks > mbr_parts_end)
mbr_parts_end= start_block + num_blocks; mbr_parts_end= start_block + num_blocks;
if(start_block == partition_offset * 4 &&
(start_block + num_blocks) >= high_block * 4 && iso_mbr_part_type < 0)
iso_mbr_part_type = part_type;
} else if(strcmp(name, "MBR partition path :") == 0) { } else if(strcmp(name, "MBR partition path :") == 0) {
idx= num[0] - 1; idx= num[0] - 1;
mbrpts[idx].has_path= 1; mbrpts[idx].has_path= 1;
} else if(strcmp(name, "GPT type GUID :") == 0) { } else if(strcmp(name, "GPT type GUID :") == 0) {
idx= num[0] - 1; idx= num[0] - 1;
if(strcmp(textpt, "a2a0d0ebe5b9334487c068b6b72699c7") == 0) if(strcmp(textpt, "a2a0d0ebe5b9334487c068b6b72699c7") == 0)
gpts[idx].ptype= 1; /* Basic data */ gpts[idx].ptype= 1; /* Basic data */
else if(strcmp(textpt, "005346480000aa11aa1100306543ecac") == 0) else if(strcmp(textpt, "005346480000aa11aa1100306543ecac") == 0)
gpts[idx].ptype= 2; /* HFS+ */ gpts[idx].ptype= 2; /* HFS+ */
else if(strcmp(textpt, "28732ac11ff8d211ba4b00a0c93ec93b") == 0) else if(strcmp(textpt, "28732ac11ff8d211ba4b00a0c93ec93b") == 0)
gpts[idx].ptype= 3; /* EFI System Partition */ gpts[idx].ptype= 3; /* EFI System Partition */
else else
gpts[idx].ptype= 0; gpts[idx].ptype= 0;
} else if(strcmp(name, "GPT start and size :") == 0) { } else if(strcmp(name, "GPT start and size :") == 0) {
idx= num[0] - 1; idx= num[0] - 1;
if(img_blocks <= num[1] && num[2] > 0) if(num[2] > 0)
appended_as_gpt= 1; appended_as_gpt= 1;
gpts[idx].start_block= num[1]; gpts[idx].start_block= num[1];
gpts[idx].block_count= num[2]; gpts[idx].block_count= num[2];
} else if(strcmp(name, "GPT partition path :") == 0) { } else if(strcmp(name, "GPT partition path :") == 0) {
idx= num[0] - 1; idx= num[0] - 1;
gpts[idx].has_path= 1; gpts[idx].has_path= 1;
gpts[idx].path= textpt; gpts[idx].path= textpt;
} else if(strcmp(name, "GPT partition name :") == 0) { } else if(strcmp(name, "GPT partition name :") == 0) {
skipping to change at line 2014 skipping to change at line 2046
} }
} else if(part_type == 0x41 && have_prep) { } else if(part_type == 0x41 && have_prep) {
if(mkisofs) { if(mkisofs) {
sprintf(buf, "-prep-boot-part "); sprintf(buf, "-prep-boot-part ");
} else { } else {
sprintf(buf, "-boot_image any prep_boot_part="); sprintf(buf, "-boot_image any prep_boot_part=");
} }
Xorriso_add_intvl_adr(xorriso, buf, (uint64_t) start_block, Xorriso_add_intvl_adr(xorriso, buf, (uint64_t) start_block,
((uint64_t) start_block) + num_blocks - 1, "d", ((uint64_t) start_block) + num_blocks - 1, "d",
imported_iso); imported_iso);
} else if((part_status & 0x80) && part_type == 0x00 && } else if((part_status & 0x80) && part_type == 0x00 &&
start_block == 0 && num_blocks == 1) { start_block == 0 && num_blocks == 1) {
if(mkisofs) if(mkisofs)
sprintf(buf, "--mbr-force-bootable"); sprintf(buf, "--mbr-force-bootable");
else else
sprintf(buf, "-boot_image any mbr_force_bootable=on"); sprintf(buf, "-boot_image any mbr_force_bootable=on");
} }
} else if(strcmp(name, "MBR partition path :") == 0) { } else if(strcmp(name, "MBR partition path :") == 0) {
idx= num[0] - 1; idx= num[0] - 1;
if(mbrpts[idx].ptype == 0x41) { if(mbrpts[idx].ptype == 0x41) {
sprintf(xorriso->info_text, sprintf(xorriso->info_text,
"Cannot make proposal to mark PReP partition by data file: "); "Cannot make proposal to mark PReP partition by data file: ");
skipping to change at line 2095 skipping to change at line 2127
} else if(strcmp(name, "GPT start and size :") == 0) { } else if(strcmp(name, "GPT start and size :") == 0) {
idx= num[0] - 1; idx= num[0] - 1;
if(gpts[idx].ptype == 3) if(gpts[idx].ptype == 3)
part_type= 0xef; part_type= 0xef;
else else
part_type= 0xcd; part_type= 0xcd;
if(high_block < num[1] && num[2] > 0 && !gpts[idx].is_gap) { if(high_block < num[1] && num[2] > 0 && !gpts[idx].is_gap) {
for(mbr_idx = 0; mbr_idx < mbr_count; mbr_idx++) { for(mbr_idx = 0; mbr_idx < mbr_count; mbr_idx++) {
if(mbrpts[mbr_idx].start_block == num[1] && if(mbrpts[mbr_idx].start_block == num[1]) {
mbrpts[mbr_idx].block_count == num[2]) if(mbrpts[mbr_idx].block_count != num[2] && !(flag & 1)) {
sprintf(xorriso->info_text,
"GPT partition %d has same start block as MBR partition %d
but different block count (%.f <> %.f)",
idx + 1, mbr_idx + 1, num[2],
(double) mbrpts[mbr_idx].block_count);
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "WARNING",
0);
}
break; break;
}
} }
if(mbr_idx >= mbr_count) { if(mbr_idx >= mbr_count) {
if(appended_as_gpt == 1) { if(appended_as_gpt == 1)
if(mkisofs)
sprintf(buf, "-appended_part_as_gpt");
else
sprintf(buf, "-boot_image any appended_part_as=gpt");
Xorriso_record_cmd_linE
appended_as_gpt= 2; appended_as_gpt= 2;
}
sprintf(buf, "-append_partition %d 0x%lx ", idx + 1, part_type); sprintf(buf, "-append_partition %d 0x%lx ", idx + 1, part_type);
Xorriso_add_intvl_adr(xorriso, buf, (uint64_t) num[1], Xorriso_add_intvl_adr(xorriso, buf, (uint64_t) num[1],
(uint64_t) (num[1] + num[2] - 1.0), "d", (uint64_t) (num[1] + num[2] - 1.0), "d",
imported_iso); imported_iso);
Xorriso_record_cmd_linE
buf[0]= 0;
appended_partition= 1; appended_partition= 1;
} }
ret= Xorriso_search_eltorito_lba(xorriso, et_imgs, elto_count, /* Check for isohybri-ish MBR and GPT mix */
(unsigned int) (num[1] / 4.0), if(mbr_count == 1 && mbrpts[0].ptype == 0xee && have_protective_msdos) {
&et_idx, 0); /* real GPT is not -part_like_isohybrid */
ret= 0;
} else {
ret= Xorriso_search_eltorito_lba(xorriso, et_imgs, elto_count,
(unsigned int) (num[1] / 4.0),
&et_idx, 0);
}
if(ret > 0) { if(ret > 0) {
if(!(et_imgs[et_idx].do_gpt_basdat || if(!(et_imgs[et_idx].do_gpt_basdat ||
et_imgs[et_idx].do_gpt_hfsplus || et_imgs[et_idx].do_gpt_hfsplus ||
part_like_isohybrid)) { part_like_isohybrid)) {
if(mkisofs) if(mkisofs)
sprintf(buf, "-part_like_isohybrid"); sprintf(buf, "-part_like_isohybrid");
else else
sprintf(buf, "-boot_image any part_like_isohybrid=on"); sprintf(buf, "-boot_image any part_like_isohybrid=on");
Xorriso_record_cmd_linE Xorriso_record_cmd_linE
buf[0]= 0; buf[0]= 0;
part_like_isohybrid= 1; part_like_isohybrid= 1;
appended_as_gpt= 0;
} }
/* mark el torito for -isohybrid-gpt-... */ /* mark el torito for -isohybrid-gpt-... */
Xorriso_register_eltorito_gpt(xorriso, et_imgs + et_idx, Xorriso_register_eltorito_gpt(xorriso, et_imgs + et_idx,
gpts[idx].ptype, &efi_boot_part, gpts[idx].ptype, &efi_boot_part,
&fe_dummy, 1); &fe_dummy, 1);
} }
} else if(gpts[idx].ptype == 3 && gpts[idx].has_path == 0 && } else if(gpts[idx].ptype == 3 && gpts[idx].has_path == 0 &&
img_blocks >= num[1] + num[2] && !efi_boot_part) { img_blocks >= num[1] + num[2] && !efi_boot_part) {
if(mkisofs) if(mkisofs)
skipping to change at line 2312 skipping to change at line 2355
else else
sprintf(buf, "-boot_image any alpha_boot="); sprintf(buf, "-boot_image any alpha_boot=");
Text_shellsafe(textpt, buf, 1); Text_shellsafe(textpt, buf, 1);
} }
if(buf[0]) if(buf[0])
Xorriso_record_cmd_linE Xorriso_record_cmd_linE
} }
if(appended_as_gpt == 2) {
if(mkisofs)
sprintf(buf, "-appended_part_as_gpt");
else
sprintf(buf, "-boot_image any appended_part_as=gpt");
Xorriso_record_cmd_linE
}
if(have_sparc_part) { if(have_sparc_part) {
if(full_sparc_part == 255) { if(full_sparc_part == 255) {
if(mkisofs) { if(mkisofs) {
sprintf(buf, "-G "); sprintf(buf, "-G ");
Xorriso_add_intvl_adr(xorriso, buf, (uint64_t) 0, (uint64_t) 15, "s", Xorriso_add_intvl_adr(xorriso, buf, (uint64_t) 0, (uint64_t) 15, "s",
imported_iso); imported_iso);
Xorriso_record_cmd_linE Xorriso_record_cmd_linE
did_sysarea= 1; did_sysarea= 1;
sprintf(buf, "-B ..."); sprintf(buf, "-B ...");
Xorriso_record_cmd_linE Xorriso_record_cmd_linE
skipping to change at line 2351 skipping to change at line 2402
/* Zeroize old partition tables from -indev */ /* Zeroize old partition tables from -indev */
if(mkisofs) if(mkisofs)
sprintf(buf, "-G "); sprintf(buf, "-G ");
else else
sprintf(buf, "-boot_image any system_area="); sprintf(buf, "-boot_image any system_area=");
Xorriso_add_intvl_adr(xorriso, buf, (uint64_t) 0, (uint64_t) 15, "s", Xorriso_add_intvl_adr(xorriso, buf, (uint64_t) 0, (uint64_t) 15, "s",
imported_iso | ptable_killer); imported_iso | ptable_killer);
Xorriso_record_cmd_linE Xorriso_record_cmd_linE
did_sysarea= 1; did_sysarea= 1;
} }
if(iso_mbr_part_type >= 0) {
if(mkisofs)
sprintf(buf, "-iso_mbr_part_type 0x%2.2x",
(unsigned int) iso_mbr_part_type);
else
sprintf(buf, "-boot_image any iso_mbr_part_type=0x%2.2x",
(unsigned int) iso_mbr_part_type);
Xorriso_record_cmd_linE
}
/* Issue commands related to El Torito */ /* Issue commands related to El Torito */
if(elto_count <= 0) if(elto_count <= 0)
goto after_el_torito; goto after_el_torito;
if(efi_boot_part) { if(efi_boot_part) {
if(mkisofs) if(mkisofs)
sprintf(buf, "-efi-boot-part --efi-boot-image"); sprintf(buf, "-efi-boot-part --efi-boot-image");
else else
sprintf(buf, "-boot_image any efi_boot_part=--efi-boot-image"); sprintf(buf, "-boot_image any efi_boot_part=--efi-boot-image");
skipping to change at line 2455 skipping to change at line 2515
if(!(flag & 1)) { if(!(flag & 1)) {
sprintf(xorriso->info_text, sprintf(xorriso->info_text,
"Cannot enable EL Torito boot image #%d because it is not a data f ile in the ISO filesystem", "Cannot enable EL Torito boot image #%d because it is not a data f ile in the ISO filesystem",
idx + 1); idx + 1);
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0);
} }
buf[0]= 0; buf[0]= 0;
continue; continue;
} }
} }
if(et_imgs[idx].platform_id == 0) { if(et_imgs[idx].platform_id != 0xef) {
if(mkisofs) if(mkisofs) {
if(prev_pltf != et_imgs[idx].platform_id) {
sprintf(buf, "-eltorito-platform 0x%2.2x", et_imgs[idx].platform_id);
Xorriso_record_cmd_linE
}
prev_pltf= et_imgs[idx].platform_id;
sprintf(buf, "-b "); sprintf(buf, "-b ");
else } else {
sprintf(buf, "-boot_image %s bin_path=", et_imgs[idx].boot_image_type); sprintf(buf, "-boot_image %s bin_path=", et_imgs[idx].boot_image_type);
} else if(et_imgs[idx].platform_id == 0xef) { }
} else {
if(mkisofs) if(mkisofs)
sprintf(buf, "-e "); sprintf(buf, "-e ");
else else
sprintf(buf, "-boot_image %s efi_path=", et_imgs[idx].boot_image_type); sprintf(buf, "-boot_image %s efi_path=", et_imgs[idx].boot_image_type);
} else {
if(mkisofs && !(flag & 1)) {
sprintf(xorriso->info_text,
"Cannot enable EL Torito boot image #%d because Platform Id 0x%2.
2x cannot be expressed in mkisofs emulation",
idx + 1, et_imgs[idx].platform_id);
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0);
continue;
}
} }
Text_shellsafe(et_imgs[idx].path, buf, 1); Text_shellsafe(et_imgs[idx].path, buf, 1);
Xorriso_record_cmd_linE Xorriso_record_cmd_linE
if(!mkisofs) { if(!mkisofs) {
sprintf(buf, "-boot_image any platform_id=0x%2.2x", sprintf(buf, "-boot_image any platform_id=0x%2.2x",
et_imgs[idx].platform_id); et_imgs[idx].platform_id);
Xorriso_record_cmd_linE Xorriso_record_cmd_linE
} }
if(strcmp(et_imgs[idx].emul, "none") == 0) { if(strcmp(et_imgs[idx].emul, "none") == 0) {
if(mkisofs) if(mkisofs)
 End of changes. 34 change blocks. 
45 lines changed or deleted 103 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)