From 1afe1443be2e6eafbcf52c0279c1ef08088be305 Mon Sep 17 00:00:00 2001 From: Thomas Schmitt Date: Tue, 6 Apr 2010 19:24:39 +0000 Subject: [PATCH] Polishing of new GRUB supporting features --- xorriso/xorriso.c | 48 ++++++++++++++++++++++++++++++------- xorriso/xorriso_eng.html | 4 ++-- xorriso/xorriso_timestamp.h | 2 +- 3 files changed, 43 insertions(+), 11 deletions(-) diff --git a/xorriso/xorriso.c b/xorriso/xorriso.c index 3cf2eed9..1005d62c 100644 --- a/xorriso/xorriso.c +++ b/xorriso/xorriso.c @@ -10513,6 +10513,38 @@ int Xorriso_reaquire_outdev(struct XorrisO *xorriso, int flag) } +int Xorriso_set_system_area_path(struct XorrisO *xorriso, char *path, int flag) +{ + int ret; + char eff_src[SfileadrL]; + + if(path[0] == 0) { + xorriso->system_area_disk_path[0]= 0; + return(1); + } + ret= Xorriso_normalize_img_path(xorriso, xorriso->wdx, path, eff_src, 2|4|16); + if(ret < 0) + return(ret); + if(ret == 0) { + sprintf(xorriso->info_text, + "Given path does not exist on disk: -boot_image system_area="); + Text_shellsafe(eff_src, xorriso->info_text, 1); + Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); + } + if(ret == 2) { + sprintf(xorriso->info_text, + "Given path leads to a directory: -boot_image system_area="); + Text_shellsafe(eff_src, xorriso->info_text, 1); + Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); + return(0); + } + ret= Sfile_str(xorriso->system_area_disk_path, eff_src, 0); + if(ret <= 0) + return(-1); + return(1); +} + + int Xorriso_cdrskin_help(struct XorrisO *xorriso, int flag) { static char helptext[][80]= { @@ -11211,17 +11243,16 @@ int Xorriso_genisofs(struct XorrisO *xorriso, char *whom, ret= Xorriso_option_boot_image(xorriso, "isolinux", sfe, 0); if(ret <= 0) goto problem_handler_1; - } else if(strcmp(argv[i], "--embedded-boot")==0) { + } else if(strcmp(argv[i], "--embedded-boot")==0 || + strcmp(argv[i], "-G") == 0) { if(i+1>=argc) goto not_enough_args; i++; - ret= Sfile_str(xorriso->system_area_disk_path, argv[i], 0); + ret= Xorriso_set_system_area_path(xorriso, argv[i], 0); if(ret <= 0) - {ret= -1; goto ex;} - + goto ex; } else if(strcmp(argv[i], "--protective-msdos-label")==0) { xorriso->system_area_options|= 1; - } else if(strcmp(argv[i], "-input-charset")==0) { if(i+1>=argc) goto not_enough_args; @@ -11486,7 +11517,8 @@ not_enough_args:; /* was already handled in first argument scan */; } else if(strncmp(argv[i], "isolinux_mbr=", 13)==0) { /* was already handled in first argument scan */; - } else if(strcmp(argv[i], "--embedded-boot")==0) { + } else if(strcmp(argv[i], "--embedded-boot")==0 || + strcmp(argv[i], "-G") == 0) { i++; /* was already handled in first argument scan */; } else if(strcmp(argv[i], "--protective-msdos-label")==0) { @@ -13725,9 +13757,9 @@ int Xorriso_option_boot_image(struct XorrisO *xorriso, char *form, xorriso->boot_image_load_size= num; } else if(strncmp(treatpt, "system_area=", 12) == 0) { - ret= Sfile_str(xorriso->system_area_disk_path, treatpt + 12, 0); + ret= Xorriso_set_system_area_path(xorriso, treatpt + 12, 0); if(ret <= 0) - return(-1); + return(ret); } else if(strncmp(treatpt, "partition_table=", 16)==0) { if(strcmp(treatpt + 16, "off") == 0) diff --git a/xorriso/xorriso_eng.html b/xorriso/xorriso_eng.html index 81ea8cd9..d34a9ad8 100644 --- a/xorriso/xorriso_eng.html +++ b/xorriso/xorriso_eng.html @@ -123,7 +123,7 @@ Writes result as completely new image or as add-on session to optical media or filesystem objects.
  • -Can activate ISOLINUX boot images by El Torito boot record. +Can activate ISOLINUX and GRUB boot images by El Torito boot record.
  • Can perform multi-session tasks as emulation of mkisofs and cdrecord. @@ -487,7 +487,7 @@ Bug fixes towards xorriso-0.5.0: