diff options
Diffstat (limited to 'sbin/geom')
-rw-r--r-- | sbin/geom/Makefile | 7 | ||||
-rw-r--r-- | sbin/geom/class/label/geom_label.c | 11 | ||||
-rw-r--r-- | sbin/geom/core/geom.c | 5 |
3 files changed, 18 insertions, 5 deletions
diff --git a/sbin/geom/Makefile b/sbin/geom/Makefile index af2b77b..0cb98d1 100644 --- a/sbin/geom/Makefile +++ b/sbin/geom/Makefile @@ -2,10 +2,13 @@ .if defined(RESCUE) -.PATH: ${.CURDIR}/class/part ${.CURDIR}/core ${.CURDIR}/misc +.PATH: ${.CURDIR}/class/part \ + ${.CURDIR}/class/label \ + ${.CURDIR}/core \ + ${.CURDIR}/misc PROG= geom -SRCS= geom.c geom_part.c subr.c +SRCS= geom.c geom_label.c geom_part.c subr.c CFLAGS+=-I${.CURDIR} -I${.CURDIR}/core diff --git a/sbin/geom/class/label/geom_label.c b/sbin/geom/class/label/geom_label.c index 9e27eec..eec20ca 100644 --- a/sbin/geom/class/label/geom_label.c +++ b/sbin/geom/class/label/geom_label.c @@ -40,16 +40,21 @@ __FBSDID("$FreeBSD$"); #include "core/geom.h" #include "misc/subr.h" +#ifdef RESCUE +#define PUBSYM(x) glabel_##x +#else +#define PUBSYM(x) x +#endif -uint32_t lib_version = G_LIB_VERSION; -uint32_t version = G_LABEL_VERSION; +uint32_t PUBSYM(lib_version) = G_LIB_VERSION; +uint32_t PUBSYM(version) = G_LABEL_VERSION; static void label_main(struct gctl_req *req, unsigned flags); static void label_clear(struct gctl_req *req); static void label_dump(struct gctl_req *req); static void label_label(struct gctl_req *req); -struct g_command class_commands[] = { +struct g_command PUBSYM(class_commands)[] = { { "clear", G_FLAG_VERBOSE, label_main, G_NULL_OPTS, NULL, "[-v] dev ..." }, diff --git a/sbin/geom/core/geom.c b/sbin/geom/core/geom.c index 91fb2f2..8726e626 100644 --- a/sbin/geom/core/geom.c +++ b/sbin/geom/core/geom.c @@ -54,6 +54,8 @@ __FBSDID("$FreeBSD$"); #ifdef RESCUE extern uint32_t gpart_version; extern struct g_command gpart_class_commands[]; +extern uint32_t glabel_version; +extern struct g_command glabel_class_commands[]; #endif static char comm[MAXPATHLEN], *class_name = NULL, *gclass_name = NULL; @@ -604,6 +606,9 @@ get_class(int *argc, char ***argv) if (!strcasecmp(class_name, "part")) { version = &gpart_version; class_commands = gpart_class_commands; + } else if (!strcasecmp(class_name, "label")) { + version = &glabel_version; + class_commands = glabel_class_commands; } else errx(EXIT_FAILURE, "Invalid class name."); #endif /* !RESCUE */ |