summaryrefslogtreecommitdiff
path: root/usr/src
diff options
context:
space:
mode:
Diffstat (limited to 'usr/src')
-rw-r--r--usr/src/cmd/netadm/Makefile29
-rw-r--r--usr/src/cmd/netadm/etc/Makefile71
-rw-r--r--usr/src/cmd/netadm/etc/ttydefs.cleanup.sh71
-rw-r--r--usr/src/pkgdefs/SUNWcar.u/prototype_com2
-rw-r--r--usr/src/pkgdefs/common_files/i.ttydefs47
5 files changed, 189 insertions, 31 deletions
diff --git a/usr/src/cmd/netadm/Makefile b/usr/src/cmd/netadm/Makefile
index 9a8225bee0..93cf1be771 100644
--- a/usr/src/cmd/netadm/Makefile
+++ b/usr/src/cmd/netadm/Makefile
@@ -2,9 +2,8 @@
# 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.
+# 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.
@@ -22,7 +21,8 @@
#
#ident "%Z%%M% %I% %E% SMI"
#
-# Copyright (c) 1989 by Sun Microsystems, Inc.
+# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
#
PROG= _sactab _pmtab _sysconfig iu.ap ttydefs
@@ -31,6 +31,8 @@ SRCS= $(PROG:%=%.sh)
include ../Makefile.cmd
+SUBDIRS= etc
+
DEFPM= zsmon
ETCSAFD= $(ROOTETC)/saf
@@ -64,9 +66,15 @@ $(VARPMD)/% : %
$(ETCPMD)/% : %
$(INS.file)
+all := TARGET= all
+install := TARGET= install
+clean := TARGET= clean
+clobber := TARGET= clean
+lint := TARGET= lint
+
.KEEP_STATE:
-all: $(PROG) $(PMLOG)
+all: $(PROG) $(PMLOG) $(SUBDIRS)
_sysconfig: _sysconf.sh
$(SH) _sysconf.sh
@@ -77,13 +85,18 @@ _sactab _pmtab iu.ap ttydefs:
$(PMLOG):
$(TOUCH) $@
-install: all $(DIRS) $(ROOTETCSAF) $(ROOTETCF) $(ROOTETCPM) $(ROOTVARPM)
+install: all $(DIRS) $(SUBDIRS) $(ROOTETCSAF) $(ROOTETCF) $(ROOTETCPM) $(ROOTVARPM)
$(DIRS):
$(INS.dir)
-clean:
+$(SUBDIRS): FRC
+ @cd $@; pwd; $(MAKE) $(TARGET)
+
+clean: $(SUBDIRS)
+
+lint: $(SUBDIRS)
-lint:
+FRC:
include ../Makefile.targ
diff --git a/usr/src/cmd/netadm/etc/Makefile b/usr/src/cmd/netadm/etc/Makefile
new file mode 100644
index 0000000000..556d4a93ca
--- /dev/null
+++ b/usr/src/cmd/netadm/etc/Makefile
@@ -0,0 +1,71 @@
+#
+# 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
+#
+#
+#pragma ident "%Z%%M% %I% %E% SMI"
+#
+# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+# Makefile for /etc/flash/
+#
+#
+# cmd/netadm/etc/Makefile
+
+include ../../Makefile.cmd
+
+FLASHTTYDEFS= ttydefs.cleanup.sh
+FLASHPOSTPROG= $(FLASHTTYDEFS:%.sh=%)
+
+ETCFLASHD= $(ROOTETC)/flash
+ETCFLASHPOSTD= $(ROOTETC)/flash/postdeployment
+
+DIRS= $(ETCFLASHD) $(ETCFLASHPOSTD)
+
+ETCFLASHPOSTPROG= $(FLASHPOSTPROG:%=$(ETCFLASHPOSTD)/%)
+
+$(ETCFLASHD) := DIRMODE= 755
+$(ETCFLASHD) := OWNER= root
+$(ETCFLASHD) := GROUP= sys
+$(ETCFLASHPOSTD) := DIRMODE= 755
+$(ETCFLASHPOSTD) := OWNER= root
+$(ETCFLASHPOSTD) := GROUP= sys
+$(ETCFLASHPOSTPROG) := FILEMODE= 0744
+$(ETCFLASHPOSTPROG) := OWNER= root
+$(ETCFLASHPOSTPROG) := GROUP= sys
+
+.KEEP_STATE:
+
+all: $(FLASHPOSTPROG)
+
+install: all .WAIT $(DIRS) .WAIT $(ETCFLASHPOSTPROG)
+
+cstyle:
+
+lint:
+
+$(DIRS):
+ $(INS.dir)
+
+$(ETCFLASHPOSTD)/% : %
+ $(INS.file)
+
+clean:
+ $(RM) $(FLASHPOSTPROG)
diff --git a/usr/src/cmd/netadm/etc/ttydefs.cleanup.sh b/usr/src/cmd/netadm/etc/ttydefs.cleanup.sh
new file mode 100644
index 0000000000..cac26e9eb4
--- /dev/null
+++ b/usr/src/cmd/netadm/etc/ttydefs.cleanup.sh
@@ -0,0 +1,71 @@
+#!/bin/sh
+#
+# 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
+#
+#
+# ident "%Z%%M% %I% %E% SMI"
+#
+# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+
+TMP=${FLASH_ROOT}/tmp/SUNWcsr.ttydefs.$$
+TTYDEFS_FILE=${FLASH_ROOT}/etc/ttydefs
+
+# If the system is an SPARC-Enterprise system,
+# then the /etc/ttydefs file must include the correct console entry.
+isSparcEnterprise()
+{
+ # Add the crtscts flag for the console settings if needed.
+ if [ ! "`grep '^console:.* crtscts:' ${TTYDEFS_FILE}`" ] ; then
+ sed -e "/^console:.*onlcr:/ {
+ s/onlcr:/onlcr crtscts:/
+ }" ${TTYDEFS_FILE} > ${TMP}
+ # Update the ttydefs file
+ cp ${TMP} ${TTYDEFS_FILE}
+ rm -f ${TMP}
+ fi
+}
+
+# Restore the ttydefs file to the default
+defaultPlatform()
+{
+ if [ "`grep '^console:.* crtscts:' ${TTYDEFS_FILE}`" ] ; then
+ sed -e "/^console:.* crtscts:/ {
+ s/ crtscts:/:/
+ }" ${TTYDEFS_FILE} > ${TMP}
+ # Update the ttydefs file
+ cp ${TMP} ${TTYDEFS_FILE}
+ rm -f ${TMP}
+ fi
+}
+
+# Determine action for the appropriate system
+PLATFORM_TOKEN=`prtconf -b | awk '/^name:/ { print $2 }'`
+case "$PLATFORM_TOKEN"
+in
+ SUNW,SPARC-Enterprise)
+ isSparcEnterprise
+ ;;
+ *)
+ defaultPlatform
+ ;;
+esac
+
+exit 0
diff --git a/usr/src/pkgdefs/SUNWcar.u/prototype_com b/usr/src/pkgdefs/SUNWcar.u/prototype_com
index 9d8469bfb2..aab91ad13c 100644
--- a/usr/src/pkgdefs/SUNWcar.u/prototype_com
+++ b/usr/src/pkgdefs/SUNWcar.u/prototype_com
@@ -51,6 +51,8 @@ d none etc/flash 755 root sys
d none etc/flash/precreation 700 root sys
d none etc/flash/preexit 700 root sys
d none etc/flash/postcreation 700 root sys
+d none etc/flash/postdeployment 700 root sys
+f none etc/flash/postdeployment/ttydefs.cleanup 744 root sys
f none etc/flash/precreation/caplib 500 root sys
d none platform 755 root sys
d none platform/sun4u-opl 755 root sys
diff --git a/usr/src/pkgdefs/common_files/i.ttydefs b/usr/src/pkgdefs/common_files/i.ttydefs
index 94c87960ed..24727468c8 100644
--- a/usr/src/pkgdefs/common_files/i.ttydefs
+++ b/usr/src/pkgdefs/common_files/i.ttydefs
@@ -22,37 +22,38 @@
#
# ident "%Z%%M% %I% %E% SMI"
#
-# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
# SUNWcsr i.ttydefs script
#
-while read src dest
-do
- if [ "`basename $src`" = "ttydefs" ]
- then
- TMP=/tmp/SUNWcsr.ttydefs.$$
+upgrade_ttydefs () {
- # Make sure that there is a copy of the original $dest file.
- if [ ! -f $dest ]; then
- cp $src $dest
- fi
+ # Add the crtscts flag to the console settings
+ cat >> $PKG_INSTALL_ROOT/var/svc/profile/upgrade <<TTYEOF
+case \`uname -i\` in
+SUNW,SPARC-Enterprise)
+ sttydefs -r console
+ sttydefs -a console -i "9600 hupcl opost onlcr crtscts" -f "9600"
+ ;;
+*)
+ ;;
+esac
+TTYEOF
+}
- # Confirm that this is an appropriate system.
- PLATFORM_TOKEN=`uname -i`
- case "$PLATFORM_TOKEN"
- in
- SUNW,SPARC-Enterprise)
- # Add the crtscts flag for the console settings
- sed -e "/^console:.*onlcr:/ {
- s/onlcr:/onlcr crtscts:/
- }" $dest > ${TMP}
- # Update the $dest file
- cp ${TMP} $dest
- ;;
- esac
+while read src dest
+do
+ if [ "`basename $src`" = "ttydefs" ]; then
+ # Make sure that there is a copy of the original $dest file.
+ if [ ! -f $dest ]; then
+ # Since there was no previous file, assume that this
+ # is a fresh install
+ cp $src $dest
+ upgrade_ttydefs
+ fi
fi
done
exit 0