diff --git a/xorriso/base_obj.c b/xorriso/base_obj.c index 3a00b9db..894ec8b0 100644 --- a/xorriso/base_obj.c +++ b/xorriso/base_obj.c @@ -274,6 +274,7 @@ int Xorriso_new(struct XorrisO ** xorriso,char *progname, int flag) m->boot_efi_default= 0; m->system_area_disk_path[0]= 0; + m->system_area_clear_loaded= 0; m->system_area_options= 0; m->patch_system_area= 0; m->partition_offset= 0; diff --git a/xorriso/drive_mgt.c b/xorriso/drive_mgt.c index 07d2e9e8..84453b1d 100644 --- a/xorriso/drive_mgt.c +++ b/xorriso/drive_mgt.c @@ -471,6 +471,8 @@ int Xorriso_aquire_drive(struct XorrisO *xorriso, char *adr, char *show_adr, Xorriso_destroy_hln_array(xorriso, 0); Xorriso_destroy_di_array(xorriso, 0); xorriso->boot_count= 0; + xorriso->system_area_clear_loaded= + (strcmp(xorriso->system_area_disk_path, "/dev/zero") == 0); /* check for invalid state */ if(state != BURN_DISC_BLANK && state != BURN_DISC_APPENDABLE && diff --git a/xorriso/iso_img.c b/xorriso/iso_img.c index 46b016ee..da9a62c6 100644 --- a/xorriso/iso_img.c +++ b/xorriso/iso_img.c @@ -113,6 +113,8 @@ int Xorriso_create_empty_iso(struct XorrisO *xorriso, int flag) Xorriso_update_volid(xorriso, 0); xorriso->volset_change_pending= 0; xorriso->boot_count= 0; + xorriso->system_area_clear_loaded= + (strcmp(xorriso->system_area_disk_path, "/dev/zero") == 0); xorriso->no_volset_present= 0; return(1); } diff --git a/xorriso/opts_a_c.c b/xorriso/opts_a_c.c index f0ae97c5..44e8ad13 100644 --- a/xorriso/opts_a_c.c +++ b/xorriso/opts_a_c.c @@ -1006,6 +1006,8 @@ treatment_patch:; if(ret <= 0) goto ex; xorriso->system_area_options&= ~0x4000; + if(strcmp(treatpt + 12, "/dev/zero") == 0) + xorriso->system_area_clear_loaded= 1; } else if(strncmp(treatpt, "partition_table=", 16)==0) { if(strcmp(treatpt + 16, "off") == 0) { diff --git a/xorriso/write_run.c b/xorriso/write_run.c index 1b1b9aff..acf0d3d4 100644 --- a/xorriso/write_run.c +++ b/xorriso/write_run.c @@ -440,7 +440,10 @@ int Xorriso_set_system_area(struct XorrisO *xorriso, struct burn_drive *drive, Xorriso_alloc_meM(buf, char, 32768); memset(buf, 0, 32768); system_area_options= xorriso->system_area_options; - sa_loaded= iso_image_get_system_area(img, buf, &options, 0); + if(xorriso->system_area_clear_loaded) + sa_loaded= 0; + else + sa_loaded= iso_image_get_system_area(img, buf, &options, 0); if(sa_loaded < 0) { Xorriso_process_msg_queues(xorriso,0); Xorriso_report_iso_error(xorriso, "", sa_loaded, diff --git a/xorriso/xorriso_private.h b/xorriso/xorriso_private.h index 726fff35..3b384990 100644 --- a/xorriso/xorriso_private.h +++ b/xorriso/xorriso_private.h @@ -411,6 +411,7 @@ struct XorrisO { /* the global context of xorriso */ 1= appy --efi-boot parameters when attaching to img */ char system_area_disk_path[SfileadrL]; + int system_area_clear_loaded; int system_area_options; /* bit0= "GRUB protective msdos label" (a simple partition table) bit1= isohybrid boot image pointer diff --git a/xorriso/xorriso_timestamp.h b/xorriso/xorriso_timestamp.h index f9a4d178..598a734e 100644 --- a/xorriso/xorriso_timestamp.h +++ b/xorriso/xorriso_timestamp.h @@ -1 +1 @@ -#define Xorriso_timestamP "2015.12.22.133736" +#define Xorriso_timestamP "2015.12.23.112013"