15806655 SUNBT7187466 Integrate smp_utils into solaris s11u3-sru
authorJarod Tian <chunshuang.tian@oracle.com>
Mon, 07 Nov 2016 17:10:14 -0800
branchs11u3-sru
changeset 7259 39b1b8abc92d
parent 7256 c523ba6bf5f1
child 7260 ddfed786ecc4
15806655 SUNBT7187466 Integrate smp_utils into solaris
components/smp_utils/Makefile
components/smp_utils/files/RtSCSIDeviceInfo.html
components/smp_utils/files/RtSCSIDeviceManagement.html
components/smp_utils/files/smp_utils-exec_attr
components/smp_utils/files/smp_utils-prof_attr
components/smp_utils/patches/smp_utils-solaris-build.patch
components/smp_utils/smp_utils.license
components/smp_utils/smp_utils.p5m
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/smp_utils/Makefile	Mon Nov 07 17:10:14 2016 -0800
@@ -0,0 +1,93 @@
+#
+# 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 (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.
+#
+include ../../make-rules/shared-macros.mk
+
+COMPONENT_NAME=		smp_utils
+COMPONENT_VERSION=	0.97
+COMPONENT_PROJECT_URL= http://sg.danny.cz/sg/smp_utils.html
+COMPONENT_SRC=          $(COMPONENT_NAME)-$(COMPONENT_VERSION)
+COMPONENT_ARCHIVE=	$(COMPONENT_SRC).tgz
+COMPONENT_ARCHIVE_HASH= \
+    sha256:0e10d304cfa8789bcf16537e8f72d9afdf8838fca20ae68103c317432d00915b
+COMPONENT_ARCHIVE_URL=	http://sg.danny.cz/sg/p/$(COMPONENT_ARCHIVE)
+COMPONENT_BUGDB=	utility/smputils
+
+TPNO=			11065
+
+include $(WS_MAKE_RULES)/prep.mk
+include $(WS_MAKE_RULES)/configure.mk
+include $(WS_MAKE_RULES)/ips.mk
+
+CC += $(CC_BITS)
+CPPFLAGS += -I$(COMPONENT_DIR)/$(COMPONENT_SRC)/include
+CONFIGURE_OPTIONS +=	--disable-static
+CONFIGURE_OPTIONS += CPPFLAGS="$(CPPFLAGS)"
+
+PKG_PROTO_DIRS +=	$(COMPONENT_DIR)/files
+
+ASLR_MODE = $(ASLR_ENABLE)
+
+COMPONENT_INSTALL_ARGS += sbindir=$(USRSBINDIR)
+
+# common targets
+build:		$(BUILD_64)
+
+install:	$(INSTALL_64)
+
+test:		install $(TEST_64)
+
+# Actions to show versions of each utility for test target
+COMPONENT_PRE_TEST_ACTION =	\
+		$(PROTOUSRSBINDIR)/smp_conf_general -V; \
+		$(PROTOUSRSBINDIR)/smp_conf_phy_event -V; \
+		$(PROTOUSRSBINDIR)/smp_conf_route_info -V; \
+		$(PROTOUSRSBINDIR)/smp_conf_zone_man_pass -V; \
+		$(PROTOUSRSBINDIR)/smp_conf_zone_perm_tbl -V; \
+		$(PROTOUSRSBINDIR)/smp_conf_zone_phy_info -V; \
+		$(PROTOUSRSBINDIR)/smp_discover -V; \
+		$(PROTOUSRSBINDIR)/smp_discover_list -V; \
+		$(PROTOUSRSBINDIR)/smp_ena_dis_zoning -V; \
+		$(PROTOUSRSBINDIR)/smp_phy_control -V; \
+		$(PROTOUSRSBINDIR)/smp_phy_test -V; \
+		$(PROTOUSRSBINDIR)/smp_read_gpio -V; \
+		$(PROTOUSRSBINDIR)/smp_rep_broadcast -V; \
+		$(PROTOUSRSBINDIR)/smp_rep_exp_route_tbl -V; \
+		$(PROTOUSRSBINDIR)/smp_rep_general -V; \
+		$(PROTOUSRSBINDIR)/smp_rep_manufacturer -V; \
+		$(PROTOUSRSBINDIR)/smp_rep_phy_err_log -V; \
+		$(PROTOUSRSBINDIR)/smp_rep_phy_event -V; \
+		$(PROTOUSRSBINDIR)/smp_rep_phy_event_list -V; \
+		$(PROTOUSRSBINDIR)/smp_rep_phy_sata -V; \
+		$(PROTOUSRSBINDIR)/smp_rep_route_info -V; \
+		$(PROTOUSRSBINDIR)/smp_rep_self_conf_stat -V; \
+		$(PROTOUSRSBINDIR)/smp_rep_zone_man_pass -V; \
+		$(PROTOUSRSBINDIR)/smp_rep_zone_perm_tbl -V; \
+		$(PROTOUSRSBINDIR)/smp_write_gpio -V; \
+		$(PROTOUSRSBINDIR)/smp_zone_activate -V; \
+		$(PROTOUSRSBINDIR)/smp_zone_lock -V; \
+		$(PROTOUSRSBINDIR)/smp_zone_unlock -V; \
+		$(PROTOUSRSBINDIR)/smp_zoned_broadcast -V;
+
+REQUIRED_PACKAGES += system/library
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/smp_utils/files/RtSCSIDeviceInfo.html	Mon Nov 07 17:10:14 2016 -0800
@@ -0,0 +1,20 @@
+<HTML>
+<!--
+
+    Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+-->
+<HEAD>
+	<TITLE> </TITLE>
+	 
+	
+</HEAD>
+<BODY>
+
+When SCSI Device Info is in the Rights Included column, it grants the right to
+use commands needed to inquiry or read SCSI device information.
+<p>
+If SCSI Device Info is grayed, then you are not entitled to Add or Remove this
+right.
+<p>
+</BODY>
+</HTML>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/smp_utils/files/RtSCSIDeviceManagement.html	Mon Nov 07 17:10:14 2016 -0800
@@ -0,0 +1,20 @@
+<HTML>
+<!--
+
+    Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+-->
+<HEAD>
+	<TITLE> </TITLE>
+	 
+	
+</HEAD>
+<BODY>
+
+When SCSI Device Management is in the Rights Included column, it grants the
+right to use commands needed to manage, modify SCSI device status or data.
+<p>
+If SCSI Device Management is grayed, then you are not entitled to Add or
+Remove this right.
+<p>
+</BODY>
+</HTML>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/smp_utils/files/smp_utils-exec_attr	Mon Nov 07 17:10:14 2016 -0800
@@ -0,0 +1,30 @@
+SCSI Device Info:solaris:cmd:RO::/usr/sbin/smp_discover:privs=zone
+SCSI Device Info:solaris:cmd:RO::/usr/sbin/smp_discover_list:privs=zone
+SCSI Device Info:solaris:cmd:RO::/usr/sbin/smp_read_gpio:privs=zone
+SCSI Device Info:solaris:cmd:RO::/usr/sbin/smp_rep_broadcast:privs=zone
+SCSI Device Info:solaris:cmd:RO::/usr/sbin/smp_rep_exp_route_tbl:privs=zone
+SCSI Device Info:solaris:cmd:RO::/usr/sbin/smp_rep_general:privs=zone
+SCSI Device Info:solaris:cmd:RO::/usr/sbin/smp_rep_manufacturer:privs=zone
+SCSI Device Info:solaris:cmd:RO::/usr/sbin/smp_rep_phy_err_log:privs=zone
+SCSI Device Info:solaris:cmd:RO::/usr/sbin/smp_rep_phy_event:privs=zone
+SCSI Device Info:solaris:cmd:RO::/usr/sbin/smp_rep_phy_event_list:privs=zone
+SCSI Device Info:solaris:cmd:RO::/usr/sbin/smp_rep_phy_sata:privs=zone
+SCSI Device Info:solaris:cmd:RO::/usr/sbin/smp_rep_self_conf_sta:privs=zone
+SCSI Device Info:solaris:cmd:RO::/usr/sbin/smp_rep_route_info:privs=zone
+SCSI Device Info:solaris:cmd:RO::/usr/sbin/smp_rep_zone_man_pass:privs=zone
+SCSI Device Info:solaris:cmd:RO::/usr/sbin/smp_rep_zone_perm_tbl:privs=zone
+
+SCSI Device Management:solaris:cmd:RO::/usr/sbin/smp_conf_general:privs=zone
+SCSI Device Management:solaris:cmd:RO::/usr/sbin/smp_conf_phy_event:privs=zone
+SCSI Device Management:solaris:cmd:RO::/usr/sbin/smp_conf_route_info:privs=zone
+SCSI Device Management:solaris:cmd:RO::/usr/sbin/smp_conf_zone_man_pass:privs=zone
+SCSI Device Management:solaris:cmd:RO::/usr/sbin/smp_conf_zone_perm_tbl:privs=zone
+SCSI Device Management:solaris:cmd:RO::/usr/sbin/smp_conf_zone_phy_info:privs=zone
+SCSI Device Management:solaris:cmd:RO::/usr/sbin/smp_ena_dis_zoning:privs=zone
+SCSI Device Management:solaris:cmd:RO::/usr/sbin/smp_phy_control:privs=zone
+SCSI Device Management:solaris:cmd:RO::/usr/sbin/smp_phy_test:privs=zone
+SCSI Device Management:solaris:cmd:RO::/usr/sbin/smp_write_gpio:privs=zone
+SCSI Device Management:solaris:cmd:RO::/usr/sbin/smp_zone_activate:privs=zone
+SCSI Device Management:solaris:cmd:RO::/usr/sbin/smp_zone_lock:privs=zone
+SCSI Device Management:solaris:cmd:RO::/usr/sbin/smp_zone_unlock:privs=zone
+SCSI Device Management:solaris:cmd:RO::/usr/sbin/smp_zoned_broadcast:privs=zone
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/smp_utils/files/smp_utils-prof_attr	Mon Nov 07 17:10:14 2016 -0800
@@ -0,0 +1,2 @@
+SCSI Device Info:RO::Inquiry, read device information:help=RtSCSIDeviceInfo.html
+SCSI Device Management:RO::Manage, modify device status or data:help=RtSCSIDeviceManagement.html;profiles=SCSI Device Info
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/smp_utils/patches/smp_utils-solaris-build.patch	Mon Nov 07 17:10:14 2016 -0800
@@ -0,0 +1,50 @@
+#Use -v to switch to standard error output. This patch is deemed
+#Solaris-centric and thus not worthy of being submitted upstream.
+diff -urN smp_utils-0.97/lib/Makefile.am smp_utils-0.97.new/lib/Makefile.am
+--- smp_utils-0.97/lib/Makefile.am	2011-08-06 20:47:17.000000000 -0700
++++ smp_utils-0.97.new/lib/Makefile.am	2012-10-29 23:22:01.250489177 -0700
[email protected]@ -38,7 +38,7 @@
+ 
+ 
+ 
+-AM_CFLAGS = -I ../include -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Wall -W
++AM_CFLAGS = -I ../include -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -v
+ # AM_CFLAGS = -I ../include -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Wall -W -pedantic -std=c99
+ 
+ lib_LTLIBRARIES = libsmputils1.la
+diff -urN smp_utils-0.97/lib/Makefile.in smp_utils-0.97.new/lib/Makefile.in
+--- smp_utils-0.97/lib/Makefile.in	2011-11-16 16:48:55.000000000 -0800
++++ smp_utils-0.97.new/lib/Makefile.in	2012-10-29 23:22:01.251160763 -0700
[email protected]@ -243,7 +243,7 @@
+ @[email protected]_libsmputils1_la_SOURCES = \
+ @[email protected]	smp_dummy.c
+ 
+-AM_CFLAGS = -I ../include -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Wall -W
++AM_CFLAGS = -I ../include -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -v
+ # AM_CFLAGS = -I ../include -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Wall -W -pedantic -std=c99
+ lib_LTLIBRARIES = libsmputils1.la
+ libsmputils1_la_LDFLAGS = -version-info 1:0:0
+diff -urN smp_utils-0.97/src/Makefile.am smp_utils-0.97.new/src/Makefile.am
+--- smp_utils-0.97/src/Makefile.am	2011-11-29 12:11:36.000000000 -0800
++++ smp_utils-0.97.new/src/Makefile.am	2012-10-29 23:22:36.457726462 -0700
[email protected]@ -28,7 +28,7 @@
+ ## endif
+ 
+ 
+-AM_CFLAGS = -I ../include -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Wall -W
++AM_CFLAGS = -I ../include -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -v
+ # AM_CFLAGS = -I ../include -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Wall -W -pedantic -std=c99
+ 
+ smp_conf_general_SOURCES =	smp_conf_general.c
+diff -urN smp_utils-0.97/src/Makefile.in smp_utils-0.97.new/src/Makefile.in
+--- smp_utils-0.97/src/Makefile.in	2011-11-29 12:11:36.000000000 -0800
++++ smp_utils-0.97.new/src/Makefile.in	2012-10-29 23:22:36.458435498 -0700
[email protected]@ -319,7 +319,7 @@
+ top_build_prefix = @[email protected]
+ top_builddir = @[email protected]
+ top_srcdir = @[email protected]
+-AM_CFLAGS = -I ../include -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Wall -W
++AM_CFLAGS = -I ../include -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -v
+ # AM_CFLAGS = -I ../include -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Wall -W -pedantic -std=c99
+ smp_conf_general_SOURCES = smp_conf_general.c
+ smp_conf_general_LDADD = ../lib/libsmputils1.la @[email protected]
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/smp_utils/smp_utils.license	Mon Nov 07 17:10:14 2016 -0800
@@ -0,0 +1,25 @@
+Copyright (c) 2006-2009 Douglas Gilbert.
+ All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+1. Redistributions of source code must retain the above copyright
+   notice, this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright
+   notice, this list of conditions and the following disclaimer in the
+   documentation and/or other materials provided with the distribution.
+3. The name of the author may not be used to endorse or promote products
+   derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGE.    
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/smp_utils/smp_utils.p5m	Mon Nov 07 17:10:14 2016 -0800
@@ -0,0 +1,114 @@
+#
+# 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 (c) 2016, Oracle and/or its affiliates. All rights reserved.
+#
+
+<transform file path=usr.*/man/.+ -> default mangler.man.stability uncommitted>
+set name=pkg.fmri \
+    value=pkg:/system/storage/[email protected]$(IPS_COMPONENT_VERSION),$(BUILD_VERSION)
+set name=pkg.summary \
+    value="Utilities for SMP expanders that help diagnose problems"
+set name=pkg.description \
+    value="The smp_utils package contains utilities for the Serial Attached SCSI (SAS) Serial Management Protocol (SMP). Most utilities correspond to a single SMP function, sending out a request, checking for errors and if all is well processing the response. The response is either decoded, printed out in ASCII hexadecimal or sent as binary to stdout."
+set name=com.oracle.info.description value="SMP diagnostic tools"
+set name=com.oracle.info.tpno value=$(TPNO)
+set name=info.classification \
+    value="org.opensolaris.category.2008:Applications/System Utilities"
+set name=info.source-url value=$(COMPONENT_ARCHIVE_URL)
+set name=info.upstream-url value=$(COMPONENT_PROJECT_URL)
+set name=org.opensolaris.arc-caseid value=PSARC/2012/329
+set name=org.opensolaris.consolidation value=$(CONSOLIDATION)
+
+file smp_utils-exec_attr path=etc/security/exec_attr.d/smp_utils
+file smp_utils-prof_attr path=etc/security/prof_attr.d/smp_utils
+file RtSCSIDeviceInfo.html \
+    path=usr/lib/help/profiles/locale/RtSCSIDeviceInfo.html
+file RtSCSIDeviceManagement.html \
+    path=usr/lib/help/profiles/locale/RtSCSIDeviceManagement.html
+
+file path=usr/include/scsi/smp_lib.h
+file path=usr/lib/$(MACH64)/libsmputils1.la
+link path=usr/lib/$(MACH64)/libsmputils1.so target=libsmputils1.so.1.0.0
+link path=usr/lib/$(MACH64)/libsmputils1.so.1 target=libsmputils1.so.1.0.0
+file path=usr/lib/$(MACH64)/libsmputils1.so.1.0.0
+file path=usr/sbin/smp_conf_general
+file path=usr/sbin/smp_conf_phy_event
+file path=usr/sbin/smp_conf_route_info
+file path=usr/sbin/smp_conf_zone_man_pass
+file path=usr/sbin/smp_conf_zone_perm_tbl
+file path=usr/sbin/smp_conf_zone_phy_info
+file path=usr/sbin/smp_discover
+file path=usr/sbin/smp_discover_list
+file path=usr/sbin/smp_ena_dis_zoning
+file path=usr/sbin/smp_phy_control
+file path=usr/sbin/smp_phy_test
+file path=usr/sbin/smp_read_gpio
+file path=usr/sbin/smp_rep_broadcast
+file path=usr/sbin/smp_rep_exp_route_tbl
+file path=usr/sbin/smp_rep_general
+file path=usr/sbin/smp_rep_manufacturer
+file path=usr/sbin/smp_rep_phy_err_log
+file path=usr/sbin/smp_rep_phy_event
+file path=usr/sbin/smp_rep_phy_event_list
+file path=usr/sbin/smp_rep_phy_sata
+file path=usr/sbin/smp_rep_route_info
+file path=usr/sbin/smp_rep_self_conf_stat
+file path=usr/sbin/smp_rep_zone_man_pass
+file path=usr/sbin/smp_rep_zone_perm_tbl
+file path=usr/sbin/smp_write_gpio
+file path=usr/sbin/smp_zone_activate
+file path=usr/sbin/smp_zone_lock
+file path=usr/sbin/smp_zone_unlock
+file path=usr/sbin/smp_zoned_broadcast
+file path=usr/share/man/man8/smp_conf_general.8
+file path=usr/share/man/man8/smp_conf_phy_event.8
+file path=usr/share/man/man8/smp_conf_route_info.8
+file path=usr/share/man/man8/smp_conf_zone_man_pass.8
+file path=usr/share/man/man8/smp_conf_zone_perm_tbl.8
+file path=usr/share/man/man8/smp_conf_zone_phy_info.8
+file path=usr/share/man/man8/smp_discover.8
+file path=usr/share/man/man8/smp_discover_list.8
+file path=usr/share/man/man8/smp_ena_dis_zoning.8
+file path=usr/share/man/man8/smp_phy_control.8
+file path=usr/share/man/man8/smp_phy_test.8
+file path=usr/share/man/man8/smp_read_gpio.8
+file path=usr/share/man/man8/smp_rep_broadcast.8
+file path=usr/share/man/man8/smp_rep_exp_route_tbl.8
+file path=usr/share/man/man8/smp_rep_general.8
+file path=usr/share/man/man8/smp_rep_manufacturer.8
+file path=usr/share/man/man8/smp_rep_phy_err_log.8
+file path=usr/share/man/man8/smp_rep_phy_event.8
+file path=usr/share/man/man8/smp_rep_phy_event_list.8
+file path=usr/share/man/man8/smp_rep_phy_sata.8
+file path=usr/share/man/man8/smp_rep_route_info.8
+file path=usr/share/man/man8/smp_rep_self_conf_stat.8
+file path=usr/share/man/man8/smp_rep_zone_man_pass.8
+file path=usr/share/man/man8/smp_rep_zone_perm_tbl.8
+file path=usr/share/man/man8/smp_utils.8
+file path=usr/share/man/man8/smp_write_gpio.8
+file path=usr/share/man/man8/smp_zone_activate.8
+file path=usr/share/man/man8/smp_zone_lock.8
+file path=usr/share/man/man8/smp_zone_unlock.8
+file path=usr/share/man/man8/smp_zoned_broadcast.8
+
+license smp_utils.license license=BSD
+
+depend type=require fmri=driver/storage/smp