Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 6 Apr 2014 02:44:38 +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: r264185 - in head/sys: conf geom/label modules/geom/geom_label
Message-ID:  <201404060244.s362icEb031481@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: marcel
Date: Sun Apr  6 02:44:37 2014
New Revision: 264185
URL: http://svnweb.freebsd.org/changeset/base/264185

Log:
  An all-or-nothing approach to labels isn't flexible enough. Embedded
  systems need fine-grained control over what's in and what's out.
  That's ideal. For now, separate GPT labels from the rest and allow
  g_label to be built with just GPT labels.
  
  Obtained from:	Juniper Networks, Inc.

Modified:
  head/sys/conf/files
  head/sys/conf/options
  head/sys/geom/label/g_label.c
  head/sys/modules/geom/geom_label/Makefile

Modified: head/sys/conf/files
==============================================================================
--- head/sys/conf/files	Sun Apr  6 02:20:42 2014	(r264184)
+++ head/sys/conf/files	Sun Apr  6 02:44:37 2014	(r264185)
@@ -2684,14 +2684,14 @@ geom/geom_vfs.c			standard
 geom/geom_vol_ffs.c		optional geom_vol
 geom/journal/g_journal.c	optional geom_journal
 geom/journal/g_journal_ufs.c	optional geom_journal
-geom/label/g_label.c		optional geom_label
+geom/label/g_label.c		optional geom_label | geom_label_gpt
 geom/label/g_label_ext2fs.c	optional geom_label
 geom/label/g_label_iso9660.c	optional geom_label
 geom/label/g_label_msdosfs.c	optional geom_label
 geom/label/g_label_ntfs.c	optional geom_label
 geom/label/g_label_reiserfs.c	optional geom_label
 geom/label/g_label_ufs.c	optional geom_label
-geom/label/g_label_gpt.c	optional geom_label
+geom/label/g_label_gpt.c	optional geom_label | geom_label_gpt
 geom/label/g_label_disk_ident.c	optional geom_label
 geom/linux_lvm/g_linux_lvm.c	optional geom_linux_lvm
 geom/mirror/g_mirror.c		optional geom_mirror

Modified: head/sys/conf/options
==============================================================================
--- head/sys/conf/options	Sun Apr  6 02:20:42 2014	(r264184)
+++ head/sys/conf/options	Sun Apr  6 02:44:37 2014	(r264185)
@@ -102,6 +102,7 @@ GEOM_FOX	opt_geom.h
 GEOM_GATE	opt_geom.h
 GEOM_JOURNAL	opt_geom.h
 GEOM_LABEL	opt_geom.h
+GEOM_LABEL_GPT	opt_geom.h
 GEOM_LINUX_LVM	opt_geom.h
 GEOM_MBR	opt_geom.h
 GEOM_MIRROR	opt_geom.h

Modified: head/sys/geom/label/g_label.c
==============================================================================
--- head/sys/geom/label/g_label.c	Sun Apr  6 02:20:42 2014	(r264184)
+++ head/sys/geom/label/g_label.c	Sun Apr  6 02:44:37 2014	(r264185)
@@ -27,6 +27,8 @@
 #include <sys/cdefs.h>
 __FBSDID("$FreeBSD$");
 
+#include "opt_geom.h"
+
 #include <sys/param.h>
 #include <sys/systm.h>
 #include <sys/kernel.h>
@@ -80,6 +82,9 @@ struct g_class g_label_class = {
  * 6. Add your file system to manual page sbin/geom/class/label/glabel.8.
  */
 const struct g_label_desc *g_labels[] = {
+	&g_label_gpt,
+	&g_label_gpt_uuid,
+#ifdef GEOM_LABEL
 	&g_label_ufs_id,
 	&g_label_ufs_volume,
 	&g_label_iso9660,
@@ -87,9 +92,8 @@ const struct g_label_desc *g_labels[] = 
 	&g_label_ext2fs,
 	&g_label_reiserfs,
 	&g_label_ntfs,
-	&g_label_gpt,
-	&g_label_gpt_uuid,
 	&g_label_disk_ident,
+#endif
 	NULL
 };
 

Modified: head/sys/modules/geom/geom_label/Makefile
==============================================================================
--- head/sys/modules/geom/geom_label/Makefile	Sun Apr  6 02:20:42 2014	(r264184)
+++ head/sys/modules/geom/geom_label/Makefile	Sun Apr  6 02:44:37 2014	(r264185)
@@ -12,5 +12,9 @@ SRCS+=	g_label_msdosfs.c
 SRCS+=	g_label_ntfs.c
 SRCS+=	g_label_reiserfs.c
 SRCS+=	g_label_ufs.c
+SRCS+=	opt_geom.h
+
+opt_geom.h:
+	echo "#define GEOM_LABEL 1" > ${.TARGET}
 
 .include <bsd.kmod.mk>



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201404060244.s362icEb031481>