From f6817911a1222eeeb668a134dfd85d8dad7fe6ed Mon Sep 17 00:00:00 2001 From: Thomas Schmitt Date: Mon, 28 May 2012 13:32:27 +0000 Subject: [PATCH] New (yet inofficial) -boot_image bootspec hfsplus_serial= --- libisoburn/trunk/xorriso/emulators.c | 17 +++++------------ libisoburn/trunk/xorriso/opts_a_c.c | 18 +++++++++++++++++- libisoburn/trunk/xorriso/text_io.c | 12 ++++++++++++ libisoburn/trunk/xorriso/xorriso_timestamp.h | 2 +- 4 files changed, 35 insertions(+), 14 deletions(-) diff --git a/libisoburn/trunk/xorriso/emulators.c b/libisoburn/trunk/xorriso/emulators.c index 4d79f7af..87d743b2 100644 --- a/libisoburn/trunk/xorriso/emulators.c +++ b/libisoburn/trunk/xorriso/emulators.c @@ -1090,8 +1090,7 @@ int Xorriso_genisofs(struct XorrisO *xorriso, char *whom, int with_boot_image= 0, with_cat_path= 0, with_emul_toc= 0; int old_root_md5= 1, old_root_dev= 0, old_root_ino= 1; int *weight_list= NULL, weight_count= 0; - int *delay_opt_list= NULL, delay_opt_count= 0, bin_count; - uint8_t sn[8]; + int *delay_opt_list= NULL, delay_opt_count= 0; char *sfe= NULL, *adr= NULL, ra_text[80], *pathspec= NULL; char *ept, *add_pt, *eff_path= NULL, *indev= NULL, msc[80], *cpt; char *old_root= NULL, *argpt, *hargv[1]; @@ -1533,16 +1532,10 @@ illegal_c:; if(i+1>=argc) goto not_enough_args; i++; - ret= Hex_to_bin(argv[i], 8, &bin_count, (unsigned char *) sn, 0); - if(ret <= 0 || bin_count != 8) { - sprintf(xorriso->info_text, - "-as %s %s : Malformed hex string. Expected 16 characters [0-9a-fA-F]", - whom, argv[i - 1]); - Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0); - ret= 0; goto ex; - } else { - memcpy(xorriso->hfsp_serial_number, sn, 8); - } + sprintf(pathspec, "hfsplus_serial=%.80s", argv[i]); + ret= Xorriso_option_boot_image(xorriso, "any", pathspec, 0); + if(ret <= 0) + goto problem_handler_2; } else if(strcmp(argpt, "-graft-points")==0) { xorriso->allow_graft_points= 1; } else if(strcmp(argpt, "-path-list")==0 || diff --git a/libisoburn/trunk/xorriso/opts_a_c.c b/libisoburn/trunk/xorriso/opts_a_c.c index 50c58b5d..21d096f2 100644 --- a/libisoburn/trunk/xorriso/opts_a_c.c +++ b/libisoburn/trunk/xorriso/opts_a_c.c @@ -640,9 +640,10 @@ unusable_size:; int Xorriso_option_boot_image(struct XorrisO *xorriso, char *form, char *treatment, int flag) { - int was_ok= 1, ret, isolinux_grub= 0, count; + int was_ok= 1, ret, isolinux_grub= 0, count, bin_count; unsigned int u; char *formpt, *treatpt, *eff_path= NULL; + uint8_t sn[8]; double num; Xorriso_alloc_meM(eff_path, char, SfileadrL); @@ -996,6 +997,21 @@ treatment_patch:; {ret= 0; goto ex;} } + } else if(strncmp(treatpt, "hfsplus_serial=", 15) == 0) { + ret= Hex_to_bin(treatpt + 15, 8, &bin_count, (unsigned char *) sn, 0); + if(ret <= 0 || bin_count != 8) { + sprintf(xorriso->info_text, + "boot_image %s : Malformed hfsplus_serial : %s", + formpt, treatpt + 15); + Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); + Xorriso_msgs_submit(xorriso, 0, + "Expected is a string of 16 hex digits [0-9a-fA-F]", + 0, "HINT", 0); + ret= 0; goto ex; + } else { + memcpy(xorriso->hfsp_serial_number, sn, 8); + } + } else if(strncmp(treatpt, "isohybrid=", 10) == 0 && strcmp(formpt, "isolinux")==0) { diff --git a/libisoburn/trunk/xorriso/text_io.c b/libisoburn/trunk/xorriso/text_io.c index 56b0ddeb..1a86c5e6 100644 --- a/libisoburn/trunk/xorriso/text_io.c +++ b/libisoburn/trunk/xorriso/text_io.c @@ -1400,6 +1400,18 @@ int Xorriso_status(struct XorrisO *xorriso, char *filter, FILE *fp, int flag) } #endif /* Xorriso_with_isohybriD */ + is_default= 1; + for(i= 0; i < 8; i++) + if(xorriso->hfsp_serial_number[i]) + is_default= 0; + sprintf(line, "-boot_image any hfsplus_serial="); + for(i= 0; i < 8; i++) + sprintf(line + strlen(line), "%-2.2X", + (unsigned int) xorriso->hfsp_serial_number[i]); + strcat(line, "\n"); + if(!(is_default && no_defaults)) + Xorriso_status_result(xorriso, filter, fp, flag & 2); + sprintf(line,"-cd %s\n", (xorriso->wdi[0] ? Text_shellsafe(xorriso->wdi,sfe,0) : "'/'")); Xorriso_status_result(xorriso,filter,fp,flag&2); diff --git a/libisoburn/trunk/xorriso/xorriso_timestamp.h b/libisoburn/trunk/xorriso/xorriso_timestamp.h index 2681fe04..a3c5f066 100644 --- a/libisoburn/trunk/xorriso/xorriso_timestamp.h +++ b/libisoburn/trunk/xorriso/xorriso_timestamp.h @@ -1 +1 @@ -#define Xorriso_timestamP "2012.05.27.165938" +#define Xorriso_timestamP "2012.05.28.133310"