Lines Matching defs:path
139 read_stage1_from_file(char *path, ib_data_t *dest)
146 fd = open(path, O_RDONLY);
150 path);
237 char **path)
251 *path = device->target.path;
255 *path = device->stage.path;
329 char *path;
335 ret = read_bootblock_from_disk(device, &bblock_disk, &path);
337 BOOT_DEBUG("Unable to read bootblock from %s\n", path);
368 "non versioned one\n"), device->path);
373 BOOT_DEBUG("Forcing update of %s bootblock\n", device->path);
490 char *path;
507 path = device->target.path;
512 path = device->stage.path;
516 "too small to fit the stage2\n"), path);
523 "to %s at offset %d\n", path, offset);
528 " %d sectors starting at %d (abs %lld)\n"), path,
572 strcmp(device->target.path, device->stage.path)) {
776 if ((rval = libfdisk_init(&epp, device->path, NULL, FDISK_READ_DISK))
852 open_device(char *path)
858 fd = open(path, O_RDONLY);
860 fd = open(path, O_RDWR);
863 BOOT_DEBUG("Unable to open %s\n", path);
869 BOOT_DEBUG("Unable to stat %s\n", path);
877 path);
889 char *path, *ptr;
900 device->stage.path = strdup(device->path);
901 if (device->stage.path == NULL) {
915 if ((path = strdup(device->path)) == NULL) {
920 ptr = strrchr(path, 'p');
923 (void) asprintf(&ptr, "%s%d", path, i+1); /* partitions are p1..p4 */
924 free(path);
929 device->stage.path = ptr;
944 char *path, *ptr;
948 if ((path = strdup(device->target.path)) == NULL) {
952 ptr = strrchr(path, 's');
955 (void) asprintf(&ptr, "%s%d", path, i);
956 free(path);
961 device->stage.path = ptr;
976 init_device(ib_device_t *device, char *path)
982 int pathlen = strlen(path);
991 if ((p = strrchr(path, '/')) == NULL)
992 p = path;
994 (path[pathlen-2] == 'p' && path[pathlen-1] == '0')) {
999 device->target.path = strdup(path);
1000 if (device->target.path == NULL) {
1004 device->path = strdup(path);
1005 if (device->path == NULL) {
1011 device->path[pathlen - 2] = 'p';
1012 device->path[pathlen - 1] = '0';
1014 if (strstr(device->target.path, "diskette")) {
1021 if (strstr(device->target.path, "p0:boot")) {
1027 if ((device->fd = open_device(device->path)) == -1)
1044 } else if (device->target.path[pathlen - 2] == 'p') {
1049 } else if (device->target.path[pathlen - 1] == '2') {
1060 if (device->stage.path == NULL) {
1061 if ((device->stage.path = strdup(path)) == NULL) {
1067 device->stage.path[pathlen - 2] = 's';
1068 device->stage.path[pathlen - 1] = '2';
1071 p = strrchr(device->stage.path, 'p');
1073 p = strrchr(device->stage.path, 's');
1077 device->stage.fd = open_device(device->stage.path);
1080 p = strrchr(device->target.path, 'p');
1082 p = strrchr(device->target.path, 's');
1085 if (strcmp(device->stage.path, device->target.path) == 0)
1088 device->target.fd = open_device(device->target.path);
1141 if (device->path)
1142 free(device->path);
1143 if (device->stage.path)
1144 free(device->stage.path);
1145 if (device->target.path)
1146 free(device->target.path);
1182 src->device.path);
1207 src->device.path, dest->device.path);
1240 * to contain 3 parameters (the target device path and the path to the
1270 BOOT_DEBUG("device path: %s, stage1 path: %s bootblock path: %s\n",
1320 * Expects one parameter, the device path, in the form: /dev/rdsk/c?[t?]d?s0
1335 char *device_path, *path;
1353 BOOT_DEBUG("device path: %s\n", device_path);
1356 path = device_path;
1364 ret = read_bootblock_from_disk(&device, &bblock, &path);
1369 "%s\n"), path);
1430 char *path;
1442 BOOT_DEBUG("Current device path is: %s, attaching device path is: "
1462 ret = read_bootblock_from_disk(curr_device, bblock_curr, &path);
1464 BOOT_DEBUG("Error reading bootblock from %s\n", path);
1471 " the bootblock\n", path);