diff options
author | Jerry Jelinek <jerry.jelinek@joyent.com> | 2019-09-09 11:26:45 +0000 |
---|---|---|
committer | Jerry Jelinek <jerry.jelinek@joyent.com> | 2019-09-09 11:26:45 +0000 |
commit | b36aca9fee0db2b4336b9f6ee7835a8f3fbfe9c9 (patch) | |
tree | 029c95d18101ff3839ddd942d4ed90ff16fd8fe7 | |
parent | 1cc204b97b9317e681958da0e91abeb27bcc6f82 (diff) | |
parent | 793ac993be490bb7c16673e5f2588c6d18672894 (diff) | |
download | illumos-joyent-b36aca9fee0db2b4336b9f6ee7835a8f3fbfe9c9.tar.gz |
[illumos-gate merge]
commit 793ac993be490bb7c16673e5f2588c6d18672894
11654 libipmi/Makefile.com has an invalid and unused variable substitution
commit d8109ce4330e1b8ad6c29f9fccacec969066bb9d
11653 tools/make/bin/Makefile has an invalid and unused variable substitution
commit bdf3516c67ac96d42da6a8adc5bf9a0a5b72b060
11652 Remove unused archive library rules from cmd/sgs
commit 2b1ff28bbd88f04a83e6ca2d284eb7be0959c43c
11647 6026 regressed after 5980
commit 21ec5af72097881ccdcd81ebfd26e1c85b609ad6
11662 nss_ldap: group members are not comma separated
commit aa5636e518a7c706134caf5072a16f9f85f7497a
11633 SPARC NULL pointer errors in libprtdiag_psr
commit 3f8c0768c028803de6022c542bbd9e9e6f08289f
11632 SPARC NULL pointer error in libtsalarm
commit 53bfe442a2e3c2938be0ac7b2b05d096689c2ea6
11631 SPARC NULL pointer error in libds
commit 9cb0a1d4446fe891a01d01e07b2e27f0177c84cd
11630 remove checks for 64-bit capable hardware
commit 95bfa623bf6336d9476ba272ebda6e2c2a305e6f
10852 libficl-sys: implement loader emulator commands with linker set
commit 90ce8b937724b0472efa92ca9911002383cf25a2
10851 want sys/linker_set.h
commit bfa93d3911fd4856c353c9b190c18cdb98fc36b4
11610 PCI ID ambiguity leads to driver induced mayhem
11611 pchtemp driver should use new IPD 9 aliases
commit 96fc3fdf646c403f7896ecd3e9657d0474025bba
11617 esc fails with /usr/bin/cpp present
commit 5711d3938643272e5ca2aaf5d868e612e7bc97b6
11640 add zpool ashift property tunable
commit 2c54ade085d70dd5a2914f0fa5cf7fe208cd36a6
11603 smbadm has wrong exit code while listing SMB group properties
commit 69b1fd3f24d0ee2e682883606201c61f52085805
11461 should use a native link-editor during the build
11463 SUNWonld has passed its use-by date
11464 cmd/sgs/tools should contain tools, not common code
11465 sgsmsg should be built with the rest of the build tools
commit d58ceae2ed78dc65ab682a0281ce523d6c4116fe
11646 fbt entry probes incorrectly placed due to -fshrink-wrap
Conflicts:
usr/src/uts/Makefile.uts
194 files changed, 2241 insertions, 3261 deletions
diff --git a/exception_lists/check_rtime b/exception_lists/check_rtime index 5dc098e8d6..250a02a5f9 100644 --- a/exception_lists/check_rtime +++ b/exception_lists/check_rtime @@ -247,3 +247,11 @@ FORBIDDEN_DEP usr/ucblib/ FORBIDDEN libm\.so\.1 FORBIDDEN libresolv\.so\.1 FORBIDDEN libxcurses\.so\.1 + +# +# the SUNWonld directory contains built versions of demos, built only to +# ensure their correctness. +# +EXEC_STACK ^opt/SUNWonld +EXEC_DATA ^opt/SUNWonld +NODIRECT ^opt/SUNWonld diff --git a/exception_lists/packaging b/exception_lists/packaging index e5ffa391be..9459a99623 100644 --- a/exception_lists/packaging +++ b/exception_lists/packaging @@ -877,3 +877,29 @@ usr/include/libjedec.h usr/lib/amd64/libjedec.so i386 usr/lib/sparcv9/libjedec.so sparc usr/lib/libjedec.so + +# +# the tools copy of the link-editor is not delivered +# +opt/onbld/bin/i386/ld i386 +opt/onbld/bin/sparc/ld sparc +opt/onbld/bin/i386/sgsmsg i386 +opt/onbld/bin/sparc/sgsmsg sparc +opt/onbld/lib/i386/libelf.so i386 +opt/onbld/lib/i386/libelf.so.1 i386 +opt/onbld/lib/i386/libld.so i386 +opt/onbld/lib/i386/libld.so.4 i386 +opt/onbld/lib/i386/liblddbg.so i386 +opt/onbld/lib/i386/liblddbg.so.4 i386 +opt/onbld/lib/sparc/libelf.so sparc +opt/onbld/lib/sparc/libelf.so.1 sparc +opt/onbld/lib/sparc/libld.so sparc +opt/onbld/lib/sparc/libld.so.4 sparc +opt/onbld/lib/sparc/liblddbg.so sparc +opt/onbld/lib/sparc/liblddbg.so.4 sparc +opt/onbld/man/man1onbld/sgsmsg.1onbld + +# +# The built link-editor demos are not delivered +# +opt/SUNWonld/ @@ -4342,6 +4342,7 @@ f usr/include/sys/libc_kernel.h 0644 root bin f usr/include/sys/libdevid.h 0644 root bin f usr/include/sys/limits.h 0644 root bin f usr/include/sys/link.h 0644 root bin +f usr/include/sys/linker_set.h 0644 root bin f usr/include/sys/list.h 0644 root bin f usr/include/sys/list_impl.h 0644 root bin f usr/include/sys/llc1.h 0644 root bin diff --git a/usr/src/Makefile.master b/usr/src/Makefile.master index e2531f0378..fdd266002c 100644 --- a/usr/src/Makefile.master +++ b/usr/src/Makefile.master @@ -878,6 +878,7 @@ $(__SUNC)PRIMARY_CCC= studio12,$(SPRO_VROOT)/bin/CC,sun CW_CC_COMPILERS= $(PRIMARY_CC:%=--primary %) $(SHADOW_CCS:%=--shadow %) CW_CCC_COMPILERS= $(PRIMARY_CCC:%=--primary %) $(SHADOW_CCCS:%=--shadow %) +CW_LINKER= --linker $(LD) # Till SS12u1 formally becomes the NV CBE, LINT is hard # coded to be picked up from the $SPRO_ROOT/sunstudio12.1/ @@ -891,10 +892,10 @@ CW_CCC_COMPILERS= $(PRIMARY_CCC:%=--primary %) $(SHADOW_CCCS:%=--shadow %) # CW= $(ONBLD_TOOLS)/bin/$(MACH)/cw -BUILD_CC= $(CW) $(CW_CC_COMPILERS) -- -BUILD_CCC= $(CW) -C $(CW_CCC_COMPILERS) -- +BUILD_CC= $(CW) $(CW_LINKER) $(CW_CC_COMPILERS) -- +BUILD_CCC= $(CW) -C $(CW_LINKER) $(CW_CCC_COMPILERS) -- BUILD_CPP= /usr/ccs/lib/cpp -BUILD_LD= /usr/ccs/bin/ld +BUILD_LD= $(ONBLD_TOOLS)/bin/$(MACH)/ld BUILD_LINT= $(SPRO_ROOT)/sunstudio12.1/bin/lint $(MACH)_CC= $(BUILD_CC) diff --git a/usr/src/cmd/fm/eversholt/common/esclex.c b/usr/src/cmd/fm/eversholt/common/esclex.c index 2c3bf73469..44555c7785 100644 --- a/usr/src/cmd/fm/eversholt/common/esclex.c +++ b/usr/src/cmd/fm/eversholt/common/esclex.c @@ -73,7 +73,7 @@ static const char *Fileopened; static FILE *Fp; static int Line; static const char *File; -static const char *Cpp = "/usr/bin/cpp"; +static const char *Cpp = "/usr/lib/cpp"; #ifdef ESC static const char *Cppargs; static const char *Cppstdargs = "-undef -Y."; diff --git a/usr/src/cmd/fm/eversholt/files/Makefile.com b/usr/src/cmd/fm/eversholt/files/Makefile.com index c5a22b3a7b..928ea34284 100644 --- a/usr/src/cmd/fm/eversholt/files/Makefile.com +++ b/usr/src/cmd/fm/eversholt/files/Makefile.com @@ -36,6 +36,13 @@ USR_PLAT_EFT_DIR= $(USR_PLAT_FM_DIR)/eft USR_PLAT_EFT_FILES= $(EFT_PLAT_FILES:%=$(USR_PLAT_EFT_DIR)/%) # +# Override the built-in ESC pre-processor with a reference to the one we +# have set in Makefile.master. This ensures that we use the same cpp +# throughout the build. +# +ESC_ENV=_ESC_CPP=$(CPP) + +# # Default target - specify before including Makefile.rootdirs which would # otherwise provide a default # @@ -57,7 +64,7 @@ ESCFLAGS= -D_ESC -I$(ROOT)/usr/include pciexrc.eft := ESCFLAGS += -I$(SRC)/uts/sun4v/io/px %.eft: ../common/%.esc - $(ESC) $(ESCFLAGS) -o $@ $< + $(ESC_ENV) $(ESC) $(ESCFLAGS) -o $@ $< %.eft: %.esc - $(ESC) $(ESCFLAGS) -o $@ $< + $(ESC_ENV) $(ESC) $(ESCFLAGS) -o $@ $< diff --git a/usr/src/cmd/fm/modules/common/zfs-retire/zfs_retire.c b/usr/src/cmd/fm/modules/common/zfs-retire/zfs_retire.c index e2d1a6831a..85d9dfc904 100644 --- a/usr/src/cmd/fm/modules/common/zfs-retire/zfs_retire.c +++ b/usr/src/cmd/fm/modules/common/zfs-retire/zfs_retire.c @@ -22,6 +22,9 @@ * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright 2019 Joyent, Inc. */ +/* + * Copyright 2019 Joyent, Inc. + */ /* * The ZFS retire agent is responsible for managing hot spares across all pools. @@ -231,6 +234,8 @@ replace_with_spare(fmd_hdl_t *hdl, zpool_handle_t *zhp, nvlist_t *vdev) nvlist_t **spares; uint_t s, nspares; char *dev_name; + zprop_source_t source; + int ashift; config = zpool_get_config(zhp, NULL); if (nvlist_lookup_nvlist(config, ZPOOL_CONFIG_VDEV_TREE, @@ -244,6 +249,11 @@ replace_with_spare(fmd_hdl_t *hdl, zpool_handle_t *zhp, nvlist_t *vdev) &spares, &nspares) != 0) return; + /* + * lookup "ashift" pool property, we may need it for the replacement + */ + ashift = zpool_get_prop_int(zhp, ZPOOL_PROP_ASHIFT, &source); + replacement = fmd_nvl_alloc(hdl, FMD_SLEEP); (void) nvlist_add_string(replacement, ZPOOL_CONFIG_TYPE, @@ -262,6 +272,11 @@ replace_with_spare(fmd_hdl_t *hdl, zpool_handle_t *zhp, nvlist_t *vdev) &spare_name) != 0) continue; + /* if set, add the "ashift" pool property to the spare nvlist */ + if (source != ZPROP_SRC_DEFAULT) + (void) nvlist_add_uint64(spares[s], + ZPOOL_CONFIG_ASHIFT, ashift); + (void) nvlist_add_nvlist_array(replacement, ZPOOL_CONFIG_CHILDREN, &spares[s], 1); diff --git a/usr/src/cmd/sgs/Makefile b/usr/src/cmd/sgs/Makefile index d9ac6c2305..e0a53e9cca 100644 --- a/usr/src/cmd/sgs/Makefile +++ b/usr/src/cmd/sgs/Makefile @@ -115,7 +115,7 @@ chkmsg := TARGET= chkmsg .PARALLEL: $(SUBDIRS) -all install: native-add .WAIT $(SUBDIRS) +all install: $(SUBDIRS) include $(SRC)/cmd/Makefile.targ @@ -125,8 +125,7 @@ _msg: _msg_gettext _msg_sgsmsg _msg_gettext: $(MSGDOMAIN)/$(POFILE) -# $(MACH)/sgsmsg must be built before we can descend into $(MSGDIR) -_msg_sgsmsg: native-add .WAIT $(MSGDIR) +_msg_sgsmsg: $(MSGDIR) $(MSGDOMAIN)/$(POFILE): \ $(MSGDOMAIN) $(POFILE) @@ -149,39 +148,18 @@ install_lib: FRC lint: -delete \ -clean clobber: native-clobber .WAIT $(SUBDIRS) $(MSGDIR) +delete clean clobber: $(SUBDIRS) $(MSGDIR) $(SUBDIRS): FRC @ cd $@; pwd; $(MAKE) $(TARGET) - -# Integration of ld and ld.so.1 in some developement cycles requires that both -# of these modules be built using the new ld. This `native' target allows us -# to build a local ld which will then be used to build the delivered version of -# itself and ld.so.1. Once this new functionality appears in the standard ld -# this target can be disabled. - -native-add: FRC - @ cd tools/$(MACH); pwd; $(MAKE) native - @ cd libconv/$(MACH); pwd; $(MAKE) - @ cd libelf/$(MACH); pwd; $(MAKE) native - @ cd liblddbg/$(MACH); pwd; $(MAKE) native - @ cd libldstab/$(MACH); pwd; $(MAKE) native - @ cd libld/$(MACH); pwd; $(MAKE) native - @ cd ld/$(MACH); pwd; $(MAKE) native - -native-clobber: - @ cd tools; pwd; $(MAKE) $(TARGET) - $(RM) -r proto/$(MACH) - FRC: # # Cross-reference customization: ignore the directories named by XRPRUNE, # and tweak the file globs slightly. # -XRPRUNE= rtld.4.x packages abi +XRPRUNE= rtld.4.x abi XRADD= *.msg mapfile* XRDEL= Makefile* kobj_* diff --git a/usr/src/cmd/sgs/Makefile.com b/usr/src/cmd/sgs/Makefile.com index c2c5143c66..f8f102b41b 100644 --- a/usr/src/cmd/sgs/Makefile.com +++ b/usr/src/cmd/sgs/Makefile.com @@ -31,8 +31,6 @@ include $(SRC)/cmd/sgs/Makefile.var -SRCBASE = ../../../.. - i386_ARCH = intel sparc_ARCH = sparc @@ -52,6 +50,8 @@ CSTD_GNU89 = $(CSTD_GNU99) CFLAGS += $(CCVERBOSE) $(DEBUG) $(XFFLAG) CFLAGS64 += $(CCVERBOSE) $(DEBUG) $(XFFLAG) +NATIVE_CFLAGS += $(CCVERBOSE) $(DEBUG) $(XFFLAG) + CERRWARN += -_gcc=-Wno-type-limits CERRWARN += -_gcc=-Wno-parentheses CERRWARN += -_gcc=-Wno-unused-value @@ -63,7 +63,7 @@ ELFCAP= $(SRC)/common/elfcap # Reassign CPPFLAGS so that local search paths are used before any parent # $ROOT paths. -CPPFLAGS = -I. -I../common -I../../include -I../../include/$(MACH) \ +CPPFLAGS = -I. -I../common -I$(SGSHOME)/include -I$(SGSHOME)/include/$(MACH) \ $(CPPFLAGS.master) -I$(ELFCAP) # PICS64 is unique to our environment @@ -77,7 +77,7 @@ DYNFLAGS += $(ZIGNORE) # Establish the local tools, proto and package area. SGSHOME = $(SRC)/cmd/sgs -SGSPROTO = $(SGSHOME)/proto/$(MACH) +SGSCOMMON = $(SGSHOME)/common SGSTOOLS = $(SGSHOME)/tools SGSMSGID = $(SGSHOME)/messages SGSMSGDIR = $(SGSHOME)/messages/$(MACH) @@ -85,12 +85,6 @@ SGSONLD = $(ROOT)/opt/SUNWonld SGSRPATH = /usr/lib SGSRPATH64 = $(SGSRPATH)/$(MACH64) -# Mimic the structure of an installed system. - -SGSLIBDIR = $(SGSPROTO)/lib -SGSPREFIX = $(SGSPROTO)/usr -SGSBINDIR = $(SGSPREFIX)/bin - # # Macros to be used to include link against libconv and include vernote.o # @@ -117,33 +111,10 @@ DTEXTDOM = # Define any generic sgsmsg(1l) flags. The default message generation system # is to use gettext(3i), add the -C flag to switch to catgets(3c). -SGSMSG = $(SGSTOOLS)/$(MACH)/sgsmsg +SGSMSG = $(ONBLD_TOOLS)/bin/$(MACH)/sgsmsg SGSMSG_PIGLATIN_NL = perl $(SGSTOOLS)/common/sgsmsg_piglatin_nl.pl -CHKMSG = $(SGSTOOLS)/chkmsg.sh +CHKMSG = $(SGSHOME)/tools/chkmsg.sh SGSMSGVFLAG = SGSMSGFLAGS = $(SGSMSGVFLAG) -i $(SGSMSGID)/sgs.ident CHKMSGFLAGS = $(SGSMSGTARG:%=-m %) $(SGSMSGCHK:%=-m %) - -# Native targets should use the minimum of ld(1) flags to allow building on -# previous releases. We use mapfiles to scope, but don't bother versioning. - -native := DYNFLAGS = -R$(SGSLIBDIR) -L$(SGSLIBDIR) $(ZNOVERSION) \ - $(HSONAME) - -# Comment out the following two lines to have the sgs built from the system -# link-editor, rather than the local proto link-editor. -CC_USE_PROTO = -Yl,$(SGSBINDIR) -LD_USE_PROTO = $(SGSBINDIR)/ - -LD_LIB = -lld -LD_LIB32 = -lld32 -LD_LIB64 = -lld64 - -LDDBG_LIB = -llddbg -LDDBG_LIB32 = -llddbg32 -LDDBG_LIB64 = -llddbg64 - -CONV_LIB = -lconv -CONV_LIB32 = -lconv32 -CONV_LIB64 = -lconv64 diff --git a/usr/src/cmd/sgs/Makefile.targ b/usr/src/cmd/sgs/Makefile.targ index 776fedad57..b8d85bef18 100644 --- a/usr/src/cmd/sgs/Makefile.targ +++ b/usr/src/cmd/sgs/Makefile.targ @@ -51,19 +51,4 @@ $(ROOTFS_LIBDIR)/$(LIBLINKSCCC): $(ROOTFS_LIBDIR)/$(LIBLINKSCCC)$(VERS) $(ROOTFS_LIBDIR64)/$(LIBLINKSCCC): $(ROOTFS_LIBDIR64)/$(LIBLINKSCCC)$(VERS) $(INS.liblinkccc64) -# -# For those that install into the SGSPROTO directory. -# -$(SGSPROTO): - $(INS.dir) - -$(SGSBINDIR): $(SGSPROTO) - $(INS.dir) - -$(SGSPREFIX): $(SGSPROTO) - $(INS.dir) - -$(SGSLIBDIR): $(SGSPREFIX) - $(INS.dir) - FRC: diff --git a/usr/src/cmd/sgs/Makefile.var b/usr/src/cmd/sgs/Makefile.var index 2e27e5411b..c2984dc553 100644 --- a/usr/src/cmd/sgs/Makefile.var +++ b/usr/src/cmd/sgs/Makefile.var @@ -69,8 +69,8 @@ VAR_PLAT_amd64= intel/amd64 # files avl.c, avl.h and avl_impl.h until these files are back ported into # the system. # -VAR_AVLDIR= $(SRCBASE)/common/avl -VAR_AVLINCDIR= -I $(SRCBASE)/uts/common +VAR_AVLDIR= $(SRC)/common/avl +VAR_AVLINCDIR= -I $(SRC)/uts/common # # VAR_DTRDIR - directory to find dtrace_data.c in. @@ -78,7 +78,7 @@ VAR_AVLINCDIR= -I $(SRCBASE)/uts/common # In Solaris 10 and earlier releases, dtrace_data.c was maintained as separate # files under sgs/rtld. This file is now under usr/src/common/dtrace. # -VAR_DTRDIR= $(SRCBASE)/common/dtrace +VAR_DTRDIR= $(SRC)/common/dtrace # # VAR_SGSBINPROG diff --git a/usr/src/cmd/sgs/ar/Makefile.com b/usr/src/cmd/sgs/ar/Makefile.com index 0ea19dc3a8..2afc58d8f3 100644 --- a/usr/src/cmd/sgs/ar/Makefile.com +++ b/usr/src/cmd/sgs/ar/Makefile.com @@ -47,7 +47,7 @@ CERRWARN += $(CNOWARN_UNINIT) SMOFF += signed -LDLIBS += -lelf $(CONVLIBDIR) $(CONV_LIB) -lsendfile +LDLIBS += -lelf $(CONVLIBDIR) -lconv -lsendfile $(XPG4) := CPPFLAGS += -DXPG4 @@ -63,6 +63,6 @@ SGSMSGALL = $(SGSMSGCOM) SGSMSGFLAGS += -h $(BLTDEFS) -d $(BLTDATA) -m $(BLTMESG) -n ar_msg -SRCS= $(COMOBJ:%.o=../common/%.c) $(BLTDATA:%.o=$(SGSTOOLS)/common/%.c) +SRCS= $(COMOBJ:%.o=../common/%.c) $(BLTDATA:%.o=$(SGSCOMMON)/%.c) CLEANFILES += $(BLTFILES) diff --git a/usr/src/cmd/sgs/tools/common/alist.c b/usr/src/cmd/sgs/common/alist.c index 51af6c0feb..51af6c0feb 100644 --- a/usr/src/cmd/sgs/tools/common/alist.c +++ b/usr/src/cmd/sgs/common/alist.c diff --git a/usr/src/cmd/sgs/tools/common/assfail.c b/usr/src/cmd/sgs/common/assfail.c index 4e0ccb7637..a362190f63 100644 --- a/usr/src/cmd/sgs/tools/common/assfail.c +++ b/usr/src/cmd/sgs/common/assfail.c @@ -24,8 +24,6 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include <stdlib.h> #include <stdio.h> @@ -37,7 +35,7 @@ int assfail(const char *a, const char *f, int l) { (void) printf("assertion failed: %s, file: %s, line: %d\n", - a, f, l); + a, f, l); abort(); return (0); } diff --git a/usr/src/cmd/sgs/tools/common/findprime.c b/usr/src/cmd/sgs/common/findprime.c index 87d88c0b93..aebc611a76 100644 --- a/usr/src/cmd/sgs/tools/common/findprime.c +++ b/usr/src/cmd/sgs/common/findprime.c @@ -24,8 +24,6 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include <sys/types.h> /* diff --git a/usr/src/cmd/sgs/tools/common/leb128.c b/usr/src/cmd/sgs/common/leb128.c index ce30be83a6..ce30be83a6 100644 --- a/usr/src/cmd/sgs/tools/common/leb128.c +++ b/usr/src/cmd/sgs/common/leb128.c diff --git a/usr/src/cmd/sgs/tools/common/strhash.c b/usr/src/cmd/sgs/common/strhash.c index d7d4dcbafd..5502fbaa56 100644 --- a/usr/src/cmd/sgs/tools/common/strhash.c +++ b/usr/src/cmd/sgs/common/strhash.c @@ -24,8 +24,6 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include <sgs.h> /* diff --git a/usr/src/cmd/sgs/tools/common/string_table.c b/usr/src/cmd/sgs/common/string_table.c index c15473150e..c15473150e 100644 --- a/usr/src/cmd/sgs/tools/common/string_table.c +++ b/usr/src/cmd/sgs/common/string_table.c diff --git a/usr/src/cmd/sgs/crle/Makefile.com b/usr/src/cmd/sgs/crle/Makefile.com index 252ecd28a3..358f4def66 100644 --- a/usr/src/cmd/sgs/crle/Makefile.com +++ b/usr/src/cmd/sgs/crle/Makefile.com @@ -35,9 +35,9 @@ include $(SRC)/cmd/sgs/Makefile.com COMOBJ= config.o crle.o depend.o dump.o \ inspect.o hash.o print.o util.o BLTOBJ= msg.o -TOOLSOBJ= alist.o +SGSCOMMONOBJ= alist.o -OBJS= $(BLTOBJ) $(COMOBJ) $(TOOLSOBJ) +OBJS= $(BLTOBJ) $(COMOBJ) $(SGSCOMMONOBJ) MAPFILE= $(MAPFILE.NGB) MAPOPT= $(MAPFILE:%=-M%) @@ -45,13 +45,12 @@ MAPOPT= $(MAPFILE:%=-M%) # not linted SMATCH=off -CPPFLAGS += -I$(SRC)/common/sgsrtcid -I$(SRCBASE)/uts/$(ARCH)/sys \ +CPPFLAGS += -I$(SRC)/common/sgsrtcid -I$(SRC)/uts/$(ARCH)/sys \ -D__EXTENSIONS__ LLDFLAGS = '-R$$ORIGIN/../lib' LLDFLAGS64 = '-R$$ORIGIN/../../lib/$(MACH64)' -LDFLAGS += $(VERSREF) $(CC_USE_PROTO) $(MAPOPT) \ - $(LLDFLAGS) $(ZNOLAZYLOAD) -LDLIBS += -lelf $(CONVLIBDIR) $(CONV_LIB) $(DLLIB) +LDFLAGS += $(VERSREF) $(MAPOPT) $(LLDFLAGS) $(ZNOLAZYLOAD) +LDLIBS += -lelf $(CONVLIBDIR) -lconv BLTDEFS= msg.h BLTDATA= msg.c @@ -66,6 +65,6 @@ SGSMSGALL= $(SGSMSGCOM) SGSMSGFLAGS += -h $(BLTDEFS) -d $(BLTDATA) -m $(BLTMESG) -n crle_msg SRCS= $(COMOBJ:%.o=../common/%.c) $(BLTDATA) \ - $(TOOLSOBJ:%.o=$(SGSTOOLS)/common/%.c) + $(COMMON:%.o=$(SGSCOMMON)/%.c) CLEANFILES += $(BLTFILES) diff --git a/usr/src/cmd/sgs/crle/Makefile.targ b/usr/src/cmd/sgs/crle/Makefile.targ index 850e37892f..346aec755a 100644 --- a/usr/src/cmd/sgs/crle/Makefile.targ +++ b/usr/src/cmd/sgs/crle/Makefile.targ @@ -28,7 +28,7 @@ $(COMPILE.c) $< $(POST_PROCESS_O) -%.o: $(SGSTOOLS)/common/%.c +%.o: $(SGSCOMMON)/%.c $(COMPILE.c) $< $(POST_PROCESS_O) diff --git a/usr/src/cmd/sgs/dump/Makefile.com b/usr/src/cmd/sgs/dump/Makefile.com index e857d76a95..6fee454721 100644 --- a/usr/src/cmd/sgs/dump/Makefile.com +++ b/usr/src/cmd/sgs/dump/Makefile.com @@ -48,4 +48,4 @@ CERRWARN += $(CNOWARN_UNINIT) SMOFF += indenting -LDLIBS += $(CONVLIBDIR) $(CONV_LIB) $(ELFLIBDIR) -lelf +LDLIBS += $(CONVLIBDIR) -lconv $(ELFLIBDIR) -lelf diff --git a/usr/src/cmd/sgs/elfdump/Makefile.com b/usr/src/cmd/sgs/elfdump/Makefile.com index a82d85307e..968c8ae99c 100644 --- a/usr/src/cmd/sgs/elfdump/Makefile.com +++ b/usr/src/cmd/sgs/elfdump/Makefile.com @@ -39,23 +39,23 @@ COMOBJ32 = elfdump32.o fake_shdr32.o COMOBJ64 = elfdump64.o fake_shdr64.o -TOOLOBJ = leb128.o +SGSCOMMONOBJ = leb128.o BLTOBJ = msg.o -OBJS= $(BLTOBJ) $(COMOBJ) $(COMOBJ32) $(COMOBJ64) $(TOOLOBJ) +OBJS= $(BLTOBJ) $(COMOBJ) $(COMOBJ32) $(COMOBJ64) $(SGSCOMMONOBJ) MAPFILE= $(MAPFILE.NGB) MAPOPT= $(MAPFILE:%=-M%) CPPFLAGS= -I. -I../common -I../../include -I../../include/$(MACH) \ - -I$(SRCBASE)/lib/libc/inc -I$(SRCBASE)/uts/$(ARCH)/sys \ + -I$(SRC)/lib/libc/inc -I$(SRC)/uts/$(ARCH)/sys \ $(CPPFLAGS.master) -I$(ELFCAP) LLDFLAGS = $(VAR_ELFDUMP_LLDFLAGS) LLDFLAGS64 = $(VAR_ELFDUMP_LLDFLAGS64) -LDFLAGS += $(VERSREF) $(CC_USE_PROTO) $(MAPOPT) $(LLDFLAGS) -LDLIBS += $(ELFLIBDIR) -lelf $(LDDBGLIBDIR) $(LDDBG_LIB) \ - $(CONVLIBDIR) $(CONV_LIB) +LDFLAGS += $(VERSREF) $(MAPOPT) $(LLDFLAGS) +LDLIBS += $(ELFLIBDIR) -lelf $(LDDBGLIBDIR) -llddbg \ + $(CONVLIBDIR) -lconv CERRWARN += $(CNOWARN_UNINIT) @@ -75,6 +75,6 @@ SGSMSGFLAGS += -h $(BLTDEFS) -d $(BLTDATA) -m $(BLTMESG) -n elfdump_msg SRCS = $(COMOBJ:%.o=../common/%.c) \ $(COMOBJ32:%32.o=../common/%.c) \ - $(TOOLOBJ:%.o=../../tools/common/%.c) $(BLTDATA) + $(SGSCOMMONOBJ:%.o=$(SGSCOMMON)/%.c) $(BLTDATA) CLEANFILES += $(BLTFILES) gen_struct_layout diff --git a/usr/src/cmd/sgs/elfdump/Makefile.targ b/usr/src/cmd/sgs/elfdump/Makefile.targ index bef356bb28..48bbbbbb87 100644 --- a/usr/src/cmd/sgs/elfdump/Makefile.targ +++ b/usr/src/cmd/sgs/elfdump/Makefile.targ @@ -39,7 +39,7 @@ $(COMPILE.c) -D_ELF64 -o $@ $< $(POST_PROCESS_O) -%.o: $(SGSTOOLS)/common/%.c +%.o: $(SGSCOMMON)/%.c $(COMPILE.c) -o $@ $< $(POST_PROCESS_O) diff --git a/usr/src/cmd/sgs/elfedit/Makefile.com b/usr/src/cmd/sgs/elfedit/Makefile.com index 99b630ff47..e218130693 100644 --- a/usr/src/cmd/sgs/elfedit/Makefile.com +++ b/usr/src/cmd/sgs/elfedit/Makefile.com @@ -44,13 +44,13 @@ OBJS= $(BLTOBJ) $(COMOBJ) $(COMOBJ32) $(COMOBJ64) MAPFILE= ../common/mapfile-vers CPPFLAGS= -I. -I../common -I../../include -I../../include/$(MACH) \ - -I$(SRCBASE)/lib/libc/inc -I$(SRCBASE)/uts/$(ARCH)/sys \ + -I$(SRC)/lib/libc/inc -I$(SRC)/uts/$(ARCH)/sys \ $(CPPFLAGS.master) -I$(ELFCAP) LLDFLAGS = $(VAR_ELFEDIT_LLDFLAGS) LLDFLAGS64 = $(VAR_ELFEDIT_LLDFLAGS64) -LDFLAGS += $(VERSREF) $(CC_USE_PROTO) -M$(MAPFILE) $(LLDFLAGS) -LDLIBS += $(ELFLIBDIR) -lelf $(LDDBGLIBDIR) $(LDDBG_LIB) \ - $(CONVLIBDIR) $(CONV_LIB) -ltecla +LDFLAGS += $(VERSREF) -M$(MAPFILE) $(LLDFLAGS) +LDLIBS += $(ELFLIBDIR) -lelf $(LDDBGLIBDIR) -llddbg \ + $(CONVLIBDIR) -lconv -ltecla CERRWARN += -_gcc=-Wno-switch CERRWARN += $(CNOWARN_UNINIT) diff --git a/usr/src/cmd/sgs/elfedit/Makefile.targ b/usr/src/cmd/sgs/elfedit/Makefile.targ index e5efa499c8..9f31a1770a 100644 --- a/usr/src/cmd/sgs/elfedit/Makefile.targ +++ b/usr/src/cmd/sgs/elfedit/Makefile.targ @@ -36,7 +36,7 @@ $(COMPILE.c) -D_ELF64 -o $@ $< $(POST_PROCESS_O) -%.o: $(SGSTOOLS)/common/%.c +%.o: $(SGSCOMMON)/%.c $(COMPILE.c) -o $@ $< $(POST_PROCESS_O) diff --git a/usr/src/cmd/sgs/elfedit/modules/Makefile.com b/usr/src/cmd/sgs/elfedit/modules/Makefile.com index e9de1523b9..721361a456 100644 --- a/usr/src/cmd/sgs/elfedit/modules/Makefile.com +++ b/usr/src/cmd/sgs/elfedit/modules/Makefile.com @@ -67,8 +67,8 @@ STR_PICS= $(STR_OBJ:%.o=$(PICDIR)/%.o) SYM_PICS= $(SYM_OBJ:%.o=$(PICDIR)/%.o) SYMINFO_PICS= $(SYMINFO_OBJ:%.o=$(PICDIR)/%.o) -LDLIBS += $(ELFLIBDIR) -lelf $(LDDBGLIBDIR) $(LDDBG_LIB) \ - $(CONVLIBDIR) $(CONV_LIB) -lc +LDLIBS += $(ELFLIBDIR) -lelf $(LDDBGLIBDIR) -llddbg \ + $(CONVLIBDIR) -lconv -lc $(CAP_LIB):= PICS = $(CAP_PICS) $(DYN_LIB):= PICS = $(DYN_PICS) @@ -92,10 +92,10 @@ $(SYMINFO_LIB):= SONAME = $(SYMINFO_LIB) MAPFILES = ../common/mapfile-vers CPPFLAGS += -I../../../include -I../../../include/$(MACH) \ - -I../$(SRCBASE)/lib/libc/inc -D_REENTRANT + -I$(SRC)/lib/libc/inc -D_REENTRANT LLDFLAGS = '-R$$ORIGIN/../../../lib' LLDFLAGS64 = '-R$$ORIGIN/../../../../lib/$(MACH64)' -LDFLAGS += $(CC_USE_PROTO) $(LLDFLAGS) +LDFLAGS += $(LLDFLAGS) DYNFLAGS += $(VERSREF) CERRWARN += -_gcc=-Wno-switch diff --git a/usr/src/cmd/sgs/elfedit/modules/Makefile.targ b/usr/src/cmd/sgs/elfedit/modules/Makefile.targ index 24f3b53e68..350bb280c9 100644 --- a/usr/src/cmd/sgs/elfedit/modules/Makefile.targ +++ b/usr/src/cmd/sgs/elfedit/modules/Makefile.targ @@ -101,10 +101,6 @@ $(ROOTELFEDITDIR64)/%: % $(SGSMSGDIR)/elfedit_%: $(SGSMSG) ../common/%.msg $(SGSMSG) $(SGSMSGFLAGS) -l -m $(SGSMSGDIR)/elfedit_$* $< -$(SGSMSG): - @ cd $(SGSTOOLS)/$(MACH); pwd; $(MAKE) catalog - @ pwd - catalog: $(SGSMSGDIR)/elfedit_cap \ $(SGSMSGDIR)/elfedit_dyn \ $(SGSMSGDIR)/elfedit_ehdr \ diff --git a/usr/src/cmd/sgs/elfwrap/Makefile.com b/usr/src/cmd/sgs/elfwrap/Makefile.com index fa84c86328..de5a4e2892 100644 --- a/usr/src/cmd/sgs/elfwrap/Makefile.com +++ b/usr/src/cmd/sgs/elfwrap/Makefile.com @@ -40,12 +40,12 @@ COMOBJ32 = elfwrap32.o COMOBJ64 = elfwrap64.o -TOOLOBJS = alist.o +SGSCOMMONOBJ = alist.o BLTOBJ = msg.o OBJS= $(BLTOBJ) $(COMOBJ) $(MACHOBJ) $(COMOBJ32) $(COMOBJ64) \ - $(TOOLOBJS) + $(SGSCOMMONOBJ) MAPFILES = $(MAPFILE.NGB) MAPOPTS = $(MAPFILES:%=-M%) @@ -53,8 +53,8 @@ MAPOPTS = $(MAPFILES:%=-M%) CPPFLAGS = -I. -I../common -I../../include $(CPPFLAGS.master) -I$(ELFCAP) LLDFLAGS = LLDFLAGS64 = -LDFLAGS += $(VERSREF) $(CC_USE_PROTO) $(MAPOPTS) $(LLDFLAGS) -LDLIBS += $(ELFLIBDIR) -lelf $(CONVLIBDIR) $(CONV_LIB) +LDFLAGS += $(VERSREF) $(MAPOPTS) $(LLDFLAGS) +LDLIBS += $(ELFLIBDIR) -lelf $(CONVLIBDIR) -lconv CERRWARN += $(CNOWARN_UNINIT) @@ -71,6 +71,6 @@ SGSMSGFLAGS += -h $(BLTDEFS) -d $(BLTDATA) -m $(BLTMESG) -n elfwrap_msg SRCS = $(COMOBJ:%.o=../common/%.c) ../common/machine.c \ $(COMOBJ32:%32.o=../common/%.c) \ - $(TOOLOBJ:%.o=../../tools/common/%.c) $(BLTDATA) + $(SGSCOMMONOBJ:%.o=$(SGSCOMMON)/%.c) $(BLTDATA) CLEANFILES += $(BLTFILES) diff --git a/usr/src/cmd/sgs/elfwrap/Makefile.targ b/usr/src/cmd/sgs/elfwrap/Makefile.targ index b315de2c50..117cd43f38 100644 --- a/usr/src/cmd/sgs/elfwrap/Makefile.targ +++ b/usr/src/cmd/sgs/elfwrap/Makefile.targ @@ -38,7 +38,7 @@ $(COMPILE.c) -D_ELF64 -o $@ $< $(POST_PROCESS_O) -%.o: $(SGSTOOLS)/common/%.c +%.o: $(SGSCOMMON)/%.c $(COMPILE.c) -o $@ $< $(POST_PROCESS_O) diff --git a/usr/src/cmd/sgs/gprof/Makefile.com b/usr/src/cmd/sgs/gprof/Makefile.com index 1a46e900cb..78a43fca4e 100644 --- a/usr/src/cmd/sgs/gprof/Makefile.com +++ b/usr/src/cmd/sgs/gprof/Makefile.com @@ -43,7 +43,7 @@ DEFLIST= -DELF_OBJ -DELF CPPFLAGS= $(INCLIST) $(DEFLIST) $(CPPFLAGS.master) -I$(ELFCAP) CFLAGS += $(CCVERBOSE) CSTD= $(CSTD_GNU99) -LDLIBS += $(CONVLIBDIR) $(CONV_LIB) $(ELFLIBDIR) -lelf +LDLIBS += $(CONVLIBDIR) -lconv $(ELFLIBDIR) -lelf CERRWARN += $(CNOWARN_UNINIT) # not linted diff --git a/usr/src/cmd/sgs/include/conv.h b/usr/src/cmd/sgs/include/conv.h index 7fc4c026d5..2c78d95b04 100644 --- a/usr/src/cmd/sgs/include/conv.h +++ b/usr/src/cmd/sgs/include/conv.h @@ -42,10 +42,7 @@ #include <libld.h> #include <sgs.h> #include <sgsmsg.h> - -#ifndef NATIVE_BUILD #include <sys/secflags.h> -#endif #ifdef __cplusplus extern "C" { @@ -331,14 +328,12 @@ typedef union { char buf[CONV_CNOTE_PROC_FLAG_BUFSIZE]; } Conv_cnote_proc_flag_buf_t; -#ifndef NATIVE_BUILD /* conv_prsecflags() */ #define CONV_PRSECFLAGS_BUFSIZE 57 typedef union { Conv_inv_buf_t inv_buf; char buf[CONV_PRSECFLAGS_BUFSIZE]; } Conv_secflags_buf_t; -#endif /* conv_cnote_sigset() */ #define CONV_CNOTE_SIGSET_BUFSIZE 639 @@ -592,7 +587,7 @@ typedef enum { } conv_ds_type_t; #define CONV_DS_COMMON_FIELDS \ - conv_ds_type_t ds_type; /* Type of data structure used */ \ + conv_ds_type_t ds_type; /* Type of data structure used */ \ uint32_t ds_baseval; /* Value of first item */ \ uint32_t ds_topval /* Value of last item */ @@ -836,10 +831,8 @@ extern const char *conv_cnote_pr_why(short, Conv_fmt_flags_t, Conv_inv_buf_t *); extern const char *conv_cnote_priv(int, Conv_fmt_flags_t, Conv_inv_buf_t *); -#ifndef NATIVE_BUILD extern const char *conv_prsecflags(secflagset_t, Conv_fmt_flags_t, Conv_secflags_buf_t *); -#endif extern const char *conv_cnote_psetid(int, Conv_fmt_flags_t, Conv_inv_buf_t *); extern const char *conv_cnote_sa_flags(int, Conv_fmt_flags_t, diff --git a/usr/src/cmd/sgs/ld/Makefile.com b/usr/src/cmd/sgs/ld/Makefile.com index 9cf9e0a713..81e507a969 100644 --- a/usr/src/cmd/sgs/ld/Makefile.com +++ b/usr/src/cmd/sgs/ld/Makefile.com @@ -36,33 +36,30 @@ BLTOBJ = msg.o OBJS = $(BLTOBJ) $(COMOBJS) .PARALLEL: $(OBJS) -MAPFILES = ../common/mapfile-intf $(MAPFILE.NGB) +SRCDIR = $(SGSHOME)/ld + +MAPFILES = $(SRCDIR)/common/mapfile-intf $(MAPFILE.NGB) MAPOPTS = $(MAPFILES:%=-M%) -LDFLAGS += $(VERSREF) $(CC_USE_PROTO) $(MAPOPTS) $(VAR_LD_LLDFLAGS) -LDLIBS += $(LDLIBDIR) $(LD_LIB) $(ELFLIBDIR) -lelf \ - $(LDDBGLIBDIR) $(LDDBG_LIB) $(CONVLIBDIR) $(CONV_LIB) +LDFLAGS += $(VERSREF) $(MAPOPTS) $(VAR_LD_LLDFLAGS) +LDLIBS += $(LDLIBDIR) -lld $(ELFLIBDIR) -lelf \ + $(LDDBGLIBDIR) -llddbg $(CONVLIBDIR) -lconv CERRWARN += -_gcc=-Wno-switch CERRWARN += -_gcc=-Wno-parentheses -native := LDFLAGS = -R$(SGSLIBDIR) $(ZNOVERSION) -native := LDLIBS = -L$(SGSLIBDIR) $(LD_LIB) -lelf $(CONVLIBDIR) \ - $(CONV_LIB) -native := CPPFLAGS += -DNATIVE_BUILD - BLTDEFS= msg.h BLTDATA= msg.c BLTMESG= $(SGSMSGDIR)/ld BLTFILES= $(BLTDEFS) $(BLTDATA) $(BLTMESG) -SGSMSGCOM= ../common/ld.msg +SGSMSGCOM= $(SRCDIR)/common/ld.msg SGSMSGTARG= $(SGSMSGCOM) SGSMSGALL= $(SGSMSGCOM) SGSMSGFLAGS += -h $(BLTDEFS) -d $(BLTDATA) -m $(BLTMESG) -n ld_msg -SRCS= $(MACHOBJS:%.o=%.c) $(COMOBJS:%.o=../common/%.c) $(BLTDATA) +SRCS= $(MACHOBJS:%.o=%.c) $(COMOBJS:%.o=$(SRCDIR)/common/%.c) $(BLTDATA) CLEANFILES += $(BLTFILES) diff --git a/usr/src/cmd/sgs/ld/Makefile.targ b/usr/src/cmd/sgs/ld/Makefile.targ index b2155c2a73..075e67d8f3 100644 --- a/usr/src/cmd/sgs/ld/Makefile.targ +++ b/usr/src/cmd/sgs/ld/Makefile.targ @@ -29,10 +29,7 @@ all: $(PROG) -package \ -install: all $(VAR_SGSBINPROG) $(VAR_SGSCCSLINK) - -%.o: ../common/%.c +%.o: $(SRCDIR)/common/%.c $(COMPILE.c) $< $(POST_PROCESS_O) @@ -49,15 +46,6 @@ delete: include $(SRC)/cmd/Makefile.targ include $(SRC)/cmd/sgs/Makefile.targ -# Special target for native builds (ie. when we need to build a version of ld -# to build a version of ld :-). - -native: $(SGSBINDIR)/$(PROG) - -$(SGSBINDIR)/$(PROG): $(OBJS) $(SGSBINDIR) - $(LINK.c) $(OBJS) -o $@ $(LDLIBS) - $(POST_PROCESS) - # Derived source and header files (messaging). catalog: $(BLTMESG) diff --git a/usr/src/cmd/sgs/ld/amd64/Makefile b/usr/src/cmd/sgs/ld/amd64/Makefile index 80b7029540..8e329ec823 100644 --- a/usr/src/cmd/sgs/ld/amd64/Makefile +++ b/usr/src/cmd/sgs/ld/amd64/Makefile @@ -23,7 +23,6 @@ # Copyright 2007 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" # include ../Makefile.com @@ -33,12 +32,11 @@ ELFLIBDIR = $(ELFLIBDIR64) LDDBGLIBDIR = $(LDDBGLIBDIR64) CONVLIBDIR = $(CONVLIBDIR64) -VAR_SGSBINPROG= $(VAR_SGSBINPROG64) -VAR_SGSCCSLINK= $(VAR_SGSCCSLINK64) - VAR_LD_LLDFLAGS = \ $(VAR_LD_LLDFLAGS64) +package install: all $(VAR_SGSBINPROG64) $(VAR_SGSCCSLINK64) + .KEEP_STATE: include ../Makefile.targ diff --git a/usr/src/cmd/sgs/ld/i386/Makefile b/usr/src/cmd/sgs/ld/i386/Makefile index 0955bc546b..b8adbefe49 100644 --- a/usr/src/cmd/sgs/ld/i386/Makefile +++ b/usr/src/cmd/sgs/ld/i386/Makefile @@ -19,9 +19,6 @@ # # CDDL HEADER END # -# -#ident "%Z%%M% %I% %E% SMI" -# # Copyright (c) 1996 by Sun Microsystems, Inc. # All rights reserved. @@ -29,4 +26,6 @@ include ../Makefile.com .KEEP_STATE: +package install: all $(VAR_SGSBINPROG) $(VAR_SGSCCSLINK) + include ../Makefile.targ diff --git a/usr/src/cmd/sgs/ld/sparc/Makefile b/usr/src/cmd/sgs/ld/sparc/Makefile index 0955bc546b..b8adbefe49 100644 --- a/usr/src/cmd/sgs/ld/sparc/Makefile +++ b/usr/src/cmd/sgs/ld/sparc/Makefile @@ -19,9 +19,6 @@ # # CDDL HEADER END # -# -#ident "%Z%%M% %I% %E% SMI" -# # Copyright (c) 1996 by Sun Microsystems, Inc. # All rights reserved. @@ -29,4 +26,6 @@ include ../Makefile.com .KEEP_STATE: +package install: all $(VAR_SGSBINPROG) $(VAR_SGSCCSLINK) + include ../Makefile.targ diff --git a/usr/src/cmd/sgs/ld/sparcv9/Makefile b/usr/src/cmd/sgs/ld/sparcv9/Makefile index dda1b9ce13..64a2db892f 100644 --- a/usr/src/cmd/sgs/ld/sparcv9/Makefile +++ b/usr/src/cmd/sgs/ld/sparcv9/Makefile @@ -23,8 +23,6 @@ # Copyright 2007 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# include ../Makefile.com @@ -33,13 +31,12 @@ ELFLIBDIR = $(ELFLIBDIR64) LDDBGLIBDIR = $(LDDBGLIBDIR64) CONVLIBDIR = $(CONVLIBDIR64) -VAR_SGSBINPROG= $(VAR_SGSBINPROG64) -VAR_SGSCCSLINK= $(VAR_SGSCCSLINK64) - VAR_LD_LLDFLAGS = \ $(VAR_LD_LLDFLAGS64) .KEEP_STATE: +package install: all $(VAR_SGSBINPROG64) $(VAR_SGSCCSLINK64) + include ../Makefile.targ include ../../Makefile.sub.64 diff --git a/usr/src/cmd/sgs/ldd/Makefile.com b/usr/src/cmd/sgs/ldd/Makefile.com index d3ec53655c..82621fe23e 100644 --- a/usr/src/cmd/sgs/ldd/Makefile.com +++ b/usr/src/cmd/sgs/ldd/Makefile.com @@ -34,20 +34,20 @@ include $(SRC)/cmd/sgs/Makefile.com COMOBJ= ldd.o BLTOBJ= msg.o -TOOLSOBJ= alist.o +SGSCOMMONOBJ= alist.o -OBJS= $(BLTOBJ) $(COMOBJ) $(TOOLSOBJ) +OBJS= $(BLTOBJ) $(COMOBJ) $(SGSCOMMONOBJ) MAPFILE= $(MAPFILE.NGB) MAPOPTS= $(MAPFILE:%=-M%) CPPFLAGS += -I. -I../../include -I../../include/$(MACH) \ - -I$(SRCBASE)/uts/$(ARCH)/sys \ + -I$(SRC)/uts/$(ARCH)/sys \ $(CPPFLAGS.master) LLDFLAGS = '-R$$ORIGIN/../../lib' LLDFLAGS64 = '-R$$ORIGIN/../../../lib/$(MACH64)' -LDFLAGS += $(VERSREF) $(CC_USE_PROTO) $(MAPOPTS) $(LLDFLAGS) -LDLIBS += $(CONVLIBDIR) $(CONV_LIB) -lelf $(DLLIB) +LDFLAGS += $(VERSREF) $(MAPOPTS) $(LLDFLAGS) +LDLIBS += $(CONVLIBDIR) -lconv -lelf SMOFF += or_vs_and @@ -63,6 +63,6 @@ SGSMSGALL= $(SGSMSGCOM) SGSMSGFLAGS += -h $(BLTDEFS) -d $(BLTDATA) -m $(BLTMESG) -n ldd_msg SRCS= $(COMOBJ:%.o=../common/%.c) $(BLTDATA) \ - $(TOOLSOBJ:%.o=$(SGSTOOLS)/common/%.c) + $(SGSCOMMONOBJ:%.o=$(SGSCOMMON)/%.c) CLEANFILES += $(BLTFILES) diff --git a/usr/src/cmd/sgs/ldd/Makefile.targ b/usr/src/cmd/sgs/ldd/Makefile.targ index c3e4f19649..12c24ab1bb 100644 --- a/usr/src/cmd/sgs/ldd/Makefile.targ +++ b/usr/src/cmd/sgs/ldd/Makefile.targ @@ -26,7 +26,7 @@ $(COMPILE.c) $< $(POST_PROCESS_O) -%.o: $(SGSTOOLS)/common/%.c +%.o: $(SGSCOMMON)/%.c $(COMPILE.c) $< $(POST_PROCESS_O) @@ -49,7 +49,6 @@ include $(SRC)/cmd/Makefile.targ include $(SRC)/cmd/sgs/Makefile.targ # Derived source and header files (messaging). - catalog: $(BLTMESG) chkmsg: $(SRCS) diff --git a/usr/src/cmd/sgs/ldprof/Makefile.com b/usr/src/cmd/sgs/ldprof/Makefile.com index 81c85b2251..577ffbbc74 100644 --- a/usr/src/cmd/sgs/ldprof/Makefile.com +++ b/usr/src/cmd/sgs/ldprof/Makefile.com @@ -38,14 +38,13 @@ ROOTLIBDIR= $(ROOT)/usr/lib/link_audit MAPFILES = ../common/mapfile-vers -DYNFLAGS += $(CC_USE_PROTO) CPPFLAGS= -I. -I../common -I../../include \ -I../../rtld/common \ -I../../include/$(MACH) \ - -I$(SRCBASE)/lib/libc/inc \ - -I$(SRCBASE)/uts/common/krtld \ + -I$(SRC)/lib/libc/inc \ + -I$(SRC)/uts/common/krtld \ -I$(SRC)/common/sgsrtcid \ - -I$(SRCBASE)/uts/$(ARCH)/sys \ + -I$(SRC)/uts/$(ARCH)/sys \ $(CPPFLAGS.master) -I$(ELFCAP) CFLAGS += $(C_PICFLAGS) diff --git a/usr/src/cmd/sgs/lex/Makefile.com b/usr/src/cmd/sgs/lex/Makefile.com index ea2224b2d0..9a24765ceb 100644 --- a/usr/src/cmd/sgs/lex/Makefile.com +++ b/usr/src/cmd/sgs/lex/Makefile.com @@ -76,7 +76,6 @@ objs/%_e.o:= DEFLIST = -DEUC -DJLSLEX -DEOPTION -D$*=$*_e pics/%_e.o:= DEFLIST = -DEUC -DJLSLEX -DEOPTION -D$*=$*_e CPPFLAGS= $(INCLIST) $(DEFLIST) $(CPPFLAGS.master) -BUILD.AR= $(AR) $(ARFLAGS) $@ `$(LORDER) $(OBJS) | $(TSORT)` $(ROOTPROG):= FILEMODE = 0555 diff --git a/usr/src/cmd/sgs/lex/Makefile.targ b/usr/src/cmd/sgs/lex/Makefile.targ index c4653c5d75..7755dd804b 100644 --- a/usr/src/cmd/sgs/lex/Makefile.targ +++ b/usr/src/cmd/sgs/lex/Makefile.targ @@ -60,10 +60,6 @@ $(ROOTLIBDIR64)/$(LIBLINKSCCC): $(ROOTLIBDIR64)/$(LIBLINKSCCC)$(VERS) objs pics: -@mkdir -p $@ -$(LIBRARY): objs .WAIT $$(OBJS) - $(BUILD.AR) - $(POST_PROCESS_A) - $(DYNLIB): pics .WAIT $$(PICS) $(BUILD.SO) $(POST_PROCESS_SO) diff --git a/usr/src/cmd/sgs/libconv/Makefile.com b/usr/src/cmd/sgs/libconv/Makefile.com index cfc99fce64..daffcfa01e 100644 --- a/usr/src/cmd/sgs/libconv/Makefile.com +++ b/usr/src/cmd/sgs/libconv/Makefile.com @@ -89,6 +89,8 @@ CTFMERGE_LIB = : include $(SRC)/lib/Makefile.lib include $(SRC)/cmd/sgs/Makefile.com +SRCDIR = $(SRC)/cmd/sgs/libconv + CERRWARN += -_gcc=-Wno-type-limits CERRWARN += -_gcc=-Wno-switch @@ -97,12 +99,12 @@ SMATCH=off CTFCONVERT_O= -README_REVISION=../../packages/common/readme_revision -ONLDREADME= ../../packages/common/SUNWonld-README +README_REVISION= $(SGSHOME)/tools/readme_revision +ONLDREADME= $(SGSHOME)/tools/SUNWonld-README PICS= $(OBJECTS:%=pics/%) -CPPFLAGS += -I$(SRCBASE)/lib/libc/inc -I$(ELFCAP) \ +CPPFLAGS += -I$(SRC)/lib/libc/inc -I$(ELFCAP) \ -I$(SRC)/common/sgsrtcid ARFLAGS= cr diff --git a/usr/src/cmd/sgs/libconv/Makefile.targ b/usr/src/cmd/sgs/libconv/Makefile.targ index 94d9cf3fdf..edb023a4a9 100644 --- a/usr/src/cmd/sgs/libconv/Makefile.targ +++ b/usr/src/cmd/sgs/libconv/Makefile.targ @@ -26,7 +26,7 @@ # Copyright 2019 OmniOS Community Edition (OmniOSce) Association. # -pics/%.o: ../common/%.c +pics/%.o: $(SRCDIR)/common/%.c $(COMPILE.c) -o $@ $< $(POST_PROCESS_O) @@ -34,11 +34,11 @@ pics/%.o: %.s $(COMPILE.s) -o $@ $< $(POST_PROCESS_O) -pics/%32.o: ../common/%.c +pics/%32.o: $(SRCDIR)/common/%.c $(COMPILE.c) -o $@ $< $(POST_PROCESS_O) -pics/%64.o: ../common/%.c +pics/%64.o: $(SRCDIR)/common/%.c $(COMPILE.c) -D_ELF64 -o $@ $< $(POST_PROCESS_O) @@ -55,27 +55,23 @@ pics/elfcap.o: $(ELFCAP)/elfcap.c # # We make this depend on Makefile.targ, because a change to Makefile.targ # can change the limit, in which case we want to force everything to rebuild. -report_bufsize.h: ../Makefile.targ - perl ../../tools/libconv_mk_report_bufsize.pl 8000 +report_bufsize.h: $(SRCDIR)/Makefile.targ + perl $(SRC)/cmd/sgs/tools/libconv_mk_report_bufsize.pl 8000 -../common/%.c ../common/%_machelf.c: %_msg.h +$(SRCDIR)/common/%.c $(SRCDIR)/common/%_machelf.c: %_msg.h -%_msg.h %_msg.c: $(SGSMSG) ../common/%.msg report_bufsize.h +%_msg.h + %_msg.c: $(SGSMSG) $(SRCDIR)/common/%.msg report_bufsize.h $(SGSMSG) $(SGSMSGFLAGS) -h $*_msg.h -d $*_msg.c \ -n sgs_msg_libconv_$* $< -$(SGSMSG): FRC - @ cd $(SGSTOOLS)/$(MACH); pwd; $(MAKE) catalog - @ pwd - vernote.s: bld_vernote $(README_REVISION) $(ONLDREADME) ./bld_vernote \ -R `perl $(README_REVISION) $(ONLDREADME)` \ -r "$(RELEASE)" -o $@ -bld_vernote: ../common/bld_vernote.ksh +bld_vernote: $(SRCDIR)/common/bld_vernote.ksh $(RM) -f $@ - cp ../common/bld_vernote.ksh $@ + cp $(SRCDIR)/common/bld_vernote.ksh $@ chmod a+x $@ $(LIBRARY): pics $$(PICS) @@ -89,7 +85,7 @@ chkmsg: $(MSGSRCS) catalog: pics: - -@mkdir -p $@ + $(MKDIR) -p $@ clobber: clean -$(RM) $(LIBRARY) $(CLOBBERFILES) diff --git a/usr/src/cmd/sgs/libcrle/Makefile.com b/usr/src/cmd/sgs/libcrle/Makefile.com index 92904198aa..c77dfa9500 100644 --- a/usr/src/cmd/sgs/libcrle/Makefile.com +++ b/usr/src/cmd/sgs/libcrle/Makefile.com @@ -42,8 +42,8 @@ SRCDIR = ../common LDLIBS += $(ZRECORD) -lmapmalloc $(DLLIB) -lc -CPPFLAGS += -I$(SRCBASE)/lib/libc/inc -I$(SRC)/common/sgsrtcid -DYNFLAGS += $(VERSREF) $(CONVLIBDIR) -lconv $(CC_USE_PROTO) +CPPFLAGS += -I$(SRC)/lib/libc/inc -I$(SRC)/common/sgsrtcid +DYNFLAGS += $(VERSREF) $(CONVLIBDIR) -lconv BLTDEFS= msg.h BLTDATA= msg.c diff --git a/usr/src/cmd/sgs/libelf/Makefile.com b/usr/src/cmd/sgs/libelf/Makefile.com index 35df043a20..7791333dc6 100644 --- a/usr/src/cmd/sgs/libelf/Makefile.com +++ b/usr/src/cmd/sgs/libelf/Makefile.com @@ -52,39 +52,36 @@ OBJECTS= $(BLTOBJS) $(MACHOBJS) $(COMOBJS) $(CLASSOBJS) $(MISCOBJS) include $(SRC)/lib/Makefile.lib +SRCDIR= $(SRC)/cmd/sgs/libelf + # Use the value of M4 set in Makefile.master via Makefile.lib DEMOFILES= Makefile 00README acom.c dcom.c \ pcom.c tpcom.c dispsyms.c -DEMOFILESRCDIR= ../demo +DEMOFILESRCDIR= $(SRCDIR)/demo ROOTDEMODIRBASE=$(ROOT)/usr/demo/ELF ROOTDEMODIRS= $(ROOTDEMODIRBASE) include $(SRC)/cmd/sgs/Makefile.com -MAPFILES = ../common/mapfile-vers +MAPFILES = $(SRCDIR)/common/mapfile-vers DYNFLAGS += $(VERSREF) -LDLIBS += $(CONVLIBDIR) $(CONV_LIB) -lc +LDLIBS += $(CONVLIBDIR) -lconv -lc CERRWARN += -_gcc=-Wno-parentheses CERRWARN += $(CNOWARN_UNINIT) SMOFF += indenting -BUILD.AR= $(RM) $@ ; \ - $(AR) q $@ `$(LORDER) $(OBJECTS:%=$(DIR)/%)| $(TSORT)` - $(POST_PROCESS_A) - - BLTDEFS= msg.h BLTDATA= msg.c BLTMESG= $(SGSMSGDIR)/libelf BLTFILES= $(BLTDEFS) $(BLTDATA) $(BLTMESG) -SGSMSGCOM= ../common/libelf.msg -SGSMSG32= ../common/libelf.32.msg +SGSMSGCOM= $(SRCDIR)/common/libelf.msg +SGSMSG32= $(SRCDIR)/common/libelf.32.msg SGSMSGTARG= $(SGSMSGCOM) SGSMSGALL= $(SGSMSGCOM) $(SGSMSG32) @@ -92,7 +89,7 @@ SGSMSGFLAGS1= $(SGSMSGFLAGS) -m $(BLTMESG) SGSMSGFLAGS2= $(SGSMSGFLAGS) -h $(BLTDEFS) -d $(BLTDATA) -n libelf_msg BLTSRCS= $(BLTOBJS:%.o=%.c) -LIBSRCS= $(COMOBJS:%.o=../common/%.c) $(MISCOBJS:%.o=../misc/%.c) \ +LIBSRCS= $(COMOBJS:%.o=$(SRCDIR)/common/%.c) $(MISCOBJS:%.o=$(SRCDIR)/misc/%.c) \ $(MACHOBJS:%.o=%.c) $(BLTSRCS) ROOTFS_DYNLIB= $(DYNLIB:%=$(ROOTFS_LIBDIR)/%) diff --git a/usr/src/cmd/sgs/libelf/Makefile.targ b/usr/src/cmd/sgs/libelf/Makefile.targ index 7fd082fb9f..3db0b17918 100644 --- a/usr/src/cmd/sgs/libelf/Makefile.targ +++ b/usr/src/cmd/sgs/libelf/Makefile.targ @@ -30,25 +30,22 @@ pics/%.o: %.c $(POST_PROCESS_O) objs/%64.o \ -pics/%64.o: ../common/%.c +pics/%64.o: $(SRCDIR)/common/%.c $(COMPILE.c) -D_ELF64 -o $@ $< $(POST_PROCESS_O) objs/%.o \ -pics/%.o: ../misc/%.c +pics/%.o: $(SRCDIR)/misc/%.c $(COMPILE.c) -DELF -o $@ $< $(POST_PROCESS_O) objs/%.o \ -pics/%.o: ../common/%.c +pics/%.o: $(SRCDIR)/common/%.c $(COMPILE.c) -o $@ $< $(POST_PROCESS_O) all: $(BLTSRCS) .WAIT $(LIBS) $(LIBLINKS) -install: all .WAIT $(ROOTFS_LIBS) $(ROOTFS_LINKS) \ - .WAIT $(ROOTDEMODIRS) .WAIT $(ROOTDEMOFILES) - delete: $(RM) $(DYNLIB) @@ -63,11 +60,11 @@ CLOBBERFILES += $(LIBLINKS) include $(SRC)/lib/Makefile.targ include $(SRC)/cmd/sgs/Makefile.targ -xlate.c: ../common/xlate.m4 - $(M4) < ../common/xlate.m4 > xlate.c +xlate.c: $(SRCDIR)/common/xlate.m4 + $(M4) < $(SRCDIR)/common/xlate.m4 > xlate.c -xlate64.c: ../common/xlate64.m4 - $(M4) < ../common/xlate64.m4 > xlate64.c +xlate64.c: $(SRCDIR)/common/xlate64.m4 + $(M4) < $(SRCDIR)/common/xlate64.m4 > xlate64.c objs/msg.o \ @@ -82,22 +79,8 @@ pics/ar.o: msg.h objs/xlate.o \ pics/xlate.o: xlate.c -# Special target for native builds (ie. when we need to build a version of ld -# to build a version of ld :-). - -native: $(SGSLIBDIR)/$(LIBLINKS) - $(PICS): pics -$(SGSLIBDIR)/$(DYNLIB): $(PICS) $(SGSLIBDIR) - $(BUILD.SO) - $(POST_PROCESS_SO) - -$(SGSLIBDIR)/$(LIBLINKS): $(SGSLIBDIR)/$(DYNLIB) - -@$(RM) $(SGSLIBDIR)/$(LIBLINKS) - $(SYMLINK) $(DYNLIB) $(SGSLIBDIR)/$(LIBLINKS) - - # Derived source and header files (messaging). Make sure that the sgsmsg # command is constructed - libelf might not be built with the whole sgs. @@ -107,14 +90,10 @@ chkmsg: $(LIBSRCS) sh $(CHKMSG) $(CHKMSGFLAGS) $(LIBSRCS) $(BLTDEFS) + \ -$(BLTDATA): $(SGSMSG) $(SGSMSGTARG) +$(BLTDATA): $(SGSMSGTARG) $(SGSMSG) $(SGSMSGFLAGS2) $(SGSMSGTARG) -$(BLTMESG): $(SGSMSG) $(SGSMSGALL) xlate.c xlate64.c +$(BLTMESG): $(SGSMSGALL) xlate.c xlate64.c $(SGSMSG) $(SGSMSGFLAGS1) $(SGSMSGALL) -$(SGSMSG): FRC - @ cd $(SGSTOOLS)/$(MACH); pwd; $(MAKE) catalog - @ pwd - FRC: diff --git a/usr/src/cmd/sgs/libelf/Makefile.targ.64 b/usr/src/cmd/sgs/libelf/Makefile.targ.64 index 058ceace4c..7cc82d9fa9 100644 --- a/usr/src/cmd/sgs/libelf/Makefile.targ.64 +++ b/usr/src/cmd/sgs/libelf/Makefile.targ.64 @@ -45,8 +45,6 @@ pics/%.o: ../common/%.c all: $(BLTSRCS) .WAIT $(LIBS) $(LIBLINKS) -install: all .WAIT $(ROOTFS_LIBS64) $(ROOTFS_LINKS64) - delete: $(RM) $(DYNLIB) @@ -89,16 +87,12 @@ chkmsg: $(LIBSRCS) sh $(CHKMSG) $(CHKMSGFLAGS) $(LIBSRCS) $(BLTDEFS) + \ -$(BLTDATA): $(SGSMSG) $(SGSMSGTARG) +$(BLTDATA): $(SGSMSGTARG) $(SGSMSG) $(SGSMSGFLAGS2) $(SGSMSGTARG) -$(BLTMESG): $(SGSMSG) $(SGSMSGALL) xlate.c xlate64.c +$(BLTMESG): $(SGSMSGALL) xlate.c xlate64.c $(SGSMSG) $(SGSMSGFLAGS1) $(SGSMSGALL) -$(SGSMSG): FRC - @ cd $(SGSTOOLS)/$(MACH); pwd; $(MAKE) catalog - @ pwd - # # 64-bit overrides # diff --git a/usr/src/cmd/sgs/libelf/amd64/Makefile b/usr/src/cmd/sgs/libelf/amd64/Makefile index 99651ac38b..94251398d8 100644 --- a/usr/src/cmd/sgs/libelf/amd64/Makefile +++ b/usr/src/cmd/sgs/libelf/amd64/Makefile @@ -34,4 +34,6 @@ MISCOBJS= $(MISCOBJS64) .KEEP_STATE: +install: all .WAIT $(ROOTFS_LIBS64) $(ROOTFS_LINKS64) + include ../Makefile.targ.64 diff --git a/usr/src/cmd/sgs/libelf/i386/Makefile b/usr/src/cmd/sgs/libelf/i386/Makefile index be3bf8ab80..a14fcadcdb 100644 --- a/usr/src/cmd/sgs/libelf/i386/Makefile +++ b/usr/src/cmd/sgs/libelf/i386/Makefile @@ -29,4 +29,7 @@ SGSMSGTARG += $(SGSMSG32) .KEEP_STATE: +install: all .WAIT $(ROOTFS_LIBS) $(ROOTFS_LINKS) \ + .WAIT $(ROOTDEMODIRS) .WAIT $(ROOTDEMOFILES) + include ../Makefile.targ diff --git a/usr/src/cmd/sgs/libelf/sparc/Makefile b/usr/src/cmd/sgs/libelf/sparc/Makefile index 0cdef9272f..f5e39a6940 100644 --- a/usr/src/cmd/sgs/libelf/sparc/Makefile +++ b/usr/src/cmd/sgs/libelf/sparc/Makefile @@ -29,4 +29,7 @@ SGSMSGTARG += $(SGSMSG32) .KEEP_STATE: +install: all .WAIT $(ROOTFS_LIBS) $(ROOTFS_LINKS) \ + .WAIT $(ROOTDEMODIRS) .WAIT $(ROOTDEMOFILES) + include ../Makefile.targ diff --git a/usr/src/cmd/sgs/libelf/sparcv9/Makefile b/usr/src/cmd/sgs/libelf/sparcv9/Makefile index 99651ac38b..94251398d8 100644 --- a/usr/src/cmd/sgs/libelf/sparcv9/Makefile +++ b/usr/src/cmd/sgs/libelf/sparcv9/Makefile @@ -34,4 +34,6 @@ MISCOBJS= $(MISCOBJS64) .KEEP_STATE: +install: all .WAIT $(ROOTFS_LIBS64) $(ROOTFS_LINKS64) + include ../Makefile.targ.64 diff --git a/usr/src/cmd/sgs/libld/Makefile.com b/usr/src/cmd/sgs/libld/Makefile.com index c85abded8f..f471b398bf 100644 --- a/usr/src/cmd/sgs/libld/Makefile.com +++ b/usr/src/cmd/sgs/libld/Makefile.com @@ -47,7 +47,7 @@ COMOBJS64 = args64.o entry64.o exit64.o groups64.o \ sunwmove64.o support64.o syms64.o update64.o \ unwind64.o version64.o wrap64.o -TOOLOBJS = alist.o assfail.o findprime.o string_table.o \ +SGSCOMMONOBJ = alist.o assfail.o findprime.o string_table.o \ strhash.o AVLOBJ = avl.o @@ -60,13 +60,13 @@ L_SPARC_MACHOBJS32 = machrel.sparc32.o machsym.sparc32.o L_SPARC_MACHOBJS64 = machrel.sparc64.o machsym.sparc64.o # Target specific objects (i386/amd64) -E_X86_TOOLOBJS = leb128.o +E_X86_COMMONOBJ = leb128.o L_X86_MACHOBJS32 = machrel.intel32.o L_X86_MACHOBJS64 = machrel.amd64.o # All target specific objects rolled together -E_TOOLOBJS = $(E_SPARC_TOOLOBJS) \ - $(E_X86_TOOLOBJS) +E_COMMONOBJ = $(E_SPARC_COMMONOBJ) \ + $(E_X86_COMMONOBJ) L_MACHOBJS32 = $(L_SPARC_MACHOBJS32) \ $(L_X86_MACHOBJS32) L_MACHOBJS64 = $(L_SPARC_MACHOBJS64) \ @@ -79,12 +79,13 @@ ELFCAPOBJ = elfcap.o OBJECTS = $(BLTOBJ) $(G_MACHOBJS32) $(G_MACHOBJS64) \ $(L_MACHOBJS32) $(L_MACHOBJS64) \ $(COMOBJS) $(COMOBJS32) $(COMOBJS64) \ - $(TOOLOBJS) $(E_TOOLOBJS) $(AVLOBJ) $(ELFCAPOBJ) + $(SGSCOMMONOBJ) $(E_COMMONOBJ) $(AVLOBJ) $(ELFCAPOBJ) include $(SRC)/lib/Makefile.lib include $(SRC)/cmd/sgs/Makefile.com -SRCDIR = ../common +SRCDIR = $(SGSHOME)/libld +MAPFILEDIR = $(SRCDIR)/common CERRWARN += -_gcc=-Wno-unused-value CERRWARN += -_gcc=-Wno-parentheses @@ -98,20 +99,18 @@ SMOFF += no_if_block # Location of the shared relocation engines maintained under usr/src/uts. # -KRTLD_I386 = $(SRCBASE)/uts/$(VAR_PLAT_i386)/krtld -KRTLD_AMD64 = $(SRCBASE)/uts/$(VAR_PLAT_amd64)/krtld -KRTLD_SPARC = $(SRCBASE)/uts/$(VAR_PLAT_sparc)/krtld +KRTLD_I386 = $(SRC)/uts/$(VAR_PLAT_i386)/krtld +KRTLD_AMD64 = $(SRC)/uts/$(VAR_PLAT_amd64)/krtld +KRTLD_SPARC = $(SRC)/uts/$(VAR_PLAT_sparc)/krtld -CPPFLAGS += -DUSE_LIBLD_MALLOC -I$(SRCBASE)/lib/libc/inc \ - -I$(SRCBASE)/uts/common/krtld -I$(SRCBASE)/uts/sparc \ +CPPFLAGS += -DUSE_LIBLD_MALLOC -I$(SRC)/lib/libc/inc \ + -I$(SRC)/uts/common/krtld -I$(SRC)/uts/sparc \ $(VAR_LIBLD_CPPFLAGS) -LDLIBS += $(CONVLIBDIR) $(CONV_LIB) $(LDDBGLIBDIR) $(LDDBG_LIB) \ +LDLIBS += $(CONVLIBDIR) -lconv $(LDDBGLIBDIR) -llddbg \ $(ELFLIBDIR) -lelf $(DLLIB) -lc -DYNFLAGS += $(VERSREF) $(CC_USE_PROTO) '-R$$ORIGIN' - -native:= DYNFLAGS += $(CONVLIBDIR) +DYNFLAGS += $(VERSREF) '-R$$ORIGIN' # too hairy pics/sections32.o := SMATCH=off @@ -127,26 +126,26 @@ BLTFILES = $(BLTDEFS) $(BLTDATA) $(BLTMESG) # However, we keep target specific messages in their own separate files for # organizational reasons. # -SGSMSGCOM = ../common/libld.msg -SGSMSGSPARC = ../common/libld.sparc.msg -SGSMSGINTEL = ../common/libld.intel.msg +SGSMSGCOM = $(SRCDIR)/common/libld.msg +SGSMSGSPARC = $(SRCDIR)/common/libld.sparc.msg +SGSMSGINTEL = $(SRCDIR)/common/libld.intel.msg SGSMSGTARG = $(SGSMSGCOM) $(SGSMSGSPARC) $(SGSMSGINTEL) SGSMSGALL = $(SGSMSGCOM) $(SGSMSGSPARC) $(SGSMSGINTEL) SGSMSGFLAGS1 = $(SGSMSGFLAGS) -m $(BLTMESG) SGSMSGFLAGS2 = $(SGSMSGFLAGS) -h $(BLTDEFS) -d $(BLTDATA) -n libld_msg -CHKSRCS = $(SRCBASE)/uts/common/krtld/reloc.h \ - $(COMOBJS32:%32.o=../common/%.c) \ - $(L_MACHOBJS32:%32.o=../common/%.c) \ - $(L_MACHOBJS64:%64.o=../common/%.c) \ +CHKSRCS = $(SRC)/uts/common/krtld/reloc.h \ + $(COMOBJS32:%32.o=$(SRCDIR)/common/%.c) \ + $(L_MACHOBJS32:%32.o=$(SRCDIR)/common/%.c) \ + $(L_MACHOBJS64:%64.o=$(SRCDIR)/common/%.c) \ $(KRTLD_I386)/doreloc.c \ $(KRTLD_AMD64)/doreloc.c \ $(KRTLD_SPARC)/doreloc.c -LIBSRCS = $(TOOLOBJS:%.o=$(SGSTOOLS)/common/%.c) \ - $(E_TOOLOBJS:%.o=$(SGSTOOLS)/common/%.c) \ - $(COMOBJS:%.o=../common/%.c) \ +LIBSRCS = $(SGSCOMMONOBJ:%.o=$(SGSCOMMON)/%.c) \ + $(SGSCOMMONOBJ:%.o=$(SGSCOMMON)/%.c) \ + $(COMOBJS:%.o=$(SRCDIR)/common/%.c) \ $(AVLOBJS:%.o=$(VAR_AVLDIR)/%.c) \ $(BLTDATA) diff --git a/usr/src/cmd/sgs/libld/Makefile.targ b/usr/src/cmd/sgs/libld/Makefile.targ index f48f6fcd56..69e53f79c9 100644 --- a/usr/src/cmd/sgs/libld/Makefile.targ +++ b/usr/src/cmd/sgs/libld/Makefile.targ @@ -26,15 +26,15 @@ # Copyright 2019 OmniOS Community Edition (OmniOSce) Association. # -pics/%.o: ../common/%.c +pics/%.o: $(SRCDIR)/common/%.c $(COMPILE.c) -o $@ $< $(POST_PROCESS_O) -pics/%32.o: ../common/%.c +pics/%32.o: $(SRCDIR)/common/%.c $(COMPILE.c) -o $@ $< $(POST_PROCESS_O) -pics/%64.o: ../common/%.c +pics/%64.o: $(SRCDIR)/common/%.c $(COMPILE.c) -o $@ -D_ELF64 $< $(POST_PROCESS_O) @@ -46,7 +46,7 @@ pics/%64.o: %.c $(COMPILE.c) -o $@ -D_ELF64 $< $(POST_PROCESS_O) -pics/%.o: $(SGSTOOLS)/common/%.c +pics/%.o: $(SGSCOMMON)/%.c $(COMPILE.c) -o $@ $< $(POST_PROCESS_O) @@ -94,21 +94,8 @@ $(LIBLINKS): delete: $(RM) $(DYNLIB) -# Special target for native builds (ie. when we need to build a version of ld -# to build a version of ld :-). - -native: $(SGSLIBDIR)/$(LIBLINKS) - $(PICS): pics -$(SGSLIBDIR)/$(DYNLIB): $(PICS) $(SGSLIBDIR) - $(BUILD.SO) - $(POST_PROCESS_SO) - -$(SGSLIBDIR)/$(LIBLINKS): $(SGSLIBDIR)/$(DYNLIB) - @$(RM) $(SGSLIBDIR)/$(LIBLINKS) - $(SYMLINK) $(DYNLIB) $(SGSLIBDIR)/$(LIBLINKS) - include $(SRC)/lib/Makefile.targ include $(SRC)/cmd/sgs/Makefile.targ diff --git a/usr/src/cmd/sgs/liblddbg/Makefile.com b/usr/src/cmd/sgs/liblddbg/Makefile.com index 76e161501f..c4b9f9d6db 100644 --- a/usr/src/cmd/sgs/liblddbg/Makefile.com +++ b/usr/src/cmd/sgs/liblddbg/Makefile.com @@ -47,26 +47,24 @@ COMOBJS64 = bindings64.o cap64.o dlfcns64.o dynamic64.o \ BLTOBJ = msg.o -TOOLOBJ = alist.o +SGSCOMMONOBJ = alist.o -OBJECTS = $(BLTOBJ) $(COMOBJS) $(COMOBJS32) $(COMOBJS64) $(TOOLOBJ) +OBJECTS = $(BLTOBJ) $(COMOBJS) $(COMOBJS32) $(COMOBJS64) $(SGSCOMMONOBJ) include $(SRC)/lib/Makefile.lib include $(SRC)/cmd/sgs/Makefile.com -SRCDIR = ../common +SRCDIR = $(SGSHOME)/liblddbg +MAPFILEDIR = $(SRCDIR)/common CERRWARN += -_gcc=-Wno-unused-value CERRWARN += $(CNOWARN_UNINIT) CERRWARN += -_gcc=-Wno-parentheses -CPPFLAGS += -I$(SRCBASE)/lib/libc/inc -DYNFLAGS += $(VERSREF) $(CC_USE_PROTO) '-R$$ORIGIN' -LDLIBS += $(CONVLIBDIR) $(CONV_LIB) -lc - -native := DYNFLAGS += $(CONVLIBDIR) -native := CPPFLAGS += -DNATIVE_BUILD +CPPFLAGS += -I$(SRC)/lib/libc/inc +DYNFLAGS += $(VERSREF) '-R$$ORIGIN' +LDLIBS += $(CONVLIBDIR) -lconv -lc BLTDEFS = msg.h BLTDATA = msg.c @@ -74,15 +72,15 @@ BLTMESG = $(SGSMSGDIR)/liblddbg BLTFILES = $(BLTDEFS) $(BLTDATA) $(BLTMESG) -SGSMSGCOM = ../common/liblddbg.msg +SGSMSGCOM = $(SRCDIR)/common/liblddbg.msg SGSMSGALL = $(SGSMSGCOM) SGSMSGTARG = $(SGSMSGCOM) SGSMSGFLAGS += -h $(BLTDEFS) -d $(BLTDATA) -m $(BLTMESG) -n liblddbg_msg -CHKSRCS = $(COMOBJS32:%32.o=../common/%.c) +CHKSRCS = $(COMOBJS32:%32.o=$(SRCDIR)/common/%.c) -LIBSRCS = $(COMOBJS:%.o=../common/%.c) \ - $(TOOLOBJ:%.o=$(SGSTOOLS)/common/%.c) $(BLTDATA) +LIBSRCS = $(COMOBJS:%.o=$(SRCDIR)/common/%.c) \ + $(SGSCOMMONOBJ:%.o=$(SGSCOMMON)/%.c) $(BLTDATA) CLEANFILES += $(BLTFILES) CLOBBERFILES += $(DYNLIB) $(LIBLINKS) diff --git a/usr/src/cmd/sgs/liblddbg/Makefile.targ b/usr/src/cmd/sgs/liblddbg/Makefile.targ index 30fb79e62a..7eb4895306 100644 --- a/usr/src/cmd/sgs/liblddbg/Makefile.targ +++ b/usr/src/cmd/sgs/liblddbg/Makefile.targ @@ -26,19 +26,19 @@ # Copyright 2019 OmniOS Community Edition (OmniOSce) Association. # -pics/%.o: ../common/%.c +pics/%.o: $(SRCDIR)/common/%.c $(COMPILE.c) -o $@ $< $(POST_PROCESS_O) -pics/%.o: $(SGSTOOLS)/common/%.c +pics/%.o: $(SGSCOMMON)/%.c $(COMPILE.c) -o $@ $< $(POST_PROCESS_O) -pics/%32.o: ../common/%.c +pics/%32.o: $(SRCDIR)/common/%.c $(COMPILE.c) -o $@ $< $(POST_PROCESS_O) -pics/%64.o: ../common/%.c +pics/%64.o: $(SRCDIR)/common/%.c $(COMPILE.c) -D_ELF64 -o $@ $< $(POST_PROCESS_O) @@ -48,21 +48,8 @@ $(LIBLINKS): delete: $(RM) $(DYNLIB) -# Special target for native builds (ie. when we need to build a version of ld -# to build a version of ld :-). - -native: $(SGSLIBDIR)/$(LIBLINKS) - $(PICS): pics -$(SGSLIBDIR)/$(DYNLIB): $(PICS) $(SGSLIBDIR) - $(BUILD.SO) - $(POST_PROCESS_SO) - -$(SGSLIBDIR)/$(LIBLINKS): $(SGSLIBDIR)/$(DYNLIB) - -@$(RM) $(SGSLIBDIR)/$(LIBLINKS) - $(SYMLINK) $(DYNLIB) $(SGSLIBDIR)/$(LIBLINKS) - include $(SRC)/lib/Makefile.targ include $(SRC)/cmd/sgs/Makefile.targ diff --git a/usr/src/cmd/sgs/libldmake/Makefile.com b/usr/src/cmd/sgs/libldmake/Makefile.com index 76a89e0dfb..ff9ead0b9c 100644 --- a/usr/src/cmd/sgs/libldmake/Makefile.com +++ b/usr/src/cmd/sgs/libldmake/Makefile.com @@ -38,8 +38,6 @@ ROOTLIBDIR64= $(ROOT)/opt/SUNWonld/lib/$(MACH64) SRCDIR = ../common -DYNFLAGS += $(CC_USE_PROTO) - CFLAGS += $(C_PICFLAGS) CFLAGS64 += $(C_PICFLAGS64) diff --git a/usr/src/cmd/sgs/libldstab/Makefile.com b/usr/src/cmd/sgs/libldstab/Makefile.com index 16e3817397..6eed5d6349 100644 --- a/usr/src/cmd/sgs/libldstab/Makefile.com +++ b/usr/src/cmd/sgs/libldstab/Makefile.com @@ -38,12 +38,11 @@ include $(SRC)/lib/Makefile.lib include $(SRC)/cmd/sgs/Makefile.com SRCDIR = ../common -SRCBASE= ../../../.. CPPFLAGS += -I$(ELFCAP) -LDLIBS += $(CONVLIBDIR) $(CONV_LIB) $(ELFLIBDIR) -lelf -lc -DYNFLAGS += $(VERSREF) $(CC_USE_PROTO) +LDLIBS += $(CONVLIBDIR) -lconv $(ELFLIBDIR) -lelf -lc +DYNFLAGS += $(VERSREF) SRCS= $(COMOBJS:%.o=../common/%.c) diff --git a/usr/src/cmd/sgs/libldstab/Makefile.targ b/usr/src/cmd/sgs/libldstab/Makefile.targ index 490a987356..6fc36576c9 100644 --- a/usr/src/cmd/sgs/libldstab/Makefile.targ +++ b/usr/src/cmd/sgs/libldstab/Makefile.targ @@ -37,17 +37,8 @@ pics/%64.o: ../common/%.c delete: -$(RM) $(DYNLIB) -# Special target for native builds (ie. when we need to build a version of ld -# to build a version of ld :-). - -native: $(SGSLIBDIR)/$(DYNLIB) - $(PICS): pics -$(SGSLIBDIR)/$(DYNLIB): $(PICS) $(SGSLIBDIR) - $(BUILD.SO) - $(POST_PROCESS_SO) - include $(SRC)/lib/Makefile.targ include $(SRC)/cmd/sgs/Makefile.targ diff --git a/usr/src/cmd/sgs/librtld/Makefile.com b/usr/src/cmd/sgs/librtld/Makefile.com index bc6772751e..e15980f956 100644 --- a/usr/src/cmd/sgs/librtld/Makefile.com +++ b/usr/src/cmd/sgs/librtld/Makefile.com @@ -41,11 +41,11 @@ include $(SRC)/lib/Makefile.lib include $(SRC)/cmd/sgs/Makefile.com SRCDIR = ../common -CPPFLAGS += -I../../rtld/common -I$(SRCBASE)/lib/libc/inc \ - -I$(SRCBASE)/uts/common/krtld -I$(SRC)/common/sgsrtcid \ - -I$(SRCBASE)/uts/sparc -DYNFLAGS += $(VERSREF) $(CC_USE_PROTO) '-R$$ORIGIN' -LDLIBS += $(CONVLIBDIR) $(CONV_LIB) $(ELFLIBDIR) -lelf -lc +CPPFLAGS += -I../../rtld/common -I$(SRC)/lib/libc/inc \ + -I$(SRC)/uts/common/krtld -I$(SRC)/common/sgsrtcid \ + -I$(SRC)/uts/sparc +DYNFLAGS += $(VERSREF) '-R$$ORIGIN' +LDLIBS += $(CONVLIBDIR) -lconv $(ELFLIBDIR) -lelf -lc CERRWARN += -_gcc=-Wno-parentheses CERRWARN += -_gcc=-Wno-unused-value diff --git a/usr/src/cmd/sgs/librtld/Makefile.targ b/usr/src/cmd/sgs/librtld/Makefile.targ index 7747934999..9b56ae1ab7 100644 --- a/usr/src/cmd/sgs/librtld/Makefile.targ +++ b/usr/src/cmd/sgs/librtld/Makefile.targ @@ -36,20 +36,8 @@ $(LIBLINKS): delete: $(RM) $(DYNLIB) -# Special target for native builds (ie. when we need to build a version of ld -# to build a version of ld :-). - -native: $(SGSLIBDIR)/$(LIBLINKS) - $(PICS): pics -$(SGSLIBDIR)/$(DYNLIB): $(PICS) $(SGSLIBDIR) - $(BUILD.SO) - $(POST_PROCESS_SO) - -$(SGSLIBDIR)/$(LIBLINKS): $(SGSLIBDIR)/$(DYNLIB) - -@$(RM) $(SGSLIBDIR)/$(LIBLINKS) - $(SYMLINK) $(DYNLIB) $(SGSLIBDIR)/$(LIBLINKS) include $(SRC)/lib/Makefile.targ include $(SRC)/cmd/sgs/Makefile.targ diff --git a/usr/src/cmd/sgs/librtld_db/Makefile.com b/usr/src/cmd/sgs/librtld_db/Makefile.com index 13ce445558..2d7b9093c3 100644 --- a/usr/src/cmd/sgs/librtld_db/Makefile.com +++ b/usr/src/cmd/sgs/librtld_db/Makefile.com @@ -36,9 +36,9 @@ include $(SRC)/cmd/sgs/Makefile.com SRCDIR = ../common -CPPFLAGS += -I$(SRCBASE)/lib/libc/inc +CPPFLAGS += -I$(SRC)/lib/libc/inc DYNFLAGS += $(VERSREF) -LDLIBS += $(CONVLIBDIR) $(CONV_LIB) -lc +LDLIBS += $(CONVLIBDIR) -lconv -lc CERRWARN += $(CNOWARN_UNINIT) diff --git a/usr/src/cmd/sgs/librtld_db/demo/Makefile b/usr/src/cmd/sgs/librtld_db/demo/Makefile index abb486b6b7..f61bf6796b 100644 --- a/usr/src/cmd/sgs/librtld_db/demo/Makefile +++ b/usr/src/cmd/sgs/librtld_db/demo/Makefile @@ -23,6 +23,7 @@ # include $(SRC)/Makefile.master +include $(SRC)/cmd/sgs/Makefile.sub MACHDEMOFILES= \ i386/regs.c \ diff --git a/usr/src/cmd/sgs/librtld_db/demo/Makefile.com b/usr/src/cmd/sgs/librtld_db/demo/Makefile.com index 5b5b663b9e..391c1a30cb 100644 --- a/usr/src/cmd/sgs/librtld_db/demo/Makefile.com +++ b/usr/src/cmd/sgs/librtld_db/demo/Makefile.com @@ -62,6 +62,7 @@ CLEANFILES += $(BLTSRC) $(BLTHDR) simp libsub.so.1 CERRWARN += -_gcc=-Wno-parentheses CERRWARN += -_gcc=-Wno-unused-label CERRWARN += -_gcc=-Wno-unused-variable +SMOFF += buffer_too_small_for_struct # DEMO DELETE END test-sparc= test-sparc-regs diff --git a/usr/src/cmd/sgs/librtld_db/demo/Makefile.targ b/usr/src/cmd/sgs/librtld_db/demo/Makefile.targ index 70a87bb949..82de1a0deb 100644 --- a/usr/src/cmd/sgs/librtld_db/demo/Makefile.targ +++ b/usr/src/cmd/sgs/librtld_db/demo/Makefile.targ @@ -31,10 +31,17 @@ $(OBJDIR)/%.o: ../common/%.c $(POST_PROCESS_O) # DEMO DELETE START -$(ROOTONLDBIN)/%: % + +$(ROOTONLDBIN): + $(INS.dir) + +$(ROOTONLDBIN)/$(MACH64): + $(INS.dir) + +$(ROOTONLDBIN)/%: % $(ROOTONLDBIN) $(INS.file) -$(ROOTONLDBIN)/$(MACH64)/%: % +$(ROOTONLDBIN)/$(MACH64)/%: % $(ROOTONLDBIN)/$(MACH64) $(INS.file) # DEMO DELETE END @@ -92,6 +99,10 @@ clean: FRC clobber: clean FRC $(RM) $(PROG) +# DEMO DELETE START +catalog check chkmsg: +# DEMO DELETE END + FRC: # DEMO DELETE START diff --git a/usr/src/cmd/sgs/librtld_db/demo/amd64/Makefile b/usr/src/cmd/sgs/librtld_db/demo/amd64/Makefile index 7cabf2ea7b..1428252d8b 100644 --- a/usr/src/cmd/sgs/librtld_db/demo/amd64/Makefile +++ b/usr/src/cmd/sgs/librtld_db/demo/amd64/Makefile @@ -48,6 +48,8 @@ test: $(TESTS) # DEMO DELETE START DEMOCFLAGS= +catalog: + install: all $(ROOTONLDBINPROG64) # DEMO DELETE END diff --git a/usr/src/cmd/sgs/librtld_db/demo/i386/Makefile b/usr/src/cmd/sgs/librtld_db/demo/i386/Makefile index da1bcc7f0e..1112eb1ca3 100644 --- a/usr/src/cmd/sgs/librtld_db/demo/i386/Makefile +++ b/usr/src/cmd/sgs/librtld_db/demo/i386/Makefile @@ -33,6 +33,8 @@ all: $(OBJDIR) .WAIT $(PROG) test: $(TESTS) # DEMO DELETE START +catalog: + install: all $(ROOTONLDBINPROG) # DEMO DELETE END diff --git a/usr/src/cmd/sgs/librtld_db/demo/sparc/Makefile b/usr/src/cmd/sgs/librtld_db/demo/sparc/Makefile index da1bcc7f0e..1112eb1ca3 100644 --- a/usr/src/cmd/sgs/librtld_db/demo/sparc/Makefile +++ b/usr/src/cmd/sgs/librtld_db/demo/sparc/Makefile @@ -33,6 +33,8 @@ all: $(OBJDIR) .WAIT $(PROG) test: $(TESTS) # DEMO DELETE START +catalog: + install: all $(ROOTONLDBINPROG) # DEMO DELETE END diff --git a/usr/src/cmd/sgs/librtld_db/demo/sparcv9/Makefile b/usr/src/cmd/sgs/librtld_db/demo/sparcv9/Makefile index bfb094260f..b1b3f38d32 100644 --- a/usr/src/cmd/sgs/librtld_db/demo/sparcv9/Makefile +++ b/usr/src/cmd/sgs/librtld_db/demo/sparcv9/Makefile @@ -48,6 +48,8 @@ test: $(TESTS) # DEMO DELETE START DEMOCFLAGS= +catalog: + install: all $(ROOTONLDBINPROG64) # DEMO DELETE END diff --git a/usr/src/cmd/sgs/link_audit/Makefile.com b/usr/src/cmd/sgs/link_audit/Makefile.com index d02c71dc4f..1d122e8f8f 100644 --- a/usr/src/cmd/sgs/link_audit/Makefile.com +++ b/usr/src/cmd/sgs/link_audit/Makefile.com @@ -62,7 +62,7 @@ BINDPICS= $(BINDSRC:%.c=$(PICDIR)/%.o) $(PICDIR)/env.o $(WHOPICS):= SEMANTICCHK= -LDLIBS += $(CONVLIBDIR) $(CONV_LIB) +LDLIBS += $(CONVLIBDIR) -lconv $(TRUSSLIB):= PICS = $(TRUSSPICS) $(PERFLIB):= PICS = $(PERFPICS) @@ -91,7 +91,6 @@ $(BINDLIB):= MAPFILES = ../common/mapfile-vers-bindings $(ROOTCCSLIB) := DIRMODE = 755 CPPFLAGS += -D_REENTRANT -LDFLAGS += $(CC_USE_PROTO) DYNFLAGS += $(VERSREF) CLEANFILES += $(OBJDIR)/* $(PICDIR)/* diff --git a/usr/src/cmd/sgs/link_audit/Makefile.targ b/usr/src/cmd/sgs/link_audit/Makefile.targ index cb6c0443c3..bc63a59842 100644 --- a/usr/src/cmd/sgs/link_audit/Makefile.targ +++ b/usr/src/cmd/sgs/link_audit/Makefile.targ @@ -80,13 +80,13 @@ $(ROOTCCSLIB)/%: % $(ROOTCCSLIB64)/%: % $(INS.file) -$(ROOTONLDBIN)/%: % +$(ROOTONLDBIN)/%: % $(ROOTONLDBIN) $(INS.file) -$(ROOTONLDLIB)/%: % +$(ROOTONLDLIB)/%: % $(ROOTONLDLIB) $(INS.file) -$(ROOTONLDLIB64)/%: % +$(ROOTONLDLIB64)/%: % $(ROOTONLDLIB64) $(INS.file) $(ROOTCCSLIB): @@ -95,4 +95,13 @@ $(ROOTCCSLIB): $(ROOTCCSLIB64): $(INS.dir) +$(ROOTONLDBIN): + $(INS.dir) + +$(ROOTONLDLIB): + $(INS.dir) + +$(ROOTONLDLIB64): + $(INS.dir) + include ../../../../lib/Makefile.targ diff --git a/usr/src/cmd/sgs/link_audit/amd64/Makefile b/usr/src/cmd/sgs/link_audit/amd64/Makefile index 078a97e8f8..0a44e691e5 100644 --- a/usr/src/cmd/sgs/link_audit/amd64/Makefile +++ b/usr/src/cmd/sgs/link_audit/amd64/Makefile @@ -39,9 +39,7 @@ $(CCSLIBS) := CFLAGS64 += $(C_PICFLAGS64) $(NO_ASM_WARN) all: $(PICDIR) .WAIT $(CCSLIBS) $(CCSSCRIPTS) \ $(ONSCRIPTS) $(ONLIBS) -install: all $(ROOTCCSLIB64) .WAIT $(ROOTCCSLIBS64) - -package: install .WAIT $(ROOTONLDLIBS64) +install: all $(ROOTCCSLIB64) .WAIT $(ROOTCCSLIBS64) .WAIT $(ROOTONLDLIBS64) include ../Makefile.targ include ../../Makefile.sub.64 diff --git a/usr/src/cmd/sgs/link_audit/i386/Makefile b/usr/src/cmd/sgs/link_audit/i386/Makefile index 1e5c56bce7..0343456ab9 100644 --- a/usr/src/cmd/sgs/link_audit/i386/Makefile +++ b/usr/src/cmd/sgs/link_audit/i386/Makefile @@ -36,8 +36,7 @@ $(CCSLIBS) := CFLAGS += $(C_PICFLAGS) $(NO_ASM_WARN) all: $(OBJDIR) $(PICDIR) .WAIT $(CCSLIBS) $(CCSSCRIPTS) \ $(ONSCRIPTS) $(ONPROGS) $(ONLIBS) -install: all $(ROOTCCSLIB) .WAIT $(ROOTUSRBINS) $(ROOTCCSLIBS) - -package: install .WAIT $(ROOTONLDLIBS) $(ROOTONLDBINPROG) +install: all $(ROOTCCSLIB) .WAIT $(ROOTUSRBINS) $(ROOTCCSLIBS) \ + .WAIT $(ROOTONLDLIBS) $(ROOTONLDBINPROG) include ../Makefile.targ diff --git a/usr/src/cmd/sgs/link_audit/sparc/Makefile b/usr/src/cmd/sgs/link_audit/sparc/Makefile index 1e5c56bce7..0343456ab9 100644 --- a/usr/src/cmd/sgs/link_audit/sparc/Makefile +++ b/usr/src/cmd/sgs/link_audit/sparc/Makefile @@ -36,8 +36,7 @@ $(CCSLIBS) := CFLAGS += $(C_PICFLAGS) $(NO_ASM_WARN) all: $(OBJDIR) $(PICDIR) .WAIT $(CCSLIBS) $(CCSSCRIPTS) \ $(ONSCRIPTS) $(ONPROGS) $(ONLIBS) -install: all $(ROOTCCSLIB) .WAIT $(ROOTUSRBINS) $(ROOTCCSLIBS) - -package: install .WAIT $(ROOTONLDLIBS) $(ROOTONLDBINPROG) +install: all $(ROOTCCSLIB) .WAIT $(ROOTUSRBINS) $(ROOTCCSLIBS) \ + .WAIT $(ROOTONLDLIBS) $(ROOTONLDBINPROG) include ../Makefile.targ diff --git a/usr/src/cmd/sgs/link_audit/sparcv9/Makefile b/usr/src/cmd/sgs/link_audit/sparcv9/Makefile index 078a97e8f8..63bed7ff25 100644 --- a/usr/src/cmd/sgs/link_audit/sparcv9/Makefile +++ b/usr/src/cmd/sgs/link_audit/sparcv9/Makefile @@ -39,9 +39,8 @@ $(CCSLIBS) := CFLAGS64 += $(C_PICFLAGS64) $(NO_ASM_WARN) all: $(PICDIR) .WAIT $(CCSLIBS) $(CCSSCRIPTS) \ $(ONSCRIPTS) $(ONLIBS) -install: all $(ROOTCCSLIB64) .WAIT $(ROOTCCSLIBS64) - -package: install .WAIT $(ROOTONLDLIBS64) +install: all $(ROOTCCSLIB64) .WAIT $(ROOTCCSLIBS64) \ + .WAIT $(ROOTONLDLIBS64) include ../Makefile.targ include ../../Makefile.sub.64 diff --git a/usr/src/cmd/sgs/mcs/Makefile.com b/usr/src/cmd/sgs/mcs/Makefile.com index b732c5c143..97ee70ac5b 100644 --- a/usr/src/cmd/sgs/mcs/Makefile.com +++ b/usr/src/cmd/sgs/mcs/Makefile.com @@ -39,18 +39,18 @@ MCS = /usr/ccs/bin/mcs COMOBJS = main.o file.o utils.o global.o \ message.o -TOOLSOBJS = alist.o +SGSCOMMONOBJ = alist.o -OBJS = $(COMOBJS) $(TOOLSOBJS) +OBJS = $(COMOBJS) $(SGSCOMMONOBJ) LLDFLAGS = '-R$$ORIGIN/../../lib' LLDFLAGS64 = '-R$$ORIGIN/../../../lib/$(MACH64)' LDFLAGS += $(VERSREF) $(LLDFLAGS) -LDLIBS += $(CONVLIBDIR) $(CONV_LIB) $(ELFLIBDIR) -lelf +LDLIBS += $(CONVLIBDIR) -lconv $(ELFLIBDIR) -lelf CERRWARN += $(CNOWARN_UNINIT) SRCS = $(COMOBJS:%.o=../common/%.c) \ - $(TOOLSOBJS:%.o=$(SGSTOOLS)/common/%.c) + $(SGSCOMMONOBJ:%.o=$(SGSCOMMON)/%.c) CLEANFILES += $(OBJS) diff --git a/usr/src/cmd/sgs/mcs/Makefile.targ b/usr/src/cmd/sgs/mcs/Makefile.targ index e35d939011..7dead9dcc6 100644 --- a/usr/src/cmd/sgs/mcs/Makefile.targ +++ b/usr/src/cmd/sgs/mcs/Makefile.targ @@ -33,7 +33,7 @@ ROOTSTRIPFILEPROG64= $(STRIPFILE:%=$(ROOTCCSBIN64)/%) $(COMPILE.c) $< $(POST_PROCESS_O) -%.o: $(SGSTOOLS)/common/%.c +%.o: $(SGSCOMMON)/%.c $(COMPILE.c) $< $(POST_PROCESS_O) diff --git a/usr/src/cmd/sgs/moe/Makefile.com b/usr/src/cmd/sgs/moe/Makefile.com index a752ef2b90..0f3ec8bdb4 100644 --- a/usr/src/cmd/sgs/moe/Makefile.com +++ b/usr/src/cmd/sgs/moe/Makefile.com @@ -39,8 +39,8 @@ OBJS= $(BLTOBJ) $(COMOBJ) MAPFILE= $(MAPFILE.NGB) MAPOPT= $(MAPFILE:%=-M%) -LDFLAGS += -Wl,$(VERSREF) $(CC_USE_PROTO) $(MAPOPT) -LDLIBS += $(CONVLIBDIR) $(CONV_LIB) +LDFLAGS += -Wl,$(VERSREF) $(MAPOPT) +LDLIBS += $(CONVLIBDIR) -lconv BLTDEFS= msg.h BLTDATA= msg.c diff --git a/usr/src/cmd/sgs/nm/amd64/Makefile b/usr/src/cmd/sgs/nm/amd64/Makefile index cb2d8a5fb5..c086b64dc3 100644 --- a/usr/src/cmd/sgs/nm/amd64/Makefile +++ b/usr/src/cmd/sgs/nm/amd64/Makefile @@ -41,10 +41,10 @@ SRCS= $(COMOBJS:%.o=../common/%.c) LDFLAGS += '-R$$ORIGIN/../../../lib/$(MACH64)' INCLIST= -I../../include -I../../include/i386 \ - -I$(SRCBASE)/uts/$(ARCH)/sys + -I$(SRC)/uts/$(ARCH)/sys CPPFLAGS= $(INCLIST) $(DEFLIST) $(CPPFLAGS.master) -I$(ELFCAP) -LDLIBS += $(CONVLIBDIR64) $(CONV_LIB) $(ELFLIBDIR) -lelf +LDLIBS += $(CONVLIBDIR64) -lconv $(ELFLIBDIR) -lelf %.o: ../common/%.c $(COMPILE.c) $< diff --git a/usr/src/cmd/sgs/nm/i386/Makefile b/usr/src/cmd/sgs/nm/i386/Makefile index a6f7735af2..3d8ecf845d 100644 --- a/usr/src/cmd/sgs/nm/i386/Makefile +++ b/usr/src/cmd/sgs/nm/i386/Makefile @@ -42,11 +42,11 @@ SRCS= $(COMOBJS:%.o=../common/%.c) LLDFLAGS = '-R$$ORIGIN/../../lib' INCLIST= -I../../include -I../../include/i386 \ - -I$(SRCBASE)/uts/$(ARCH)/sys + -I$(SRC)/uts/$(ARCH)/sys DEFLIST= -DTARGET=I386 -DI386=1 -D$(ARFORMAT) -DELF CPPFLAGS= $(INCLIST) $(DEFLIST) $(CPPFLAGS.master) -I$(ELFCAP) -LDLIBS += $(CONVLIBDIR) $(CONV_LIB) $(ELFLIBDIR) -lelf +LDLIBS += $(CONVLIBDIR) -lconv $(ELFLIBDIR) -lelf objs.xpg4/%.o := CPPFLAGS += -DXPG4 $(DEMOBJS):= DEFLIST = -DELF_OBJ diff --git a/usr/src/cmd/sgs/nm/sparc/Makefile b/usr/src/cmd/sgs/nm/sparc/Makefile index a76d967545..ceb5646968 100644 --- a/usr/src/cmd/sgs/nm/sparc/Makefile +++ b/usr/src/cmd/sgs/nm/sparc/Makefile @@ -42,10 +42,10 @@ SRCS= $(COMOBJS:%.o=../common/%.c) LLDFLAGS= '-R$$ORIGIN/../../lib' INCLIST= -I../../include -I../../include/sparc \ - -I$(SRCBASE)/uts/$(ARCH)/sys + -I$(SRC)/uts/$(ARCH)/sys DEFLIST= -DTARGET=SPARC -DSPARC=1 -D$(ARFORMAT) -DELF CPPFLAGS= $(INCLIST) $(DEFLIST) $(CPPFLAGS.master) -I$(ELFCAP) -LDLIBS += $(CONVLIBDIR) $(CONV_LIB) $(ELFLIBDIR) -lelf +LDLIBS += $(CONVLIBDIR) -lconv $(ELFLIBDIR) -lelf objs.xpg4/%.o := CPPFLAGS += -DXPG4 diff --git a/usr/src/cmd/sgs/nm/sparcv9/Makefile b/usr/src/cmd/sgs/nm/sparcv9/Makefile index 75772f807c..6fb95ac24f 100644 --- a/usr/src/cmd/sgs/nm/sparcv9/Makefile +++ b/usr/src/cmd/sgs/nm/sparcv9/Makefile @@ -40,10 +40,10 @@ SRCS= $(COMOBJS:%.o=../common/%.c) LDFLAGS += '-R$$ORIGIN/../../../lib/$(MACH64)' INCLIST= -I../../include -I../../include/sparc \ - -I$(SRCBASE)/uts/$(ARCH)/sys + -I$(SRC)/uts/$(ARCH)/sys DEFLIST= -DTARGET=SPARC -DSPARC=1 -D$(ARFORMAT) -DELF CPPFLAGS= $(INCLIST) $(DEFLIST) $(CPPFLAGS.master) -I$(ELFCAP) -LDLIBS += $(CONVLIBDIR64) $(CONV_LIB) $(ELFLIBDIR) -lelf +LDLIBS += $(CONVLIBDIR64) -lconv $(ELFLIBDIR) -lelf %.o: ../common/%.c diff --git a/usr/src/cmd/sgs/packages/Makefile b/usr/src/cmd/sgs/packages/Makefile deleted file mode 100644 index cfc6424a61..0000000000 --- a/usr/src/cmd/sgs/packages/Makefile +++ /dev/null @@ -1,154 +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 (c) 1994, 2010, Oracle and/or its affiliates. All rights reserved. -# Copyright 2019 OmniOS Community Edition (OmniOSce) Association. -# - -include $(SRC)/Makefile.master -include $(SRC)/cmd/sgs/Makefile.var - -BUILDLOG= package_build.$(MACH).log - -MACHS:sh= if [ "$MACH" = "sparc" ]; \ - then echo "sparc sparcv9"; \ - elif [ "$MACH" = "i386" ]; \ - then echo "i386 amd64"; \ - else echo "unknown"; \ - fi - -RDBDIRS= $(MACHS:%=../librtld_db/demo/%) -LDMAKEDIRS= $(MACHS:%=../libldmake/%) - -SUBDIRS1= ../libconv \ - .WAIT \ - ../libdl \ - .WAIT \ - ../libelf \ - .WAIT \ - ../liblddbg \ - ../librtld_db \ - .WAIT \ - ../librtld \ - ../libcrle - -SUBDIRS2 = ../rtld \ - ../rtld.4.x \ - ../libldstab \ - ../lari \ - ../ldprof \ - ../lddstub \ - $(LDMAKEDIRS) \ - ../0@0 \ - ../tools \ - $(RDBDIRS) - -# -# Package dirs are directories which specifically -# have a 'package' target. This target is used to key -# off of whether a system build is performed -# or a SUNWonld build. -# -PKGDIRS= ../libcrle \ - ../libld \ - ../elfdump \ - ../elfedit \ - ../elfedit/modules \ - ../elfwrap \ - ../ar \ - ../crle \ - ../dump \ - ../lari \ - ../ld \ - ../ldd \ - ../ldprof \ - ../nm \ - ../mcs \ - ../moe \ - ../pvs - -$(SUBDIRS1) $(SUBDIRS2) := TARGET = install -$(PKGDIRS) := TARGET = package - -../%: FRC - @ cd $@; pwd; $(MAKE) $(TARGET) - -.KEEP_STATE_FILE: .make.state.$(MACH) -.KEEP_STATE: -.PARALLEL: $(SUBDIRS1) $(PKGDIRS) $(SUBDIRS2) - -all clean clobber install: FRC - @ cd $(MACH); pwd; $(MAKE) $@ - -# -# invoke `package' to build this package from scratch. It will -# perform make install in the directories that contains components -# that this package is dependent upon -# -package: FRC - @/bin/time $(MAKE) package_build 2>&1 | tee $(BUILDLOG) - @ echo "===BUILD COMPLETED checking for warnings...===" - @ grep -i "warning:" $(BUILDLOG) | grep -v PSTAMP | cat - @ echo "==================done=========================" - -package_build: package_dep .WAIT package_chkmsg .WAIT install - -package_chkmsg: FRC - @ cd ..; pwd; $(MAKE) chkmsg - -package_dep: package_dep_ .WAIT $(SUBDIRS1) .WAIT \ - $(PKGDIRS) .WAIT $(SUBDIRS2) - -package_dep_: FRC - @ cd ../tools; pwd; $(MAKE) proto && ./proto $(RELEASE) - @ cd $(SRC)/common/mapfiles/gen ; pwd; $(MAKE) install - @ cd $(SRC)/head; pwd; $(MAKE) \ - $(ROOT)/usr/include/dlfcn.h \ - $(ROOT)/usr/include/gelf.h \ - $(ROOT)/usr/include/libelf.h \ - $(ROOT)/usr/include/proc_service.h \ - $(ROOT)/usr/include/rtld_db.h \ - $(ROOT)/usr/include/link.h - @ cd $(SRC)/lib/libproc; pwd; $(MAKE) install_h - @ cd $(SRC)/uts/common/sys; pwd; $(MAKE) \ - $(ROOT)/usr/include/sys/elf.h \ - $(ROOT)/usr/include/sys/elf_386.h \ - $(ROOT)/usr/include/sys/elf_SPARC.h \ - $(ROOT)/usr/include/sys/elf_notes.h \ - $(ROOT)/usr/include/sys/elf_amd64.h \ - $(ROOT)/usr/include/sys/elftypes.h \ - $(ROOT)/usr/include/sys/auxv.h \ - $(ROOT)/usr/include/sys/auxv_SPARC.h \ - $(ROOT)/usr/include/sys/auxv_386.h \ - $(ROOT)/usr/include/sys/avl.h \ - $(ROOT)/usr/include/sys/link.h \ - $(ROOT)/usr/include/sys/machelf.h \ - $(ROOT)/usr/include/sys/note.h \ - $(ROOT)/usr/include/sys/systeminfo.h - @ cd ../tools/$(MACH); pwd; $(MAKE) sgsmsg piglatin - @ cd ..; pwd; $(MAKE) _msg_sgsmsg - @ cd ..; pwd; $(MAKE) native-add - @ cd ../libconv; pwd; $(MAKE) all - @ cd ../link_audit; pwd; $(MAKE) package - @ cd ../messages/$(MACH); pwd; $(MAKE) test - -FRC: diff --git a/usr/src/cmd/sgs/packages/Makefile.targ b/usr/src/cmd/sgs/packages/Makefile.targ deleted file mode 100644 index a4b307f359..0000000000 --- a/usr/src/cmd/sgs/packages/Makefile.targ +++ /dev/null @@ -1,51 +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 2009 Sun Microsystems, Inc. All rights reserved. -# Use is subject to license terms. -# Copyright 2015 Igor Kozhukhov <ikozhukhov@gmail.com> -# - -pkginfo: ../common/pkginfo.tmpl awk_pkginfo - $(RM) $@; $(AWK) -f awk_pkginfo ../common/$@.tmpl > $@ - -pkg: FRC - @ $(RM) -r $(PACKAGE) - pkgmk -f prototype_$(MACH) -d $(PKGARCHIVE) -r $(ROOT) \ - -o $(PACKAGE) 2>&1 | egrep -v "$(SRC)|parametric paths may" - pkgtrans -o -s $(PKGARCHIVE) $(PACKAGE).tmp $(PACKAGE) - $(RM) -r $(PKGARCHIVE)/$(PACKAGE) - mv $(PKGARCHIVE)/$(PACKAGE).tmp $(PKGARCHIVE)/$(PACKAGE) - -$(DATAFILES): ../common/$$@ - $(RM) $@; cp ../common/$@ $@ - -awk_pkginfo: ../bld_awk_pkginfo ../common/readme_revision ../common/$(README) - ../bld_awk_pkginfo \ - -R `perl ../common/readme_revision -d ../common/$(README)` \ - -m $(MACH) -r "$(RELEASE)" -o $@ - -clean: FRC - $(RM) $(CLEANFILES) - -clobber: clean FRC - $(RM) -r $(CLOBBERFILES) - -FRC: diff --git a/usr/src/cmd/sgs/packages/common/bld_awk_pkginfo.ksh b/usr/src/cmd/sgs/packages/common/bld_awk_pkginfo.ksh deleted file mode 100644 index 4b1f33e2da..0000000000 --- a/usr/src/cmd/sgs/packages/common/bld_awk_pkginfo.ksh +++ /dev/null @@ -1,119 +0,0 @@ -#!/usr/bin/ksh -p -# -# 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 2008 Sun Microsystems, Inc. All rights reserved. -# Use is subject to license terms. -# -# Simple script which builds the awk_pkginfo awk script. This awk script -# is used to convert the pkginfo.tmpl files into pkginfo files -# for the build. -# - - -usage() -{ - echo "usage: bld_awk_pkginfo -R <revision> -r <release> -m <mach> -o <awk_script>" -} -# -# Awk strings -# -VERSION="VERSION\=" -PRODVERS="^PRODVERS\=" -ARCH='ARCH=\"ISA\"' - - -# -# parse command line -# -mach="" -release="" -awk_script="" -revision="" - -while getopts DR:o:r:m: c -do - case $c in - o) - awk_script=$OPTARG - ;; - m) - mach=$OPTARG - ;; - r) - release=$OPTARG - ;; - R) - revision=$OPTARG - ;; - \?) - usage - exit 1 - ;; - esac -done - -if [[ ( -z $release ) || ( -z $mach ) || ( -z $awk_script ) \ - || ( -z $revision) ]] -then - usage - exit 1 -fi - -if [[ -f $awk_script ]] -then - rm -f $awk_script -fi - -# -# Build REV= field based on date -# -rev=$(date "+%y.%m.%d.%H.%M") - -# -# Build PRODVERS string - same as in libconv/common/bld_vernote.ksh -# -prodver="${release}-${revision}" - -# -# Build awk script which will process all the -# pkginfo.tmpl files. -# -rm -f $awk_script -cat << EOF > $awk_script -/$VERSION/ { - sub(/\=[^=]*$/,"=$rev\"") - print - next - } -/$PRODVERS/ { - printf "PRODVERS=\"%s\"\n", "$prodver" - next - } -/$ARCH/ { - printf "ARCH=\"%s\"\n", "$mach" - next - } -{ print } -EOF - diff --git a/usr/src/cmd/sgs/packages/common/checkinstall b/usr/src/cmd/sgs/packages/common/checkinstall deleted file mode 100644 index b728b6489c..0000000000 --- a/usr/src/cmd/sgs/packages/common/checkinstall +++ /dev/null @@ -1,60 +0,0 @@ -# -# Copyright 2009 Sun Microsystems, Inc. All rights reserved. -# Use is subject to license terms. -# -# 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 -# - -# Installing the wrong architecture of runtime linker will immediately -# brick the system. Catch this case and refuse to do it. -if [ "$PKG_INSTALL_ROOT" = '' -o "$PKG_INSTALL_ROOT" = '/' ]; then - SYSARCH=`uname -p` - if [ "$SYSARCH" != "$ARCH" ]; then - echo "***" - echo "*** Cannot install $ARCH linker into root of $SYSARCH system." - echo "***" - exit 1 - fi -fi - -if [ -d $BASEDIR/$SGSBACKUPDIR ]; -then - echo "***" - echo "*** Previous version of SUNWonld already installed. Use" - echo "*** # pkgrm SUNWonld" - echo "*** to remove it before installing a newer version, or" - echo "*** use an admin file to force an overwrite." - echo "***" - exit 1 -fi - -# As of Nevada build snv_104, we require the mmapobj() system call. -# Installing on a system that lacks it will break rtld and brick the system. -elfdump -sN.dynsym /lib/libc.so.1 | grep mmapobj > /dev/null -if [ $? != 0 ]; -then - echo "***" - echo "*** System lacks required mmapobj() system call" - echo "*** Nevada snv_104 or newer is required." - echo "***" - exit 1 -fi - -exit 0 diff --git a/usr/src/cmd/sgs/packages/common/copyright b/usr/src/cmd/sgs/packages/common/copyright deleted file mode 100644 index 2ebebd6ed8..0000000000 --- a/usr/src/cmd/sgs/packages/common/copyright +++ /dev/null @@ -1,2 +0,0 @@ -Copyright 2009 Sun Microsystems, Inc. All rights reserved. -Use is subject to license terms. diff --git a/usr/src/cmd/sgs/packages/common/depend b/usr/src/cmd/sgs/packages/common/depend deleted file mode 100644 index e10cb99d4e..0000000000 --- a/usr/src/cmd/sgs/packages/common/depend +++ /dev/null @@ -1,46 +0,0 @@ -# ident "%Z%%M% %I% %E% SMI" -# Copyright 2005 Sun Microsystems, Inc. All rights reserved. -# Use is subject to license terms. -# -# 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 -# -# -# This package information file defines software dependencies associated -# with the pkg. You can define three types of pkg dependencies with this file: -# P indicates a prerequisite for installation -# I indicates an incompatible package -# R indicates a reverse dependency -# <pkg.abbr> see pkginfo(4), PKG parameter -# <name> see pkginfo(4), NAME parameter -# <version> see pkginfo(4), VERSION parameter -# <arch> see pkginfo(4), ARCH parameter -# <type> <pkg.abbr> <name> -# (<arch>)<version> -# (<arch>)<version> -# ... -# <type> <pkg.abbr> <name> -# ... - -P SUNWcar Core Architecture, (Root) -P SUNWkvm Core Architecture, (Kvm) -P SUNWcsr Core Solaris, (Root) -P SUNWcsu Core Solaris, (Usr) -P SUNWcsd Core Solaris Devices diff --git a/usr/src/cmd/sgs/packages/common/postinstall b/usr/src/cmd/sgs/packages/common/postinstall deleted file mode 100644 index 31575a1dbd..0000000000 --- a/usr/src/cmd/sgs/packages/common/postinstall +++ /dev/null @@ -1,173 +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 2009 Sun Microsystems, Inc. All rights reserved. -# Use is subject to license terms. -# - -ONLDCPIO=/tmp/SUNWonld.cpio.$$ - - -# -# This script handles the installation of the new sgstools on -# both Solaris10 systems (which libraries moved to '/lib') and -# pre Solaris10 systems where libraries reside under '/usr/lib'. -# -# We test to deterine if '/lib' is a symlink (pre Solaris10) or a -# directory (Solaris10 & later). We key off of that for -# everything below. -# -if [ -h ${BASEDIR}/lib ] -then - LIBBASE=usr/lib - ETCLIST="etc/lib/ld.so.1 etc/lib/libdl.so.1" -else - LIBBASE=lib -fi -export LIBBASE - - -build_liblist () -{ - # - # Build '/lib' file list for backing up - # - cd $BASEDIR/$SGSDIR/lib - find . \( -type f -o -type l \) -print | sed 's/^\.\///'g | - while read file - do - if [ \( -f $BASEDIR/$LIBBASE/$file \) -o \ - \( -h $BASEDIR/$LIBBASE/$file \) ]; then - echo $LIBBASE/$file - fi - done -} - -build_filelist() -{ - # - # Build rest of files - # - cd $BASEDIR/$SGSDIR - find usr \( -type f -o -type l \) -print | while read file - do - if [ \( -f $BASEDIR/$file \) -o \ - \( -h $BASEDIR/$file \) ]; then - echo $file - fi - done -} - -build_newitemsfile () -{ - rm -f ${SGSBACKUPDIR}.newfiles - - # Build a list of files/directories that this package is going - # add to the system that do not already exist. - cd $BASEDIR/$SGSDIR/lib - find . -depth -print | sed 's/^\.\///'g | while read file - do - # Built in /bin/sh test lacks -e - /usr/bin/test \! -e "$BASEDIR/$LIBBASE/$file" - if [ $? = 0 ]; then - echo $LIBBASE/$file >> ${SGSBACKUPDIR}.newfiles - fi - done - - cd $BASEDIR/$SGSDIR - find usr -depth -print | while read file - do - /usr/bin/test \! -e "$BASEDIR/$file" - if [ $? = 0 ]; then - echo $file >> ${SGSBACKUPDIR}.newfiles - fi - done -} - -# Generate a file containing the names of the files and directories -# that are being added (as opposed to being replaced) to the system. -# These items will need to be explicitly removed at uninstall. -build_newitemsfile - -# Generate a file containing the names of the original files backed -# up from the system. These items will be moved back at uninstall. -LIBLIST=`build_liblist` -FILELIST=`build_filelist` -for file in $LIBLIST $FILELIST $ETCLIST -do - echo $file -done > ${SGSBACKUPDIR}.origfiles - -# -# backup all existing SGStools. -# -echo "Backup up existing SGS tools to $SGSBACKUPDIR..." -cd $BASEDIR -cpio -pdm $BASEDIR/$SGSBACKUPDIR < ${SGSBACKUPDIR}.origfiles - - -# -# Overwrite SGSTOOLS onto existing system. We use CPIO -# because it unlinks a file and then creates a new one -# instead of copying over an existing inode. This is -# required when updating libraries (and the run-time linker) -# which are currently being used. -# - - -# -# First '/lib' components -# -echo "Installing new SGSTOOLS from $BASEDIR/$SGSDIR" - -prev_bindnow=$LD_BIND_NOW -LD_BIND_NOW=1 -export LD_BIND_NOW - -cd $BASEDIR/$SGSDIR/lib -find . -depth -print | cpio -o -O $ONLDCPIO -cd $BASEDIR/$LIBBASE -cpio -imdu < $ONLDCPIO -rm -f $ONLDCPIO - -# -# Then everything else -# -cd $BASEDIR/$SGSDIR -find usr -depth -print | cpio -o -O $ONLDCPIO -cd $BASEDIR -cpio -imdu < $ONLDCPIO -rm -f $ONLDCPIO - - -# -# Populate '/etc/lib' directories on systems with the -# run-time linker installed under '/usr/lib/ld.so.1' -# -if [ "${ETCLIST}x" != "x" ]; then - cp $BASEDIR/usr/lib/ld.so.1 $BASEDIR/etc/lib/ld.so.1.onld - cp $BASEDIR/usr/lib/libdl.so.1 $BASEDIR/etc/lib/libdl.so.1.onld - cd $BASEDIR/etc/lib - mv ld.so.1.onld ld.so.1 - mv libdl.so.1.onld libdl.so.1 -fi - -LD_BIND_NOW=$prev_bindnow diff --git a/usr/src/cmd/sgs/packages/common/prototype_com b/usr/src/cmd/sgs/packages/common/prototype_com deleted file mode 100644 index b4e32178d1..0000000000 --- a/usr/src/cmd/sgs/packages/common/prototype_com +++ /dev/null @@ -1,300 +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 (c) 1994, 2010, Oracle and/or its affiliates. All rights reserved. -# -# This required package information file contains a list of package contents. -# The 'pkgmk' command uses this file to identify the contents of a package -# and their location on the development machine when building the package. -# Can be created via a text editor or through use of the 'pkgproto' command. - -# packaging files -i pkginfo -i copyright -i depend -i checkinstall -i postinstall -i preremove -# -# source locations relative to the prototype file -# -# SUNWonld -# -d none var 755 root sys -d none var/ld 755 root bin -d none $SGSBACKUPDIR 755 root bin -d none opt 755 root sys -d none opt/SUNWonld 755 root sys -d none $SGSDIR/ 755 root sys -d none $SGSDIR/lib 755 root sys -s none $SGSDIR/lib/32=. -d none $SGSDIR/usr 755 root sys -f none $SGSDIR/lib/ld.so.1=lib/ld.so.1 755 root bin -f none $SGSDIR/lib/libdl.so.1=lib/libdl.so.1 755 root bin -s none $SGSDIR/lib/libdl.so=./libdl.so.1 -f none $SGSDIR/lib/libelf.so.1=lib/libelf.so.1 755 root bin -s none $SGSDIR/lib/libelf.so=./libelf.so.1 -f none $SGSDIR/lib/libld.so.4=lib/libld.so.4 755 root bin -f none $SGSDIR/lib/liblddbg.so.4=lib/liblddbg.so.4 755 root bin -f none $SGSDIR/lib/librtld.so.1=lib/librtld.so.1 755 root bin -s none $SGSDIR/lib/librtld_db.so=librtld_db.so.1 -f none $SGSDIR/lib/librtld_db.so.1=lib/librtld_db.so.1 755 root bin -d none $SGSDIR/usr/bin 755 root bin -f none $SGSDIR/usr/bin/ar=usr/bin/ar 555 root bin -s none $SGSDIR/usr/ccs/bin/ar=../../bin/ar -f none $SGSDIR/usr/xpg4/bin/ar=usr/xpg4/bin/ar 0555 root bin -f none $SGSDIR/usr/bin/crle=usr/bin/crle 555 root bin -f none $SGSDIR/usr/bin/ldd=usr/bin/ldd 555 root bin -f none $SGSDIR/usr/bin/moe=usr/bin/moe 555 root bin -f none $SGSDIR/usr/bin/pvs=usr/bin/pvs 555 root bin -f none $SGSDIR/usr/bin/sotruss=usr/bin/sotruss 755 root bin -f none $SGSDIR/usr/bin/whocalls=usr/bin/whocalls 755 root bin -d none $SGSDIR/usr/ccs 755 root bin -d none $SGSDIR/usr/ccs/bin 755 root bin -f none $SGSDIR/usr/bin/dump=usr/bin/dump 0555 root bin -s none $SGSDIR/usr/ccs/bin/dump=../../bin/dump -f none $SGSDIR/usr/bin/elfdump=usr/bin/elfdump 0555 root bin -s none $SGSDIR/usr/ccs/bin/elfdump=../../bin/elfdump -f none $SGSDIR/usr/bin/elfedit=usr/bin/elfedit 0555 root bin -f none $SGSDIR/usr/bin/elfwrap=usr/bin/elfwrap 0555 root bin -f none $SGSDIR/usr/bin/lari=usr/bin/lari 0555 root bin -s none $SGSDIR/usr/ccs/bin/lari=../../bin/lari -f none $SGSDIR/usr/bin/ld=usr/bin/ld 755 root bin -s none $SGSDIR/usr/ccs/bin/ld=../../bin/ld -f none $SGSDIR/usr/bin/nm=usr/bin/nm 0555 root bin -s none $SGSDIR/usr/ccs/bin/nm=../../bin/nm -f none $SGSDIR/usr/bin/mcs=usr/bin/mcs 0555 root bin -s none $SGSDIR/usr/ccs/bin/mcs=../../bin/mcs -l none $SGSDIR/usr/bin/strip=./mcs -s none $SGSDIR/usr/ccs/bin/strip=../../bin/strip -d none $SGSDIR/usr/include 755 root bin -f none $SGSDIR/usr/include/dlfcn.h=usr/include/dlfcn.h 644 root bin -f none $SGSDIR/usr/include/libelf.h=usr/include/libelf.h 644 root bin -f none $SGSDIR/usr/include/link.h=usr/include/link.h 644 root bin -f none $SGSDIR/usr/include/gelf.h=usr/include/gelf.h 644 root bin -f none $SGSDIR/usr/include/proc_service.h=usr/include/proc_service.h 644 root bin -f none $SGSDIR/usr/include/rtld_db.h=usr/include/rtld_db.h 644 root bin -d none $SGSDIR/usr/include/sys 755 root bin -f none $SGSDIR/usr/include/sys/elf.h=usr/include/sys/elf.h 644 root bin -f none $SGSDIR/usr/include/sys/elf_386.h=usr/include/sys/elf_386.h 644 root bin -f none $SGSDIR/usr/include/sys/elf_amd64.h=usr/include/sys/elf_amd64.h 644 root bin -f none $SGSDIR/usr/include/sys/elf_SPARC.h=usr/include/sys/elf_SPARC.h 644 root bin -f none $SGSDIR/usr/include/sys/elftypes.h=usr/include/sys/elftypes.h 644 root bin -f none $SGSDIR/usr/include/sys/machelf.h=usr/include/sys/machelf.h 644 root bin -f none $SGSDIR/usr/include/sys/link.h=usr/include/sys/link.h 644 root bin -d none $SGSDIR/usr/lib 755 root bin -s none $SGSDIR/usr/lib/32=. -f none $SGSDIR/usr/lib/0@0.so.1=usr/lib/0@0.so.1 755 root bin -f none $SGSDIR/usr/lib/lddstub=usr/lib/lddstub 555 root bin -f none $SGSDIR/usr/lib/libcrle.so.1=usr/lib/libcrle.so.1 755 root bin -f none $SGSDIR/usr/lib/libldstab.so.1=usr/lib/libldstab.so.1 755 root bin -d none $SGSDIR/usr/lib/elfedit 755 root bin -s none $SGSDIR/usr/lib/elfedit/32=. -f none $SGSDIR/usr/lib/elfedit/cap.so=usr/lib/elfedit/cap.so 755 root bin -f none $SGSDIR/usr/lib/elfedit/dyn.so=usr/lib/elfedit/dyn.so 755 root bin -f none $SGSDIR/usr/lib/elfedit/ehdr.so=usr/lib/elfedit/ehdr.so 755 root bin -f none $SGSDIR/usr/lib/elfedit/phdr.so=usr/lib/elfedit/phdr.so 755 root bin -f none $SGSDIR/usr/lib/elfedit/shdr.so=usr/lib/elfedit/shdr.so 755 root bin -f none $SGSDIR/usr/lib/elfedit/str.so=usr/lib/elfedit/str.so 755 root bin -f none $SGSDIR/usr/lib/elfedit/sym.so=usr/lib/elfedit/sym.so 755 root bin -f none $SGSDIR/usr/lib/elfedit/syminfo.so=usr/lib/elfedit/syminfo.so 755 root bin -d none $SGSDIR/usr/lib/link_audit 755 root bin -s none $SGSDIR/usr/lib/link_audit/32=. -f none $SGSDIR/usr/lib/link_audit/ldprof.so.1=usr/lib/link_audit/ldprof.so.1 755 root bin -f none $SGSDIR/usr/lib/link_audit/truss.so.1=usr/lib/link_audit/truss.so.1 755 root bin -f none $SGSDIR/usr/lib/link_audit/who.so.1=usr/lib/link_audit/who.so.1 755 root bin -d none $SGSDIR/usr/lib/mdb/ 755 root sys -d none $SGSDIR/usr/lib/mdb/proc 755 root sys -f none $SGSDIR/usr/lib/mdb/proc/ld.so=/usr/lib/mdb/proc/ld.so 555 root sys -d none $SGSDIR/usr/lib/locale 755 root bin -d none $SGSDIR/usr/lib/locale/piglatin 755 root bin -d none $SGSDIR/usr/lib/locale/piglatin/LC_MESSAGES 755 root bin -f none $SGSDIR/usr/lib/locale/piglatin/LC_MESSAGES/SUNW_OST_SGS.mo=/usr/lib/locale/piglatin/LC_MESSAGES/SUNW_OST_SGS.mo 444 root bin -d none $SGSDIR/usr/lib/secure 755 root bin -s none $SGSDIR/usr/lib/secure/32=. -d none $SGSDIR/usr/xpg4 755 root bin -d none $SGSDIR/usr/xpg4/bin 755 root bin -f none $SGSDIR/usr/xpg4/bin/nm=usr/xpg4/bin/nm 0555 root bin -d none $SGSDIR/usr/demo 755 root bin -d none $SGSDIR/usr/demo/ELF 755 root bin -f none $SGSDIR/usr/demo/ELF/Makefile=usr/demo/ELF/Makefile 644 root bin -f none $SGSDIR/usr/demo/ELF/00README=usr/demo/ELF/00README 644 root bin -f none $SGSDIR/usr/demo/ELF/acom.c=usr/demo/ELF/acom.c 644 root bin -f none $SGSDIR/usr/demo/ELF/dcom.c=usr/demo/ELF/dcom.c 644 root bin -f none $SGSDIR/usr/demo/ELF/dispsyms.c=usr/demo/ELF/dispsyms.c 644 root bin -f none $SGSDIR/usr/demo/ELF/pcom.c=usr/demo/ELF/pcom.c 644 root bin -f none $SGSDIR/usr/demo/ELF/tpcom.c=usr/demo/ELF/tpcom.c 644 root bin -d none $SGSDIR/usr/demo/librtld_db 755 root bin -f none $SGSDIR/usr/demo/librtld_db/00README=usr/demo/librtld_db/00README 644 root bin -f none $SGSDIR/usr/demo/librtld_db/Makefile.com=usr/demo/librtld_db/Makefile.com 644 root bin -f none $SGSDIR/usr/demo/librtld_db/Makefile.targ=usr/demo/librtld_db/Makefile.targ 644 root bin -d none $SGSDIR/usr/demo/librtld_db/amd64 755 root bin -f none $SGSDIR/usr/demo/librtld_db/amd64/Makefile=usr/demo/librtld_db/amd64/Makefile 644 root bin -f none $SGSDIR/usr/demo/librtld_db/amd64/rdb_mach.h=usr/demo/librtld_db/amd64/rdb_mach.h 644 root bin -f none $SGSDIR/usr/demo/librtld_db/amd64/regs.c=usr/demo/librtld_db/amd64/regs.c 644 root bin -d none $SGSDIR/usr/demo/librtld_db/common 755 root bin -f none $SGSDIR/usr/demo/librtld_db/common/bpt.c=usr/demo/librtld_db/common/bpt.c 644 root bin -f none $SGSDIR/usr/demo/librtld_db/common/callstack.c=usr/demo/librtld_db/common/callstack.c 644 root bin -f none $SGSDIR/usr/demo/librtld_db/common/dis.c=usr/demo/librtld_db/common/dis.c 644 root bin -f none $SGSDIR/usr/demo/librtld_db/common/disasm.c=usr/demo/librtld_db/common/disasm.c 644 root bin -f none $SGSDIR/usr/demo/librtld_db/common/disasm.h=usr/demo/librtld_db/common/disasm.h 644 root bin -f none $SGSDIR/usr/demo/librtld_db/common/globals.c=usr/demo/librtld_db/common/globals.c 644 root bin -f none $SGSDIR/usr/demo/librtld_db/common/gram.y=usr/demo/librtld_db/common/gram.y 644 root bin -f none $SGSDIR/usr/demo/librtld_db/common/help.c=usr/demo/librtld_db/common/help.c 644 root bin -f none $SGSDIR/usr/demo/librtld_db/common/lex.l=usr/demo/librtld_db/common/lex.l 644 root bin -f none $SGSDIR/usr/demo/librtld_db/common/main.c=usr/demo/librtld_db/common/main.c 644 root bin -f none $SGSDIR/usr/demo/librtld_db/common/maps.c=usr/demo/librtld_db/common/maps.c 644 root bin -f none $SGSDIR/usr/demo/librtld_db/common/ps.c=usr/demo/librtld_db/common/ps.c 644 root bin -f none $SGSDIR/usr/demo/librtld_db/common/rdb.h=usr/demo/librtld_db/common/rdb.h 644 root bin -f none $SGSDIR/usr/demo/librtld_db/common/rdb.man=usr/demo/librtld_db/common/rdb.man 644 root bin -f none $SGSDIR/usr/demo/librtld_db/common/syms.c=usr/demo/librtld_db/common/syms.c 644 root bin -f none $SGSDIR/usr/demo/librtld_db/common/utils.c=usr/demo/librtld_db/common/utils.c 644 root bin -d none $SGSDIR/usr/demo/librtld_db/i386 755 root bin -f none $SGSDIR/usr/demo/librtld_db/i386/Makefile=usr/demo/librtld_db/i386/Makefile 644 root bin -f none $SGSDIR/usr/demo/librtld_db/i386/m_utils.c=usr/demo/librtld_db/i386/m_utils.c 644 root bin -f none $SGSDIR/usr/demo/librtld_db/i386/rdb_mach.h=usr/demo/librtld_db/i386/rdb_mach.h 644 root bin -f none $SGSDIR/usr/demo/librtld_db/i386/regs.c=usr/demo/librtld_db/i386/regs.c 644 root bin -d none $SGSDIR/usr/demo/librtld_db/sparc 755 root bin -f none $SGSDIR/usr/demo/librtld_db/sparc/Makefile=usr/demo/librtld_db/sparc/Makefile 644 root bin -f none $SGSDIR/usr/demo/librtld_db/sparc/m_utils.c=usr/demo/librtld_db/sparc/m_utils.c 644 root bin -f none $SGSDIR/usr/demo/librtld_db/sparc/rdb_mach.h=usr/demo/librtld_db/sparc/rdb_mach.h 644 root bin -f none $SGSDIR/usr/demo/librtld_db/sparc/regs.c=usr/demo/librtld_db/sparc/regs.c 644 root bin -d none $SGSDIR/usr/demo/librtld_db/sparcv9 755 root bin -f none $SGSDIR/usr/demo/librtld_db/sparcv9/Makefile=usr/demo/librtld_db/sparcv9/Makefile 644 root bin -f none $SGSDIR/usr/demo/librtld_db/sparcv9/m_utils.c=usr/demo/librtld_db/sparcv9/m_utils.c 644 root bin -f none $SGSDIR/usr/demo/librtld_db/sparcv9/rdb_mach.h=usr/demo/librtld_db/sparcv9/rdb_mach.h 644 root bin -f none $SGSDIR/usr/demo/librtld_db/sparcv9/regs.c=usr/demo/librtld_db/sparcv9/regs.c 644 root bin -d none $SGSDIR/usr/demo/librtld_db/tests 755 root bin -f none $SGSDIR/usr/demo/librtld_db/tests/breaks=usr/demo/librtld_db/tests/breaks 644 root bin -f none $SGSDIR/usr/demo/librtld_db/tests/loadmaps=usr/demo/librtld_db/tests/loadmaps 644 root bin -f none $SGSDIR/usr/demo/librtld_db/tests/object_padding_maps=usr/demo/librtld_db/tests/object_padding_maps 644 root bin -f none $SGSDIR/usr/demo/librtld_db/tests/plt_skip=usr/demo/librtld_db/tests/plt_skip 644 root bin -f none $SGSDIR/usr/demo/librtld_db/tests/simp.c=usr/demo/librtld_db/tests/simp.c 644 root bin -f none $SGSDIR/usr/demo/librtld_db/tests/steps=usr/demo/librtld_db/tests/steps 644 root bin -f none $SGSDIR/usr/demo/librtld_db/tests/sub.c=usr/demo/librtld_db/tests/sub.c 644 root bin -f none $SGSDIR/usr/demo/librtld_db/tests/test-sparc-regs=usr/demo/librtld_db/tests/test-sparc-regs 644 root bin -d none $SGSDIR/usr/demo/link_audit 755 root bin -f none $SGSDIR/usr/demo/link_audit/00README=usr/demo/link_audit/00README 644 root bin -f none $SGSDIR/usr/demo/link_audit/Makefile=usr/demo/link_audit/Makefile 644 root bin -d none $SGSDIR/usr/demo/link_audit/man 755 root bin -f none $SGSDIR/usr/demo/link_audit/man/dumpbind.man=usr/demo/link_audit/man/dumpbind.man 644 root bin -f none $SGSDIR/usr/demo/link_audit/man/perfcnt.man=usr/demo/link_audit/man/perfcnt.man 644 root bin -f none $SGSDIR/usr/demo/link_audit/man/symbindrep.man=usr/demo/link_audit/man/symbindrep.man 644 root bin -d none $SGSDIR/usr/demo/link_audit/src 755 root bin -f none $SGSDIR/usr/demo/link_audit/src/bindings.c=usr/demo/link_audit/src/bindings.c 644 root bin -f none $SGSDIR/usr/demo/link_audit/src/bindings.h=usr/demo/link_audit/src/bindings.h 644 root bin -f none $SGSDIR/usr/demo/link_audit/src/dumpbind.c=usr/demo/link_audit/src/dumpbind.c 644 root bin -f none $SGSDIR/usr/demo/link_audit/src/env.c=usr/demo/link_audit/src/env.c 644 root bin -f none $SGSDIR/usr/demo/link_audit/src/env.h=usr/demo/link_audit/src/env.h 644 root bin -f none $SGSDIR/usr/demo/link_audit/src/hash.c=usr/demo/link_audit/src/hash.c 644 root bin -f none $SGSDIR/usr/demo/link_audit/src/hash.h=usr/demo/link_audit/src/hash.h 644 root bin -f none $SGSDIR/usr/demo/link_audit/src/mach.h=usr/demo/link_audit/src/mach.h 644 root bin -f none $SGSDIR/usr/demo/link_audit/src/perfcnt.c=usr/demo/link_audit/src/perfcnt.c 644 root bin -f none $SGSDIR/usr/demo/link_audit/src/perfcnt.ksh=usr/demo/link_audit/src/perfcnt.ksh 644 root bin -f none $SGSDIR/usr/demo/link_audit/src/sotruss.ksh=usr/demo/link_audit/src/sotruss.ksh 644 root bin -f none $SGSDIR/usr/demo/link_audit/src/symbindrep.c=usr/demo/link_audit/src/symbindrep.c 644 root bin -f none $SGSDIR/usr/demo/link_audit/src/symbindrep.ksh=usr/demo/link_audit/src/symbindrep.ksh 644 root bin -f none $SGSDIR/usr/demo/link_audit/src/truss.c=usr/demo/link_audit/src/truss.c 644 root bin -f none $SGSDIR/usr/demo/link_audit/src/who.c=usr/demo/link_audit/src/who.c 644 root bin -f none $SGSDIR/usr/demo/link_audit/src/who.h=usr/demo/link_audit/src/who.h 644 root bin -f none $SGSDIR/usr/demo/link_audit/src/whocalls.ksh=usr/demo/link_audit/src/whocalls.ksh 644 root bin -f none opt/SUNWonld/SUNWonld-README 444 root bin -d none opt/SUNWonld/bin 755 root bin -f none opt/SUNWonld/bin/dumpbind 755 root bin -f none opt/SUNWonld/bin/rdb 755 root bin -f none opt/SUNWonld/bin/perfcnt 755 root bin -f none opt/SUNWonld/bin/symbindrep 755 root bin -d none opt/SUNWonld/lib 755 root bin -s none opt/SUNWonld/lib/32=. -f none opt/SUNWonld/lib/libldmake.so.1 755 root bin -f none opt/SUNWonld/lib/bindings.so.1 755 root bin -f none opt/SUNWonld/lib/symbindrep.so.1 755 root bin -f none opt/SUNWonld/lib/perfcnt.so.1 755 root bin -d none opt/SUNWonld/man 755 root bin -d none opt/SUNWonld/man/man1l 755 root bin -f none opt/SUNWonld/man/man1l/chkmsg.1l 444 root bin -f none opt/SUNWonld/man/man1l/sgsmsg.1l 444 root bin - - -# -# The following commented items are for things that exist within -# usr/src/cmd/sgs, but which are not normally considered to be -# part of the SUNWonld package. It is possible to add these items -# to a special-purpose SUNWonld by uncommenting the appropriate lines. -# - -# /usr/share/lib/ccs is needed by: gprof, lex, yacc -#d none $SGSDIR/usr/share 755 root bin -#d none $SGSDIR/usr/share/lib 755 root bin -#d none $SGSDIR/usr/share/lib/ccs 755 root bin - -#f none $SGSDIR/usr/bin/error=usr/bin/error 555 root bin -#s none $SGSDIR/usr/ccs/bin/error=../../bin/error - -#f none $SGSDIR/usr/bin/gprof=usr/bin/gprof 555 root bin -#s none $SGSDIR/usr/ccs/bin/gprof=../../bin/gprof -#f none $SGSDIR/usr/share/lib/ccs/gprof.callg.blurb=usr/share/lib/ccs/gprof.callg.blurb 444 root bin -#f none $SGSDIR/usr/share/lib/ccs/gprof.flat.blurb=usr/share/lib/ccs/gprof.flat.blurb 444 root bin - -#f none $SGSDIR/usr/bin/lex=usr/bin/lex 555 root bin -#s none $SGSDIR/usr/ccs/bin/lex=../../bin/lex -#f none $SGSDIR/usr/share/lib/ccs/nceucform=usr/share/lib/ccs/nceucform 644 root bin -#f none $SGSDIR/usr/share/lib/ccs/ncform=usr/share/lib/ccs/ncform 644 root bin -#f none $SGSDIR/usr/share/lib/ccs/nrform=usr/share/lib/ccs/nrform 644 root bin -#f none $SGSDIR/usr/lib/libl.so.1=usr/lib/libl.so.1 755 root bin -#s none $SGSDIR/usr/lib/libl.so=./libl.so.1 -#f none $SGSDIR/usr/lib/llib-ll.ln=usr/lib/llib-ll.ln 644 root bin -#f none $SGSDIR/usr/lib/llib-ll=usr/lib/llib-ll 644 root bin - -#f none $SGSDIR/usr/bin/lorder=usr/bin/lorder 555 root bin -#s none $SGSDIR/usr/ccs/bin/lorder=../../bin/lorder - -#f none $SGSDIR/usr/bin/m4=usr/bin/m4 555 root bin -#s none $SGSDIR/usr/ccs/bin/m4=../../bin/m4 -#f none $SGSDIR/usr/xpg4/bin/m4=usr/xpg4/bin/m4 0555 root bin - -#f none $SGSDIR/usr/bin/prof=usr/bin/prof 555 root bin -#s none $SGSDIR/usr/ccs/bin/prof=../../bin/prof - -#f none $SGSDIR/usr/bin/ranlib=usr/bin/ranlib 555 root bin -#s none $SGSDIR/usr/ccs/bin/ranlib=../../bin/ranlib - -#f none $SGSDIR/usr/bin/size=usr/bin/size 555 root bin -#s none $SGSDIR/usr/ccs/bin/size=../../bin/size - -#f none $SGSDIR/usr/bin/symorder=usr/bin/symorder 555 root bin -#s none $SGSDIR/usr/ccs/bin/symorder=../../bin/symorder - -#f none $SGSDIR/usr/bin/tsort=usr/bin/tsort 555 root bin -#s none $SGSDIR/usr/ccs/bin/tsort=../../bin/tsort - -#f none $SGSDIR/usr/bin/unifdef=usr/bin/unifdef 555 root bin -#s none $SGSDIR/usr/ccs/bin/unifdef=../../bin/unifdef - -#f none $SGSDIR/usr/bin/yacc=usr/bin/yacc 555 root bin -#s none $SGSDIR/usr/ccs/bin/yacc=../../bin/yacc -#f none $SGSDIR/usr/share/lib/ccs/yaccpar=usr/share/lib/ccs/yaccpar 644 root bin -#s none $SGSDIR/usr/ccs/bin/yaccpar=../../share/lib/ccs/yaccpar -#f none $SGSDIR/usr/lib/liby.so.1=usr/lib/liby.so.1 755 root bin -#s none $SGSDIR/usr/lib/liby.so=./liby.so.1 -#f none $SGSDIR/usr/lib/llib-ly.ln=usr/lib/llib-ly.ln 644 root bin -#f none $SGSDIR/usr/lib/llib-ly=usr/lib/llib-ly 644 root bin diff --git a/usr/src/cmd/sgs/packages/common/prototype_i386 b/usr/src/cmd/sgs/packages/common/prototype_i386 deleted file mode 100644 index b17f7b4a46..0000000000 --- a/usr/src/cmd/sgs/packages/common/prototype_i386 +++ /dev/null @@ -1,119 +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 (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. -# -# This required package information file contains a list of package contents. -# The 'pkgmk' command uses this file to identify the contents of a package -# and their location on the development machine when building the package. -# Can be created via a text editor or through use of the 'pkgproto' command. - -#!search <pathname pathname ...> # where to find pkg objects -#!include <filename> # include another 'prototype' file -#!default <mode> <owner> <group> # default used if not specified on entry -#!<param>=<value> # puts parameter in pkg environment - -!include prototype_com - -d none $SGSDIR/lib/amd64=lib/amd64 755 root bin -s none $SGSDIR/lib/64=amd64 -f none $SGSDIR/lib/amd64/ld.so.1=lib/amd64/ld.so.1 755 root bin -f none $SGSDIR/lib/amd64/libdl.so.1=lib/amd64/libdl.so.1 755 root bin -s none $SGSDIR/lib/amd64/libdl.so=libdl.so.1 -f none $SGSDIR/lib/amd64/libelf.so.1=lib/amd64/libelf.so.1 755 root bin -s none $SGSDIR/lib/amd64/libelf.so=libelf.so.1 -f none $SGSDIR/lib/amd64/libld.so.4=lib/amd64/libld.so.4 755 root bin -f none $SGSDIR/lib/amd64/liblddbg.so.4=lib/amd64/liblddbg.so.4 755 root bin -f none $SGSDIR/lib/amd64/librtld.so.1=lib/amd64/librtld.so.1 755 root bin -f none $SGSDIR/lib/amd64/librtld_db.so.1=lib/amd64/librtld_db.so.1 755 root bin -s none $SGSDIR/lib/amd64/librtld_db.so=librtld_db.so.1 -d none $SGSDIR/usr/bin/amd64 755 root bin -f none $SGSDIR/usr/bin/amd64/ar=usr/bin/amd64/ar 555 root bin -s none $SGSDIR/usr/ccs/bin/amd64/ar=../../bin/amd64/ar -f none $SGSDIR/usr/bin/amd64/crle=usr/bin/amd64/crle 555 root bin -f none $SGSDIR/usr/bin/amd64/ldd=usr/bin/amd64/ldd 555 root bin -f none $SGSDIR/usr/bin/amd64/moe=usr/bin/amd64/moe 555 root bin -f none $SGSDIR/usr/bin/amd64/pvs=usr/bin/amd64/pvs 555 root bin -d none $SGSDIR/usr/ccs/bin/amd64 755 root bin -f none $SGSDIR/usr/bin/amd64/dump=usr/bin/amd64/dump 0555 root bin -s none $SGSDIR/usr/ccs/bin/amd64/dump=../../../bin/amd64/dump -f none $SGSDIR/usr/bin/amd64/elfdump=usr/bin/amd64/elfdump 0555 root bin -s none $SGSDIR/usr/ccs/bin/amd64/elfdump=../../../bin/amd64/elfdump -f none $SGSDIR/usr/bin/amd64/elfedit=usr/bin/amd64/elfedit 0555 root bin -f none $SGSDIR/usr/bin/amd64/elfwrap=usr/bin/amd64/elfwrap 0555 root bin -f none $SGSDIR/usr/bin/amd64/ld=usr/bin/amd64/ld 755 root bin -s none $SGSDIR/usr/ccs/bin/amd64/ld=../../../bin/amd64/ld -f none $SGSDIR/usr/bin/amd64/nm=usr/bin/amd64/nm 0555 root bin -s none $SGSDIR/usr/ccs/bin/amd64/nm=../../../bin/amd64/nm -f none $SGSDIR/usr/bin/amd64/mcs=usr/bin/amd64/mcs 0555 root bin -s none $SGSDIR/usr/ccs/bin/amd64/mcs=../../../bin/amd64/mcs -l none $SGSDIR/usr/bin/amd64/strip=./mcs -s none $SGSDIR/usr/ccs/bin/amd64/strip=../../../bin/amd64/strip -d none $SGSDIR/usr/lib/elfedit/amd64 755 root bin -s none $SGSDIR/usr/lib/elfedit/64=amd64 -f none $SGSDIR/usr/lib/elfedit/amd64/cap.so=usr/lib/elfedit/amd64/cap.so 755 root bin -f none $SGSDIR/usr/lib/elfedit/amd64/dyn.so=usr/lib/elfedit/amd64/dyn.so 755 root bin -f none $SGSDIR/usr/lib/elfedit/amd64/ehdr.so=usr/lib/elfedit/amd64/ehdr.so 755 root bin -f none $SGSDIR/usr/lib/elfedit/amd64/phdr.so=usr/lib/elfedit/amd64/phdr.so 755 root bin -f none $SGSDIR/usr/lib/elfedit/amd64/shdr.so=usr/lib/elfedit/amd64/shdr.so 755 root bin -f none $SGSDIR/usr/lib/elfedit/amd64/str.so=usr/lib/elfedit/amd64/str.so 755 root bin -f none $SGSDIR/usr/lib/elfedit/amd64/sym.so=usr/lib/elfedit/amd64/sym.so 755 root bin -f none $SGSDIR/usr/lib/elfedit/amd64/syminfo.so=usr/lib/elfedit/amd64/syminfo.so 755 root bin -d none $SGSDIR/usr/lib/link_audit/amd64 755 root bin -s none $SGSDIR/usr/lib/link_audit/64=amd64 -f none $SGSDIR/usr/lib/link_audit/amd64/ldprof.so.1=usr/lib/link_audit/amd64/ldprof.so.1 755 root bin -f none $SGSDIR/usr/lib/link_audit/amd64/truss.so.1=usr/lib/link_audit/amd64/truss.so.1 755 root bin -f none $SGSDIR/usr/lib/link_audit/amd64/who.so.1=usr/lib/link_audit/amd64/who.so.1 755 root bin -d none $SGSDIR/usr/lib/mdb/proc/amd64 755 root sys -f none $SGSDIR/usr/lib/mdb/proc/amd64/ld.so=usr/lib/mdb/proc/amd64/ld.so 555 root sys -d none $SGSDIR/usr/lib/secure/amd64 755 root bin -s none $SGSDIR/usr/lib/secure/64=amd64 -d none $SGSDIR/usr/lib/amd64 755 root bin -s none $SGSDIR/usr/lib/64=amd64 -f none $SGSDIR/usr/lib/amd64/lddstub=usr/lib/amd64/lddstub 555 root bin -f none $SGSDIR/usr/lib/amd64/libcrle.so.1=usr/lib/amd64/libcrle.so.1 755 root bin -f none $SGSDIR/usr/lib/amd64/libldstab.so.1=usr/lib/amd64/libldstab.so.1 755 root bin -d none opt/SUNWonld/bin/amd64 755 root bin -f none opt/SUNWonld/bin/amd64/rdb 755 root bin -d none opt/SUNWonld/lib/amd64 755 root bin -s none opt/SUNWonld/lib/64=amd64 -f none opt/SUNWonld/lib/amd64/libldmake.so.1 755 root bin -f none opt/SUNWonld/lib/amd64/bindings.so.1 755 root bin -f none opt/SUNWonld/lib/amd64/perfcnt.so.1 755 root bin -f none opt/SUNWonld/lib/amd64/symbindrep.so.1 755 root bin - -# -# The following commented items are for things that exist within -# usr/src/cmd/sgs, but which are not normally considered to be -# part of the SUNWonld package. It is possible to add these items -# to a special-purpose SUNWonld by uncommenting the appropriate lines. -# -#f none $SGSDIR/usr/lib/amd64/libl.so.1=usr/lib/amd64/libl.so.1 755 root bin -#s none $SGSDIR/usr/lib/amd64/libl.so=./libl.so.1 -#f none $SGSDIR/usr/lib/amd64/llib-ll.ln=usr/lib/amd64/llib-ll.ln 644 root bin - -#f none $SGSDIR/usr/bin/amd64/size=usr/bin/amd64/size 555 root bin -#s none $SGSDIR/usr/ccs/bin/amd64/size=../../../bin/amd64/size - -#f none $SGSDIR/usr/lib/amd64/liby.so.1=usr/lib/amd64/liby.so.1 755 root bin -#s none $SGSDIR/usr/lib/amd64/liby.so=./liby.so.1 -#f none $SGSDIR/usr/lib/amd64/llib-ly.ln=usr/lib/amd64/llib-ly.ln 644 root bin diff --git a/usr/src/cmd/sgs/packages/common/prototype_sparc b/usr/src/cmd/sgs/packages/common/prototype_sparc deleted file mode 100644 index 6f6e6f317c..0000000000 --- a/usr/src/cmd/sgs/packages/common/prototype_sparc +++ /dev/null @@ -1,120 +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 (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. -# -# This required package information file contains a list of package contents. -# The 'pkgmk' command uses this file to identify the contents of a package -# and their location on the development machine when building the package. -# Can be created via a text editor or through use of the 'pkgproto' command. - -#!search <pathname pathname ...> # where to find pkg objects -#!include <filename> # include another 'prototype' file -#!default <mode> <owner> <group> # default used if not specified on entry -#!<param>=<value> # puts parameter in pkg environment - -!include prototype_com - -d none $SGSDIR/lib/sparcv9=lib/sparcv9 755 root bin -s none $SGSDIR/lib/64=sparcv9 -f none $SGSDIR/lib/sparcv9/ld.so.1=lib/sparcv9/ld.so.1 755 root bin -f none $SGSDIR/lib/sparcv9/libdl.so.1=lib/sparcv9/libdl.so.1 755 root bin -s none $SGSDIR/lib/sparcv9/libdl.so=libdl.so.1 -f none $SGSDIR/lib/sparcv9/libelf.so.1=lib/sparcv9/libelf.so.1 755 root bin -s none $SGSDIR/lib/sparcv9/libelf.so=libelf.so.1 -f none $SGSDIR/lib/sparcv9/libld.so.4=lib/sparcv9/libld.so.4 755 root bin -f none $SGSDIR/lib/sparcv9/liblddbg.so.4=lib/sparcv9/liblddbg.so.4 755 root bin -f none $SGSDIR/lib/sparcv9/librtld.so.1=lib/sparcv9/librtld.so.1 755 root bin -f none $SGSDIR/lib/sparcv9/librtld_db.so.1=lib/sparcv9/librtld_db.so.1 755 root bin -s none $SGSDIR/lib/sparcv9/librtld_db.so=librtld_db.so.1 -d none $SGSDIR/usr/bin/sparcv9 755 root bin -f none $SGSDIR/usr/bin/sparcv9/ar=usr/bin/sparcv9/ar 555 root bin -s none $SGSDIR/usr/ccs/bin/sparcv9/ar=../../bin/sparcv9/ar -f none $SGSDIR/usr/bin/sparcv9/crle=usr/bin/sparcv9/crle 555 root bin -f none $SGSDIR/usr/bin/sparcv9/ldd=usr/bin/sparcv9/ldd 555 root bin -f none $SGSDIR/usr/bin/sparcv9/moe=usr/bin/sparcv9/moe 555 root bin -f none $SGSDIR/usr/bin/sparcv9/pvs=usr/bin/sparcv9/pvs 555 root bin -d none $SGSDIR/usr/ccs/bin/sparcv9 755 root bin -f none $SGSDIR/usr/bin/sparcv9/dump=usr/bin/sparcv9/dump 0555 root bin -s none $SGSDIR/usr/ccs/bin/sparcv9/dump=../../../bin/sparcv9/dump -f none $SGSDIR/usr/bin/sparcv9/elfdump=usr/bin/sparcv9/elfdump 0555 root bin -s none $SGSDIR/usr/ccs/bin/sparcv9/elfdump=../../../bin/sparcv9/elfdump -f none $SGSDIR/usr/bin/sparcv9/elfedit=usr/bin/sparcv9/elfedit 0555 root bin -f none $SGSDIR/usr/bin/sparcv9/elfwrap=usr/bin/sparcv9/elfwrap 0555 root bin -f none $SGSDIR/usr/bin/sparcv9/ld=usr/bin/sparcv9/ld 755 root bin -s none $SGSDIR/usr/ccs/bin/sparcv9/ld=../../../bin/sparcv9/ld -f none $SGSDIR/usr/bin/sparcv9/nm=usr/bin/sparcv9/nm 0555 root bin -s none $SGSDIR/usr/ccs/bin/sparcv9/nm=../../../bin/sparcv9/nm 0555 root bin -f none $SGSDIR/usr/bin/sparcv9/mcs=usr/bin/sparcv9/mcs 0555 root bin -s none $SGSDIR/usr/ccs/bin/sparcv9/mcs=../../../bin/sparcv9/mcs 0555 root bin -l none $SGSDIR/usr/bin/sparcv9/strip=./mcs -s none $SGSDIR/usr/ccs/bin/sparcv9/strip=../../../bin/sparcv9/strip -f none $SGSDIR/usr/lib/ld.so=usr/lib/ld.so 755 root bin -d none $SGSDIR/usr/lib/elfedit/sparcv9 755 root bin -s none $SGSDIR/usr/lib/elfedit/64=sparcv9 -f none $SGSDIR/usr/lib/elfedit/sparcv9/cap.so=usr/lib/elfedit/sparcv9/cap.so 755 root bin -f none $SGSDIR/usr/lib/elfedit/sparcv9/dyn.so=usr/lib/elfedit/sparcv9/dyn.so 755 root bin -f none $SGSDIR/usr/lib/elfedit/sparcv9/ehdr.so=usr/lib/elfedit/sparcv9/ehdr.so 755 root bin -f none $SGSDIR/usr/lib/elfedit/sparcv9/phdr.so=usr/lib/elfedit/sparcv9/phdr.so 755 root bin -f none $SGSDIR/usr/lib/elfedit/sparcv9/shdr.so=usr/lib/elfedit/sparcv9/shdr.so 755 root bin -f none $SGSDIR/usr/lib/elfedit/sparcv9/str.so=usr/lib/elfedit/sparcv9/str.so 755 root bin -f none $SGSDIR/usr/lib/elfedit/sparcv9/sym.so=usr/lib/elfedit/sparcv9/sym.so 755 root bin -f none $SGSDIR/usr/lib/elfedit/sparcv9/syminfo.so=usr/lib/elfedit/sparcv9/syminfo.so 755 root bin -d none $SGSDIR/usr/lib/link_audit/sparcv9 755 root bin -s none $SGSDIR/usr/lib/link_audit/64=sparcv9 -f none $SGSDIR/usr/lib/link_audit/sparcv9/ldprof.so.1=usr/lib/link_audit/sparcv9/ldprof.so.1 755 root bin -f none $SGSDIR/usr/lib/link_audit/sparcv9/truss.so.1=usr/lib/link_audit/sparcv9/truss.so.1 755 root bin -f none $SGSDIR/usr/lib/link_audit/sparcv9/who.so.1=usr/lib/link_audit/sparcv9/who.so.1 755 root bin -d none $SGSDIR/usr/lib/mdb/proc/sparcv9 755 root sys -f none $SGSDIR/usr/lib/mdb/proc/sparcv9/ld.so=usr/lib/mdb/proc/sparcv9/ld.so 555 root sys -d none $SGSDIR/usr/lib/secure/sparcv9 755 root bin -s none $SGSDIR/usr/lib/secure/64=sparcv9 -d none $SGSDIR/usr/lib/sparcv9 755 root bin -s none $SGSDIR/usr/lib/64=sparcv9 -f none $SGSDIR/usr/lib/sparcv9/lddstub=usr/lib/sparcv9/lddstub 555 root bin -f none $SGSDIR/usr/lib/sparcv9/libcrle.so.1=usr/lib/sparcv9/libcrle.so.1 755 root bin -f none $SGSDIR/usr/lib/sparcv9/libldstab.so.1=usr/lib/sparcv9/libldstab.so.1 755 root bin -d none opt/SUNWonld/bin/sparcv9 755 root bin -f none opt/SUNWonld/bin/sparcv9/rdb 755 root bin -d none opt/SUNWonld/lib/sparcv9 755 root bin -s none opt/SUNWonld/lib/64=sparcv9 -f none opt/SUNWonld/lib/sparcv9/libldmake.so.1 755 root bin -f none opt/SUNWonld/lib/sparcv9/bindings.so.1 755 root bin -f none opt/SUNWonld/lib/sparcv9/perfcnt.so.1 755 root bin -f none opt/SUNWonld/lib/sparcv9/symbindrep.so.1 755 root bin - -# -# The following commented items are for things that exist within -# usr/src/cmd/sgs, but which are not normally considered to be -# part of the SUNWonld package. It is possible to add these items -# to a special-purpose SUNWonld by uncommenting the appropriate lines. -# -#f none $SGSDIR/usr/lib/sparcv9/libl.so.1=usr/lib/sparcv9/libl.so.1 755 root bin -#s none $SGSDIR/usr/lib/sparcv9/libl.so=./libl.so.1 -#f none $SGSDIR/usr/lib/sparcv9/llib-ll.ln=usr/lib/sparcv9/llib-ll.ln 644 root bin - -#f none $SGSDIR/usr/bin/sparcv9/size=usr/bin/sparcv9/size 555 root bin -#s none $SGSDIR/usr/ccs/bin/sparcv9/size=../../../bin/sparcv9/size - -#f none $SGSDIR/usr/lib/sparcv9/liby.so.1=usr/lib/sparcv9/liby.so.1 755 root bin -#s none $SGSDIR/usr/lib/sparcv9/liby.so=./liby.so.1 -#f none $SGSDIR/usr/lib/sparcv9/llib-ly.ln=usr/lib/sparcv9/llib-ly.ln 644 root bin diff --git a/usr/src/cmd/sgs/packages/i386/Makefile b/usr/src/cmd/sgs/packages/i386/Makefile deleted file mode 100644 index 6158a1c608..0000000000 --- a/usr/src/cmd/sgs/packages/i386/Makefile +++ /dev/null @@ -1,36 +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 (c) 1993 by Sun Microsystems, Inc. -# - - -include ../Makefile.com - -.KEEP_STATE: - -all: $(FILES) -install: all $(ROOTREADME) .WAIT pkg - -include ../Makefile.targ diff --git a/usr/src/cmd/sgs/prof/Makefile.com b/usr/src/cmd/sgs/prof/Makefile.com index d713f56acc..52e0bd1031 100644 --- a/usr/src/cmd/sgs/prof/Makefile.com +++ b/usr/src/cmd/sgs/prof/Makefile.com @@ -48,7 +48,7 @@ CERRWARN += $(CNOWARN_UNINIT) # not linted SMATCH=off -LDLIBS += $(CONVLIBDIR) $(CONV_LIB) $(ELFLIBDIR) -lelf +LDLIBS += $(CONVLIBDIR) -lconv $(ELFLIBDIR) -lelf %.o: ../common/%.c $(COMPILE.c) $< diff --git a/usr/src/cmd/sgs/pvs/Makefile.com b/usr/src/cmd/sgs/pvs/Makefile.com index 31239a7d0d..e34c937975 100644 --- a/usr/src/cmd/sgs/pvs/Makefile.com +++ b/usr/src/cmd/sgs/pvs/Makefile.com @@ -35,19 +35,19 @@ include $(SRC)/cmd/sgs/Makefile.com COMOBJ= pvs.o BLTOBJ= msg.o -TOOLOBJS = alist.o +SGSCOMMONOBJ = alist.o -OBJS= $(BLTOBJ) $(COMOBJ) $(TOOLOBJS) +OBJS= $(BLTOBJ) $(COMOBJ) $(SGSCOMMONOBJ) MAPFILE= $(MAPFILE.NGB) MAPOPTS= $(MAPFILE:%=-M%) -CPPFLAGS += -I$(SRCBASE)/lib/libc/inc +CPPFLAGS += -I$(SRC)/lib/libc/inc LLDFLAGS = '-R$$ORIGIN/../lib' LLDFLAGS64 = '-R$$ORIGIN/../../lib/$(MACH64)' -LDFLAGS += $(VERSREF) $(CC_USE_PROTO) $(MAPOPTS) $(LLDFLAGS) -LDLIBS += $(LDDBGLIBDIR) $(LDDBG_LIB) $(ELFLIBDIR) -lelf \ - $(CONVLIBDIR) $(CONV_LIB) +LDFLAGS += $(VERSREF) $(MAPOPTS) $(LLDFLAGS) +LDLIBS += $(LDDBGLIBDIR) -llddbg $(ELFLIBDIR) -lelf \ + $(CONVLIBDIR) -lconv # not linted SMATCH=off @@ -65,6 +65,6 @@ SGSMSGALL= $(SGSMSGCOM) SGSMSGFLAGS += -h $(BLTDEFS) -d $(BLTDATA) -m $(BLTMESG) -n pvs_msg SRCS= $(COMOBJ:%.o=../common/%.c) $(BLTDATA) \ - $(TOOLOBJS:%.o=$(SGSTOOLS)/common/%.c) + $(SGSCOMMONOBJ:%.o=$(SGSCOMMON)/%.c) CLEANFILES += $(BLTFILES) diff --git a/usr/src/cmd/sgs/pvs/Makefile.targ b/usr/src/cmd/sgs/pvs/Makefile.targ index 444f1e4bc9..2069a4615c 100644 --- a/usr/src/cmd/sgs/pvs/Makefile.targ +++ b/usr/src/cmd/sgs/pvs/Makefile.targ @@ -29,7 +29,7 @@ $(COMPILE.c) $< $(POST_PROCESS_O) -%.o: $(SGSTOOLS)/common/%.c +%.o: $(SGSCOMMON)/%.c $(COMPILE.c) -o $@ $< $(POST_PROCESS_O) diff --git a/usr/src/cmd/sgs/rtld/Makefile.com b/usr/src/cmd/sgs/rtld/Makefile.com index fbdede2a9e..6a767de04b 100644 --- a/usr/src/cmd/sgs/rtld/Makefile.com +++ b/usr/src/cmd/sgs/rtld/Makefile.com @@ -29,13 +29,13 @@ RTLD= ld.so.1 AVLOBJ= avl.o DTROBJ= dtrace_data.o -TOOLOBJS= alist.o strhash.o +SGSCOMMONOBJ= alist.o strhash.o BLTOBJ= msg.o ELFCAPOBJ= elfcap.o OBJECTS= $(BLTOBJ) \ $(AVLOBJ) \ $(DTROBJ) \ - $(TOOLOBJS) \ + $(SGSCOMMONOBJ) \ $(ELFCAPOBJ) \ $(P_ASOBJS) $(P_COMOBJS) $(P_MACHOBJS) $(G_MACHOBJS) \ $(S_ASOBJS) $(S_COMOBJS) $(S_MACHOBJS) $(CP_MACHOBJS) @@ -75,10 +75,10 @@ ROOTDYNLIB64= $(RTLD:%=$(ROOTFS_LIBDIR64)/%) FILEMODE = 755 -CPPFLAGS += -I$(SRCBASE)/lib/libc/inc \ - -I$(SRCBASE)/uts/common/krtld \ - -I$(SRCBASE)/uts/$(PLAT) \ - -I$(SRCBASE)/uts/$(PLAT)/krtld \ +CPPFLAGS += -I$(SRC)/lib/libc/inc \ + -I$(SRC)/uts/common/krtld \ + -I$(SRC)/uts/$(PLAT) \ + -I$(SRC)/uts/$(PLAT)/krtld \ -I$(SRC)/common/sgsrtcid \ -I$(ELFCAP) \ $(CPPFEATUREMACROS) @@ -101,11 +101,11 @@ CPICLIB = $(VAR_RTLD_CPICLIB) CPICLIB64 = $(VAR_RTLD_CPICLIB64) CLIB = -lc_pic -LDLIBS += $(CONVLIBDIR) $(CONV_LIB) \ +LDLIBS += $(CONVLIBDIR) -lconv \ $(CPICLIB) $(CLIB) \ - $(LDDBGLIBDIR) $(LDDBG_LIB) \ + $(LDDBGLIBDIR) -llddbg \ $(RTLDLIB) -lrtld \ - $(LDLIB) $(LD_LIB) + $(LDLIB) -lld DYNFLAGS += -i -e _rt_boot $(VERSREF) $(ZNODLOPEN) \ $(ZINTERPOSE) -zdtrace=dtrace_data '-R$$ORIGIN' @@ -138,9 +138,9 @@ SGSMSGFLAGS2= $(SGSMSGFLAGS) -h $(BLTDEFS) -d $(BLTDATA) -n rtld_msg SRCS= $(AVLOBJ:%.o=$(VAR_AVLDIR)/%.c) \ $(DTROBJ:%.o=$(VAR_DTRDIR)/%.c) \ - $(TOOLOBJS:%.o=$(SGSTOOLS)/common/%.c) \ + $(SGSCOMMONOBJ:%.o=$(SGSCOMMON)/%.c) \ $(COMOBJS:%.o=../common/%.c) $(MACHOBJS:%.o=%.c) $(BLTDATA) \ - $(G_MACHOBJS:%.o=$(SRCBASE)/uts/$(PLAT)/krtld/%.c) \ + $(G_MACHOBJS:%.o=$(SRC)/uts/$(PLAT)/krtld/%.c) \ $(CP_MACHOBJS:%.o=../$(MACH)/%.c) \ $(ASOBJS:%.o=%.s) diff --git a/usr/src/cmd/sgs/rtld/Makefile.targ b/usr/src/cmd/sgs/rtld/Makefile.targ index 6ea1a29e6d..ff2ccf9864 100644 --- a/usr/src/cmd/sgs/rtld/Makefile.targ +++ b/usr/src/cmd/sgs/rtld/Makefile.targ @@ -58,11 +58,11 @@ pics/%.o: $(VAR_DTRDIR)/%.c $(COMPILE.c) -o $@ $< $(POST_PROCESS_O) -pics/%.o: $(SGSTOOLS)/common/%.c +pics/%.o: $(SGSCOMMON)/%.c $(COMPILE.c) -o $@ $< $(POST_PROCESS_O) -pics/%.o: $(SRCBASE)/uts/$(PLAT)/krtld/%.c +pics/%.o: $(SRC)/uts/$(PLAT)/krtld/%.c $(COMPILE.c) -o $@ $< $(POST_PROCESS_O) @@ -71,7 +71,7 @@ pics/elfcap.o: $(ELFCAP)/elfcap.c $(POST_PROCESS_O) $(RTLD): pics $(PICS) $(CRTS) - $(LD_USE_PROTO)ld -o $@ -dy -G $(DYNFLAGS) $(CRTI) $(PICS) \ + $(LD) -o $@ -dy -G $(DYNFLAGS) $(CRTI) $(PICS) \ $(LDLIBS) $(CRTN) $(POST_PROCESS_SO) diff --git a/usr/src/cmd/sgs/rtld/mdbmod/Makefile.com b/usr/src/cmd/sgs/rtld/mdbmod/Makefile.com index e7cfe1137f..4f654ba8c4 100644 --- a/usr/src/cmd/sgs/rtld/mdbmod/Makefile.com +++ b/usr/src/cmd/sgs/rtld/mdbmod/Makefile.com @@ -66,7 +66,7 @@ CPPFLAGS += -I. -I../common -I../../common -I../../../include \ -I$(SRC)/uts/$(ARCH)/sys DYNFLAGS += $(VERSREF) -LDLIBS += $(CONVLIBDIR) $(CONV_LIB) -lc +LDLIBS += $(CONVLIBDIR) -lconv -lc ROOTMDBLIB= $(ROOT)/usr/lib/mdb/proc ROOTMDBLIB64= $(ROOTMDBLIB)/$(MACH64) diff --git a/usr/src/cmd/sgs/rtld/sparc/Makefile b/usr/src/cmd/sgs/rtld/sparc/Makefile index 4c60c5c8d6..d63f57b13a 100644 --- a/usr/src/cmd/sgs/rtld/sparc/Makefile +++ b/usr/src/cmd/sgs/rtld/sparc/Makefile @@ -53,7 +53,7 @@ CRTI= pics/crti.o CRTN= pics/crtn.o CRTS= $(CRTI) $(CRTN) -CHKSRCS= $(SRCBASE)/uts/common/krtld/reloc.h +CHKSRCS= $(SRC)/uts/common/krtld/reloc.h BASEPLAT = sparc diff --git a/usr/src/cmd/sgs/rtld/sparcv9/Makefile b/usr/src/cmd/sgs/rtld/sparcv9/Makefile index d351ee66da..87593bc6d2 100644 --- a/usr/src/cmd/sgs/rtld/sparcv9/Makefile +++ b/usr/src/cmd/sgs/rtld/sparcv9/Makefile @@ -52,7 +52,7 @@ CRTI= pics/crti.o CRTN= pics/crtn.o CRTS= $(CRTI) $(CRTN) -CHKSRCS= $(SRCBASE)/uts/common/krtld/reloc.h +CHKSRCS= $(SRC)/uts/common/krtld/reloc.h BASEPLAT = sparc diff --git a/usr/src/cmd/sgs/size/Makefile.com b/usr/src/cmd/sgs/size/Makefile.com index bba1a33384..d835b55ce3 100644 --- a/usr/src/cmd/sgs/size/Makefile.com +++ b/usr/src/cmd/sgs/size/Makefile.com @@ -44,6 +44,6 @@ LLDFLAGS = '$(LDPASS)-R$$ORIGIN/../../lib' LLDFLAGS64 = '$(LDPASS)-R$$ORIGIN/../../../lib/$(MACH64)' LDFLAGS += $(LLDFLAGS) -LDLIBS += $(CONVLIBDIR) $(CONV_LIB) $(ELFLIBDIR) -lelf +LDLIBS += $(CONVLIBDIR) -lconv $(ELFLIBDIR) -lelf CLEANFILES += $(OBJS) diff --git a/usr/src/cmd/sgs/tools/Makefile b/usr/src/cmd/sgs/tools/Makefile index eacc1f10a8..0d65dff41f 100644 --- a/usr/src/cmd/sgs/tools/Makefile +++ b/usr/src/cmd/sgs/tools/Makefile @@ -38,20 +38,7 @@ include $(SRC)/Makefile.master -LSSRCS= info.sh \ - proto.sh - -SRCS= $(LSSRCS) - -LEXECS= $(LSSRCS:%.sh=%) - -ROOTDIR = $(ROOT)/opt/SUNWonld/bin -ROOTPROGS = $(GEXECS:%=$(ROOTDIR)/%) -ROOTPROGS += $(PSRCS:%=$(ROOTDIR)/%) - -$(ROOTPROGS) := FILEMODE=755 - -SUBDIRS= $(MACH) man +SUBDIRS= $(MACH) all:= TARGET= all install:= TARGET= install @@ -61,29 +48,11 @@ clobber:= TARGET= clobber .KEEP_STATE: -all: $(EXECS) $(SUBDIRS) - -install: all $(ROOTPROGS) $(SUBDIRS) - -clean clobber: $(SUBDIRS) - $(RM) $(RMFLAGS) $(EXECS) +all install clean clobberall: $(SUBDIRS) delete: -%: %.ksh - $(RM) $@ - cat $< > $@ - chmod +x $@ - $(SUBDIRS): FRC @cd $@; pwd; $(MAKE) $(TARGET) -$(ROOTDIR)/%: % - $(INS.file) - -$(ROOTDIR)/%: scoping/% - $(INS.file) - FRC: - -execs: $(EXECS) diff --git a/usr/src/cmd/sgs/tools/Makefile.com b/usr/src/cmd/sgs/tools/Makefile.com index 91e4cfa27f..be05c9f0a3 100644 --- a/usr/src/cmd/sgs/tools/Makefile.com +++ b/usr/src/cmd/sgs/tools/Makefile.com @@ -29,8 +29,9 @@ # # Makefile to support tools used for linker development: # -# o sgsmsg creates message headers/arrays/catalogs (a native tool). +# piglatin - generates phone message catalogs for testing # + # Note, these tools are not part of the product. # # cmd/sgs/tools/Makefile.com @@ -39,29 +40,12 @@ include $(SRC)/cmd/Makefile.cmd include $(SRC)/cmd/sgs/Makefile.com -SGSPROTO= ../../proto/$(MACH) - -COMOBJS= - -NATOBJS= piglatin.o - -OBJECTS= $(COMOBJS) $(NATOBJS) - -AVLOBJ= avl.o -TOOL_OBJS= sgsmsg.o string_table.o findprime.o assfail.o -SGSMSG_OBJS= $(TOOL_OBJS) $(AVLOBJ) -SGSMSG_SRCS= $(TOOL_OBJS:%.o=../common/%.c) \ - $(AVLOBJ:%.o=$(VAR_AVLDIR)/%.c) - -$(SGSMSG_OBJS) := NATIVE_CFLAGS += -I../../include $(VAR_TOOLS_CPPFLAGS) +OBJECTS= piglatin.o -PROGS= $(COMOBJS:%.o=%) -NATIVE= $(NATOBJS:%.o=%) sgsmsg -SRCS= $(COMOBJS:%.o=../common/%.c) $(NATOBJS:%.o=../common/%.c) +NATIVE= $(OBJECTS:%.o=%) +SRCS= $(OBJECTS:%.o=../common/%.c) CPPFLAGS += $(VAR_TOOLS_CPPFLAGS) -LDFLAGS += $(CC_USE_PROTO) -CLEANFILES += $(SGSMSG_OBJS) ROOTDIR= $(ROOT)/opt/SUNWonld ROOTPROGS= $(PROGS:%=$(ROOTDIR)/bin/%) diff --git a/usr/src/cmd/sgs/tools/Makefile.targ b/usr/src/cmd/sgs/tools/Makefile.targ index 2bde89ba1b..5d37f9bb65 100644 --- a/usr/src/cmd/sgs/tools/Makefile.targ +++ b/usr/src/cmd/sgs/tools/Makefile.targ @@ -33,21 +33,6 @@ $(ROOTDIR)/bin/%: % $(ROOTDIR)/lib/%: % $(INS.file) -sgsmsg: $(SGSMSG_OBJS) - $(NATIVECC) $(DEBUG) $(NATIVE_CFLAGS) \ - -o $@ $(SGSMSG_OBJS) - -sgsmsg.o: ../common/sgsmsg.c - $(NATIVECC) $(DEBUG) $(NATIVE_CFLAGS) -c ../common/sgsmsg.c - -string_table.o: ../common/string_table.c - $(NATIVECC) $(DEBUG) $(NATIVE_CFLAGS) -c \ - ../common/string_table.c - -avl.o: $(VAR_AVLDIR)/avl.c - $(NATIVECC) $(DEBUG) $(NATIVE_CFLAGS) -c \ - $(VAR_AVLDIR)/avl.c - piglatin: ../common/piglatin.c $(NATIVECC) $(NATIVE_CFLAGS) -o $@ ../common/piglatin.c @@ -59,8 +44,6 @@ piglatin: ../common/piglatin.c $(COMPILE.c) -o $@ $< $(POST_PROCESS_O) -catalog: sgsmsg - clobber: clean $(RM) $(PROGS) $(NATIVE) $(CLOBBERFILES) diff --git a/usr/src/cmd/sgs/packages/common/SUNWonld-README b/usr/src/cmd/sgs/tools/SUNWonld-README index 731e52c973..731e52c973 100644 --- a/usr/src/cmd/sgs/packages/common/SUNWonld-README +++ b/usr/src/cmd/sgs/tools/SUNWonld-README diff --git a/usr/src/cmd/sgs/tools/bld_lint.sh b/usr/src/cmd/sgs/tools/bld_lint.sh deleted file mode 100644 index 730a3fb9ee..0000000000 --- a/usr/src/cmd/sgs/tools/bld_lint.sh +++ /dev/null @@ -1,94 +0,0 @@ -#! /usr/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 -# - -# -# Copyright 2008 Sun Microsystems, Inc. All rights reserved. -# Use is subject to license terms. -# -# ident "%Z%%M% %I% %E% SMI" -# - -DASHES="============================================================" - -MACH= `uname -p` - -if [ $MACH = "sparc" ] -then - MACH64="sparcv9" -elif [ $MACH = "i386" ] -then - MACH64="amd64" -else - MACH64="unknown" -fi - -LOG=lint.$MACH.log - -# -# Keep the first run as a backup, so that subsequent runs can diff against it. -# -if [ -f $LOG ] -then - if [ ! -f $LOG.bak ] - then - mv $LOG $LOG.bak - else - rm -f $LOG - fi -fi - -# -# Grab the lint.out from all of our directories. -# -for ii in $* -do - if [ $ii = ".WAIT" ] - then - continue - fi - - # Concatinate the lint.out to our log file. -# echo $ii/$MACH >> $LOG - echo $DASHES >> $LOG - cat $ii/$MACH/lint.out >> $LOG - echo "\n" >> $LOG - - # If there is a 64-bit directory, tack that on as well. - if [ -f $ii/$MACH64/lint.out ] - then -# echo $ii/$MACH64 >> $LOG - echo $DASHES >> $LOG - cat $ii/$MACH64/lint.out >> $LOG - echo "\n" >> $LOG - fi -done - -# -# If there is a backup log, diff the current one against it. -# -if [ -f $LOG.bak ] -then - echo "Running diff on log file..." - diff $LOG.bak $LOG -fi - -exit 0 diff --git a/usr/src/cmd/sgs/tools/man/chkmsg.1l b/usr/src/cmd/sgs/tools/chkmsg.1l index cfe5f1ee7f..47d56dd3a1 100644 --- a/usr/src/cmd/sgs/tools/man/chkmsg.1l +++ b/usr/src/cmd/sgs/tools/chkmsg.1l @@ -1,4 +1,3 @@ -.\" ident "%Z%%M% %I% %E% SMI" .\" Copyright 2005 Sun Microsystems, Inc. All rights reserved. .\" Use is subject to license terms. .\" @@ -23,9 +22,9 @@ .\" CDDL HEADER END .\" .if n .tr \-- -.TH chkmsg 1l "5 Apr 1997" +.TH chkmsg 1l "Apr 5, 1997" .SH NAME -chkmsg \- cross check messages +chkmsg \- cross check messages .SH SYNOPSIS .B chkmsg .BI [ -64 ] @@ -38,7 +37,7 @@ chkmsg checks the message identifiers defined in the input file and the message identifyer used in the input source_files. The input file is the input file which is used by the sgsmsg command. .P -The chkmsg command reads the input file and +The chkmsg command reads the input file and generates two sets of message identifiers. The first set is the identifiers defined in between the _START_ and _END_ key words. @@ -83,8 +82,8 @@ directly passed to MSG_INTL() or MSG_ORIG(). Therefore, for example: .RE the identifyer MSG_ERROR_01 will not be included in MSG_INTL_FROM_SRC set. .P -There are two key words which can be used in the input file -to control whether the identifier will be extracted into +There are two key words which can be used in the input file +to control whether the identifier will be extracted into MSG_{INTL,ORIG}_FROM_ORIG or not. If the identifyer are surrounded by _CHKMSG_SKIP_BEGIN_ {sparc,i386} and _CHKMSG_SKIP_END_ {sparc,i386}, then @@ -114,8 +113,6 @@ Note that this option must be specified first on the command line. .BR ld (1), .BR msgfmt (1), .BR catgets (3C), -.BR gettext (3I). -.BR sgsmsg (1l). -.br -.TZ LLM +.BR gettext (3C). +.BR sgsmsg (1ONBLD). .if n .tr \-\- diff --git a/usr/src/cmd/sgs/tools/chkmsg.sh b/usr/src/cmd/sgs/tools/chkmsg.sh index 04d7be141f..31c5261e84 100644 --- a/usr/src/cmd/sgs/tools/chkmsg.sh +++ b/usr/src/cmd/sgs/tools/chkmsg.sh @@ -24,7 +24,6 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" TOOLDIR="${SRC}/cmd/sgs/tools/" diff --git a/usr/src/cmd/sgs/tools/i386/Makefile b/usr/src/cmd/sgs/tools/i386/Makefile index 44cab67a8f..3076c8026e 100644 --- a/usr/src/cmd/sgs/tools/i386/Makefile +++ b/usr/src/cmd/sgs/tools/i386/Makefile @@ -19,9 +19,6 @@ # # CDDL HEADER END # -# -#ident "%Z%%M% %I% %E% SMI" -# # Copyright (c) 1996 by Sun Microsystems, Inc. # All rights reserved. @@ -29,9 +26,7 @@ include $(SRC)/cmd/sgs/tools/Makefile.com .KEEP_STATE: -all: native $(PROGS) $(LIBS) - -native: $(NATIVE) +all: $(NATIVE) $(PROGS) $(LIBS) install: all $(ROOTPROGS) $(ROOTLIBS) diff --git a/usr/src/cmd/sgs/tools/man/Makefile b/usr/src/cmd/sgs/tools/man/Makefile deleted file mode 100644 index 3aca0b0af4..0000000000 --- a/usr/src/cmd/sgs/tools/man/Makefile +++ /dev/null @@ -1,50 +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 2003 Sun Microsystems, Inc. All rights reserved. -# Use is subject to license terms. -# -# Copyright 2019 OmniOS Community Edition (OmniOSce) Association. -# - -MAN1l= chkmsg.1l \ - sgsmsg.1l - -MANS= $(MAN1l) - -include ../../../../Makefile.master - -ROOTDIR= $(ROOT)/opt/SUNWonld/man -ROOT1lMAN= $(MAN1l:%=$(ROOTDIR)/man1l/%) - -ROOTMANS= $(ROOT1lMAN) - -FILEMODE= 0444 - -.KEEP_STATE: -all: $(MANS) - -install: all $(ROOTMANS) - -$(ROOTDIR)/man1l/%: % - $(INS.file) - -clobber clean: diff --git a/usr/src/cmd/sgs/tools/proto.sh b/usr/src/cmd/sgs/tools/proto.sh deleted file mode 100644 index 7c5f5cabbd..0000000000 --- a/usr/src/cmd/sgs/tools/proto.sh +++ /dev/null @@ -1,197 +0,0 @@ -#!/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 -# - -# -# Copyright 2007 Sun Microsystems, Inc. All rights reserved. -# Use is subject to license terms. -# -# ident "%Z%%M% %I% %E% SMI" -# -# Generate a proto area suitable for the current architecture ($(MACH)) -# sufficient to support the sgs build. -# -# Currently, the following releases are supported: -# 5.11, 5.10, and 5.9. -# - -if [ "X$CODEMGR_WS" = "X" -o "X$MACH" = "X" ] ; then - echo "usage: CODEMGR_WS and MACH environment variables must be set" - exit 1 -fi - -RELEASE=$1 - -if [ "X$RELEASE" = "X" ] ; then - echo "usage: proto release" - exit 1; -fi - -IS_THIS_UNIFIED=1 - -case $RELEASE in - "5.11") break;; - "5.10") break;; - "5.9") IS_THIS_UNIFIED=0; break;; - *) - echo "usage: unsupported release $RELEASE specified" - exit 1;; -esac - -dirs=" $CODEMGR_WS/proto \ - $CODEMGR_WS/proto/root_$MACH \ - $CODEMGR_WS/proto/root_$MACH/lib \ - $CODEMGR_WS/proto/root_$MACH/usr \ - $CODEMGR_WS/proto/root_$MACH/usr/demo \ - $CODEMGR_WS/proto/root_$MACH/usr/lib \ - $CODEMGR_WS/proto/root_$MACH/usr/lib/abi \ - $CODEMGR_WS/proto/root_$MACH/usr/lib/link_audit \ - $CODEMGR_WS/proto/root_$MACH/usr/lib/mdb \ - $CODEMGR_WS/proto/root_$MACH/usr/lib/mdb/proc \ - $CODEMGR_WS/proto/root_$MACH/usr/lib/pics \ - $CODEMGR_WS/proto/root_$MACH/usr/4lib \ - $CODEMGR_WS/proto/root_$MACH/usr/bin \ - $CODEMGR_WS/proto/root_$MACH/usr/ccs \ - $CODEMGR_WS/proto/root_$MACH/usr/ccs/bin \ - $CODEMGR_WS/proto/root_$MACH/usr/include \ - $CODEMGR_WS/proto/root_$MACH/usr/include/sys \ - $CODEMGR_WS/proto/root_$MACH/usr/xpg4 \ - $CODEMGR_WS/proto/root_$MACH/usr/xpg4/bin \ - $CODEMGR_WS/proto/root_$MACH/etc \ - $CODEMGR_WS/proto/root_$MACH/etc/lib \ - $CODEMGR_WS/proto/root_$MACH/opt \ - $CODEMGR_WS/proto/root_$MACH/opt/SUNWonld \ - $CODEMGR_WS/proto/root_$MACH/opt/SUNWonld/bin \ - $CODEMGR_WS/proto/root_$MACH/opt/SUNWonld/doc \ - $CODEMGR_WS/proto/root_$MACH/opt/SUNWonld/lib \ - $CODEMGR_WS/proto/root_$MACH/opt/SUNWonld/man \ - $CODEMGR_WS/proto/root_$MACH/opt/SUNWonld/man/man1 \ - $CODEMGR_WS/proto/root_$MACH/opt/SUNWonld/man/man1l \ - $CODEMGR_WS/proto/root_$MACH/opt/SUNWonld/man/man3t \ - $CODEMGR_WS/proto/root_$MACH/opt/SUNWonld/man/man3l \ - $CODEMGR_WS/proto/root_$MACH/opt/SUNWonld/man/man3x" - -# -# Add 64bit directories -# -MACH64="" -if [ $MACH = "sparc" ]; then - MACH64="sparcv9"; -fi -if [ $MACH = "i386" ]; then - MACH64="amd64"; -fi -if [ "${MACH64}x" != x ]; then - - dirs="$dirs \ - $CODEMGR_WS/proto/root_$MACH/lib/$MACH64 \ - $CODEMGR_WS/proto/root_$MACH/usr/bin/$MACH64 \ - $CODEMGR_WS/proto/root_$MACH/usr/ccs/bin/$MACH64 \ - $CODEMGR_WS/proto/root_$MACH/usr/lib/$MACH64 \ - $CODEMGR_WS/proto/root_$MACH/usr/lib/abi/$MACH64 \ - $CODEMGR_WS/proto/root_$MACH/usr/lib/link_audit/$MACH64 \ - $CODEMGR_WS/proto/root_$MACH/usr/lib/mdb/proc/$MACH64 \ - $CODEMGR_WS/proto/root_$MACH/usr/lib/pics/$MACH64 \ - $CODEMGR_WS/proto/root_$MACH/opt/SUNWonld/bin/$MACH64 \ - $CODEMGR_WS/proto/root_$MACH/opt/SUNWonld/lib/$MACH64 \ - " -fi - -for dir in `echo $dirs` -do - if [ ! -d $dir ] ; then - echo $dir - mkdir $dir - chmod 777 $dir - fi -done - -# We need a local copy of libc_pic.a (we should get this from the parent -# workspace, but as we can't be sure how the proto area is constructed there -# simply take it from a stashed copy on the linkers server. If -# LINKERS_EXPORT is defined, we use it. Failing that, we fall over -# to linkers.central. -if [ "$LINKERS_EXPORT" = "" ]; then - LINKERS_EXPORT=/net/linkers.central/export -fi - -if [ $MACH = "sparc" ]; then - PLATS="sparc sparcv9" -elif [ $MACH = "i386" ]; then - PLATS="i386 amd64" -else - echo "Unknown Mach: $MACH - no libc_pic.a provided!" - PLATS="" -fi - -for p in $PLATS -do - SRCLIBCDIR=${SRC}/lib/libc/$p - if [ ! -d $SRCLIBCDIR ]; then - mkdir -p $SRCLIBCDIR - fi - if [ ! -f $SRCLIBCDIR/libc_pic.a ]; then - cp $LINKERS_EXPORT/big/libc_pic/$RELEASE/$p/libc_pic.a \ - $SRCLIBCDIR - fi -done - -SYSLIB=$CODEMGR_WS/proto/root_$MACH/lib -USRLIB=$CODEMGR_WS/proto/root_$MACH/usr/lib - -if [ ! -h $USRLIB/ld.so.1 ]; then - rm -f $USRLIB/ld.so.1 - ln -s ../../lib/ld.so.1 $USRLIB/ld.so.1 - echo "$USRLIB/ld.so.1 -> ../../lib/ld.so.1" -fi - -# -# In addition create some 64 symlinks so that dependencies referenced -# from our test environment will map back to the appropriate libraries. -# -if [ ! -h $SYSLIB/64 ] ; then - rm -f $SYSLIB/64 - ln -s $MACH64 $SYSLIB/64 - echo "$SYSLIB/64 -> $SYSLIB/$MACH64" -fi -if [ ! -h $USRLIB/64 ] ; then - rm -f $USRLIB/64 - ln -s $MACH64 $USRLIB/64 - echo "$USRLIB/64 -> $USRLIB/$MACH64" -fi -if [ ! -h $USRLIB/link_audit/64 ] ; then - rm -f $USRLIB/link_audit/64 - ln -s $MACH64 $USRLIB/link_audit/64 - echo "$USRLIB/link_audit/64 -> $USRLIB/link_audit/$MACH64" -fi -if [ ! -h $USRLIB/64/ld.so.1 ]; then - rm -f $USRLIB/64/ld.so.1 - ln -s ../../../lib/64/ld.so.1 $USRLIB/64/ld.so.1 - echo "$USRLIB/64/ld.so.1 -> ../../../lib/64/ld.so.1" -fi - -# -# -# -if [ $IS_THIS_UNIFIED = 0 ] ; then - rm -fr $CODEMGR_WS/proto/root_$MACH/lib - ln -s $CODEMGR_WS/proto/root_$MACH/usr/lib $CODEMGR_WS/proto/root_$MACH/lib -fi diff --git a/usr/src/cmd/sgs/packages/common/readme_revision b/usr/src/cmd/sgs/tools/readme_revision index 7cde955a9d..c2ea670186 100755 --- a/usr/src/cmd/sgs/packages/common/readme_revision +++ b/usr/src/cmd/sgs/tools/readme_revision @@ -22,12 +22,9 @@ # # CDDL HEADER END # -#pragma ident "%Z%%M% %I% %E% SMI" - - # # Generate a revision number for the sgs linker components, based -# on usr/src/cmd/sgs/packages/common/SUNWonld-README. +# on usr/src/cmd/sgs/tools/SUNWonld-README. # # usage: readme_revision [-d] [readme-file] # @@ -128,7 +125,6 @@ if ($debug == 0) { } # For debug mode, add diagnostic data -# ($wsname = $ENV{'CODEMGR_WS'}) ne '' || ($wsname = 'unknown'); @wsname = split /\//, $wsname; $wsname = $wsname[$#wsname]; diff --git a/usr/src/cmd/sgs/tools/sparc/Makefile b/usr/src/cmd/sgs/tools/sparc/Makefile index 44cab67a8f..3076c8026e 100644 --- a/usr/src/cmd/sgs/tools/sparc/Makefile +++ b/usr/src/cmd/sgs/tools/sparc/Makefile @@ -19,9 +19,6 @@ # # CDDL HEADER END # -# -#ident "%Z%%M% %I% %E% SMI" -# # Copyright (c) 1996 by Sun Microsystems, Inc. # All rights reserved. @@ -29,9 +26,7 @@ include $(SRC)/cmd/sgs/tools/Makefile.com .KEEP_STATE: -all: native $(PROGS) $(LIBS) - -native: $(NATIVE) +all: $(NATIVE) $(PROGS) $(LIBS) install: all $(ROOTPROGS) $(ROOTLIBS) diff --git a/usr/src/cmd/sgs/yacc/Makefile.com b/usr/src/cmd/sgs/yacc/Makefile.com index 17a509ca87..2172234f49 100644 --- a/usr/src/cmd/sgs/yacc/Makefile.com +++ b/usr/src/cmd/sgs/yacc/Makefile.com @@ -61,7 +61,6 @@ $(DYNLIBCCC):= ZDEFS = $(ZNODEFS) INCLIST= -I../../include -I../../include/$(MACH) CPPFLAGS= $(INCLIST) $(DEFLIST) $(CPPFLAGS.master) $(PROG):= LDLIBS = $(LDLIBS.cmd) -BUILD.AR= $(AR) $(ARFLAGS) $@ `$(LORDER) $(OBJS) | $(TSORT)` CSTD= $(CSTD_GNU99) CFLAGS += $(CCVERBOSE) diff --git a/usr/src/cmd/sgs/yacc/Makefile.targ b/usr/src/cmd/sgs/yacc/Makefile.targ index baa615514c..a7932225e0 100644 --- a/usr/src/cmd/sgs/yacc/Makefile.targ +++ b/usr/src/cmd/sgs/yacc/Makefile.targ @@ -60,10 +60,6 @@ $(ROOTLIBDIR64)/$(LIBLINKSCCC): $(ROOTLIBDIR64)/$(LIBLINKSCCC)$(VERS) objs pics: -@mkdir -p $@ -$(LIBRARY): objs .WAIT $$(OBJS) - $(BUILD.AR) - $(POST_PROCESS_A) - $(DYNLIB): pics .WAIT $$(PICS) $(BUILD.SO) $(POST_PROCESS_SO) diff --git a/usr/src/cmd/smbsrv/smbadm/Makefile b/usr/src/cmd/smbsrv/smbadm/Makefile index 8f7b43a3e3..9011799749 100644 --- a/usr/src/cmd/smbsrv/smbadm/Makefile +++ b/usr/src/cmd/smbsrv/smbadm/Makefile @@ -22,7 +22,7 @@ # Copyright 2010 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# Copyright 2014 Nexenta Systems, Inc. All rights reserved. +# Copyright 2019 Nexenta by DDN, Inc. All rights reserved. # Copyright (c) 2018, Joyent, Inc. # @@ -37,8 +37,6 @@ LDFLAGS += -R/usr/lib/smbsrv .KEEP_STATE: -CERRWARN += $(CNOWARN_UNINIT) - SMOFF += free all: $(PROG) diff --git a/usr/src/cmd/smbsrv/smbadm/smbadm.c b/usr/src/cmd/smbsrv/smbadm/smbadm.c index 234c8332ce..d8509aecdf 100644 --- a/usr/src/cmd/smbsrv/smbadm/smbadm.c +++ b/usr/src/cmd/smbsrv/smbadm/smbadm.c @@ -1164,7 +1164,7 @@ smbadm_group_setprop(int argc, char **argv) smbadm_prop_handle_t *phandle; char option; int pcnt = 0; - int ret; + int ret = 0; int p; bzero(props, SMBADM_NPROP * sizeof (smbadm_prop_t)); @@ -1224,7 +1224,7 @@ smbadm_group_getprop(int argc, char **argv) smbadm_prop_handle_t *phandle; char option; int pcnt = 0; - int ret; + int ret = 0; int p; bzero(props, SMBADM_NPROP * sizeof (smbadm_prop_t)); @@ -1398,7 +1398,7 @@ smbadm_group_add_del_member(char *gname, char *mname, lsa_account_t acct; smb_gsid_t msid; char *sidstr; - char *act_str; + char *act_str = NULL; int rc; if (strncmp(mname, "S-1-", 4) == 0) { diff --git a/usr/src/cmd/zpool/Makefile b/usr/src/cmd/zpool/Makefile index 0dfb7344f1..b849d9c759 100644 --- a/usr/src/cmd/zpool/Makefile +++ b/usr/src/cmd/zpool/Makefile @@ -42,7 +42,7 @@ SRCS += $(STAT_COMMON_SRCS) LDLIBS += -lzfs -lnvpair -ldevid -lefi -ldiskmgt -luutil -lumem -INCS += -I../../common/zfs -I$(STATCOMMONDIR) +INCS += -I../../common/zfs -I../../uts/common/fs/zfs -I$(STATCOMMONDIR) CSTD= $(CSTD_GNU99) C99LMODE= -Xc99=%all diff --git a/usr/src/cmd/zpool/zpool_main.c b/usr/src/cmd/zpool/zpool_main.c index 651525685c..5fbc7de4c2 100644 --- a/usr/src/cmd/zpool/zpool_main.c +++ b/usr/src/cmd/zpool/zpool_main.c @@ -30,6 +30,7 @@ * Copyright (c) 2017 Datto Inc. * Copyright (c) 2017, Intel Corporation. * Copyright 2019 Joyent, Inc. + * Copyright (c) 2012 by Cyril Plisko. All rights reserved. */ #include <assert.h> @@ -224,10 +225,11 @@ get_usage(zpool_help_t idx) { switch (idx) { case HELP_ADD: - return (gettext("\tadd [-fgLnP] <pool> <vdev> ...\n")); + return (gettext("\tadd [-fgLnP] [-o property=value] " + "<pool> <vdev> ...\n")); case HELP_ATTACH: - return (gettext("\tattach [-f] <pool> <device> " - "<new-device>\n")); + return (gettext("\tattach [-f] [-o property=value] " + "<pool> <device> <new-device>\n")); case HELP_CLEAR: return (gettext("\tclear [-nF] <pool> [device]\n")); case HELP_CREATE: @@ -548,6 +550,7 @@ add_prop_list_default(const char *propname, char *propval, nvlist_t **props, * -n Do not add the devices, but display the resulting layout if * they were to be added. * -P Display full path for vdev name. + * -o Set property=value. * * Adds the given vdevs to 'pool'. As with create, the bulk of this work is * handled by get_vdev_spec(), which constructs the nvlist needed to pass to @@ -567,9 +570,11 @@ zpool_do_add(int argc, char **argv) int ret; zpool_handle_t *zhp; nvlist_t *config; + nvlist_t *props = NULL; + char *propval; /* check options */ - while ((c = getopt(argc, argv, "fgLnP")) != -1) { + while ((c = getopt(argc, argv, "fgLnPo:")) != -1) { switch (c) { case 'f': force = B_TRUE; @@ -586,6 +591,19 @@ zpool_do_add(int argc, char **argv) case 'P': name_flags |= VDEV_NAME_PATH; break; + case 'o': + if ((propval = strchr(optarg, '=')) == NULL) { + (void) fprintf(stderr, gettext("missing " + "'=' for -o option\n")); + usage(B_FALSE); + } + *propval = '\0'; + propval++; + + if ((strcmp(optarg, ZPOOL_CONFIG_ASHIFT) != 0) || + (add_prop_list(optarg, propval, &props, B_TRUE))) + usage(B_FALSE); + break; case '?': (void) fprintf(stderr, gettext("invalid option '%c'\n"), optopt); @@ -626,9 +644,23 @@ zpool_do_add(int argc, char **argv) else boot_type = ZPOOL_NO_BOOT_LABEL; + /* unless manually specified use "ashift" pool property (if set) */ + if (!nvlist_exists(props, ZPOOL_CONFIG_ASHIFT)) { + int intval; + zprop_source_t src; + char strval[ZPOOL_MAXPROPLEN]; + + intval = zpool_get_prop_int(zhp, ZPOOL_PROP_ASHIFT, &src); + if (src != ZPROP_SRC_DEFAULT) { + (void) sprintf(strval, "%" PRId32, intval); + verify(add_prop_list(ZPOOL_CONFIG_ASHIFT, strval, + &props, B_TRUE) == 0); + } + } + /* pass off to get_vdev_spec for processing */ boot_size = zpool_get_prop_int(zhp, ZPOOL_PROP_BOOTSIZE, NULL); - nvroot = make_root_vdev(zhp, force, !force, B_FALSE, dryrun, + nvroot = make_root_vdev(zhp, props, force, !force, B_FALSE, dryrun, boot_type, boot_size, argc, argv); if (nvroot == NULL) { zpool_close(zhp); @@ -670,6 +702,7 @@ zpool_do_add(int argc, char **argv) ret = (zpool_add(zhp, nvroot) != 0); } + nvlist_free(props); nvlist_free(nvroot); zpool_close(zhp); @@ -1153,7 +1186,7 @@ zpool_do_create(int argc, char **argv) } /* pass off to get_vdev_spec for bulk processing */ - nvroot = make_root_vdev(NULL, force, !force, B_FALSE, dryrun, + nvroot = make_root_vdev(NULL, props, force, !force, B_FALSE, dryrun, boot_type, boot_size, argc - 1, argv + 1); if (nvroot == NULL) goto errout; @@ -3935,14 +3968,29 @@ zpool_do_attach_or_replace(int argc, char **argv, int replacing) zpool_handle_t *zhp; zpool_boot_label_t boot_type; uint64_t boot_size; + nvlist_t *props = NULL; + char *propval; int ret; /* check options */ - while ((c = getopt(argc, argv, "f")) != -1) { + while ((c = getopt(argc, argv, "fo:")) != -1) { switch (c) { case 'f': force = B_TRUE; break; + case 'o': + if ((propval = strchr(optarg, '=')) == NULL) { + (void) fprintf(stderr, gettext("missing " + "'=' for -o option\n")); + usage(B_FALSE); + } + *propval = '\0'; + propval++; + + if ((strcmp(optarg, ZPOOL_CONFIG_ASHIFT) != 0) || + (add_prop_list(optarg, propval, &props, B_TRUE))) + usage(B_FALSE); + break; case '?': (void) fprintf(stderr, gettext("invalid option '%c'\n"), optopt); @@ -4005,7 +4053,22 @@ zpool_do_attach_or_replace(int argc, char **argv, int replacing) boot_type = ZPOOL_NO_BOOT_LABEL; boot_size = zpool_get_prop_int(zhp, ZPOOL_PROP_BOOTSIZE, NULL); - nvroot = make_root_vdev(zhp, force, B_FALSE, replacing, B_FALSE, + + /* unless manually specified use "ashift" pool property (if set) */ + if (!nvlist_exists(props, ZPOOL_CONFIG_ASHIFT)) { + int intval; + zprop_source_t src; + char strval[ZPOOL_MAXPROPLEN]; + + intval = zpool_get_prop_int(zhp, ZPOOL_PROP_ASHIFT, &src); + if (src != ZPROP_SRC_DEFAULT) { + (void) sprintf(strval, "%" PRId32, intval); + verify(add_prop_list(ZPOOL_CONFIG_ASHIFT, strval, + &props, B_TRUE) == 0); + } + } + + nvroot = make_root_vdev(zhp, props, force, B_FALSE, replacing, B_FALSE, boot_type, boot_size, argc, argv); if (nvroot == NULL) { zpool_close(zhp); @@ -4035,9 +4098,10 @@ zpool_do_replace(int argc, char **argv) } /* - * zpool attach [-f] <pool> <device> <new_device> + * zpool attach [-f] [-o property=value] <pool> <device> <new_device> * * -f Force attach, even if <new_device> appears to be in use. + * -o Set property=value. * * Attach <new_device> to the mirror containing <device>. If <device> is not * part of a mirror, then <device> will be transformed into a mirror of diff --git a/usr/src/cmd/zpool/zpool_util.h b/usr/src/cmd/zpool/zpool_util.h index 8777edc9de..3aeb9b5431 100644 --- a/usr/src/cmd/zpool/zpool_util.h +++ b/usr/src/cmd/zpool/zpool_util.h @@ -43,9 +43,9 @@ uint_t num_logs(nvlist_t *nv); * Virtual device functions */ -nvlist_t *make_root_vdev(zpool_handle_t *zhp, int force, int check_rep, - boolean_t replacing, boolean_t dryrun, zpool_boot_label_t boot_type, - uint64_t boot_size, int argc, char **argv); +nvlist_t *make_root_vdev(zpool_handle_t *zhp, nvlist_t *props, int force, + int check_rep, boolean_t replacing, boolean_t dryrun, + zpool_boot_label_t boot_type, uint64_t boot_size, int argc, char **argv); nvlist_t *split_mirror_vdev(zpool_handle_t *zhp, char *newname, nvlist_t *props, splitflags_t flags, int argc, char **argv); diff --git a/usr/src/cmd/zpool/zpool_vdev.c b/usr/src/cmd/zpool/zpool_vdev.c index 8a1a7e9825..6e6589ab47 100644 --- a/usr/src/cmd/zpool/zpool_vdev.c +++ b/usr/src/cmd/zpool/zpool_vdev.c @@ -70,6 +70,7 @@ #include <libintl.h> #include <libnvpair.h> #include <limits.h> +#include <sys/spa.h> #include <stdio.h> #include <string.h> #include <unistd.h> @@ -388,13 +389,14 @@ is_whole_disk(const char *arg) * xxx Shorthand for /dev/dsk/xxx */ static nvlist_t * -make_leaf_vdev(const char *arg, uint64_t is_log) +make_leaf_vdev(nvlist_t *props, const char *arg, uint64_t is_log) { char path[MAXPATHLEN]; struct stat64 statbuf; nvlist_t *vdev = NULL; char *type = NULL; boolean_t wholedisk = B_FALSE; + uint64_t ashift = 0; /* * Determine what type of vdev this is, and put the full path into @@ -479,6 +481,28 @@ make_leaf_vdev(const char *arg, uint64_t is_log) verify(nvlist_add_uint64(vdev, ZPOOL_CONFIG_WHOLE_DISK, (uint64_t)wholedisk) == 0); + if (props != NULL) { + char *value = NULL; + + if (nvlist_lookup_string(props, + zpool_prop_to_name(ZPOOL_PROP_ASHIFT), &value) == 0) { + if (zfs_nicestrtonum(NULL, value, &ashift) != 0) { + (void) fprintf(stderr, + gettext("ashift must be a number.\n")); + return (NULL); + } + if (ashift != 0 && + (ashift < ASHIFT_MIN || ashift > ASHIFT_MAX)) { + (void) fprintf(stderr, + gettext("invalid 'ashift=%" PRIu64 "' " + "property: only values between %" PRId32 " " + "and %" PRId32 " are allowed.\n"), + ashift, ASHIFT_MIN, ASHIFT_MAX); + return (NULL); + } + } + } + /* * For a whole disk, defer getting its devid until after labeling it. */ @@ -514,6 +538,9 @@ make_leaf_vdev(const char *arg, uint64_t is_log) (void) close(fd); } + if (ashift > 0) + (void) nvlist_add_uint64(vdev, ZPOOL_CONFIG_ASHIFT, ashift); + return (vdev); } @@ -1264,7 +1291,7 @@ is_grouping(const char *type, int *mindev, int *maxdev) * because the program is just going to exit anyway. */ nvlist_t * -construct_spec(int argc, char **argv) +construct_spec(nvlist_t *props, int argc, char **argv) { nvlist_t *nvroot, *nv, **top, **spares, **l2cache; int t, toplevels, mindev, maxdev, nspares, nlogs, nl2cache; @@ -1374,8 +1401,8 @@ construct_spec(int argc, char **argv) children * sizeof (nvlist_t *)); if (child == NULL) zpool_no_memory(); - if ((nv = make_leaf_vdev(argv[c], B_FALSE)) - == NULL) + if ((nv = make_leaf_vdev(props, argv[c], + B_FALSE)) == NULL) return (NULL); child[children - 1] = nv; } @@ -1445,7 +1472,8 @@ construct_spec(int argc, char **argv) * We have a device. Pass off to make_leaf_vdev() to * construct the appropriate nvlist describing the vdev. */ - if ((nv = make_leaf_vdev(argv[0], is_log)) == NULL) + if ((nv = make_leaf_vdev(props, argv[0], is_log)) + == NULL) return (NULL); if (is_log) nlogs++; @@ -1522,7 +1550,7 @@ split_mirror_vdev(zpool_handle_t *zhp, char *newname, nvlist_t *props, zpool_boot_label_t boot_type; if (argc > 0) { - if ((newroot = construct_spec(argc, argv)) == NULL) { + if ((newroot = construct_spec(props, argc, argv)) == NULL) { (void) fprintf(stderr, gettext("Unable to build a " "pool from the specified devices\n")); return (NULL); @@ -1601,7 +1629,7 @@ num_normal_vdevs(nvlist_t *nvroot) * added, even if they appear in use. */ nvlist_t * -make_root_vdev(zpool_handle_t *zhp, int force, int check_rep, +make_root_vdev(zpool_handle_t *zhp, nvlist_t *props, int force, int check_rep, boolean_t replacing, boolean_t dryrun, zpool_boot_label_t boot_type, uint64_t boot_size, int argc, char **argv) { @@ -1614,7 +1642,7 @@ make_root_vdev(zpool_handle_t *zhp, int force, int check_rep, * that we have a valid specification, and that all devices can be * opened. */ - if ((newroot = construct_spec(argc, argv)) == NULL) + if ((newroot = construct_spec(props, argc, argv)) == NULL) return (NULL); if (zhp && ((poolconfig = zpool_get_config(zhp, NULL)) == NULL)) diff --git a/usr/src/common/ficl/emu/loader_emu.c b/usr/src/common/ficl/emu/loader_emu.c index c3ebb3f21f..8c4b376cfd 100644 --- a/usr/src/common/ficl/emu/loader_emu.c +++ b/usr/src/common/ficl/emu/loader_emu.c @@ -38,27 +38,13 @@ #include <dirent.h> #include <macros.h> #include <sys/systeminfo.h> +#include <sys/linker_set.h> #include <sys/queue.h> #include <sys/mnttab.h> +#include "loader_emu.h" #include "gfx_fb.h" #include "ficl.h" -/* Commands and return values; nonzero return sets command_errmsg != NULL */ -typedef int (bootblk_cmd_t)(int argc, char *argv[]); -#define CMD_OK 0 -#define CMD_ERROR 1 - -/* - * Support for commands - */ -struct bootblk_command -{ - const char *c_name; - const char *c_desc; - bootblk_cmd_t *c_fn; - STAILQ_ENTRY(bootblk_command) next; -}; - #define MDIR_REMOVED 0x0001 #define MDIR_NOHINTS 0x0002 @@ -112,7 +98,6 @@ static int command_framebuffer(int argc, char *argv[]); /* update when loader version will change */ static const char bootprog_rev[] = "1.1"; -STAILQ_HEAD(cmdh, bootblk_command) commands; /* * BootForth Interface to Ficl Forth interpreter. @@ -505,7 +490,7 @@ bf_command(ficlVm *vm) { char *name, *line, *tail, *cp; size_t len; - struct bootblk_command *cmdp; + struct bootblk_command **cmdp; bootblk_cmd_t *cmd; int nstrings, i; int argc, result; @@ -516,9 +501,10 @@ bf_command(ficlVm *vm) /* Find our command structure */ cmd = NULL; - STAILQ_FOREACH(cmdp, &commands, next) { - if ((cmdp->c_name != NULL) && strcmp(name, cmdp->c_name) == 0) - cmd = cmdp->c_fn; + SET_FOREACH(cmdp, Xcommand_set) { + if (((*cmdp)->c_name != NULL) && + strcmp(name, (*cmdp)->c_name) == 0) + cmd = (*cmdp)->c_fn; } if (cmd == NULL) printf("callout for unknown command '%s'\n", name); @@ -698,11 +684,6 @@ get_currdev(void) "then ; " extern int ficlExecFD(ficlVm *, int); -#define COMMAND_SET(ptr, name, desc, fn) \ - ptr = malloc(sizeof (struct bootblk_command)); \ - ptr->c_name = (name); \ - ptr->c_desc = (desc); \ - ptr->c_fn = (fn); /* * Initialise the Forth interpreter, create all our commands as words. @@ -710,7 +691,7 @@ extern int ficlExecFD(ficlVm *, int); ficlVm * bf_init(const char *rc, ficlOutputFunction out) { - struct bootblk_command *cmdp; + struct bootblk_command **cmdp; char create_buf[41]; /* 31 characters-long builtins */ char *buf; int fd, rv; @@ -718,50 +699,6 @@ bf_init(const char *rc, ficlOutputFunction out) ficlDictionary *dict; ficlDictionary *env; - /* set up commands list */ - STAILQ_INIT(&commands); - COMMAND_SET(cmdp, "help", "detailed help", command_help); - STAILQ_INSERT_TAIL(&commands, cmdp, next); - COMMAND_SET(cmdp, "?", "list commands", command_commandlist); - STAILQ_INSERT_TAIL(&commands, cmdp, next); - COMMAND_SET(cmdp, "show", "show variable(s)", command_show); - STAILQ_INSERT_TAIL(&commands, cmdp, next); - COMMAND_SET(cmdp, "printenv", "show variable(s)", command_show); - STAILQ_INSERT_TAIL(&commands, cmdp, next); - COMMAND_SET(cmdp, "set", "set a variable", command_set); - STAILQ_INSERT_TAIL(&commands, cmdp, next); - COMMAND_SET(cmdp, "setprop", "set a variable", command_setprop); - STAILQ_INSERT_TAIL(&commands, cmdp, next); - COMMAND_SET(cmdp, "unset", "unset a variable", command_unset); - STAILQ_INSERT_TAIL(&commands, cmdp, next); - COMMAND_SET(cmdp, "echo", "echo arguments", command_echo); - STAILQ_INSERT_TAIL(&commands, cmdp, next); - COMMAND_SET(cmdp, "read", "read input from the terminal", command_read); - STAILQ_INSERT_TAIL(&commands, cmdp, next); - COMMAND_SET(cmdp, "more", "show contents of a file", command_more); - STAILQ_INSERT_TAIL(&commands, cmdp, next); - COMMAND_SET(cmdp, "ls", "list files", command_ls); - STAILQ_INSERT_TAIL(&commands, cmdp, next); - COMMAND_SET(cmdp, "include", "read commands from a file", - command_include); - STAILQ_INSERT_TAIL(&commands, cmdp, next); - COMMAND_SET(cmdp, "boot", "boot a file or loaded kernel", command_boot); - STAILQ_INSERT_TAIL(&commands, cmdp, next); - COMMAND_SET(cmdp, "autoboot", "boot automatically after a delay", - command_autoboot); - STAILQ_INSERT_TAIL(&commands, cmdp, next); - COMMAND_SET(cmdp, "load", "load a kernel or module", command_load); - STAILQ_INSERT_TAIL(&commands, cmdp, next); - COMMAND_SET(cmdp, "unload", "unload all modules", command_unload); - STAILQ_INSERT_TAIL(&commands, cmdp, next); - COMMAND_SET(cmdp, "reboot", "reboot the system", command_reboot); - STAILQ_INSERT_TAIL(&commands, cmdp, next); - COMMAND_SET(cmdp, "sifting", "find words", command_sifting); - STAILQ_INSERT_TAIL(&commands, cmdp, next); - COMMAND_SET(cmdp, "framebuffer", "framebuffer mode management", - command_framebuffer); - STAILQ_INSERT_TAIL(&commands, cmdp, next); - fsi = malloc(sizeof (ficlSystemInformation)); ficlSystemInformationInitialize(fsi); fsi->textOut = out; @@ -802,16 +739,17 @@ bf_init(const char *rc, ficlOutputFunction out) /* make all commands appear as Forth words */ dict = ficlSystemGetDictionary(bf_sys); cmdp = NULL; - STAILQ_FOREACH(cmdp, &commands, next) { - (void) ficlDictionaryAppendPrimitive(dict, (char *)cmdp->c_name, - bf_command, FICL_WORD_DEFAULT); + + SET_FOREACH(cmdp, Xcommand_set) { + (void) ficlDictionaryAppendPrimitive(dict, + (char *)(*cmdp)->c_name, bf_command, FICL_WORD_DEFAULT); rv = ficlVmEvaluate(bf_vm, "forth definitions builtins"); if (rv != FICL_VM_STATUS_OUT_OF_TEXT) { printf("error interpreting forth: %d\n", rv); exit(1); } (void) snprintf(create_buf, sizeof (create_buf), "builtin: %s", - cmdp->c_name); + (*cmdp)->c_name); rv = ficlVmEvaluate(bf_vm, create_buf); if (rv != FICL_VM_STATUS_OUT_OF_TEXT) { printf("error interpreting forth: %d\n", rv); @@ -1139,6 +1077,8 @@ help_emitsummary(char *topic, char *subtopic, char *desc) return (pager_output("\n")); } +COMMAND_SET(help, "help", "detailed help", command_help); + static int command_help(int argc, char *argv[]) { @@ -1230,25 +1170,26 @@ command_help(int argc, char *argv[]) return (CMD_OK); } +COMMAND_SET(commandlist, "?", "list commands", command_commandlist); + static int command_commandlist(int argc __unused, char *argv[] __unused) { - struct bootblk_command *cmdp; + struct bootblk_command **cmdp; int res; char name[20]; res = 0; pager_open(); res = pager_output("Available commands:\n"); - cmdp = NULL; - STAILQ_FOREACH(cmdp, &commands, next) { + SET_FOREACH(cmdp, Xcommand_set) { if (res) break; - if (cmdp->c_name != NULL && cmdp->c_desc != NULL) { + if ((*cmdp)->c_name != NULL && (*cmdp)->c_desc != NULL) { (void) snprintf(name, sizeof (name), " %-15s ", - cmdp->c_name); + (*cmdp)->c_name); (void) pager_output(name); - (void) pager_output(cmdp->c_desc); + (void) pager_output((*cmdp)->c_desc); res = pager_output("\n"); } } @@ -1260,6 +1201,9 @@ command_commandlist(int argc __unused, char *argv[] __unused) * XXX set/show should become set/echo if we have variable * substitution happening. */ +COMMAND_SET(show, "show", "show variable(s)", command_show); +COMMAND_SET(printenv, "printenv", "show variable(s)", command_show); + static int command_show(int argc, char *argv[]) { @@ -1294,6 +1238,7 @@ command_show(int argc, char *argv[]) return (CMD_OK); } +COMMAND_SET(set, "set", "set a variable", command_set); static int command_set(int argc, char *argv[]) { @@ -1323,6 +1268,7 @@ command_set(int argc, char *argv[]) return (CMD_OK); } +COMMAND_SET(setprop, "setprop", "set a variable", command_setprop); static int command_setprop(int argc, char *argv[]) { @@ -1340,6 +1286,7 @@ command_setprop(int argc, char *argv[]) return (CMD_OK); } +COMMAND_SET(unset, "unset", "unset a variable", command_unset); static int command_unset(int argc, char *argv[]) { @@ -1357,6 +1304,7 @@ command_unset(int argc, char *argv[]) return (CMD_OK); } +COMMAND_SET(echo, "echo", "echo arguments", command_echo); static int command_echo(int argc, char *argv[]) { @@ -1399,6 +1347,7 @@ ischar(void) return (1); } +COMMAND_SET(read, "read", "read input from the terminal", command_read); static int command_read(int argc, char *argv[]) { @@ -1456,6 +1405,7 @@ command_read(int argc, char *argv[]) /* * File pager */ +COMMAND_SET(more, "more", "show contents of a file", command_more); static int command_more(int argc, char *argv[]) { @@ -1502,6 +1452,7 @@ page_file(char *filename) return (result); } +COMMAND_SET(ls, "ls", "list files", command_ls); static int command_ls(int argc, char *argv[]) { @@ -1646,6 +1597,7 @@ out: return (-1); } +COMMAND_SET(include, "include", "read commands from a file", command_include); static int command_include(int argc, char *argv[]) { @@ -1780,12 +1732,15 @@ include(const char *filename) return (res); } +COMMAND_SET(boot, "boot", "boot a file or loaded kernel", command_boot); static int command_boot(int argc, char *argv[]) { return (CMD_OK); } +COMMAND_SET(autoboot, "autoboot", "boot automatically after a delay", + command_autoboot); static int command_autoboot(int argc, char *argv[]) { @@ -1928,6 +1883,7 @@ file_search(const char *name) return (result); } +COMMAND_SET(load, "load", "load a kernel or module", command_load); static int command_load(int argc, char *argv[]) { @@ -1980,6 +1936,7 @@ command_load(int argc, char *argv[]) return (CMD_OK); } +COMMAND_SET(unload, "unload", "unload all modules", command_unload); static int command_unload(int argc, char *argv[]) { @@ -1987,6 +1944,7 @@ command_unload(int argc, char *argv[]) return (CMD_OK); } +COMMAND_SET(reboot, "reboot", "reboot the system", command_reboot); static int command_reboot(int argc, char *argv[]) { @@ -1994,6 +1952,7 @@ command_reboot(int argc, char *argv[]) return (CMD_OK); } +COMMAND_SET(sifting, "sifting", "find words", command_sifting); static int command_sifting(int argc, char *argv[]) { @@ -2006,6 +1965,8 @@ command_sifting(int argc, char *argv[]) } /* Only implement get and list. Ignore arguments on, off and set. */ +COMMAND_SET(framebuffer, "framebuffer", "framebuffer mode management", + command_framebuffer); static int command_framebuffer(int argc, char *argv[]) { diff --git a/usr/src/common/ficl/emu/loader_emu.h b/usr/src/common/ficl/emu/loader_emu.h index 7cbdff886e..6ae53d3215 100644 --- a/usr/src/common/ficl/emu/loader_emu.h +++ b/usr/src/common/ficl/emu/loader_emu.h @@ -16,6 +16,8 @@ #ifndef _LOADER_EMU_H #define _LOADER_EMU_H +#include <sys/linker_set.h> + /* * BootFORTH emulator interface. */ @@ -39,9 +41,15 @@ struct bootblk_command const char *c_name; const char *c_desc; bootblk_cmd_t *c_fn; - STAILQ_ENTRY(bootblk_command) next; }; +#define COMMAND_SET(tag, key, desc, func) \ + static bootblk_cmd_t func; \ + static struct bootblk_command _cmd_ ## tag = { key, desc, func }; \ + DATA_SET(Xcommand_set, _cmd_ ## tag) + +SET_DECLARE(Xcommand_set, struct bootblk_command); + #ifdef __cplusplus } #endif diff --git a/usr/src/common/smbsrv/smb_inet.c b/usr/src/common/smbsrv/smb_inet.c index 023e9986bb..6cf7abcb54 100644 --- a/usr/src/common/smbsrv/smb_inet.c +++ b/usr/src/common/smbsrv/smb_inet.c @@ -22,11 +22,12 @@ /* * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. - * Copyright 2017 Nexenta Systems, Inc. + * + * Copyright 2019 Nexenta by DDN, Inc. All rights reserved. */ /* - * This file was originally generated using rpcgen. + * Wrappers for inet address manipulation to do what SMB needs. */ #include <sys/types.h> @@ -42,6 +43,7 @@ #include <sys/errno.h> #include <sys/sunddi.h> /* Don't want the rest of what's in inet/ip.h */ +#define inet_ntop _inet_ntop // illumos.org/issues/5980 extern char *inet_ntop(int, const void *, char *, int); extern int inet_pton(int, char *, void *); #endif /* !_KERNEL */ diff --git a/usr/src/common/zfs/zpool_prop.c b/usr/src/common/zfs/zpool_prop.c index d17c7fd980..43e28ba01e 100644 --- a/usr/src/common/zfs/zpool_prop.c +++ b/usr/src/common/zfs/zpool_prop.c @@ -111,6 +111,8 @@ zpool_prop_init(void) PROP_DEFAULT, ZFS_TYPE_POOL, "<version>", "VERSION"); zprop_register_number(ZPOOL_PROP_DEDUPDITTO, "dedupditto", 0, PROP_DEFAULT, ZFS_TYPE_POOL, "<threshold (min 100)>", "DEDUPDITTO"); + zprop_register_number(ZPOOL_PROP_ASHIFT, "ashift", 0, PROP_DEFAULT, + ZFS_TYPE_POOL, "<ashift, 9-16, or 0=default>", "ASHIFT"); /* default index (boolean) properties */ zprop_register_index(ZPOOL_PROP_DELEGATION, "delegation", 1, diff --git a/usr/src/lib/libds/common/libds.c b/usr/src/lib/libds/common/libds.c index 274b90132a..1e8673573c 100644 --- a/usr/src/lib/libds/common/libds.c +++ b/usr/src/lib/libds/common/libds.c @@ -102,7 +102,7 @@ ds_new_dslibentry(void) int newndslib; dslibentry_t *dsp; - if ((dsp = ds_hdl_to_dslibentry(NULL)) != NULL) + if ((dsp = ds_hdl_to_dslibentry(0)) != NULL) return (dsp); /* double the size */ @@ -125,7 +125,7 @@ ds_service_count(char *service, boolean_t is_client) uint_t count = 0; for (i = 0, dsp = dslibtab; i < ndslib; i++, dsp++) { - if (dsp->dsl_hdl != NULL && + if (dsp->dsl_hdl != 0 && strcmp(dsp->dsl_service, service) == 0 && (dsp->dsl_flags & VLDS_REG_CLIENT) == is_client_flag) { count++; @@ -142,7 +142,7 @@ ds_lookup_dslibentry(char *service, boolean_t is_client) uint_t is_client_flag = is_client ? VLDS_REG_CLIENT : 0; for (i = 0, dsp = dslibtab; i < ndslib; i++, dsp++) { - if (dsp->dsl_hdl != NULL && + if (dsp->dsl_hdl != 0 && strcmp(dsp->dsl_service, service) == 0 && (dsp->dsl_flags & VLDS_REG_CLIENT) == is_client_flag) { return (dsp); @@ -201,7 +201,7 @@ ds_free_dslibentry(dslibentry_t *dsp, int force_unreg) (dsp->dsl_flags & VLDS_REG_CLIENT) != 0); if ((nhdls == 1 && force_unreg) || nhdls >= 2) { - dsp->dsl_hdl = NULL; + dsp->dsl_hdl = 0; if (dsp->dsl_service) { free(dsp->dsl_service); } @@ -297,7 +297,7 @@ static void ds_string_arg(vlds_string_t *dsp, char *str) { if (str == NULL) { - dsp->vlds_strp = NULL; + dsp->vlds_strp = 0; dsp->vlds_strlen = 0; } else { dsp->vlds_strp = PTRTOUINT64(str); @@ -714,7 +714,7 @@ ds_fini(void) if (ndslib > 0) { (void) mutex_lock(&dslib_lock); for (i = 0, dsp = dslibtab; i < ndslib; i++, dsp++) { - if (dsp->dsl_hdl == NULL) + if (dsp->dsl_hdl == 0) continue; if (dsp->dsl_service) { free(dsp->dsl_service); diff --git a/usr/src/lib/libipmi/Makefile.com b/usr/src/lib/libipmi/Makefile.com index 3ba226cabb..b8f201487a 100644 --- a/usr/src/lib/libipmi/Makefile.com +++ b/usr/src/lib/libipmi/Makefile.com @@ -44,15 +44,13 @@ OBJECTS= ipmi_bmc.o \ ipmi_util.o \ libipmi.o -SRCS= $(OBJECTS:%.o:$(SRCDIR)/%c.) - include ../../Makefile.lib -LIBS= $(DYNLIB) $(LINTLIB) +LIBS= $(DYNLIB) SRCDIR= ../common -CLEANFILES += $(SRCDIR)/ipmi_tables.c +CLEANFILES += $(SRCDIR)/ipmi_tables.c INCS += -I$(SRCDIR) LDLIBS += -lc -lm -lnvpair -lsocket -lnsl CPPFLAGS += $(INCS) @@ -60,14 +58,10 @@ CSTD = $(CSTD_GNU99) CERRWARN += $(CNOWARN_UNINIT) -$(LINTLIB) := SRCS= $(SRCDIR)/$(LINTSRC) - .KEEP_STATE: all: $(LIBS) -lint: lintcheck - $(SRCDIR)/ipmi_tables.c: $(SRCDIR)/mktables.sh $(SRCDIR)/libipmi.h sh $(SRCDIR)/mktables.sh $(SRCDIR)/libipmi.h > $@ diff --git a/usr/src/lib/libprtdiag_psr/sparc/javelin/common/javelin.c b/usr/src/lib/libprtdiag_psr/sparc/javelin/common/javelin.c index 2c2d77b1fa..1327ae9248 100644 --- a/usr/src/lib/libprtdiag_psr/sparc/javelin/common/javelin.c +++ b/usr/src/lib/libprtdiag_psr/sparc/javelin/common/javelin.c @@ -25,13 +25,11 @@ * * Javelin Platform specific functions. * - * called when : - * machine_type == MTYPE_JAVELIN + * called when : + * machine_type == MTYPE_JAVELIN * */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include <stdio.h> #include <stdlib.h> #include <unistd.h> @@ -75,9 +73,9 @@ void display_hp_fail_fault(Sys_tree *tree, struct system_kstat_data *kstats); void display_diaginfo(int flag, Prom_node *root, Sys_tree *tree, struct system_kstat_data *kstats); void display_boardnum(int num); -void display_pci(Board_node *); +void display_pci(Board_node *); void display_io_cards(struct io_card *list); -void display_ffb(Board_node *, int); +void display_ffb(Board_node *, int); void read_platform_kstats(Sys_tree *tree, struct system_kstat_data *sys_kstat, struct bd_kstat_data *bdp, struct envctrl_kstat_data *ep); @@ -85,7 +83,7 @@ void read_platform_kstats(Sys_tree *tree, /* local functions */ static int disp_envc_status(struct system_kstat_data *); static void tazjav_disp_asic_revs(Sys_tree *); -static int tazmo_physical_slot(Prom_node *, Prom_node *, int, char *); +static int tazmo_physical_slot(Prom_node *, Prom_node *, int, char *); static Prom_node *dev_next_node_sibling(Prom_node *root, char *name); @@ -169,15 +167,15 @@ display_memoryconf(Sys_tree *tree, struct grp_info *grps) dimm = bnode->nodes; for (bank = dev_find_node(bnode->nodes, "bank"); bank != NULL; - bank = dev_next_node(bank, "bank")) { + bank = dev_next_node(bank, "bank")) { int bank_size = 0; uint_t *reg_prop; preg = (uint_t *)(get_prop_val( - find_prop(bank, "bank-interleave"))); + find_prop(bank, "bank-interleave"))); reg_prop = (uint_t *)(get_prop_val( - find_prop(bank, "reg"))); + find_prop(bank, "reg"))); /* * Skip empty banks @@ -199,11 +197,11 @@ display_memoryconf(Sys_tree *tree, struct grp_info *grps) } } for (dimm = dev_find_node(bank, "dimm"); dimm != NULL; - dimm = dev_next_node_sibling(dimm, "dimm")) { + dimm = dev_next_node_sibling(dimm, "dimm")) { char dimm_status[16]; sock_name = (char *)(get_prop_val( - find_prop(dimm, "socket-name"))); + find_prop(dimm, "socket-name"))); preg = (uint_t *)(get_prop_val(find_prop(dimm, "reg"))); size = (preg[2]<<12) + (preg[3]>>20); if ((status_prop = find_prop(dimm, "status")) == NULL) { @@ -213,8 +211,8 @@ display_memoryconf(Sys_tree *tree, struct grp_info *grps) (void) sprintf(dimm_status, "%s", status); } log_printf("%3d %5s %6s %4d %6s\n", - bank_count, interleave, sock_name, - size, dimm_status, 0); + bank_count, interleave, sock_name, + size, dimm_status, 0); } total_size += bank_size; bank_count++; @@ -255,9 +253,9 @@ disp_fail_parts(Sys_tree *tree) } log_printf("\n", 0); log_printf(dgettext(TEXT_DOMAIN, "Failed Field " - "Replaceable Units (FRU) in System:\n"), 0); + "Replaceable Units (FRU) in System:\n"), 0); log_printf("==========================" - "====================\n", 0); + "====================\n", 0); } while (pnode != NULL) { @@ -276,13 +274,13 @@ disp_fail_parts(Sys_tree *tree) log_printf(dgettext(TEXT_DOMAIN, "%s unavailable :\n"), - name, 0); + name, 0); log_printf(dgettext(TEXT_DOMAIN, "\tPROM fault " - "string: %s\n"), value, 0); + "string: %s\n"), value, 0); log_printf(dgettext(TEXT_DOMAIN, "\tFailed Field " - "Replaceable Unit is "), 0); + "Replaceable Unit is "), 0); /* * Determine whether FRU is CPU module, system @@ -291,52 +289,51 @@ disp_fail_parts(Sys_tree *tree) if ((name != NULL) && (strstr(name, "sbus"))) { log_printf(dgettext(TEXT_DOMAIN, "SBus " - "Card %d\n"), get_sbus_slot(pnode), 0); + "Card %d\n"), get_sbus_slot(pnode), 0); } else if (((name = get_node_name(pnode)) != NULL) && (strstr(name, "pci"))) { log_printf(dgettext(TEXT_DOMAIN, "system " - "board\n"), 0); + "board\n"), 0); } else if (((name = get_node_name(pnode)) != NULL) && (strstr(name, "ffb"))) { log_printf(dgettext(TEXT_DOMAIN, "FFB " - "Card %d\n"), tazmo_physical_slot( - dev_find_node(bnode->nodes, "slot2dev"), - pnode, -1, slot_str), 0); + "Card %d\n"), tazmo_physical_slot( + dev_find_node(bnode->nodes, "slot2dev"), + pnode, -1, slot_str), 0); } else if (((name = get_node_name(pnode->parent)) != NULL) && (strstr(name, "pci"))) { - (void) tazmo_physical_slot( - NULL, - pnode->parent, - get_pci_device(pnode), - slot_str); + (void) tazmo_physical_slot(NULL, + pnode->parent, + get_pci_device(pnode), + slot_str); log_printf(dgettext(TEXT_DOMAIN, "PCI Card " - "in %s\n"), slot_str, 0); + "in %s\n"), slot_str, 0); } else if (((type = get_node_type(pnode)) != NULL) && (strstr(type, "cpu"))) { log_printf( - dgettext(TEXT_DOMAIN, "UltraSPARC " - "module Module %d\n"), - get_id(pnode)); + dgettext(TEXT_DOMAIN, "UltraSPARC " + "module Module %d\n"), + get_id(pnode)); } else if (((type = get_node_type(pnode)) != NULL) && (strstr(type, "memory-module"))) { fru = (char *)(get_prop_val( - find_prop(pnode, "fru"))); + find_prop(pnode, "fru"))); sock_name = (char *)(get_prop_val( - find_prop(pnode, "socket-name"))); + find_prop(pnode, "socket-name"))); log_printf( - dgettext(TEXT_DOMAIN, "%s in " - "socket %s\n"), fru, - sock_name, 0); + dgettext(TEXT_DOMAIN, "%s in " + "socket %s\n"), fru, + sock_name, 0); } pnode = next_failed_node(pnode); } @@ -346,7 +343,7 @@ disp_fail_parts(Sys_tree *tree) if (!system_failed) { log_printf("\n", 0); log_printf(dgettext(TEXT_DOMAIN, "No failures found " - "in System\n"), 0); + "in System\n"), 0); log_printf("===========================\n", 0); } @@ -369,7 +366,7 @@ display_hp_fail_fault(Sys_tree *tree, struct system_kstat_data *kstats) void display_diaginfo(int flag, Prom_node *root, Sys_tree *tree, - struct system_kstat_data *kstats) + struct system_kstat_data *kstats) { /* * Now display the last powerfail time and the fatal hardware @@ -444,9 +441,9 @@ display_pci(Board_node *board) */ if (find_prop(pci, "upa-portid") == NULL) { if ((pci->parent->sibling != NULL) && - (strcmp(get_prop_val( - find_prop(pci->parent->sibling, - "name")), PCI_NAME) == 0)) + (strcmp(get_prop_val( + find_prop(pci->parent->sibling, + "name")), PCI_NAME) == 0)) pci = pci->parent->sibling; else { pci = pci->parent->sibling; @@ -472,7 +469,7 @@ display_pci(Board_node *board) /* If it doesn't have a name, skip it */ name = (char *)get_prop_val( - find_prop(card_node, "name")); + find_prop(card_node, "name")); if (name == NULL) { card_node = card_node->sibling; continue; @@ -491,27 +488,25 @@ display_pci(Board_node *board) /* Get the slot number for this card */ if (pci_pci_bridge) { card.slot = tazmo_physical_slot( - dev_find_node(board->nodes, "slot2dev"), - pci, - get_pci_to_pci_device( - card_node->parent), - card.slot_str); + dev_find_node(board->nodes, "slot2dev"), + pci, + get_pci_to_pci_device(card_node->parent), + card.slot_str); } else card.slot = tazmo_physical_slot( - dev_find_node(board->nodes, - "slot2dev"), - pci, - get_pci_device(card_node), - card.slot_str); + dev_find_node(board->nodes, "slot2dev"), + pci, + get_pci_device(card_node), + card.slot_str); /* * Check that duplicate devices are not reported * on Tazmo. */ if ((card_node->parent == prev_parent) && - (get_pci_device(card_node) == prev_device) && - (pci_pci_bridge == 0)) - card.slot = -1; + (get_pci_device(card_node) == prev_device) && + (pci_pci_bridge == 0)) + card.slot = -1; prev_parent = card_node->parent; prev_device = get_pci_device(card_node); @@ -530,7 +525,7 @@ display_pci(Board_node *board) card.model[0] = '\0'; else (void) sprintf(card.model, "%s", - (char *)value); + (char *)value); /* * Check if further processing is necessary to display @@ -546,11 +541,11 @@ display_pci(Board_node *board) value = get_prop_val(find_prop(pci, "clock-frequency")); if (value != NULL && card.freq == -1) card.freq = ((*(int *)value) + 500000) - / 1000000; + / 1000000; value = get_prop_val(find_prop(card_node, - "compatible")); + "compatible")); /* * On Tazmo, we would like to print out the last @@ -568,7 +563,7 @@ display_pci(Board_node *board) compat = find_prop(card_node, "compatible"); while (always) { if ((strlen(tval) + 1) == - (compat->size - index)) + (compat->size - index)) break; index += strlen(tval) + 1; tval += strlen(tval) + 1; @@ -578,10 +573,10 @@ display_pci(Board_node *board) if (value != NULL) (void) sprintf(card.name, "%s-%s", - (char *)name, (char *)value); + (char *)name, (char *)value); else (void) sprintf(card.name, "%s", - (char *)name); + (char *)name); if (card.freq != -1) card_list = insert_io_card(card_list, &card); @@ -620,12 +615,12 @@ display_io_cards(struct io_card *list) if (banner == 0) { log_printf(" Bus Freq\n", 0); log_printf("Brd Type MHz Slot " - "Name " - "Model", 0); + "Name " + "Model", 0); log_printf("\n", 0); log_printf("--- ---- ---- ---- " - "-------------------------------- " - "----------------------", 0); + "-------------------------------- " + "----------------------", 0); log_printf("\n", 0); banner = 1; } @@ -676,10 +671,10 @@ display_ffb(Board_node *board, int table) /* XXX - Get the slot number (hack) */ card.slot = tazmo_physical_slot( - dev_find_node(board->nodes, "slot2dev"), - ffb, - -1, - card.slot_str); + dev_find_node(board->nodes, "slot2dev"), + ffb, + -1, + card.slot_str); /* Find out if it's single or double buffered */ (void) sprintf(card.name, "FFB"); @@ -687,17 +682,17 @@ display_ffb(Board_node *board, int table) if (value != NULL) if ((*(int *)value) & FFB_B_BUFF) (void) sprintf(card.name, - "FFB, Double Buffered"); + "FFB, Double Buffered"); else (void) sprintf(card.name, - "FFB, Single Buffered"); + "FFB, Single Buffered"); /* Print model number */ card.model[0] = '\0'; value = get_prop_val(find_prop(ffb, "model")); if (value != NULL) (void) sprintf(card.model, "%s", - (char *)value); + (char *)value); card_list = insert_io_card(card_list, &card); } else { @@ -712,17 +707,17 @@ display_ffb(Board_node *board, int table) /* Find the device node using upa address */ value = get_prop_val(find_prop(ffb, "upa-portid")); if (value == NULL) - continue; + continue; (void) sprintf(device, "%s@%x", FFB_NAME, - *(int *)value); + *(int *)value); if ((dirp = opendir("/devices")) == NULL) continue; while ((direntp = readdir(dirp)) != NULL) { if (strstr(direntp->d_name, device) != NULL) { (void) sprintf(device, "/devices/%s", - direntp->d_name); + direntp->d_name); fd = open(device, O_RDWR, 0666); break; } @@ -740,13 +735,13 @@ display_ffb(Board_node *board, int table) strap.ffb_strap_bits = fsi.ffb_strap_bits; log_printf("\tBoard rev: %d\n", - (int)strap.fld.board_rev, 0); + (int)strap.fld.board_rev, 0); log_printf("\tFBC version: " - "0x%x\n", fsi.fbc_version, 0); + "0x%x\n", fsi.fbc_version, 0); log_printf("\tDAC: %s\n", - fmt_manf_id(fsi.dac_version, device), 0); + fmt_manf_id(fsi.dac_version, device), 0); log_printf("\t3DRAM: %s\n", - fmt_manf_id(fsi.fbram_version, device), 0); + fmt_manf_id(fsi.fbram_version, device), 0); log_printf("\n", 0); } } @@ -761,7 +756,7 @@ display_ffb(Board_node *board, int table) */ void read_platform_kstats(Sys_tree *tree, struct system_kstat_data *sys_kstat, - struct bd_kstat_data *bdp, struct envctrl_kstat_data *ep) + struct bd_kstat_data *bdp, struct envctrl_kstat_data *ep) { kstat_ctl_t *kc; struct envctrltwo_kstat_data *ecp; @@ -781,11 +776,11 @@ read_platform_kstats(Sys_tree *tree, struct system_kstat_data *sys_kstat, /* Read the power supply kstats */ ksp = kstat_lookup(kc, ENVCTRL_MODULE_NAME, INSTANCE_0, - ENVCTRL_KSTAT_PSNAME2); + ENVCTRL_KSTAT_PSNAME2); if (ksp != NULL && (kstat_read(kc, ksp, NULL) != -1)) { (void) memcpy(ecp->ps_kstats, ksp->ks_data, - ksp->ks_ndata * sizeof (envctrl_ps2_t)); + ksp->ks_ndata * sizeof (envctrl_ps2_t)); } else { sys_kstat->envctrltwo_kstat_ok = B_FALSE; return; @@ -795,11 +790,11 @@ read_platform_kstats(Sys_tree *tree, struct system_kstat_data *sys_kstat, /* Read the fan status kstats */ ksp = kstat_lookup(kc, ENVCTRL_MODULE_NAME, INSTANCE_0, - ENVCTRL_KSTAT_FANSTAT); + ENVCTRL_KSTAT_FANSTAT); if (ksp != NULL && (kstat_read(kc, ksp, NULL) != -1)) { (void) memcpy(ecp->fan_kstats, ksp->ks_data, - ksp->ks_ndata * sizeof (envctrl_fan_t)); + ksp->ks_ndata * sizeof (envctrl_fan_t)); } else { sys_kstat->envctrltwo_kstat_ok = B_FALSE; return; @@ -809,11 +804,11 @@ read_platform_kstats(Sys_tree *tree, struct system_kstat_data *sys_kstat, /* Read the enclosure kstats */ ksp = kstat_lookup(kc, ENVCTRL_MODULE_NAME, INSTANCE_0, - ENVCTRL_KSTAT_ENCL); + ENVCTRL_KSTAT_ENCL); if (ksp != NULL && (kstat_read(kc, ksp, NULL) != -1)) { (void) memcpy(ecp->encl_kstats, ksp->ks_data, - ksp->ks_ndata * sizeof (envctrl_encl_t)); + ksp->ks_ndata * sizeof (envctrl_encl_t)); } else { sys_kstat->envctrltwo_kstat_ok = B_FALSE; return; @@ -823,11 +818,11 @@ read_platform_kstats(Sys_tree *tree, struct system_kstat_data *sys_kstat, /* Read the temperature kstats */ ksp = kstat_lookup(kc, ENVCTRL_MODULE_NAME, INSTANCE_0, - ENVCTRL_KSTAT_TEMPERATURE); + ENVCTRL_KSTAT_TEMPERATURE); if (ksp != NULL && (kstat_read(kc, ksp, NULL) != -1)) { (void) memcpy(ecp->temp_kstats, ksp->ks_data, - ksp->ks_ndata * sizeof (envctrl_temp_t)); + ksp->ks_ndata * sizeof (envctrl_temp_t)); } else { sys_kstat->envctrltwo_kstat_ok = B_FALSE; return; @@ -837,11 +832,11 @@ read_platform_kstats(Sys_tree *tree, struct system_kstat_data *sys_kstat, /* Read the disk kstats */ ksp = kstat_lookup(kc, ENVCTRL_MODULE_NAME, INSTANCE_0, - ENVCTRL_KSTAT_DISK); + ENVCTRL_KSTAT_DISK); if (ksp != NULL && (kstat_read(kc, ksp, NULL) != -1)) { (void) memcpy(ecp->disk_kstats, ksp->ks_data, - ksp->ks_ndata * sizeof (envctrl_disk_t)); + ksp->ks_ndata * sizeof (envctrl_disk_t)); } else { sys_kstat->envctrltwo_kstat_ok = B_FALSE; return; @@ -925,16 +920,16 @@ walk(Sys_tree *tree, Prom_node *root, int id) board_node = 1; #ifdef DEBUG printf("ADDED BOARD name=%s type=%s model=%s\n", - name, type, model); + name, type, model); #endif } else if ((strcmp(name, FFB_NAME) == 0) || (strcmp(type, "cpu") == 0) || ((strcmp(name, "pci") == 0) && (model != NULL) && - (strcmp(model, "SUNW,psycho") == 0)) || + (strcmp(model, "SUNW,psycho") == 0)) || ((strcmp(name, "pci") == 0) && (model != NULL) && - (strcmp(model, "SUNW,sabre") == 0)) || + (strcmp(model, "SUNW,sabre") == 0)) || (strcmp(name, "counter-timer") == 0) || (strcmp(name, "sbus") == 0) || @@ -945,7 +940,7 @@ walk(Sys_tree *tree, Prom_node *root, int id) board_node = 1; #ifdef DEBUG printf("ADDED BOARD name=%s type=%s model=%s\n", - name, type, model); + name, type, model); #endif } #ifdef DEBUG @@ -1003,9 +998,9 @@ disp_envc_status(struct system_kstat_data *sys_kstats) if (sys_kstats->envctrltwo_kstat_ok == 0) { log_printf("\n", 0); log_printf(dgettext(TEXT_DOMAIN, "Environmental information " - "is not available\n"), 0); + "is not available\n"), 0); log_printf(dgettext(TEXT_DOMAIN, "Environmental driver may " - "not be installed\n"), 0); + "not be installed\n"), 0); log_printf("\n", 0); return (1); } @@ -1067,21 +1062,21 @@ disp_envc_status(struct system_kstat_data *sys_kstats) log_printf("Keyswitch position is in %s mode.\n", state); log_printf("\n", 0); val = fsp_value & (ENVCTRL_UE250_FSP_DISK_ERR | - ENVCTRL_UE250_FSP_PS_ERR | ENVCTRL_UE250_FSP_TEMP_ERR | - ENVCTRL_UE250_FSP_GEN_ERR | ENVCTRL_UE250_FSP_ACTIVE); + ENVCTRL_UE250_FSP_PS_ERR | ENVCTRL_UE250_FSP_TEMP_ERR | + ENVCTRL_UE250_FSP_GEN_ERR | ENVCTRL_UE250_FSP_ACTIVE); log_printf("System LED Status: DISK ERROR POWER \n", 0); log_printf(" [%3s] [ ON] \n", - val & ENVCTRL_UE250_FSP_DISK_ERR ? "ON" : "OFF"); + val & ENVCTRL_UE250_FSP_DISK_ERR ? "ON" : "OFF"); log_printf(" POWER SUPPLY ERROR ACTIVITY \n", 0); log_printf(" [%3s] [%3s] \n", - val & ENVCTRL_UE250_FSP_PS_ERR ? "ON" : "OFF", - val & ENVCTRL_UE250_FSP_ACTIVE ? "ON" : "OFF"); + val & ENVCTRL_UE250_FSP_PS_ERR ? "ON" : "OFF", + val & ENVCTRL_UE250_FSP_ACTIVE ? "ON" : "OFF"); log_printf(" GENERAL ERROR THERMAL ERROR \n", 0); log_printf(" [%3s] [%3s] \n", - val & ENVCTRL_UE250_FSP_GEN_ERR ? "ON" : "OFF", - val & ENVCTRL_UE250_FSP_TEMP_ERR ? "ON" : "OFF"); + val & ENVCTRL_UE250_FSP_GEN_ERR ? "ON" : "OFF", + val & ENVCTRL_UE250_FSP_TEMP_ERR ? "ON" : "OFF"); if (val & (ENVCTRL_UE250_FSP_DISK_ERR | ENVCTRL_UE250_FSP_PS_ERR | - ENVCTRL_UE250_FSP_GEN_ERR | ENVCTRL_UE250_FSP_TEMP_ERR)) { + ENVCTRL_UE250_FSP_GEN_ERR | ENVCTRL_UE250_FSP_TEMP_ERR)) { exit_code = 1; } @@ -1100,19 +1095,19 @@ disp_envc_status(struct system_kstat_data *sys_kstats) log_printf("Disk LED Status: OK = GREEN ERROR = YELLOW\n", 0); log_printf(" DISK 5: %7s DISK 3: %7s DISK 1: %7s\n", - disk_pr & ENVCTRL_DISK_5 ? - disk_fl & ENVCTRL_DISK_5 ? "[ERROR]" : "[OK]" : "[EMPTY]", - disk_pr & ENVCTRL_DISK_3 ? - disk_fl & ENVCTRL_DISK_3 ? "[ERROR]" : "[OK]" : "[EMPTY]", - disk_pr & ENVCTRL_DISK_1 ? - disk_fl & ENVCTRL_DISK_1 ? "[ERROR]" : "[OK]" : "[EMPTY]"); + disk_pr & ENVCTRL_DISK_5 ? + disk_fl & ENVCTRL_DISK_5 ? "[ERROR]" : "[OK]" : "[EMPTY]", + disk_pr & ENVCTRL_DISK_3 ? + disk_fl & ENVCTRL_DISK_3 ? "[ERROR]" : "[OK]" : "[EMPTY]", + disk_pr & ENVCTRL_DISK_1 ? + disk_fl & ENVCTRL_DISK_1 ? "[ERROR]" : "[OK]" : "[EMPTY]"); log_printf(" DISK 4: %7s DISK 2: %7s DISK 0: %7s\n", - disk_pr & ENVCTRL_DISK_4 ? - disk_fl & ENVCTRL_DISK_4 ? "[ERROR]" : "[OK]" : "[EMPTY]", - disk_pr & ENVCTRL_DISK_2 ? - disk_fl & ENVCTRL_DISK_2 ? "[ERROR]" : "[OK]" : "[EMPTY]", - disk_pr & ENVCTRL_DISK_0 ? - disk_fl & ENVCTRL_DISK_0 ? "[ERROR]" : "[OK]" : "[EMPTY]"); + disk_pr & ENVCTRL_DISK_4 ? + disk_fl & ENVCTRL_DISK_4 ? "[ERROR]" : "[OK]" : "[EMPTY]", + disk_pr & ENVCTRL_DISK_2 ? + disk_fl & ENVCTRL_DISK_2 ? "[ERROR]" : "[OK]" : "[EMPTY]", + disk_pr & ENVCTRL_DISK_0 ? + disk_fl & ENVCTRL_DISK_0 ? "[ERROR]" : "[OK]" : "[EMPTY]"); log_printf("\n", 0); log_printf("=================================\n", 0); @@ -1147,7 +1142,7 @@ disp_envc_status(struct system_kstat_data *sys_kstats) (void) sprintf(state, "%s", " OK "); else if (ps_ks.ps_ok != B_TRUE) { (void) sprintf(state, "%s", "FAILED: DC " - "Power Failure"); + "Power Failure"); exit_code = 1; } @@ -1197,9 +1192,9 @@ tazjav_disp_asic_revs(Sys_tree *tree) if (find_prop(pnode, "upa-portid") == NULL) { if ((parsib != NULL) && - (strcmp(get_prop_val( - find_prop(parsib, "name")), - PCI_NAME) == 0)) + (strcmp(get_prop_val( + find_prop(parsib, "name")), + PCI_NAME) == 0)) pnode = parsib; else { pnode = parsib; @@ -1307,7 +1302,7 @@ tazmo_physical_slot(Prom_node *slotd, Prom_node *parent, int device, char *str) offset = reg[1]; if (strcmp(name, "pci") == 0) { (void) sprintf(controller, "/pci@%x,%x/*@%x,*", - *upa_id, offset, device); + *upa_id, offset, device); slots = 20; } else if (strcmp(name, "SUNW,ffb") == 0) { (void) sprintf(controller, "/*@%x,0", *upa_id); @@ -1327,9 +1322,8 @@ tazmo_physical_slot(Prom_node *slotd, Prom_node *parent, int device, char *str) (void) sprintf(slotx, "graphics#%d", slot); if ((prop = find_prop(slotd, slotx)) != NULL) if ((devpath_p = (char *)(get_prop_val - (prop))) != NULL) - if (strcmp(devpath_p, controller) == - NULL) + (prop))) != NULL) + if (strcmp(devpath_p, controller) == 0) return (slot); } return (-1); diff --git a/usr/src/lib/libprtdiag_psr/sparc/serengeti/common/serengeti.c b/usr/src/lib/libprtdiag_psr/sparc/serengeti/common/serengeti.c index c1bee1b293..d77455e83d 100644 --- a/usr/src/lib/libprtdiag_psr/sparc/serengeti/common/serengeti.c +++ b/usr/src/lib/libprtdiag_psr/sparc/serengeti/common/serengeti.c @@ -26,8 +26,6 @@ * */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include <stdio.h> #include <stdlib.h> #include <unistd.h> @@ -128,8 +126,8 @@ Prop *find_prop(Prom_node *pnode, char *name); char *get_node_name(Prom_node *pnode); char *get_node_type(Prom_node *pnode); void add_node(Sys_tree *, Prom_node *); -void display_pci(Board_node *); -void display_ffb(Board_node *, int); +void display_pci(Board_node *); +void display_ffb(Board_node *, int); void display_io_cards(struct io_card *list); void display_cpu_devices(Sys_tree *tree); void display_cpus(Board_node *board); @@ -706,7 +704,7 @@ serengeti_display_board_info(int state) char tmp_info[DISPLAY_INFO + 1]; const char listops[] = "class=sbd"; struct cfga_list_data dat; - cfga_flags_t flags = NULL; + cfga_flags_t flags = 0; ret = config_list_ext(0, NULL, &board_cfg, &nlist, NULL, listops, @@ -1177,7 +1175,7 @@ display_cpus(Board_node *board) /*ARGSUSED3*/ void display_diaginfo(int flag, Prom_node *root, Sys_tree *tree, - struct system_kstat_data *kstats) + struct system_kstat_data *kstats) { log_printf("\n", 0); log_printf("=========================", 0); @@ -1285,7 +1283,7 @@ display_schizo_revisions(Board_node *bdlist, int mode) char *status_a, *status_b; char status[MAX_STATUS_LEN]; int version; - int node_id; + int node_id; #ifdef DEBUG uint32_t a_notes, b_notes; #endif @@ -1467,7 +1465,7 @@ display_sgsbbc_revisions(Board_node *bdlist) char *model; char *status; int revision; - int node_id; + int node_id; Board_node *bnode; #ifdef DEBUG @@ -1805,14 +1803,14 @@ display_memoryconf(Sys_tree *tree, struct grp_info *grps) */ void print_us3_memory_line(int portid, int bank_id, uint64_t bank_size, - char *bank_status, uint64_t dimm_size, uint32_t intlv, int seg_id) + char *bank_status, uint64_t dimm_size, uint32_t intlv, int seg_id) { int nodeid, board, mcid; char fru_name[MAX_FRU_NAME_LEN] = ""; - mcid = SG_PORTID_TO_SAFARI_ID(portid); - nodeid = SG_PORTID_TO_NODEID(portid); - board = SG_PORTID_TO_BOARD_NUM(portid); + mcid = SG_PORTID_TO_SAFARI_ID(portid); + nodeid = SG_PORTID_TO_NODEID(portid); + board = SG_PORTID_TO_BOARD_NUM(portid); SG_SET_FRU_NAME_NODE(fru_name, nodeid); SG_SET_FRU_NAME_CPU_BOARD(fru_name, board); diff --git a/usr/src/lib/libprtdiag_psr/sparc/tazmo/common/tazmo.c b/usr/src/lib/libprtdiag_psr/sparc/tazmo/common/tazmo.c index bbeadffea0..58d4634164 100644 --- a/usr/src/lib/libprtdiag_psr/sparc/tazmo/common/tazmo.c +++ b/usr/src/lib/libprtdiag_psr/sparc/tazmo/common/tazmo.c @@ -25,13 +25,11 @@ * * Tazmo Platform specific functions. * - * called when : - * machine_type == MTYPE_TAZMO + * called when : + * machine_type == MTYPE_TAZMO * */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include <stdio.h> #include <stdlib.h> #include <unistd.h> @@ -75,9 +73,9 @@ void display_hp_fail_fault(Sys_tree *tree, struct system_kstat_data *kstats); void display_diaginfo(int flag, Prom_node *root, Sys_tree *tree, struct system_kstat_data *kstats); void display_boardnum(int num); -void display_pci(Board_node *); +void display_pci(Board_node *); void display_io_cards(struct io_card *list); -void display_ffb(Board_node *, int); +void display_ffb(Board_node *, int); void read_platform_kstats(Sys_tree *tree, struct system_kstat_data *sys_kstat, struct bd_kstat_data *bdp, struct envctrl_kstat_data *ep); @@ -88,7 +86,7 @@ static void check_disk_presence(Sys_tree *, int *, int *, int *); static void modify_device_path(char *, char *); static int disk_present(char *); static void tazjav_disp_asic_revs(Sys_tree *); -static int tazmo_physical_slot(Prom_node *, Prom_node *, int, char *); +static int tazmo_physical_slot(Prom_node *, Prom_node *, int, char *); static Prom_node *dev_next_node_sibling(Prom_node *root, char *name); @@ -172,15 +170,15 @@ display_memoryconf(Sys_tree *tree, struct grp_info *grps) dimm = bnode->nodes; for (bank = dev_find_node(bnode->nodes, "bank"); bank != NULL; - bank = dev_next_node(bank, "bank")) { + bank = dev_next_node(bank, "bank")) { int bank_size = 0; uint_t *reg_prop; preg = (uint_t *)(get_prop_val( - find_prop(bank, "bank-interleave"))); + find_prop(bank, "bank-interleave"))); reg_prop = (uint_t *)(get_prop_val( - find_prop(bank, "reg"))); + find_prop(bank, "reg"))); /* * Skip empty banks @@ -202,11 +200,11 @@ display_memoryconf(Sys_tree *tree, struct grp_info *grps) } } for (dimm = dev_find_node(bank, "dimm"); dimm != NULL; - dimm = dev_next_node_sibling(dimm, "dimm")) { + dimm = dev_next_node_sibling(dimm, "dimm")) { char dimm_status[16]; sock_name = (char *)(get_prop_val( - find_prop(dimm, "socket-name"))); + find_prop(dimm, "socket-name"))); preg = (uint_t *)(get_prop_val(find_prop(dimm, "reg"))); size = (preg[2]<<12) + (preg[3]>>20); if ((status_prop = find_prop(dimm, "status")) == NULL) { @@ -216,8 +214,8 @@ display_memoryconf(Sys_tree *tree, struct grp_info *grps) (void) sprintf(dimm_status, "%s", status); } log_printf("%3d %5s %6s %4d %6s\n", - bank_count, interleave, sock_name, - size, dimm_status, 0); + bank_count, interleave, sock_name, + size, dimm_status, 0); } total_size += bank_size; bank_count++; @@ -258,9 +256,9 @@ disp_fail_parts(Sys_tree *tree) } log_printf("\n", 0); log_printf(dgettext(TEXT_DOMAIN, "Failed Field " - "Replaceable Units (FRU) in System:\n"), 0); + "Replaceable Units (FRU) in System:\n"), 0); log_printf("==========================" - "====================\n", 0); + "====================\n", 0); } while (pnode != NULL) { @@ -279,14 +277,14 @@ disp_fail_parts(Sys_tree *tree) log_printf(dgettext(TEXT_DOMAIN, "%s unavailable :\n"), - name, 0); + name, 0); log_printf(dgettext(TEXT_DOMAIN, - "\tPROM fault string: %s\n"), - value, 0); + "\tPROM fault string: %s\n"), + value, 0); log_printf(dgettext(TEXT_DOMAIN, - "\tFailed Field Replaceable Unit is "), 0); + "\tFailed Field Replaceable Unit is "), 0); /* * Determine whether FRU is CPU module, system @@ -295,53 +293,53 @@ disp_fail_parts(Sys_tree *tree) if ((name != NULL) && (strstr(name, "sbus"))) { log_printf(dgettext(TEXT_DOMAIN, "SBus " - "Card %d\n"), get_sbus_slot(pnode), 0); + "Card %d\n"), get_sbus_slot(pnode), 0); } else if (((name = get_node_name(pnode)) != NULL) && (strstr(name, "pci"))) { log_printf(dgettext(TEXT_DOMAIN, - "system board\n"), 0); + "system board\n"), 0); } else if (((name = get_node_name(pnode)) != NULL) && (strstr(name, "ffb"))) { log_printf(dgettext(TEXT_DOMAIN, - "FFB Card %d\n"), - tazmo_physical_slot( - dev_find_node(bnode->nodes, "slot2dev"), - pnode, -1, slot_str), 0); + "FFB Card %d\n"), + tazmo_physical_slot( + dev_find_node(bnode->nodes, "slot2dev"), + pnode, -1, slot_str), 0); } else if (((name = get_node_name(pnode->parent)) != NULL) && (strstr(name, "pci"))) { (void) tazmo_physical_slot( - NULL, - pnode->parent, - get_pci_device(pnode), - slot_str); + NULL, + pnode->parent, + get_pci_device(pnode), + slot_str); log_printf(dgettext(TEXT_DOMAIN, - "PCI Card in %s\n"), slot_str, 0); + "PCI Card in %s\n"), slot_str, 0); } else if (((type = get_node_type(pnode)) != NULL) && (strstr(type, "cpu"))) { log_printf( - dgettext(TEXT_DOMAIN, - "UltraSPARC module Module %d\n"), - get_id(pnode)); + dgettext(TEXT_DOMAIN, + "UltraSPARC module Module %d\n"), + get_id(pnode)); } else if (((type = get_node_type(pnode)) != NULL) && (strstr(type, "memory-module"))) { fru = (char *)(get_prop_val( - find_prop(pnode, "fru"))); + find_prop(pnode, "fru"))); sock_name = (char *)(get_prop_val( - find_prop(pnode, "socket-name"))); + find_prop(pnode, "socket-name"))); log_printf( - dgettext(TEXT_DOMAIN, - "%s in socket %s\n"), - fru, sock_name, 0); + dgettext(TEXT_DOMAIN, + "%s in socket %s\n"), + fru, sock_name, 0); } pnode = next_failed_node(pnode); } @@ -351,7 +349,7 @@ disp_fail_parts(Sys_tree *tree) if (!system_failed) { log_printf("\n", 0); log_printf(dgettext(TEXT_DOMAIN, - "No failures found in System\n"), 0); + "No failures found in System\n"), 0); log_printf("===========================\n", 0); } @@ -374,7 +372,7 @@ display_hp_fail_fault(Sys_tree *tree, struct system_kstat_data *kstats) void display_diaginfo(int flag, Prom_node *root, Sys_tree *tree, - struct system_kstat_data *kstats) + struct system_kstat_data *kstats) { /* * Now display the last powerfail time and the fatal hardware @@ -449,9 +447,9 @@ display_pci(Board_node *board) */ if (find_prop(pci, "upa-portid") == NULL) { if ((pci->parent->sibling != NULL) && - (strcmp(get_prop_val( - find_prop(pci->parent->sibling, - "name")), PCI_NAME) == 0)) + (strcmp(get_prop_val( + find_prop(pci->parent->sibling, + "name")), PCI_NAME) == 0)) pci = pci->parent->sibling; else { pci = pci->parent->sibling; @@ -477,7 +475,7 @@ display_pci(Board_node *board) /* If it doesn't have a name, skip it */ name = (char *)get_prop_val( - find_prop(card_node, "name")); + find_prop(card_node, "name")); if (name == NULL) { card_node = card_node->sibling; continue; @@ -496,26 +494,24 @@ display_pci(Board_node *board) /* Get the slot number for this card */ if (pci_pci_bridge) { card.slot = tazmo_physical_slot( - dev_find_node(board->nodes, "slot2dev"), - pci, - get_pci_to_pci_device( - card_node->parent), - card.slot_str); + dev_find_node(board->nodes, "slot2dev"), + pci, + get_pci_to_pci_device(card_node->parent), + card.slot_str); } else card.slot = tazmo_physical_slot( - dev_find_node(board->nodes, - "slot2dev"), - pci, - get_pci_device(card_node), - card.slot_str); + dev_find_node(board->nodes, "slot2dev"), + pci, + get_pci_device(card_node), + card.slot_str); /* * Check that duplicate devices are not reported * on Tazmo. */ if ((card_node->parent == prev_parent) && - (get_pci_device(card_node) == prev_device) && - (pci_pci_bridge == 0)) + (get_pci_device(card_node) == prev_device) && + (pci_pci_bridge == 0)) card.slot = -1; prev_parent = card_node->parent; prev_device = get_pci_device(card_node); @@ -535,7 +531,7 @@ display_pci(Board_node *board) card.model[0] = '\0'; else (void) sprintf(card.model, "%s", - (char *)value); + (char *)value); /* * Check if further processing is necessary to display @@ -550,11 +546,11 @@ display_pci(Board_node *board) value = get_prop_val(find_prop(pci, "clock-frequency")); if (value != NULL && card.freq == -1) card.freq = ((*(int *)value) + 500000) - / 1000000; + / 1000000; value = get_prop_val(find_prop(card_node, - "compatible")); + "compatible")); /* * On Tazmo, we would like to print out the last @@ -572,7 +568,7 @@ display_pci(Board_node *board) compat = find_prop(card_node, "compatible"); while (always) { if ((strlen(tval) + 1) == - (compat->size - index)) + (compat->size - index)) break; index += strlen(tval) + 1; tval += strlen(tval) + 1; @@ -582,10 +578,10 @@ display_pci(Board_node *board) if (value != NULL) (void) sprintf(card.name, "%s-%s", - (char *)name, (char *)value); + (char *)name, (char *)value); else (void) sprintf(card.name, "%s", - (char *)name); + (char *)name); if (card.freq != -1) card_list = insert_io_card(card_list, &card); @@ -624,11 +620,11 @@ display_io_cards(struct io_card *list) if (banner == 0) { log_printf(" Bus Freq\n", 0); log_printf("Brd Type MHz Slot " - "Name Model", 0); + "Name Model", 0); log_printf("\n", 0); log_printf("--- ---- ---- ---- " - "-------------------------------- " - "----------------------", 0); + "-------------------------------- " + "----------------------", 0); log_printf("\n", 0); banner = 1; } @@ -679,10 +675,10 @@ display_ffb(Board_node *board, int table) /* XXX - Get the slot number (hack) */ card.slot = tazmo_physical_slot( - dev_find_node(board->nodes, "slot2dev"), - ffb, - -1, - card.slot_str); + dev_find_node(board->nodes, "slot2dev"), + ffb, + -1, + card.slot_str); /* Find out if it's single or double buffered */ (void) sprintf(card.name, "FFB"); @@ -690,17 +686,17 @@ display_ffb(Board_node *board, int table) if (value != NULL) if ((*(int *)value) & FFB_B_BUFF) (void) sprintf(card.name, - "FFB, Double Buffered"); + "FFB, Double Buffered"); else (void) sprintf(card.name, - "FFB, Single Buffered"); + "FFB, Single Buffered"); /* Print model number */ card.model[0] = '\0'; value = get_prop_val(find_prop(ffb, "model")); if (value != NULL) (void) sprintf(card.model, "%s", - (char *)value); + (char *)value); card_list = insert_io_card(card_list, &card); } else { @@ -715,17 +711,17 @@ display_ffb(Board_node *board, int table) /* Find the device node using upa address */ value = get_prop_val(find_prop(ffb, "upa-portid")); if (value == NULL) - continue; + continue; (void) sprintf(device, "%s@%x", FFB_NAME, - *(int *)value); + *(int *)value); if ((dirp = opendir("/devices")) == NULL) continue; while ((direntp = readdir(dirp)) != NULL) { if (strstr(direntp->d_name, device) != NULL) { (void) sprintf(device, "/devices/%s", - direntp->d_name); + direntp->d_name); fd = open(device, O_RDWR, 0666); break; } @@ -743,12 +739,12 @@ display_ffb(Board_node *board, int table) strap.ffb_strap_bits = fsi.ffb_strap_bits; log_printf("\tBoard rev: %d\n", - (int)strap.fld.board_rev, 0); + (int)strap.fld.board_rev, 0); log_printf("\tFBC version: 0x%x\n", fsi.fbc_version, 0); log_printf("\tDAC: %s\n", - fmt_manf_id(fsi.dac_version, device), 0); + fmt_manf_id(fsi.dac_version, device), 0); log_printf("\t3DRAM: %s\n", - fmt_manf_id(fsi.fbram_version, device), 0); + fmt_manf_id(fsi.fbram_version, device), 0); log_printf("\n", 0); } } @@ -763,7 +759,7 @@ display_ffb(Board_node *board, int table) */ void read_platform_kstats(Sys_tree *tree, struct system_kstat_data *sys_kstat, - struct bd_kstat_data *bdp, struct envctrl_kstat_data *ep) + struct bd_kstat_data *bdp, struct envctrl_kstat_data *ep) { kstat_ctl_t *kc; kstat_t *ksp; @@ -780,11 +776,11 @@ read_platform_kstats(Sys_tree *tree, struct system_kstat_data *sys_kstat, /* Read the power supply kstats */ ksp = kstat_lookup(kc, ENVCTRL_MODULE_NAME, INSTANCE_0, - ENVCTRL_KSTAT_PSNAME); + ENVCTRL_KSTAT_PSNAME); if (ksp != NULL && (kstat_read(kc, ksp, NULL) != -1)) { (void) memcpy(ep->ps_kstats, ksp->ks_data, - MAX_DEVS * sizeof (envctrl_ps_t)); + MAX_DEVS * sizeof (envctrl_ps_t)); } else { sys_kstat->envctrl_kstat_ok = B_FALSE; return; @@ -792,11 +788,11 @@ read_platform_kstats(Sys_tree *tree, struct system_kstat_data *sys_kstat, /* Read the fan status kstats */ ksp = kstat_lookup(kc, ENVCTRL_MODULE_NAME, INSTANCE_0, - ENVCTRL_KSTAT_FANSTAT); + ENVCTRL_KSTAT_FANSTAT); if (ksp != NULL && (kstat_read(kc, ksp, NULL) != -1)) { (void) memcpy(ep->fan_kstats, ksp->ks_data, - ksp->ks_ndata * sizeof (envctrl_fan_t)); + ksp->ks_ndata * sizeof (envctrl_fan_t)); } else { sys_kstat->envctrl_kstat_ok = B_FALSE; return; @@ -804,11 +800,11 @@ read_platform_kstats(Sys_tree *tree, struct system_kstat_data *sys_kstat, /* Read the enclosure kstats */ ksp = kstat_lookup(kc, ENVCTRL_MODULE_NAME, INSTANCE_0, - ENVCTRL_KSTAT_ENCL); + ENVCTRL_KSTAT_ENCL); if (ksp != NULL && (kstat_read(kc, ksp, NULL) != -1)) { (void) memcpy(ep->encl_kstats, ksp->ks_data, - ksp->ks_ndata * sizeof (envctrl_encl_t)); + ksp->ks_ndata * sizeof (envctrl_encl_t)); } else { sys_kstat->envctrl_kstat_ok = B_FALSE; return; @@ -888,16 +884,16 @@ walk(Sys_tree *tree, Prom_node *root, int id) board_node = 1; #ifdef DEBUG printf("ADDED BOARD name=%s type=%s model=%s\n", - name, type, model); + name, type, model); #endif } else if ((strcmp(name, FFB_NAME) == 0) || (strcmp(type, "cpu") == 0) || ((strcmp(name, "pci") == 0) && (model != NULL) && - (strcmp(model, "SUNW,psycho") == 0)) || + (strcmp(model, "SUNW,psycho") == 0)) || ((strcmp(name, "pci") == 0) && (model != NULL) && - (strcmp(model, "SUNW,sabre") == 0)) || + (strcmp(model, "SUNW,sabre") == 0)) || (strcmp(name, "counter-timer") == 0) || (strcmp(name, "sbus") == 0) || @@ -908,7 +904,7 @@ walk(Sys_tree *tree, Prom_node *root, int id) board_node = 1; #ifdef DEBUG printf("ADDED BOARD name=%s type=%s model=%s\n", - name, type, model); + name, type, model); #endif } #ifdef DEBUG @@ -972,9 +968,9 @@ disp_envctrl_status(Sys_tree *tree, struct system_kstat_data *sys_kstats) if (sys_kstats->envctrl_kstat_ok == 0) { log_printf("\n", 0); log_printf(dgettext(TEXT_DOMAIN, "Environmental information " - "is not available\n"), 0); + "is not available\n"), 0); log_printf(dgettext(TEXT_DOMAIN, "Environmental driver may " - "not be installed\n"), 0); + "not be installed\n"), 0); log_printf("\n", 0); return (1); } @@ -982,7 +978,7 @@ disp_envctrl_status(Sys_tree *tree, struct system_kstat_data *sys_kstats) ep = &sys_kstats->env_data; check_disk_presence(tree, &first_4disk_bp, &first_8disk_bp, - &second_8disk_bp); + &second_8disk_bp); log_printf("\n", 0); log_printf("=========================", 0); @@ -998,7 +994,7 @@ disp_envctrl_status(Sys_tree *tree, struct system_kstat_data *sys_kstats) switch (encl.type) { case ENVCTRL_ENCL_AMBTEMPR: if (encl.instance == I2C_NODEV) - continue; + continue; (void) sprintf(name, "%s", "AMBIENT"); log_printf("%s %d", name, encl.value); if (encl.value > MAX_AMB_TEMP) { @@ -1009,7 +1005,7 @@ disp_envctrl_status(Sys_tree *tree, struct system_kstat_data *sys_kstats) break; case ENVCTRL_ENCL_CPUTEMPR: if (encl.instance == I2C_NODEV) - continue; + continue; (void) sprintf(name, "%s %d", "CPU", encl.instance); log_printf("%s %d", name, encl.value); if (encl.value > MAX_CPU_TEMP) { @@ -1020,7 +1016,7 @@ disp_envctrl_status(Sys_tree *tree, struct system_kstat_data *sys_kstats) break; case ENVCTRL_ENCL_FSP: if (encl.instance == I2C_NODEV) - continue; + continue; val = encl.value & ENVCTRL_FSP_KEYMASK; fsp_value = encl.value; switch (val) { @@ -1071,23 +1067,23 @@ disp_envctrl_status(Sys_tree *tree, struct system_kstat_data *sys_kstats) log_printf("Keyswitch position is in %s mode.\n", state); log_printf("\n", 0); val = fsp_value & (ENVCTRL_FSP_DISK_ERR | ENVCTRL_FSP_PS_ERR | - ENVCTRL_FSP_TEMP_ERR | ENVCTRL_FSP_GEN_ERR | - ENVCTRL_FSP_ACTIVE); + ENVCTRL_FSP_TEMP_ERR | ENVCTRL_FSP_GEN_ERR | + ENVCTRL_FSP_ACTIVE); log_printf("System LED Status: POWER GENERAL ERROR " - " ACTIVITY\n", 0); + " ACTIVITY\n", 0); log_printf(" [ ON] [%3s] " - " [%3s]\n", val & ENVCTRL_FSP_GEN_ERR ? "ON" : "OFF", - val & ENVCTRL_FSP_ACTIVE ? "ON" : "OFF"); + " [%3s]\n", val & ENVCTRL_FSP_GEN_ERR ? "ON" : "OFF", + val & ENVCTRL_FSP_ACTIVE ? "ON" : "OFF"); log_printf(" DISK ERROR " - "THERMAL ERROR POWER SUPPLY ERROR\n", 0); + "THERMAL ERROR POWER SUPPLY ERROR\n", 0); log_printf(" [%3s] [%3s] " - " [%3s]\n", val & ENVCTRL_FSP_DISK_ERR ? "ON" : "OFF", - val & ENVCTRL_FSP_TEMP_ERR ? "ON" : "OFF", - val & ENVCTRL_FSP_PS_ERR ? "ON" : "OFF"); + " [%3s]\n", val & ENVCTRL_FSP_DISK_ERR ? "ON" : "OFF", + val & ENVCTRL_FSP_TEMP_ERR ? "ON" : "OFF", + val & ENVCTRL_FSP_PS_ERR ? "ON" : "OFF"); log_printf("\n", 0); /* record error conditions */ if (val & (ENVCTRL_FSP_GEN_ERR | ENVCTRL_FSP_DISK_ERR | - ENVCTRL_FSP_TEMP_ERR | ENVCTRL_FSP_PS_ERR)) { + ENVCTRL_FSP_TEMP_ERR | ENVCTRL_FSP_PS_ERR)) { exit_code = 1; } @@ -1098,67 +1094,67 @@ disp_envctrl_status(Sys_tree *tree, struct system_kstat_data *sys_kstats) log_printf(" DISK 18: %7s DISK 19: %7s\n", second_8disk_bp & ENVCTRL_DISK_6 ? j8slot_backplane_value & ENVCTRL_DISK_6 ? "[ERROR]" : "[OK]" - : "[EMPTY]", second_8disk_bp & ENVCTRL_DISK_7 ? + : "[EMPTY]", second_8disk_bp & ENVCTRL_DISK_7 ? j8slot_backplane_value & ENVCTRL_DISK_7 ? "[ERROR]" : "[OK]" - : "[EMPTY]"); + : "[EMPTY]"); log_printf(" DISK 16: %7s DISK 17: %7s\n", second_8disk_bp & ENVCTRL_DISK_4 ? j8slot_backplane_value & ENVCTRL_DISK_4 ? "[ERROR]" : "[OK]" - : "[EMPTY]", second_8disk_bp & ENVCTRL_DISK_5 ? + : "[EMPTY]", second_8disk_bp & ENVCTRL_DISK_5 ? j8slot_backplane_value & ENVCTRL_DISK_5 ? "[ERROR]" : "[OK]" - : "[EMPTY]"); + : "[EMPTY]"); log_printf(" DISK 14: %7s DISK 15: %7s\n", second_8disk_bp & ENVCTRL_DISK_2 ? j8slot_backplane_value & ENVCTRL_DISK_2 ? "[ERROR]" : "[OK]" - : "[EMPTY]", second_8disk_bp & ENVCTRL_DISK_3 ? + : "[EMPTY]", second_8disk_bp & ENVCTRL_DISK_3 ? j8slot_backplane_value & ENVCTRL_DISK_3 ? "[ERROR]" : "[OK]" - : "[EMPTY]"); + : "[EMPTY]"); log_printf(" DISK 12: %7s DISK 13: %7s\n", second_8disk_bp & ENVCTRL_DISK_0 ? j8slot_backplane_value & ENVCTRL_DISK_0 ? "[ERROR]" : "[OK]" - : "[EMPTY]", second_8disk_bp & ENVCTRL_DISK_1 ? + : "[EMPTY]", second_8disk_bp & ENVCTRL_DISK_1 ? j8slot_backplane_value & ENVCTRL_DISK_1 ? "[ERROR]" : "[OK]" - : "[EMPTY]"); + : "[EMPTY]"); } if (i8slot_backplane_value != -1) { log_printf(" DISK 10: %7s DISK 11: %7s\n", first_8disk_bp & ENVCTRL_DISK_6 ? i8slot_backplane_value & ENVCTRL_DISK_6 ? "[ERROR]" : "[OK]" - : "[EMPTY]", first_8disk_bp & ENVCTRL_DISK_7 ? + : "[EMPTY]", first_8disk_bp & ENVCTRL_DISK_7 ? i8slot_backplane_value & ENVCTRL_DISK_7 ? "[ERROR]" : "[OK]" - : "[EMPTY]"); + : "[EMPTY]"); log_printf(" DISK 8: %7s DISK 9: %7s\n", first_8disk_bp & ENVCTRL_DISK_4 ? i8slot_backplane_value & ENVCTRL_DISK_4 ? "[ERROR]" : "[OK]" - : "[EMPTY]", first_8disk_bp & ENVCTRL_DISK_5 ? + : "[EMPTY]", first_8disk_bp & ENVCTRL_DISK_5 ? i8slot_backplane_value & ENVCTRL_DISK_5 ? "[ERROR]" : "[OK]" - : "[EMPTY]"); + : "[EMPTY]"); log_printf(" DISK 6: %7s DISK 7: %7s\n", first_8disk_bp & ENVCTRL_DISK_2 ? i8slot_backplane_value & ENVCTRL_DISK_2 ? "[ERROR]" : "[OK]" - : "[EMPTY]", first_8disk_bp & ENVCTRL_DISK_3 ? + : "[EMPTY]", first_8disk_bp & ENVCTRL_DISK_3 ? i8slot_backplane_value & ENVCTRL_DISK_3 ? "[ERROR]" : "[OK]" - : "[EMPTY]"); + : "[EMPTY]"); log_printf(" DISK 4: %7s DISK 5: %7s\n", first_8disk_bp & ENVCTRL_DISK_0 ? i8slot_backplane_value & ENVCTRL_DISK_0 ? "[ERROR]" : "[OK]" - : "[EMPTY]", first_8disk_bp & ENVCTRL_DISK_1 ? + : "[EMPTY]", first_8disk_bp & ENVCTRL_DISK_1 ? i8slot_backplane_value & ENVCTRL_DISK_1 ? "[ERROR]" : "[OK]" - : "[EMPTY]"); + : "[EMPTY]"); } if (i4slot_backplane_value != -1) { log_printf(" DISK 2: %7s DISK 3: %7s\n", first_4disk_bp & ENVCTRL_DISK_2 ? i4slot_backplane_value & ENVCTRL_DISK_2 ? "[ERROR]" : "[OK]" - : "[EMPTY]", first_4disk_bp & ENVCTRL_DISK_3 ? + : "[EMPTY]", first_4disk_bp & ENVCTRL_DISK_3 ? i4slot_backplane_value & ENVCTRL_DISK_3 ? "[ERROR]" : "[OK]" - : "[EMPTY]"); + : "[EMPTY]"); log_printf(" DISK 0: %7s DISK 1: %7s\n", first_4disk_bp & ENVCTRL_DISK_0 ? i4slot_backplane_value & ENVCTRL_DISK_0 ? "[ERROR]" : "[OK]" - : "[EMPTY]", first_4disk_bp & ENVCTRL_DISK_1 ? + : "[EMPTY]", first_4disk_bp & ENVCTRL_DISK_1 ? i4slot_backplane_value & ENVCTRL_DISK_1 ? "[ERROR]" : "[OK]" - : "[EMPTY]"); + : "[EMPTY]"); } log_printf("=================================\n", 0); @@ -1191,13 +1187,13 @@ disp_envctrl_status(Sys_tree *tree, struct system_kstat_data *sys_kstats) (void) sprintf(state, "%s", " OK "); } else { (void) sprintf(state, "FAILED (FAN# %d)", - fan.fanflt_num); + fan.fanflt_num); /* we know fan.instance != I2C_NODEV */ exit_code = 1; } if (fan.instance != I2C_NODEV) log_printf("%s %d %s\n", fan_type, - fan.fanspeed, state); + fan.fanspeed, state); } @@ -1217,15 +1213,15 @@ disp_envctrl_status(Sys_tree *tree, struct system_kstat_data *sys_kstats) } else { if (ps.ps_ok != B_TRUE) { (void) sprintf(state, "%s", - "FAILED: DC Power Failure"); + "FAILED: DC Power Failure"); possible_failure = 1; } else if (ps.curr_share_ok != B_TRUE) { (void) sprintf(state, "%s", - "WARNING: Current Share Imbalance"); + "WARNING: Current Share Imbalance"); possible_failure = 1; } else if (ps.limit_ok != B_TRUE) { (void) sprintf(state, "%s", - "WARNING: Current Overload"); + "WARNING: Current Overload"); possible_failure = 1; } } @@ -1271,7 +1267,7 @@ check_disk_presence(Sys_tree *tree, int *i4disk, int *i8disk, int *j8disk) (void) sprintf(slotx, "slot#%d", slot); if ((slotprop = find_prop(slot2disk, slotx)) != NULL) if ((devpath_p = (char *)(get_prop_val(slotprop))) - != NULL) { + != NULL) { modify_device_path(devpath_p, devpath); if (disk_present(devpath)) { if (slot < 4) @@ -1393,7 +1389,7 @@ tazjav_disp_asic_revs(Sys_tree *tree) if ((version != NULL) && (name != NULL)) { log_printf("SBus: %s Rev %d\n", - name, *version, 0); + name, *version, 0); } } @@ -1404,9 +1400,9 @@ tazjav_disp_asic_revs(Sys_tree *tree) if (find_prop(pnode, "upa-portid") == NULL) { if ((parsib != NULL) && - (strcmp(get_prop_val( - find_prop(parsib, "name")), - PCI_NAME) == 0)) + (strcmp(get_prop_val( + find_prop(parsib, "name")), + PCI_NAME) == 0)) pnode = parsib; else { pnode = parsib; @@ -1514,7 +1510,7 @@ tazmo_physical_slot(Prom_node *slotd, Prom_node *parent, int device, char *str) offset = reg[1]; if (strcmp(name, "pci") == 0) { (void) sprintf(controller, "/pci@%x,%x/*@%x,*", - *upa_id, offset, device); + *upa_id, offset, device); slots = 20; } else if (strcmp(name, "SUNW,ffb") == 0) { (void) sprintf(controller, "/*@%x,0", *upa_id); @@ -1529,9 +1525,8 @@ tazmo_physical_slot(Prom_node *slotd, Prom_node *parent, int device, char *str) (void) sprintf(slotx, "graphics#%d", slot); if ((prop = find_prop(slotd, slotx)) != NULL) if ((devpath_p = (char *)(get_prop_val - (prop))) != NULL) - if (strcmp(devpath_p, controller) == - NULL) + (prop))) != NULL) + if (strcmp(devpath_p, controller) == 0) return (slot); } return (-1); diff --git a/usr/src/lib/libtsalarm/common/tsalarm.c b/usr/src/lib/libtsalarm/common/tsalarm.c index 42b015a7e9..4dcc34b216 100644 --- a/usr/src/lib/libtsalarm/common/tsalarm.c +++ b/usr/src/lib/libtsalarm/common/tsalarm.c @@ -76,7 +76,7 @@ tsalarm_get(uint32_t alarm_type, uint32_t *alarm_state) req_ptr->alarm_id = alarm_type; send_msg.msg_type = TSALARM_CONTROL; - send_msg.sub_type = NULL; + send_msg.sub_type = 0; send_msg.msg_len = sizeof (tsalarm_req_t); send_msg.msg_data = (uint8_t *)req_ptr; @@ -171,7 +171,7 @@ tsalarm_set(uint32_t alarm_type, uint32_t alarm_state) req_ptr->alarm_action = TSALARM_DISABLE; send_msg.msg_type = TSALARM_CONTROL; - send_msg.sub_type = NULL; + send_msg.sub_type = 0; send_msg.msg_len = sizeof (tsalarm_req_t); send_msg.msg_data = (uint8_t *)req_ptr; diff --git a/usr/src/lib/libzfs/common/libzfs_pool.c b/usr/src/lib/libzfs/common/libzfs_pool.c index ef153c39c9..b425d4e944 100644 --- a/usr/src/lib/libzfs/common/libzfs_pool.c +++ b/usr/src/lib/libzfs/common/libzfs_pool.c @@ -309,6 +309,7 @@ zpool_get_prop(zpool_handle_t *zhp, zpool_prop_t prop, char *buf, size_t len, case ZPOOL_PROP_FREE: case ZPOOL_PROP_FREEING: case ZPOOL_PROP_LEAKED: + case ZPOOL_PROP_ASHIFT: if (literal) { (void) snprintf(buf, len, "%llu", (u_longlong_t)intval); @@ -458,7 +459,8 @@ zpool_valid_proplist(libzfs_handle_t *hdl, const char *poolname, if (err != 0) { ASSERT3U(err, ==, ENOENT); zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, - "invalid feature '%s'"), fname); + "invalid feature '%s', '%s'"), fname, + propname); (void) zfs_error(hdl, EZFS_BADPROP, errbuf); goto error; } @@ -532,6 +534,19 @@ zpool_valid_proplist(libzfs_handle_t *hdl, const char *poolname, } break; + case ZPOOL_PROP_ASHIFT: + if (intval != 0 && + (intval < ASHIFT_MIN || intval > ASHIFT_MAX)) { + zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, + "invalid '%s=%d' property: only values " + "between %" PRId32 " and %" PRId32 " " + "are allowed.\n"), + propname, intval, ASHIFT_MIN, ASHIFT_MAX); + (void) zfs_error(hdl, EZFS_BADPROP, errbuf); + goto error; + } + break; + case ZPOOL_PROP_BOOTFS: if (flags.create || flags.import) { zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, @@ -3045,10 +3060,11 @@ zpool_vdev_attach(zpool_handle_t *zhp, case EDOM: /* - * The new device has a different alignment requirement. + * The new device has a different optimal sector size. */ zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, - "devices have different sector alignment")); + "new device has a different optimal sector size; use the " + "option '-o ashift=N' to override the optimal size")); (void) zfs_error(hdl, EZFS_BADDEV, msg); break; diff --git a/usr/src/lib/nsswitch/ldap/common/getgrent.c b/usr/src/lib/nsswitch/ldap/common/getgrent.c index e65a741efe..184891c9d3 100644 --- a/usr/src/lib/nsswitch/ldap/common/getgrent.c +++ b/usr/src/lib/nsswitch/ldap/common/getgrent.c @@ -207,10 +207,12 @@ getmembers_UID(char **bufpp, int *lenp, ns_ldap_attr_t *members) strpbrk(member_str, " ,:=") != NULL) continue; - if (firsttime) + if (firsttime) { len = snprintf(buffer, buflen, "%s", member_str); - else + firsttime = 0; + } else { len = snprintf(buffer, buflen, ",%s", member_str); + } TEST_AND_ADJUST(len, buffer, buflen, out); } @@ -279,10 +281,12 @@ getmembers_DN(char **bufpp, int *lenp, ns_ldap_attr_t *members) continue; } - if (firsttime) + if (firsttime) { len = snprintf(buffer, buflen, "%s", member_uid); - else + firsttime = 0; + } else { len = snprintf(buffer, buflen, ",%s", member_uid); + } free(member_uid); TEST_AND_ADJUST(len, buffer, buflen, out); } @@ -522,7 +526,7 @@ static ldap_backend_op_t gr_ops[] = { /*ARGSUSED0*/ nss_backend_t * _nss_ldap_group_constr(const char *dummy1, const char *dummy2, - const char *dummy3) + const char *dummy3) { return ((nss_backend_t *)_nss_ldap_constr(gr_ops, diff --git a/usr/src/man/man1m/zpool.1m b/usr/src/man/man1m/zpool.1m index 70d3dc29d9..14e361a442 100644 --- a/usr/src/man/man1m/zpool.1m +++ b/usr/src/man/man1m/zpool.1m @@ -26,8 +26,9 @@ .\" Copyright (c) 2017 Datto Inc. .\" Copyright (c) 2017 George Melikov. All Rights Reserved. .\" Copyright 2019 Joyent, Inc. +.\" Copyright (c) 2012 Cyril Plisko. All Rights Reserved. .\" -.Dd May 15, 2019 +.Dd August 30, 2019 .Dt ZPOOL 1M .Os .Sh NAME @@ -39,10 +40,12 @@ .Nm .Cm add .Op Fl fgLnP +.Oo Fl o Ar property Ns = Ns Ar value Oc .Ar pool vdev Ns ... .Nm .Cm attach .Op Fl f +.Oo Fl o Ar property Ns = Ns Ar value Oc .Ar pool device new_device .Nm .Cm checkpoint @@ -668,6 +671,31 @@ changed with the .Nm zpool Cm set command: .Bl -tag -width Ds +.It Sy ashift Ns = Ns Sy ashift +Pool sector size exponent, to the power of +.Sy 2 +(internally referred to as +.Sy ashift +). Values from 9 to 16, inclusive, are valid; also, the +value 0 (the default) means to auto-detect using the kernel's block +layer and a ZFS internal exception list. +I/O operations will be aligned to the specified size boundaries. +Additionally, the minimum (disk) write size will be set to the specified size, +so this represents a space vs performance trade-off. +For optimal performance, the pool sector size should be greater than or equal to +the sector size of the underlying disks. +The typical case for setting this property is when performance is important and +the underlying disks use 4KiB sectors but report 512B sectors to the OS (for +compatibility reasons); in that case, set +.Sy ashift=12 +(which is 1<<12 = 4096). When set, this property is +used as the default hint value in subsequent vdev operations (add, +attach and replace). +Changing this value will not modify any existing +vdev, not even on disk replacement; however it can be used, for +instance, to replace a dying 512B sectors disk with a newer 4KiB +sectors device: this will probably result in bad performance but at the +same time could prevent loss of data. .It Sy autoexpand Ns = Ns Sy on Ns | Ns Sy off Controls automatic pool expansion when the underlying LUN is grown. If set to @@ -838,6 +866,7 @@ Displays a help message. .Nm .Cm add .Op Fl fgLnP +.Oo Fl o Ar property Ns = Ns Ar value Oc .Ar pool vdev Ns ... .Xc Adds the specified virtual devices to the given pool. @@ -881,11 +910,19 @@ instead of only the last component of the path. This can be used in conjunction with the .Fl L flag. +.It Fl o Ar property Ns = Ns Ar value +Sets the given pool properties. +See the +.Sx Properties +section for a list of valid properties that can be set. +The only property supported at the moment is +.Sy ashift. .El .It Xo .Nm .Cm attach .Op Fl f +.Oo Fl o Ar property Ns = Ns Ar value Oc .Ar pool device new_device .Xc Attaches @@ -915,6 +952,13 @@ Forces use of .Ar new_device , even if its appears to be in use. Not all devices can be overridden in this manner. +.It Fl o Ar property Ns = Ns Ar value +Sets the given pool properties. +See the +.Sx Properties +section for a list of valid properties that can be set. +The only property supported at the moment is +.Sy ashift. .El .It Xo .Nm diff --git a/usr/src/pkg/manifests/driver-cpu-sensor.mf b/usr/src/pkg/manifests/driver-cpu-sensor.mf index b9161f82f6..b6b59e4f03 100644 --- a/usr/src/pkg/manifests/driver-cpu-sensor.mf +++ b/usr/src/pkg/manifests/driver-cpu-sensor.mf @@ -30,19 +30,19 @@ dir path=usr/lib/devfsadm/linkmod group=sys dir path=usr/share/man dir path=usr/share/man/man7d driver name=amdf17nbdf \ - alias=pci1022,1450 \ - alias=pci1022,1460 + alias=pci1022,1450,p \ + alias=pci1022,1460,p driver name=coretemp driver name=pchtemp \ - alias=pci8086,8c24 \ - alias=pci8086,8ca4 \ - alias=pci8086,8d24 \ - alias=pci8086,9d31 \ - alias=pci8086,a131 \ - alias=pci8086,a1b1 \ - alias=pci8086,a231 \ - alias=pci8086,a2b1 \ - alias=pci8086,a379 + alias=pci8086,8c24,p \ + alias=pci8086,8ca4,p \ + alias=pci8086,8d24,p \ + alias=pci8086,9d31,p \ + alias=pci8086,a131,p \ + alias=pci8086,a1b1,p \ + alias=pci8086,a231,p \ + alias=pci8086,a2b1,p \ + alias=pci8086,a379,p file path=kernel/drv/$(ARCH64)/amdf17nbdf group=sys file path=kernel/drv/$(ARCH64)/coretemp group=sys file path=kernel/drv/$(ARCH64)/pchtemp group=sys diff --git a/usr/src/pkg/manifests/system-header.mf b/usr/src/pkg/manifests/system-header.mf index f13015d5ce..45fda3fbfc 100644 --- a/usr/src/pkg/manifests/system-header.mf +++ b/usr/src/pkg/manifests/system-header.mf @@ -1171,6 +1171,7 @@ file path=usr/include/sys/ldterm.h file path=usr/include/sys/lgrp.h file path=usr/include/sys/lgrp_user.h file path=usr/include/sys/link.h +file path=usr/include/sys/linker_set.h file path=usr/include/sys/list.h file path=usr/include/sys/list_impl.h file path=usr/include/sys/llc1.h diff --git a/usr/src/pkg/manifests/system-test-zfstest.mf b/usr/src/pkg/manifests/system-test-zfstest.mf index a4448972d6..8a056160a8 100644 --- a/usr/src/pkg/manifests/system-test-zfstest.mf +++ b/usr/src/pkg/manifests/system-test-zfstest.mf @@ -1450,9 +1450,13 @@ file path=opt/zfs-tests/tests/functional/cli_root/zpool/zpool_002_pos \ mode=0555 file path=opt/zfs-tests/tests/functional/cli_root/zpool/zpool_003_pos \ mode=0555 +file path=opt/zfs-tests/tests/functional/cli_root/zpool_add/add-o_ashift \ + mode=0555 file \ path=opt/zfs-tests/tests/functional/cli_root/zpool_add/add_nested_replacing_spare \ mode=0555 +file path=opt/zfs-tests/tests/functional/cli_root/zpool_add/add_prop_ashift \ + mode=0555 file path=opt/zfs-tests/tests/functional/cli_root/zpool_add/cleanup mode=0555 file path=opt/zfs-tests/tests/functional/cli_root/zpool_add/setup mode=0555 file path=opt/zfs-tests/tests/functional/cli_root/zpool_add/zpool_add.cfg \ @@ -1479,6 +1483,8 @@ file path=opt/zfs-tests/tests/functional/cli_root/zpool_add/zpool_add_009_neg \ mode=0555 file path=opt/zfs-tests/tests/functional/cli_root/zpool_add/zpool_add_010_pos \ mode=0555 +file path=opt/zfs-tests/tests/functional/cli_root/zpool_attach/attach-o_ashift \ + mode=0555 file path=opt/zfs-tests/tests/functional/cli_root/zpool_attach/cleanup \ mode=0555 file path=opt/zfs-tests/tests/functional/cli_root/zpool_attach/setup mode=0555 @@ -1504,6 +1510,8 @@ file \ mode=0555 file path=opt/zfs-tests/tests/functional/cli_root/zpool_create/cleanup \ mode=0555 +file path=opt/zfs-tests/tests/functional/cli_root/zpool_create/create-o_ashift \ + mode=0555 file path=opt/zfs-tests/tests/functional/cli_root/zpool_create/setup mode=0555 file \ path=opt/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create.cfg \ @@ -1909,6 +1917,12 @@ file \ mode=0555 file path=opt/zfs-tests/tests/functional/cli_root/zpool_replace/cleanup \ mode=0555 +file \ + path=opt/zfs-tests/tests/functional/cli_root/zpool_replace/replace-o_ashift \ + mode=0555 +file \ + path=opt/zfs-tests/tests/functional/cli_root/zpool_replace/replace_prop_ashift \ + mode=0555 file path=opt/zfs-tests/tests/functional/cli_root/zpool_replace/setup \ mode=0555 file \ @@ -1965,6 +1979,8 @@ file path=opt/zfs-tests/tests/functional/cli_root/zpool_set/zpool_set_002_neg \ mode=0555 file path=opt/zfs-tests/tests/functional/cli_root/zpool_set/zpool_set_003_neg \ mode=0555 +file path=opt/zfs-tests/tests/functional/cli_root/zpool_set/zpool_set_ashift \ + mode=0555 file path=opt/zfs-tests/tests/functional/cli_root/zpool_status/cleanup \ mode=0555 file path=opt/zfs-tests/tests/functional/cli_root/zpool_status/setup mode=0555 diff --git a/usr/src/psm/promif/ieee1275/sun4/prom_vercheck.c b/usr/src/psm/promif/ieee1275/sun4/prom_vercheck.c deleted file mode 100644 index 852f2a6e60..0000000000 --- a/usr/src/psm/promif/ieee1275/sun4/prom_vercheck.c +++ /dev/null @@ -1,362 +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 2010 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. - */ - -#include <sys/promif.h> -#include <sys/promimpl.h> - -#ifdef DPRINTF -#define dprintf prom_printf -#endif - -/* - * Check if the prom is 64-bit ready. - */ - -/* - * Table listing the minimum prom versions supported by this kernel. - * The model value is expected to match the model in the flashprom node. - */ -static struct obp_rev_table { - char *model; - char *version; -} obp_min_revs[] = { - {"SUNW,525-1414", "OBP 3.11.2 1997/12/05 10:25"}, /* pulsar */ - {"SUNW,525-1672", "OBP 3.7.107 1998/02/19 17:54"}, /* tazmo */ - {"SUNW,525-1431", "OBP 3.2.16 1998/06/08 16:58"}, /* sunfire */ - { NULL, NULL} -}; - -#define NMINS 60 -#define NHOURS 24 -#define NDAYS 31 -#define NMONTHS 12 - -#define YEAR(y) ((y-1) * (NMONTHS * NDAYS * NHOURS * NMINS)) -#define MONTH(m) ((m-1) * (NDAYS * NHOURS * NMINS)) -#define DAY(d) ((d-1) * (NHOURS * NMINS)) -#define HOUR(h) ((h) * (NMINS)) -#define MINUTE(m) (m) - -static int -strtoi(char *str, char **pos) -{ - int c; - int val = 0; - - for (c = *str++; c >= '0' && c <= '9'; c = *str++) { - val *= 10; - val += c - '0'; - } - if (pos) - *pos = str; - return (val); -} - -/* - * obp_timestamp: based on the OBP flashprom version string of the - * format "OBP x.y.z YYYY/MM/DD HH:MM" calculate a timestamp based - * on the year, month, day, hour and minute by turning that into - * a number of minutes. - */ -static int -obp_timestamp(char *v) -{ - char *c; - int maj, year, month, day, hour, min; - - if (v[0] != 'O' || v[1] != 'B' || v[2] != 'P') - return (-1); - - c = v + 3; - - /* Find first non-space character after OBP */ - while (*c != '\0' && (*c == ' ' || *c == '\t')) - c++; - if (prom_strlen(c) < 5) /* need at least "x.y.z" */ - return (-1); - - maj = strtoi(c, &c); - if (maj < 3) - return (-1); - -#if 0 /* XXX - not used */ - dot = dotdot = 0; - if (*c == '.') { - dot = strtoi(c + 1, &c); - - /* optional? dot-dot release */ - if (*c == '.') - dotdot = strtoi(c + 1, &c); - } -#endif - - /* Find space at the end of version number */ - while (*c != '\0' && *c != ' ') - c++; - if (prom_strlen(c) < 11) /* need at least " xxxx/xx/xx" */ - return (-1); - - /* Point to first character of date */ - c++; - - /* Validate date format */ - if (c[4] != '/' || c[7] != '/') - return (-1); - - year = strtoi(c, NULL); - month = strtoi(c + 5, NULL); - day = strtoi(c + 8, NULL); - - if (year < 1995 || month == 0 || day == 0) - return (-1); - - /* - * Find space at the end of date number - */ - c += 10; - while (*c != '\0' && *c != ' ') - c++; - if (prom_strlen(c) < 6) /* need at least " xx:xx" */ - return (-1); - - /* Point to first character of time */ - c++; - - if (c[2] != ':') - return (-1); - - hour = strtoi(c, NULL); - min = strtoi(c + 3, NULL); - - return (YEAR(year) + MONTH(month) + - DAY(day) + HOUR(hour) + MINUTE(min)); -} - -/* - * Check the prom against the obp_min_revs table and complain if - * the system has an older prom installed. The actual major/minor/ - * dotdot numbers are not checked, only the date/time stamp. - */ - -static struct obp_rev_table *flashprom_ortp; -static pnode_t flashprom_node; -static int flashprom_checked; -static int flashprom_return_code; - -int -check_timestamp(char *model, int tstamp) -{ - int min_tstamp; - struct obp_rev_table *ortp; - - for (ortp = obp_min_revs; ortp->model != NULL; ortp++) { - if (prom_strcmp(model, ortp->model) == 0) { - min_tstamp = obp_timestamp(ortp->version); - if (min_tstamp == -1) { -#ifdef DEBUG - prom_printf("prom_version_check: " - "invalid OBP version string in table " - " (entry %d)", (int)(ortp - obp_min_revs)); -#endif - continue; - } - if (tstamp < min_tstamp) { -#ifdef DPRINTF - dprintf("prom_version_check: " - "Down-rev OBP detected. " - "Please update to at least:\n\t%s\n\n", - ortp->version); -#endif - flashprom_ortp = ortp; - return (1); - } - } - } /* for each obp_rev_table entry */ - - return (0); -} - -static pnode_t -visit(pnode_t node) -{ - int tstamp, plen, i; - char vers[512], model[64]; - static pnode_t openprom_node; - static char version[] = "version"; - static char model_name[] = "model"; - static char flashprom[] = "flashprom"; - - /* - * if name isn't 'flashprom', continue. - */ - if (prom_getproplen(node, OBP_NAME) != sizeof (flashprom)) - return ((pnode_t)0); - (void) prom_getprop(node, OBP_NAME, model); - if (prom_strncmp(model, flashprom, sizeof (flashprom)) != 0) - return ((pnode_t)0); - - plen = prom_getproplen(node, version); - if (plen <= 0 || plen > sizeof (vers)) - return ((pnode_t)0); - (void) prom_getprop(node, version, vers); - vers[plen] = '\0'; - - /* Make sure it's an OBP flashprom */ - if (vers[0] != 'O' && vers[1] != 'B' && vers[2] != 'P') - return ((pnode_t)0); - - plen = prom_getproplen(node, model_name); - if (plen <= 0 || plen > sizeof (model)) - return ((pnode_t)0); - (void) prom_getprop(node, model_name, model); - model[plen] = '\0'; - - tstamp = obp_timestamp(vers); - if (tstamp == -1) { - prom_printf("prom_version_check: node contains " - "improperly formatted version property,\n" - "\tnot checking prom version"); - return ((pnode_t)0); - } - - i = check_timestamp(model, tstamp); - - if (i == 0) - return ((pnode_t)0); - - /* - * We know that "node"'s flashprom image contains downrev firmware, - * however, a multi-board server might be running correct firmware. - * Check for that case by looking at the "/openprom" node, - * which always contains the running version. (We needed the - * "model" value to be able to do this, so we can use it as - * an index value into the table.) - * - * If it turns out we're running 'current' firmware, - * but detect down-rev firmware, use a different return code. - */ - - flashprom_return_code = PROM_VER64_UPGRADE; - - openprom_node = prom_finddevice("/openprom"); - if (openprom_node == OBP_BADNODE) - return (node); - - plen = prom_getproplen(node, version); - if (plen <= 0 || plen > sizeof (vers)) - return (node); - (void) prom_getprop(node, version, vers); - vers[plen] = '\0'; - - if (vers[0] != 'O' && vers[1] != 'B' && vers[2] != 'P') { - prom_printf("prom_version_check: " - "unknown <version> string in </openprom>\n"); - return (node); - } - - tstamp = obp_timestamp(vers); - if (tstamp == -1) { - prom_printf("prom_version_check: " - "</openprom> node <version> property: bad tstamp\n"); - return (node); - } - - i = check_timestamp(model, tstamp); - /* - * If that returned zero, then the running version is - * adequate ... so we can 'suggest' instead of 'require'. - */ - if (i == 0) - flashprom_return_code = PROM_VER64_SUGGEST; - - return (node); -} - -/* - * visit each node in the device tree, until we get a non-null answer - */ -static pnode_t -walk(pnode_t node) -{ - pnode_t id; - - if (visit(node)) - return (node); - - for (node = prom_childnode(node); node; node = prom_nextnode(node)) - if ((id = walk(node)) != (pnode_t)0) - return (id); - - return ((pnode_t)0); -} - -/* - * Check if the prom is 64-bit ready. - * - * If it's ready (or the test doesn't apply), return PROM_VER64_OK. - * If downrev firmware is running, return PROM_VER64_UPGRADE. - * If downrev firmware is detected (but not running), return PROM_VER64_SUGGEST. - * - * For PROM_VER64_UPGRADE and PROM_VER64_SUGGEST return code values: - * Return the nodeid of the flashprom node in *nodeid. - * and a printable message in *buf, buflen. - */ -int -prom_version_check(char *buf, size_t buflen, pnode_t *nodeid) -{ - char *p; - pnode_t node = flashprom_node; - size_t i; - - /* - * If we already checked, we already know the answer. - */ - if (flashprom_checked == 0) { - flashprom_node = node = walk(prom_rootnode()); - flashprom_checked = 1; - } - - if (nodeid) - *nodeid = node; - - if (node == (pnode_t)0) { - if (buf && buflen) - *buf = '\0'; - return (PROM_VER64_OK); - } - - /* bzero the callers buffer */ - for (i = buflen, p = buf; i != 0; --i, ++p) - *p = '\0'; - - /* - * Do a bounded copy of the output string into the callers buffer - */ - if (buflen <= 1) - return (flashprom_return_code); - - (void) prom_strncpy(buf, flashprom_ortp->version, buflen - 1); - return (flashprom_return_code); -} diff --git a/usr/src/psm/promif/ieee1275/sun4u/Makefile.files b/usr/src/psm/promif/ieee1275/sun4u/Makefile.files index 5fa8bbe84e..ea10f14d47 100644 --- a/usr/src/psm/promif/ieee1275/sun4u/Makefile.files +++ b/usr/src/psm/promif/ieee1275/sun4u/Makefile.files @@ -55,6 +55,5 @@ CORE_OBJS += \ prom_sparc.o \ prom_sunfire.o \ prom_tlb.o \ - prom_vercheck.o \ prom_vername.o \ prom_opl.o diff --git a/usr/src/psm/promif/ieee1275/sun4v/Makefile.files b/usr/src/psm/promif/ieee1275/sun4v/Makefile.files index 0cb087efa2..684d7c5f19 100644 --- a/usr/src/psm/promif/ieee1275/sun4v/Makefile.files +++ b/usr/src/psm/promif/ieee1275/sun4v/Makefile.files @@ -21,12 +21,11 @@ # # Copyright 2007 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. -# -#pragma ident "%Z%%M% %I% %E% SMI" +# Copyright 2019 Peter Tribble. # # psm/promif/ieee1275/sun4u/Makefile.files # -# This Makefile defines all the promif file modules for the +# This Makefile defines all the promif file modules for the # directory psm/promif/ieee1275/sun4u. # @@ -55,5 +54,4 @@ CORE_OBJS += \ prom_sparc.o \ prom_sun4v_api_version.o \ prom_sun4v_soft_state_supported.o \ - prom_vercheck.o \ prom_vername.o diff --git a/usr/src/psm/stand/boot/sparc/common/boot_plat.c b/usr/src/psm/stand/boot/sparc/common/boot_plat.c index 8129b029c2..a06c734b4e 100644 --- a/usr/src/psm/stand/boot/sparc/common/boot_plat.c +++ b/usr/src/psm/stand/boot/sparc/common/boot_plat.c @@ -21,6 +21,7 @@ /* * Copyright 2010 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. + * Copyright 2019 Peter Tribbble. */ #include <sys/param.h> @@ -453,12 +454,9 @@ redirect_boot_path(char *bpath, char *redirect) prom_panic("redirect_boot_path: mangled boot path!"); } -#define PROM_VERS_MAX_LEN 64 - void system_check(void) { - char buf[PROM_VERS_MAX_LEN]; pnode_t n; char arch[128]; size_t len; @@ -483,12 +481,6 @@ system_check(void) dprintf("device_type: no such property, len=%d\n", (int)len); } - if (!is_sun4v && cpu_is_ultrasparc_1()) { - printf("UltraSPARC I processors are not supported by this " - "release of Solaris.\n"); - prom_exit_to_mon(); - } - /* * Set up defaults per platform */ @@ -502,13 +494,6 @@ system_check(void) dprintf("default_name: %s\n", default_name); dprintf("default_path: %s\n", default_path); dprintf("vac: %d\n", vac); - - if (prom_version_check(buf, PROM_VERS_MAX_LEN, NULL) != PROM_VER64_OK) { - printf("The firmware on this system does not support the 64-bit" - " OS.\n\tPlease upgrade to at least the following version:" - "\n\n\t%s\n", buf); - prom_exit_to_mon(); - } } /* diff --git a/usr/src/psm/stand/boot/sparc/common/boot_plat.h b/usr/src/psm/stand/boot/sparc/common/boot_plat.h index 68d9dd9791..a283696259 100644 --- a/usr/src/psm/stand/boot/sparc/common/boot_plat.h +++ b/usr/src/psm/stand/boot/sparc/common/boot_plat.h @@ -21,6 +21,7 @@ /* * Copyright 2010 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. + * Copyright 2019 Peter Tribble. */ #ifndef _BOOT_PLAT_H @@ -90,7 +91,6 @@ extern int vac; extern void fiximp(void); extern void retain_nvram_page(); -extern int cpu_is_ultrasparc_1(void); /* memlist.c */ diff --git a/usr/src/psm/stand/boot/sparc/common/machdep.c b/usr/src/psm/stand/boot/sparc/common/machdep.c index 3fd6cc36db..9000ffa23c 100644 --- a/usr/src/psm/stand/boot/sparc/common/machdep.c +++ b/usr/src/psm/stand/boot/sparc/common/machdep.c @@ -36,98 +36,6 @@ extern int is_sun4v; /* - * Check if the CPU should default to 64-bit or not. - * UltraSPARC-1's default to 32-bit mode. - * Everything else defaults to 64-bit mode. - */ - -/* - * Manufacturer codes for the CPUs we're interested in - */ -#define TI_JEDEC 0x17 -#define SUNW_JEDEC 0x22 - -/* - * Implementation codes for the CPUs we're interested in - */ -#define IMPL_US_I 0x10 - -static pnode_t -visit(pnode_t node) -{ - int impl, manu; - char name[32]; - static char ultrasparc[] = "SUNW,UltraSPARC"; - static char implementation[] = "implementation#"; - static char manufacturer[] = "manufacturer#"; - - /* - * if name isn't 'SUNW,UltraSPARC', continue. - */ - if (prom_getproplen(node, "name") != sizeof (ultrasparc)) - return ((pnode_t)0); - (void) prom_getprop(node, "name", name); - if (strncmp(name, ultrasparc, sizeof (ultrasparc)) != 0) - return ((pnode_t)0); - - if (prom_getproplen(node, manufacturer) != sizeof (int)) - return ((pnode_t)0); - (void) prom_getprop(node, manufacturer, (caddr_t)&manu); - - if ((manu != SUNW_JEDEC) && (manu != TI_JEDEC)) - return ((pnode_t)0); - - if (prom_getproplen(node, implementation) != sizeof (int)) - return ((pnode_t)0); - (void) prom_getprop(node, implementation, (caddr_t)&impl); - - if (impl != IMPL_US_I) - return ((pnode_t)0); - - return (node); -} - -/* - * visit each node in the device tree, until we get a non-null answer - */ -static pnode_t -walk(pnode_t node) -{ - pnode_t id; - - if (visit(node)) - return (node); - - for (node = prom_childnode(node); node; node = prom_nextnode(node)) - if ((id = walk(node)) != (pnode_t)0) - return (id); - - return ((pnode_t)0); -} - -/* - * Check if the CPU is an UltraSPARC-1 or not. - */ -int -cpu_is_ultrasparc_1(void) -{ - static int cpu_checked; - static int cpu_default; - - /* - * If we already checked or the machine is - * a sun4v, we already know the answer. - */ - if (!is_sun4v || cpu_checked == 0) { - if (walk(prom_rootnode())) - cpu_default = 1; - cpu_checked = 1; - } - - return (cpu_default); -} - -/* * Retain a page or reclaim a previously retained page of physical * memory for use by the prom upgrade. If successful, leave * an indication that a page was retained by creating a boolean diff --git a/usr/src/psm/stand/lib/promif/sparcv9/ieee1275/sun4/Makefile b/usr/src/psm/stand/lib/promif/sparcv9/ieee1275/sun4/Makefile index 436edb7048..e03bd483a2 100644 --- a/usr/src/psm/stand/lib/promif/sparcv9/ieee1275/sun4/Makefile +++ b/usr/src/psm/stand/lib/promif/sparcv9/ieee1275/sun4/Makefile @@ -21,6 +21,7 @@ # # Copyright 2010 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. +# Copyright 2019 Peter Tribble. # # psm/stand/boot/sparcv9/ieee1275/sun4u/Makefile # @@ -56,7 +57,6 @@ PLAT_PSUN4FILES = \ prom_mmu.c \ prom_retain.c \ prom_sparc.c \ - prom_vercheck.c \ prom_vername.c KARCH = sun4u @@ -68,8 +68,8 @@ PLAT_POBJ = $(PLAT_PFILES:%.c=$(OBJSDIR)/%.o) PLAT_PSUN4OBJ = $(PLAT_PSUN4FILES:%.c=$(OBJSDIR)/%.o) OBJS = $(PLAT_POBJ) $(PLAT_PSUN4OBJ) L_OBJS = $(OBJS:%.o=%.ln) -L_SRCS = $(PLAT_PFILES:%=$(PLATDIR)/%) -L_SRCS += $(PLAT_PSUN4FILES:%=$(PLATSUN4DIR)/%) +L_SRCS = $(PLAT_PFILES:%=$(PLATDIR)/%) +L_SRCS += $(PLAT_PSUN4FILES:%=$(PLATSUN4DIR)/%) ARCHOPTS= -Dsun4u ASFLAGS = -P -D__STDC__ -D_BOOT -D_ASM diff --git a/usr/src/psm/stand/lib/promif/sparcv9/ieee1275/sun4u/Makefile b/usr/src/psm/stand/lib/promif/sparcv9/ieee1275/sun4u/Makefile index 71d0c68b97..ab2b3e6d92 100644 --- a/usr/src/psm/stand/lib/promif/sparcv9/ieee1275/sun4u/Makefile +++ b/usr/src/psm/stand/lib/promif/sparcv9/ieee1275/sun4u/Makefile @@ -21,6 +21,7 @@ # # Copyright 2010 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. +# Copyright 2019 Peter Tribble. # # psm/stand/boot/sparcv9/ieee1275/sun4u/Makefile # @@ -41,7 +42,7 @@ SYSDIR = $(TOPDIR)/uts LIBPLAT = libplat.a LINTLIBPLAT = llib-lplat.ln -PLAT_PFILES = \ +PLAT_PFILES = \ prom_serengeti.c \ prom_sunfire.c \ prom_tlb.c @@ -60,7 +61,6 @@ PLAT_PSUN4FILES = \ prom_mmu.c \ prom_retain.c \ prom_sparc.c \ - prom_vercheck.c \ prom_vername.c KARCH = sun4u @@ -72,8 +72,8 @@ PLAT_POBJ = $(PLAT_PFILES:%.c=$(OBJSDIR)/%.o) PLAT_PSUN4OBJ = $(PLAT_PSUN4FILES:%.c=$(OBJSDIR)/%.o) OBJS = $(PLAT_POBJ) $(PLAT_PSUN4OBJ) L_OBJS = $(OBJS:%.o=%.ln) -L_SRCS = $(PLAT_PFILES:%=$(PLATDIR)/%) -L_SRCS += $(PLAT_PSUN4FILES:%=$(PLATSUN4DIR)/%) +L_SRCS = $(PLAT_PFILES:%=$(PLATDIR)/%) +L_SRCS += $(PLAT_PSUN4FILES:%=$(PLATSUN4DIR)/%) ARCHOPTS= -Dsun4u ASFLAGS = -P -D__STDC__ -D_BOOT -D_ASM diff --git a/usr/src/psm/stand/lib/promif/sparcv9/ieee1275/sun4v/Makefile b/usr/src/psm/stand/lib/promif/sparcv9/ieee1275/sun4v/Makefile index ac6f64326a..f9c192f9e4 100644 --- a/usr/src/psm/stand/lib/promif/sparcv9/ieee1275/sun4v/Makefile +++ b/usr/src/psm/stand/lib/promif/sparcv9/ieee1275/sun4v/Makefile @@ -21,6 +21,7 @@ # # Copyright 2010 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. +# Copyright 2019 Peter tribble. # # psm/stand/boot/sparcv9/ieee1275/sun4v/Makefile # @@ -57,8 +58,7 @@ PLAT_PSUN4FILES = \ prom_mmu.c \ prom_retain.c \ prom_sparc.c \ - prom_vername.c \ - prom_vercheck.c + prom_vername.c KARCH = sun4v MMU = sfmmu @@ -69,8 +69,8 @@ PLAT_POBJ = $(PLAT_PFILES:%.c=$(OBJSDIR)/%.o) PLAT_PSUN4OBJ = $(PLAT_PSUN4FILES:%.c=$(OBJSDIR)/%.o) OBJS = $(PLAT_POBJ) $(PLAT_PSUN4OBJ) L_OBJS = $(OBJS:%.o=%.ln) -L_SRCS = $(PLAT_PFILES:%=$(PLATDIR)/%) -L_SRCS += $(PLAT_PSUN4FILES:%=$(PLATSUN4DIR)/%) +L_SRCS = $(PLAT_PFILES:%=$(PLATDIR)/%) +L_SRCS += $(PLAT_PSUN4FILES:%=$(PLATSUN4DIR)/%) ARCHOPTS= -Dsun4v ASFLAGS = -P -D__STDC__ -D_BOOT -D_ASM diff --git a/usr/src/test/zfs-tests/include/libtest.shlib b/usr/src/test/zfs-tests/include/libtest.shlib index fbdcc85d1c..1c632d3464 100644 --- a/usr/src/test/zfs-tests/include/libtest.shlib +++ b/usr/src/test/zfs-tests/include/libtest.shlib @@ -1478,6 +1478,29 @@ function snapshot_mountpoint } # +# Given a device and 'ashift' value verify it's correctly set on every label +# +function verify_ashift # device ashift +{ + typeset device="$1" + typeset ashift="$2" + + zdb -e -lll $device | nawk -v ashift=$ashift '/ashift: / { + if (ashift != $2) + exit 1; + else + count++; + } END { + if (count != 4) + exit 1; + else + exit 0; + }' + + return $? +} + +# # Given a pool and file system, this function will verify the file system # using the zdb internal tool. Note that the pool is exported and imported # to ensure it has consistent state. @@ -2710,6 +2733,21 @@ function mdb_get_uint32 } # +# Wait for every device replace operation to complete +# +# $1 pool name +# +function wait_replacing #pool +{ + typeset pool=${1:-$TESTPOOL} + while true; do + [[ "" == "$(zpool status $pool | + awk '/replacing-[0-9]+/ {print $1}')" ]] && break + log_must sleep 1 + done +} + +# # Set global uint32_t variable to a decimal value using mdb. # function mdb_set_uint32 diff --git a/usr/src/test/zfs-tests/runfiles/delphix.run b/usr/src/test/zfs-tests/runfiles/delphix.run index 8eb3862220..0ae619dccb 100644 --- a/usr/src/test/zfs-tests/runfiles/delphix.run +++ b/usr/src/test/zfs-tests/runfiles/delphix.run @@ -258,10 +258,10 @@ tests = ['zpool_add_001_pos', 'zpool_add_002_pos', 'zpool_add_003_pos', 'zpool_add_004_pos', 'zpool_add_005_pos', 'zpool_add_006_pos', 'zpool_add_007_neg', 'zpool_add_008_neg', 'zpool_add_009_neg', 'zpool_add_010_pos', - 'add_nested_replacing_spare'] + 'add_nested_replacing_spare', 'add-o_ashift', 'add_prop_ashift'] [/opt/zfs-tests/tests/functional/cli_root/zpool_attach] -tests = ['zpool_attach_001_neg'] +tests = ['zpool_attach_001_neg', 'attach-o_ashift'] [/opt/zfs-tests/tests/functional/cli_root/zpool_clear] tests = ['zpool_clear_001_pos', 'zpool_clear_002_neg', 'zpool_clear_003_neg', @@ -280,7 +280,7 @@ tests = ['zpool_create_001_pos', 'zpool_create_002_pos', 'zpool_create_encrypted', 'zpool_create_crypt_combos', 'zpool_create_features_001_pos', 'zpool_create_features_002_pos', 'zpool_create_features_003_pos', 'zpool_create_features_004_neg', - 'zpool_create_tempname'] + 'zpool_create_tempname', 'create-o_ashift'] [/opt/zfs-tests/tests/functional/cli_root/zpool_destroy] tests = ['zpool_destroy_001_pos', 'zpool_destroy_002_pos', @@ -358,7 +358,7 @@ tests = ['zpool_remove_001_neg', 'zpool_remove_002_pos', 'zpool_remove_003_pos'] [/opt/zfs-tests/tests/functional/cli_root/zpool_replace] -tests = ['zpool_replace_001_neg'] +tests = ['zpool_replace_001_neg', 'replace-o_ashift', 'replace_prop_ashift'] [/opt/zfs-tests/tests/functional/cli_root/zpool_resilver] tests = ['zpool_resilver_bad_args', 'zpool_resilver_restart'] @@ -371,7 +371,8 @@ tests = ['zpool_scrub_001_neg', 'zpool_scrub_002_pos', 'zpool_scrub_003_pos', 'zpool_scrub_encrypted_unloaded'] [/opt/zfs-tests/tests/functional/cli_root/zpool_set] -tests = ['zpool_set_001_pos', 'zpool_set_002_neg', 'zpool_set_003_neg'] +tests = ['zpool_set_001_pos', 'zpool_set_002_neg', 'zpool_set_003_neg', + 'zpool_set_ashift'] pre = post = diff --git a/usr/src/test/zfs-tests/runfiles/omnios.run b/usr/src/test/zfs-tests/runfiles/omnios.run index e8120a415f..eb801e366c 100644 --- a/usr/src/test/zfs-tests/runfiles/omnios.run +++ b/usr/src/test/zfs-tests/runfiles/omnios.run @@ -259,10 +259,10 @@ tests = ['zpool_add_001_pos', 'zpool_add_002_pos', 'zpool_add_003_pos', 'zpool_add_004_pos', 'zpool_add_005_pos', 'zpool_add_006_pos', 'zpool_add_007_neg', 'zpool_add_008_neg', 'zpool_add_009_neg', 'zpool_add_010_pos', - 'add_nested_replacing_spare'] + 'add_nested_replacing_spare', 'add-o_ashift', 'add_prop_ashift'] [/opt/zfs-tests/tests/functional/cli_root/zpool_attach] -tests = ['zpool_attach_001_neg'] +tests = ['zpool_attach_001_neg', 'attach-o_ashift'] [/opt/zfs-tests/tests/functional/cli_root/zpool_clear] tests = ['zpool_clear_001_pos', 'zpool_clear_002_neg', 'zpool_clear_003_neg', @@ -281,7 +281,7 @@ tests = ['zpool_create_001_pos', 'zpool_create_002_pos', 'zpool_create_encrypted', 'zpool_create_crypt_combos', 'zpool_create_features_001_pos', 'zpool_create_features_002_pos', 'zpool_create_features_003_pos', 'zpool_create_features_004_neg', - 'zpool_create_tempname'] + 'zpool_create_tempname', 'create-o_ashift'] [/opt/zfs-tests/tests/functional/cli_root/zpool_destroy] tests = ['zpool_destroy_001_pos', 'zpool_destroy_002_pos', @@ -359,7 +359,7 @@ tests = ['zpool_remove_001_neg', 'zpool_remove_002_pos', 'zpool_remove_003_pos'] [/opt/zfs-tests/tests/functional/cli_root/zpool_replace] -tests = ['zpool_replace_001_neg'] +tests = ['zpool_replace_001_neg', 'replace-o_ashift', 'replace_prop_ashift'] [/opt/zfs-tests/tests/functional/cli_root/zpool_resilver] tests = ['zpool_resilver_bad_args', 'zpool_resilver_restart'] @@ -372,7 +372,8 @@ tests = ['zpool_scrub_001_neg', 'zpool_scrub_002_pos', 'zpool_scrub_003_pos', 'zpool_scrub_encrypted_unloaded'] [/opt/zfs-tests/tests/functional/cli_root/zpool_set] -tests = ['zpool_set_001_pos', 'zpool_set_002_neg', 'zpool_set_003_neg'] +tests = ['zpool_set_001_pos', 'zpool_set_002_neg', 'zpool_set_003_neg', + 'zpool_set_ashift'] pre = post = diff --git a/usr/src/test/zfs-tests/runfiles/openindiana.run b/usr/src/test/zfs-tests/runfiles/openindiana.run index a4c5917abe..7c3a8d249e 100644 --- a/usr/src/test/zfs-tests/runfiles/openindiana.run +++ b/usr/src/test/zfs-tests/runfiles/openindiana.run @@ -259,10 +259,10 @@ tests = ['zpool_add_001_pos', 'zpool_add_002_pos', 'zpool_add_003_pos', 'zpool_add_004_pos', 'zpool_add_005_pos', 'zpool_add_006_pos', 'zpool_add_007_neg', 'zpool_add_008_neg', 'zpool_add_009_neg', 'zpool_add_010_pos', - 'add_nested_replacing_spare'] + 'add_nested_replacing_spare', 'add-o_ashift', 'add_prop_ashift'] [/opt/zfs-tests/tests/functional/cli_root/zpool_attach] -tests = ['zpool_attach_001_neg'] +tests = ['zpool_attach_001_neg', 'attach-o_ashift'] [/opt/zfs-tests/tests/functional/cli_root/zpool_clear] tests = ['zpool_clear_001_pos', 'zpool_clear_002_neg', 'zpool_clear_003_neg', @@ -281,7 +281,7 @@ tests = ['zpool_create_001_pos', 'zpool_create_002_pos', 'zpool_create_encrypted', 'zpool_create_crypt_combos', 'zpool_create_features_001_pos', 'zpool_create_features_002_pos', 'zpool_create_features_003_pos', 'zpool_create_features_004_neg', - 'zpool_create_tempname'] + 'zpool_create_tempname', 'create-o_ashift'] [/opt/zfs-tests/tests/functional/cli_root/zpool_destroy] tests = ['zpool_destroy_001_pos', 'zpool_destroy_002_pos', @@ -359,7 +359,7 @@ tests = ['zpool_remove_001_neg', 'zpool_remove_002_pos', 'zpool_remove_003_pos'] [/opt/zfs-tests/tests/functional/cli_root/zpool_replace] -tests = ['zpool_replace_001_neg'] +tests = ['zpool_replace_001_neg', 'replace-o_ashift', 'replace_prop_ashift'] [/opt/zfs-tests/tests/functional/cli_root/zpool_resilver] tests = ['zpool_resilver_bad_args', 'zpool_resilver_restart'] @@ -372,7 +372,8 @@ tests = ['zpool_scrub_001_neg', 'zpool_scrub_002_pos', 'zpool_scrub_003_pos', 'zpool_scrub_encrypted_unloaded'] [/opt/zfs-tests/tests/functional/cli_root/zpool_set] -tests = ['zpool_set_001_pos', 'zpool_set_002_neg', 'zpool_set_003_neg'] +tests = ['zpool_set_001_pos', 'zpool_set_002_neg', 'zpool_set_003_neg', + 'zpool_set_ashift'] pre = post = diff --git a/usr/src/test/zfs-tests/runfiles/smartos.run b/usr/src/test/zfs-tests/runfiles/smartos.run index 872bb8f74c..34859b0fda 100644 --- a/usr/src/test/zfs-tests/runfiles/smartos.run +++ b/usr/src/test/zfs-tests/runfiles/smartos.run @@ -32,7 +32,7 @@ tests = ['alloc_class_001_pos', 'alloc_class_002_neg', 'alloc_class_003_pos', tags = ['functional', 'alloc_class'] [/opt/zfs-tests/tests/functional/cli_root/zpool_add] -tests = ['zpool_add_010_pos'] +tests = ['zpool_add_010_pos', 'add-o_ashift', 'add_prop_ashift'] [/opt/zfs-tests/tests/functional/atime] tests = ['atime_001_pos', 'atime_002_neg'] @@ -219,7 +219,7 @@ tests = ['zpool_add_001_pos', 'zpool_add_002_pos', 'zpool_add_003_pos', 'add_nested_replacing_spare'] [/opt/zfs-tests/tests/functional/cli_root/zpool_attach] -tests = ['zpool_attach_001_neg'] +tests = ['zpool_attach_001_neg', 'attach-o_ashift'] [/opt/zfs-tests/tests/functional/cli_root/zpool_clear] tests = ['zpool_clear_001_pos', 'zpool_clear_002_neg', 'zpool_clear_003_neg', @@ -237,7 +237,7 @@ tests = ['zpool_create_001_pos', 'zpool_create_002_pos', 'zpool_create_encrypted', 'zpool_create_crypt_combos', 'zpool_create_features_001_pos', 'zpool_create_features_002_pos', 'zpool_create_features_003_pos', 'zpool_create_features_004_neg', - 'zpool_create_tempname'] + 'zpool_create_tempname', 'create-o_ashift'] [/opt/zfs-tests/tests/functional/cli_root/zpool_destroy] tests = ['zpool_destroy_001_pos', 'zpool_destroy_002_pos', @@ -308,7 +308,8 @@ tests = ['zpool_remove_001_neg', 'zpool_remove_002_pos', 'zpool_remove_003_pos'] [/opt/zfs-tests/tests/functional/cli_root/zpool_replace] -tests = ['zpool_replace_001_neg', 'zpool_replace_002_neg'] +tests = ['zpool_replace_001_neg', 'zpool_replace_002_neg', 'replace-o_ashift', + 'replace_prop_ashift'] [/opt/zfs-tests/tests/functional/cli_root/zpool_resilver] tests = ['zpool_resilver_bad_args', 'zpool_resilver_restart'] @@ -319,7 +320,8 @@ tests = ['zpool_scrub_001_neg', 'zpool_scrub_002_pos', 'zpool_scrub_003_pos', 'zpool_scrub_encrypted_unloaded'] [/opt/zfs-tests/tests/functional/cli_root/zpool_set] -tests = ['zpool_set_001_pos', 'zpool_set_002_neg', 'zpool_set_003_neg'] +tests = ['zpool_set_001_pos', 'zpool_set_002_neg', 'zpool_set_003_neg', + 'zpool_set_ashift'] pre = post = diff --git a/usr/src/test/zfs-tests/tests/functional/cli_root/zpool_add/add-o_ashift.ksh b/usr/src/test/zfs-tests/tests/functional/cli_root/zpool_add/add-o_ashift.ksh new file mode 100644 index 0000000000..8556f298e7 --- /dev/null +++ b/usr/src/test/zfs-tests/tests/functional/cli_root/zpool_add/add-o_ashift.ksh @@ -0,0 +1,85 @@ +#!/bin/ksh -p +# +# 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 2017, loli10K. All rights reserved. +# + +. $STF_SUITE/include/libtest.shlib +. $STF_SUITE/tests/functional/cli_root/zpool_create/zpool_create.shlib + +# +# DESCRIPTION: +# 'zpool add -o ashift=<n> ...' should work with different ashift +# values. +# +# STRATEGY: +# 1. Create a pool with default values. +# 2. Verify 'zpool add -o ashift=<n>' works with allowed values (9-16). +# 3. Verify 'zpool add -o ashift=<n>' doesn't accept other invalid values. +# + +verify_runnable "global" + +function cleanup +{ + poolexists $TESTPOOL && destroy_pool $TESTPOOL + log_must rm -f $disk1 $disk2 +} + +log_assert "zpool add -o ashift=<n>' works with different ashift values" +log_onexit cleanup + +disk1=$TEST_BASE_DIR/$FILEDISK0 +disk2=$TEST_BASE_DIR/$FILEDISK1 +log_must mkfile $SIZE $disk1 +log_must mkfile $SIZE $disk2 + +typeset ashifts=("9" "10" "11" "12" "13" "14" "15" "16") +for ashift in ${ashifts[@]} +do + log_must zpool create $TESTPOOL $disk1 + log_must zpool add -o ashift=$ashift $TESTPOOL $disk2 + verify_ashift $disk2 $ashift + if [[ $? -ne 0 ]] + then + log_fail "Device was added without setting ashift value to "\ + "$ashift" + fi + # clean things for the next run + log_must zpool destroy $TESTPOOL + log_must zpool labelclear $disk1 + log_must zpool labelclear $disk2 +done + +typeset badvals=("off" "on" "1" "8" "17" "1b" "ff" "-") +for badval in ${badvals[@]} +do + log_must zpool create $TESTPOOL $disk1 + log_mustnot zpool add $TESTPOOL -o ashift="$badval" $disk2 + # clean things for the next run + log_must zpool destroy $TESTPOOL + log_must zpool labelclear $disk1 + log_mustnot zpool labelclear $disk2 +done + +log_pass "zpool add -o ashift=<n>' works with different ashift values" diff --git a/usr/src/test/zfs-tests/tests/functional/cli_root/zpool_add/add_prop_ashift.ksh b/usr/src/test/zfs-tests/tests/functional/cli_root/zpool_add/add_prop_ashift.ksh new file mode 100644 index 0000000000..9cc230a795 --- /dev/null +++ b/usr/src/test/zfs-tests/tests/functional/cli_root/zpool_add/add_prop_ashift.ksh @@ -0,0 +1,95 @@ +#!/bin/ksh -p +# +# 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 2017, loli10K. All rights reserved. +# Copyright 2019 Joyent, Inc. +# + +. $STF_SUITE/include/libtest.shlib +. $STF_SUITE/tests/functional/cli_root/zpool_create/zpool_create.shlib + +# +# DESCRIPTION: +# 'zpool add' should use the ashift pool property value as default. +# +# STRATEGY: +# 1. Create a pool with default values. +# 2. Verify 'zpool add' uses the ashift pool property value when adding +# a new device. +# 3. Verify the default ashift value can still be overridden by manually +# specifying '-o ashift=<n>' from the command line. +# + +verify_runnable "global" + +function cleanup +{ + poolexists $TESTPOOL && destroy_pool $TESTPOOL + log_must rm -f $disk1 $disk2 +} + +log_assert "'zpool add' uses the ashift pool property value as default." +log_onexit cleanup + +disk1=$TEST_BASE_DIR/$FILEDISK0 +disk2=$TEST_BASE_DIR/$FILEDISK1 +log_must mkfile $SIZE $disk1 +log_must mkfile $SIZE $disk2 + +typeset ashifts=("9" "10" "11" "12" "13" "14" "15" "16") +for ashift in ${ashifts[@]} +do + log_must zpool create -o ashift=$ashift $TESTPOOL $disk1 + log_must zpool add $TESTPOOL $disk2 + verify_ashift $disk2 $ashift + if [[ $? -ne 0 ]] + then + log_fail "Device was added without setting ashift value to "\ + "$ashift" + fi + # clean things for the next run + log_must zpool destroy $TESTPOOL + log_must zpool labelclear $disk1 + log_must zpool labelclear $disk2 +done + +for ashift in ${ashifts[@]} +do + for cmdval in ${ashifts[@]} + do + log_must zpool create -o ashift=$ashift $TESTPOOL $disk1 + log_must zpool add -o ashift=$cmdval $TESTPOOL $disk2 + verify_ashift $disk2 $cmdval + if [[ $? -ne 0 ]] + then + log_fail "Device was added without setting ashift " \ + "value to $cmdval" + fi + # clean things for the next run + log_must zpool destroy $TESTPOOL + log_must zpool labelclear $disk1 + log_must zpool labelclear $disk2 + done +done + +log_pass "'zpool add' uses the ashift pool property value." diff --git a/usr/src/test/zfs-tests/tests/functional/cli_root/zpool_attach/attach-o_ashift.ksh b/usr/src/test/zfs-tests/tests/functional/cli_root/zpool_attach/attach-o_ashift.ksh new file mode 100644 index 0000000000..58ab57db05 --- /dev/null +++ b/usr/src/test/zfs-tests/tests/functional/cli_root/zpool_attach/attach-o_ashift.ksh @@ -0,0 +1,107 @@ +#!/bin/ksh -p +# +# 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 2017, loli10K. All rights reserved. +# + +. $STF_SUITE/include/libtest.shlib +. $STF_SUITE/tests/functional/cli_root/zpool_create/zpool_create.shlib + +# +# DESCRIPTION: +# 'zpool attach -o ashift=<n> ...' should work with different ashift +# values. +# +# STRATEGY: +# 1. Create various pools with different ashift values. +# 2. Verify 'attach -o ashift=<n>' works only with allowed values. +# + +verify_runnable "global" + +function cleanup +{ + poolexists $TESTPOOL1 && destroy_pool $TESTPOOL1 + log_must rm -f $disk1 + log_must rm -f $disk2 +} + +log_assert "zpool attach -o ashift=<n>' works with different ashift values" +log_onexit cleanup + +disk1=$TEST_BASE_DIR/$FILEDISK0 +disk2=$TEST_BASE_DIR/$FILEDISK1 +log_must mkfile $SIZE $disk1 +log_must mkfile $SIZE $disk2 + +typeset ashifts=("9" "10" "11" "12" "13" "14" "15" "16") +for ashift in ${ashifts[@]} +do + for cmdval in ${ashifts[@]} + do + log_must zpool create -o ashift=$ashift $TESTPOOL1 $disk1 + verify_ashift $disk1 $ashift + if [[ $? -ne 0 ]] + then + log_fail "Pool was created without setting ashift " \ + "value to $ashift" + fi + # ashift_of(attached_disk) <= ashift_of(existing_vdev) + if [[ $cmdval -le $ashift ]] + then + log_must zpool attach -o ashift=$cmdval $TESTPOOL1 \ + $disk1 $disk2 + verify_ashift $disk2 $ashift + if [[ $? -ne 0 ]] + then + log_fail "Device was attached without " \ + "setting ashift value to $ashift" + fi + else + log_mustnot zpool attach -o ashift=$cmdval $TESTPOOL1 \ + $disk1 $disk2 + fi + # clean things for the next run + log_must zpool destroy $TESTPOOL1 + log_must zpool labelclear $disk1 + # depending on if we expect to have failed the 'zpool attach' + if [[ $cmdval -le $ashift ]] + then + log_must zpool labelclear $disk2 + else + log_mustnot zpool labelclear $disk2 + fi + done +done + +typeset badvals=("off" "on" "1" "8" "17" "1b" "ff" "-") +for badval in ${badvals[@]} +do + log_must zpool create $TESTPOOL1 $disk1 + log_mustnot zpool attach $TESTPOOL1 -o ashift=$badval $disk1 $disk2 + log_must zpool destroy $TESTPOOL1 + log_must zpool labelclear $disk1 + log_mustnot zpool labelclear $disk2 +done + +log_pass "zpool attach -o ashift=<n>' works with different ashift values" diff --git a/usr/src/test/zfs-tests/tests/functional/cli_root/zpool_create/create-o_ashift.ksh b/usr/src/test/zfs-tests/tests/functional/cli_root/zpool_create/create-o_ashift.ksh new file mode 100644 index 0000000000..c4375e0eea --- /dev/null +++ b/usr/src/test/zfs-tests/tests/functional/cli_root/zpool_create/create-o_ashift.ksh @@ -0,0 +1,141 @@ +#!/bin/ksh -p +# +# 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 2016, loli10K. All rights reserved. +# Copyright 2019 Joyent, Inc. +# + +. $STF_SUITE/include/libtest.shlib +. $STF_SUITE/tests/functional/cli_root/zpool_create/zpool_create.shlib + +# +# DESCRIPTION: +# 'zpool create -o ashift=<n> ...' should work with different ashift +# values. +# +# STRATEGY: +# 1. Create various pools with different ashift values. +# 2. Verify -o ashift=<n> works only with allowed values (9-16). +# Also verify that the lowest number of uberblocks in a label is 16 and +# smallest uberblock size is 8K even with higher ashift values. +# + +verify_runnable "global" + +function cleanup +{ + poolexists $TESTPOOL && destroy_pool $TESTPOOL + log_must rm -f $disk +} + +# +# FIXME: Ugly hack to force a $1 number of txg syncs. +# This is used on Linux because we can't force it via sync(1) like on Illumos. +# This could eventually (an hopefully) be replaced by a 'zpool sync' command. +# $1 pool name +# $2 number of txg syncs +# +function txg_sync +{ + typeset pool=$1 + typeset count=$2 + typeset -i i=0; + + while [ $i -lt $count ] + do + zfs snapshot $pool@sync$$$i + if [[ $? -ne 0 ]] + then + log_fail "Failed to sync pool $pool (snapshot $i)" + return 1 + fi + ((i = i + 1)) + done + + return 0 +} + +# +# Verify device $1 labels contains $2 valid uberblocks in every label +# $1 device +# $2 uberblocks count +# +function verify_device_uberblocks +{ + typeset device=$1 + typeset ubcount=$2 + + zdb -quuul $device | egrep '^(\s+)?Uberblock' | + egrep -v 'invalid$' | nawk \ + -v ubcount=$ubcount '{ uberblocks[$0]++; } + END { for (i in uberblocks) { + count++; + if (uberblocks[i] != 4) { exit 1; } + } + if (count != ubcount) { exit 1; } }' + + return $? +} + +log_assert "zpool create -o ashift=<n>' works with different ashift values" +log_onexit cleanup + +disk=$TEST_BASE_DIR/$FILEDISK0 +log_must mkfile $SIZE $disk + +typeset ashifts=("9" "10" "11" "12" "13" "14" "15" "16") +# since Illumos 4958 the largest uberblock is 8K so we have at least of 16/label +typeset ubcount=("128" "128" "64" "32" "16" "16" "16" "16") +typeset -i i=0; +while [ $i -lt "${#ashifts[@]}" ] +do + typeset ashift=${ashifts[$i]} + log_must zpool create -o ashift=$ashift $TESTPOOL $disk + typeset pprop=$(get_pool_prop ashift $TESTPOOL) + verify_ashift $disk $ashift + if [[ $? -ne 0 || "$pprop" != "$ashift" ]] + then + log_fail "Pool was created without setting ashift value to "\ + "$ashift (current = $pprop)" + fi + # force 128 txg sync to fill the uberblock ring + log_must eval "txg_sync $TESTPOOL 128" + verify_device_uberblocks $disk ${ubcount[$i]} + if [[ $? -ne 0 ]] + then + log_fail "Pool was created with unexpected number of uberblocks" + fi + # clean things for the next run + log_must zpool destroy $TESTPOOL + log_must zpool labelclear $disk + log_must eval "verify_device_uberblocks $disk 0" + ((i = i + 1)) +done + +typeset badvals=("off" "on" "1" "8" "17" "1b" "ff" "-") +for badval in ${badvals[@]} +do + log_mustnot zpool create -o ashift="$badval" $TESTPOOL $disk +done + +log_pass "zpool create -o ashift=<n>' works with different ashift values" diff --git a/usr/src/test/zfs-tests/tests/functional/cli_root/zpool_get/zpool_get.cfg b/usr/src/test/zfs-tests/tests/functional/cli_root/zpool_get/zpool_get.cfg index 0db15d67a7..2cf046d47f 100644 --- a/usr/src/test/zfs-tests/tests/functional/cli_root/zpool_get/zpool_get.cfg +++ b/usr/src/test/zfs-tests/tests/functional/cli_root/zpool_get/zpool_get.cfg @@ -57,6 +57,7 @@ typeset -a properties=( "bootsize" "checkpoint" "multihost" + "ashift" "feature@async_destroy" "feature@empty_bpobj" "feature@lz4_compress" diff --git a/usr/src/test/zfs-tests/tests/functional/cli_root/zpool_replace/replace-o_ashift.ksh b/usr/src/test/zfs-tests/tests/functional/cli_root/zpool_replace/replace-o_ashift.ksh new file mode 100644 index 0000000000..77f85c6bea --- /dev/null +++ b/usr/src/test/zfs-tests/tests/functional/cli_root/zpool_replace/replace-o_ashift.ksh @@ -0,0 +1,109 @@ +#!/bin/ksh -p +# +# 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 2017, loli10K. All rights reserved. +# + +. $STF_SUITE/include/libtest.shlib +. $STF_SUITE/tests/functional/cli_root/zpool_create/zpool_create.shlib + +# +# DESCRIPTION: +# 'zpool replace -o ashift=<n> ...' should work with different ashift +# values. +# +# STRATEGY: +# 1. Create various pools with different ashift values. +# 2. Verify 'replace -o ashift=<n>' works only with allowed values. +# + +verify_runnable "global" + +function cleanup +{ + poolexists $TESTPOOL1 && destroy_pool $TESTPOOL1 + log_must rm -f $disk1 + log_must rm -f $disk2 +} + +log_assert "zpool replace -o ashift=<n>' works with different ashift values" +log_onexit cleanup + +disk1=$TEST_BASE_DIR/$FILEDISK0 +disk2=$TEST_BASE_DIR/$FILEDISK1 +log_must mkfile $SIZE $disk1 +log_must mkfile $SIZE $disk2 + +typeset ashifts=("9" "10" "11" "12" "13" "14" "15" "16") +for ashift in ${ashifts[@]} +do + for cmdval in ${ashifts[@]} + do + log_must zpool create -o ashift=$ashift $TESTPOOL1 $disk1 + verify_ashift $disk1 $ashift + if [[ $? -ne 0 ]] + then + log_fail "Pool was created without setting ashift " \ + "value to $ashift" + fi + # ashift_of(replacing_disk) <= ashift_of(existing_vdev) + if [[ $cmdval -le $ashift ]] + then + log_must zpool replace -o ashift=$cmdval $TESTPOOL1 \ + $disk1 $disk2 + verify_ashift $disk2 $ashift + if [[ $? -ne 0 ]] + then + log_fail "Device was replaced without " \ + "setting ashift value to $ashift" + fi + wait_replacing $TESTPOOL1 + else + log_mustnot zpool replace -o ashift=$cmdval $TESTPOOL1 \ + $disk1 $disk2 + fi + # clean things for the next run + log_must zpool destroy $TESTPOOL1 + # depending on if we expect to have failed the 'zpool replace' + if [[ $cmdval -le $ashift ]] + then + log_mustnot zpool labelclear $disk1 + log_must zpool labelclear $disk2 + else + log_must zpool labelclear $disk1 + log_mustnot zpool labelclear $disk2 + fi + done +done + +typeset badvals=("off" "on" "1" "8" "17" "1b" "ff" "-") +for badval in ${badvals[@]} +do + log_must zpool create $TESTPOOL1 $disk1 + log_mustnot zpool replace -o ashift=$badval $TESTPOOL1 $disk1 $disk2 + log_must zpool destroy $TESTPOOL1 + log_must zpool labelclear $disk1 + log_mustnot zpool labelclear $disk2 +done + +log_pass "zpool replace -o ashift=<n>' works with different ashift values" diff --git a/usr/src/test/zfs-tests/tests/functional/cli_root/zpool_replace/replace_prop_ashift.ksh b/usr/src/test/zfs-tests/tests/functional/cli_root/zpool_replace/replace_prop_ashift.ksh new file mode 100644 index 0000000000..714f1180f5 --- /dev/null +++ b/usr/src/test/zfs-tests/tests/functional/cli_root/zpool_replace/replace_prop_ashift.ksh @@ -0,0 +1,97 @@ +#!/bin/ksh -p +# +# 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 2017, loli10K. All rights reserved. +# + +. $STF_SUITE/include/libtest.shlib +. $STF_SUITE/tests/functional/cli_root/zpool_create/zpool_create.shlib + +# +# DESCRIPTION: +# 'zpool replace' should use the ashift pool property value as default. +# +# STRATEGY: +# 1. Create a pool with default values. +# 2. Verify 'zpool replace' uses the ashift pool property value when +# replacing an existing device. +# 3. Verify the default ashift value can still be overridden by manually +# specifying '-o ashift=<n>' from the command line. +# + +verify_runnable "global" + +function cleanup +{ + poolexists $TESTPOOL1 && destroy_pool $TESTPOOL1 + log_must rm -f $disk1 $disk2 +} + +log_assert "'zpool replace' uses the ashift pool property value as default." +log_onexit cleanup + +disk1=$TEST_BASE_DIR/$FILEDISK0 +disk2=$TEST_BASE_DIR/$FILEDISK1 +log_must mkfile $SIZE $disk1 +log_must mkfile $SIZE $disk2 + +typeset ashifts=("9" "10" "11" "12" "13" "14" "15" "16") +for ashift in ${ashifts[@]} +do + for pprop in ${ashifts[@]} + do + log_must zpool create -o ashift=$ashift $TESTPOOL1 $disk1 + log_must zpool set ashift=$pprop $TESTPOOL1 + # ashift_of(replacing_disk) <= ashift_of(existing_vdev) + if [[ $pprop -le $ashift ]] + then + log_must zpool replace $TESTPOOL1 $disk1 $disk2 + wait_replacing $TESTPOOL1 + verify_ashift $disk2 $ashift + if [[ $? -ne 0 ]] + then + log_fail "Device was replaced without " \ + "setting ashift value to $ashift" + fi + else + # cannot replace if pool prop ashift > vdev ashift + log_mustnot zpool replace $TESTPOOL1 $disk1 $disk2 + # verify we can override the pool prop value manually + log_must zpool replace -o ashift=$ashift $TESTPOOL1 \ + $disk1 $disk2 + wait_replacing $TESTPOOL1 + verify_ashift $disk2 $ashift + if [[ $? -ne 0 ]] + then + log_fail "Device was replaced without " \ + "setting ashift value to $ashift" + fi + fi + # clean things for the next run + log_must zpool destroy $TESTPOOL1 + log_mustnot zpool labelclear $disk1 + log_must zpool labelclear $disk2 + done +done + +log_pass "'zpool replace' uses the ashift pool property value." diff --git a/usr/src/test/zfs-tests/tests/functional/cli_root/zpool_set/zpool_set_ashift.ksh b/usr/src/test/zfs-tests/tests/functional/cli_root/zpool_set/zpool_set_ashift.ksh new file mode 100644 index 0000000000..4a192698ad --- /dev/null +++ b/usr/src/test/zfs-tests/tests/functional/cli_root/zpool_set/zpool_set_ashift.ksh @@ -0,0 +1,78 @@ +#!/bin/ksh -p +# +# 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 2017, loli10K. All rights reserved. +# + +. $STF_SUITE/include/libtest.shlib +. $STF_SUITE/tests/functional/cli_root/zpool_create/zpool_create.shlib + +# +# DESCRIPTION: +# +# zpool set can modify 'ashift' property +# +# STRATEGY: +# 1. Create a pool +# 2. Verify that we can set 'ashift' only to allowed values on that pool +# + +verify_runnable "global" + +function cleanup +{ + poolexists $TESTPOOL && destroy_pool $TESTPOOL + log_must rm -f $disk +} + +typeset goodvals=("0" "9" "10" "11" "12" "13" "14" "15" "16") +typeset badvals=("off" "on" "1" "8" "17" "1b" "ff" "-") + +log_onexit cleanup + +log_assert "zpool set can modify 'ashift' property" + +disk=$TEST_BASE_DIR/$FILEDISK0 +log_must mkfile $SIZE $disk +log_must zpool create $TESTPOOL $disk + +for ashift in ${goodvals[@]} +do + log_must zpool set ashift=$ashift $TESTPOOL + typeset value=$(get_pool_prop ashift $TESTPOOL) + if [[ "$ashift" != "$value" ]]; then + log_fail "'zpool set' did not update ashift value to $ashift "\ + "(current = $value)" + fi +done + +for ashift in ${badvals[@]} +do + log_mustnot zpool set ashift=$ashift $TESTPOOL + typeset value=$(get_pool_prop ashift $TESTPOOL) + if [[ "$ashift" == "$value" ]]; then + log_fail "'zpool set' incorrectly set ashift value to $value" + fi +done + +log_pass "zpool set can modify 'ashift' property" diff --git a/usr/src/tools/Makefile b/usr/src/tools/Makefile index 68a4c34ff5..60c74fb342 100644 --- a/usr/src/tools/Makefile +++ b/usr/src/tools/Makefile @@ -61,12 +61,19 @@ COMMON_SUBDIRS= \ onbld \ protocmp \ protolist \ - scripts + scripts \ + sgs # # special versions of commands for use only in build # UNSHIPPED_SUBDIRS = \ + $(SGSMSG) \ + $(SGSLIBCONV) \ + $(SGSLIBELF) \ + $(SGSLIBLDDBG) \ + $(SGSLIBLD) \ + $(SGSLD) \ localedef \ man \ mandoc \ @@ -86,6 +93,8 @@ i386_SUBDIRS= \ mbh_patch \ btxld +$(INTEL_BLD)sgs: aw + SUBDIRS= \ $($(MACH)_SUBDIRS) \ $(COMMON_SUBDIRS) \ diff --git a/usr/src/tools/Makefile.tools b/usr/src/tools/Makefile.tools index cd38795b01..867c55b2f4 100644 --- a/usr/src/tools/Makefile.tools +++ b/usr/src/tools/Makefile.tools @@ -55,6 +55,10 @@ LDLIBS= LDFLAGS= $(MAPFILE.NES:%=-M%) $(MAPFILE.NED:%=-M%) \ $(MAPFILE.PGA:%=-M%) +# Unset CW_LINKER so we run the default. We don't set LD here to avoid taking +# the journey through LD_ALTEXEC unnecessarily. +CW_LINKER= + ROOTONBLDPROG= $(PROG:%=$(ROOTONBLDBIN)/%) ROOTONBLDMACHPROG= $(PROG:%=$(ROOTONBLDBINMACH)/%) ROOTONBLDSHFILES= $(SHFILES:%=$(ROOTONBLDBIN)/%) diff --git a/usr/src/tools/chk4ubin/Makefile b/usr/src/tools/chk4ubin/Makefile index a251d49ca7..5da362350e 100644 --- a/usr/src/tools/chk4ubin/Makefile +++ b/usr/src/tools/chk4ubin/Makefile @@ -28,6 +28,7 @@ include ../Makefile.tools PROG = chk4ubin +DYNFLAGS += '-R$$ORIGIN/../../lib/$(MACH)' LDLIBS += -lelf LINTFLAGS += -ux diff --git a/usr/src/tools/ctf/dwarf/Makefile.com b/usr/src/tools/ctf/dwarf/Makefile.com index 67ffd64a62..52aedda3a7 100644 --- a/usr/src/tools/ctf/dwarf/Makefile.com +++ b/usr/src/tools/ctf/dwarf/Makefile.com @@ -68,7 +68,7 @@ OBJECTS=dwarf_abbrev.o \ pro_weaks.o include $(SRC)/lib/Makefile.lib - +include $(SRC)/tools/Makefile.tools FILEMODE = 0755 SRCDIR = $(SRC)/lib/libdwarf/common/ @@ -81,6 +81,7 @@ CERRWARN += -_gcc=-Wno-implicit-function-declaration # libdwarf not clean SMATCH=off +DYNFLAGS += '-R$$ORIGIN/../../lib/$(MACH)' LDLIBS = -lelf -lc .KEEP_STATE: diff --git a/usr/src/tools/cw/cw.1onbld b/usr/src/tools/cw/cw.1onbld index 62800bb727..465c4b590d 100644 --- a/usr/src/tools/cw/cw.1onbld +++ b/usr/src/tools/cw/cw.1onbld @@ -36,6 +36,7 @@ .Op Fl -noecho .Fl -primary Ar compiler .Op Fl -shadow Ar compiler ... +.Op Fl -linker Ar linker .Fl - .Ar compiler args ... .Sh DESCRIPTION @@ -77,6 +78,11 @@ and pre-processing, and whos objects we deliver). .It Fl -shadow Ar compiler Specify a shadow compiler, which builds sources for the sake of checking code quality and compatibility, but has its output discarded. +.It Fl -linker Ar linker +Specify a link-editor to use in place of +.Pa /usr/bin/ld . +.Xr ld 1 +itself arranges for this to be executed by any subprocesses. .It Fl -noecho Do not echo the actual command line of any compilers invoked. .It Fl -versions @@ -210,7 +216,8 @@ exit status. .Sh SEE ALSO .Xr cc 1 , .Xr CC 1 , -.Xr gcc 1 +.Xr gcc 1 , +.Xr ld 1 .Sh BUGS The translations provided for gcc are not always exact and in some cases reflect local policy rather than actual equivalence. diff --git a/usr/src/tools/cw/cw.c b/usr/src/tools/cw/cw.c index 3763e8298e..31ba40cb85 100644 --- a/usr/src/tools/cw/cw.c +++ b/usr/src/tools/cw/cw.c @@ -39,7 +39,7 @@ */ /* If you modify this file, you must increment CW_VERSION */ -#define CW_VERSION "4.0" +#define CW_VERSION "5.0" /* * -# Verbose mode @@ -306,6 +306,7 @@ typedef struct { typedef struct cw_ictx { struct cw_ictx *i_next; cw_compiler_t *i_compiler; + char *i_linker; struct aelist *i_ae; uint32_t i_flags; int i_oldargc; @@ -423,7 +424,7 @@ newae(struct aelist *ael, const char *arg) { struct ae *ae; - if ((ae = calloc(sizeof (*ae), 1)) == NULL) + if ((ae = calloc(1, sizeof (*ae))) == NULL) nomem(); ae->ae_arg = strdup(arg); if (ael->ael_tail == NULL) @@ -437,9 +438,9 @@ newae(struct aelist *ael, const char *arg) static cw_ictx_t * newictx(void) { - cw_ictx_t *ctx = calloc(sizeof (cw_ictx_t), 1); + cw_ictx_t *ctx = calloc(1, sizeof (cw_ictx_t)); if (ctx) - if ((ctx->i_ae = calloc(sizeof (struct aelist), 1)) == NULL) { + if ((ctx->i_ae = calloc(1, sizeof (struct aelist))) == NULL) { free(ctx); return (NULL); } @@ -495,7 +496,7 @@ Xsmode(struct aelist *h) } static void -usage() +usage(void) { extern char *__progname; (void) fprintf(stderr, @@ -1209,14 +1210,6 @@ do_gcc(cw_ictx_t *ctx) /* Just ignore -YS,... for now */ if (strncmp(arg, "S,", 2) == 0) break; - if (strncmp(arg, "l,", 2) == 0) { - char *s = strdup(arg); - s[0] = '-'; - s[1] = 'B'; - newae(ctx->i_ae, s); - free(s); - break; - } if (strncmp(arg, "I,", 2) == 0) { char *s = strdup(arg); s[0] = '-'; @@ -1468,6 +1461,14 @@ prepctx(cw_ictx_t *ctx) (void) fflush(stdout); } + /* + * If LD_ALTEXEC is already set, the expectation would be that that + * link-editor is run, as such we need to leave it the environment + * alone and let that happen. + */ + if ((ctx->i_linker != NULL) && (getenv("LD_ALTEXEC") == NULL)) + setenv("LD_ALTEXEC", ctx->i_linker, 1); + if (!(ctx->i_flags & CW_F_XLATE)) return; @@ -1727,6 +1728,7 @@ main(int argc, char **argv) static struct option longopts[] = { { "compiler", no_argument, NULL, 'c' }, + { "linker", required_argument, NULL, 'l' }, { "noecho", no_argument, NULL, 'n' }, { "primary", required_argument, NULL, 'p' }, { "shadow", required_argument, NULL, 's' }, @@ -1746,6 +1748,10 @@ main(int argc, char **argv) case 'C': Cflg = B_TRUE; break; + case 'l': + if ((main_ctx->i_linker = strdup(optarg)) == NULL) + nomem(); + break; case 'n': nflg = B_TRUE; break; diff --git a/usr/src/tools/findunref/exception_list.open b/usr/src/tools/findunref/exception_list.open index a1c421cceb..6c432c78c1 100644 --- a/usr/src/tools/findunref/exception_list.open +++ b/usr/src/tools/findunref/exception_list.open @@ -143,7 +143,6 @@ # Ignore internal packages, scripts, and tools that are intentionally not # built or used during a nightly. # -./usr/src/cmd/sgs/packages ./usr/src/cmd/sgs/rtld.4.x ./usr/src/prototypes ./usr/src/cmd/pools/poold/com/sun/solaris/*/*/package.html diff --git a/usr/src/tools/make/bin/Makefile b/usr/src/tools/make/bin/Makefile index 28c51177bd..fcbcb3c7d1 100644 --- a/usr/src/tools/make/bin/Makefile +++ b/usr/src/tools/make/bin/Makefile @@ -30,7 +30,6 @@ OBJS= ar.o \ read2.o \ rep.o \ state.o -SRCS=$(OBJS:%.o:$(CMDDIR)/%.cc) include ../../Makefile.tools include ../Makefile.com diff --git a/usr/src/tools/make/lib/makestate/Makefile.com b/usr/src/tools/make/lib/makestate/Makefile.com index 1bf0d1d89a..338cdf7a27 100644 --- a/usr/src/tools/make/lib/makestate/Makefile.com +++ b/usr/src/tools/make/lib/makestate/Makefile.com @@ -18,6 +18,7 @@ VERS = .1 OBJECTS = ld_file.o lock.o include $(SRC)/lib/Makefile.lib +include $(SRC)/tools/Makefile.tools include ../../../Makefile.com LIBS = $(DYNLIB) diff --git a/usr/src/tools/sgs/Makefile b/usr/src/tools/sgs/Makefile new file mode 100644 index 0000000000..cd407f0709 --- /dev/null +++ b/usr/src/tools/sgs/Makefile @@ -0,0 +1,39 @@ +# +# This file and its contents are supplied under the terms of the +# Common Development and Distribution License ("CDDL"), version 1.0. +# You may only use this file in accordance with the terms of version +# 1.0 of the CDDL. +# +# A full copy of the text of the CDDL should have accompanied this +# source. A copy of the CDDL is also available via the Internet at +# http://www.illumos.org/license/CDDL. +# + +# Copyright 2019, Richard Lowe. + +SUBDIRS = \ + include \ + ld \ + libconv \ + libelf \ + libld \ + liblddbg \ + sgsmsg + +all := TARGET= install +install := TARGET= install +clean := TARGET= clean +clobber := TARGET= clobber + +ld: sgsmsg include libconv libelf libld +libconv: sgsmsg include +libelf: sgsmsg include +libld: sgsmsg libelf libconv liblddbg include +liblddbg: sgsmsg libconv include + +all install clean clobber: $(SUBDIRS) + +$(SUBDIRS): FRC + @cd $@; pwd; $(MAKE) $(TARGET) + +FRC: diff --git a/usr/src/tools/sgs/Makefile.com b/usr/src/tools/sgs/Makefile.com new file mode 100644 index 0000000000..e3be3840f7 --- /dev/null +++ b/usr/src/tools/sgs/Makefile.com @@ -0,0 +1,18 @@ +# +# This file and its contents are supplied under the terms of the +# Common Development and Distribution License ("CDDL"), version 1.0. +# You may only use this file in accordance with the terms of version +# 1.0 of the CDDL. +# +# A full copy of the text of the CDDL should have accompanied this +# source. A copy of the CDDL is also available via the Internet at +# http://www.illumos.org/license/CDDL. +# + +# Copyright 2019, Richard Lowe. + +include $(SRC)/cmd/sgs/Makefile.com + +NATIVE_CPPFLAGS = -I. -I$(SRCDIR) -I$(SRCDIR)/common \ + -I$(SGSHOME)/include -I$(SGSHOME)/include/$(MACH) \ + -I../include $(CPPFLAGS.native) -I$(ELFCAP) -DNATIVE_BUILD diff --git a/usr/src/tools/sgs/include/Makefile b/usr/src/tools/sgs/include/Makefile new file mode 100644 index 0000000000..e97e7564b3 --- /dev/null +++ b/usr/src/tools/sgs/include/Makefile @@ -0,0 +1,68 @@ +# +# This file and its contents are supplied under the terms of the +# Common Development and Distribution License ("CDDL"), version 1.0. +# You may only use this file in accordance with the terms of version +# 1.0 of the CDDL. +# +# A full copy of the text of the CDDL should have accompanied this +# source. A copy of the CDDL is also available via the Internet at +# http://www.illumos.org/license/CDDL. +# + +# Copyright 2019, Richard Lowe. + +include ../../../Makefile.master + +# +# To build a proper 'tools' version of the link-editor is not possible, as +# we'll always depend on the ELF-related headers from the workspace, not the +# system. +# +# We pull in the minimum amount of headers using an explicit list of "ELF-y" +# headers to populate this directory, which we then search while building. +# +# This may not be enough on all occasions, judgement must be used to decide +# between providing extra headers, and wrapping problematic code in conditions +# on NATIVE_BUILD for a period of time. +# + +ROOTHDRS= dlfcn.h \ + gelf.h \ + libelf.h \ + proc_service.h \ + rtld_db.h \ + link.h + +SYSHDRS= sys/elf.h \ + sys/elf_386.h \ + sys/elf_SPARC.h \ + sys/elf_notes.h \ + sys/elf_amd64.h \ + sys/elftypes.h \ + sys/auxv.h \ + sys/auxv_SPARC.h \ + sys/auxv_386.h \ + sys/avl.h \ + sys/link.h \ + sys/machelf.h \ + sys/note.h \ + sys/systeminfo.h + +sys: + $(MKDIR) -p sys + +%: $(SRC)/head/% + $(INS.file) + +sys/%: sys $(SRC)/uts/common/sys/% + $(INS.file) + +all install: $(SYSHDRS) $(ROOTHDRS) + +clean: + +clobber: clean + $(RM) $(SYSHDRS) $(ROOTHDRS) + + + diff --git a/usr/src/cmd/sgs/packages/sparc/Makefile b/usr/src/tools/sgs/ld/Makefile index 6158a1c608..fc802dea0e 100644 --- a/usr/src/cmd/sgs/packages/sparc/Makefile +++ b/usr/src/tools/sgs/ld/Makefile @@ -19,18 +19,23 @@ # # CDDL HEADER END # -# -#ident "%Z%%M% %I% %E% SMI" -# -# Copyright (c) 1993 by Sun Microsystems, Inc. -# +# Copyright (c) 1996 by Sun Microsystems, Inc. +# All rights reserved. +include ../Makefile.com +include ../../Makefile.tools +include $(SGSHOME)/ld/Makefile.com -include ../Makefile.com +LDLIBS = -L../libconv -L$(ROOTONBLDLIBMACH) -lld -lelf -lconv +CPPFLAGS = $(NATIVE_CPPFLAGS) +CFLAGS = $(NATIVE_CFLAGS) +MAPFILES = $(SRCDIR)/common/mapfile-intf +CW_LINKER = +VAR_LD_LLDFLAGS= '-R$$ORIGIN/../../lib/$(MACH)' +VAR_LD_LLDFLAGS64 = '-R$$ORIGIN/../../../lib/$(MACH64)' -.KEEP_STATE: +install: $(ROOTONBLDMACHPROG) -all: $(FILES) -install: all $(ROOTREADME) .WAIT pkg +.KEEP_STATE: -include ../Makefile.targ +include $(SGSHOME)/ld/Makefile.targ diff --git a/usr/src/cmd/sgs/packages/Makefile.com b/usr/src/tools/sgs/libconv/Makefile index 376264ef1b..a4423c8304 100644 --- a/usr/src/cmd/sgs/packages/Makefile.com +++ b/usr/src/tools/sgs/libconv/Makefile @@ -18,31 +18,26 @@ # # CDDL HEADER END # + +# +# Copyright 2006 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. # -# Copyright (c) 1994, 2010, Oracle and/or its affiliates. All rights reserved. -# Copyright 2019 OmniOS Community Edition (OmniOSce) Association. # -include $(SRC)/Makefile.master +include ../Makefile.com +include $(SGSHOME)/libconv/Makefile.com + +CPPFLAGS = $(NATIVE_CPPFLAGS) -I$(SRC)/lib/libc/inc -I$(ELFCAP) \ + -I$(SRC)/common/sgsrtcid \ + -I$(SRC)/lib/libdemangle/common +CFLAGS = $(NATIVE_CFLAGS) +CW_LINKER = -PKGARCHIVE= . -DATAFILES= copyright prototype_com prototype_$(MACH) postinstall \ - preremove depend checkinstall -README= SUNWonld-README -FILES= $(DATAFILES) pkginfo -PACKAGE= SUNWonld -ROOTONLD= $(ROOT)/opt/SUNWonld -ROOTREADME= $(README:%=$(ROOTONLD)/%) +.PARALLEL: $(PICS) +.KEEP_STATE: -CLEANFILES= $(FILES) awk_pkginfo ../bld_awk_pkginfo -CLOBBERFILES= $(PACKAGE) +install all: $(LIBRARY) -../%: ../common/%.ksh - $(RM) $@ - cp $< $@ - chmod +x $@ +include $(SGSHOME)/libconv/Makefile.targ -$(ROOTONLD)/%: ../common/% - $(RM) $@ - cp $< $@ - chmod +x $@ diff --git a/usr/src/cmd/sgs/packages/common/pkginfo.tmpl b/usr/src/tools/sgs/libelf/Makefile index e253c2066b..2ee8dfeb48 100644 --- a/usr/src/cmd/sgs/packages/common/pkginfo.tmpl +++ b/usr/src/tools/sgs/libelf/Makefile @@ -1,4 +1,3 @@ -# Copyright (c) 1994, 2010, Oracle and/or its affiliates. All rights reserved. # # CDDL HEADER START # @@ -19,26 +18,31 @@ # # CDDL HEADER END # -# -# This required package information file describes characteristics of the -# package, such as package abbreviation, full package name, package version, -# and package architecture. -# -PKG="SUNWonld" -SGSDIR=/opt/SUNWonld/base/ -SGSBACKUPDIR=/var/ld/SUNWonld_backup -LIBDIR=lib -NAME="Solaris Link-Editors" -ARCH="ISA" -VERSION="2.4.2,REV=0.0.0" -PRODNAME="SunOS" -PRODVERS="RELEASE/VERSION" -SUNW_PKGTYPE="usr" -MAXINST="1000" -CATEGORY="internal" -DESC="OS-Net Static/Dynamic linker package" -VENDOR="Oracle Corporation" -HOTLINE="see email" -EMAIL="Rod.Evans@Oracle.COM Ali.Bahrami@Oracle.COM" -CLASSES="none" -BASEDIR=/ + +# +# Copyright (c) 1992, 2010, Oracle and/or its affiliates. All rights reserved. +# + +include ../Makefile.com +include ../../Makefile.tools +include $(SGSHOME)/libelf/Makefile.com + +CONVLIBDIR = -L../libconv +CPPFLAGS = $(NATIVE_CPPFLAGS) +CFLAGS = $(NATIVE_CFLAGS) +SGSMSGTARG += $(SGSMSG32) +CW_LINKER = + +.KEEP_STATE: + +install: all $(ROOTONBLDLIBMACH)/$(DYNLIB) $(ROOTONBLDLIBMACH)/$(LIBLINKS) + +$(ROOTONBLDLIBMACH)/$(DYNLIB): $(PICS) $(ROOTONBLDLIBMACH) + $(BUILD.SO) + $(POST_PROCESS_SO) + +$(ROOTONBLDLIBMACH)/$(LIBLINKS): $(ROOTONBLDLIBMACH)/$(DYNLIB) + @$(RM) $(ROOTONBLDLIBMACH)/$(LIBLINKS) + $(SYMLINK) $(DYNLIB) $(ROOTONBLDLIBMACH)/$(LIBLINKS) + +include $(SGSHOME)/libelf/Makefile.targ diff --git a/usr/src/tools/sgs/libld/Makefile b/usr/src/tools/sgs/libld/Makefile new file mode 100644 index 0000000000..bc5ebb73e8 --- /dev/null +++ b/usr/src/tools/sgs/libld/Makefile @@ -0,0 +1,56 @@ +# +# 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 2008 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# +# + +include ../Makefile.com +include ../../Makefile.tools +include $(SGSHOME)/libld/Makefile.com + +.KEEP_STATE: + +CW_LINKER = + +CPPFLAGS = $(NATIVE_CPPFLAGS) -DUSE_LIBLD_MALLOC -I$(SRC)/lib/libc/inc \ + -I$(SRC)/uts/common/krtld -I$(SRC)/uts/sparc \ + $(VAR_LIBLD_CPPFLAGS) +LDLIBS += -L$(ROOTONBLDLIBMACH) -L../libconv -lconv -llddbg -lelf -lc + +DYNFLAGS += $(VERSREF) '-R$$ORIGIN' +CFLAGS = $(NATIVE_CFLAGS) + +all: $(DYNLIB) $(LIBLINKS) + +install: all $(ROOTONBLDLIBMACH)/$(DYNLIB) $(ROOTONBLDLIBMACH)/$(LIBLINKS) + +$(ROOTONBLDLIBMACH)/$(DYNLIB): $(PICS) $(ROOTONBLDLIBMACH) + $(BUILD.SO) + $(POST_PROCESS_SO) + +$(ROOTONBLDLIBMACH)/$(LIBLINKS): $(ROOTONBLDLIBMACH)/$(DYNLIB) + @$(RM) $(ROOTONBLDLIBMACH)/$(LIBLINKS) + $(SYMLINK) $(DYNLIB) $(ROOTONBLDLIBMACH)/$(LIBLINKS) + +include $(SGSHOME)/libld/Makefile.targ diff --git a/usr/src/cmd/sgs/packages/common/preremove b/usr/src/tools/sgs/liblddbg/Makefile index ec1348051a..f2bdd55c81 100644 --- a/usr/src/cmd/sgs/packages/common/preremove +++ b/usr/src/tools/sgs/liblddbg/Makefile @@ -18,43 +18,34 @@ # # CDDL HEADER END # + # -# Copyright 2009 Sun Microsystems, Inc. All rights reserved. +# Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # +include ../Makefile.com +include ../../Makefile.tools +include $(SGSHOME)/liblddbg/Makefile.com -# -# Remove any new files that SUNWonld added to the system -# -if [ -f $BASEDIR/${SGSBACKUPDIR}.newfiles ]; then - echo "Removing new files added by SUNWonld" - cat $BASEDIR/${SGSBACKUPDIR}.newfiles | while read file - do - if [ -d $BASEDIR/$file ]; then - rmdir $BASEDIR/$file - else - rm $BASEDIR/$file - fi - done - rm $BASEDIR/${SGSBACKUPDIR}.newfiles -fi +.KEEP_STATE: +CPPFLAGS = $(NATIVE_CPPFLAGS) -I$(SRC)/lib/libc/inc +CFLAGS = $(NATIVE_CFLAGS) +DYNFLAGS += -L../libconv +SGSMSGTARG += $(SGSMSG32) +CW_LINKER= -# -# Restore previous SGSTOOLS -# -if [ \( -d $BASEDIR/$SGSBACKUPDIR \) -a \ - \( -f $BASEDIR/${SGSBACKUPDIR}.origfiles \) ]; then - prev_bindnow=$LD_BIND_NOW - LD_BIND_NOW=1 - export LD_BIND_NOW - echo "Restoring SGSTOOLS from $BASEDIR$SGSBACKUPDIR" - cd $BASEDIR/$SGSBACKUPDIR - cpio -pdmu $BASEDIR < $BASEDIR/${SGSBACKUPDIR}.origfiles - rm -rf * - rm $BASEDIR/${SGSBACKUPDIR}.origfiles - LD_BIND_NOW=$prev_bindnow -fi +all: $(DYNLIB) $(LIBLINKS) + +install: all $(ROOTONBLDLIBMACH)/$(DYNLIB) $(ROOTONBLDLIBMACH)/$(LIBLINKS) + +$(ROOTONBLDLIBMACH)/$(DYNLIB): $(PICS) $(ROOTONBLDLIBMACH) + $(BUILD.SO) + $(POST_PROCESS_SO) + +$(ROOTONBLDLIBMACH)/$(LIBLINKS): $(ROOTONBLDLIBMACH)/$(DYNLIB) + @$(RM) $(ROOTONBLDLIBMACH)/$(LIBLINKS) + $(SYMLINK) $(DYNLIB) $(ROOTONBLDLIBMACH)/$(LIBLINKS) -cd $BASEDIR +include $(SGSHOME)/liblddbg/Makefile.targ diff --git a/usr/src/tools/sgs/sgsmsg/Makefile b/usr/src/tools/sgs/sgsmsg/Makefile new file mode 100644 index 0000000000..e808245030 --- /dev/null +++ b/usr/src/tools/sgs/sgsmsg/Makefile @@ -0,0 +1,79 @@ +# +# 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) 2018, Joyent, Inc. +# Copyright 2019 OmniOS Community Edition (OmniOSce) Association. + +# +# Copyright 2010 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# + +# +# Makefile to support tools used for linker development: +# +# o sgsmsg creates message headers/arrays/catalogs (a native tool). +# +# Note, these tools are not part of the product. +# + +include ../Makefile.com +include ../../Makefile.tools +include $(SRC)/cmd/Makefile.cmd + + +PROG= sgsmsg + +MAN1ONBLDFILES = sgsmsg.1onbld +$(ROOTONBLDMAN1ONBLDFILES) := FILEMODE= 644 + +OBJS= assfail.o \ + avl.o \ + findprime.o \ + sgsmsg.o \ + string_table.o + +FILEMODE= 0755 + +CPPFLAGS = $(NATIVE_CPPFLAGS) +CFLAGS = $(NATIVE_CFLAGS) +CW_LINKER = + +# not linted +SMATCH= off + +all: $(PROG) + +install: $(ROOTONBLDMACHPROG) $(ROOTONBLDMAN1ONBLDFILES) + +$(PROG): $(OBJS) + $(LINK.c) $(OBJS) -o $@ $(LDLIBS) + +%.o: $(SGSCOMMON)/%.c + $(NATIVECC) $(DEBUG) $(NATIVE_CFLAGS) $(CPPFLAGS) -c $< + +avl.o: $(SRC)/common/avl/avl.c + $(NATIVECC) $(DEBUG) $(NATIVE_CFLAGS) $(CPPFLAGS) -c \ + $(SRC)/common/avl/avl.c + +clean: + $(RM) $(OBJS) + +include $(SRC)/cmd/Makefile.targ diff --git a/usr/src/cmd/sgs/tools/man/sgsmsg.1l b/usr/src/tools/sgs/sgsmsg/sgsmsg.1onbld index 88937580a7..abd8d3b318 100644 --- a/usr/src/cmd/sgs/tools/man/sgsmsg.1l +++ b/usr/src/tools/sgs/sgsmsg/sgsmsg.1onbld @@ -1,4 +1,3 @@ -.\" ident "%Z%%M% %I% %E% SMI" .\" Copyright 2005 Sun Microsystems, Inc. All rights reserved. .\" Use is subject to license terms. .\" @@ -23,7 +22,7 @@ .\" CDDL HEADER END .\" .if n .tr \-- -.TH sgsmsg 1l "2 Jun 1999" +.TH sgsmsg 1ONBLD "Jun 2, 1999" .SH NAME sgsmsg \- generate message strings for SGS subsystem. .SH SYNOPSIS @@ -69,7 +68,6 @@ translated into a form suitable for .BR catgets (3C) manipulation. .SH OPERANDS -.LP One of more input \f2file\f1s contains a definition for each character string used by a particular code group. The interpretation of a definition is determined by the first character of each line within @@ -229,9 +227,6 @@ strings used by .ft 1 .if t .sp 0.35 .if n .sp -# ident "%Z%%M% %I% %E% SMI" -.if t .sp 0.35 -.if n .sp @ _START_ .if t .sp 0.35 .if n .sp @@ -417,17 +412,15 @@ _ld_msg(int mid) { return (gettext(MSG_ORIG(mid))); } +.RE .sp .SH "EXIT STATUS" A non-zero error return indicates a processing error. -.RE .PD .SH "SEE ALSO" .BR gencat (1), .BR ld (1), .BR msgfmt (1), .BR catgets (3C), -.BR gettext (3I). -.br -.TZ LLM +.BR gettext (3C). .if n .tr \-\- diff --git a/usr/src/cmd/sgs/tools/common/sgsmsg.c b/usr/src/tools/sgs/sgsmsg/sgsmsg.c index 203a7569a5..203a7569a5 100644 --- a/usr/src/cmd/sgs/tools/common/sgsmsg.c +++ b/usr/src/tools/sgs/sgsmsg/sgsmsg.c diff --git a/usr/src/uts/Makefile.uts b/usr/src/uts/Makefile.uts index 791ebe8859..6292fb6e53 100644 --- a/usr/src/uts/Makefile.uts +++ b/usr/src/uts/Makefile.uts @@ -251,8 +251,8 @@ CFLAGS_uts_i386 += -_gcc8=-mindirect-branch=thunk-extern CFLAGS_uts_i386 += -_gcc8=-mindirect-branch-register # -# Ensure that the standard function prologue remains at the very start of a function, -# so DTrace fbt will instrument the right place. +# Ensure that the standard function prologue remains at the very start +# of a function, so DTrace fbt will instrument the right place. # CFLAGS_uts_i386 += -_gcc7=-fno-shrink-wrap CFLAGS_uts_i386 += -_gcc8=-fno-shrink-wrap diff --git a/usr/src/uts/common/fs/zfs/sys/spa.h b/usr/src/uts/common/fs/zfs/sys/spa.h index 4f4eb15318..6a7e13b819 100644 --- a/usr/src/uts/common/fs/zfs/sys/spa.h +++ b/usr/src/uts/common/fs/zfs/sys/spa.h @@ -124,6 +124,17 @@ _NOTE(CONSTCOND) } while (0) #define SPA_MAXBLOCKSIZE (1ULL << SPA_MAXBLOCKSHIFT) /* + * Alignment Shift (ashift) is an immutable, internal top-level vdev property + * which can only be set at vdev creation time. Physical writes are always done + * according to it, which makes 2^ashift the smallest possible IO on a vdev. + * + * We currently allow values ranging from 512 bytes (2^9 = 512) to 64 KiB + * (2^16 = 65,536). + */ +#define ASHIFT_MIN 9 +#define ASHIFT_MAX 16 + +/* * Size of block to hold the configuration data (a packed nvlist) */ #define SPA_CONFIG_BLOCKSIZE (1ULL << 14) diff --git a/usr/src/uts/common/fs/zfs/vdev.c b/usr/src/uts/common/fs/zfs/vdev.c index 2c84c0cd5b..687e00b6e9 100644 --- a/usr/src/uts/common/fs/zfs/vdev.c +++ b/usr/src/uts/common/fs/zfs/vdev.c @@ -1662,25 +1662,31 @@ vdev_open(vdev_t *vd) if (vd->vdev_asize == 0) { /* * This is the first-ever open, so use the computed values. - * For testing purposes, a higher ashift can be requested. + * For compatibility, a different ashift can be requested. */ vd->vdev_asize = asize; vd->vdev_max_asize = max_asize; - vd->vdev_ashift = MAX(ashift, vd->vdev_ashift); - vd->vdev_ashift = MAX(zfs_ashift_min, vd->vdev_ashift); + if (vd->vdev_ashift == 0) { + vd->vdev_ashift = ashift; /* use detected value */ + } + if (vd->vdev_ashift != 0 && (vd->vdev_ashift < ASHIFT_MIN || + vd->vdev_ashift > ASHIFT_MAX)) { + vdev_set_state(vd, B_TRUE, VDEV_STATE_CANT_OPEN, + VDEV_AUX_BAD_ASHIFT); + return (SET_ERROR(EDOM)); + } } else { /* * Detect if the alignment requirement has increased. * We don't want to make the pool unavailable, just - * issue a warning instead. + * post an event instead. */ if (ashift > vd->vdev_top->vdev_ashift && vd->vdev_ops->vdev_op_leaf) { - cmn_err(CE_WARN, - "Disk, '%s', has a block alignment that is " - "larger than the pool's alignment\n", - vd->vdev_path); + zfs_ereport_post(FM_EREPORT_ZFS_DEVICE_BAD_ASHIFT, + spa, vd, NULL, NULL, 0, 0); } + vd->vdev_max_asize = max_asize; } @@ -4186,6 +4192,9 @@ vdev_set_state(vdev_t *vd, boolean_t isopen, vdev_state_t state, vdev_aux_t aux) case VDEV_AUX_BAD_LABEL: class = FM_EREPORT_ZFS_DEVICE_BAD_LABEL; break; + case VDEV_AUX_BAD_ASHIFT: + class = FM_EREPORT_ZFS_DEVICE_BAD_ASHIFT; + break; default: class = FM_EREPORT_ZFS_DEVICE_UNKNOWN; } diff --git a/usr/src/uts/common/fs/zfs/zfs_fm.c b/usr/src/uts/common/fs/zfs/zfs_fm.c index 07a7a9f70b..87846292b1 100644 --- a/usr/src/uts/common/fs/zfs/zfs_fm.c +++ b/usr/src/uts/common/fs/zfs/zfs_fm.c @@ -44,11 +44,11 @@ * ereports. The payload is dependent on the class, and which arguments are * supplied to the function: * - * EREPORT POOL VDEV IO - * block X X X - * data X X - * device X X - * pool X + * EREPORT POOL VDEV IO + * block X X X + * data X X + * device X X + * pool X * * If we are in a loading state, all errors are chained together by the same * SPA-wide ENA (Error Numeric Association). @@ -60,18 +60,18 @@ * layered diagram: * * +---------------+ - * | Aggregate I/O | No associated logical data or device - * +---------------+ + * | Aggregate I/O | No associated logical data or device + * +---------------+ * | * V - * +---------------+ Reads associated with a piece of logical data. - * | Read I/O | This includes reads on behalf of RAID-Z, - * +---------------+ mirrors, gang blocks, retries, etc. + * +---------------+ Reads associated with a piece of logical data. + * | Read I/O | This includes reads on behalf of RAID-Z, + * +---------------+ mirrors, gang blocks, retries, etc. * | * V - * +---------------+ Reads associated with a particular device, but - * | Physical I/O | no logical data. Issued as part of vdev caching - * +---------------+ and I/O aggregation. + * +---------------+ Reads associated with a particular device, but + * | Physical I/O | no logical data. Issued as part of vdev caching + * +---------------+ and I/O aggregation. * * Note that 'physical I/O' here is not the same terminology as used in the rest * of ZIO. Typically, 'physical I/O' simply means that there is no attached @@ -273,6 +273,10 @@ zfs_ereport_start(nvlist_t **ereport_out, nvlist_t **detector_out, fm_payload_set(ereport, FM_EREPORT_PAYLOAD_ZFS_VDEV_FRU, DATA_TYPE_STRING, vd->vdev_fru, NULL); + if (vd->vdev_ashift) + fm_payload_set(ereport, + FM_EREPORT_PAYLOAD_ZFS_VDEV_ASHIFT, + DATA_TYPE_UINT64, vd->vdev_ashift, NULL); if (pvd != NULL) { fm_payload_set(ereport, diff --git a/usr/src/uts/common/io/openprom.c b/usr/src/uts/common/io/openprom.c index aab70a88f3..6fe363fa45 100644 --- a/usr/src/uts/common/io/openprom.c +++ b/usr/src/uts/common/io/openprom.c @@ -21,6 +21,7 @@ /* * Copyright 2010 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. + * Copyright 2019 Peter Tribble. */ /* @@ -490,7 +491,6 @@ opromioctl_cb(void *avp, int has_changed) #if !defined(__i386) && !defined(__amd64) case OPROMGETFBNAME: case OPROMDEV2PROMNAME: - case OPROMREADY64: #endif /* !__i386 && !__amd64 */ if ((mode & FREAD) == 0) { return (EPERM); @@ -977,38 +977,6 @@ opromioctl_cb(void *avp, int has_changed) break; } - - case OPROMREADY64: { - struct openprom_opr64 *opr = - (struct openprom_opr64 *)opp->oprom_array; - int i; - pnode_t id; - - if (userbufsize < sizeof (*opr)) { - error = EINVAL; - break; - } - - valsize = userbufsize - - offsetof(struct openprom_opr64, message); - - i = prom_version_check(opr->message, valsize, &id); - opr->return_code = i; - opr->nodeid = (int)id; - - valsize = offsetof(struct openprom_opr64, message); - valsize += strlen(opr->message) + 1; - - /* - * copyout only the part of the user buffer we need to. - */ - if (copyout(opp, (void *)arg, - (size_t)(min((uint_t)valsize, userbufsize) + - sizeof (uint_t))) != 0) - error = EFAULT; - break; - - } /* case OPROMREADY64 */ #endif /* !__i386 && !__amd64 */ } /* switch (cmd) */ diff --git a/usr/src/uts/common/sys/Makefile b/usr/src/uts/common/sys/Makefile index aa4eab00a2..cee6dfb94d 100644 --- a/usr/src/uts/common/sys/Makefile +++ b/usr/src/uts/common/sys/Makefile @@ -351,6 +351,7 @@ CHKHDRS= \ libc_kernel.h \ limits.h \ link.h \ + linker_set.h \ list.h \ list_impl.h \ llc1.h \ diff --git a/usr/src/uts/common/sys/ccompile.h b/usr/src/uts/common/sys/ccompile.h index 3bfbc2fb5e..0cd104efef 100644 --- a/usr/src/uts/common/sys/ccompile.h +++ b/usr/src/uts/common/sys/ccompile.h @@ -149,7 +149,10 @@ extern "C" { #define __CONST __sun_attr__((__const__)) #define __PURE __sun_attr__((__pure__)) #define __packed __attribute__((__packed__)) +#define __section(x) __attribute__((__section__(x))) #define __unused __sun_attr__((__unused__)) +#define __used __attribute__((__used__)) +#define __weak_symbol __attribute__((__weak__)) #ifdef __cplusplus } diff --git a/usr/src/uts/common/sys/fm/fs/zfs.h b/usr/src/uts/common/sys/fm/fs/zfs.h index 51a12f6817..c3eb950326 100644 --- a/usr/src/uts/common/sys/fm/fs/zfs.h +++ b/usr/src/uts/common/sys/fm/fs/zfs.h @@ -44,6 +44,7 @@ extern "C" { #define FM_EREPORT_ZFS_DEVICE_BAD_GUID_SUM "vdev.bad_guid_sum" #define FM_EREPORT_ZFS_DEVICE_TOO_SMALL "vdev.too_small" #define FM_EREPORT_ZFS_DEVICE_BAD_LABEL "vdev.bad_label" +#define FM_EREPORT_ZFS_DEVICE_BAD_ASHIFT "vdev.bad_ashift" #define FM_EREPORT_ZFS_IO_FAILURE "io_failure" #define FM_EREPORT_ZFS_PROBE_FAILURE "probe_failure" #define FM_EREPORT_ZFS_LOG_REPLAY "log_replay" @@ -58,6 +59,8 @@ extern "C" { #define FM_EREPORT_PAYLOAD_ZFS_VDEV_PATH "vdev_path" #define FM_EREPORT_PAYLOAD_ZFS_VDEV_DEVID "vdev_devid" #define FM_EREPORT_PAYLOAD_ZFS_VDEV_FRU "vdev_fru" +#define FM_EREPORT_PAYLOAD_ZFS_VDEV_STATE "vdev_state" +#define FM_EREPORT_PAYLOAD_ZFS_VDEV_ASHIFT "vdev_ashift" #define FM_EREPORT_PAYLOAD_ZFS_PARENT_GUID "parent_guid" #define FM_EREPORT_PAYLOAD_ZFS_PARENT_TYPE "parent_type" #define FM_EREPORT_PAYLOAD_ZFS_PARENT_PATH "parent_path" diff --git a/usr/src/uts/common/sys/fs/zfs.h b/usr/src/uts/common/sys/fs/zfs.h index f0136aa148..a55d860a0e 100644 --- a/usr/src/uts/common/sys/fs/zfs.h +++ b/usr/src/uts/common/sys/fs/zfs.h @@ -233,6 +233,7 @@ typedef enum { ZPOOL_PROP_TNAME, ZPOOL_PROP_MAXDNODESIZE, ZPOOL_PROP_MULTIHOST, + ZPOOL_PROP_ASHIFT, ZPOOL_NUM_PROPS } zpool_prop_t; @@ -768,7 +769,8 @@ typedef enum vdev_aux { VDEV_AUX_EXTERNAL, /* external diagnosis */ VDEV_AUX_SPLIT_POOL, /* vdev was split off into another pool */ VDEV_AUX_ACTIVE, /* vdev active on a different host */ - VDEV_AUX_CHILDREN_OFFLINE /* all children are offline */ + VDEV_AUX_CHILDREN_OFFLINE, /* all children are offline */ + VDEV_AUX_BAD_ASHIFT /* vdev ashift is invalid */ } vdev_aux_t; /* diff --git a/usr/src/uts/common/sys/linker_set.h b/usr/src/uts/common/sys/linker_set.h new file mode 100644 index 0000000000..44934bcd97 --- /dev/null +++ b/usr/src/uts/common/sys/linker_set.h @@ -0,0 +1,96 @@ +/* + * Copyright (c) 1999 John D. Polstra + * Copyright (c) 1999,2001 Peter Wemm <peter@FreeBSD.org> + * 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. + * + * 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. + */ + +#ifndef _SYS_LINKER_SET_H_ +#define _SYS_LINKER_SET_H_ + +#include <sys/ccompile.h> + +/* + * The following macros are used to declare global sets of objects, which + * are collected by the linker into a `linker_set' as defined below. + * For ELF, this is done by constructing a separate segment for each set. + */ + +#define __MAKE_SET_CONST const + +#define __CONCAT1(x, y) x ## y +#define __CONCAT(x, y) __CONCAT1(x, y) + +#define __GLOBL1(sym) __asm__(".globl " #sym) +#define __GLOBL(sym) __GLOBL1(sym) +/* + * Private macros, not to be used outside this header file. + */ +#define __MAKE_SET(set, sym) \ + __GLOBL(__CONCAT(__start_set_, set)); \ + __GLOBL(__CONCAT(__stop_set_, set)); \ + static void const * __MAKE_SET_CONST \ + __set_##set##_sym_##sym __section("set_" #set) \ + __used = &(sym) + +/* + * Public macros. + */ +#define TEXT_SET(set, sym) __MAKE_SET(set, sym) +#define DATA_SET(set, sym) __MAKE_SET(set, sym) +#define BSS_SET(set, sym) __MAKE_SET(set, sym) +#define ABS_SET(set, sym) __MAKE_SET(set, sym) +#define SET_ENTRY(set, sym) __MAKE_SET(set, sym) + +/* + * Initialize before referring to a given linker set. + */ +#define SET_DECLARE(set, ptype) \ + extern ptype __weak_symbol *__CONCAT(__start_set_, set); \ + extern ptype __weak_symbol *__CONCAT(__stop_set_, set) + +#define SET_BEGIN(set) \ + (&__CONCAT(__start_set_, set)) +#define SET_LIMIT(set) \ + (&__CONCAT(__stop_set_, set)) + +/* + * Iterate over all the elements of a set. + * + * Sets always contain addresses of things, and "pvar" points to words + * containing those addresses. Thus is must be declared as "type **pvar", + * and the address of each set item is obtained inside the loop by "*pvar". + */ +#define SET_FOREACH(pvar, set) \ + for (pvar = SET_BEGIN(set); pvar < SET_LIMIT(set); pvar++) + +#define SET_ITEM(set, i) \ + ((SET_BEGIN(set))[i]) + +/* + * Provide a count of the items in a set. + */ +#define SET_COUNT(set) \ + (SET_LIMIT(set) - SET_BEGIN(set)) + +#endif /* _SYS_LINKER_SET_H_ */ diff --git a/usr/src/uts/common/sys/openpromio.h b/usr/src/uts/common/sys/openpromio.h index 824943791a..09b146d1cc 100644 --- a/usr/src/uts/common/sys/openpromio.h +++ b/usr/src/uts/common/sys/openpromio.h @@ -21,6 +21,7 @@ /* * Copyright 2010 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. + * Copyright 2019 Peter Tribble. */ #ifndef _SYS_OPENPROMIO_H @@ -85,7 +86,7 @@ struct openpromio { #define OPROMDEV2PROMNAME (OIOC | 15) /* Convert devfs path to prom path */ #define OPROMPROM2DEVNAME (OIOC | 16) /* Convert devfs path to prom path */ #define OPROMGETPROPLEN (OIOC | 17) /* interface to raw config_ops */ -#define OPROMREADY64 (OIOC | 18) /* is prom 64-bit ready? */ +#define OPROMREADY64 (OIOC | 18) /* DEPRECATED is prom 64-bit ready? */ #define OPROMSETNODEID (OIOC | 19) /* set current node_id */ #define OPROMSNAPSHOT (OIOC | 20) /* create a snapshot */ #define OPROMCOPYOUT (OIOC | 21) /* copyout and free snapshot */ @@ -104,30 +105,6 @@ struct openpromio { #define OPROMCONS_STDOUT_IS_FB 0x2 /* stdout is a framebuffer */ #define OPROMCONS_OPENPROM 0x4 /* supports openboot */ -#if defined(__sparc) - -/* - * Data structure returned in oprom_array, from OPROMREADY64: - * - * With return codes 1 and 2, also returns nodeid, a nodeid - * of a flashprom node, and a message string with the minimum version - * requirement for this platform. - */ -struct openprom_opr64 { - int return_code; /* See below */ - int nodeid; /* Valid with positive return codes */ - char message[1]; /* NULL terminated message string */ -}; - -/* - * return_code values from OPROMREADY64: - */ -#define OP64R_READY 0 /* ready or not applicable */ -#define OP64R_UPGRADE_REQUIRED 1 /* Upgrade required */ -#define OP64R_UPGRADE_RECOMMENDED 2 /* Upgrade recommended */ - -#endif - #ifdef __cplusplus } #endif diff --git a/usr/src/uts/intel/os/driver_aliases b/usr/src/uts/intel/os/driver_aliases index e914a9870f..459d7b98a0 100644 --- a/usr/src/uts/intel/os/driver_aliases +++ b/usr/src/uts/intel/os/driver_aliases @@ -67,8 +67,8 @@ amd64_gart "pci1022,1103" amd8111s "pci1022,7462" amd_iommu "pci1002,5a23" amd_iommu "pci1022,11ff" -amdf17nbdf "pci1022,1450" -amdf17nbdf "pci1022,1460" +amdf17nbdf "pci1022,1450,p" +amdf17nbdf "pci1022,1460,p" amr "pci1000,1960.1000,532" amr "pci101e,1960.1028,493" amr "pci1000,1960.1028,518" @@ -1188,15 +1188,15 @@ oce "pciex19a2,700" oce "pciex19a2,710" ohci "pciclass,0c0310" pcata "pccard,disk" -pchtemp "pci8086,8ca4" -pchtemp "pci8086,8c24" -pchtemp "pci8086,8d24" -pchtemp "pci8086,9d31" -pchtemp "pci8086,a1b1" -pchtemp "pci8086,a231" -pchtemp "pci8086,a2b1" -pchtemp "pci8086,a131" -pchtemp "pci8086,a379" +pchtemp "pci8086,8ca4,p" +pchtemp "pci8086,8c24,p" +pchtemp "pci8086,8d24,p" +pchtemp "pci8086,9d31,p" +pchtemp "pci8086,a1b1,p" +pchtemp "pci8086,a231,p" +pchtemp "pci8086,a2b1,p" +pchtemp "pci8086,a131,p" +pchtemp "pci8086,a379,p" pci_pci "pci1011,1" pci_pci "pci1011,21" pci_pci "pci1014,22" diff --git a/usr/src/uts/sun/sys/promif.h b/usr/src/uts/sun/sys/promif.h index cfb51d55f6..0c4188782e 100644 --- a/usr/src/uts/sun/sys/promif.h +++ b/usr/src/uts/sun/sys/promif.h @@ -22,13 +22,12 @@ /* * Copyright 2008 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. + * Copyright 2019 Peter Tribble. */ #ifndef _SYS_PROMIF_H #define _SYS_PROMIF_H -#pragma ident "%Z%%M% %I% %E% SMI" - #include <sys/types.h> #include <sys/obpdefs.h> @@ -64,8 +63,8 @@ extern "C" { * allow the promif routines to allocate and free memory allocated from * the bottom 32-bits of the 64-bit address space: * - * void *promplat_alloc(size_t); - * void promplat_free(void *, size_t); + * void *promplat_alloc(size_t); + * void promplat_free(void *, size_t); * * The alloc function should guarantee that it will never return an * invalid pointer. @@ -185,7 +184,6 @@ extern int prom_getversion(void); extern int prom_is_openprom(void); extern int prom_is_p1275(void); extern int prom_version_name(char *buf, int buflen); -extern int prom_version_check(char *buf, size_t len, pnode_t *n); extern void *prom_mon_id(void); /* SMCC/OBP platform centric */ @@ -199,20 +197,6 @@ extern void prom_interpret(char *str, uintptr_t arg1, uintptr_t arg5); /* - * Return code values from prom_version_check: - * - * This routine uses past-prediction mode to determine if the firmware - * on the current system is 64-bit ready. - * - * return code 2 could happen on a board-based server with a slave CPU board - * running down-rev firmware and the current master running adequate fw. - */ -#define PROM_VER64_OK 0 /* Prom is 64-bit ready (or n/a) */ -#define PROM_VER64_UPGRADE 1 /* Down-rev firmware is running */ -#define PROM_VER64_SUGGEST 2 /* Down-rev firmware detected .. */ - /* .. but not currently active */ - -/* * Administrative group: OBP only. */ extern int prom_sethandler(void (*v0_func)(), void (*v2_func)()); diff --git a/usr/src/uts/sun4/os/startup.c b/usr/src/uts/sun4/os/startup.c index c8752a16ac..759802b2cd 100644 --- a/usr/src/uts/sun4/os/startup.c +++ b/usr/src/uts/sun4/os/startup.c @@ -277,11 +277,6 @@ uint_t hblk1_min = H1MIN; /* - * Hook for down-rev firmware - */ -static void do_prom_version_check(void); - -/* * After receiving a thermal interrupt, this is the number of seconds * to delay before shutting off the system, assuming * shutdown fails. Use /etc/system to change the delay if this isn't @@ -1518,12 +1513,6 @@ startup_modules(void) mod_setup(); /* - * If we are running firmware that isn't 64-bit ready - * then complain and halt. - */ - do_prom_version_check(); - - /* * Initialize system parameters */ param_init(); @@ -3090,43 +3079,6 @@ startup_create_io_node(void) } -static void -do_prom_version_check(void) -{ - int i; - pnode_t node; - char buf[64]; - static char drev[] = "Down-rev firmware detected%s\n" - "\tPlease upgrade to the following minimum version:\n" - "\t\t%s\n"; - - i = prom_version_check(buf, sizeof (buf), &node); - - if (i == PROM_VER64_OK) - return; - - if (i == PROM_VER64_UPGRADE) { - cmn_err(CE_WARN, drev, "", buf); - -#ifdef DEBUG - prom_enter_mon(); /* Type 'go' to continue */ - cmn_err(CE_WARN, "Booting with down-rev firmware\n"); - return; -#else - halt(0); -#endif - } - - /* - * The other possibility is that this is a server running - * good firmware, but down-rev firmware was detected on at - * least one other cpu board. We just complain if we see - * that. - */ - cmn_err(CE_WARN, drev, " on one or more CPU boards", buf); -} - - /* * Must be defined in platform dependent code. */ |