metaconf.c revision 8d8f3e46a49a26b0bc62717e8c9ae4c33eefc0c6
/*
* 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.
*/
#include <stdio.h>
#include <ctype.h>
#include <unistd.h>
#include <dirent.h>
#include <limits.h>
#include <string.h>
#include <libsvm.h>
#include <svm.h>
#include <errno.h>
#define VERSION "1.0"
extern int _map_to_effective_dev();
static int is_blank(char *);
/*
* is_blank() returns 1 (true) if a line specified is composed of
* whitespace characters only. otherwise, it returns 0 (false).
*
* Note. the argument (line) must be null-terminated.
*/
static int
{
return (0);
return (1);
}
/*
* FUNCTION: write_targ_nm_table
* creates a tuple table of <driver name, major number > in md.conf
* INPUT: rootpath
*
* RETURN VALUES:
* RET_SUCCESS
* RET_ERROR
*/
int
write_targ_nm_table(char *path)
{
int retval = RET_SUCCESS;
int first_entry = 1;
return (RET_ERROR);
return (RET_ERROR);
}
(retval == RET_SUCCESS)) {
/* remove a new-line character for md_targ_nm_table */
*cp = 0;
/* cut off comments starting with '#' */
*cp = 0;
/* ignore comment or blank lines */
continue;
if (first_entry) {
first_entry = 0;
} else {
}
}
if (!first_entry)
return (retval);
}
/*
* FUNCTION: write_xlate_to_mdconf
* creates a tuple table of <miniroot devt, target devt> in md.conf
* INPUT: rootpath
*
* RETURN VALUES:
* RET_SUCCESS
* RET_ERROR
*/
int
write_xlate_to_mdconf(char *path)
{
struct stat statb_edev;
char *devname;
int first_devid = 1;
int ret = RET_SUCCESS;
return (RET_ERROR);
}
return (RET_ERROR);
}
/* special case to write the first tuple in the table */
continue;
continue;
}
/*
* stat /devices to see if it's a devfs based file system
* On Solaris 10 and up, the devfs has been built on the
* fly for the mini-root. We need to adjust the path
* accordingly.
* If it's not devfs, just use the targname as it is.
*/
continue;
}
sizeof (linkpath)) == -1) {
continue;
}
/*
* turn ../../devices/<path> into /devices/<path>
* and stat that into statb_dev
*/
&statb_dev) != 0) {
continue;
}
} else {
continue;
}
}
continue;
}
!= 0) {
continue;
}
continue;
}
if (first_devid) {
"md_xlate=%lu,%lu", VERSION,
first_devid = 0;
}
} /* end while */
if (!first_devid)
return (ret);
}