"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "libisofs/eltorito.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.

eltorito.c  (xorriso-1.4.6):eltorito.c  (xorriso-1.4.8)
skipping to change at line 116 skipping to change at line 116
return; return;
if (sectors < 0) if (sectors < 0)
bootimg->load_size = 0x10000 + sectors; bootimg->load_size = 0x10000 + sectors;
else else
bootimg->load_size = sectors; bootimg->load_size = sectors;
} }
/* API */ /* API */
int el_torito_get_load_size(ElToritoBootImage *bootimg) int el_torito_get_load_size(ElToritoBootImage *bootimg)
{ {
return (int) bootimg->load_size; return (int) bootimg->load_size;
}
/* API */
void el_torito_set_full_load(ElToritoBootImage *bootimg, int mode)
{
if (bootimg->type != 0)
return;
bootimg->load_size_full= !!mode;
}
/* API */
int el_torito_get_full_load(ElToritoBootImage *bootimg)
{
return bootimg->load_size_full;
} }
/** /**
* Marks the specified boot image as not bootable * Marks the specified boot image as not bootable
*/ */
void el_torito_set_no_bootable(ElToritoBootImage *bootimg) void el_torito_set_no_bootable(ElToritoBootImage *bootimg)
{ {
bootimg->bootable = 0; bootimg->bootable = 0;
} }
skipping to change at line 515 skipping to change at line 529
iso_node_ref(imgfile); /* get our ref */ iso_node_ref(imgfile); /* get our ref */
boot->bootable = 1; boot->bootable = 1;
boot->seems_boot_info_table = 0; boot->seems_boot_info_table = 0;
boot->seems_grub2_boot_info = 0; boot->seems_grub2_boot_info = 0;
boot->seems_isohybrid_capable = 0; boot->seems_isohybrid_capable = 0;
boot->isolinux_options = 0; boot->isolinux_options = 0;
boot->type = boot_media_type; boot->type = boot_media_type;
boot->partition_type = partition_type; boot->partition_type = partition_type;
boot->load_seg = 0; boot->load_seg = 0;
boot->load_size = load_sectors; boot->load_size = load_sectors;
boot->load_size_full = 0;
boot->platform_id = 0; /* 80x86 */ boot->platform_id = 0; /* 80x86 */
memset(boot->id_string, 0, sizeof(boot->id_string)); memset(boot->id_string, 0, sizeof(boot->id_string));
memset(boot->selection_crit, 0, sizeof(boot->selection_crit)); memset(boot->selection_crit, 0, sizeof(boot->selection_crit));
*bootimg = boot; *bootimg = boot;
return ISO_SUCCESS; return ISO_SUCCESS;
} }
int iso_image_set_boot_image(IsoImage *image, const char *image_path, int iso_image_set_boot_image(IsoImage *image, const char *image_path,
enum eltorito_boot_media_type type, enum eltorito_boot_media_type type,
skipping to change at line 888 skipping to change at line 903
e->header_indicator[0] = e->header_indicator[0] =
0x90 + (idx == t->catalog->num_bootimages - num_entries); 0x90 + (idx == t->catalog->num_bootimages - num_entries);
e->platform_id[0] = t->catalog->bootimages[idx]->platform_id; e->platform_id[0] = t->catalog->bootimages[idx]->platform_id;
e->num_entries[0] = num_entries & 0xff; e->num_entries[0] = num_entries & 0xff;
e->num_entries[1] = (num_entries >> 8) & 0xff;; e->num_entries[1] = (num_entries >> 8) & 0xff;;
id_string = (char *) e->id_string; id_string = (char *) e->id_string;
memcpy(id_string, t->catalog->bootimages[idx]->id_string, memcpy(id_string, t->catalog->bootimages[idx]->id_string,
sizeof(e->id_string)); sizeof(e->id_string));
} }
static int
write_section_load_size(struct el_torito_boot_image *img,
struct el_torito_section_entry *se,
uint16_t load_size, off_t full_byte_size, int flag)
{
uint16_t size;
off_t blocks;
size= load_size;
if(img->type == 0 && img->load_size_full) {
blocks= ((full_byte_size + 2047) / 2048) * 4;
if (blocks > 65535) {
if (img->platform_id == 0xef)
size= 0;
else
size= 65535;
} else if(blocks <= 0) {
size= 1;
} else {
size= blocks;
}
}
iso_lsb(se->sec_count, size, 2);
return(1);
}
/** /**
* Write one section entry. * Write one section entry.
* Usable for the Default Entry * Usable for the Default Entry
* and for Section Entries with Selection criteria type == 0 * and for Section Entries with Selection criteria type == 0
*/ */
static static
int write_section_entry(uint8_t *buf, Ecma119Image *t, int idx) int write_section_entry(uint8_t *buf, Ecma119Image *t, int idx)
{ {
struct el_torito_boot_image *img; struct el_torito_boot_image *img;
struct el_torito_section_entry *se = struct el_torito_section_entry *se =
skipping to change at line 931 skipping to change at line 972
if (mode == 1) { if (mode == 1) {
if (t->boot_intvl_start[idx] + (t->boot_intvl_size[idx] + 3) / 4 > if (t->boot_intvl_start[idx] + (t->boot_intvl_size[idx] + 3) / 4 >
t->total_size / 2048 + t->opts->ms_block - t->eff_partition_offset t->total_size / 2048 + t->opts->ms_block - t->eff_partition_offset
) { ) {
iso_msg_submit(t->image->id, ISO_BOOT_IMAGE_NOT_VALID, 0, iso_msg_submit(t->image->id, ISO_BOOT_IMAGE_NOT_VALID, 0,
"Block interval which shall serve as boot image is outside result range"); "Block interval which shall serve as boot image is outside result range");
return ISO_BOOT_IMAGE_NOT_VALID; return ISO_BOOT_IMAGE_NOT_VALID;
} }
/* >>> check for non-automatic load size */;
if (t->boot_intvl_size[idx] > 65535) { if (t->boot_intvl_size[idx] > 65535) {
if (img->platform_id == 0xef) if (img->platform_id == 0xef)
iso_lsb(se->sec_count, 0, 2); iso_lsb(se->sec_count, 0, 2);
else else
iso_lsb(se->sec_count, 65535, 2); iso_lsb(se->sec_count, 65535, 2);
} else { } else {
if (t->boot_intvl_size[idx] == 0) { if (t->boot_intvl_size[idx] == 0) {
iso_msg_submit(t->image->id, ISO_BOOT_IMAGE_NOT_VALID, 0, iso_msg_submit(t->image->id, ISO_BOOT_IMAGE_NOT_VALID, 0,
"Block interval which shall serve as boot image has zero size"); "Block interval which shall serve as boot image has zero size");
return ISO_BOOT_IMAGE_NOT_VALID; return ISO_BOOT_IMAGE_NOT_VALID;
} }
iso_lsb(se->sec_count, t->boot_intvl_size[idx], 2); iso_lsb(se->sec_count, t->boot_intvl_size[idx], 2);
} }
iso_lsb(se->block, t->boot_intvl_start[idx], 4); iso_lsb(se->block, t->boot_intvl_start[idx], 4);
} else if (mode == 2) { } else if (mode == 2) {
app_idx = t->boot_appended_idx[idx]; app_idx = t->boot_appended_idx[idx];
/* >>> check for non-automatic load size */;
if (t->appended_part_size[app_idx] * 4 > 65535) { if (t->appended_part_size[app_idx] * 4 > 65535) {
if (img->platform_id == 0xef) if (img->platform_id == 0xef)
iso_lsb(se->sec_count, 0, 2); iso_lsb(se->sec_count, 0, 2);
else else
iso_lsb(se->sec_count, 65535, 2); iso_lsb(se->sec_count, 65535, 2);
} else { } else {
iso_lsb(se->sec_count, t->appended_part_size[app_idx] * 4, 2); iso_lsb(se->sec_count, t->appended_part_size[app_idx] * 4, 2);
} }
iso_lsb(se->block, t->appended_part_start[app_idx], 4); iso_lsb(se->block, t->appended_part_start[app_idx], 4);
} else { } else {
iso_lsb(se->sec_count, img->load_size, 2); write_section_load_size(img, se, (uint16_t) img->load_size,
(off_t) t->bootsrc[idx]->sections[0].size, 0);
iso_lsb(se->block, t->bootsrc[idx]->sections[0].block, 4); iso_lsb(se->block, t->bootsrc[idx]->sections[0].block, 4);
} }
se->selec_criteria[0] = img->selection_crit[0]; se->selec_criteria[0] = img->selection_crit[0];
memcpy(se->vendor_sc, img->selection_crit + 1, 19); memcpy(se->vendor_sc, img->selection_crit + 1, 19);
return ISO_SUCCESS; return ISO_SUCCESS;
} }
static static
int catalog_open(IsoStream *stream) int catalog_open(IsoStream *stream)
skipping to change at line 1455 skipping to change at line 1502
for (idx = 0; idx < target->catalog->num_bootimages; idx++) { for (idx = 0; idx < target->catalog->num_bootimages; idx++) {
target->bootsrc[idx] = NULL; target->bootsrc[idx] = NULL;
if (target->catalog->bootimages[idx]->appended_idx >= 0) { if (target->catalog->bootimages[idx]->appended_idx >= 0) {
/* Use an appended partition as boot image rather than IsoFile */ /* Use an appended partition as boot image rather than IsoFile */
target->boot_appended_idx[idx] = target->boot_appended_idx[idx] =
target->catalog->bootimages[idx]->appended_idx; target->catalog->bootimages[idx]->appended_idx;
target->boot_intvl_start[idx] = target->boot_intvl_start[idx] =
target->catalog->bootimages[idx]->appended_start; target->catalog->bootimages[idx]->appended_start;
target->boot_intvl_size[idx] = target->boot_intvl_size[idx] =
target->catalog->bootimages[idx]->appended_size; target->catalog->bootimages[idx]->appended_size;
if (((target->system_area_options >> 2) & 0x3f) == 0 &&
(target->system_area_options & 3) == 1) {
/* ISO will not be a partition. It can span the whole image. */
target->pvd_size_is_total_size = 1;
}
continue; continue;
} }
bootimg = target->catalog->bootimages[idx]->image; bootimg = target->catalog->bootimages[idx]->image;
ret = iso_file_src_create(target, bootimg, &src); ret = iso_file_src_create(target, bootimg, &src);
if (ret < 0) { if (ret < 0) {
return ret; return ret;
} }
target->bootsrc[idx] = src; target->bootsrc[idx] = src;
 End of changes. 7 change blocks. 
7 lines changed or deleted 49 lines changed or added

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