summaryrefslogtreecommitdiff
path: root/sys/boot/i386/libi386/devicename.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/boot/i386/libi386/devicename.c')
-rw-r--r--sys/boot/i386/libi386/devicename.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/sys/boot/i386/libi386/devicename.c b/sys/boot/i386/libi386/devicename.c
index 79a562b622834..d6f3ac1cb895e 100644
--- a/sys/boot/i386/libi386/devicename.c
+++ b/sys/boot/i386/libi386/devicename.c
@@ -120,6 +120,7 @@ i386_parsedev(struct i386_devdesc **dev, const char *devspec, const char **path)
err = EUNIT;
goto fail;
}
+#ifdef LOADER_GPT_SUPPORT
if (*cp == 'p') { /* got a GPT partition */
np = cp + 1;
slice = strtol(np, &cp, 10);
@@ -133,6 +134,7 @@ i386_parsedev(struct i386_devdesc **dev, const char *devspec, const char **path)
}
partition = 0xff;
} else {
+#endif
if (*cp == 's') { /* got a slice number */
np = cp + 1;
slice = strtol(np, &cp, 10);
@@ -149,7 +151,9 @@ i386_parsedev(struct i386_devdesc **dev, const char *devspec, const char **path)
}
cp++;
}
+#ifdef LOADER_GPT_SUPPORT
}
+#endif
} else {
cp = np;
}
@@ -227,14 +231,18 @@ i386_fmtdev(void *vdev)
case DEVT_DISK:
cp = buf;
cp += sprintf(cp, "%s%d", dev->d_dev->dv_name, dev->d_unit);
+#ifdef LOADER_GPT_SUPPORT
if (dev->d_kind.biosdisk.partition == 0xff) {
cp += sprintf(cp, "p%d", dev->d_kind.biosdisk.slice);
} else {
+#endif
if (dev->d_kind.biosdisk.slice > 0)
cp += sprintf(cp, "s%d", dev->d_kind.biosdisk.slice);
if (dev->d_kind.biosdisk.partition >= 0)
cp += sprintf(cp, "%c", dev->d_kind.biosdisk.partition + 'a');
+#ifdef LOADER_GPT_SUPPORT
}
+#endif
strcat(cp, ":");
break;