metarecover.c revision 80148899834a4078a2bd348504aa2d6de9752837
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/*
* Recover metadevice configurations that have been lost by scanning
* media, intelligent guessing, or other means.
*/
#include <meta.h>
#include <sdssc.h>
/*
* print usage message
*/
static void
int eval
)
{
"usage: %s [-s setname] [-v] raw-device -p\n"), myname);
" %s [-s setname] [-v] [-n] raw-device -p -d\n"), myname);
" %s [-s setname] [-v] [-n] raw-device -p -m\n"), myname);
}
int
main(
int argc,
char *argv[]
)
{
char *sname = MD_LOCAL_NAME;
char *devname;
int error;
int c;
/*
* Get the locale set up before calling any other routines
* with messages to ouput. Just in case we're not in a build
* environment, make sure that TEXT_DOMAIN gets set to
* something.
*/
#if !defined(TEXT_DOMAIN)
#define TEXT_DOMAIN "SYS_TEST"
#endif
(void) textdomain(TEXT_DOMAIN);
if (sdssc_bind_library() == SDSSC_ERROR) {
"%s: Interface error with libsds_sc.so\n"), argv[0]);
exit(1);
}
meta_check_root(ep) != 0) {
}
/* parse arguments */
optind = 1;
opterr = 1;
switch (c) {
case 's':
break;
case 'h':
break;
case 'v':
options |= MDCMD_VERBOSE;
break;
case 'n':
options &= ~MDCMD_DOIT;
break;
case '?':
if (optopt == '?')
/*FALLTHROUGH*/
default:
break;
}
}
/* sname is MD_LOCAL_NAME if not specified on the command line */
}
}
/* get raw device name */
argv++;
argc--;
}
/* check for a valid component */
}
/* check for ownership */
}
/*
* If the component is not a metadevice and we have a named set
* make sure that the component is part of the named set.
*/
if (!metaismeta(namep)) {
}
}
}
/* parse command line -- currently only soft partitions are supported */
} else {
}
if (error < 0) {
} else {
}
}
/*NOTREACHED*/
return (0);
}