From bc5d6d0c577d2012bb42e8ee9023a6a0537026d1 Mon Sep 17 00:00:00 2001 From: Josef 'Jeff' Sipek Date: Wed, 28 Nov 2018 13:23:29 -0500 Subject: [PATCH] cmd: remove locator --- FEATURES.txt | 1 + share/man/man8/Makefile | 1 - share/man/man8/locator.8 | 120 -------------- usr/src/cmd/Makefile | 1 - usr/src/cmd/locator/Makefile | 46 ------ usr/src/cmd/locator/locator.c | 282 -------------------------------- usr/src/pkg/manifests/SUNWcs.man8.inc | 1 - usr/src/pkg/manifests/system-core-os.mf | 1 - 8 files changed, 1 insertion(+), 452 deletions(-) delete mode 100644 share/man/man8/locator.8 delete mode 100644 usr/src/cmd/locator/Makefile delete mode 100644 usr/src/cmd/locator/locator.c diff --git a/FEATURES.txt b/FEATURES.txt index 1174fdcc40..33e09d425e 100644 --- a/FEATURES.txt +++ b/FEATURES.txt @@ -11,6 +11,7 @@ was changed. -------------- - libfruraw, libnvfru, libfru, libfrureg, libfruutils - pyzfs & pysolaris + - locator(8) 1.1 release ----------- diff --git a/share/man/man8/Makefile b/share/man/man8/Makefile index 7f68fd7a8c..01351cbbf0 100644 --- a/share/man/man8/Makefile +++ b/share/man/man8/Makefile @@ -207,7 +207,6 @@ MAN = 6to4relay.8 \ link.8 \ listdgrp.8 \ listen.8 \ - locator.8 \ lockfs.8 \ lockstat.8 \ lofiadm.8 \ diff --git a/share/man/man8/locator.8 b/share/man/man8/locator.8 deleted file mode 100644 index 96cade618d..0000000000 --- a/share/man/man8/locator.8 +++ /dev/null @@ -1,120 +0,0 @@ -'\" te -.\" Copyright (c) 2001, Sun Microsystems, Inc. All Rights Reserved. -.\" 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 or http://www.opensolaris.org/os/licensing. 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] -.TH LOCATOR 8 "Sep 4, 2001" -.SH NAME -locator \- location indicator control -.SH SYNOPSIS -.LP -.nf -\fB /usr/sbin/locator\fR [\fB-f\fR | \fB-n\fR] -.fi - -.SH DESCRIPTION -.sp -.LP -The locator command sets or queries the state of the system locator if such a -device exists. -.sp -.LP -Without options, the locator command reports the current state of the system. -.sp -.LP -The privileges required to use this command are hardware dependent. Typically, -only the super user can get or set a locator. -.SH OPTIONS -.sp -.LP -The following options are supported: -.sp -.ne 2 -.na -\fB\fB-f\fR\fR -.ad -.RS 6n -Turns the locator off. -.RE - -.sp -.ne 2 -.na -\fB\fB-n\fR\fR -.ad -.RS 6n -Turns the locator on. -.RE - -.SH EXAMPLES -.LP -\fBExample 1 \fRUsing the \fBlocator\fR Command on a Platform Which Has a -System Locator LED -.sp -.LP -When issued on a platform which has a system locator \fBLED\fR, the following -command turns the locator on: - -.sp -.in +2 -.nf -# \fBlocator \fR\fB-n\fR -# \fBlocator\fR -The 'system' locator is on -.fi -.in -2 -.sp - -.LP -\fBExample 2 \fRUsing the \fBlocator\fR Command on a Platform Which Does Not -Have a System Locator LED -.sp -.LP -When issued on a platform which does not have a system locator \fBLED\fR, the -following command attempts to turn the locator on. The command returns an error -message. - -.sp -.in +2 -.nf -# \fBlocator \fR\fB-n\fR -\&'system' locator not found -.fi -.in -2 -.sp - -.SH EXIT STATUS -.sp -.LP -The following exit values are returned: -.sp -.ne 2 -.na -\fB\fB0\fR\fR -.ad -.RS 5n -Successful completion. -.RE - -.sp -.ne 2 -.na -\fB\fB1\fR\fR -.ad -.RS 5n -Invalid command line input. -.RE - -.sp -.ne 2 -.na -\fB\fB2\fR\fR -.ad -.RS 5n -The requested operation failed. -.RE - -.SH SEE ALSO -.sp -.LP -\fBattributes\fR(5) diff --git a/usr/src/cmd/Makefile b/usr/src/cmd/Makefile index 2b73ffd73d..e79fa7bde0 100644 --- a/usr/src/cmd/Makefile +++ b/usr/src/cmd/Makefile @@ -210,7 +210,6 @@ COMMON_SUBDIRS= \ loadkeys \ locale \ lockstat \ - locator \ lofiadm \ logadm \ logger \ diff --git a/usr/src/cmd/locator/Makefile b/usr/src/cmd/locator/Makefile deleted file mode 100644 index 03e0ccde25..0000000000 --- a/usr/src/cmd/locator/Makefile +++ /dev/null @@ -1,46 +0,0 @@ -# -# 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 -# or http://www.opensolaris.org/os/licensing. -# 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 2004 Sun Microsystems, Inc. All rights reserved. -# Use is subject to license terms. -# -#ident "%Z%%M% %I% %E% SMI" -# -# cmd/locator/Makefile -# -# -PROG= locator - -include $(SRC)/cmd/Makefile.cmd - -LDLIBS += -lpicl - -.KEEP_STATE: - -all: $(PROG) - -install: all $(ROOTUSRSBINPROG) - -clean: - - -include $(SRC)/cmd/Makefile.targ diff --git a/usr/src/cmd/locator/locator.c b/usr/src/cmd/locator/locator.c deleted file mode 100644 index 83fbcc12b7..0000000000 --- a/usr/src/cmd/locator/locator.c +++ /dev/null @@ -1,282 +0,0 @@ -/* - * 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 - * or http://www.opensolaris.org/os/licensing. - * 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 2006 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. - */ - -#pragma ident "%Z%%M% %I% %E% SMI" - -#include -#include -#include -#include -#include -#include -#include -#include - -#define DEFAULT_NAME "system" - -typedef struct locator_info { - int (*locator_func)(picl_nodehdl_t, struct locator_info *); - int found; /* Nonzero if found during walk */ - int err; /* Last error from picl */ - char *name; /* Name/LocatorName of locator node */ - int new_state; /* 0 = logical off, 1 = logical on */ - char *on; /* Logical on value for State */ - char *off; /* Logical off value for State */ -} locator_info_t; - -static void -usage(char *prog_name) -{ - (void) fprintf(stderr, gettext("usage: %s [-n | -f]\n"), prog_name); - exit(1); -} - -static int -change_locator_state(picl_nodehdl_t locator_node, locator_info_t *locator_info) -{ - picl_prophdl_t state_prop; - char state[PICL_PROPNAMELEN_MAX]; - int err; - char *new_state; - - err = picl_get_prop_by_name(locator_node, "State", &state_prop); - if (err != PICL_SUCCESS) { - (void) fprintf(stderr, - gettext("picl_get_prop_by_name failed: %s\n"), - picl_strerror(err)); - return (err); - } - - err = picl_get_propval(state_prop, state, sizeof (state)); - if (err != PICL_SUCCESS) { - (void) fprintf(stderr, - gettext("picl_get_propval failed: %s\n"), - picl_strerror(err)); - return (err); - } - - new_state = (locator_info->new_state) ? locator_info->on : - locator_info->off; - - if (strcmp(state, new_state) != 0) { - picl_propinfo_t prop_info; - err = picl_get_propinfo(state_prop, &prop_info); - if (err != PICL_SUCCESS) { - (void) fprintf(stderr, - gettext("picl_get_propinfo failed: %s\n"), - picl_strerror(err)); - return (err); - } - err = picl_set_propval(state_prop, new_state, prop_info.size); - if (err != PICL_SUCCESS) { - (void) fprintf(stderr, - gettext("picl_set_propval failed: %s\n"), - picl_strerror(err)); - return (err); - } - } - return (err); -} - -static int -display_locator_state(picl_nodehdl_t locator_node, - locator_info_t *locator_info) -{ - char state[PICL_PROPNAMELEN_MAX]; - char *display_state; - int err; - - err = picl_get_propval_by_name(locator_node, "State", - state, sizeof (state)); - if (err != PICL_SUCCESS) { - (void) fprintf(stderr, - gettext("picl_get_propval_by_name failed: %s\n"), - picl_strerror(err)); - return (err); - } - - if (strcmp(state, locator_info->on) == 0) - display_state = gettext("on"); - else if (strcmp(state, locator_info->off) == 0) - display_state = gettext("off"); - else - display_state = state; - - (void) printf(gettext("The '%s' locator is %s.\n"), - locator_info->name, display_state); - return (err); -} - -static int -locator_walker_func(picl_nodehdl_t nodeh, void *arg) -{ - locator_info_t *locator_info = (locator_info_t *)arg; - int err; - char is_locator[PICL_PROPNAMELEN_MAX]; - char name[PICL_PROPNAMELEN_MAX]; - char locator_on[PICL_PROPNAMELEN_MAX]; - char locator_off[PICL_PROPNAMELEN_MAX]; - - err = picl_get_propval_by_name(nodeh, "IsLocator", is_locator, - sizeof (is_locator)); - - if (err != PICL_SUCCESS) - return (PICL_WALK_CONTINUE); - - if (strcmp(is_locator, "true") != 0) - return (PICL_WALK_CONTINUE); - - err = picl_get_propval_by_name(nodeh, "LocatorName", name, - sizeof (name)); - - if (err == PICL_PROPNOTFOUND) - err = picl_get_propval_by_name(nodeh, PICL_PROP_NAME, name, - sizeof (name)); - - if (err != PICL_SUCCESS) - return (err); - - if (strcmp(name, locator_info->name) != 0) - return (PICL_WALK_CONTINUE); - - err = picl_get_propval_by_name(nodeh, "LocatorOn", locator_on, - sizeof (locator_on)); - - if (err == PICL_SUCCESS) { - locator_info->on = locator_on; - } else if (err == PICL_PROPNOTFOUND) { - locator_info->on = "ON"; - } else { - return (err); - } - - err = picl_get_propval_by_name(nodeh, "LocatorOff", locator_off, - sizeof (locator_off)); - - if (err == PICL_SUCCESS) { - locator_info->off = locator_off; - } else if (err == PICL_PROPNOTFOUND) { - locator_info->off = "OFF"; - } else { - return (err); - } - - locator_info->err = (locator_info->locator_func)(nodeh, - locator_info); - locator_info->found = 1; - - return (PICL_WALK_TERMINATE); -} - -int -main(int argc, char **argv) -{ - locator_info_t locator_info = {0, 0, 0, 0, 0}; - picl_nodehdl_t rooth; - int err; - int c; - int on_flag = 0; - int off_flag = 0; - char *progname; - char *locator_name = DEFAULT_NAME; - - (void) setlocale(LC_ALL, ""); - (void) textdomain(TEXT_DOMAIN); - - if ((progname = strrchr(argv[0], '/')) == NULL) - progname = argv[0]; - else - progname++; - - while ((c = getopt(argc, argv, "nf")) != EOF) { - switch (c) { - case 'n': - on_flag++; - break; - case 'f': - off_flag++; - break; - case '?': - /*FALLTHROUGH*/ - default: - usage(progname); - } - } - if (argc != optind) - usage(progname); - - /* We only take one option */ - if (on_flag && off_flag) - usage(progname); - - err = picl_initialize(); - if (err != PICL_SUCCESS) { - (void) fprintf(stderr, gettext("picl_initialize failed: %s\n"), - picl_strerror(err)); - exit(2); - } - - err = picl_get_root(&rooth); - if (err != PICL_SUCCESS) { - (void) fprintf(stderr, gettext("picl_get_root failed: %s\n"), - picl_strerror(err)); - err = 2; - goto OUT; - } - - if (on_flag) { - locator_info.locator_func = change_locator_state; - locator_info.new_state = 1; - } else if (off_flag) { - locator_info.locator_func = change_locator_state; - locator_info.new_state = 0; - } else { - locator_info.locator_func = display_locator_state; - } - - locator_info.name = locator_name; - - err = picl_walk_tree_by_class(rooth, "led", &locator_info, - locator_walker_func); - if (err != PICL_SUCCESS) { - (void) fprintf(stderr, - gettext("picl_walk_tree_by_class failed: %s\n"), - picl_strerror(err)); - err = 2; - goto OUT; - } - - if (locator_info.found == 0) { - (void) fprintf(stderr, gettext("'%s' locator not found\n"), - locator_name); - err = 2; - } - if (locator_info.err != PICL_SUCCESS) - err = 2; -OUT: - (void) picl_shutdown(); - return (err); -} diff --git a/usr/src/pkg/manifests/SUNWcs.man8.inc b/usr/src/pkg/manifests/SUNWcs.man8.inc index af68db5891..c7ed9a64c4 100644 --- a/usr/src/pkg/manifests/SUNWcs.man8.inc +++ b/usr/src/pkg/manifests/SUNWcs.man8.inc @@ -131,7 +131,6 @@ file path=usr/share/man/man8/labelit_ufs.8 file path=usr/share/man/man8/link.8 file path=usr/share/man/man8/listdgrp.8 file path=usr/share/man/man8/listen.8 -file path=usr/share/man/man8/locator.8 file path=usr/share/man/man8/lockfs.8 file path=usr/share/man/man8/lofiadm.8 file path=usr/share/man/man8/logadm.8 diff --git a/usr/src/pkg/manifests/system-core-os.mf b/usr/src/pkg/manifests/system-core-os.mf index 036ab888ce..9adb67d1ec 100644 --- a/usr/src/pkg/manifests/system-core-os.mf +++ b/usr/src/pkg/manifests/system-core-os.mf @@ -1148,7 +1148,6 @@ file path=usr/sbin/ipseckey mode=0555 file path=usr/sbin/keyserv group=sys mode=0555 file path=usr/sbin/killall mode=0555 file path=usr/sbin/link mode=0555 -file path=usr/sbin/locator mode=0555 file path=usr/sbin/lofiadm mode=0555 file path=usr/sbin/logadm mode=0555 file path=usr/sbin/makedbm mode=0555 -- 2.11.4.GIT