Lines Matching refs:bootstrapbuf
69 uint8_t *bootstrapbuf; in landisk_setboot() local
83 bootstrapbuf = NULL; in landisk_setboot()
128 bootstrapbuf = malloc(bootstrapsize); in landisk_setboot()
129 if (bootstrapbuf == NULL) { in landisk_setboot()
133 memset(bootstrapbuf, 0, bootstrapsize); in landisk_setboot()
138 rv = pread(params->s1fd, bootstrapbuf, params->s1stat.st_size, 0); in landisk_setboot()
147 magic = *(uint32_t *)(bootstrapbuf + 512 * 2 + 4); in landisk_setboot()
163 if (bootstrapbuf[1] == 0xa0 && bootstrapbuf[2] == 0x11 && in landisk_setboot()
164 (bootstrapbuf[0] == 0x2b /*|| bootstrapbuf[0] == 0x1d*/)) { in landisk_setboot()
165 bpbsize = bootstrapbuf[0] + 2 - MBR_BPB_OFFSET; in landisk_setboot()
174 if (*(uint8_t *)(bootstrapbuf + MBR_PART_OFFSET + i) != 0) { in landisk_setboot()
191 (void)memcpy(bootstrapbuf + MBR_BPB_OFFSET, &mbr.mbr_bpb, in landisk_setboot()
195 memcpy(bootstrapbuf + MBR_PART_OFFSET, &mbr.mbr_parts, in landisk_setboot()
204 bpp = (void *)(bootstrapbuf + 512 * 2 + 8); in landisk_setboot()
231 rv = pwrite(params->fsfd, bootstrapbuf, 512, 0); in landisk_setboot()
243 rv = pwrite(params->fsfd, bootstrapbuf + 512 * 2, in landisk_setboot()
256 if (bootstrapbuf) in landisk_setboot()
257 free(bootstrapbuf); in landisk_setboot()