From 12d92811649cc6a1d36b5f22fb7a1bc15091e6f3 Mon Sep 17 00:00:00 2001 From: Thomas Schmitt Date: Tue, 21 Oct 2008 11:26:16 +0000 Subject: [PATCH] Implemented in xorriso provisory 1 MB alignement for MBR enhanced ISO images --- libisoburn/trunk/xorriso/xorriso.c | 1 + libisoburn/trunk/xorriso/xorriso_private.h | 5 +++++ libisoburn/trunk/xorriso/xorriso_timestamp.h | 2 +- libisoburn/trunk/xorriso/xorrisoburn.c | 9 +++++++++ 4 files changed, 16 insertions(+), 1 deletion(-) diff --git a/libisoburn/trunk/xorriso/xorriso.c b/libisoburn/trunk/xorriso/xorriso.c index fa317b48..f3ead8ab 100644 --- a/libisoburn/trunk/xorriso/xorriso.c +++ b/libisoburn/trunk/xorriso/xorriso.c @@ -3628,6 +3628,7 @@ int Xorriso_new(struct XorrisO ** xorriso,char *progname, int flag) m->speed= 0; m->fs= 4*512; /* 4 MiB */ m->padding= 300*1024; + m->alignment= 0; m->do_stream_recording= 0; m->keep_boot_image= 0; m->patch_isolinux_image= 0; diff --git a/libisoburn/trunk/xorriso/xorriso_private.h b/libisoburn/trunk/xorriso/xorriso_private.h index 0a57c204..201da1cd 100644 --- a/libisoburn/trunk/xorriso/xorriso_private.h +++ b/libisoburn/trunk/xorriso/xorriso_private.h @@ -183,6 +183,11 @@ struct XorrisO { /* the global context of xorriso */ int speed; /* in libburn units : 1000 bytes/second , 0 = Max, -1 = Min */ int fs; /* fifo size in 2048 byte chunks : at most 1 GB */ int padding; /* number of bytes to add after ISO 9660 image */ + + int alignment; /* if > 0 : image size alignment in 2048 byt blocks */ + /* <<< not sure whether to keep this after libisofs will have + learned to pad up MBR images to full MB */ + int do_stream_recording; int keep_boot_image; diff --git a/libisoburn/trunk/xorriso/xorriso_timestamp.h b/libisoburn/trunk/xorriso/xorriso_timestamp.h index 2d60d55a..dee447ce 100644 --- a/libisoburn/trunk/xorriso/xorriso_timestamp.h +++ b/libisoburn/trunk/xorriso/xorriso_timestamp.h @@ -1 +1 @@ -#define Xorriso_timestamP "2008.10.20.180747" +#define Xorriso_timestamP "2008.10.21.112523" diff --git a/libisoburn/trunk/xorriso/xorrisoburn.c b/libisoburn/trunk/xorriso/xorrisoburn.c index 33f1278a..84125311 100644 --- a/libisoburn/trunk/xorriso/xorrisoburn.c +++ b/libisoburn/trunk/xorriso/xorrisoburn.c @@ -821,6 +821,13 @@ no_track:; Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "NOTE", 0); } } + if(xorriso->alignment > 0) { + if(img_sectors > 0) + padding+= xorriso->alignment + - ((img_sectors + padding) % xorriso->alignment); + else if(padding < xorriso->alignment) + padding= xorriso->alignment; + } burn_track_define_data(tracks[0], 0, padding * 2048, 0, BURN_MODE1); Xorriso_process_msg_queues(xorriso,0); @@ -890,6 +897,7 @@ int Xorriso_set_isolinux_options(struct XorrisO *xorriso, if(make_isohybrid_mbr) { sprintf(xorriso->info_text, "Will write isohybrid MBR."); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "NOTE", 0); + xorriso->alignment= 512; } ret= el_torito_set_isolinux_options(bootimg, 1 | (make_isohybrid_mbr << 1),0); @@ -982,6 +990,7 @@ int Xorriso_write_session(struct XorrisO *xorriso, int flag) } relax= isoburn_igopt_allow_deep_paths; + xorriso->alignment= 0; /* Activate, adjust or discard boot image */ image= isoburn_get_attached_image(source_drive); /* >>> ??? move down to libisoburn ? */