diff options
author | brian <brian@FreeBSD.org> | 2010-09-16 08:16:53 +0000 |
---|---|---|
committer | brian <brian@FreeBSD.org> | 2010-09-16 08:16:53 +0000 |
commit | a59a434889e85d1d59947cb293330c657a32b412 (patch) | |
tree | 1ffa0dacfb3cfe479c1900d7deba8e453550b065 | |
parent | a14c121cce805b0a5c3e3a75579ec4503792ce9a (diff) | |
download | FreeBSD-src-a59a434889e85d1d59947cb293330c657a32b412.zip FreeBSD-src-a59a434889e85d1d59947cb293330c657a32b412.tar.gz |
Add support for identifying a journaled root filesystem.
Fix support for identifying the given /dev/vinum/root example.
MFC after: 3 weeks
-rw-r--r-- | sbin/fdisk/fdisk.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sbin/fdisk/fdisk.c b/sbin/fdisk/fdisk.c index c53ef85..0495a69 100644 --- a/sbin/fdisk/fdisk.c +++ b/sbin/fdisk/fdisk.c @@ -1462,6 +1462,7 @@ sanitize_partition(struct dos_partition *partp) * /dev/da0a => /dev/da0 * /dev/vinum/root => /dev/vinum/root * A ".eli" part is removed if it exists (see geli(8)). + * A ".journal" ending is removed if it exists (see gjournal(8)). */ static char * get_rootdisk(void) @@ -1476,7 +1477,7 @@ get_rootdisk(void) if (statfs("/", &rootfs) == -1) err(1, "statfs(\"/\")"); - if ((rv = regcomp(&re, "^(/dev/[a-z/]+[0-9]+)([sp][0-9]+)?[a-h]?$", + if ((rv = regcomp(&re, "^(/dev/[a-z/]+[0-9]*)([sp][0-9]+)?[a-h]?(\\.journal)?$", REG_EXTENDED)) != 0) errx(1, "regcomp() failed (%d)", rv); strlcpy(dev, rootfs.f_mntfromname, sizeof (dev)); |