From 7041a551b1f078e24a0cf75c9b76bd996965add1 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 --- xorriso/xorriso.c | 1 + xorriso/xorriso_private.h | 5 +++++ xorriso/xorriso_timestamp.h | 2 +- xorriso/xorrisoburn.c | 9 +++++++++ 4 files changed, 16 insertions(+), 1 deletion(-) diff --git a/xorriso/xorriso.c b/xorriso/xorriso.c index fa317b48..f3ead8ab 100644 --- a/xorriso/xorriso.c +++ b/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/xorriso/xorriso_private.h b/xorriso/xorriso_private.h index 0a57c204..201da1cd 100644 --- a/xorriso/xorriso_private.h +++ b/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/xorriso/xorriso_timestamp.h b/xorriso/xorriso_timestamp.h index 2d60d55a..dee447ce 100644 --- a/xorriso/xorriso_timestamp.h +++ b/xorriso/xorriso_timestamp.h @@ -1 +1 @@ -#define Xorriso_timestamP "2008.10.20.180747" +#define Xorriso_timestamP "2008.10.21.112523" diff --git a/xorriso/xorrisoburn.c b/xorriso/xorrisoburn.c index 33f1278a..84125311 100644 --- a/xorriso/xorrisoburn.c +++ b/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 ? */