summaryrefslogtreecommitdiffstats
path: root/lib/libdisk
diff options
context:
space:
mode:
authormarcel <marcel@FreeBSD.org>2008-04-24 00:11:15 +0000
committermarcel <marcel@FreeBSD.org>2008-04-24 00:11:15 +0000
commit38f942a4e1a1cee0a4e0673c0ed47803ea80b5c0 (patch)
tree3a26e1f62df77c0485644e9ceb6ca2ac070137d0 /lib/libdisk
parent22b58de0b5b831e144a28559a02d4bcc0a57ebff (diff)
downloadFreeBSD-src-38f942a4e1a1cee0a4e0673c0ed47803ea80b5c0.zip
FreeBSD-src-38f942a4e1a1cee0a4e0673c0ed47803ea80b5c0.tar.gz
Add support for gpart:
o Correct for gpart's 1-based index, versus 0-based index used by legacy slicers. o Parse and understand the xs and xt parameters.
Diffstat (limited to 'lib/libdisk')
-rw-r--r--lib/libdisk/open_disk.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/lib/libdisk/open_disk.c b/lib/libdisk/open_disk.c
index 5ffae46..6ffe88d 100644
--- a/lib/libdisk/open_disk.c
+++ b/lib/libdisk/open_disk.c
@@ -193,7 +193,7 @@ Int_Open_Disk(const char *name, char *conftxt)
if (!strcmp(a, "o"))
off = o;
else if (!strcmp(a, "i"))
- i = o;
+ i = (!strcmp(t, "PART")) ? o - 1 : o;
else if (!strcmp(a, "ty"))
ty = o;
else if (!strcmp(a, "sc"))
@@ -202,6 +202,14 @@ Int_Open_Disk(const char *name, char *conftxt)
hd = o;
else if (!strcmp(a, "alt"))
alt = o;
+ else if (!strcmp(a, "xs"))
+ t = b;
+ else if (!strcmp(a, "xt")) {
+ if (*r)
+ sn = b;
+ else
+ ty = o;
+ }
}
/* PLATFORM POLICY BEGIN ----------------------------------- */
@@ -278,11 +286,7 @@ Int_Open_Disk(const char *name, char *conftxt)
i = Add_Chunk(d, off, len, n, gpt, 0, 0, b);
else if (!strcmp(t, "APPLE"))
i = Add_Chunk(d, off, len, n, apple, 0, 0, sn);
- else if (!strcmp(t, "PART")) {
-#ifdef __powerpc__
- i = Add_Chunk(d, off, len, n, apple, 0, 0, sn);
-#endif
- } else
+ else
; /* Ignore unknown classes. */
}
/* PLATFORM POLICY BEGIN ------------------------------------- */
OpenPOWER on IntegriCloud