diff options
| author | james <james> | 2008-01-25 03:01:06 +0000 | 
|---|---|---|
| committer | james <james> | 2008-01-25 03:01:06 +0000 | 
| commit | a6b1ebc71b36ed18ad3f2f2685067b5cd4a78f14 (patch) | |
| tree | 6e18079c394cc348ddd8e4b6fdb7aac234cbd301 /src | |
| parent | ce6101382098005d4db87e4eea120aa8fae1d381 (diff) | |
| download | gpt-a6b1ebc71b36ed18ad3f2f2685067b5cd4a78f14.tar.gz gpt-a6b1ebc71b36ed18ad3f2f2685067b5cd4a78f14.tar.bz2 gpt-a6b1ebc71b36ed18ad3f2f2685067b5cd4a78f14.zip | |
*** empty log message ***
Diffstat (limited to 'src')
| -rw-r--r-- | src/disk.c | 5 | ||||
| -rw-r--r-- | src/gpt.c | 6 | ||||
| -rw-r--r-- | src/header.c | 2 | ||||
| -rw-r--r-- | src/new.c | 1 | ||||
| -rw-r--r-- | src/prototypes.h | 3 | ||||
| -rw-r--r-- | src/sync.c | 3 | 
6 files changed, 14 insertions, 6 deletions
| @@ -24,10 +24,11 @@ disk_open (char *fn)    ret->lbas = lseek (ret->fd, (off_t) 0, SEEK_END); +    ret->lbas = ret->lbas / (uint64_t) SECTOR_SIZE; -  fprintf (stderr, "Opened %s with size of %d lbas\n", ret->name, -           (int) ret->lbas); +  fprintf (stderr, "Opened %s with size of %lld lbas\n", ret->name, +           (long long) ret->lbas);    return ret;  } @@ -6,10 +6,13 @@   *   */ -static char rcsid[] = "$Id: gpt.c,v 1.13 2007/11/13 15:18:30 james Exp $"; +static char rcsid[] = "$Id: gpt.c,v 1.14 2008/01/25 03:01:06 james Exp $";  /*   * $Log: gpt.c,v $ + * Revision 1.14  2008/01/25 03:01:06  james + * *** empty log message *** + *   * Revision 1.13  2007/11/13 15:18:30  james   * *** empty log message ***   * @@ -95,6 +98,7 @@ main (int argc, char *argv[])    extern char *optarg;    extern int optind; +  fprintf(stderr,"sizeof(off_t)=%d\n",sizeof(off_t));    while ((c = getopt (argc, argv, "d:hlsef:unac")) != EOF)      { diff --git a/src/header.c b/src/header.c index 81caf29..22c255c 100644 --- a/src/header.c +++ b/src/header.c @@ -13,7 +13,7 @@ header_calc_crc (GPT_header * h)  }  GPT_header -header_new (GUID disk_guid, int lbas, int alt) +header_new (GUID disk_guid, uint64_t lbas, int alt)  {    GPT_header ret = { 0 }; @@ -17,7 +17,6 @@ new (DISK * d)    lbas = disk_lbas (d); -    disk_guid = guid_random ();    m = mbr_new (lbas); diff --git a/src/prototypes.h b/src/prototypes.h index 3b9bb81..11b0a69 100644 --- a/src/prototypes.h +++ b/src/prototypes.h @@ -15,7 +15,7 @@ GUID guid_random(void);  uint32_t crc32(uint32_t crc, const void *_buf, int len);  /* header.c */  void header_calc_crc(GPT_header *h); -GPT_header header_new(GUID disk_guid, int lbas, int alt); +GPT_header header_new(GUID disk_guid, uint64_t lbas, int alt);  uint32_t header_calc_ent_crc(DISK *d, GPT_header *h);  void header_show(DISK *d, GPT_header *h);  int header_validate(DISK *d, GPT_header *h); @@ -28,6 +28,7 @@ DISK *disk_open(char *fn);  void disk_read(DISK *d, void *buf, uint64_t lba, int lbas);  void disk_write(DISK *d, void *buf, uint64_t lba, int lbas);  uint64_t disk_lbas(DISK *d); +int disk_reread_kernel_table(DISK *d);  /* pmbr.c */  void mbr_entry_show(MBR_entry *e);  void mbr_show(MBR *m); @@ -26,6 +26,9 @@ sync_tables (DISK * d)        GPT_entry e = entry_read (d, &h.header, i);        uint8_t type = 0, bootable = 0; +      if (e.start>=2147483648) continue; +      if (e.end>=2147483648) continue; +        if (!guid_cmp (&e.type, &guid_efi))          {            type = MBR_PARTITION_TYPE_EFI; | 
