search for: initialise_gpt

Displaying 9 results from an estimated 9 matches for "initialise_gpt".

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 24
2
[syslinux:master] isohybrid: Function to write UTF-16LE strings
...uint16_t * > +ascii_to_utf16le(uint16_t *dst, const char *src) > +{ > + uint8_t *p = (uint8_t *)dst; > + char c; > + > + do { > + c = *src++; > + *p++ = c; > + *p++ = 0; > + } while (c); > + > + return (uint16_t *)p; > +} > + > void > initialise_gpt(uint8_t *gpt, uint32_t current, uint32_t alternate, int primary) > { > @@ -793,11 +808,6 @@ initialise_gpt(uint8_t *gpt, uint32_t current, uint32_t alternate, int primary) > struct gpt_part_header *part; > int hole = 0; > int gptsize = 128 / 4 + 2; > - char part...
2014 Jun 22
0
[PATCH 4/6] utils/isohybrid.c: Write GPT backup to the very end of the image
...ions(-) diff --git a/utils/isohybrid.c b/utils/isohybrid.c index ff6b930..1c8f0b6 100644 --- a/utils/isohybrid.c +++ b/utils/isohybrid.c @@ -1084,7 +1084,7 @@ main(int argc, char *argv[]) * Primary GPT starts at sector 1, secondary GPT starts at 1 sector * before the end of the image */ - 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(s...
2014 Jun 22
0
[PATCH 1/6] utils/isohybrid.c: Encode GPT partition names as UTF-16LE
...stants "ISOHybrid ISO" and "ISOHybrid". --- utils/isohybrid.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/utils/isohybrid.c b/utils/isohybrid.c index 05afd29..c5b4281 100644 --- a/utils/isohybrid.c +++ b/utils/isohybrid.c @@ -749,6 +749,11 @@ initialise_gpt(uint8_t *gpt, uint32_t current, uint32_t alternate, int primary) struct gpt_part_header *part; int hole = 0; int gptsize = 128 / 4 + 2; + char part_name_iso[] = {'I', 0, 'S', 0, 'O', 0, 'H', 0, 'y', 0, + 'b'...
2012 Jun 09
5
Build failure for isohybrid
...n isohybrid which seems to be distro specific. On Fedora 17 64bit the build completes without problems, but under both Ubuntu 32/64bit 11.10 and 12.04 I get the following: tim at oxygen:/usr/src/git/syslinux/utils$ make gcc -O2 -luuid -o isohybrid isohybrid.o isohdpfx.o isohybrid.o: In function `initialise_gpt': isohybrid.c:(.text+0xc42): undefined reference to `uuid_generate' isohybrid.c:(.text+0xd20): undefined reference to `uuid_generate' isohybrid.c:(.text+0xd2d): undefined reference to `uuid_generate' collect2: ld returned 1 exit status make: *** [isohybrid] Error 1 I've done th...
2012 May 06
1
isohybrid.c, problem reports and questions
...i, 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, "ISOHybrid ISO", 28); This seems to assume dealing with 16 bit characters. (Wikipedia states about GPT that the character set shall be UTF-16LE.) The result in Fedora-LiveCD.iso is: $ dd if=Fedora-LiveCD.iso b...
2011 Aug 05
3
isolinux: Generate GPT and Mac bootable images
...rc_tab[(crc ^ *block++) & 0xFF]; + } + return (crc ^ 0xFFFFFFFF); +} + +void +reverse_uuid(uuid_t uuid) +{ + uint8_t t, *p = (uint8_t *)uuid; + + t = p[0]; p[0] = p[3]; p[3] = t; + t = p[1]; p[1] = p[2]; p[2] = t; + t = p[4]; p[4] = p[5]; p[5] = t; + t = p[6]; p[6] = p[7]; p[7] = t; +} + +void +initialise_gpt(uint8_t *gpt, uint32_t current, uint32_t alternate, int primary) +{ + struct gpt_header *header = (struct gpt_header *)gpt; + struct gpt_part_header *part; + int hole = 0; + int gptsize = 128 / 4 + 2; + + if (mac_lba) { + /* 2048 bytes per partition, plus round to 2048 boundary */ +...
2014 Jun 22
0
[PATCH 3/6] utils/isohybrid.c: Correct end block address of first GPT partition
...rst block after the partition end. This change reduces the number by 1. --- utils/isohybrid.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/isohybrid.c b/utils/isohybrid.c index 7d0864e..ff6b930 100644 --- a/utils/isohybrid.c +++ b/utils/isohybrid.c @@ -797,7 +797,7 @@ initialise_gpt(uint8_t *gpt, uint32_t current, uint32_t alternate, int primary) memcpy(part->partGUID, iso_uuid, sizeof(uuid_t)); memcpy(part->partTypeGUID, basic_partition, sizeof(uuid_t)); part->firstLBA = lendian_64(0); - part->lastLBA = lendian_64(psize); + part->lastLBA =...
2014 Jun 22
0
[PATCH 5/6] utils/isohybrid.c: Change all fseek(3) to fseeko(3)
...de & VERBOSE) display_mbr(buf, i); - if (fseek(fp, 0, SEEK_SET)) + if (fseeko(fp, (off_t) 0, SEEK_SET)) err(1, "%s: seek error - 5", argv[0]); if (fwrite(buf, sizeof(char), i, fp) != (size_t)i) @@ -1086,7 +1086,7 @@ main(int argc, char *argv[]) */ initialise_gpt(buf, 1, (isostat.st_size + padding - 512) / 512, 1); - if (fseek(fp, 512, SEEK_SET)) + if (fseeko(fp, (off_t) 512, SEEK_SET)) err(1, "%s: seek error - 6", argv[0]); if (fwrite(buf, sizeof(char), gpt_size, fp) != (size_t)gpt_size) @@ -1103,7 +1103,7 @@ main(int argc, char *argv...