Improved message at image load time about hidden El Torito images for EFI

This commit is contained in:
Thomas Schmitt 2018-06-10 19:51:47 +02:00
parent f39d4eefee
commit 69c8c543a9
3 changed files with 18 additions and 1 deletions

View File

@ -5885,6 +5885,7 @@ int iso_image_import(IsoImage *image, IsoDataSource *src,
memcpy(boot_image->id_string, data->id_strings[idx], 28); memcpy(boot_image->id_string, data->id_strings[idx], 28);
memcpy(boot_image->selection_crit, data->selection_crits, 20); memcpy(boot_image->selection_crit, data->selection_crits, 20);
boot_image->appended_idx = -1; boot_image->appended_idx = -1;
boot_image->appended_start = data->bootblocks[idx];
catalog->bootimages[catalog->num_bootimages] = boot_image; catalog->bootimages[catalog->num_bootimages] = boot_image;
boot_image = NULL; boot_image = NULL;
@ -5956,10 +5957,21 @@ int iso_image_import(IsoImage *image, IsoDataSource *src,
/* warn about hidden images */ /* warn about hidden images */
iso_msg_submit(image->id, ISO_EL_TORITO_HIDDEN, 0, if (image->bootcat->bootimages[idx]->platform_id == 0xef) {
iso_msg_submit(image->id, ISO_ELTO_EFI_HIDDEN, 0,
"Found hidden El-Torito image for EFI.");
iso_msg_submit(image->id, ISO_GENERAL_NOTE, 0,
"EFI image start and size: %lu * 2048 , %lu * 512",
(unsigned long int)
image->bootcat->bootimages[idx]->appended_start,
(unsigned long int)
image->bootcat->bootimages[idx]->load_size);
} else {
iso_msg_submit(image->id, ISO_EL_TORITO_HIDDEN, 0,
"Found hidden El-Torito image. Its size could not " "Found hidden El-Torito image. Its size could not "
"be figured out, so image modify or boot image " "be figured out, so image modify or boot image "
"patching may lead to bad results."); "patching may lead to bad results.");
}
} }
if (image->bootcat->node == NULL) { if (image->bootcat->node == NULL) {
IsoNode *node; IsoNode *node;

View File

@ -8955,6 +8955,9 @@ int iso_conv_name_chars(IsoWriteOpts *opts, char *name, size_t name_len,
(FAILURE, HIGH, -420) */ (FAILURE, HIGH, -420) */
#define ISO_MULTI_OVER_IMPORTED 0xE830FE5C #define ISO_MULTI_OVER_IMPORTED 0xE830FE5C
/** El-Torito EFI image is hidden (NOTE,HIGH, -421) */
#define ISO_ELTO_EFI_HIDDEN 0xB030FE5B
/* Internal developer note: /* Internal developer note:
Place new error codes directly above this comment. Place new error codes directly above this comment.

View File

@ -553,6 +553,8 @@ const char *iso_error_to_msg(int errcode)
return "Zero sized, oversized, or mislocated SUSP CE area found"; return "Zero sized, oversized, or mislocated SUSP CE area found";
case ISO_MULTI_OVER_IMPORTED: case ISO_MULTI_OVER_IMPORTED:
return "Multi-session would overwrite imported_iso interval"; return "Multi-session would overwrite imported_iso interval";
case ISO_ELTO_EFI_HIDDEN:
return "El-Torito EFI image is hidden";
default: default:
return "Unknown error"; return "Unknown error";
} }