/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (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 (c) 1984, 1986, 1987, 1988, 1989 AT&T */
/* All Rights Reserved */
/*
* Copyright (c) 1997, by Sun Microsystems, Inc.
* All rights reserved.
*/
/*LINTLIBRARY*/
#include <stdio.h>
#include <string.h>
#include <devmgmt.h>
#include "libadm.h"
#include <stdlib.h>
static void elabel(void);
static void doformat(char *, char *, char *);
static void labelerr(char *, char *);
static int ckilabel(char *, int);
static int insert(char *, char *, int, char *);
/*
* Return:
* 0 - okay, label matches
* 1 - device not accessable
* 2 - unknown device (devattr failed)
* 3 - user selected quit
* 4 - label does not match
*/
/*
* macros from labelit to behave correctly for tape
* is a kludge, should use devmgmt
*/
#ifdef RT
#else
#endif
int
{
}
int
{
int n, override;
return (2); /* bad device */
}
if (!pname)
}
if (label) {
*pt = '\0';
}
} else
origvolname[0] = '\0';
}
override = 0;
for (;;) {
if (n < 0)
override++;
else if (n)
return (n); /* input function failed */
}
/* device was not accessible */
return (1);
return (1);
/* display advice on how to ready device */
continue;
}
/* check label on device */
if (label) {
elabel();
else {
return (4);
continue;
}
}
}
break;
}
return (0);
}
static int
{
int n, c;
*pt = '\0';
}
} else
volname[0] = '\0';
*pt++ = (char)c;
*pt = '\0';
look = "Current fsname: ";
while (*pt) {
*pt = '\0';
look = ", Current volname: ";
look = ", Blocks: ";
} else
break;
} else
pt++;
}
/* mismatched label */
if (flag) {
/* LINTED E_SEC_SPRINTF_UNBOUNDED_COPY */
} else {
return (1);
}
}
return (0);
}
static int
{
int n;
"Enter text for fsname label:"))
return (n);
} else
"Enter text for volume label:"))
return (n);
} else
} else {
}
return (1);
}
if (label)
/* LINTED E_SEC_SPRINTF_UNBOUNDED_COPY */
return (0);
}
static void
elabel(void)
{
}
static int
{
int n;
char *fmtcmd;
char *mkfscmd;
char *voltxt;
char *removecmd;
char *dev_type;
if (prompt) {
prompt++;
else if (*prompt == '%') {
switch (prompt[1]) {
case 'v':
break;
case 'p':
break;
default:
*pt = '\0';
break;
}
prompt += 2;
continue;
}
}
*pt = '\0';
} else {
/* LINTED E_SEC_SPRINTF_UNBOUNDED_COPY */
/* LINTED E_SEC_SPRINTF_UNBOUNDED_COPY */
" should appear on the %s:\\n\\t%s",
}
/* LINTED E_SEC_SPRINTF_UNBOUNDED_COPY */
" The %s should be internally labeled as follows:",
voltxt);
/* LINTED E_SEC_SPRINTF_UNBOUNDED_COPY */
"\\n\\t%s\\n", label);
}
}
n = 0;
keyword[n++] = "go";
/* LINTED E_SEC_SPRINTF_UNBOUNDED_COPY */
keyword[n++] = "f";
/* LINTED E_SEC_SPRINTF_UNBOUNDED_COPY */
keyword[n++] = "f";
}
/* LINTED E_SEC_SPRINTF_UNBOUNDED_COPY */
keyword[n++] = "m";
}
/* LINTED E_SEC_SPRINTF_UNBOUNDED_COPY */
keyword[n++] = "f";
}
}
/* LINTED E_SEC_SPRINTF_UNBOUNDED_COPY */
keyword[n++] = "w";
}
keyword[n++] = "o";
}
/* LINTED E_SEC_SPRINTF_UNBOUNDED_COPY */
keyword[n++] = "e";
} else {
/* LINTED E_SEC_SPRINTF_UNBOUNDED_COPY */
keyword[n++] = "u";
}
}
if (ckquit)
*pt++ = ':';
*pt = '\0';
for (;;) {
return (n);
if (*strval == 'f') {
else
continue;
} else if (*strval == 'm') {
continue;
continue;
} else if (*strval == 'w') {
continue;
} else if (*strval == 'o')
return (-1);
break;
}
return (0);
}
static void
{
return;
}
}
return;
}
}
}
void
{
char *removecmd;
if (echo)
"(%s) 1>&2", removecmd);
if (echo)
return;
}
}
}
}
static void
{
if (volume)
"The internal label on the inserted %s is\n", volume);
else
}