2009-12-21 Robert Millan <rmh.grub@aybabtu.com>

* util/mkisofs/mkisofs.c (use_embedded_boot, boot_image_embed): New
        variables.
        (ld_options, main): Recognize `--embedded-boot'.
        * util/mkisofs/mkisofs.h (use_embedded_boot, boot_image_embed): New
        declarations.
        * util/mkisofs/write.c (PADBLOCK_SIZE): New variable.
        (padblock_size): Use `PADBLOCK_SIZE' instead of hardcoding 16.
        (padblock_write): Likewise.  Rewrite to support embedded boot image.

        * util/grub-mkrescue.in: When building i386-pc images, embed core.img
        for BIOS-based disk boot instead of only ElTorito.
This commit is contained in:
Robert Millan 2009-12-21 17:40:26 +00:00
parent b15937b110
commit 0ae5692966
5 changed files with 74 additions and 35 deletions

View file

@ -90,6 +90,7 @@ int extension_record_size = 0;
/* These variables are associated with command line options */
int use_eltorito = 0;
int use_eltorito_emul_floppy = 0;
int use_embedded_boot = 0;
int use_boot_info_table = 0;
int use_RockRidge = 0;
int use_Joliet = 0;
@ -100,17 +101,18 @@ int rationalize = 0;
int generate_tables = 0;
int print_size = 0;
int split_output = 0;
char * preparer = PREPARER_DEFAULT;
char * publisher = PUBLISHER_DEFAULT;
char * appid = APPID_DEFAULT;
char * copyright = COPYRIGHT_DEFAULT;
char * biblio = BIBLIO_DEFAULT;
char * abstract = ABSTRACT_DEFAULT;
char * volset_id = VOLSET_ID_DEFAULT;
char * volume_id = VOLUME_ID_DEFAULT;
char * system_id = SYSTEM_ID_DEFAULT;
char * boot_catalog = BOOT_CATALOG_DEFAULT;
char * boot_image = BOOT_IMAGE_DEFAULT;
char *preparer = PREPARER_DEFAULT;
char *publisher = PUBLISHER_DEFAULT;
char *appid = APPID_DEFAULT;
char *copyright = COPYRIGHT_DEFAULT;
char *biblio = BIBLIO_DEFAULT;
char *abstract = ABSTRACT_DEFAULT;
char *volset_id = VOLSET_ID_DEFAULT;
char *volume_id = VOLUME_ID_DEFAULT;
char *system_id = SYSTEM_ID_DEFAULT;
char *boot_catalog = BOOT_CATALOG_DEFAULT;
char *boot_image = BOOT_IMAGE_DEFAULT;
char *boot_image_embed = NULL;
int volume_set_size = 1;
int volume_sequence_number = 1;
@ -209,6 +211,8 @@ static const struct ld_option ld_options[] =
'\0', N_("FILE"), N_("Set Bibliographic filename"), ONE_DASH },
{ {"copyright", required_argument, NULL, OPTION_COPYRIGHT},
'\0', N_("FILE"), N_("Set Copyright filename"), ONE_DASH },
{ {"embedded-boot", required_argument, NULL, 'G'},
'G', N_("FILE"), N_("Set embedded boot image name"), TWO_DASHES },
{ {"eltorito-boot", required_argument, NULL, 'b'},
'b', N_("FILE"), N_("Set El Torito boot image name"), ONE_DASH },
{ {"eltorito-catalog", required_argument, NULL, 'c'},
@ -719,10 +723,13 @@ int FDECL2(main, int, argc, char **, argv){
use_eltorito++;
boot_image = optarg; /* pathname of the boot image on cd */
if (boot_image == NULL)
{
fprintf (stderr, _("Required boot image pathname missing\n"));
exit (1);
}
error (1, 0, _("Required boot image pathname missing"));
break;
case 'G':
use_embedded_boot++;
boot_image_embed = optarg; /* pathname of the boot image on host filesystem */
if (boot_image_embed == NULL)
error (1, 0, _("Required boot image pathname missing"));
break;
case 'c':
use_eltorito++;