Date: Fri, 25 May 2012 20:33:35 +0000 (UTC) From: Marcel Moolenaar <marcel@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r236023 - in head/sys: geom/part sys Message-ID: <201205252033.q4PKXZqG031813@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: marcel Date: Fri May 25 20:33:34 2012 New Revision: 236023 URL: http://svn.freebsd.org/changeset/base/236023 Log: Add a partition type for nandfs to the apm, bsd, gpt and vtoc8 schemes. The gpart alias for these partition types is "freebsd-nandfs". Modified: head/sys/geom/part/g_part.c head/sys/geom/part/g_part.h head/sys/geom/part/g_part_apm.c head/sys/geom/part/g_part_bsd.c head/sys/geom/part/g_part_gpt.c head/sys/geom/part/g_part_vtoc8.c head/sys/sys/apm.h head/sys/sys/disklabel.h head/sys/sys/gpt.h head/sys/sys/vtoc.h Modified: head/sys/geom/part/g_part.c ============================================================================== --- head/sys/geom/part/g_part.c Fri May 25 19:57:01 2012 (r236022) +++ head/sys/geom/part/g_part.c Fri May 25 20:33:34 2012 (r236023) @@ -83,6 +83,7 @@ struct g_part_alias_list { { "fat32", G_PART_ALIAS_MS_FAT32 }, { "freebsd", G_PART_ALIAS_FREEBSD }, { "freebsd-boot", G_PART_ALIAS_FREEBSD_BOOT }, + { "freebsd-nandfs", G_PART_ALIAS_FREEBSD_NANDFS }, { "freebsd-swap", G_PART_ALIAS_FREEBSD_SWAP }, { "freebsd-ufs", G_PART_ALIAS_FREEBSD_UFS }, { "freebsd-vinum", G_PART_ALIAS_FREEBSD_VINUM }, Modified: head/sys/geom/part/g_part.h ============================================================================== --- head/sys/geom/part/g_part.h Fri May 25 19:57:01 2012 (r236022) +++ head/sys/geom/part/g_part.h Fri May 25 20:33:34 2012 (r236023) @@ -46,6 +46,7 @@ enum g_part_alias { G_PART_ALIAS_EFI, /* A EFI system partition entry. */ G_PART_ALIAS_FREEBSD, /* A BSD labeled partition entry. */ G_PART_ALIAS_FREEBSD_BOOT, /* A FreeBSD boot partition entry. */ + G_PART_ALIAS_FREEBSD_NANDFS, /* A FreeBSD nandfs partition entry. */ G_PART_ALIAS_FREEBSD_SWAP, /* A swap partition entry. */ G_PART_ALIAS_FREEBSD_UFS, /* A UFS/UFS2 file system entry. */ G_PART_ALIAS_FREEBSD_VINUM, /* A Vinum partition entry. */ Modified: head/sys/geom/part/g_part_apm.c ============================================================================== --- head/sys/geom/part/g_part_apm.c Fri May 25 19:57:01 2012 (r236022) +++ head/sys/geom/part/g_part_apm.c Fri May 25 20:33:34 2012 (r236023) @@ -159,6 +159,11 @@ apm_parse_type(const char *type, char *b strcpy(buf, APM_ENT_TYPE_FREEBSD); return (0); } + alias = g_part_alias_name(G_PART_ALIAS_FREEBSD_NANDFS); + if (!strcasecmp(type, alias)) { + strcpy(buf, APM_ENT_TYPE_FREEBSD_NANDFS); + return (0); + } alias = g_part_alias_name(G_PART_ALIAS_FREEBSD_SWAP); if (!strcasecmp(type, alias)) { strcpy(buf, APM_ENT_TYPE_FREEBSD_SWAP); @@ -485,6 +490,8 @@ g_part_apm_type(struct g_part_table *bas return (g_part_alias_name(G_PART_ALIAS_APPLE_UFS)); if (!strcmp(type, APM_ENT_TYPE_FREEBSD)) return (g_part_alias_name(G_PART_ALIAS_FREEBSD)); + if (!strcmp(type, APM_ENT_TYPE_FREEBSD_NANDFS)) + return (g_part_alias_name(G_PART_ALIAS_FREEBSD_NANDFS)); if (!strcmp(type, APM_ENT_TYPE_FREEBSD_SWAP)) return (g_part_alias_name(G_PART_ALIAS_FREEBSD_SWAP)); if (!strcmp(type, APM_ENT_TYPE_FREEBSD_UFS)) Modified: head/sys/geom/part/g_part_bsd.c ============================================================================== --- head/sys/geom/part/g_part_bsd.c Fri May 25 19:57:01 2012 (r236022) +++ head/sys/geom/part/g_part_bsd.c Fri May 25 20:33:34 2012 (r236023) @@ -126,6 +126,11 @@ bsd_parse_type(const char *type, uint8_t *fstype = (u_int)lt; return (0); } + alias = g_part_alias_name(G_PART_ALIAS_FREEBSD_NANDFS); + if (!strcasecmp(type, alias)) { + *fstype = FS_NANDFS; + return (0); + } alias = g_part_alias_name(G_PART_ALIAS_FREEBSD_SWAP); if (!strcasecmp(type, alias)) { *fstype = FS_SWAP; @@ -450,6 +455,8 @@ g_part_bsd_type(struct g_part_table *bas entry = (struct g_part_bsd_entry *)baseentry; type = entry->part.p_fstype; + if (type == FS_NANDFS) + return (g_part_alias_name(G_PART_ALIAS_FREEBSD_NANDFS)); if (type == FS_SWAP) return (g_part_alias_name(G_PART_ALIAS_FREEBSD_SWAP)); if (type == FS_BSDFFS) Modified: head/sys/geom/part/g_part_gpt.c ============================================================================== --- head/sys/geom/part/g_part_gpt.c Fri May 25 19:57:01 2012 (r236022) +++ head/sys/geom/part/g_part_gpt.c Fri May 25 20:33:34 2012 (r236023) @@ -155,6 +155,7 @@ static struct uuid gpt_uuid_bios_boot = static struct uuid gpt_uuid_efi = GPT_ENT_TYPE_EFI; static struct uuid gpt_uuid_freebsd = GPT_ENT_TYPE_FREEBSD; static struct uuid gpt_uuid_freebsd_boot = GPT_ENT_TYPE_FREEBSD_BOOT; +static struct uuid gpt_uuid_freebsd_nandfs = GPT_ENT_TYPE_FREEBSD_NANDFS; static struct uuid gpt_uuid_freebsd_swap = GPT_ENT_TYPE_FREEBSD_SWAP; static struct uuid gpt_uuid_freebsd_ufs = GPT_ENT_TYPE_FREEBSD_UFS; static struct uuid gpt_uuid_freebsd_vinum = GPT_ENT_TYPE_FREEBSD_VINUM; @@ -195,6 +196,7 @@ static struct g_part_uuid_alias { { &gpt_uuid_efi, G_PART_ALIAS_EFI, 0xee }, { &gpt_uuid_freebsd, G_PART_ALIAS_FREEBSD, 0xa5 }, { &gpt_uuid_freebsd_boot, G_PART_ALIAS_FREEBSD_BOOT, 0 }, + { &gpt_uuid_freebsd_nandfs, G_PART_ALIAS_FREEBSD_NANDFS, 0 }, { &gpt_uuid_freebsd_swap, G_PART_ALIAS_FREEBSD_SWAP, 0 }, { &gpt_uuid_freebsd_ufs, G_PART_ALIAS_FREEBSD_UFS, 0 }, { &gpt_uuid_freebsd_vinum, G_PART_ALIAS_FREEBSD_VINUM, 0 }, Modified: head/sys/geom/part/g_part_vtoc8.c ============================================================================== --- head/sys/geom/part/g_part_vtoc8.c Fri May 25 19:57:01 2012 (r236022) +++ head/sys/geom/part/g_part_vtoc8.c Fri May 25 20:33:34 2012 (r236023) @@ -114,6 +114,11 @@ vtoc8_parse_type(const char *type, uint1 *tag = (uint16_t)lt; return (0); } + alias = g_part_alias_name(G_PART_ALIAS_FREEBSD_NANDFS); + if (!strcasecmp(type, alias)) { + *tag = VTOC_TAG_FREEBSD_NANDFS; + return (0); + } alias = g_part_alias_name(G_PART_ALIAS_FREEBSD_SWAP); if (!strcasecmp(type, alias)) { *tag = VTOC_TAG_FREEBSD_SWAP; @@ -487,6 +492,8 @@ g_part_vtoc8_type(struct g_part_table *b table = (struct g_part_vtoc8_table *)basetable; tag = be16dec(&table->vtoc.part[entry->gpe_index - 1].tag); + if (tag == VTOC_TAG_FREEBSD_NANDFS) + return (g_part_alias_name(G_PART_ALIAS_FREEBSD_NANDFS)); if (tag == VTOC_TAG_FREEBSD_SWAP) return (g_part_alias_name(G_PART_ALIAS_FREEBSD_SWAP)); if (tag == VTOC_TAG_FREEBSD_UFS) Modified: head/sys/sys/apm.h ============================================================================== --- head/sys/sys/apm.h Fri May 25 19:57:01 2012 (r236022) +++ head/sys/sys/apm.h Fri May 25 20:33:34 2012 (r236023) @@ -56,6 +56,7 @@ struct apm_ent { #define APM_ENT_TYPE_UNUSED "Apple_Free" #define APM_ENT_TYPE_FREEBSD "FreeBSD" +#define APM_ENT_TYPE_FREEBSD_NANDFS "FreeBSD-nandfs" #define APM_ENT_TYPE_FREEBSD_SWAP "FreeBSD-swap" #define APM_ENT_TYPE_FREEBSD_UFS "FreeBSD-UFS" #define APM_ENT_TYPE_FREEBSD_VINUM "FreeBSD-Vinum" Modified: head/sys/sys/disklabel.h ============================================================================== --- head/sys/sys/disklabel.h Fri May 25 19:57:01 2012 (r236022) +++ head/sys/sys/disklabel.h Fri May 25 20:33:34 2012 (r236023) @@ -232,6 +232,7 @@ static const char *dktypenames[] = { #define FS_UDF 24 /* UDF */ #define FS_EFS 26 /* SGI's Extent File system */ #define FS_ZFS 27 /* Sun's ZFS */ +#define FS_NANDFS 30 /* FreeBSD nandfs (NiLFS derived) */ #ifdef FSTYPENAMES static const char *fstypenames[] = { @@ -263,6 +264,9 @@ static const char *fstypenames[] = { "?", "EFS", "ZFS", + "?", + "?", + "nandfs", NULL }; #define FSMAXTYPES (sizeof(fstypenames) / sizeof(fstypenames[0]) - 1) Modified: head/sys/sys/gpt.h ============================================================================== --- head/sys/sys/gpt.h Fri May 25 19:57:01 2012 (r236022) +++ head/sys/sys/gpt.h Fri May 25 20:33:34 2012 (r236023) @@ -79,6 +79,10 @@ struct gpt_ent { {0x024dee41,0x33e7,0x11d3,0x9d,0x69,{0x00,0x08,0xc7,0x81,0xf3,0x9f}} #define GPT_ENT_TYPE_FREEBSD \ {0x516e7cb4,0x6ecf,0x11d6,0x8f,0xf8,{0x00,0x02,0x2d,0x09,0x71,0x2b}} +#define GPT_ENT_TYPE_FREEBSD_BOOT \ + {0x83bd6b9d,0x7f41,0x11dc,0xbe,0x0b,{0x00,0x15,0x60,0xb8,0x4f,0x0f}} +#define GPT_ENT_TYPE_FREEBSD_NANDFS \ + {0x74ba7dd9,0xa689,0x11e1,0xbd,0x04,{0x00,0xe0,0x81,0x28,0x6a,0xcf}} #define GPT_ENT_TYPE_FREEBSD_SWAP \ {0x516e7cb5,0x6ecf,0x11d6,0x8f,0xf8,{0x00,0x02,0x2d,0x09,0x71,0x2b}} #define GPT_ENT_TYPE_FREEBSD_UFS \ @@ -87,8 +91,6 @@ struct gpt_ent { {0x516e7cb8,0x6ecf,0x11d6,0x8f,0xf8,{0x00,0x02,0x2d,0x09,0x71,0x2b}} #define GPT_ENT_TYPE_FREEBSD_ZFS \ {0x516e7cba,0x6ecf,0x11d6,0x8f,0xf8,{0x00,0x02,0x2d,0x09,0x71,0x2b}} -#define GPT_ENT_TYPE_FREEBSD_BOOT \ - {0x83bd6b9d,0x7f41,0x11dc,0xbe,0x0b,{0x00,0x15,0x60,0xb8,0x4f,0x0f}} /* * The following are unused but documented here to avoid reuse. Modified: head/sys/sys/vtoc.h ============================================================================== --- head/sys/sys/vtoc.h Fri May 25 19:57:01 2012 (r236022) +++ head/sys/sys/vtoc.h Fri May 25 20:33:34 2012 (r236023) @@ -51,6 +51,7 @@ #define VTOC_TAG_FREEBSD_UFS 0x0902 #define VTOC_TAG_FREEBSD_VINUM 0x0903 #define VTOC_TAG_FREEBSD_ZFS 0x0904 +#define VTOC_TAG_FREEBSD_NANDFS 0x0905 #define VTOC_FLAG_UNMNT 0x01 /* unmountable partition */ #define VTOC_FLAG_RDONLY 0x10 /* partition is read/only */
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201205252033.q4PKXZqG031813>