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.
This commit is contained in:
mrg 2018-11-06 04:04:33 +00:00
parent 0f1e9886f4
commit f5f53dd6ab
6 changed files with 39 additions and 11 deletions

View File

@ -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. * Copyright (c) 2011 The NetBSD Foundation, Inc.
@ -39,10 +39,10 @@
# include <sys/cdefs.h> # include <sys/cdefs.h>
# ifndef _KERNEL # ifndef _KERNEL
# if !defined(lint) # 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 # endif
# else # 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 */ # endif /* _KERNEL */
# define FSTYPE_ENUMNAME fstype_enum # define FSTYPE_ENUMNAME fstype_enum
@ -123,6 +123,12 @@ getfstypename(int fstype)
return DKW_PTYPE_UNKNOWN; return DKW_PTYPE_UNKNOWN;
case FS_MINIXFS3: case FS_MINIXFS3:
return DKW_PTYPE_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 */ /* Stupid gcc, should know it is impossible to get here */
/*NOTREACHED*/ /*NOTREACHED*/

View File

@ -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. * Copyright (c) 2014 The NetBSD Foundation, Inc.
@ -32,7 +32,7 @@
#include <sys/cdefs.h> #include <sys/cdefs.h>
#ifdef __RCSID #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 #endif
#include <err.h> #include <err.h>
@ -87,6 +87,9 @@ static const struct {
{ GPT_ENT_TYPE_NETBSD_RAIDFRAME, "raid", { GPT_ENT_TYPE_NETBSD_RAIDFRAME, "raid",
"NetBSD RAIDFrame component" }, "NetBSD RAIDFrame component" },
{ GPT_ENT_TYPE_NETBSD_SWAP, "swap", "NetBSD swap" }, { 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 static void

View File

@ -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. * Copyright (c) 2004 The NetBSD Foundation, Inc.
@ -34,7 +34,7 @@
*/ */
#include <sys/cdefs.h> #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/param.h>
#include <sys/systm.h> #include <sys/systm.h>
@ -73,6 +73,9 @@ static const struct {
{ GPT_ENT_TYPE_NETBSD_CCD, DKW_PTYPE_CCD }, { GPT_ENT_TYPE_NETBSD_CCD, DKW_PTYPE_CCD },
{ GPT_ENT_TYPE_NETBSD_CGD, DKW_PTYPE_CGD }, { GPT_ENT_TYPE_NETBSD_CGD, DKW_PTYPE_CGD },
{ GPT_ENT_TYPE_APPLE_HFS, DKW_PTYPE_APPLEHFS }, { 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 * static const char *

View File

@ -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. * Copyright (c) 1996, 1997, 2004 The NetBSD Foundation, Inc.
@ -208,6 +208,9 @@ struct dkwedge_list {
#define DKW_PTYPE_NILFS "nilfs" #define DKW_PTYPE_NILFS "nilfs"
#define DKW_PTYPE_CGD "cgd" #define DKW_PTYPE_CGD "cgd"
#define DKW_PTYPE_MINIXFS3 "minixfs3" #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> * Ensure each symbol used in FSTYPE_DEFN in <sys/disklabel.h>

View File

@ -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 * Copyright (c) 1987, 1988, 1993
@ -361,7 +361,10 @@ x(SYSVBFS, 25, "SysVBFS", NULL, "sysvbfs")/* System V boot file system */ \
x(EFS, 26, "EFS", NULL, "efs") /* SGI's Extent Filesystem */ \ x(EFS, 26, "EFS", NULL, "efs") /* SGI's Extent Filesystem */ \
x(NILFS, 27, "NiLFS", NULL, "nilfs") /* NTT's NiLFS(2) */ \ x(NILFS, 27, "NiLFS", NULL, "nilfs") /* NTT's NiLFS(2) */ \
x(CGD, 28, "cgd", NULL, NULL) /* Cryptographic disk */ \ 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 #ifndef _LOCORE

View File

@ -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 * Copyright (c) 2002 Marcel Moolenaar
@ -176,4 +176,14 @@ struct gpt_ent {
#define GPT_ENT_TYPE_BIOS \ #define GPT_ENT_TYPE_BIOS \
{0x21686148,0x6449,0x6e6f,0x74,0x4e,{0x65,0x65,0x64,0x45,0x46,0x49}} {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_ */ #endif /* _SYS_DISKLABEL_GPT_H_ */