Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src add support to detect the 3 vmware GPT partition types:



details:   https://anonhg.NetBSD.org/src/rev/ec64dce45c70
branches:  trunk
changeset: 836782:ec64dce45c70
user:      mrg <mrg%NetBSD.org@localhost>
date:      Tue Nov 06 04:04:33 2018 +0000

description:
add support to detect the 3 vmware GPT partition types:

- VMKcore (dump partition)
- VMFS
- VMware reserved

this enables vmkcore partitions for netbsd swap or dump, as well
as naming all of them.

diffstat:

 common/lib/libutil/getfstypename.c |  12 +++++++++---
 sbin/gpt/gpt_uuid.c                |   7 +++++--
 sys/dev/dkwedge/dkwedge_gpt.c      |   7 +++++--
 sys/sys/disk.h                     |   5 ++++-
 sys/sys/disklabel.h                |   7 +++++--
 sys/sys/disklabel_gpt.h            |  12 +++++++++++-
 6 files changed, 39 insertions(+), 11 deletions(-)

diffs (155 lines):

diff -r 8a9c3e347b8f -r ec64dce45c70 common/lib/libutil/getfstypename.c
--- a/common/lib/libutil/getfstypename.c        Tue Nov 06 02:39:49 2018 +0000
+++ b/common/lib/libutil/getfstypename.c        Tue Nov 06 04:04:33 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: getfstypename.c,v 1.8 2012/04/07 16:28:59 christos Exp $       */
+/*     $NetBSD: getfstypename.c,v 1.9 2018/11/06 04:04:33 mrg Exp $    */
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -39,10 +39,10 @@
 # include <sys/cdefs.h>
 # ifndef _KERNEL
 #  if !defined(lint)
-__RCSID("$NetBSD: getfstypename.c,v 1.8 2012/04/07 16:28:59 christos Exp $");
+__RCSID("$NetBSD: getfstypename.c,v 1.9 2018/11/06 04:04:33 mrg Exp $");
 #  endif
 # else
-__KERNEL_RCSID(0, "$NetBSD: getfstypename.c,v 1.8 2012/04/07 16:28:59 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: getfstypename.c,v 1.9 2018/11/06 04:04:33 mrg Exp $");
 # endif /* _KERNEL */
 
 # define FSTYPE_ENUMNAME fstype_enum
@@ -123,6 +123,12 @@
                return DKW_PTYPE_UNKNOWN;
        case FS_MINIXFS3:
                return DKW_PTYPE_MINIXFS3;
+       case FS_VMKCORE:
+               return DKW_PTYPE_VMKCORE;
+       case FS_VMFS:
+               return DKW_PTYPE_VMFS;
+       case FS_VMWRESV:
+               return DKW_PTYPE_VMWRESV;
        }
        /* Stupid gcc, should know it is impossible to get here */
        /*NOTREACHED*/
diff -r 8a9c3e347b8f -r ec64dce45c70 sbin/gpt/gpt_uuid.c
--- a/sbin/gpt/gpt_uuid.c       Tue Nov 06 02:39:49 2018 +0000
+++ b/sbin/gpt/gpt_uuid.c       Tue Nov 06 04:04:33 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: gpt_uuid.c,v 1.15 2017/02/16 22:40:19 christos Exp $   */
+/*     $NetBSD: gpt_uuid.c,v 1.16 2018/11/06 04:04:33 mrg Exp $        */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
 
 #include <sys/cdefs.h>
 #ifdef __RCSID
-__RCSID("$NetBSD: gpt_uuid.c,v 1.15 2017/02/16 22:40:19 christos Exp $");
+__RCSID("$NetBSD: gpt_uuid.c,v 1.16 2018/11/06 04:04:33 mrg Exp $");
 #endif
 
 #include <err.h>
@@ -87,6 +87,9 @@
        { GPT_ENT_TYPE_NETBSD_RAIDFRAME, "raid",
            "NetBSD RAIDFrame component" },
        { GPT_ENT_TYPE_NETBSD_SWAP, "swap", "NetBSD swap" },
+       { GPT_ENT_TYPE_VMWARE_VMKCORE, "swap", "VMware VMkernel core dump" },
+       { GPT_ENT_TYPE_VMWARE_VMFS, "swap", "VMware VMFS" },
+       { GPT_ENT_TYPE_VMWARE_RESERVED, "swap", "VMware reserved" },
 };
 
 static void
diff -r 8a9c3e347b8f -r ec64dce45c70 sys/dev/dkwedge/dkwedge_gpt.c
--- a/sys/dev/dkwedge/dkwedge_gpt.c     Tue Nov 06 02:39:49 2018 +0000
+++ b/sys/dev/dkwedge/dkwedge_gpt.c     Tue Nov 06 04:04:33 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: dkwedge_gpt.c,v 1.20 2017/09/07 10:18:26 christos Exp $        */
+/*     $NetBSD: dkwedge_gpt.c,v 1.21 2018/11/06 04:04:33 mrg Exp $     */
 
 /*-
  * Copyright (c) 2004 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: dkwedge_gpt.c,v 1.20 2017/09/07 10:18:26 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dkwedge_gpt.c,v 1.21 2018/11/06 04:04:33 mrg Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -73,6 +73,9 @@
        { GPT_ENT_TYPE_NETBSD_CCD,              DKW_PTYPE_CCD },
        { GPT_ENT_TYPE_NETBSD_CGD,              DKW_PTYPE_CGD },
        { GPT_ENT_TYPE_APPLE_HFS,               DKW_PTYPE_APPLEHFS },
+       { GPT_ENT_TYPE_VMWARE_VMKCORE,          DKW_PTYPE_VMKCORE },
+       { GPT_ENT_TYPE_VMWARE_VMFS,             DKW_PTYPE_VMFS },
+       { GPT_ENT_TYPE_VMWARE_RESERVED,         DKW_PTYPE_VMWRESV },
 };
 
 static const char *
diff -r 8a9c3e347b8f -r ec64dce45c70 sys/sys/disk.h
--- a/sys/sys/disk.h    Tue Nov 06 02:39:49 2018 +0000
+++ b/sys/sys/disk.h    Tue Nov 06 04:04:33 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: disk.h,v 1.72 2017/06/13 14:05:47 chs Exp $    */
+/*     $NetBSD: disk.h,v 1.73 2018/11/06 04:04:34 mrg Exp $    */
 
 /*-
  * Copyright (c) 1996, 1997, 2004 The NetBSD Foundation, Inc.
@@ -208,6 +208,9 @@
 #define        DKW_PTYPE_NILFS         "nilfs"
 #define        DKW_PTYPE_CGD           "cgd"
 #define        DKW_PTYPE_MINIXFS3      "minixfs3"
+#define        DKW_PTYPE_VMKCORE       "vmkcore"
+#define        DKW_PTYPE_VMFS          "vmfs"
+#define        DKW_PTYPE_VMWRESV       "vmwresv"
 
 /*
  * Ensure each symbol used in FSTYPE_DEFN in <sys/disklabel.h>
diff -r 8a9c3e347b8f -r ec64dce45c70 sys/sys/disklabel.h
--- a/sys/sys/disklabel.h       Tue Nov 06 02:39:49 2018 +0000
+++ b/sys/sys/disklabel.h       Tue Nov 06 04:04:33 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: disklabel.h,v 1.119 2015/12/08 20:36:15 christos Exp $ */
+/*     $NetBSD: disklabel.h,v 1.120 2018/11/06 04:04:34 mrg Exp $      */
 
 /*
  * Copyright (c) 1987, 1988, 1993
@@ -361,7 +361,10 @@
 x(EFS,     26, "EFS",        NULL,   "efs")   /* SGI's Extent Filesystem */ \
 x(NILFS,   27, "NiLFS",      NULL,   "nilfs") /* NTT's NiLFS(2) */ \
 x(CGD,     28, "cgd",       NULL,   NULL)    /* Cryptographic disk */ \
-x(MINIXFS3,29, "MINIX FSv3", NULL,   NULL)    /* MINIX file system v3 */
+x(MINIXFS3,29, "MINIX FSv3", NULL,   NULL)    /* MINIX file system v3 */ \
+x(VMKCORE, 30, "VMware vmkcore", NULL, NULL)  /* VMware vmkcore */ \
+x(VMFS,    31, "VMware VMFS", NULL,  NULL)    /* VMware VMFS */ \
+x(VMWRESV, 32, "VMware Reserved", NULL, NULL) /* VMware reserved */
 
 
 #ifndef _LOCORE
diff -r 8a9c3e347b8f -r ec64dce45c70 sys/sys/disklabel_gpt.h
--- a/sys/sys/disklabel_gpt.h   Tue Nov 06 02:39:49 2018 +0000
+++ b/sys/sys/disklabel_gpt.h   Tue Nov 06 04:04:33 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: disklabel_gpt.h,v 1.12 2013/11/24 08:17:50 jnemeth Exp $       */
+/*     $NetBSD: disklabel_gpt.h,v 1.13 2018/11/06 04:04:34 mrg Exp $   */
 
 /*
  * Copyright (c) 2002 Marcel Moolenaar
@@ -176,4 +176,14 @@
 #define        GPT_ENT_TYPE_BIOS               \
        {0x21686148,0x6449,0x6e6f,0x74,0x4e,{0x65,0x65,0x64,0x45,0x46,0x49}}
 
+/*
+ * VMware types.
+ */
+#define        GPT_ENT_TYPE_VMWARE_VMKCORE     \
+       {0x9D275380,0x40AD,0x11DB,0xBF,0x97,{0x00,0x0C,0x29,0x11,0xD1,0xB8}}
+#define        GPT_ENT_TYPE_VMWARE_VMFS        \
+       {0xAA31E02A,0x400F,0x11DB,0x95,0x90,{0x00,0x0C,0x29,0x11,0xD1,0xB8}}
+#define        GPT_ENT_TYPE_VMWARE_RESERVED    \
+       {0x9198EFFC,0x31C0,0x11DB,0x8F,0x78,{0x00,0x0C,0x29,0x11,0xD1,0xB8}}
+
 #endif /* _SYS_DISKLABEL_GPT_H_ */



Home | Main Index | Thread Index | Old Index