summaryrefslogtreecommitdiff
path: root/usr/src
diff options
context:
space:
mode:
authorJerry Jelinek <jerry.jelinek@joyent.com>2020-05-04 11:41:34 +0000
committerJerry Jelinek <jerry.jelinek@joyent.com>2020-05-04 11:41:34 +0000
commit8905677cfdd7eb5c1a4f10fc9cfc3905e28d87a6 (patch)
treed371f7bce8a54c9aa53773440c8351cf017a87ba /usr/src
parent363d63cac68cdd10faf2dc4f7b4685713a4706af (diff)
parent45de8795bcb0e4c49743f37edfdd2c89d5a7863b (diff)
downloadillumos-joyent-8905677cfdd7eb5c1a4f10fc9cfc3905e28d87a6.tar.gz
[illumos-gate merge]
commit 45de8795bcb0e4c49743f37edfdd2c89d5a7863b 12683 w(1) and whodo(1) should silently skip dirs it cannot open commit 6112cec5d5374dff12a12bd285afeb5e660b7154 12517 allow for custom per-distribution branding commit 15fa1d047e03d3f123546d72f130c5ce4b278eba 12519 Targetdirs: remove left over /usr/4lib commit 85ba5240e8fe32c7405930a51a93630182ce67d7 12551 cmlb: NULL pointer errors Conflicts: usr/src/uts/common/os/logsubr.c usr/src/uts/common/Makefile.rules usr/src/cmd/init/init.c usr/src/cmd/init/Makefile usr/src/cmd/Adm/sun/Makefile
Diffstat (limited to 'usr/src')
-rw-r--r--usr/src/Makefile.master19
-rw-r--r--usr/src/Targetdirs1
-rw-r--r--usr/src/cmd/Adm/sun/Makefile2
-rw-r--r--usr/src/cmd/abi/appcert/scripts/abi_index.pl8
-rw-r--r--usr/src/cmd/init/Makefile22
-rw-r--r--usr/src/cmd/init/init.c42
-rw-r--r--usr/src/cmd/sgs/crle/common/crle.msg6
-rw-r--r--usr/src/cmd/sgs/rtld/common/a.out.c1
-rw-r--r--usr/src/cmd/sgs/rtld/common/rtld.sparc32.msg1
-rw-r--r--usr/src/cmd/w/w.c6
-rw-r--r--usr/src/cmd/whodo/whodo.c7
-rw-r--r--usr/src/common/bootbanner/bootbanner.c354
-rw-r--r--usr/src/man/man1/crle.115
-rw-r--r--usr/src/man/man2/sysinfo.214
-rw-r--r--usr/src/man/man5/filesystem.517
-rwxr-xr-xusr/src/tools/scripts/bldenv15
-rw-r--r--usr/src/tools/scripts/check_rtime.pl12
-rwxr-xr-xusr/src/tools/scripts/nightly22
-rw-r--r--usr/src/ucbcmd/Makefile.ucbcmd5
-rw-r--r--usr/src/uts/common/Makefile.files1
-rw-r--r--usr/src/uts/common/Makefile.rules12
-rw-r--r--usr/src/uts/common/io/cmlb.c4
-rw-r--r--usr/src/uts/common/os/logsubr.c16
-rw-r--r--usr/src/uts/common/sys/Makefile1
-rw-r--r--usr/src/uts/common/sys/bootbanner.h33
-rw-r--r--usr/src/uts/common/sys/systeminfo.h12
-rw-r--r--usr/src/uts/common/syscall/systeminfo.c8
27 files changed, 547 insertions, 109 deletions
diff --git a/usr/src/Makefile.master b/usr/src/Makefile.master
index 02242189d8..659edcf19c 100644
--- a/usr/src/Makefile.master
+++ b/usr/src/Makefile.master
@@ -30,6 +30,7 @@
# Copyright 2018 OmniOS Community Edition (OmniOSce) Association.
# Copyright 2020 Joyent, Inc.
# Copyright 2019 RackTop Systems.
+# Copyright 2020 Oxide Computer Company
#
#
@@ -1116,10 +1117,24 @@ VERSION= SunOS Development
PATCHID= $(VERSION)
RELEASE_DATE= release date not set
PATCH_DATE= $(RELEASE_DATE)
-RELEASE_CM= "@($(POUND_SIGN))SunOS $(RELEASE) $(PATCHID) $(PATCH_DATE)"
-DEV_CM= "@($(POUND_SIGN))SunOS Internal Development: non-nightly build"
+RELEASE_CM= "@($(POUND_SIGN))illumos $(PATCHID) $(PATCH_DATE)"
+DEV_CM_TAIL= development build: $(LOGNAME)
+DEV_CM= "@($(POUND_SIGN))illumos $(DEV_CM_TAIL)"
UTS_LABEL= $(RELEASE)
+#
+# The boot banner may be overridden by distributions. Up to five lines can be
+# specified by overriding the BOOTBANNER macros, and any line that expands to
+# an empty string will not be printed. See comments in
+# bootbanner_expand_template() for more details about the template string
+# format.
+#
+BOOTBANNER1= ^o Version ^v ^w-bit
+BOOTBANNER2=
+BOOTBANNER3=
+BOOTBANNER4=
+BOOTBANNER5=
+
PROCESS_COMMENT= @?${MCS} -d -a $(RELEASE_CM) -a $(DEV_CM)
$(RELEASE_BUILD)PROCESS_COMMENT= @?${MCS} -d -a $(RELEASE_CM)
diff --git a/usr/src/Targetdirs b/usr/src/Targetdirs
index 699a2b8dc9..9fbd858bc7 100644
--- a/usr/src/Targetdirs
+++ b/usr/src/Targetdirs
@@ -250,7 +250,6 @@ DIRS= \
/system/object \
/tmp \
/usr \
- /usr/4lib \
/usr/ast \
/usr/ast/bin \
/usr/bin \
diff --git a/usr/src/cmd/Adm/sun/Makefile b/usr/src/cmd/Adm/sun/Makefile
index e249952dcc..636dc875e6 100644
--- a/usr/src/cmd/Adm/sun/Makefile
+++ b/usr/src/cmd/Adm/sun/Makefile
@@ -65,6 +65,8 @@ motd: $(ROOT)/buildstamp
issue: issue.in $(ROOT)/buildstamp
sed "s+build: 00000000T000000Z+$$(cat $(ROOT)/buildstamp)+" issue.in >$@
+ @$(NOT_RELEASE_BUILD)-$(ECHO) $(DEV_CM) | sed -e "s/@(#)//" >> motd
+ @-$(CAT) release_info >> motd
smbpasswd:
$(TOUCH) smbpasswd
diff --git a/usr/src/cmd/abi/appcert/scripts/abi_index.pl b/usr/src/cmd/abi/appcert/scripts/abi_index.pl
index c1ff743a13..61a4e19cc8 100644
--- a/usr/src/cmd/abi/appcert/scripts/abi_index.pl
+++ b/usr/src/cmd/abi/appcert/scripts/abi_index.pl
@@ -20,9 +20,6 @@
#
# CDDL HEADER END
#
-#
-# ident "%Z%%M% %I% %E% SMI"
-#
# Copyright 2004 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
@@ -59,7 +56,6 @@ my $must_be_public = 0;
# paths to skip outright.
my @skip_list = qw(
/etc
- /usr/4lib
/usr/perl5
);
my $path_skip = join('|', @skip_list);
@@ -114,7 +110,7 @@ while (<$contents_fh>) {
next unless ($pathname =~ m,\.so,);
next unless ($pathname =~ m,/lib,);
next unless ($pathname =~ m,/lib[^/]*\.so\b,);
- next unless ($type =~ /regular file|symbolic link/i);
+ next unless ($type =~ /regular file|symbolic link/i);
next unless ($status =~ /^\s*installed\s*$/);
$pathname = trim($pathname);
$link = trim($link);
@@ -216,7 +212,7 @@ sub do_pvs
next if ($path =~ /'/);
#
# quote the filename in case it has meta-characters
- # (which should never happen in all normal usage)
+ # (which should never happen in all normal usage)
#
$paths .= "'$path'";
$cnt++;
diff --git a/usr/src/cmd/init/Makefile b/usr/src/cmd/init/Makefile
index a644c8087a..6f16395082 100644
--- a/usr/src/cmd/init/Makefile
+++ b/usr/src/cmd/init/Makefile
@@ -24,6 +24,7 @@
# Use is subject to license terms.
#
# Copyright (c) 2018, Joyent, Inc.
+# Copyright 2020 Oxide Computer Company
PROG= init
OBJS= init.o
@@ -34,12 +35,17 @@ DEFAULTFILES= init.dfl
include ../Makefile.cmd
include ../Makefile.ctf
+OBJS = init.o bootbanner.o
CSTD = $(CSTD_GNU99)
LDLIBS += -lpam -lbsm -lcontract -lscf
CERRWARN += -_gcc=-Wno-parentheses
CERRWARN += $(CNOWARN_UNINIT)
-LINTFLAGS += -erroff=E_NAME_USED_NOT_DEF2
CLOBBERFILES= $(STATIC)
+CPPFLAGS += -DBOOTBANNER1='"$(BOOTBANNER1)"'
+CPPFLAGS += -DBOOTBANNER2='"$(BOOTBANNER2)"'
+CPPFLAGS += -DBOOTBANNER3='"$(BOOTBANNER3)"'
+CPPFLAGS += -DBOOTBANNER4='"$(BOOTBANNER4)"'
+CPPFLAGS += -DBOOTBANNER5='"$(BOOTBANNER5)"'
# needs work
SMATCH=off
@@ -62,15 +68,17 @@ install: all $(ROOTETCDEFAULTFILES) $(ROOTSBINPROG)
$(RM) $(ROOTETC)/TIMEZONE
cd $(ROOTETC); $(SYMLINK) default/init TIMEZONE
+$(PROG): $(OBJS)
+ $(LINK.c) $(OBJS) -o $@ $(LDLIBS)
+ $(POST_PROCESS)
+
+%.o: $(SRC)/common/bootbanner/%.c
+ $(COMPILE.c) $(OUTPUT_OPTION) $<
+ $(POST_PROCESS_O)
+
test:
rtest $(PROG)
clean:
-lint: lint_PROG
-
-%.o: %.c
- $(COMPILE.c) $<
- $(POST_PROCESS_O)
-
include ../Makefile.targ
diff --git a/usr/src/cmd/init/init.c b/usr/src/cmd/init/init.c
index b37322aa5c..86f717d54a 100644
--- a/usr/src/cmd/init/init.c
+++ b/usr/src/cmd/init/init.c
@@ -20,6 +20,7 @@
*/
/*
+ * Copyright 2020 Oxide Computer Company
* Copyright (c) 2013 Gary Mills
*
* Copyright (c) 1988, 2010, Oracle and/or its affiliates. All rights reserved.
@@ -100,6 +101,7 @@
#include <sys/tty.h>
#include <sys/types.h>
#include <sys/utsname.h>
+#include <sys/bootbanner.h>
#include <bsm/adt_event.h>
#include <bsm/libbsm.h>
@@ -605,6 +607,7 @@ static int startd_failure_rate_critical();
static char *audit_boot_msg();
static int audit_put_record(int, int, char *);
static void update_boot_archive(int new_state);
+static void init_bootbanner_print(const char *, uint_t);
int
main(int argc, char *argv[])
@@ -674,34 +677,33 @@ main(int argc, char *argv[])
st_init();
if (booting && print_banner) {
- struct utsname un;
- char buf[BUFSIZ], *isa;
- long ret;
- int bits = 32;
-
/*
* We want to print the boot banner as soon as
* possible. In the global zone, the kernel does it,
* but we do not have that luxury in non-global zones,
* so we will print it here.
*/
+#ifdef LEGACY_BANNER
+ struct utsname un;
+ char buf[BUFSIZ];
+ const char *bits;
+ int r;
+
(void) uname(&un);
- ret = sysinfo(SI_ISALIST, buf, sizeof (buf));
- if (ret != -1L && ret <= sizeof (buf)) {
- for (isa = strtok(buf, " "); isa;
- isa = strtok(NULL, " ")) {
- if (strcmp(isa, "sparcv9") == 0 ||
- strcmp(isa, "amd64") == 0) {
- bits = 64;
- break;
- }
- }
+ if ((r = sysinfo(SI_ADDRESS_WIDTH, buf, sizeof (buf))) > 0 &&
+ r < sizeof (buf)) {
+ bits = buf;
+ } else {
+ bits = "64";
}
console(B_FALSE,
- "\n\n%s Release %s Version %s %d-bit\r\n",
+ "\n\n%s Release %s Version %s %s-bit\r\n",
un.sysname, un.release, un.version, bits);
console(B_FALSE, "Copyright 2010-2020 Joyent, Inc.\r\n");
+#else
+ bootbanner_print(init_bootbanner_print, 0);
+#endif
}
/*
@@ -918,6 +920,14 @@ main(int argc, char *argv[])
}
static void
+init_bootbanner_print(const char *line, uint_t num)
+{
+ const char *pfx = (num == 0) ? "\n\n" : "";
+
+ console(B_FALSE, "%s%s\r\n", pfx, line);
+}
+
+static void
update_boot_archive(int new_state)
{
if (new_state != LVL0 && new_state != LVL5 && new_state != LVL6)
diff --git a/usr/src/cmd/sgs/crle/common/crle.msg b/usr/src/cmd/sgs/crle/common/crle.msg
index 12eb812309..6c9c0e999a 100644
--- a/usr/src/cmd/sgs/crle/common/crle.msg
+++ b/usr/src/cmd/sgs/crle/common/crle.msg
@@ -159,7 +159,7 @@
/usr/lib/secure/64 (system default)\n"
@ MSG_DEF_AOUTDLP " Default Library Path (AOUT):\t\
- /usr/4lib:/usr/lib:/usr/local/lib \
+ /usr/lib:/usr/local/lib \
(system default)\n"
@ MSG_DEF_AOUTNEWTD " Trusted Directories (AOUT):\t\
/lib/secure:/usr/lib/secure (system default)\n"
@@ -193,7 +193,7 @@
@ MSG_DMP_HEAD "\nConfiguration file [version %d]: %s %s\n"
@ MSG_DMP_PLATFORM " Platform:\t%s %s %s\n"
-@ MSG_DMP_APP " Specific application: %s (original: %s)\n"
+@ MSG_DMP_APP " Specific application: %s (original: %s)\n"
@ MSG_DMP_DLIBPTH " Default Library Path (%s):\t%s\n"
@ MSG_DMP_TLIBPTH " Trusted Directories (%s):\t%s\n"
@ MSG_DMP_RESV "\nMemory Reservation:\t%llx - %llx (%llx bytes)\n"
@@ -291,7 +291,7 @@
@ MSG_PTH_OLDTD_64 "/usr/lib/secure/64"
@ MSG_PTH_UPTD_64 "/lib/secure/64"
-@ MSG_PTH_AOUTDLP "/usr/4lib:/usr/lib:/usr/local/lib"
+@ MSG_PTH_AOUTDLP "/usr/lib:/usr/local/lib"
@ MSG_DIR_ROOT "/"
@ MSG_DIR_DOT "."
diff --git a/usr/src/cmd/sgs/rtld/common/a.out.c b/usr/src/cmd/sgs/rtld/common/a.out.c
index c7abfcab12..6ea37918ad 100644
--- a/usr/src/cmd/sgs/rtld/common/a.out.c
+++ b/usr/src/cmd/sgs/rtld/common/a.out.c
@@ -50,7 +50,6 @@
* Default and secure dependency search paths.
*/
static Spath_defn _aout_def_dirs[] = {
- { MSG_ORIG(MSG_PTH_USR4LIB), MSG_PTH_USR4LIB_SIZE },
{ MSG_ORIG(MSG_PTH_USRLIB), MSG_PTH_USRLIB_SIZE },
{ MSG_ORIG(MSG_PTH_USRLCLIB), MSG_PTH_USRLCLIB_SIZE },
{ 0, 0 }
diff --git a/usr/src/cmd/sgs/rtld/common/rtld.sparc32.msg b/usr/src/cmd/sgs/rtld/common/rtld.sparc32.msg
index 8f19af9390..99b623803d 100644
--- a/usr/src/cmd/sgs/rtld/common/rtld.sparc32.msg
+++ b/usr/src/cmd/sgs/rtld/common/rtld.sparc32.msg
@@ -48,7 +48,6 @@
@ MSG_FIL_LIB "lib"
@ MSG_PTH_USRLCLIB "/usr/local/lib"
-@ MSG_PTH_USR4LIB "/usr/4lib"
@ MSG_SYM_LAV8PLTENTER "la_sparcv8_pltenter"
diff --git a/usr/src/cmd/w/w.c b/usr/src/cmd/w/w.c
index f945415688..85b5726631 100644
--- a/usr/src/cmd/w/w.c
+++ b/usr/src/cmd/w/w.c
@@ -392,12 +392,8 @@ main(int argc, char *argv[])
dirfd = priv_proc_open(pname, O_RDONLY | O_DIRECTORY);
- if (dirfd < 0) {
- if (errno == ENOENT)
- continue;
- warn(gettext("failed to open %s"), pname);
+ if (dirfd < 0)
continue;
- }
procfd = priv_proc_openat(dirfd, "psinfo", O_RDONLY);
if (procfd < 0) {
diff --git a/usr/src/cmd/whodo/whodo.c b/usr/src/cmd/whodo/whodo.c
index 98abc0792d..6527aaf7c3 100644
--- a/usr/src/cmd/whodo/whodo.c
+++ b/usr/src/cmd/whodo/whodo.c
@@ -371,13 +371,8 @@ main(int argc, char *argv[])
dirfd = priv_proc_open(pname, O_RDONLY | O_DIRECTORY);
- if (dirfd < 0) {
- if (errno == ENOENT)
- continue;
- warn(gettext("failed to open %s"), pname);
+ if (dirfd < 0)
continue;
- }
-
procfd = priv_proc_openat(dirfd, "psinfo", O_RDONLY);
if (procfd < 0) {
diff --git a/usr/src/common/bootbanner/bootbanner.c b/usr/src/common/bootbanner/bootbanner.c
new file mode 100644
index 0000000000..90eccd8e0b
--- /dev/null
+++ b/usr/src/common/bootbanner/bootbanner.c
@@ -0,0 +1,354 @@
+/*
+ * 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 2020 Oxide Computer Company
+ */
+
+#ifdef _KERNEL
+#include <sys/types.h>
+#include <sys/sunddi.h>
+#else
+#include <stdio.h>
+#include <stdlib.h>
+#include <strings.h>
+#include <sys/utsname.h>
+#include <sys/systeminfo.h>
+#endif
+#include <sys/debug.h>
+
+/*
+ * Rendering of the boot banner, used on the system and zone consoles.
+ */
+
+typedef enum ilstr_errno {
+ ILSTR_ERROR_OK = 0,
+ ILSTR_ERROR_NOMEM,
+ ILSTR_ERROR_OVERFLOW,
+} ilstr_errno_t;
+
+typedef struct ilstr {
+ char *ils_data;
+ size_t ils_datalen;
+ size_t ils_strlen;
+ uint_t ils_errno;
+ int ils_kmflag;
+} ilstr_t;
+
+static void
+ilstr_init(ilstr_t *ils, int kmflag)
+{
+ bzero(ils, sizeof (*ils));
+ ils->ils_kmflag = kmflag;
+}
+
+static void
+ilstr_reset(ilstr_t *ils)
+{
+ if (ils->ils_strlen > 0) {
+ /*
+ * Truncate the string but do not free the buffer so that we
+ * can use it again without further allocation.
+ */
+ ils->ils_data[0] = '\0';
+ ils->ils_strlen = 0;
+ }
+ ils->ils_errno = ILSTR_ERROR_OK;
+}
+
+static void
+ilstr_fini(ilstr_t *ils)
+{
+ if (ils->ils_data != NULL) {
+#ifdef _KERNEL
+ kmem_free(ils->ils_data, ils->ils_datalen);
+#else
+ free(ils->ils_data);
+#endif
+ }
+}
+
+static void
+ilstr_append_str(ilstr_t *ils, const char *s)
+{
+ size_t len;
+ size_t chunksz = 64;
+
+ if (ils->ils_errno != ILSTR_ERROR_OK) {
+ return;
+ }
+
+ if ((len = strlen(s)) < 1) {
+ return;
+ }
+
+ /*
+ * Check to ensure that the new string length does not overflow,
+ * leaving room for the termination byte:
+ */
+ if (len >= SIZE_MAX - ils->ils_strlen - 1) {
+ ils->ils_errno = ILSTR_ERROR_OVERFLOW;
+ return;
+ }
+ size_t new_strlen = ils->ils_strlen + len;
+
+ if (new_strlen + 1 >= ils->ils_datalen) {
+ size_t new_datalen = ils->ils_datalen;
+ char *new_data;
+
+ /*
+ * Grow the string buffer to make room for the new string.
+ */
+ while (new_datalen < new_strlen + 1) {
+ if (chunksz >= SIZE_MAX - new_datalen) {
+ ils->ils_errno = ILSTR_ERROR_OVERFLOW;
+ return;
+ }
+ new_datalen += chunksz;
+ }
+
+#ifdef _KERNEL
+ new_data = kmem_alloc(new_datalen, ils->ils_kmflag);
+#else
+ new_data = malloc(new_datalen);
+#endif
+ if (new_data == NULL) {
+ ils->ils_errno = ILSTR_ERROR_NOMEM;
+ return;
+ }
+
+ if (ils->ils_data != NULL) {
+ bcopy(ils->ils_data, new_data, ils->ils_strlen + 1);
+#ifdef _KERNEL
+ kmem_free(ils->ils_data, ils->ils_datalen);
+#else
+ free(ils->ils_data);
+#endif
+ }
+
+ ils->ils_data = new_data;
+ ils->ils_datalen = new_datalen;
+ }
+
+ bcopy(s, ils->ils_data + ils->ils_strlen, len + 1);
+ ils->ils_strlen = new_strlen;
+}
+
+#ifdef _KERNEL
+static void
+ilstr_append_uint(ilstr_t *ils, uint_t n)
+{
+ char buf[64];
+
+ if (ils->ils_errno != ILSTR_ERROR_OK) {
+ return;
+ }
+
+ VERIFY3U(snprintf(buf, sizeof (buf), "%u", n), <, sizeof (buf));
+
+ ilstr_append_str(ils, buf);
+}
+#endif
+
+static void
+ilstr_append_char(ilstr_t *ils, char c)
+{
+ char buf[2];
+
+ if (ils->ils_errno != ILSTR_ERROR_OK) {
+ return;
+ }
+
+ buf[0] = c;
+ buf[1] = '\0';
+
+ ilstr_append_str(ils, buf);
+}
+
+static ilstr_errno_t
+ilstr_errno(ilstr_t *ils)
+{
+ return (ils->ils_errno);
+}
+
+static const char *
+ilstr_cstr(ilstr_t *ils)
+{
+ return (ils->ils_data);
+}
+
+static size_t
+ilstr_len(ilstr_t *ils)
+{
+ return (ils->ils_strlen);
+}
+
+static const char *
+ilstr_errstr(ilstr_t *ils)
+{
+ switch (ils->ils_errno) {
+ case ILSTR_ERROR_OK:
+ return ("ok");
+ case ILSTR_ERROR_NOMEM:
+ return ("could not allocate memory");
+ case ILSTR_ERROR_OVERFLOW:
+ return ("tried to construct too large a string");
+ default:
+ return ("unknown error");
+ }
+}
+
+/*
+ * Expand a boot banner template string. The following expansion tokens
+ * are supported:
+ *
+ * ^^ a literal caret
+ * ^s the base kernel name (utsname.sysname)
+ * ^o the operating system name ("illumos")
+ * ^v the operating system version (utsname.version)
+ * ^r the operating system release (utsname.release)
+ * ^w the native address width in bits (e.g., "32" or "64")
+ */
+static void
+bootbanner_expand_template(const char *input, ilstr_t *output)
+{
+ size_t pos = 0;
+ enum {
+ ST_REST,
+ ST_CARET,
+ } state = ST_REST;
+
+#ifndef _KERNEL
+ struct utsname utsname;
+ bzero(&utsname, sizeof (utsname));
+ (void) uname(&utsname);
+#endif
+
+ for (;;) {
+ char c = input[pos];
+
+ if (c == '\0') {
+ /*
+ * Even if the template came to an end mid way through
+ * a caret expansion, it seems best to just print what
+ * we have and drive on. The onus will be on the
+ * distributor to ensure their templates are
+ * well-formed at build time.
+ */
+ break;
+ }
+
+ switch (state) {
+ case ST_REST:
+ if (c == '^') {
+ state = ST_CARET;
+ } else {
+ ilstr_append_char(output, c);
+ }
+ pos++;
+ continue;
+
+ case ST_CARET:
+ if (c == '^') {
+ ilstr_append_char(output, c);
+ } else if (c == 's') {
+ ilstr_append_str(output, utsname.sysname);
+ } else if (c == 'o') {
+ ilstr_append_str(output, "illumos");
+ } else if (c == 'r') {
+ ilstr_append_str(output, utsname.release);
+ } else if (c == 'v') {
+ ilstr_append_str(output, utsname.version);
+ } else if (c == 'w') {
+#ifdef _KERNEL
+ ilstr_append_uint(output,
+ NBBY * (uint_t)sizeof (void *));
+#else
+ char *bits;
+ char buf[32];
+ int r;
+
+ if ((r = sysinfo(SI_ADDRESS_WIDTH, buf,
+ sizeof (buf))) > 0 &&
+ r < (int)sizeof (buf)) {
+ bits = buf;
+ } else {
+ bits = "64";
+ }
+
+ ilstr_append_str(output, bits);
+#endif
+ } else {
+ /*
+ * Try to make it obvious what went wrong:
+ */
+ ilstr_append_str(output, "!^");
+ ilstr_append_char(output, c);
+ ilstr_append_str(output, " UNKNOWN!");
+ }
+ state = ST_REST;
+ pos++;
+ continue;
+ }
+ }
+}
+
+static void
+bootbanner_print_one(ilstr_t *s, void (*printfunc)(const char *, uint_t),
+ const char *template, uint_t *nump)
+{
+ ilstr_reset(s);
+
+ bootbanner_expand_template(template, s);
+
+ if (ilstr_errno(s) == ILSTR_ERROR_OK) {
+ if (ilstr_len(s) > 0) {
+ printfunc(ilstr_cstr(s), *nump);
+ *nump += 1;
+ }
+ } else {
+ char ebuf[128];
+
+ snprintf(ebuf, sizeof (ebuf), "boot banner error: %s",
+ ilstr_errstr(s));
+
+ printfunc(ebuf, *nump);
+ *nump += 1;
+ }
+}
+
+/*
+ * This routine should be called during early system boot to render the boot
+ * banner on the system console, and during zone boot to do so on the zone
+ * console.
+ *
+ * The "printfunc" argument is a callback function. When passed a string, the
+ * function must print it in a fashion appropriate for the context. The
+ * callback will only be called while within the call to bootbanner_print().
+ * The "kmflag" value accepts the same values as kmem_alloc(9F) in the kernel,
+ * and is ignored otherwise.
+ */
+void
+bootbanner_print(void (*printfunc)(const char *, uint_t), int kmflag)
+{
+ ilstr_t s;
+ uint_t num = 0;
+
+ ilstr_init(&s, kmflag);
+
+ bootbanner_print_one(&s, printfunc, BOOTBANNER1, &num);
+ bootbanner_print_one(&s, printfunc, BOOTBANNER2, &num);
+ bootbanner_print_one(&s, printfunc, BOOTBANNER3, &num);
+ bootbanner_print_one(&s, printfunc, BOOTBANNER4, &num);
+ bootbanner_print_one(&s, printfunc, BOOTBANNER5, &num);
+
+ ilstr_fini(&s);
+}
diff --git a/usr/src/man/man1/crle.1 b/usr/src/man/man1/crle.1
index ecab0fa618..c6dabcf56f 100644
--- a/usr/src/man/man1/crle.1
+++ b/usr/src/man/man1/crle.1
@@ -3,11 +3,10 @@
.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
-.TH CRLE 1 "Oct 6, 2008"
+.TH CRLE 1 "Apr 15, 2020"
.SH NAME
crle \- configure runtime linking environment
.SH SYNOPSIS
-.LP
.nf
\fBcrle\fR [\fB-64\fR] [\fB-a\fR \fIname\fR] [\fB-A\fR \fIname\fR] [\fB-c\fR \fIconf\fR] [\fB-e\fR \fIenv\fR] [\fB-E\fR \fIenv\fR]
[\fB-f\fR \fIflags\fR] [\fB-i\fR \fIname\fR] [\fB-I\fR \fIname\fR] [\fB-g\fR \fIname\fR] [\fB-G\fR \fIname\fR]
@@ -15,7 +14,6 @@ crle \- configure runtime linking environment
.fi
.SH DESCRIPTION
-.LP
The \fBcrle\fR utility provides for the creation and display of a runtime
linking configuration file. The configuration file is read and interpreted by
the runtime linker, \fBld.so.1\fR(1), during process startup. The runtime
@@ -182,7 +180,6 @@ alternate object is created in the directory specified by the preceding
is created. The flags used by \fBdldump()\fR are specified using the \fB-f\fR
option, or default to \fBRTLD_REL_RELATIVE\fR.
.SH OPTIONS
-.LP
The following options are supported.
.sp
.ne 2
@@ -383,8 +380,8 @@ The default search paths for 32-bit \fBELF\fR objects are \fB/lib\fR followed
by \fB/usr/lib\fR. For 64-bit \fBELF\fR objects, the default search paths are
\fB/lib/64\fR followed by \fB/usr/lib/64\fR.
.sp
-The default search paths for \fBAOUT\fR objects are \fB/usr/4lib\fR, followed
-by \fB/usr/lib\fR and finally \fB/usr/local/lib\fR.
+The default search paths for \fBAOUT\fR objects are \fB/usr/lib\fR and
+\fB/usr/local/lib\fR.
.sp
Use of this option \fBreplaces\fR the default search path. Therefore, a
\fB-l\fR option is normally required to specify the original system default in
@@ -502,7 +499,6 @@ the \fBLD_CONFIG\fR environment variable. An alternative configuration file can
also be specified by recording the configuration file name in the application
at the time the application is built. See the \fB-c\fR option of \fBld\fR(1).
.SH EXAMPLES
-.LP
\fBExample 1 \fRExperimenting With a Temporary Configuration File
.sp
.LP
@@ -792,12 +788,10 @@ together with a permanent preload object which becomes appended to the process
environment definition.
.SH EXIT STATUS
-.LP
The creation or display of a configuration file results in a \fB0\fR being
returned. Otherwise, any error condition is accompanied with a diagnostic
message and a non-zero value being returned.
.SH NOTES
-.LP
The ability to tag an alternative application to use an application-specific
configuration file, is possible if the original application contains one of the
\fI\&.dynamic\fR tags \fBDT_FLAGS_1\fR or \fBDT_FEATURE_1\fR. Without these
@@ -914,7 +908,6 @@ Audit library that is employed to \fBdldump\fR(3C) 64-bit objects.
.RE
.SH ENVIRONMENT VARIABLES
-.LP
There are no environment variables that are referenced by \fBcrle\fR. However,
several environment variables affect the runtime linkers behavior in regard to
the processing of configuration files that are created by \fBcrle\fR.
@@ -969,7 +962,6 @@ Disable alternative object processing from a configuration file.
.RE
.SH ATTRIBUTES
-.LP
See \fBattributes\fR(5) for descriptions of the following attributes.
.sp
@@ -984,7 +976,6 @@ Interface Stability Committed
.TE
.SH SEE ALSO
-.LP
\fBfile\fR(1), \fBld\fR(1), \fBld.so.1\fR(1), \fBdldump\fR(3C),
\fBtempnam\fR(3C), \fBattributes\fR(5)
.sp
diff --git a/usr/src/man/man2/sysinfo.2 b/usr/src/man/man2/sysinfo.2
index fc85af6b0e..6815dbc229 100644
--- a/usr/src/man/man2/sysinfo.2
+++ b/usr/src/man/man2/sysinfo.2
@@ -4,7 +4,7 @@
.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
-.TH SYSINFO 2 "Sep 7, 2015"
+.TH SYSINFO 2 "Apr 27, 2020"
.SH NAME
sysinfo \- get and set system information strings
.SH SYNOPSIS
@@ -177,6 +177,18 @@ compilation system.
.sp
.ne 2
.na
+\fB\fBSI_ADDRESS_WIDTH\fR\fR
+.ad
+.sp .6
+.RS 4n
+Copy into the array pointed to by \fIbuf\fR a string describing the number
+of bits in the address space of the native instruction set; e.g., \fB32\fR
+or \fB64\fR.
+.RE
+
+.sp
+.ne 2
+.na
\fB\fBSI_ISALIST\fR\fR
.ad
.sp .6
diff --git a/usr/src/man/man5/filesystem.5 b/usr/src/man/man5/filesystem.5
index f0420111c4..8b4cd14157 100644
--- a/usr/src/man/man5/filesystem.5
+++ b/usr/src/man/man5/filesystem.5
@@ -20,11 +20,10 @@
.\" Copyright 2016 Nexenta Systems, Inc.
.\" Copyright 2017 Peter Tribble
.\"
-.TH FILESYSTEM 5 "Nov 26, 2017"
+.TH FILESYSTEM 5 "Apr 15, 2020"
.SH NAME
filesystem \- File system organization
.SH SYNOPSIS
-.LP
.nf
/
.fi
@@ -35,7 +34,6 @@ filesystem \- File system organization
.fi
.SH DESCRIPTION
-.LP
The file system tree is organized for administrative convenience. Distinct
areas within the file system tree are provided for files that are private to
one machine, files that can be shared by multiple machines of a common
@@ -85,7 +83,6 @@ the \fBplatform-specific\fR file is installed only on a subset of supported
platforms. Most platform-specific files are gathered under \fB/platform\fR and
\fB/usr/platform\fR.
.SS "Root File System"
-.LP
The root file system contains files that are unique to each machine. It
contains the following directories:
.sp
@@ -1544,7 +1541,6 @@ Databases used by \fBNIS\fR and \fBypbind\fR(1M).
.RE
.SS "\fB/usr\fR File System"
-.LP
Because it is desirable to keep the root file system small and not volatile, on
disk-based systems larger file systems are often mounted on \fB/home\fR,
\fB/opt\fR, \fB/usr\fR, and \fB/var\fR.
@@ -1566,16 +1562,6 @@ The \fB/usr\fR file system contains the following subdirectories:
.sp
.ne 2
.na
-\fB\fB/usr/4lib\fR\fR
-.ad
-.sp .6
-.RS 4n
-\fBa.out\fR libraries for the Binary Compatibility Package.
-.RE
-
-.sp
-.ne 2
-.na
\fB\fB/usr/5bin\fR\fR
.ad
.sp .6
@@ -2951,7 +2937,6 @@ Directory for newer versions of POSIX-compliant utilities.
.RE
.SH SEE ALSO
-.LP
\fBat\fR(1), \fBex\fR(1), \fBiconv\fR(1), \fBlp\fR(1),
\fBisainfo\fR(1), \fBmail\fR(1), \fBmailx\fR(1), \fBnroff\fR(1),
\fBpriocntl\fR(1), \fBrefer\fR(1), \fBsar\fR(1), \fBsh\fR(1), \fBspell\fR(1),
diff --git a/usr/src/tools/scripts/bldenv b/usr/src/tools/scripts/bldenv
index 85999e5b77..69f74d89de 100755
--- a/usr/src/tools/scripts/bldenv
+++ b/usr/src/tools/scripts/bldenv
@@ -25,6 +25,7 @@
# Copyright 2011 Nexenta Systems, Inc. All rights reserved.
# Copyright 2014 Garrett D'Amore <garrett@damore.org>
# Copyright 2020 Joyent, Inc.
+# Copyright 2020 Oxide Computer Company
#
# Uses supplied "env" file, based on /opt/onbld/etc/env, to set shell variables
# before spawning a shell for doing a release-style builds interactively
@@ -247,14 +248,20 @@ if [ "${flags.d_set}" != "true" ] && "${flags.DF_build}"; then
fi
POUND_SIGN="#"
+basews=$(basename -- "$CODEMGR_WS")
# have we set RELEASE_DATE in our env file?
if [ -z "$RELEASE_DATE" ]; then
RELEASE_DATE=$(LC_ALL=C date +"%B %Y")
fi
-BUILD_DATE=$(LC_ALL=C date +%Y-%b-%d)
-BASEWSDIR=$(basename -- "${CODEMGR_WS}")
-DEV_CM="\"@(#)SunOS Internal Development: $LOGNAME $BUILD_DATE [$BASEWSDIR]\""
-export DEV_CM RELEASE_DATE POUND_SIGN
+now=$(LC_ALL=C date +%Y-%b-%d)
+DEV_CM_TAIL="development build: $LOGNAME $now [$basews]"
+
+#
+# We export POUND_SIGN, RELEASE_DATE and DEV_CM_TAIL to speed up the build
+# process by avoiding repeated shell invocations to evaluate Makefile.master
+# definitions.
+#
+export POUND_SIGN RELEASE_DATE DEV_CM_TAIL
print 'Build type is \c'
if ${flags.d} ; then
diff --git a/usr/src/tools/scripts/check_rtime.pl b/usr/src/tools/scripts/check_rtime.pl
index f456ea4cbc..ebd49a79bb 100644
--- a/usr/src/tools/scripts/check_rtime.pl
+++ b/usr/src/tools/scripts/check_rtime.pl
@@ -22,6 +22,7 @@
#
# Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright 2020 Oxide Computer Company
#
#
@@ -147,7 +148,7 @@ use vars qw($EXRE_exec_data $EXRE_exec_stack $EXRE_nocrlealt);
use vars qw($EXRE_nodirect $EXRE_nosymsort $EXRE_forbidden_dep $EXRE_forbidden);
use vars qw($EXRE_olddep $EXRE_skip $EXRE_stab $EXRE_textrel $EXRE_undef_ref);
use vars qw($EXRE_unref_obj $EXRE_unused_deps $EXRE_unused_obj);
-use vars qw($EXRE_unused_rpath);
+use vars qw($EXRE_unused_rpath $EXRE_no_comment);
use strict;
use Getopt::Std;
@@ -279,11 +280,12 @@ sub ProcFile {
# Determine whether this ELF executable or shared object has a
# conforming mcs(1) comment section. If the correct $(POST_PROCESS)
# macros are used, only a 3 or 4 line .comment section should exist
- # containing one or two "@(#)SunOS" identifying comments (one comment
+ # containing one or two "@(#)illumos" identifying comments (one comment
# for a non-debug build, and two for a debug build). The results of
# the following split should be three or four lines, the last empty
# line being discarded by the split.
- if ($opt{m}) {
+ if ($opt{m} &&
+ (!defined($EXRE_no_comment) || ($RelPath !~ $EXRE_no_comment))) {
my(@Mcs, $Con, $Dev);
@Mcs = split(/\n/, `mcs -p $FullPath 2>&1`);
@@ -292,11 +294,11 @@ sub ProcFile {
foreach my $Line (@Mcs) {
$Val++;
- if (($Val == 3) && ($Line !~ /^@\(#\)SunOS/)) {
+ if (($Val == 3) && ($Line !~ /^@\(#\)illumos/)) {
$Con = 1;
last;
}
- if (($Val == 4) && ($Line =~ /^@\(#\)SunOS/)) {
+ if (($Val == 4) && ($Line =~ /^@\(#\)illumos/)) {
$Dev = 1;
next;
}
diff --git a/usr/src/tools/scripts/nightly b/usr/src/tools/scripts/nightly
index 489f63b897..f6b536c924 100755
--- a/usr/src/tools/scripts/nightly
+++ b/usr/src/tools/scripts/nightly
@@ -29,6 +29,7 @@
# Copyright 2020 Joyent, Inc.
# Copyright 2018 OmniOS Community Edition (OmniOSce) Association.
# Copyright 2019 Peter Trible.
+# Copyright 2020 Oxide Computer Company
#
# Based on the nightly script from the integration folks,
# Mostly modified and owned by mike_s.
@@ -804,18 +805,20 @@ abssrcdirs="$SRC"
PROTOCMPTERSE="protocmp.terse -gu"
POUND_SIGN="#"
+basews="$(basename "$CODEMGR_WS")"
# have we set RELEASE_DATE in our env file?
if [ -z "$RELEASE_DATE" ]; then
RELEASE_DATE=$(LC_ALL=C date +"%B %Y")
fi
-BUILD_DATE=$(LC_ALL=C date +%Y-%b-%d)
-BASEWSDIR=$(basename $CODEMGR_WS)
-DEV_CM="\"@(#)SunOS Internal Development: $LOGNAME $BUILD_DATE [$BASEWSDIR]\""
+now=$(LC_ALL=C date +%Y-%b-%d)
+DEV_CM_TAIL="development build: $LOGNAME $now [$basews]"
-# we export POUND_SIGN, RELEASE_DATE and DEV_CM to speed up the build process
-# by avoiding repeated shell invocations to evaluate Makefile.master
+#
+# We export POUND_SIGN, RELEASE_DATE and DEV_CM_TAIL to speed up the build
+# process by avoiding repeated shell invocations to evaluate Makefile.master
# definitions.
-export POUND_SIGN RELEASE_DATE DEV_CM
+#
+export POUND_SIGN RELEASE_DATE DEV_CM_TAIL
maketype="distributed"
if [[ -z "$MAKE" ]]; then
@@ -1027,9 +1030,9 @@ function logshuffle {
cat $build_time_file $build_environ_file $mail_msg_file \
> ${LLOG}/mail_msg
if [ "$m_FLAG" = "y" ]; then
- cat ${LLOG}/mail_msg | /usr/bin/mailx ${mailx_r} -s \
- "Nightly ${MACH} Build of `basename ${CODEMGR_WS}` ${state}." \
- ${MAILTO}
+ /usr/bin/mailx ${mailx_r} -s \
+ "Nightly ${MACH} Build of ${basews} ${state}." \
+ "${MAILTO}" < "${LLOG}/mail_msg"
fi
if [ "$u_FLAG" = "y" -a "$build_ok" = "y" ]; then
@@ -1086,7 +1089,6 @@ function create_lock {
eval $lockvar=$lockf
while ! staffer ln -s $hostname.$STAFFER.$$ $lockf 2> /dev/null; do
- basews=`basename $CODEMGR_WS`
ls -l $lockf | nawk '{print $NF}' | IFS=. read host user pid
if [ "$host" != "$hostname" ]; then
echo "$MACH build of $basews apparently" \
diff --git a/usr/src/ucbcmd/Makefile.ucbcmd b/usr/src/ucbcmd/Makefile.ucbcmd
index d8d43c44d2..47cf585440 100644
--- a/usr/src/ucbcmd/Makefile.ucbcmd
+++ b/usr/src/ucbcmd/Makefile.ucbcmd
@@ -44,7 +44,6 @@ FILEMODE= 0555
LIBFILEMODE= 0444
ROOTBIN= $(ROOT)/usr/ucb
ROOTLIB= $(ROOT)/usr/ucblib
-ROOT4LIB= $(ROOT)/usr/4lib
ROOTETC= $(ROOT)/etc
ROOTSHLIB= $(ROOT)/usr/share/lib
ROOTBIN32= $(ROOTBIN)/$(MACH32)
@@ -52,7 +51,6 @@ ROOTBIN64= $(ROOTBIN)/$(MACH64)
ROOTPROG= $(PROG:%=$(ROOTBIN)/%)
ROOTLIBPROG= $(PROG:%=$(ROOTLIB)/%)
-ROOT4LIBPROG= $(PROG:%=$(ROOT4LIB)/%)
ROOTETCPROG= $(PROG:%=$(ROOTETC)/%)
ROOTPROG64= $(PROG:%=$(ROOTBIN64)/%)
ROOTPROG32= $(PROG:%=$(ROOTBIN32)/%)
@@ -79,9 +77,6 @@ $(ROOTBIN)/%: %
$(ROOTLIB)/%: %
$(INS.file)
-$(ROOT4LIB)/%: %
- $(INS.file)
-
$(ROOTETC)/%: %
$(INS.file)
diff --git a/usr/src/uts/common/Makefile.files b/usr/src/uts/common/Makefile.files
index ce7b7a3e6a..720701371d 100644
--- a/usr/src/uts/common/Makefile.files
+++ b/usr/src/uts/common/Makefile.files
@@ -110,6 +110,7 @@ GENUNIX_OBJS += \
bio.o \
bitmap.o \
blabel.o \
+ bootbanner.o \
brandsys.o \
bz2blocksort.o \
bz2compress.o \
diff --git a/usr/src/uts/common/Makefile.rules b/usr/src/uts/common/Makefile.rules
index 8a906a2e25..bb80ca63c4 100644
--- a/usr/src/uts/common/Makefile.rules
+++ b/usr/src/uts/common/Makefile.rules
@@ -26,6 +26,7 @@
# Copyright 2020 Joyent, Inc.
# Copyright 2018 Nexenta Systems, Inc.
# Copyright (c) 2017 by Delphix. All rights reserved.
+# Copyright 2020 Oxide Computer Company
#
#
@@ -1563,6 +1564,10 @@ $(OBJS_DIR)/%.o: $(UTSBASE)/common/krtld/%.c
$(COMPILE.c) -o $@ $<
$(CTFCONVERT_O)
+$(OBJS_DIR)/%.o: $(COMMONBASE)/bootbanner/%.c
+ $(COMPILE.c) -o $@ $<
+ $(CTFCONVERT_O)
+
$(OBJS_DIR)/%.o: $(COMMONBASE)/list/%.c
$(COMPILE.c) -o $@ $<
$(CTFCONVERT_O)
@@ -1591,6 +1596,13 @@ $(OBJS_DIR)/%.o: $(COMMONBASE)/refhash/%.c
$(COMPILE.c) -o $@ $<
$(CTFCONVERT_O)
+$(OBJS_DIR)/bootbanner.o := CPPFLAGS += \
+ -DBOOTBANNER1='"$(BOOTBANNER1)"' \
+ -DBOOTBANNER2='"$(BOOTBANNER2)"' \
+ -DBOOTBANNER3='"$(BOOTBANNER3)"' \
+ -DBOOTBANNER4='"$(BOOTBANNER4)"' \
+ -DBOOTBANNER5='"$(BOOTBANNER5)"'
+
$(OBJS_DIR)/%.o: $(UTSBASE)/common/os/%.c
$(COMPILE.c) -o $@ $<
$(CTFCONVERT_O)
diff --git a/usr/src/uts/common/io/cmlb.c b/usr/src/uts/common/io/cmlb.c
index 6275948465..f4ae9f3ed5 100644
--- a/usr/src/uts/common/io/cmlb.c
+++ b/usr/src/uts/common/io/cmlb.c
@@ -1514,7 +1514,7 @@ cmlb_create_minor_nodes(struct cmlb_lun *cl)
if (cl->cl_alter_behavior & CMLB_CREATE_P0_MINOR_NODE) {
if (cmlb_create_minor(CMLB_DEVINFO(cl), "q", S_IFBLK,
(instance << CMLBUNIT_FORCE_P0_SHIFT) | P0_RAW_DISK,
- cl->cl_node_type, NULL, internal) == DDI_FAILURE) {
+ cl->cl_node_type, 0, internal) == DDI_FAILURE) {
ddi_remove_minor_node(CMLB_DEVINFO(cl), NULL);
return (ENXIO);
}
@@ -1522,7 +1522,7 @@ cmlb_create_minor_nodes(struct cmlb_lun *cl)
if (cmlb_create_minor(CMLB_DEVINFO(cl), "q,raw",
S_IFCHR,
(instance << CMLBUNIT_FORCE_P0_SHIFT) | P0_RAW_DISK,
- cl->cl_node_type, NULL, internal) == DDI_FAILURE) {
+ cl->cl_node_type, 0, internal) == DDI_FAILURE) {
ddi_remove_minor_node(CMLB_DEVINFO(cl), NULL);
return (ENXIO);
}
diff --git a/usr/src/uts/common/os/logsubr.c b/usr/src/uts/common/os/logsubr.c
index 9e58a7bb56..2543bdf17e 100644
--- a/usr/src/uts/common/os/logsubr.c
+++ b/usr/src/uts/common/os/logsubr.c
@@ -20,6 +20,7 @@
*/
/*
+ * Copyright 2020 Oxide Computer Company
* Copyright (c) 2013 Gary Mills
* Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright 2020 Joyent, Inc.
@@ -43,6 +44,7 @@
#include <sys/utsname.h>
#include <sys/id_space.h>
#include <sys/zone.h>
+#include <sys/bootbanner.h>
log_zone_t log_global;
queue_t *log_consq;
@@ -182,6 +184,14 @@ log_zonefree(zoneid_t zoneid, void *arg)
kmem_free(lzp, sizeof (log_zone_t));
}
+static void
+log_bootbanner_print(const char *line, uint_t num)
+{
+ const char *pfx = (num == 0) ? "\r" : "";
+
+ printf("%s%s\n", pfx, line);
+}
+
void
log_init(void)
{
@@ -246,11 +256,15 @@ log_init(void)
log_update(&log_backlog, log_backlogq, SL_CONSOLE, log_console);
/*
- * Now that logging is enabled, emit the SunOS banner.
+ * Now that logging is enabled, emit the boot banner.
*/
+#ifdef LEGACY_BANNER
printf("\rSunOS Release %s Version %s %u-bit\n",
utsname.release, utsname.version, NBBY * (uint_t)sizeof (void *));
printf("Copyright 2010-2020 Joyent, Inc.\n");
+#else
+ bootbanner_print(log_bootbanner_print, KM_SLEEP);
+#endif
#ifdef DEBUG
printf("DEBUG enabled\n");
#endif
diff --git a/usr/src/uts/common/sys/Makefile b/usr/src/uts/common/sys/Makefile
index 3664f0096b..24fdd94c11 100644
--- a/usr/src/uts/common/sys/Makefile
+++ b/usr/src/uts/common/sys/Makefile
@@ -96,6 +96,7 @@ CHKHDRS= \
bofi.h \
bofi_impl.h \
bpp_io.h \
+ bootbanner.h \
bootstat.h \
brand.h \
buf.h \
diff --git a/usr/src/uts/common/sys/bootbanner.h b/usr/src/uts/common/sys/bootbanner.h
new file mode 100644
index 0000000000..93ba1b9e79
--- /dev/null
+++ b/usr/src/uts/common/sys/bootbanner.h
@@ -0,0 +1,33 @@
+/*
+ * 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 2020 Oxide Computer Company
+ */
+
+#ifndef _SYS_BOOTBANNER_H
+#define _SYS_BOOTBANNER_H
+
+/*
+ * Rendering of the boot banner, used on the system and zone consoles.
+ */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+extern void bootbanner_print(void (*)(const char *, uint_t), int kmflag);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _SYS_BOOTBANNER_H */
diff --git a/usr/src/uts/common/sys/systeminfo.h b/usr/src/uts/common/sys/systeminfo.h
index a664a19b9e..951d799a70 100644
--- a/usr/src/uts/common/sys/systeminfo.h
+++ b/usr/src/uts/common/sys/systeminfo.h
@@ -21,6 +21,7 @@
/*
* Copyright 2014 Garrett D'Amore <garrett@damore.org>
* Copyright 2017 RackTop Systems.
+ * Copyright 2020 Oxide Computer Company
*
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
@@ -56,8 +57,8 @@ extern char platform[];
* 257 - 512 Unix International assigned numbers for `set' style commands
* where the value is selected to be the value for the
* corresponding `get' command plus 256.
- * 513 - 768 Solaris specific `get' style commands.
- * 769 - 1024 Solaris specific `set' style commands where the value is
+ * 513 - 768 illumos-defined `get' style commands.
+ * 769 - 1024 illumos-defined `set' style commands where the value is
* selected to be the value for the corresponding `get' command
* plus 256.
*
@@ -69,7 +70,7 @@ extern char platform[];
/* UI defined `get' commands (1-256) */
#define SI_SYSNAME 1 /* return name of operating system */
#define SI_HOSTNAME 2 /* return name of node */
-#define SI_RELEASE 3 /* return release of operating system */
+#define SI_RELEASE 3 /* return release of operating system */
#define SI_VERSION 4 /* return version field of utsname */
#define SI_MACHINE 5 /* return kind of machine */
#define SI_ARCHITECTURE 6 /* return instruction set arch */
@@ -81,7 +82,7 @@ extern char platform[];
#define SI_SET_HOSTNAME 258 /* set name of node */
#define SI_SET_SRPC_DOMAIN 265 /* set secure RPC domain */
-/* Solaris defined `get' commands (513-768) */
+/* illumos-defined `get' commands (513-768) */
#define SI_PLATFORM 513 /* return platform identifier */
#define SI_ISALIST 514 /* return supported isa list */
#define SI_DHCP_CACHE 515 /* return kernel-cached DHCPACK */
@@ -89,8 +90,9 @@ extern char platform[];
#define SI_ARCHITECTURE_64 517 /* basic 64-bit SI_ARCHITECTURE */
#define SI_ARCHITECTURE_K 518 /* kernel SI_ARCHITECTURE equivalent */
#define SI_ARCHITECTURE_NATIVE 519 /* SI_ARCHITECTURE of the caller */
+#define SI_ADDRESS_WIDTH 520 /* number of bits in native address */
-/* Solaris defined `set' commands (769-1024) (none currently assigned) */
+/* illumos-defined `set' commands (769-1024) (none currently assigned) */
#define HW_INVALID_HOSTID 0xFFFFFFFF /* an invalid hostid */
diff --git a/usr/src/uts/common/syscall/systeminfo.c b/usr/src/uts/common/syscall/systeminfo.c
index 21b5ac08ba..00d11e5aba 100644
--- a/usr/src/uts/common/syscall/systeminfo.c
+++ b/usr/src/uts/common/syscall/systeminfo.c
@@ -19,6 +19,7 @@
* CDDL HEADER END
*/
/*
+ * Copyright 2020 Oxide Computer Company
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
@@ -26,6 +27,7 @@
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
/* All rights reserved. */
+
#include <sys/param.h>
#include <sys/types.h>
#include <sys/sysmacros.h>
@@ -81,6 +83,9 @@ systeminfo(int command, char *buf, long count)
kstr = utsname.machine;
break;
#ifdef _LP64
+ case SI_ADDRESS_WIDTH:
+ kstr = "64";
+ break;
case SI_ARCHITECTURE_64:
case SI_ARCHITECTURE_K:
kstr = architecture;
@@ -94,6 +99,9 @@ systeminfo(int command, char *buf, long count)
architecture : architecture_32;
break;
#else
+ case SI_ADDRESS_WIDTH:
+ kstr = "32";
+ break;
case SI_ARCHITECTURE_K:
case SI_ARCHITECTURE_32:
case SI_ARCHITECTURE: