search for: orig_gpt_size

Displaying 10 results from an estimated 10 matches for "orig_gpt_size".

2011 Aug 05
3
isolinux: Generate GPT and Mac bootable images
...start/2048 - 10); + part->status = bendian_int(0x01); + } +} + int main(int argc, char *argv[]) { int i = 0; FILE *fp = NULL; - struct stat isostat; uint8_t *buf = NULL, *bufz = NULL; - int cylsize = 0, frac = 0, padding = 0; + int cylsize = 0, frac = 0; + size_t orig_gpt_size, free_space, gpt_size; + struct iso_primary_descriptor descriptor; prog = strcpy(alloca(strlen(argv[0]) + 1), argv[0]); i = check_option(argc, argv); @@ -450,10 +855,21 @@ main(int argc, char *argv[]) usage(); return 1; } + + if ((mode & EFI) &&...
2014 May 12
4
[PATCH] isohybrid: fix overflow on 32 bit system
...t; #include <unistd.h> +#include <limits.h> #include <sys/stat.h> #include <inttypes.h> #include <uuid/uuid.h> @@ -888,7 +889,7 @@ main(int argc, char *argv[]) FILE *fp = NULL; uint8_t *buf = NULL, *bufz = NULL; int cylsize = 0, frac = 0; - size_t orig_gpt_size, free_space, gpt_size; + size_t orig_gpt_size, free_space, gpt_size, real_offset; struct iso_primary_descriptor descriptor; prog = strcpy(alloca(strlen(argv[0]) + 1), argv[0]); @@ -1125,9 +1126,16 @@ main(int argc, char *argv[]) * Seek far enough back that the gpt header is 512 by...
2014 Jun 22
0
[PATCH 5/6] utils/isohybrid.c: Change all fseek(3) to fseeko(3)
...) initialise_apm(buf, APM_OFFSET); - fseek(fp, APM_OFFSET, SEEK_SET); + fseeko(fp, (off_t) APM_OFFSET, SEEK_SET); fwrite(buf, sizeof(char), apm_size, fp); } @@ -1132,8 +1132,7 @@ main(int argc, char *argv[]) * end of the image */ - if (fseeko(fp, (isostat.st_size + padding) - orig_gpt_size, - SEEK_SET)) + if (fseeko(fp, (isostat.st_size + padding) - orig_gpt_size, SEEK_SET)) err(1, "%s: seek error - 8", argv[0]); if (fwrite(buf, sizeof(char), orig_gpt_size, fp) != orig_gpt_size) -- 1.8.4.2
2014 Jun 22
16
Announcing a patch series for isohybrid.c
Hi, following will be 6 patch proposals for isohybrid.c 1: Encode GPT partition names as UTF-16LE 2: Correct blocking factor in APM partition block counts 3: Correct end block address of first GPT partition 4: Write GPT backup to the very end of the image 5: Change all fseek(3) to fseeko(3) 6: Introduce option --mbr and make isohybrid.c compilable standalone If the form needs adjustments,
2014 Jun 22
0
[PATCH 4/6] utils/isohybrid.c: Write GPT backup to the very end of the image
...e */ - initialise_gpt(buf, 1, (isostat.st_size + padding - 1024) / 512, 1); + initialise_gpt(buf, 1, (isostat.st_size + padding - 512) / 512, 1); if (fseek(fp, 512, SEEK_SET)) err(1, "%s: seek error - 6", argv[0]); @@ -1122,7 +1122,7 @@ main(int argc, char *argv[]) buf += orig_gpt_size - sizeof(struct gpt_header); - initialise_gpt(buf, (isostat.st_size + padding - 1024) / 512, 1, 0); + initialise_gpt(buf, (isostat.st_size + padding - 512) / 512, 1, 0); /* Shift back far enough to write the 128 GPT entries */ buf -= 128 * sizeof(struct gpt_part_header); @@ -1132,7 +1132,7...
2012 May 06
1
isohybrid.c, problem reports and questions
Hi, i am currently exploring the boot data of Matthew Garret's Fedora LiveCD. For that i read utils/isohybrid.c from git resp. 4.05. (I assume Matthew used options --efi --mac --type 0 .) Some stumblestones showed up: ----------------------------------------------------------------------- In initialise_gpt() i see unhealthy usage of string constants. Like: memcpy(part->name,
2014 Jun 20
3
[PATCH] isohybrid: fix overflow on 32 bit system
...ile changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/isohybrid.c b/utils/isohybrid.c index 410bb60..23fc6c0 100644 --- a/utils/isohybrid.c +++ b/utils/isohybrid.c @@ -1126,7 +1126,7 @@ main(int argc, char *argv[]) * end of the image */ - if (fseek(fp, (isostat.st_size + padding) - orig_gpt_size - 512, + if (fseeko(fp, (isostat.st_size + padding) - orig_gpt_size - 512, SEEK_SET)) err(1, "%s: seek error - 8", argv[0]); -- 1.9.1
2015 Feb 20
0
isohybrid and ISO images whose size is not a multiple of 2048 bytes vs. VirtualBox
> > Same result as yours. > > > Have a nice day :) > > Thomas > I was under the impression (apparently the wrong one) that your pseudo-code was adding 4 cylinders to the first example, from 132 to 136, which would be non-optimal. Since I am not a developer, I believe you when you say that such jump won't happen :). Perhaps the code will be more clear to me
2015 Feb 20
2
isohybrid and ISO images whose size is not a multiple of 2048 bytes vs. VirtualBox
Hi, my proposal is based on a mathematical proof (see mail before) and yours is correct too. They cannot but match. Let's inspect your examples: Ady wrote: > ISO size: 1'085'736'960 bytes ( > 1GiB) This are exactly 132 cylinders of 255x63. 132 is divisible by 4. So there is no padding needed. > Cylinders (1st attempt)=132 > [...] > 2120580 / 4 = 530145, so
2015 Feb 20
4
isohybrid and ISO images whose size is not a multiple of 2048 bytes vs. VirtualBox
...0 +0100 +++ isohybrid_test.c 2015-02-20 11:01:33.000000000 +0100 @@ -947,7 +947,7 @@ main(int argc, char *argv[]) int i = 0; FILE *fp = NULL; uint8_t *buf = NULL, *bufz = NULL; - int cylsize = 0, frac = 0; + int cylsize = 0, frac = 0, align_factor, align_cylsize; size_t orig_gpt_size, free_space, gpt_size; struct iso_primary_descriptor descriptor; @@ -1058,9 +1058,20 @@ main(int argc, char *argv[]) isosize = lendian_int(descriptor.size) * lendian_short(descriptor.block_size); free_space = isostat.st_size - isosize; + /* Making sure that the resulting image...