diff options
author | Alexander Eremin <a.eremin@nexenta.com> | 2015-02-22 12:33:37 -0800 |
---|---|---|
committer | Gordon Ross <gwr@nexenta.com> | 2015-02-24 20:29:16 -0500 |
commit | d1515e527c5d324d2c75e58781f1dd47f18624d8 (patch) | |
tree | 3e7d35adb7d5f14b926274feec3fed2bece0b5e0 /usr/src/cmd | |
parent | 4d4ea8fa1c791525ea6d0a077480434f64d6e7b4 (diff) | |
download | illumos-gate-d1515e527c5d324d2c75e58781f1dd47f18624d8.tar.gz |
3842 remove the machid commands
Reviewed by: Peter Tribble <peter.tribble@gmail.com>
Reviewed by: Josef 'Jeff' Sipek <josef.sipek@nexenta.com>
Approved by: Garrett D'Amore <garrett@damore.org>
Diffstat (limited to 'usr/src/cmd')
-rw-r--r-- | usr/src/cmd/Makefile | 3 | ||||
-rw-r--r-- | usr/src/cmd/machid/Makefile | 80 | ||||
-rw-r--r-- | usr/src/cmd/machid/machid.c | 137 | ||||
-rw-r--r-- | usr/src/cmd/nsadmin/etc-profile.sh | 5 | ||||
-rw-r--r-- | usr/src/cmd/nsadmin/login.csh | 6 |
5 files changed, 6 insertions, 225 deletions
diff --git a/usr/src/cmd/Makefile b/usr/src/cmd/Makefile index 6f5a277510..a158d4af7c 100644 --- a/usr/src/cmd/Makefile +++ b/usr/src/cmd/Makefile @@ -20,7 +20,7 @@ # # Copyright (c) 1989, 2010, Oracle and/or its affiliates. All rights reserved. -# Copyright 2010 Nexenta Systems, Inc. All rights reserved. +# Copyright 2015 Nexenta Systems, Inc. All rights reserved. # Copyright (c) 2012 Joyent, Inc. All rights reserved. # Copyright (c) 2012 by Delphix. All rights reserved. # Copyright (c) 2013 DEY Storage Systems, Inc. All rights reserved. @@ -248,7 +248,6 @@ COMMON_SUBDIRS= \ luxadm \ lvm \ mach \ - machid \ mail \ mailwrapper \ mailx \ diff --git a/usr/src/cmd/machid/Makefile b/usr/src/cmd/machid/Makefile deleted file mode 100644 index 6a3c7138dc..0000000000 --- a/usr/src/cmd/machid/Makefile +++ /dev/null @@ -1,80 +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 -# -# -# ident "%Z%%M% %I% %E% SMI" -# -# Copyright 2004 Sun Microsystems, Inc. All rights reserved. -# Use is subject to license terms. -# - -PROG= machid - -include ../Makefile.cmd - -# -# List of all links present on all architectures and machines. -# -# Note that this function is obsolesent and we don't generally -# add to this list (see psarc/1992/171). -# -FIRSTLINK = i286 -LINKS = i386 i486 i860 i86pc iAPX286 \ - m68k mc68000 mc68010 mc68020 mc68030 mc68040 \ - sparc sun sun2 sun3 sun3x sun4 sun4c sun4m sun4d sun4e \ - u370 u3b u3b15 u3b2 u3b5 vax pdp11 - -ROOTFIRSTLINK = $(ROOTBIN)/$(FIRSTLINK) -ROOTLINKS = $(LINKS:%=$(ROOTBIN)/%) - -# -# Install the program as the first machine in the list. -# -INSTALLIT= $(INS.link) -$(ROOTFIRSTLINK):= INSTALLIT = $(INS.rename) -$(ROOTLINKS):= INSLINKTARGET = $(ROOTFIRSTLINK) - -$(ROOTLINKS): $(ROOTFIRSTLINK) - -# -# Link installation rules -# -$(ROOTBIN)/%: $(PROG) - $(INSTALLIT) - -$(ROOTFIRSTLINK): $(ROOTBIN) - -$(ROOTBIN): - $(INS.dir) - -CFLAGS += $(CCVERBOSE) - -.KEEP_STATE: - -all: $(PROG) - -install: all $(ROOTLINKS) - -clean: - -lint: lint_PROG - -include ../Makefile.targ diff --git a/usr/src/cmd/machid/machid.c b/usr/src/cmd/machid/machid.c deleted file mode 100644 index c3d57b91f9..0000000000 --- a/usr/src/cmd/machid/machid.c +++ /dev/null @@ -1,137 +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 (c) 1993-1994, by Sun Microsystems, Inc. - */ - -/* - * This program replicates the function of the links from a machine name - * (such as sun4c) through /usr/kvm to true or false as appropriate. It - * knows the correct special cases. - * - * IMPORTANT NOTE: - * - * Do not modify this program to know about additional special cases or - * reflect new platforms or instruction set architectures. This is a - * deprecated interface and strictly for backwards compatibility. This - * is psarc/1992/171. Note the following excerpt from the opinion: - * - * It is most important to note that the manual page states in - * the NOTES section: "The machid family of commands is - * obsolete. Use uname -p and uname -m instead." - * - * The intent of Kernel Architecture Project team is to provide - * only enough functionality to mimic the existing definitions - * on the SPARC and Intel x86 versions of Solaris 2.x. No new - * identifiers will ever be added to the documented and - * undocumented identifiers listed above. - */ - -#pragma ident "%Z%%M% %I% %E% SMI" - -#include <errno.h> -#include <stdlib.h> -#include <stdio.h> -#include <string.h> -#include <limits.h> -#include <sys/systeminfo.h> - -static char static_buf[SYS_NMLN]; -static char *progname; - -static void get_info_item(int command, char **buf, long *count); - -/* ARGSUSED */ -int -main(int argc, char *argv[], char *envp[]) -{ - char *buf = &static_buf[0]; - long buflen = SYS_NMLN; - - if ((progname = strrchr(argv[0], '/')) == NULL) - progname = argv[0]; - else - progname++; - - /* - * First possible match is on the processor type. - * - * Special case for architectures: i386 matches i486 and visa versa. - */ - get_info_item(SI_ARCHITECTURE, &buf, &buflen); - if (strcmp(buf, progname) == 0) - return (0); - if ((strcmp(buf, "i386") == 0 && strcmp(progname, "i486") == 0) || - (strcmp(buf, "i486") == 0 && strcmp(progname, "i386") == 0)) - return (0); - - /* - * Next possible match is the machine, or more exactly, the value - * which would be returned by uname(2) in the machine field or uname(1) - * with the -m option. For historical reasons this is really is - * often a class of platforms which are identical to userland processes - * such as sun4c, sun4m, etc. - */ - get_info_item(SI_MACHINE, &buf, &buflen); - if (strcmp(buf, progname) == 0) - return (0); - - /* - * Finally, match the vendor. We hardwire in one historical match. - */ - get_info_item(SI_HW_PROVIDER, &buf, &buflen); - if (strcmp(buf, progname) == 0) - return (0); - if (strcasecmp(buf, "Sun_Microsystems") == 0 && - strcmp("sun", progname) == 0) - return (0); - - return (255); -} - -/* - * get_info_item is a wrapper around the sysinfo system call. It makes sure - * the buffer is large enough, returning a larger buffer if needed. On - * unrecoverable error, it exits. An error message doesn't help and makes - * this tiny program link stdio and maybe deal with internationalization, - * so the best thing is to die silently. Note that the larger buffer is - * retained for later use. Reality is that the buffer will always be big - * enough, but this is coded to the spec rather than implementation. - */ -static void -get_info_item(int command, char **buf, long *count) -{ - long error; - - error = sysinfo(command, *buf, *count); - if (error > *count) { - *count = error; - if (*buf != static_buf) { - free(*buf); - } - *buf = (char *) malloc(*count); - error = sysinfo(command, *buf, *count); - } - - if (error == -1) - exit(-1); -} diff --git a/usr/src/cmd/nsadmin/etc-profile.sh b/usr/src/cmd/nsadmin/etc-profile.sh index f6c640282a..a74965d21a 100644 --- a/usr/src/cmd/nsadmin/etc-profile.sh +++ b/usr/src/cmd/nsadmin/etc-profile.sh @@ -20,7 +20,7 @@ # # Copyright 2010 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. -# +# Copyright 2015 Nexenta Systems, Inc. All rights reserved. # The profile that all logins get before using their own .profile. @@ -29,8 +29,7 @@ export LOGNAME PATH if [ "$TERM" = "" ] then - if /bin/i386 - then + if [ `uname -p` = "i386" ]; then TERM=sun-color else TERM=sun diff --git a/usr/src/cmd/nsadmin/login.csh b/usr/src/cmd/nsadmin/login.csh index 447d383f91..4409bf2e09 100644 --- a/usr/src/cmd/nsadmin/login.csh +++ b/usr/src/cmd/nsadmin/login.csh @@ -20,20 +20,20 @@ # # Copyright 1998 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. +# Copyright 2015 Nexenta Systems, Inc. All rights reserved. # -#ident "%Z%%M% %I% %E% SMI" # The initial machine wide defaults for csh. if ( $?TERM == 0 ) then - if { /bin/i386 } then + if ( `uname -p` == "i386" ) then setenv TERM sun-color else setenv TERM sun endif else if ( $TERM == "" ) then - if { /bin/i386 } then + if ( `uname -p` == "i386" ) then setenv TERM sun-color else setenv TERM sun |