Commit 2126dce2 authored by Thomas Schmitt's avatar Thomas Schmitt

New -as mkisofs option -eltorito-platform

parent 3e3fddd4
......@@ -664,7 +664,7 @@ int Xorriso_genisofs_count_args(struct XorrisO *xorriso, int argc, char **argv,
"-hfsplus-block-size", "-apm-block-size", "--grub2-mbr",
"--grub2-sparc-core", "--sort-weight-list", "--sort-weight-patterns",
"-hppa-hdrversion", "-file_name_limit", "--set_all_file_dates",
"--gpt_disk_guid", "-iso_mbr_part_type",
"--gpt_disk_guid", "-iso_mbr_part_type", "-eltorito-platform",
""
};
static char arg2_options[][41]= {
......@@ -857,6 +857,7 @@ int Xorriso_genisofs_help(struct XorrisO *xorriso, int flag)
" Specify the checksum types desired for the output image (in .jigdo)",
" -checksum_algorithm_template alg1,alg2,...",
" Specify the checksum types desired for the output jigdo template",
" -eltorito-platform Set El Torito platform id for the next boot entry",
" -b FILE, -eltorito-boot FILE",
" Set El Torito boot image name",
" -eltorito-alt-boot Start specifying alternative El Torito boot parameters",
......@@ -1269,6 +1270,44 @@ ex:;
}
int Xorriso_genisofs_platform(struct XorrisO *xorriso, char *id, int flag)
{
unsigned int u;
char re_id[64];
if(strcmp(id, "x86") == 0)
return(0);
else if(strcmp(id, "PPC") == 0)
return(1);
else if(strcmp(id, "Mac") == 0)
return(2);
else if(strcmp(id, "efi") == 0)
return(0xef);
u= 0x100;
if(strncmp(id, "0x", 2) == 0) {
sscanf(id + 2, "%x", &u);
} else {
sscanf(id, "%u", &u);
sprintf(re_id, "%u", u);
if(strcmp(id, re_id) != 0)
goto wrong_id;
}
if(u <= 0xff)
return((int) u);
wrong_id:;
sprintf(xorriso->info_text,
"Unrecognized El Torito Platform Id : '%.16s%s'",
id, strlen(id) > 16 ? "..." : "");
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
sprintf(xorriso->info_text,
"Recognizable are: x86, PPC, Mac, efi, [0...255], [0x00...0xff]");
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "HINT", 0);
return(-1);
}
/* micro emulation of mkisofs */
int Xorriso_genisofs(struct XorrisO *xorriso, char *whom,
int argc, char **argv, int flag)
......@@ -1284,6 +1323,7 @@ int Xorriso_genisofs(struct XorrisO *xorriso, char *whom,
int old_root_md5= 1, old_root_dev= 0, old_root_ino= 1, sort_file_pattern= 0;
int *weight_list= NULL, weight_count= 0;
int *delay_opt_list= NULL, delay_opt_count= 0;
int mkisofs_b_platform_id= 0x00;
char *sfe= NULL, *adr= NULL, ra_text[80], *pathspec= NULL, *sort_file= NULL;
char *ept, *add_pt, *eff_path= NULL, *indev= NULL, msc[80], *cpt;
char *old_root= NULL, *argpt, *hargv[1];
......@@ -1892,6 +1932,7 @@ not_enough_args:;
delay_opt_list[delay_opt_count - 1]|= 1<<31;
} else if(strcmp(argpt, "-b") == 0 ||
strcmp(argpt, "-eltorito-boot") == 0 ||
strcmp(argpt, "-eltorito-platform") == 0 ||
strcmp(argpt, "--efi-boot") == 0 ||
strcmp(argpt, "-e") == 0 ||
strcmp(argpt, "-mips-boot") == 0 ||
......@@ -2414,7 +2455,7 @@ problem_handler_2:;
if(strcmp(argpt, "-e") == 0)
xorriso->boot_platform_id= 0xef;
else
xorriso->boot_platform_id= 0x00;
xorriso->boot_platform_id= mkisofs_b_platform_id;
xorriso->boot_efi_default= 0;
if(xorriso->boot_emul_default)
xorriso->boot_image_emul= 2;
......@@ -2432,6 +2473,21 @@ problem_handler_2:;
}
xorriso->keep_boot_image= 0;
with_boot_image= 1;
} else if(strcmp(argpt, "-eltorito-platform") == 0) {
if(i + 1>=argc)
goto not_enough_args;
i++;
if(xorriso->boot_image_bin_path[0] != 0) {
ret= Xorriso_genisofs_add_boot(xorriso, 0);
if(ret <= 0)
goto problem_handler_boot;
}
mkisofs_b_platform_id= Xorriso_genisofs_platform(xorriso, argv[i], 0);
if(mkisofs_b_platform_id < 0) {
mkisofs_b_platform_id= 0;
goto problem_handler_boot;
}
} else if(strcmp(argpt, "-c") == 0 ||
strcmp(argpt, "-eltorito-catalog") == 0) {
if(i+1>=argc)
......
#define Xorriso_timestamP "2017.05.09.081543"
#define Xorriso_timestamP "2017.06.03.132429"
......@@ -9,7 +9,7 @@
.\" First parameter, NAME, should be all caps
.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection
.\" other parameters are allowed: see man(7), man(1)
.TH XORRISOFS 1 "Version 1.4.7, Feb 26, 2017"
.TH XORRISOFS 1 "Version 1.4.7, Jun 03, 2017"
.\" Please adjust this date whenever revising the manpage.
.\"
.\" Some roff macros, for reference:
......@@ -988,6 +988,13 @@ Perform \-eltorito\-alt\-boot, option \-e with the given
iso_rr_path, \-no\-emul\-boot, and again \-eltorito\-alt\-boot. This gesture is
used for achieving EFI\-bootability of the GRUB2 rescue CD.
.TP
\fB\-eltorito-platform\fR "x86"|"PPC"|"Mac"|"efi"|0xnn|nnn
Perform option \-eltorito\-alt\-boot and set the Platform Id number for the next
option \-b or \-eltorito\-boot. The number may be chosen by a platform name or by
a number between 0 and 255 (0x00 and 0xFF). "x86" = 0 is for PC\-BIOS,
"PPC" = 1 for some PowerPC systems, "Mac" = 2 for some MacIntosh systems,
"efi" = 0xEF for EFI on modern PCs with x86 compatible CPUs or others.
.TP
\fB\-boot-load-size\fR number|"full"
Set the number of 512\-byte blocks to be loaded at boot time
from the boot image in the current catalog entry.
......
This diff is collapsed.
......@@ -50,7 +50,7 @@
@c man .\" First parameter, NAME, should be all caps
@c man .\" Second parameter, SECTION, should be 1-8, maybe w/ subsection
@c man .\" other parameters are allowed: see man(7), man(1)
@c man .TH XORRISOFS 1 "Version 1.4.7, Feb 26, 2017"
@c man .TH XORRISOFS 1 "Version 1.4.7, Jun 03, 2017"
@c man .\" Please adjust this date whenever revising the manpage.
@c man .\"
@c man .\" Some roff macros, for reference:
......@@ -1339,6 +1339,15 @@ Perform -eltorito-alt-boot, option -e with the given
iso_rr_path, -no-emul-boot, and again -eltorito-alt-boot. This gesture is
used for achieving EFI-bootability of the GRUB2 rescue CD.
@c man .TP
@item -eltorito-platform "x86"|"PPC"|"Mac"|"efi"|0xnn|nnn
@kindex -eltorito-platform El Torito Platform Id
@cindex Bootability, control, -eltorito-platform
Perform option -eltorito-alt-boot and set the Platform Id number for the next
option -b or -eltorito-boot. The number may be chosen by a platform name or by
a number between 0 and 255 (0x00 and 0xFF). "x86" = 0 is for PC-BIOS,
"PPC" = 1 for some PowerPC systems, "Mac" = 2 for some MacIntosh systems,
"efi" = 0xEF for EFI on modern PCs with x86 compatible CPUs or others.
@c man .TP
@item -boot-load-size number|"full"
@kindex -boot-load-size El Torito boot image load size
@cindex Bootability, boot image load size, -boot-load-size
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment