Home | History | Annotate | Download | only in cgpt

Lines Matching full:drive

16   struct drive drive;
23 if (CGPT_OK != DriveOpen(params->drive_name, &drive, O_RDONLY,
27 if (GPT_SUCCESS != (gpt_retval = GptSanityCheck(&drive.gpt))) {
34 if (CGPT_OK != ReadPMBR(&drive)) {
41 GuidToStr(&drive.pmbr.boot_guid, buf, sizeof(buf));
43 int numEntries = GetNumberOfEntries(&drive);
46 GptEntry *entry = GetEntry(&drive.gpt, ANY_VALID, i);
48 if (GuidEqual(&entry->unique, &drive.pmbr.boot_guid)) {
60 (void) DriveClose(&drive, 1);
66 struct drive drive;
77 if (CGPT_OK != DriveOpen(params->drive_name, &drive, mode,
82 if (CGPT_OK != ReadPMBR(&drive)) {
88 drive.pmbr.magic[0] = 0x1d;
89 drive.pmbr.magic[1] = 0x9a;
90 drive.pmbr.sig[0] = 0x55;
91 drive.pmbr.sig[1] = 0xaa;
92 memset(&drive.pmbr.part, 0, sizeof(drive.pmbr.part));
93 drive.pmbr.part[0].f_head = 0x00;
94 drive.pmbr.part[0].f_sect = 0x02;
95 drive.pmbr.part[0].f_cyl = 0x00;
96 drive.pmbr.part[0].type = 0xee;
97 drive.pmbr.part[0].l_head = 0xff;
98 drive.pmbr.part[0].l_sect = 0xff;
99 drive.pmbr.part[0].l_cyl = 0xff;
100 drive.pmbr.part[0].f_lba = htole32(1);
102 if (drive.gpt.streaming_drive_sectors < 0xffffffff)
103 max = drive.gpt.streaming_drive_sectors - 1;
104 drive.pmbr.part[0].num_sect = htole32(max);
108 if (GPT_SUCCESS != (gpt_retval = GptSanityCheck(&drive.gpt))) {
114 if (params->partition > GetNumberOfEntries(&drive)) {
120 GptEntry *entry = GetEntry(&drive.gpt, ANY_VALID, index);
121 memcpy(&drive.pmbr.boot_guid, &entry->unique, sizeof(Guid));
131 int n = read(fd, drive.pmbr.bootcode, sizeof(drive.pmbr.bootcode));
142 GuidToStr(&drive.pmbr.boot_guid, buf, sizeof(buf));
146 if (mode == O_RDONLY || CGPT_OK == WritePMBR(&drive))
150 (void) DriveClose(&drive, 1);