Removed most of the development remarks of 0.6.31

This commit is contained in:
Thomas Schmitt 2010-05-01 20:38:01 +02:00
parent 4978424328
commit eb23260459
4 changed files with 6 additions and 69 deletions

View File

@ -455,7 +455,6 @@ struct ecma119_image
struct el_torito_boot_catalog *catalog; struct el_torito_boot_catalog *catalog;
IsoFileSrc *cat; /**< location of the boot catalog in the new image */ IsoFileSrc *cat; /**< location of the boot catalog in the new image */
/* ts B00420 */
int num_bootsrc; int num_bootsrc;
IsoFileSrc **bootsrc; /* location of the boot images in the new image */ IsoFileSrc **bootsrc; /* location of the boot images in the new image */

View File

@ -640,8 +640,7 @@ void iso_image_remove_boot_image(IsoImage *image)
image->bootcat = NULL; image->bootcat = NULL;
} }
/* ts B00420 */ /* API */
/* future API */
int iso_image_add_boot_image(IsoImage *image, const char *image_path, int iso_image_add_boot_image(IsoImage *image, const char *image_path,
enum eltorito_boot_media_type type, int flag, enum eltorito_boot_media_type type, int flag,
ElToritoBootImage **boot) ElToritoBootImage **boot)
@ -797,8 +796,7 @@ int catalog_open(IsoStream *stream)
/* write default entry = first boot image */ /* write default entry = first boot image */
write_section_entry(data->buffer + 32, data->target, 0); write_section_entry(data->buffer + 32, data->target, 0);
/* ts B00420 */ /* IMPORTANT: The maximum number of boot images must fit into BLOCK_SIZE */
/* (The maximum number of boot images must fit into BLOCK_SIZE) */
wpt = data->buffer + 64; wpt = data->buffer + 64;
for (i = 1; i < cat->num_bootimages; ) { for (i = 1; i < cat->num_bootimages; ) {
/* Look ahead and put images of same platform_id and id_string /* Look ahead and put images of same platform_id and id_string
@ -1043,11 +1041,6 @@ int make_boot_info_table(uint8_t *buf, uint32_t pvd_lba,
static static
int patch_boot_image(uint8_t *buf, Ecma119Image *t, size_t imgsize, int idx) int patch_boot_image(uint8_t *buf, Ecma119Image *t, size_t imgsize, int idx)
{ {
/* >>> ts B00428 BOOT : make this the default case */
#define Libisofs_new_patch_boot_imagE 1
#ifdef Libisofs_new_patch_boot_imagE
int ret; int ret;
if (imgsize < 64) { if (imgsize < 64) {
@ -1058,48 +1051,6 @@ int patch_boot_image(uint8_t *buf, Ecma119Image *t, size_t imgsize, int idx)
t->bootsrc[idx]->sections[0].block, t->bootsrc[idx]->sections[0].block,
(uint32_t) imgsize); (uint32_t) imgsize);
return ret; return ret;
#else /* Libisofs_new_patch_boot_imagE */
struct boot_info_table *info;
uint32_t checksum;
size_t offset;
if (imgsize < 64) {
return iso_msg_submit(t->image->id, ISO_ISOLINUX_CANT_PATCH, 0,
"Isolinux image too small. We won't patch it.");
}
/* compute checksum, as the the sum of all 32 bit words in boot image
* from offset 64 */
checksum = 0;
offset = (size_t) 64;
while (offset <= imgsize - 4) {
checksum += iso_read_lsb(buf + offset, 4);
offset += 4;
}
if (offset != imgsize) {
/*
* file length not multiple of 4
* empty space in isofs is padded with zero;
* assume same for last dword
*/
checksum += iso_read_lsb(buf + offset, imgsize - offset);
}
/* patch boot info table */
info = (struct boot_info_table*)(buf + 8);
/*memset(info, 0, sizeof(struct boot_info_table));*/
iso_lsb(info->bi_pvd, t->ms_block + 16, 4);
iso_lsb(info->bi_file, t->bootsrc[idx]->sections[0].block, 4);
iso_lsb(info->bi_length, imgsize, 4);
iso_lsb(info->bi_csum, checksum, 4);
memset(buf + 24, 0, 40);
return ISO_SUCCESS;
#endif /* ! Libisofs_new_patch_boot_imagE */
} }
static static
@ -1122,7 +1073,6 @@ int eltorito_writer_compute_data_blocks(IsoImageWriter *writer)
t = writer->target; t = writer->target;
/* ts B00420 : now in loop */
/* Patch the boot image info tables if indicated */ /* Patch the boot image info tables if indicated */
for (idx = 0; idx < t->catalog->num_bootimages; idx++) { for (idx = 0; idx < t->catalog->num_bootimages; idx++) {
if (!(t->catalog->bootimages[idx]->isolinux_options & 0x01)) if (!(t->catalog->bootimages[idx]->isolinux_options & 0x01))
@ -1242,7 +1192,6 @@ int eltorito_writer_create(Ecma119Image *target)
} }
} }
/* ts B00420 : now in a loop */
for (idx = 0; idx < target->catalog->num_bootimages; idx++) { for (idx = 0; idx < target->catalog->num_bootimages; idx++) {
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);

View File

@ -34,12 +34,10 @@ struct Iso_Boot
struct el_torito_boot_catalog { struct el_torito_boot_catalog {
IsoBoot *node; /* node of the catalog */ IsoBoot *node; /* node of the catalog */
/* ts B00419 */
int num_bootimages; int num_bootimages;
struct el_torito_boot_image *bootimages[Libisofs_max_boot_imageS]; struct el_torito_boot_image *bootimages[Libisofs_max_boot_imageS];
/* [0]= default boot image */ /* [0]= default boot image */
/* ts B00419 */
/* Weight value for image sorting */ /* Weight value for image sorting */
int sort_weight; int sort_weight;
}; };
@ -64,7 +62,6 @@ struct el_torito_boot_image {
short load_seg; /**< Load segment for the initial boot image. */ short load_seg; /**< Load segment for the initial boot image. */
short load_size; /**< Number of sectors to load. */ short load_size; /**< Number of sectors to load. */
/* ts B00419 */
/* Byte 1 of Validation Entry or Section Header Entry: /* Byte 1 of Validation Entry or Section Header Entry:
0= 80x86, 1= PowerPC, 2= Mac, 0xef= EFI */ 0= 80x86, 1= PowerPC, 2= Mac, 0xef= EFI */
uint8_t platform_id; uint8_t platform_id;

View File

@ -279,7 +279,6 @@ typedef struct
/* el-torito information */ /* el-torito information */
unsigned int eltorito : 1; /* is el-torito available */ unsigned int eltorito : 1; /* is el-torito available */
/* ts B00419 */
int num_bootimgs; int num_bootimgs;
unsigned char platform_ids[Libisofs_max_boot_imageS]; unsigned char platform_ids[Libisofs_max_boot_imageS];
unsigned char id_strings[Libisofs_max_boot_imageS][28]; unsigned char id_strings[Libisofs_max_boot_imageS][28];
@ -2249,7 +2248,6 @@ int read_el_torito_boot_catalog(_ImageFsData *data, uint32_t block)
entry = (struct el_torito_section_entry *)(buffer + 32); entry = (struct el_torito_section_entry *)(buffer + 32);
data->eltorito = 1; data->eltorito = 1;
/* ts B00420 */
/* The Default Entry is declared mandatory */ /* The Default Entry is declared mandatory */
data->num_bootimgs = 1; data->num_bootimgs = 1;
data->platform_ids[0] = ve->platform_id[0]; data->platform_ids[0] = ve->platform_id[0];
@ -2264,7 +2262,7 @@ int read_el_torito_boot_catalog(_ImageFsData *data, uint32_t block)
/* The Default Entry has no selection criterion */ /* The Default Entry has no selection criterion */
memset(data->selection_crits[0], 0, 20); memset(data->selection_crits[0], 0, 20);
/* ts B00420 : Read eventual more entries from the boot catalog */ /* Read eventual more entries from the boot catalog */
last_done = 0; last_done = 0;
for (rx = 64; (buffer[rx] & 0xfe) == 0x90 && !last_done; rx += 32) { for (rx = 64; (buffer[rx] & 0xfe) == 0x90 && !last_done; rx += 32) {
last_done = buffer[rx] & 1; last_done = buffer[rx] & 1;
@ -2783,7 +2781,6 @@ int image_builder_create_node(IsoNodeBuilder *builder, IsoImage *image,
new = (IsoNode*) file; new = (IsoNode*) file;
new->refcount = 0; new->refcount = 0;
/* ts B00419 */
for (idx = 0; idx < fsdata->num_bootimgs; idx++) for (idx = 0; idx < fsdata->num_bootimgs; idx++)
if (fsdata->eltorito && data->sections[0].block == if (fsdata->eltorito && data->sections[0].block ==
fsdata->bootblocks[idx]) fsdata->bootblocks[idx])
@ -2998,8 +2995,6 @@ int create_boot_img_filesrc(IsoImageFilesystem *fs, IsoImage *image, int idx,
ifsdata->parent = NULL; ifsdata->parent = NULL;
ifsdata->info = atts; ifsdata->info = atts;
ifsdata->name = NULL; ifsdata->name = NULL;
/* ts B00420 */
ifsdata->sections[0].block = fsdata->bootblocks[idx]; ifsdata->sections[0].block = fsdata->bootblocks[idx];
ifsdata->sections[0].size = BLOCK_SIZE; ifsdata->sections[0].size = BLOCK_SIZE;
ifsdata->nsections = 1; ifsdata->nsections = 1;
@ -3017,10 +3012,11 @@ boot_fs_cleanup: ;
return ret; return ret;
} }
/** ??? ts B00428 : should the max size become public ? */ /** ??? >>> ts B00428 : should the max size become public ? */
#define Libisofs_boot_image_max_sizE (4096*1024) #define Libisofs_boot_image_max_sizE (4096*1024)
/** ts B00428 BOOT : perform boot-info-table detection /** Guess which of the loaded boot images contain boot information tables.
Set boot->seems_boot_info_table accordingly.
*/ */
static static
int iso_image_eval_boot_info_table(IsoImage *image, struct iso_read_opts *opts, int iso_image_eval_boot_info_table(IsoImage *image, struct iso_read_opts *opts,
@ -3243,7 +3239,6 @@ int iso_image_import(IsoImage *image, IsoDataSource *src,
goto import_revert; goto import_revert;
} }
/* ts B00421 */
catalog->num_bootimages = 0; catalog->num_bootimages = 0;
for (idx = 0; idx < data->num_bootimgs; idx++) { for (idx = 0; idx < data->num_bootimgs; idx++) {
boot_image = calloc(1, sizeof(ElToritoBootImage)); boot_image = calloc(1, sizeof(ElToritoBootImage));
@ -3301,8 +3296,6 @@ int iso_image_import(IsoImage *image, IsoDataSource *src,
if (data->eltorito) { if (data->eltorito) {
/* if catalog and boot image nodes were not filled, /* if catalog and boot image nodes were not filled,
we create them here */ we create them here */
/* ts B00419 : now in a loop */
for (idx = 0; idx < image->bootcat->num_bootimages; idx++) { for (idx = 0; idx < image->bootcat->num_bootimages; idx++) {
if (image->bootcat->bootimages[idx]->image != NULL) if (image->bootcat->bootimages[idx]->image != NULL)
continue; continue;
@ -3426,7 +3419,6 @@ int iso_image_import(IsoImage *image, IsoDataSource *src,
#endif /* Libisofs_with_checksumS */ #endif /* Libisofs_with_checksumS */
/* ts B00428 */
ret = iso_image_eval_boot_info_table(image, opts, src, data->nblocks, 0); ret = iso_image_eval_boot_info_table(image, opts, src, data->nblocks, 0);
if (ret < 0) if (ret < 0)
goto import_revert; goto import_revert;