From 48ae8acbd66b409fee3d0bdb7159bd10375065e5 Mon Sep 17 00:00:00 2001 From: Thomas Schmitt Date: Wed, 24 Nov 2010 10:06:19 +0100 Subject: [PATCH] Better handling of El Torito boot images with identical block address at image load time. --- libisofs/fs_image.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/libisofs/fs_image.c b/libisofs/fs_image.c index ba73009..d9903b3 100644 --- a/libisofs/fs_image.c +++ b/libisofs/fs_image.c @@ -2796,8 +2796,17 @@ int image_builder_create_node(IsoNodeBuilder *builder, IsoImage *image, break; if (idx < fsdata->num_bootimgs) { /* it is boot image node */ - if (image->bootcat->bootimages[idx]->image != NULL) { + /* idx is already occupied, try to find unoccupied one + which has the same block address. + */ + for (; idx < fsdata->num_bootimgs; idx++) + if (fsdata->eltorito && data->sections[0].block == + fsdata->bootblocks[idx] && + image->bootcat->bootimages[idx]->image == NULL) + break; + } + if (idx >= fsdata->num_bootimgs) { ret = iso_msg_submit(image->id, ISO_EL_TORITO_WARN, 0, "More than one ISO node has been found for the same boot image."); if (ret < 0) {