summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJerry Jelinek <jerry.jelinek@joyent.com>2020-06-03 11:38:44 +0000
committerJerry Jelinek <jerry.jelinek@joyent.com>2020-06-03 11:38:44 +0000
commit1c5ac86169ba0e28b070d8b7f6c787be64bce7e4 (patch)
tree984f229706437e50b866d25cd3aced33f9358a5f
parented13e9ae4cee8abfe808486d0e0d7ee69b8fc256 (diff)
parentd15d17d4231f87f1571fa6d585377206f360f667 (diff)
downloadillumos-joyent-1c5ac86169ba0e28b070d8b7f6c787be64bce7e4.tar.gz
[illumos-gate merge]
commit d15d17d4231f87f1571fa6d585377206f360f667 12786 fix CTF pointer overrun commit 8fff788790878e3c95666decd46960ecc74c1c69 12721 would like svcadm disable -c commit 87be0d9605ee884229638b6fd168fa7165e109a3 12813 pptadm and libppt are x86 only commit 069e6b7e31ba5dcbc5441b98af272714d9a5455c 12708 Packages could be linted 12717 Stop ignoring pkgdepend errors commit 605d010da59abaf92279a7caed83515cbb3218dc 7510 enable highres clock usage for non-privileged users Conflicts: usr/src/man/man3c/timer_settime.3c
-rw-r--r--exception_lists/packaging.deps52
-rw-r--r--usr/src/cmd/Makefile2
-rw-r--r--usr/src/cmd/svc/startd/libscf.c10
-rw-r--r--usr/src/cmd/svc/svcadm/svcadm.c305
-rw-r--r--usr/src/cmd/svc/svccfg/svccfg_libscf.c4
-rw-r--r--usr/src/cmd/svc/svcs/explain.c43
-rw-r--r--usr/src/cmd/svc/svcs/svcs.c29
-rw-r--r--usr/src/cmd/svc/svcs/svcs.h8
-rw-r--r--usr/src/common/ctf/ctf_lookup.c3
-rw-r--r--usr/src/lib/Makefile4
-rw-r--r--usr/src/lib/libscf/common/mapfile-vers6
-rw-r--r--usr/src/lib/libscf/common/midlevel.c115
-rw-r--r--usr/src/lib/libscf/inc/libscf.h7
-rw-r--r--usr/src/man/man1/svcs.123
-rw-r--r--usr/src/man/man1m/svcadm.1m23
-rw-r--r--usr/src/man/man3c/timer_create.3c6
-rw-r--r--usr/src/man/man3c/timer_settime.3c11
-rw-r--r--usr/src/man/man3scf/Makefile51
-rw-r--r--usr/src/man/man3scf/smf_enable_instance.3scf44
-rw-r--r--usr/src/pkg/Makefile65
-rw-r--r--usr/src/pkg/etc/pkglintrc26
-rw-r--r--usr/src/pkg/manifests/consolidation-l10n-l10n-incorporation.mf2
-rw-r--r--usr/src/pkg/manifests/consolidation-sunpro-sunpro-incorporation.mf2
-rw-r--r--usr/src/pkg/manifests/developer-build-onbld.mf25
-rw-r--r--usr/src/pkg/manifests/driver-xvm-pv.mf5
-rw-r--r--usr/src/pkg/manifests/system-kernel-platform.mf7
-rw-r--r--usr/src/pkg/manifests/system-library-libpcsc.mf2
-rw-r--r--usr/src/pkg/manifests/system-library-libutempter.mf2
-rw-r--r--usr/src/pkg/manifests/system-library-math.mf3
-rw-r--r--usr/src/pkg/manifests/system-library-python-libbe-2.mf4
-rw-r--r--usr/src/pkg/manifests/system-library-python-libbe-3.mf4
-rw-r--r--usr/src/pkg/manifests/system-library-python-solaris-2.mf4
-rw-r--r--usr/src/pkg/manifests/system-library-python-solaris-3.mf4
-rw-r--r--usr/src/pkg/manifests/system-library-python-zfs-2.mf4
-rw-r--r--usr/src/pkg/manifests/system-library-python-zfs-3.mf4
-rw-r--r--usr/src/pkg/manifests/system-library.man3scf.inc3
-rw-r--r--usr/src/pkg/manifests/system-microcode-amd.mf4
-rw-r--r--usr/src/pkg/manifests/system-microcode-intel.mf2
-rw-r--r--usr/src/pkg/manifests/system-test-testrunner.mf5
-rw-r--r--usr/src/pkg/osnet-incorporation.mf3
-rw-r--r--usr/src/pkg/osnet-redist.mf3
-rw-r--r--usr/src/pkg/transforms/strip_dependinfo29
-rwxr-xr-xusr/src/tools/scripts/nightly38
-rw-r--r--usr/src/tools/scripts/nightly.1onbld23
-rw-r--r--usr/src/uts/common/os/clock_highres.c2
-rw-r--r--usr/src/uts/intel/ipd/Makefile3
-rw-r--r--usr/src/uts/sparc/ipd/Makefile3
47 files changed, 730 insertions, 297 deletions
diff --git a/exception_lists/packaging.deps b/exception_lists/packaging.deps
new file mode 100644
index 0000000000..4df18a2f46
--- /dev/null
+++ b/exception_lists/packaging.deps
@@ -0,0 +1,52 @@
+#
+# This is a list of external dependencies referenced by packages in gate
+# which are expected to be provided by the distribution.
+#
+# These are ignored during package lint runs.
+#
+pkg:/data/docbook
+pkg:/developer/gnu-binutils
+pkg:/developer/java/jdk
+pkg:/developer/java/openjdk8
+pkg:/developer/lexer/flex
+pkg:/developer/macro/cpp
+pkg:/developer/macro/gnu-m4
+pkg:/developer/parser/bison
+pkg:/developer/versioning/mercurial
+pkg:/gnome/zenity
+pkg:/library/expat
+pkg:/library/glib2
+pkg:/library/libxml2
+pkg:/library/libxslt
+pkg:/library/nspr
+pkg:/library/nspr/header-nspr
+pkg:/library/perl-5/xml-parser
+pkg:/library/security/openssl
+pkg:/library/security/trousers
+pkg:/library/zlib
+pkg:/package/pkg
+pkg:/print/cups
+pkg:/print/filter/ghostscript
+pkg:/release/name
+pkg:/runtime/java
+pkg:/runtime/java/openjdk8
+pkg:/runtime/java/runtime64
+pkg:/security/sudo
+pkg:/shell/bash
+pkg:/shell/expect
+pkg:/system/bhyve/firmware
+pkg:/system/library/dbus
+pkg:/system/library/g++-7-runtime
+pkg:/system/library/g++-runtime
+pkg:/system/library/gcc-7-runtime
+pkg:/system/library/gcc-runtime
+pkg:/system/library/libdbus
+pkg:/system/library/libdbus-glib
+pkg:/system/library/mozilla-nss
+pkg:/system/library/mozilla-nss/header-nss
+pkg:/system/management/snmp/net-snmp
+pkg:/system/test/fio
+pkg:/system/xvm/xvmstore
+pkg:/text/gnu-gettext
+pkg:/text/less
+pkg:/web/wget
diff --git a/usr/src/cmd/Makefile b/usr/src/cmd/Makefile
index acb3717b0a..6d6276c70d 100644
--- a/usr/src/cmd/Makefile
+++ b/usr/src/cmd/Makefile
@@ -322,7 +322,6 @@ COMMON_SUBDIRS= \
ppgsz \
pg \
plockstat \
- pptadm \
pr \
prctl \
printf \
@@ -495,6 +494,7 @@ i386_SUBDIRS= \
cxgbetool \
diskscan \
nvmeadm \
+ pptadm \
rdmsr \
rtc \
ucodeadm \
diff --git a/usr/src/cmd/svc/startd/libscf.c b/usr/src/cmd/svc/startd/libscf.c
index c4a3b20117..fe54b500b6 100644
--- a/usr/src/cmd/svc/startd/libscf.c
+++ b/usr/src/cmd/svc/startd/libscf.c
@@ -22,6 +22,7 @@
/*
* Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright 2012 Milan Jurik. All rights reserved.
+ * Copyright 2020 Joyent, Inc.
*/
@@ -1681,13 +1682,20 @@ libscf_set_deathrow(scf_instance_t *inst, int deathrow)
}
/*
+ * Since we're clearing the over-ridden enabled state for the service, we'll
+ * also take the opportunity to remove any comment.
+ *
* Returns 0, ECONNABORTED, ECANCELED, or EPERM.
*/
int
libscf_delete_enable_ovr(scf_instance_t *inst)
{
+ int r = scf_instance_delete_prop(inst, SCF_PG_GENERAL_OVR,
+ SCF_PROPERTY_ENABLED);
+ if (r != 0)
+ return (r);
return (scf_instance_delete_prop(inst, SCF_PG_GENERAL_OVR,
- SCF_PROPERTY_ENABLED));
+ SCF_PROPERTY_COMMENT));
}
/*
diff --git a/usr/src/cmd/svc/svcadm/svcadm.c b/usr/src/cmd/svc/svcadm/svcadm.c
index b51d218f45..c5a046565f 100644
--- a/usr/src/cmd/svc/svcadm/svcadm.c
+++ b/usr/src/cmd/svc/svcadm/svcadm.c
@@ -24,7 +24,7 @@
*/
/*
- * Copyright 2015, Joyent, Inc. All rights reserved.
+ * Copyright 2020, Joyent, Inc. All rights reserved.
*/
/*
@@ -82,6 +82,19 @@ struct ht_elt {
};
+/*
+ * Callback data for enable/disable.
+ */
+#define SET_ENABLED 0x1
+#define SET_TEMPORARY 0x2
+#define SET_RECURSIVE 0x4
+
+typedef struct {
+ char ed_comment[SCF_COMMENT_MAX_LENGTH];
+ int ed_flags;
+} enable_data_t;
+
+
scf_handle_t *h;
ssize_t max_scf_fmri_sz;
static const char *emsg_permission_denied;
@@ -146,7 +159,7 @@ usage()
(void) fprintf(stderr, gettext(
"Usage: %1$s [-S <state>] [-v] [-Z | -z zone] [cmd [args ... ]]\n\n"
"\t%1$s enable [-rst] [<service> ...]\t- enable and online service(s)\n"
- "\t%1$s disable [-st] [<service> ...]\t- disable and offline "
+ "\t%1$s disable [-c comment] [-st] [<service> ...] - disable "
"service(s)\n"
"\t%1$s restart [-d] [<service> ...]\t- restart specified service(s)\n"
"\t%1$s refresh [<service> ...]\t\t- re-read service configuration\n"
@@ -567,20 +580,150 @@ out:
return (ret);
}
+static int
+delete_prop(const char *fmri, scf_instance_t *inst, const char *pgname,
+ const char *propname)
+{
+ int r = scf_instance_delete_prop(inst, pgname, propname);
+
+ switch (r) {
+ case 0:
+ break;
+
+ case ECANCELED:
+ uu_warn(emsg_no_service, fmri);
+ break;
+
+ case EACCES:
+ uu_warn(gettext("Could not delete %s/%s "
+ "property of %s: backend access denied.\n"),
+ pgname, propname, fmri);
+ break;
+
+ case EROFS:
+ uu_warn(gettext("Could not delete %s/%s "
+ "property of %s: backend is read-only.\n"),
+ pgname, propname, fmri);
+ break;
+
+ default:
+ bad_error("scf_instance_delete_prop", r);
+ }
+
+ return (r);
+}
+
/*
- * Enable or disable inst, per enable. If temp is true, set
- * general_ovr/enabled. Otherwise set general/enabled and delete
- * general_ovr/enabled if it exists (order is important here: we don't want the
- * enabled status to glitch).
+ * Returns 0, EPERM, or EROFS.
+ */
+static int
+set_enabled_props(scf_propertygroup_t *pg, enable_data_t *ed)
+{
+ scf_transaction_entry_t *ent1;
+ scf_transaction_entry_t *ent2;
+ scf_transaction_t *tx;
+ scf_value_t *v2;
+ scf_value_t *v1;
+ int ret = 0, r;
+
+ if ((tx = scf_transaction_create(h)) == NULL ||
+ (ent1 = scf_entry_create(h)) == NULL ||
+ (ent2 = scf_entry_create(h)) == NULL ||
+ (v1 = scf_value_create(h)) == NULL ||
+ (v2 = scf_value_create(h)) == NULL)
+ scfdie();
+
+ for (;;) {
+ if (scf_transaction_start(tx, pg) == -1) {
+ switch (scf_error()) {
+ case SCF_ERROR_PERMISSION_DENIED:
+ ret = EPERM;
+ goto out;
+
+ case SCF_ERROR_BACKEND_READONLY:
+ ret = EROFS;
+ goto out;
+
+ default:
+ scfdie();
+ }
+ }
+
+ if (scf_transaction_property_change_type(tx, ent1,
+ SCF_PROPERTY_ENABLED, SCF_TYPE_BOOLEAN) != 0) {
+ if (scf_error() != SCF_ERROR_NOT_FOUND)
+ scfdie();
+
+ if (scf_transaction_property_new(tx, ent1,
+ SCF_PROPERTY_ENABLED, SCF_TYPE_BOOLEAN) != 0)
+ scfdie();
+ }
+
+ scf_value_set_boolean(v1, !!(ed->ed_flags & SET_ENABLED));
+
+ r = scf_entry_add_value(ent1, v1);
+ assert(r == 0);
+
+ if (scf_transaction_property_change_type(tx, ent2,
+ SCF_PROPERTY_COMMENT, SCF_TYPE_ASTRING) != 0) {
+ if (scf_error() != SCF_ERROR_NOT_FOUND)
+ scfdie();
+
+ if (scf_transaction_property_new(tx, ent2,
+ SCF_PROPERTY_COMMENT, SCF_TYPE_ASTRING) != 0)
+ scfdie();
+ }
+
+ if (scf_value_set_astring(v2, ed->ed_comment) != SCF_SUCCESS)
+ scfdie();
+
+ if (scf_entry_add_value(ent2, v2) != SCF_SUCCESS)
+ scfdie();
+
+ r = scf_transaction_commit(tx);
+ if (r == 1)
+ break;
+
+ scf_transaction_reset(tx);
+
+ if (r != 0) {
+ switch (scf_error()) {
+ case SCF_ERROR_PERMISSION_DENIED:
+ ret = EPERM;
+ goto out;
+
+ case SCF_ERROR_BACKEND_READONLY:
+ ret = EROFS;
+ goto out;
+
+ default:
+ scfdie();
+ }
+ }
+
+ if (scf_pg_update(pg) == -1)
+ scfdie();
+ }
+
+out:
+ scf_transaction_destroy(tx);
+ scf_entry_destroy(ent1);
+ scf_entry_destroy(ent2);
+ scf_value_destroy(v1);
+ scf_value_destroy(v2);
+ return (ret);
+}
+
+/*
+ * Enable or disable an instance. SET_TEMPORARY modifications apply to
+ * general_ovr/ property group.
*/
static void
-set_inst_enabled(const char *fmri, scf_instance_t *inst, boolean_t temp,
- boolean_t enable)
+set_inst_enabled(const char *fmri, scf_instance_t *inst, enable_data_t *ed)
{
scf_propertygroup_t *pg;
uint8_t b;
const char *pgname = NULL; /* For emsg_pg_perm_denied */
- int r;
pg = scf_pg_create(h);
if (pg == NULL)
@@ -625,14 +768,13 @@ set_inst_enabled(const char *fmri, scf_instance_t *inst, boolean_t temp,
}
}
- if (temp) {
- /* Set general_ovr/enabled */
+ if (ed->ed_flags & SET_TEMPORARY) {
pgname = SCF_PG_GENERAL_OVR;
if (pg_get_or_add(inst, pgname, SCF_PG_GENERAL_OVR_TYPE,
SCF_PG_GENERAL_OVR_FLAGS, pg) != 0)
goto eperm;
- switch (set_bool_prop(pg, SCF_PROPERTY_ENABLED, enable)) {
+ switch (set_enabled_props(pg, ed)) {
case 0:
break;
@@ -656,7 +798,7 @@ set_inst_enabled(const char *fmri, scf_instance_t *inst, boolean_t temp,
}
if (verbose)
- (void) printf(enable ?
+ (void) printf((ed->ed_flags & SET_ENABLED) ?
gettext("%s temporarily enabled.\n") :
gettext("%s temporarily disabled.\n"), fmri);
} else {
@@ -671,7 +813,7 @@ again:
SCF_PG_GENERAL_FLAGS, pg) != 0)
goto eperm;
- switch (set_bool_prop(pg, SCF_PROPERTY_ENABLED, enable)) {
+ switch (set_enabled_props(pg, ed)) {
case 0:
break;
@@ -685,7 +827,7 @@ again:
*/
switch (get_bool_prop(pg, SCF_PROPERTY_ENABLED, &b)) {
case 0:
- if ((b != 0) == (enable != B_FALSE))
+ if (!(b) == !(ed->ed_flags & SET_ENABLED))
break;
/* FALLTHROUGH */
@@ -716,39 +858,35 @@ again:
abort();
}
- pgname = SCF_PG_GENERAL_OVR;
- r = scf_instance_delete_prop(inst, pgname,
- SCF_PROPERTY_ENABLED);
- switch (r) {
+ switch (delete_prop(fmri, inst, SCF_PG_GENERAL_OVR,
+ SCF_PROPERTY_ENABLED)) {
case 0:
break;
- case ECANCELED:
- uu_warn(emsg_no_service, fmri);
- goto out;
-
case EPERM:
goto eperm;
- case EACCES:
- uu_warn(gettext("Could not delete %s/%s "
- "property of %s: backend access denied.\n"),
- pgname, SCF_PROPERTY_ENABLED, fmri);
+ default:
goto out;
+ }
- case EROFS:
- uu_warn(gettext("Could not delete %s/%s "
- "property of %s: backend is read-only.\n"),
- pgname, SCF_PROPERTY_ENABLED, fmri);
- goto out;
+ switch (delete_prop(fmri, inst, SCF_PG_GENERAL_OVR,
+ SCF_PROPERTY_COMMENT)) {
+ case 0:
+ break;
+
+ case EPERM:
+ goto eperm;
default:
- bad_error("scf_instance_delete_prop", r);
+ goto out;
}
- if (verbose)
- (void) printf(enable ? gettext("%s enabled.\n") :
+ if (verbose) {
+ (void) printf((ed->ed_flags & SET_ENABLED) ?
+ gettext("%s enabled.\n") :
gettext("%s disabled.\n"), fmri);
+ }
}
scf_pg_destroy(pg);
@@ -1014,7 +1152,7 @@ out:
* on cycle detection, or 0 on success.
*/
static int
-enable_fmri_rec(char *fmri, boolean_t temp)
+enable_fmri_rec(char *fmri, enable_data_t *ed)
{
scf_instance_t *inst;
scf_snapshot_t *snap;
@@ -1068,7 +1206,7 @@ enable_fmri_rec(char *fmri, boolean_t temp)
return (0);
}
- set_inst_enabled(fmri, inst, temp, B_TRUE);
+ set_inst_enabled(fmri, inst, ed);
if ((snap = scf_snapshot_create(h)) == NULL ||
(pg = scf_pg_create(h)) == NULL ||
@@ -1118,7 +1256,7 @@ enable_fmri_rec(char *fmri, boolean_t temp)
ret = 0;
goto out;
} else if (sz >= 0) {
- switch (enable_fmri_rec(buf, temp)) {
+ switch (enable_fmri_rec(buf, ed)) {
case 0:
break;
@@ -1269,7 +1407,7 @@ enable_fmri_rec(char *fmri, boolean_t temp)
-1)
scfdie();
- switch (enable_fmri_rec(buf, temp)) {
+ switch (enable_fmri_rec(buf, ed)) {
case 0:
break;
@@ -1668,17 +1806,10 @@ out:
}
-/*
- * Flags to control enable and disable actions.
- */
-#define SET_ENABLED 0x1
-#define SET_TEMPORARY 0x2
-#define SET_RECURSIVE 0x4
-
static int
set_fmri_enabled(void *data, scf_walkinfo_t *wip)
{
- int flags = (int)data;
+ enable_data_t *ed = data;
assert(wip->inst != NULL);
assert(wip->pg == NULL);
@@ -1692,7 +1823,7 @@ set_fmri_enabled(void *data, scf_walkinfo_t *wip)
return (0);
}
- if (flags & SET_RECURSIVE) {
+ if (ed->ed_flags & SET_RECURSIVE) {
char *fmri_buf = malloc(max_scf_fmri_sz);
if (fmri_buf == NULL)
uu_die(emsg_nomem);
@@ -1705,7 +1836,7 @@ set_fmri_enabled(void *data, scf_walkinfo_t *wip)
assert(strlen(wip->fmri) <= max_scf_fmri_sz);
(void) strlcpy(fmri_buf, wip->fmri, max_scf_fmri_sz);
- switch (enable_fmri_rec(fmri_buf, (flags & SET_TEMPORARY))) {
+ switch (enable_fmri_rec(fmri_buf, ed)) {
case E2BIG:
uu_warn(gettext("operation on service %s is ambiguous; "
"instance specification needed.\n"), fmri_buf);
@@ -1720,8 +1851,7 @@ set_fmri_enabled(void *data, scf_walkinfo_t *wip)
free(fmri_buf);
} else {
- set_inst_enabled(wip->fmri, wip->inst,
- (flags & SET_TEMPORARY) != 0, (flags & SET_ENABLED) != 0);
+ set_inst_enabled(wip->fmri, wip->inst, ed);
}
return (0);
@@ -1972,7 +2102,6 @@ set_milestone(const char *fmri, boolean_t temporary)
{
scf_instance_t *inst;
scf_propertygroup_t *pg;
- int r;
if (temporary) {
set_astring_prop(SCF_SERVICE_STARTD, SCF_PG_OPTIONS_OVR,
@@ -1998,43 +2127,10 @@ set_milestone(const char *fmri, boolean_t temporary)
SCF_PG_OPTIONS_TYPE, SCF_PG_OPTIONS_FLAGS, SCF_PROPERTY_MILESTONE,
fmri);
- r = scf_instance_delete_prop(inst, SCF_PG_OPTIONS_OVR,
- SCF_PROPERTY_MILESTONE);
- switch (r) {
- case 0:
- break;
-
- case ECANCELED:
- uu_warn(emsg_no_service, fmri);
+ if (delete_prop(SCF_SERVICE_STARTD, inst, SCF_PG_OPTIONS_OVR,
+ SCF_PROPERTY_MILESTONE) != 0)
exit_status = 1;
- goto out;
- case EPERM:
- uu_warn(gettext("Could not delete %s/%s property of "
- "%s: permission denied.\n"), SCF_PG_OPTIONS_OVR,
- SCF_PROPERTY_MILESTONE, SCF_SERVICE_STARTD);
- exit_status = 1;
- goto out;
-
- case EACCES:
- uu_warn(gettext("Could not delete %s/%s property of "
- "%s: access denied.\n"), SCF_PG_OPTIONS_OVR,
- SCF_PROPERTY_MILESTONE, SCF_SERVICE_STARTD);
- exit_status = 1;
- goto out;
-
- case EROFS:
- uu_warn(gettext("Could not delete %s/%s property of "
- "%s: backend read-only.\n"), SCF_PG_OPTIONS_OVR,
- SCF_PROPERTY_MILESTONE, SCF_SERVICE_STARTD);
- exit_status = 1;
- goto out;
-
- default:
- bad_error("scf_instance_delete_prop", r);
- }
-
-out:
scf_pg_destroy(pg);
scf_instance_destroy(inst);
}
@@ -2315,7 +2411,10 @@ again:
usage();
if (strcmp(argv[optind], "enable") == 0) {
- int flags = SET_ENABLED;
+ enable_data_t ed = {
+ .ed_flags = SET_ENABLED,
+ .ed_comment = ""
+ };
int wait = 0;
int error = 0;
@@ -2323,9 +2422,9 @@ again:
while ((o = getopt(argc, argv, "rst")) != -1) {
if (o == 'r')
- flags |= SET_RECURSIVE;
+ ed.ed_flags |= SET_RECURSIVE;
else if (o == 't')
- flags |= SET_TEMPORARY;
+ ed.ed_flags |= SET_TEMPORARY;
else if (o == 's')
wait = 1;
else if (o == '?')
@@ -2351,7 +2450,7 @@ again:
* the errors the first time.
*/
if ((err = scf_walk_fmri(h, argc, argv, WALK_FLAGS,
- set_fmri_enabled, (void *)flags, &error, pr_warn)) != 0) {
+ set_fmri_enabled, &ed, &error, pr_warn)) != 0) {
pr_warn(gettext("failed to iterate over "
"instances: %s\n"), scf_strerror(err));
@@ -2359,7 +2458,7 @@ again:
} else if (wait && exit_status == 0 &&
(err = scf_walk_fmri(h, argc, argv, WALK_FLAGS,
- wait_fmri_enabled, (void *)flags, &error, quiet)) != 0) {
+ wait_fmri_enabled, NULL, &error, quiet)) != 0) {
pr_warn(gettext("failed to iterate over "
"instances: %s\n"), scf_strerror(err));
@@ -2370,15 +2469,25 @@ again:
exit_status = error;
} else if (strcmp(argv[optind], "disable") == 0) {
- int flags = 0;
+ enable_data_t ed = {
+ .ed_flags = 0,
+ .ed_comment = ""
+ };
int wait = 0;
int error = 0;
++optind;
- while ((o = getopt(argc, argv, "st")) != -1) {
- if (o == 't')
- flags |= SET_TEMPORARY;
+ while ((o = getopt(argc, argv, "c:st")) != -1) {
+ if (o == 'c') {
+ if (strlcpy(ed.ed_comment, optarg,
+ sizeof (ed.ed_comment)) >=
+ sizeof (ed.ed_comment)) {
+ uu_die(gettext("disable -c comment "
+ "too long.\n"));
+ }
+ } else if (o == 't')
+ ed.ed_flags |= SET_TEMPORARY;
else if (o == 's')
wait = 1;
else if (o == '?')
@@ -2404,7 +2513,7 @@ again:
* the errors the first time.
*/
if ((err = scf_walk_fmri(h, argc, argv, WALK_FLAGS,
- set_fmri_enabled, (void *)flags, &exit_status,
+ set_fmri_enabled, &ed, &exit_status,
pr_warn)) != 0) {
pr_warn(gettext("failed to iterate over "
@@ -2413,7 +2522,7 @@ again:
} else if (wait && exit_status == 0 &&
(err = scf_walk_fmri(h, argc, argv, WALK_FLAGS,
- wait_fmri_disabled, (void *)flags, &error, quiet)) != 0) {
+ wait_fmri_disabled, NULL, &error, quiet)) != 0) {
pr_warn(gettext("failed to iterate over "
"instances: %s\n"), scf_strerror(err));
diff --git a/usr/src/cmd/svc/svccfg/svccfg_libscf.c b/usr/src/cmd/svc/svccfg/svccfg_libscf.c
index 9fec777bd3..38dd45c75c 100644
--- a/usr/src/cmd/svc/svccfg/svccfg_libscf.c
+++ b/usr/src/cmd/svc/svccfg/svccfg_libscf.c
@@ -21,7 +21,7 @@
/*
* Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
- * Copyright 2019 Joyent, Inc.
+ * Copyright 2020 Joyent, Inc.
* Copyright 2012 Milan Jurik. All rights reserved.
* Copyright 2017 RackTop Systems.
* Copyright 2018 OmniOS Community Edition (OmniOSce) Association.
@@ -10522,6 +10522,8 @@ export_inst_general(scf_propertygroup_t *pg, xmlNodePtr inode,
if (strcmp(exp_str, scf_property_enabled) == 0) {
continue;
+ } else if (strcmp(exp_str, SCF_PROPERTY_COMMENT) == 0) {
+ continue;
} else if (strcmp(exp_str, SCF_PROPERTY_RESTARTER) == 0) {
xmlNodePtr rnode, sfnode;
diff --git a/usr/src/cmd/svc/svcs/explain.c b/usr/src/cmd/svc/svcs/explain.c
index 41ba1b3b47..8a8dfa043b 100644
--- a/usr/src/cmd/svc/svcs/explain.c
+++ b/usr/src/cmd/svc/svcs/explain.c
@@ -22,7 +22,7 @@
/*
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
- * Copyright (c) 2015, Joyent, Inc. All rights reserved.
+ * Copyright 2020 Joyent, Inc.
*/
/*
@@ -133,6 +133,8 @@ typedef struct {
const char *restarter;
uu_list_t *dependencies; /* list of dependency_group's */
+ char comment[SCF_COMMENT_MAX_LENGTH];
+
int active; /* In use? (cycle detection) */
int restarter_bad;
const char *summary;
@@ -404,7 +406,7 @@ add_instance(const char *svcname, const char *instname, scf_instance_t *inst)
{
inst_t *instp;
svc_t *svcp;
- int have_enabled = 0;
+ int ovr_set = 0;
uint8_t i;
uint32_t h;
int r;
@@ -480,7 +482,10 @@ add_instance(const char *svcname, const char *instname, scf_instance_t *inst)
if (scf_instance_get_pg(inst, SCF_PG_GENERAL_OVR, g_pg) == 0) {
if (pg_get_single_val(g_pg, SCF_PROPERTY_ENABLED,
SCF_TYPE_BOOLEAN, &instp->enabled, 0, 0) == 0)
- have_enabled = 1;
+ ovr_set = 1;
+ (void) pg_get_single_val(g_pg, SCF_PROPERTY_COMMENT,
+ SCF_TYPE_ASTRING, instp->comment,
+ sizeof (instp->comment), EMPTY_OK);
} else {
switch (scf_error()) {
case SCF_ERROR_NOT_FOUND:
@@ -509,11 +514,18 @@ add_instance(const char *svcname, const char *instname, scf_instance_t *inst)
if (pg_get_single_val(g_pg, SCF_PROPERTY_ENABLED, SCF_TYPE_BOOLEAN,
&i, 0, 0) != 0)
return;
- if (!have_enabled) {
+
+ if (ovr_set) {
+ instp->temporary = (instp->enabled != i);
+ } else {
instp->enabled = i;
instp->temporary = 0;
- } else {
- instp->temporary = (instp->enabled != i);
+ }
+
+ if (!instp->temporary) {
+ (void) pg_get_single_val(g_pg, SCF_PROPERTY_COMMENT,
+ SCF_TYPE_ASTRING, instp->comment,
+ sizeof (instp->comment), EMPTY_OK);
}
if (pg_get_single_val(g_pg, SCF_PROPERTY_RESTARTER, SCF_TYPE_ASTRING,
@@ -1737,12 +1749,23 @@ print_reasons(const inst_t *svcp, int verbose)
} else if (strcmp(svcp->state, SCF_STATE_STRING_DISABLED) == 0) {
if (!svcp->temporary) {
- (void) puts(gettext(
- "Reason: Disabled by an administrator."));
+ if (svcp->comment[0] != '\0') {
+ (void) printf(gettext("Reason: Disabled by "
+ "an administrator: %s\n"), svcp->comment);
+ } else {
+ (void) printf(gettext("Reason: Disabled by "
+ "an administrator.\n"));
+ }
dc = DC_DISABLED;
} else {
- (void) puts(gettext("Reason: "
- "Temporarily disabled by an administrator."));
+ if (svcp->comment[0] != '\0') {
+ (void) printf(gettext("Reason: Temporarily "
+ "disabled by an administrator: %s\n"),
+ svcp->comment);
+ } else {
+ (void) printf(gettext("Reason: Temporarily "
+ "disabled by an administrator.\n"));
+ }
dc = DC_TEMPDISABLED;
}
diff --git a/usr/src/cmd/svc/svcs/svcs.c b/usr/src/cmd/svc/svcs/svcs.c
index b6998f2624..402b40f4ca 100644
--- a/usr/src/cmd/svc/svcs/svcs.c
+++ b/usr/src/cmd/svc/svcs/svcs.c
@@ -21,7 +21,7 @@
/*
* Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
- * Copyright 2019 Joyent, Inc.
+ * Copyright 2020 Joyent, Inc.
* Copyright (c) 2015, 2016 by Delphix. All rights reserved.
*/
@@ -88,10 +88,6 @@
#define LEGACY_UNKNOWN "unknown"
-/* Flags for pg_get_single_val() */
-#define EMPTY_OK 0x01
-#define MULTI_OK 0x02
-
/*
* Per proc(4) when pr_nlwp, pr_nzomb, and pr_lwp.pr_lwpid are all 0,
* the process is a zombie.
@@ -431,7 +427,13 @@ pg_get_single_val(scf_propertygroup_t *pg, const char *propname, scf_type_t ty,
switch (ty) {
case SCF_TYPE_ASTRING:
- r = scf_value_get_astring(g_val, vp, sz) > 0 ? SCF_SUCCESS : -1;
+ r = scf_value_get_astring(g_val, vp, sz);
+ if (r == 0 && !(flags & EMPTY_OK)) {
+ uu_die(gettext("Unexpected empty string for property "
+ "%s. Exiting.\n"), propname);
+ }
+ if (r >= 0)
+ r = SCF_SUCCESS;
break;
case SCF_TYPE_BOOLEAN:
@@ -2499,6 +2501,21 @@ print_detailed(void *unused, scf_walkinfo_t *wip)
perm ? gettext("true") : gettext("false"));
}
+ if (temp == 0 || (temp == -1 && perm == 0)) {
+ char comment[SCF_COMMENT_MAX_LENGTH] = "";
+ const char *pg = (temp != -1 && temp != perm) ?
+ SCF_PG_GENERAL_OVR : SCF_PG_GENERAL;
+
+ (void) inst_get_single_val(wip->inst, pg, SCF_PROPERTY_COMMENT,
+ SCF_TYPE_ASTRING, &comment, sizeof (comment),
+ EMPTY_OK, 0, 0);
+
+ if (comment[0] != '\0') {
+ printf(fmt, DETAILED_WIDTH, gettext("comment"),
+ comment);
+ }
+ }
+
/*
* Property values may be longer than max_scf_fmri_length, but these
* shouldn't be, so we'll just reuse buf. The user can use svcprop if
diff --git a/usr/src/cmd/svc/svcs/svcs.h b/usr/src/cmd/svc/svcs/svcs.h
index 5f0cb83360..78b3c26dd3 100644
--- a/usr/src/cmd/svc/svcs/svcs.h
+++ b/usr/src/cmd/svc/svcs/svcs.h
@@ -22,13 +22,13 @@
/*
* Copyright 2004 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
+ *
+ * Copyright 2020 Joyent, Inc.
*/
#ifndef _SVCS_H
#define _SVCS_H
-#pragma ident "%Z%%M% %I% %E% SMI"
-
#include <libscf.h>
#ifdef __cplusplus
@@ -52,6 +52,10 @@ void scfdie(void);
void *safe_malloc(size_t);
char *safe_strdup(const char *);
+/* Flags for pg_get_single_val() */
+#define EMPTY_OK 0x01
+#define MULTI_OK 0x02
+
int pg_get_single_val(scf_propertygroup_t *, const char *, scf_type_t, void *,
size_t, uint_t);
int inst_get_single_val(scf_instance_t *, const char *, const char *,
diff --git a/usr/src/common/ctf/ctf_lookup.c b/usr/src/common/ctf/ctf_lookup.c
index 05aa54d6cb..b45b7ad793 100644
--- a/usr/src/common/ctf/ctf_lookup.c
+++ b/usr/src/common/ctf/ctf_lookup.c
@@ -133,7 +133,8 @@ ctf_lookup_by_name(ctf_file_t *fp, const char *name)
for (lp = fp->ctf_lookups; lp->ctl_prefix != NULL; lp++) {
if (lp->ctl_prefix[0] == '\0' ||
- strncmp(p, lp->ctl_prefix, (size_t)(q - p)) == 0) {
+ ((size_t)(q - p) >= lp->ctl_len && strncmp(p,
+ lp->ctl_prefix, (size_t)(q - p)) == 0)) {
for (p += lp->ctl_len; isspace(*p); p++)
continue; /* skip prefix and next ws */
diff --git a/usr/src/lib/Makefile b/usr/src/lib/Makefile
index 9fd28c40f6..a0221ca855 100644
--- a/usr/src/lib/Makefile
+++ b/usr/src/lib/Makefile
@@ -188,7 +188,6 @@ SUBDIRS += \
libpkg \
libpool \
libpp \
- libppt \
libproc \
libproject \
libpthread \
@@ -287,6 +286,7 @@ SUBDIRS += \
i386_SUBDIRS= \
libfdisk \
+ libppt \
libsaveargs \
libvmm \
libvmmapi
@@ -457,7 +457,6 @@ HDRSUBDIRS= \
libpicltree \
libpool \
libpp \
- libppt \
libproc \
libraidcfg \
librcm \
@@ -520,6 +519,7 @@ HDRSUBDIRS= \
i386_HDRSUBDIRS= \
libfdisk \
+ libppt \
libsaveargs \
libvmm \
libvmmapi
diff --git a/usr/src/lib/libscf/common/mapfile-vers b/usr/src/lib/libscf/common/mapfile-vers
index 049912185c..c9616640de 100644
--- a/usr/src/lib/libscf/common/mapfile-vers
+++ b/usr/src/lib/libscf/common/mapfile-vers
@@ -20,6 +20,7 @@
#
#
# Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright 2020 Joyent, Inc.
#
#
@@ -38,6 +39,11 @@
$mapfile_version 2
+SYMBOL_VERSION ILLUMOS_0.1 {
+ global:
+ smf_disable_instance_with_comment;
+} SUNW_1.2;
+
SYMBOL_VERSION SUNW_1.2 {
global:
scf_count_ranges_destroy;
diff --git a/usr/src/lib/libscf/common/midlevel.c b/usr/src/lib/libscf/common/midlevel.c
index 3c75364548..03eda8a4e8 100644
--- a/usr/src/lib/libscf/common/midlevel.c
+++ b/usr/src/lib/libscf/common/midlevel.c
@@ -23,6 +23,7 @@
* Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright 2013 Nexenta Systems, Inc. All rights reserved.
* Copyright 2018 RackTop Systems.
+ * Copyright 2020 Joyent, Inc.
*/
#include "libscf_impl.h"
@@ -512,16 +513,21 @@ out:
* instance and the desired state for the enabled bit in the instance's
* named property group. If the group doesn't exist, it's created with the
* given flags. Called by smf_{dis,en}able_instance().
+ *
+ * Note that if we're enabling, comment will be "", and we use that to clear out
+ * any old disabled comment.
*/
static int
set_inst_enabled(const scf_instance_t *inst, uint8_t desired,
- const char *pgname, uint32_t pgflags)
+ const char *pgname, uint32_t pgflags, const char *comment)
{
scf_transaction_t *tx = NULL;
- scf_transaction_entry_t *ent = NULL;
+ scf_transaction_entry_t *ent1 = NULL;
+ scf_transaction_entry_t *ent2 = NULL;
scf_propertygroup_t *gpg = NULL;
scf_property_t *eprop = NULL;
- scf_value_t *v = NULL;
+ scf_value_t *v1 = NULL;
+ scf_value_t *v2 = NULL;
scf_handle_t *h = NULL;
int ret = -1;
int committed;
@@ -532,9 +538,11 @@ set_inst_enabled(const scf_instance_t *inst, uint8_t desired,
if ((gpg = scf_pg_create(h)) == NULL ||
(eprop = scf_property_create(h)) == NULL ||
- (v = scf_value_create(h)) == NULL ||
+ (v1 = scf_value_create(h)) == NULL ||
+ (v2 = scf_value_create(h)) == NULL ||
(tx = scf_transaction_create(h)) == NULL ||
- (ent = scf_entry_create(h)) == NULL)
+ (ent1 = scf_entry_create(h)) == NULL ||
+ (ent2 = scf_entry_create(h)) == NULL)
goto out;
general_pg_get:
@@ -575,7 +583,7 @@ get:
/*
* If it's already set the way we want, forgo the transaction.
*/
- if (scf_property_get_value(eprop, v) == -1) {
+ if (scf_property_get_value(eprop, v1) == -1) {
switch (scf_error()) {
case SCF_ERROR_CONSTRAINT_VIOLATED:
case SCF_ERROR_NOT_FOUND:
@@ -586,7 +594,7 @@ get:
goto out;
}
}
- if (scf_value_get_boolean(v, &b) == -1) {
+ if (scf_value_get_boolean(v1, &b) == -1) {
if (scf_error() != SCF_ERROR_TYPE_MISMATCH)
goto out;
goto set;
@@ -601,7 +609,7 @@ set:
if (scf_transaction_start(tx, gpg) == -1)
goto out;
- if (transaction_property_set(tx, ent, SCF_PROPERTY_ENABLED,
+ if (transaction_property_set(tx, ent1, SCF_PROPERTY_ENABLED,
SCF_TYPE_BOOLEAN) != 0) {
switch (scf_error()) {
case SCF_ERROR_CONNECTION_BROKEN:
@@ -618,8 +626,31 @@ set:
}
}
- scf_value_set_boolean(v, desired);
- if (scf_entry_add_value(ent, v) == -1)
+ scf_value_set_boolean(v1, desired);
+ if (scf_entry_add_value(ent1, v1) == -1)
+ goto out;
+
+ if (transaction_property_set(tx, ent2,
+ SCF_PROPERTY_COMMENT, SCF_TYPE_ASTRING) != 0) {
+ switch (scf_error()) {
+ case SCF_ERROR_CONNECTION_BROKEN:
+ case SCF_ERROR_DELETED:
+ default:
+ goto out;
+
+ case SCF_ERROR_HANDLE_MISMATCH:
+ case SCF_ERROR_INVALID_ARGUMENT:
+ case SCF_ERROR_NOT_BOUND:
+ case SCF_ERROR_NOT_SET:
+ bad_error("transaction_property_set",
+ scf_error());
+ }
+ }
+
+ if (scf_value_set_astring(v2, comment) == -1)
+ goto out;
+
+ if (scf_entry_add_value(ent2, v2) == -1)
goto out;
committed = scf_transaction_commit(tx);
@@ -637,8 +668,10 @@ set:
ret = 0;
out:
- scf_value_destroy(v);
- scf_entry_destroy(ent);
+ scf_value_destroy(v1);
+ scf_value_destroy(v2);
+ scf_entry_destroy(ent1);
+ scf_entry_destroy(ent2);
scf_transaction_destroy(tx);
scf_property_destroy(eprop);
scf_pg_destroy(gpg);
@@ -650,7 +683,8 @@ static int
delete_inst_enabled(const scf_instance_t *inst, const char *pgname)
{
scf_transaction_t *tx = NULL;
- scf_transaction_entry_t *ent = NULL;
+ scf_transaction_entry_t *ent1 = NULL;
+ scf_transaction_entry_t *ent2 = NULL;
scf_propertygroup_t *gpg = NULL;
scf_handle_t *h = NULL;
int ret = -1;
@@ -661,16 +695,31 @@ delete_inst_enabled(const scf_instance_t *inst, const char *pgname)
if ((gpg = scf_pg_create(h)) == NULL ||
(tx = scf_transaction_create(h)) == NULL ||
- (ent = scf_entry_create(h)) == NULL)
+ (ent1 = scf_entry_create(h)) == NULL ||
+ (ent2 = scf_entry_create(h)) == NULL)
goto out;
if (scf_instance_get_pg(inst, pgname, gpg) != 0)
goto error;
do {
- if (scf_transaction_start(tx, gpg) == -1 ||
- scf_transaction_property_delete(tx, ent,
- SCF_PROPERTY_ENABLED) == -1 ||
- (committed = scf_transaction_commit(tx)) == -1)
+ if (scf_transaction_start(tx, gpg) == -1)
+ goto error;
+
+ ret = scf_transaction_property_delete(tx, ent1,
+ SCF_PROPERTY_ENABLED);
+
+ if (ret == -1 && scf_error() != SCF_ERROR_DELETED &&
+ scf_error() != SCF_ERROR_NOT_FOUND)
+ goto error;
+
+ ret = scf_transaction_property_delete(tx, ent2,
+ SCF_PROPERTY_COMMENT);
+
+ if (ret == -1 && scf_error() != SCF_ERROR_DELETED &&
+ scf_error() != SCF_ERROR_NOT_FOUND)
+ goto error;
+
+ if ((committed = scf_transaction_commit(tx)) == -1)
goto error;
scf_transaction_reset(tx);
@@ -691,7 +740,8 @@ error:
}
out:
- scf_entry_destroy(ent);
+ scf_entry_destroy(ent1);
+ scf_entry_destroy(ent2);
scf_transaction_destroy(tx);
scf_pg_destroy(gpg);
@@ -1016,7 +1066,8 @@ out:
* present state, if it is different.
*/
static int
-set_inst_enabled_atboot(scf_instance_t *inst, uint8_t desired)
+set_inst_enabled_atboot(scf_instance_t *inst, uint8_t desired,
+ const char *comment)
{
int enabled;
int persistent;
@@ -1034,13 +1085,14 @@ set_inst_enabled_atboot(scf_instance_t *inst, uint8_t desired)
* Temporarily store the present enabled state.
*/
if (set_inst_enabled(inst, persistent,
- SCF_PG_GENERAL_OVR, SCF_PG_GENERAL_OVR_FLAGS))
+ SCF_PG_GENERAL_OVR, SCF_PG_GENERAL_OVR_FLAGS,
+ comment))
goto out;
}
}
if (persistent != desired)
if (set_inst_enabled(inst, desired, SCF_PG_GENERAL,
- SCF_PG_GENERAL_FLAGS))
+ SCF_PG_GENERAL_FLAGS, comment))
goto out;
if (enabled == desired)
ret = delete_inst_enabled(inst, SCF_PG_GENERAL_OVR);
@@ -1052,7 +1104,8 @@ out:
}
static int
-set_inst_enabled_flags(const char *fmri, int flags, uint8_t desired)
+set_inst_enabled_flags(const char *fmri, int flags, uint8_t desired,
+ const char *comment)
{
int ret = -1;
scf_handle_t *h;
@@ -1080,11 +1133,11 @@ set_inst_enabled_flags(const char *fmri, int flags, uint8_t desired)
}
if (flags & SMF_AT_NEXT_BOOT) {
- ret = set_inst_enabled_atboot(inst, desired);
+ ret = set_inst_enabled_atboot(inst, desired, comment);
} else {
if (set_inst_enabled(inst, desired, flags & SMF_TEMPORARY ?
SCF_PG_GENERAL_OVR : SCF_PG_GENERAL, flags & SMF_TEMPORARY ?
- SCF_PG_GENERAL_OVR_FLAGS : SCF_PG_GENERAL_FLAGS))
+ SCF_PG_GENERAL_OVR_FLAGS : SCF_PG_GENERAL_FLAGS, comment))
goto out;
/*
@@ -1150,16 +1203,22 @@ get_instance_pg(scf_simple_handle_t *simple_h)
int
smf_enable_instance(const char *fmri, int flags)
{
- return (set_inst_enabled_flags(fmri, flags, B_TRUE));
+ return (set_inst_enabled_flags(fmri, flags, B_TRUE, ""));
}
int
-smf_disable_instance(const char *fmri, int flags)
+smf_disable_instance_with_comment(const char *fmri, int flags,
+ const char *comment)
{
- return (set_inst_enabled_flags(fmri, flags, B_FALSE));
+ return (set_inst_enabled_flags(fmri, flags, B_FALSE, comment));
}
int
+smf_disable_instance(const char *fmri, int flags)
+{
+ return (set_inst_enabled_flags(fmri, flags, B_FALSE, ""));
+}
+int
_smf_refresh_instance_i(scf_instance_t *inst)
{
return (set_inst_action_inst(inst, SCF_PROPERTY_REFRESH));
diff --git a/usr/src/lib/libscf/inc/libscf.h b/usr/src/lib/libscf/inc/libscf.h
index adc7455622..a30d374ae3 100644
--- a/usr/src/lib/libscf/inc/libscf.h
+++ b/usr/src/lib/libscf/inc/libscf.h
@@ -23,7 +23,7 @@
* Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, Joyent, Inc. All rights reserved.
* Copyright 2016 RackTop Systems.
- * Copyright (c) 2012, Joyent, Inc. All rights reserved.
+ * Copyright 2020 Joyent, Inc.
*/
#ifndef _LIBSCF_H
@@ -327,6 +327,7 @@ typedef struct {
#define SCF_PROPERTY_AUX_STATE "auxiliary_state"
#define SCF_PROPERTY_AUX_FMRI "auxiliary_fmri"
#define SCF_PROPERTY_AUX_TTY "auxiliary_tty"
+#define SCF_PROPERTY_COMMENT "comment"
#define SCF_PROPERTY_CONTRACT "contract"
#define SCF_PROPERTY_COREFILE_PATTERN "corefile_pattern"
#define SCF_PROPERTY_DEGRADED "degraded"
@@ -486,6 +487,9 @@ ssize_t scf_limit(uint32_t code);
#define SCF_LIMIT_MAX_PG_TYPE_LENGTH -2002U
#define SCF_LIMIT_MAX_FMRI_LENGTH -2003U
+
+#define SCF_COMMENT_MAX_LENGTH (1024)
+
scf_handle_t *scf_handle_create(scf_version_t);
int scf_handle_decorate(scf_handle_t *, const char *, scf_value_t *);
@@ -808,6 +812,7 @@ int scf_tmpl_error_value(const scf_tmpl_error_t *, char **);
* Simplified calls
*/
int smf_enable_instance(const char *, int);
+int smf_disable_instance_with_comment(const char *, int, const char *);
int smf_disable_instance(const char *, int);
int smf_refresh_instance(const char *);
int smf_restart_instance(const char *);
diff --git a/usr/src/man/man1/svcs.1 b/usr/src/man/man1/svcs.1
index a7b9d1b5be..cb8b3cd120 100644
--- a/usr/src/man/man1/svcs.1
+++ b/usr/src/man/man1/svcs.1
@@ -1,13 +1,13 @@
'\" te
.\" Copyright (c) 2008, Sun Microsystems, Inc. All Rights Reserved
+.\" Copyright 2020 Joyent, Inc.
.\" 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 SVCS 1 "Apr 17, 2011"
+.TH SVCS 1 "May 11, 2020"
.SH NAME
svcs \- report service status
.SH SYNOPSIS
-.LP
.nf
\fBsvcs\fR [\fB-aHpv?\fR] [\fB-Z\fR | \fB-z\fR \fIzone\fR] [\fB-o\fR \fIcol\fR[,\fIcol\fR]]... [\fB-R\fR \fIFMRI-instance\fR]...
[\fB-sS\fR \fIcol\fR]... [\fIFMRI\fR | \fIpattern\fR]...
@@ -30,8 +30,6 @@ svcs \- report service status
.fi
.SH DESCRIPTION
-.sp
-.LP
The \fBsvcs\fR command displays information about service instances as recorded
in the service configuration repository.
.sp
@@ -62,8 +60,6 @@ Error messages are printed to the standard error stream.
The output of this command can be used appropriately as input to the
\fBsvcadm\fR(1M) command.
.SH OPTIONS
-.sp
-.LP
The following options are supported:
.sp
.ne 2
@@ -212,6 +208,10 @@ temporarily (until the next system reboot). The former is specified as either
A service might be temporarily disabled because an administrator has run
\fBsvcadm disable -t\fR, used \fBsvcadm milestone\fR, or booted the system to a
specific milestone. See \fBsvcadm\fR(1M) for details.
+.sp
+If a service instance was disabled via
+\fBsvcadm disable -c\fR
+, then the provided comment will also be displayed.
.RE
.RE
@@ -337,8 +337,6 @@ zone, see \fBzones\fR(5).
.RE
.SH OPERANDS
-.sp
-.LP
The following operands are supported:
.sp
.ne 2
@@ -421,8 +419,6 @@ An FMRI that specifies an instance.
.RE
.SH COLUMNS
-.sp
-.LP
Column names are case insensitive. The default output format is equivalent to
"\fB-o\fR \fBstate,stime,fmri\fR". The default sorting columns are \fBSTATE\fR,
\fBSTIME\fR, \fBFMRI\fR.
@@ -607,7 +603,6 @@ blanks.
.RE
.SH EXAMPLES
-.LP
\fBExample 1 \fRDisplaying the Default Output
.sp
.LP
@@ -767,8 +762,6 @@ Impact: This service is not running.
.sp
.SH EXIT STATUS
-.sp
-.LP
The following exit values are returned:
.sp
.ne 2
@@ -798,8 +791,6 @@ Invalid command line options were specified.
.RE
.SH ATTRIBUTES
-.sp
-.LP
See \fBattributes\fR(5) for descriptions of the following attributes:
.sp
@@ -817,8 +808,6 @@ Interface Stability See below.
.LP
Screen output is Uncommitted. The invocation is Committed.
.SH SEE ALSO
-.sp
-.LP
\fBps\fR(1), \fBsvcprop\fR(1), \fBsvcadm\fR(1M), \fBsvccfg\fR(1M),
\fBsvc.startd\fR(1M), \fBstat\fR(2), \fBlibscf\fR(3LIB), \fBattributes\fR(5),
\fBfnmatch\fR(5), \fBsmf\fR(5), \fBzones\fR(5)
diff --git a/usr/src/man/man1m/svcadm.1m b/usr/src/man/man1m/svcadm.1m
index 4bfefe5eb3..550e093239 100644
--- a/usr/src/man/man1m/svcadm.1m
+++ b/usr/src/man/man1m/svcadm.1m
@@ -1,10 +1,10 @@
'\" te
.\" Copyright (c) 2008, Sun Microsystems, Inc. All Rights Reserved.
-.\" Copyright 2019 Joyent, Inc.
+.\" Copyright 2020 Joyent, Inc.
.\" 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 SVCADM 1M "Oct 24, 2019"
+.TH SVCADM 1M "May 11, 2020"
.SH NAME
svcadm \- manipulate service instances
.SH SYNOPSIS
@@ -15,8 +15,8 @@ svcadm \- manipulate service instances
.LP
.nf
-\fB/usr/sbin/svcadm\fR [\fB-S state\fR] [\fB-v\fR] [\fB-Z\fR | \fB-z\fR \fIzone\fR] disable [\fB-st\fR]
- [{\fIFMRI\fR | \fIpattern\fR}...]
+\fB/usr/sbin/svcadm\fR [\fB-S state\fR] [\fB-v\fR] [\fB-Z\fR | \fB-z\fR \fIzone\fR] disable
+ [\fB-c\fR \fIcomment\fR] [\fB-st\fR] [{\fIFMRI\fR | \fIpattern\fR}...]
.fi
.LP
@@ -142,7 +142,7 @@ persistent across reboot.
.sp
.ne 2
.na
-\fB\fBdisable\fR [\fB-st\fR] {\fIFMRI\fR | \fIpattern\fR}...\fR
+\fB\fBdisable\fR [\fB-c\fR \fIcomment\fR] [\fB-st\fR] {\fIFMRI\fR | \fIpattern\fR}...\fR
.ad
.sp .6
.RS 4n
@@ -161,6 +161,11 @@ service instance. Temporary disable only lasts until reboot. This action
requires permission to modify the "restarter_actions" property group of the
service instance (see \fBsmf_security\fR(5)). By default, \fBdisable\fR is
persistent across reboot.
+.sp
+If the \fB-c\fR option is specified, the given free-form comment is recorded
+in the (temporary) service configuration under the \fBgeneral/comment\fR
+property. This can serve as an administrator reason for disabling the service,
+and is reported by \fBsvcs\fR(1).
.RE
.sp
@@ -379,16 +384,16 @@ However, you can abbreviate the full \fIFMRI\fR as follows:
.sp
.LP
-\fBExample 2 \fRDisabling the Standard HTTP Server
+\fBExample 2 \fRDisabling a service
.sp
.LP
-The following command disables the standard HTTP server, using an abbreviated
-\fIFMRI\fR:
+The following command synchronously disables a service, using an abbreviated
+\fIFMRI\fR, and recording a ticket ID as the administrative reason:
.sp
.in +2
.nf
-$ svcadm disable http
+$ svcadm disable -c "OPS-1000" -s http
.fi
.in -2
.sp
diff --git a/usr/src/man/man3c/timer_create.3c b/usr/src/man/man3c/timer_create.3c
index 08b8351755..63b57e0a41 100644
--- a/usr/src/man/man3c/timer_create.3c
+++ b/usr/src/man/man3c/timer_create.3c
@@ -48,7 +48,6 @@
.SH NAME
timer_create \- create a timer
.SH SYNOPSIS
-.LP
.nf
#include <signal.h>
#include <time.h>
@@ -58,7 +57,6 @@ timer_create \- create a timer
.fi
.SH DESCRIPTION
-.LP
The \fBtimer_create()\fR function creates a timer using the specified clock,
\fIclock_id\fR, as the timing base. The \fBtimer_create()\fR function returns,
in the location referenced by \fItimerid\fR, a timer \fBID\fR of type
@@ -131,14 +129,12 @@ Timers are not inherited by a child process across a \fBfork\fR(2) and are
disarmed and deleted by a call to one of the \fBexec\fR functions (see
\fBexec\fR(2)).
.SH RETURN VALUES
-.LP
Upon successful completion, \fBtimer_create()\fR returns \fB0\fR and updates
the location referenced by \fItimerid\fR to a \fBtimer_t\fR, which can be
passed to the per-process timer calls. If an error occurs, the function returns
\fB\(mi1\fR and sets \fBerrno\fR to indicate the error. The value of
\fItimerid\fR is undefined if an error occurs.
.SH ERRORS
-.LP
The \fBtimer_create()\fR function will fail if:
.sp
.ne 2
@@ -161,7 +157,6 @@ The specified clock \fBID\fR, \fIclock_id\fR, is not defined.
.RE
.SH ATTRIBUTES
-.LP
See \fBattributes\fR(5) for descriptions of the following attributes:
.sp
@@ -180,7 +175,6 @@ Standard See \fBstandards\fR(5).
.TE
.SH SEE ALSO
-.LP
\fBexec\fR(2), \fBfork\fR(2), \fBtime\fR(2), \fBclock_settime\fR(3C),
\fBsignal\fR(3C), \fBsignal.h\fR(3HEAD), \fBtimer_delete\fR(3C),
\fBtimer_settime\fR(3C), \fBattributes\fR(5), \fBstandards\fR(5)
diff --git a/usr/src/man/man3c/timer_settime.3c b/usr/src/man/man3c/timer_settime.3c
index ca07bfdb63..3813a9d86d 100644
--- a/usr/src/man/man3c/timer_settime.3c
+++ b/usr/src/man/man3c/timer_settime.3c
@@ -49,7 +49,6 @@
.SH NAME
timer_settime, timer_gettime, timer_getoverrun \- per-process timers
.SH SYNOPSIS
-.LP
.nf
#include <time.h>
@@ -69,8 +68,6 @@ timer_settime, timer_gettime, timer_getoverrun \- per-process timers
.fi
.SH DESCRIPTION
-.sp
-.LP
The \fBtimer_settime()\fR function sets the time until the next expiration of
the timer specified by \fItimerid\fR from the \fBit_value\fR member of the
\fIvalue\fR argument and arm the timer if the \fBit_value\fR member of
@@ -146,16 +143,12 @@ smaller than a system defined threshold, then {\fBPRIV_PROC_CLOCK_HIGHRES\fR}
must be asserted in the effective set of the calling process or the time values
will be adjusted up to the threshold value.
.SH RETURN VALUES
-.sp
-.LP
If the \fBtimer_settime()\fR or \fBtimer_gettime()\fR functions succeed,
\fB0\fR is returned. If an error occurs for either of these functions,
\fB\(mi1\fR is returned, and \fBerrno\fR is set to indicate the error. If the
\fBtimer_getoverrun()\fR function succeeds, it returns the timer expiration
overrun count as explained above.
.SH ERRORS
-.sp
-.LP
The \fBtimer_settime()\fR, \fBtimer_gettime()\fR and \fBtimer_getoverrun()\fR
functions will fail if:
.sp
@@ -190,8 +183,6 @@ than or equal to 1000 million.
.RE
.SH ATTRIBUTES
-.sp
-.LP
See \fBattributes\fR(5) for descriptions of the following attributes:
.sp
@@ -210,8 +201,6 @@ Standard See \fBstandards\fR(5).
.TE
.SH SEE ALSO
-.sp
-.LP
\fBtime.h\fR(3HEAD), \fBclock_settime\fR(3C), \fBtimer_create\fR(3C),
\fBtimer_delete\fR(3C), \fBattributes\fR(5), \fBprivileges\fR(5),
\fBstandards\fR(5)
diff --git a/usr/src/man/man3scf/Makefile b/usr/src/man/man3scf/Makefile
index 088037ad15..cbebef7221 100644
--- a/usr/src/man/man3scf/Makefile
+++ b/usr/src/man/man3scf/Makefile
@@ -12,35 +12,36 @@
#
# Copyright 2011, Richard Lowe
# Copyright 2013 Nexenta Systems, Inc. All rights reserved.
+# Copyright 2020 Joyent, Inc.
#
include $(SRC)/Makefile.master
-MANSECT= 3scf
+MANSECT= 3scf
-MANFILES= scf_entry_create.3scf \
- scf_error.3scf \
- scf_handle_create.3scf \
- scf_handle_decode_fmri.3scf \
- scf_instance_create.3scf \
- scf_iter_create.3scf \
- scf_limit.3scf \
- scf_pg_create.3scf \
- scf_property_create.3scf \
- scf_scope_create.3scf \
- scf_service_create.3scf \
- scf_simple_prop_get.3scf \
- scf_simple_walk_instances.3scf \
- scf_snaplevel_create.3scf \
- scf_snapshot_create.3scf \
- scf_tmpl_pg_create.3scf \
- scf_tmpl_pg_name.3scf \
- scf_tmpl_prop_create.3scf \
- scf_tmpl_prop_name.3scf \
- scf_tmpl_validate_fmri.3scf \
- scf_transaction_create.3scf \
- scf_value_create.3scf \
- smf_enable_instance.3scf
+MANFILES= scf_entry_create.3scf \
+ scf_error.3scf \
+ scf_handle_create.3scf \
+ scf_handle_decode_fmri.3scf \
+ scf_instance_create.3scf \
+ scf_iter_create.3scf \
+ scf_limit.3scf \
+ scf_pg_create.3scf \
+ scf_property_create.3scf \
+ scf_scope_create.3scf \
+ scf_service_create.3scf \
+ scf_simple_prop_get.3scf \
+ scf_simple_walk_instances.3scf \
+ scf_snaplevel_create.3scf \
+ scf_snapshot_create.3scf \
+ scf_tmpl_pg_create.3scf \
+ scf_tmpl_pg_name.3scf \
+ scf_tmpl_prop_create.3scf \
+ scf_tmpl_prop_name.3scf \
+ scf_tmpl_validate_fmri.3scf \
+ scf_transaction_create.3scf \
+ scf_value_create.3scf \
+ smf_enable_instance.3scf
MANLINKS= scf_count_ranges_destroy.3scf \
@@ -241,6 +242,7 @@ MANLINKS= scf_count_ranges_destroy.3scf \
scf_values_destroy.3scf \
smf_degrade_instance.3scf \
smf_disable_instance.3scf \
+ smf_disable_instance_with_comment.3scf \
smf_get_state.3scf \
smf_maintain_instance.3scf \
smf_refresh_instance.3scf \
@@ -465,6 +467,7 @@ scf_value_type.3scf := LINKSRC = scf_value_create.3scf
smf_degrade_instance.3scf := LINKSRC = smf_enable_instance.3scf
smf_disable_instance.3scf := LINKSRC = smf_enable_instance.3scf
+smf_disable_instance_with_comment.3scf := LINKSRC = smf_enable_instance.3scf
smf_get_state.3scf := LINKSRC = smf_enable_instance.3scf
smf_maintain_instance.3scf := LINKSRC = smf_enable_instance.3scf
smf_refresh_instance.3scf := LINKSRC = smf_enable_instance.3scf
diff --git a/usr/src/man/man3scf/smf_enable_instance.3scf b/usr/src/man/man3scf/smf_enable_instance.3scf
index 6e8663f77f..9333b16265 100644
--- a/usr/src/man/man3scf/smf_enable_instance.3scf
+++ b/usr/src/man/man3scf/smf_enable_instance.3scf
@@ -1,16 +1,16 @@
'\" te
.\" Copyright (c) 2007, Sun Microsystems, Inc. All Rights Reserved.
+.\" Copyright 2020 Joyent, Inc.
.\" 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 SMF_ENABLE_INSTANCE 3SCF "Nov 5, 2007"
+.TH SMF_ENABLE_INSTANCE 3SCF "May 15, 2020"
.SH NAME
-smf_enable_instance, smf_disable_instance, smf_refresh_instance,
-smf_restart_instance, smf_maintain_instance, smf_degrade_instance,
-smf_restore_instance, smf_get_state \- administrative interface to the Service
-Configuration Facility
+smf_enable_instance, smf_disable_instance, smf_disable_instance_with_comment,
+smf_refresh_instance, smf_restart_instance, smf_maintain_instance,
+smf_degrade_instance, smf_restore_instance, smf_get_state \-
+administrative interface to the Service Configuration Facility
.SH SYNOPSIS
-.LP
.nf
cc [ \fIflag\fR\&.\|.\|. ] \fIfile\fR\&.\|.\|. \fB-lscf\fR [ \fIlibrary\fR\&.\|.\|. ]
#include <libscf.h>
@@ -25,6 +25,12 @@ cc [ \fIflag\fR\&.\|.\|. ] \fIfile\fR\&.\|.\|. \fB-lscf\fR [ \fIlibrary\fR\&.\|.
.LP
.nf
+\fBint\fR \fBsmf_disable_instance_with_comment\fR(\fBconst char *\fR\fIinstance\fR,
+ \fBint\fR \fIflags\fR, \fBconst char *\fR\fIcomment\fR);
+.fi
+
+.LP
+.nf
\fBint\fR \fBsmf_refresh_instance\fR(\fBconst char *\fR\fIinstance\fR);
.fi
@@ -54,8 +60,6 @@ cc [ \fIflag\fR\&.\|.\|. ] \fIfile\fR\&.\|.\|. \fB-lscf\fR [ \fIlibrary\fR\&.\|.
.fi
.SH DESCRIPTION
-.sp
-.LP
These functions provide administrative control over service instances. Using
these functions, an administrative tool can make a request to enable, disable,
refresh, or restart an instance. All calls are asynchronous. They request an
@@ -77,6 +81,13 @@ the current system instance. The \fIflags\fR argument is set to \fB0\fR if no
flags are to be use.
.sp
.LP
+The \fBsmf_disable_instance_with_comment()\fR function behaves the same as
+\fBsmf_disable_instance()\fR, except the given free-form comment is recorded
+under the \fIcomment\fR property, as reported by \fBsvcs\fR(1).
+The comment may be up to \fBSCF_COMMENT_MAX_LENGTH\fR characters including
+the NUL terminator.
+.sp
+.LP
The \fBsmf_refresh_instance()\fR function causes the service instance specified
by \fIinstance\fR FMRI to re-read its configuration information.
.sp
@@ -123,20 +134,17 @@ string. Possible state strings are defined as the following:
.in -2
.SH RETURN VALUES
-.sp
-.LP
Upon successful completion, \fBsmf_enable_instance()\fR,
-\fBsmf_disable_instance()\fR, \fBsmf_refresh_instance()\fR,
-\fBsmf_restart_instance()\fR, \fBsmf_maintain_instance()\fR,
-\fBsmf_degrade_instance()\fR, and \fBsmf_restore_instance()\fR return \fB0\fR.
+\fBsmf_disable_instance()\fR, \fBsmf_disable_instance_with_comment()\fR,
+\fBsmf_refresh_instance()\fR, \fBsmf_restart_instance()\fR,
+\fBsmf_maintain_instance()\fR, \fBsmf_degrade_instance()\fR,
+and \fBsmf_restore_instance()\fR return \fB0\fR.
Otherwise, they return \fB-1\fR\&.
.sp
.LP
Upon successful completion, smf_get_state returns an allocated string.
Otherwise, it returns \fINULL\fR.
.SH ERRORS
-.sp
-.LP
These functions will fail if:
.sp
.ne 2
@@ -241,8 +249,6 @@ The function is called on an instance in an inappropriate state.
.LP
The \fBscf_error\fR(3SCF) function can be used to retrieve the error value.
.SH ATTRIBUTES
-.sp
-.LP
See \fBattributes\fR(5) for descriptions of the following attributes:
.sp
@@ -259,7 +265,5 @@ MT-Level Safe
.TE
.SH SEE ALSO
-.sp
-.LP
\fBsvc.startd\fR(1M), \fBlibscf\fR(3LIB), \fBscf_error\fR(3SCF),
-\fBattributes\fR(5), \fBsmf_security\fR(5)
+\fBattributes\fR(5), \fBsmf_security\fR(5), \fBsvcs\fR(1)
diff --git a/usr/src/pkg/Makefile b/usr/src/pkg/Makefile
index 18f7010b45..99f96af4f1 100644
--- a/usr/src/pkg/Makefile
+++ b/usr/src/pkg/Makefile
@@ -24,7 +24,7 @@
# Copyright 2015, OmniTI Computer Consulting, Inc. All rights reserved.
# Copyright 2015 Igor Kozhukhov <ikozhukhov@gmail.com>
# Copyright 2016 RackTop Systems.
-# Copyright 2019 OmniOS Community Edition (OmniOSce) Association.
+# Copyright 2020 OmniOS Community Edition (OmniOSce) Association.
#
include $(SRC)/Makefile.master
@@ -167,6 +167,7 @@ sparc_ARCH64= sparcv9
#
PM_TRANSFORMS= common_actions publish restart_fmri facets defaults \
extract_metadata
+PM_FINAL_TRANSFORMS= strip_dependinfo
PM_INC= transforms manifests
JAVA_7_ONLY=
@@ -266,6 +267,7 @@ $(BUILDPY3) MANIFESTS += \
PKGS= $(MANIFESTS:%.mf=%)
DEP_PKGS= $(PKGS:%=$(PDIR)/%.dep)
PROC_PKGS= $(PKGS:%=$(PDIR)/%.mog)
+FIN_PKGS= $(PKGS:%=$(PDIR)/%.fin)
#
# Track the synthetic manifests separately so we can properly express
@@ -320,7 +322,7 @@ PKGLISTS= \
.KEEP_STATE:
.PARALLEL: $(PKGS) $(PROC_PKGS) $(DEP_PKGS) \
- $(PROC_SYNTH_PKGS) $(DEP_SYNTH_PKGS) $(PUB_PKGS)
+ $(PROC_SYNTH_PKGS) $(DEP_SYNTH_PKGS) $(FIN_PKGS) $(PUB_PKGS)
#
# For a single manifest, the dependency chain looks like this:
@@ -339,6 +341,10 @@ PKGLISTS= \
# |
# manifest with dependencies resolved (mypkg.res)
# |
+# | use pkgmogrify to apply final cleanups
+# |
+# cleaned up manifest (mypkg.fin)
+# |
# | use pkgsend to publish the package
# |
# placeholder to indicate successful publication (mypkg.pub)
@@ -382,16 +388,19 @@ PKGLISTS= \
# | |
# | | pkgsend publish
# | |
-# repositories resolved dependencies
+# repositories final manifests
# | |
-# pkgsend | | pkgdepend resolve
+# pkgsend | | pkgmogrify final
# create-repository |
-# | generated dependencies
+# | resolved dependencies
# repo directories |
+# | pkgdepend resolve
+# |
+# generated dependencies
+# |
# | pkgdepend
# |
-# processed manifests
-#
+# processed manifests
ALL_TARGETS= $(PROC_SYNTH_PKGS) proto_list_$(PKGMACH)
@@ -408,12 +417,8 @@ $(PDIR):
#
# This rule resolves dependencies across all published manifests.
#
-# We shouldn't have to ignore the error from pkgdepend, but until
-# 16012 and its dependencies are resolved, pkgdepend will always exit
-# with an error.
-#
$(PDIR)/gendeps: $(DEP_SYNTH_PKGS) $(DEP_PKGS)
- -$(PKGDEBUG)if [ "$(SUPPRESSPKGDEP)" = "true" ]; then \
+ $(PKGDEBUG)if [ "$(SUPPRESSPKGDEP)" = "true" ]; then \
print "Suppressing dependency resolution"; \
for p in $(DEP_PKGS:%.dep=%); do \
$(CP) $$p.dep $$p.res; \
@@ -528,7 +533,7 @@ $(REPOS:%=$(PKGDEST)/repo.%):
# pkgmogrify encounters an abort in the publish transforms.
#
-.SUFFIXES: .mf .mog .dep .res .pub
+.SUFFIXES: .mf .mog .dep .res .fin .pub
$(PDIR)/%.mog: manifests/%.mf
@print "Processing manifest $(<F)"
@@ -572,7 +577,17 @@ $(PDIR)/%.dep: $(PDIR)/%.mog
# on a per-manifest basis. Instead, see the gendeps rule above.
#
-$(PDIR)/%.pub: $(PDIR)/%.res
+$(PDIR)/%.fin: $(PDIR)/%.res
+ $(PKGDEBUG)$(RM) $(@)
+ $(PKGDEBUG)if [ -s $(<) ]; then \
+ print "Running final transforms for $(<F)"; \
+ $(PKGMOGRIFY) $(PKGMOG_VERBOSE) $(PM_INC:%= -I %) -O $(@) \
+ $(<) $(PM_FINAL_TRANSFORMS); \
+ else \
+ $(TOUCH) $(@); \
+ fi
+
+$(PDIR)/%.pub: $(PDIR)/%.fin
$(PKGDEBUG)m=$$(basename $(@:%.pub=%).metadata.*); \
r=$${m#$(@F:%.pub=%.metadata.)+(?).}; \
if [ -s $(<) ]; then \
@@ -690,7 +705,27 @@ pmodes: makesilent
@validate_pkg -a $(PKGMACH) -M -m $(PDIR) \
-e $(CODEMGR_WS)/exception_lists/pmodes
-check: protocmp pmodes
+pkglint: makesilent
+ $(PKGDEBUG)$(CP) etc/pkglintrc $(PDIR)/pkglintrc
+ $(PKGDEBUG)$(GREP) pkg:/ $(CODEMGR_WS)/exception_lists/packaging.deps \
+ | sed 's/.*/ & \\/' >> $(PDIR)/pkglintrc
+ $(PKGDEBUG)echo " pkg:/runtime/python$(PYTHON_PKGVERS) \\" \
+ >> $(PDIR)/pkglintrc
+ $(PKGDEBUG)echo " pkg:/runtime/python$(PYTHON3_PKGVERS) \\" \
+ >> $(PDIR)/pkglintrc
+ $(PKGDEBUG) echo " pkg:/runtime/perl$(PERL_PKGVERS) \\" \
+ >> $(PDIR)/pkglintrc
+ $(PKGDEBUG)echo >> $(PDIR)/pkglintrc
+ $(PKGDEBUG)$(RM) -rf $(PKGDEST)/lint.image
+ $(PKGDEBUG)for r in $(REPOS); do \
+ pkglint \
+ -f $(PDIR)/pkglintrc \
+ -c $(PKGDEST)/lint.image \
+ -r $(PKGDEST)/repo.$$r \
+ `$(FIND) $(PDIR) -name \*.fin \! -size 0c -print`; \
+ done
+
+check: protocmp pmodes pkglint
protolist: proto_list_$(PKGMACH)
diff --git a/usr/src/pkg/etc/pkglintrc b/usr/src/pkg/etc/pkglintrc
new file mode 100644
index 0000000000..a7aa00e5e7
--- /dev/null
+++ b/usr/src/pkg/etc/pkglintrc
@@ -0,0 +1,26 @@
+# 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 OmniOS Community Edition (OmniOSce) Association.
+
+[pkglint]
+use_progress_tracker = False
+log_level = INFO
+do_pub_checks = True
+version.pattern = *,5.11-
+pkglint001.5.report-linted = False
+
+pkglint.exclude = \
+ pkg.lint.pkglint_action.PkgActionChecker.linted \
+ pkg.lint.pkglint_manifest.PkgManifestChecker.linted \
+ pkg.lint.pkglint_manifest.PkgManifestChecker.bogus_description \
+ pkg.lint.pkglint_manifest.PkgManifestChecker.naming \
+ pkg.lint.pkglint_manifest.PkgManifestChecker.duplicate_deps
+
+pkglint.action005.1.missing-deps = \
diff --git a/usr/src/pkg/manifests/consolidation-l10n-l10n-incorporation.mf b/usr/src/pkg/manifests/consolidation-l10n-l10n-incorporation.mf
index b866b30345..96a23f12f1 100644
--- a/usr/src/pkg/manifests/consolidation-l10n-l10n-incorporation.mf
+++ b/usr/src/pkg/manifests/consolidation-l10n-l10n-incorporation.mf
@@ -11,8 +11,10 @@
# Copyright 2011, Richard Lowe.
# Copyright 2018 Alexander Pyhalov
+# Copyright 2020 OmniOS Community Edition (OmniOSce) Association.
set name=pkg.fmri value=pkg:/consolidation/l10n/l10n-incorporation@$(PKGVERS)
+set name=pkg.linted value=True
# Don't incorporate, as we were one and that would get deeply confusing
set name=org.opensolaris.noincorp value=true
set name=variant.arch value=$(ARCH)
diff --git a/usr/src/pkg/manifests/consolidation-sunpro-sunpro-incorporation.mf b/usr/src/pkg/manifests/consolidation-sunpro-sunpro-incorporation.mf
index 9c9afc945d..422653755f 100644
--- a/usr/src/pkg/manifests/consolidation-sunpro-sunpro-incorporation.mf
+++ b/usr/src/pkg/manifests/consolidation-sunpro-sunpro-incorporation.mf
@@ -10,9 +10,11 @@
#
# Copyright 2011, Richard Lowe.
+# Copyright 2020 OmniOS Community Edition (OmniOSce) Association.
set name=pkg.fmri \
value=pkg:/consolidation/sunpro/sunpro-incorporation@$(PKGVERS)
+set name=pkg.linted value=True
# Don't incorporate, as we were one and that would get deeply confusing
set name=org.opensolaris.noincorp value=true
set name=variant.arch value=$(ARCH)
diff --git a/usr/src/pkg/manifests/developer-build-onbld.mf b/usr/src/pkg/manifests/developer-build-onbld.mf
index 309ee71d4c..53a9df7eb8 100644
--- a/usr/src/pkg/manifests/developer-build-onbld.mf
+++ b/usr/src/pkg/manifests/developer-build-onbld.mf
@@ -26,7 +26,7 @@
# Copyright 2014 Garrett D'Amore <garrett@damore.org>
# Copyright 2019 Joyent, Inc.
# Copyright 2016 Toomas Soome <tsoome@me.com>
-# Copyright 2018 OmniOS Community Edition (OmniOSce) Association.
+# Copyright 2020 OmniOS Community Edition (OmniOSce) Association.
#
set name=pkg.fmri value=pkg:/developer/build/onbld@$(PKGVERS)
@@ -105,22 +105,27 @@ file path=opt/onbld/bin/Install mode=0555
file path=opt/onbld/bin/bldenv mode=0555
file path=opt/onbld/bin/bringovercheck mode=0555
file path=opt/onbld/bin/build_cscope mode=0555
-file path=opt/onbld/bin/cddlchk mode=0555
+file path=opt/onbld/bin/cddlchk mode=0555 \
+ pkg.depend.bypass-generate=.*(?:Checks|onbld|Cddl).*
file path=opt/onbld/bin/check_rtime mode=0555
file path=opt/onbld/bin/checkpaths mode=0555
-file path=opt/onbld/bin/copyrightchk mode=0555
+file path=opt/onbld/bin/copyrightchk mode=0555 \
+ pkg.depend.bypass-generate=.*(?:Checks|onbld|Copyright).*
file path=opt/onbld/bin/cstyle mode=0555
file path=opt/onbld/bin/elfcmp mode=0555
file path=opt/onbld/bin/find_elf mode=0555
file path=opt/onbld/bin/findcrypto mode=0555
file path=opt/onbld/bin/flg.flp mode=0555
file path=opt/onbld/bin/genoffsets mode=0555
-file path=opt/onbld/bin/git-pbchk mode=0555
-file path=opt/onbld/bin/hdrchk mode=0555
+file path=opt/onbld/bin/git-pbchk mode=0555 \
+ pkg.depend.bypass-generate=.*(?:Checks|onbld|cStringIO).*
+file path=opt/onbld/bin/hdrchk mode=0555 \
+ pkg.depend.bypass-generate=.*(?:Checks|onbld|HdrChk).*
file path=opt/onbld/bin/interface_check mode=0555
file path=opt/onbld/bin/interface_cmp mode=0555
file path=opt/onbld/bin/jstyle mode=0555
-file path=opt/onbld/bin/mapfilechk mode=0555
+file path=opt/onbld/bin/mapfilechk mode=0555 \
+ pkg.depend.bypass-generate=.*(?:Checks|onbld).*
file path=opt/onbld/bin/nightly mode=0555
file path=opt/onbld/bin/onu mode=0555
file path=opt/onbld/bin/protocmp.terse mode=0555
@@ -134,8 +139,12 @@ file path=opt/onbld/bin/wdiff mode=0555
file path=opt/onbld/bin/webrev mode=0555
file path=opt/onbld/bin/which_scm mode=0555
file path=opt/onbld/bin/ws mode=0555
-file path=opt/onbld/bin/wscheck mode=0555
-file path=opt/onbld/bin/wsdiff mode=0555
+file path=opt/onbld/bin/wscheck mode=0555 \
+ pkg.depend.bypass-generate=.*(?:Checks|onbld|WsCheck).*
+# wsdiff does not import the commands module when run under python3 but
+# pkgdepend still tries to resolve it, and fails.
+file path=opt/onbld/bin/wsdiff mode=0555 \
+ pkg.depend.bypass-generate=.*commands.*
file path=opt/onbld/bin/xref mode=0555
file path=opt/onbld/bin/xref.mk
file path=opt/onbld/env/illumos
diff --git a/usr/src/pkg/manifests/driver-xvm-pv.mf b/usr/src/pkg/manifests/driver-xvm-pv.mf
index c207dbc1f5..46a09b79c1 100644
--- a/usr/src/pkg/manifests/driver-xvm-pv.mf
+++ b/usr/src/pkg/manifests/driver-xvm-pv.mf
@@ -21,6 +21,7 @@
#
# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright 2020 OmniOS Community Edition (OmniOSce) Association.
#
#
@@ -47,7 +48,9 @@ file path=platform/$(ARCH32)hvm/kernel/drv/$(ARCH64)/cmdk group=sys
file path=platform/$(ARCH32)hvm/kernel/drv/$(ARCH64)/rtls group=sys
file path=platform/$(ARCH32)hvm/kernel/drv/$(ARCH64)/xdf group=sys
file path=platform/$(ARCH32)hvm/kernel/drv/$(ARCH64)/xnf group=sys
-file path=platform/$(ARCH32)hvm/kernel/drv/$(ARCH64)/xpv group=sys
+# pkgdepend does not know to also look for modules in the base platform
+file path=platform/$(ARCH32)hvm/kernel/drv/$(ARCH64)/xpv group=sys \
+ pkg.depend.runpath=$PKGDEPEND_RUNPATH:/platform/$(ARCH32)pc/kernel
file path=platform/$(ARCH32)hvm/kernel/drv/$(ARCH64)/xpvd group=sys
file path=platform/$(ARCH32)hvm/kernel/drv/xpv.conf group=sys
file path=platform/$(ARCH32)hvm/kernel/drv/xpvd.conf group=sys
diff --git a/usr/src/pkg/manifests/system-kernel-platform.mf b/usr/src/pkg/manifests/system-kernel-platform.mf
index d306668d50..29538ccd9b 100644
--- a/usr/src/pkg/manifests/system-kernel-platform.mf
+++ b/usr/src/pkg/manifests/system-kernel-platform.mf
@@ -25,7 +25,7 @@
# Copyright 2014 Gary Mills
# Copyright 2020 Peter Tribble.
# Copyright 2019 Joyent, Inc.
-# Copyright 2019 OmniOS Community Edition (OmniOSce) Association.
+# Copyright 2020 OmniOS Community Edition (OmniOSce) Association.
#
#
@@ -691,7 +691,8 @@ $(sparc_ONLY)file \
group=sys mode=0755
$(sparc_ONLY)file path=platform/SUNW,UltraAX-i2/kernel/misc/$(ARCH64)/platmod \
group=sys mode=0755
-$(i386_ONLY)file path=platform/i86pc/kernel/$(ARCH64)/unix group=sys mode=0755
+$(i386_ONLY)file path=platform/i86pc/kernel/$(ARCH64)/unix group=sys mode=0755 \
+ pkg.depend.bypass-generate=dtracestubs
$(i386_ONLY)file path=platform/i86pc/kernel/cpu/$(ARCH64)/cpu.generic \
group=sys mode=0755
$(i386_ONLY)file path=platform/i86pc/kernel/cpu/$(ARCH64)/cpu_ms.AuthenticAMD \
@@ -732,7 +733,7 @@ $(i386_ONLY)file path=platform/i86pc/kernel/misc/$(ARCH64)/acpidev group=sys \
$(i386_ONLY)file path=platform/i86pc/kernel/misc/$(ARCH64)/gfx_private \
group=sys mode=0755
$(i386_ONLY)file path=platform/i86xpv/kernel/$(ARCH64)/unix group=sys \
- mode=0755
+ mode=0755 pkg.depend.bypass-generate=dtracestubs
$(i386_ONLY)file path=platform/i86xpv/kernel/cpu/$(ARCH64)/cpu.generic \
group=sys mode=0755
$(i386_ONLY)file path=platform/i86xpv/kernel/cpu/$(ARCH64)/cpu_ms.AuthenticAMD \
diff --git a/usr/src/pkg/manifests/system-library-libpcsc.mf b/usr/src/pkg/manifests/system-library-libpcsc.mf
index fbf60f6595..b5a26a60d0 100644
--- a/usr/src/pkg/manifests/system-library-libpcsc.mf
+++ b/usr/src/pkg/manifests/system-library-libpcsc.mf
@@ -11,11 +11,13 @@
#
# Copyright 2019, Joyent Inc.
+# Copyright 2020 OmniOS Community Edition (OmniOSce) Association.
#
set name=pkg.fmri value=pkg:/system/library/libpcsc@$(PKGVERS)
set name=pkg.description \
value="PC/SC compatible library for Smart Card access"
+set name=pkg.summary value="PC/SC compatible library for Smart Card access"
set name=info.classification \
value=org.opensolaris.category.2008:System/Libraries
set name=variant.arch value=$(ARCH)
diff --git a/usr/src/pkg/manifests/system-library-libutempter.mf b/usr/src/pkg/manifests/system-library-libutempter.mf
index e883545383..82a1a526ea 100644
--- a/usr/src/pkg/manifests/system-library-libutempter.mf
+++ b/usr/src/pkg/manifests/system-library-libutempter.mf
@@ -15,7 +15,7 @@ set name=pkg.description \
set name=pkg.summary \
value="Interface to record user sessions in utmpx database"
set name=info.classification \
- value=org.opensolaris.category.2008:System/Library
+ value=org.opensolaris.category.2008:System/Libraries
set name=variant.arch value=$(ARCH)
dir path=usr group=sys
dir path=usr/include
diff --git a/usr/src/pkg/manifests/system-library-math.mf b/usr/src/pkg/manifests/system-library-math.mf
index 453a3ba585..55a2c02e67 100644
--- a/usr/src/pkg/manifests/system-library-math.mf
+++ b/usr/src/pkg/manifests/system-library-math.mf
@@ -11,7 +11,7 @@
#
# Copyright (c) 2012, Igor Kozhukhov <ikozhukhov@gmail.com>. All rights reserved.
-# Copyright 2019 OmniOS Community Edition (OmniOSce) Association.
+# Copyright 2020 OmniOS Community Edition (OmniOSce) Association.
#
<include system-library-math.man3m.inc>
@@ -23,7 +23,6 @@ set name=description value="Math Libraries"
set name=info.classification \
value=org.opensolaris.category.2008:System/Libraries
set name=variant.arch value=$(ARCH)
-set name=variant.opensolaris.zone value=global value=nonglobal
dir path=lib
dir path=lib/$(ARCH64)
$(sparc_ONLY)dir path=lib/cpu
diff --git a/usr/src/pkg/manifests/system-library-python-libbe-2.mf b/usr/src/pkg/manifests/system-library-python-libbe-2.mf
index c4d108c5f9..6977994c6c 100644
--- a/usr/src/pkg/manifests/system-library-python-libbe-2.mf
+++ b/usr/src/pkg/manifests/system-library-python-libbe-2.mf
@@ -19,13 +19,15 @@
# CDDL HEADER END
#
#
-# Copyright 2018 OmniOS Community Edition (OmniOSce) Association.
+# Copyright 2020 OmniOS Community Edition (OmniOSce) Association.
#
set name=pkg.fmri \
value=pkg:/system/library/python/libbe$(PYTHON_PKGVERS)@$(PKGVERS)
set name=pkg.description value="Boot Environment Management Python2 Module"
set name=pkg.summary value="py_libbe module, python2"
+set name=info.classification \
+ value=org.opensolaris.category.2008:System/Libraries
set name=variant.arch value=$(ARCH)
dir path=usr group=sys
dir path=usr/lib
diff --git a/usr/src/pkg/manifests/system-library-python-libbe-3.mf b/usr/src/pkg/manifests/system-library-python-libbe-3.mf
index 43ab32586b..28495e9aab 100644
--- a/usr/src/pkg/manifests/system-library-python-libbe-3.mf
+++ b/usr/src/pkg/manifests/system-library-python-libbe-3.mf
@@ -19,13 +19,15 @@
# CDDL HEADER END
#
#
-# Copyright 2018 OmniOS Community Edition (OmniOSce) Association.
+# Copyright 2020 OmniOS Community Edition (OmniOSce) Association.
#
set name=pkg.fmri \
value=pkg:/system/library/python/libbe$(PYTHON3_PKGVERS)@$(PKGVERS)
set name=pkg.description value="Boot Environment Management Python3 Module"
set name=pkg.summary value="py_libbe module, python3"
+set name=info.classification \
+ value=org.opensolaris.category.2008:System/Libraries
set name=variant.arch value=$(ARCH)
dir path=usr group=sys
dir path=usr/lib
diff --git a/usr/src/pkg/manifests/system-library-python-solaris-2.mf b/usr/src/pkg/manifests/system-library-python-solaris-2.mf
index 4b2bced94e..503919e3ee 100644
--- a/usr/src/pkg/manifests/system-library-python-solaris-2.mf
+++ b/usr/src/pkg/manifests/system-library-python-solaris-2.mf
@@ -19,12 +19,14 @@
# CDDL HEADER END
#
-# Copyright 2018 OmniOS Community Edition (OmniOSce) Association.
+# Copyright 2020 OmniOS Community Edition (OmniOSce) Association.
set name=pkg.fmri \
value=pkg:/system/library/python/solaris$(PYTHON_PKGVERS)@$(PKGVERS)
set name=pkg.description value="Solaris Python2 Module"
set name=pkg.summary value="solaris module, python2"
+set name=info.classification \
+ value=org.opensolaris.category.2008:System/Libraries
set name=variant.arch value=$(ARCH)
dir path=usr group=sys
dir path=usr/lib
diff --git a/usr/src/pkg/manifests/system-library-python-solaris-3.mf b/usr/src/pkg/manifests/system-library-python-solaris-3.mf
index 92c3c3a9dd..f98edd3da5 100644
--- a/usr/src/pkg/manifests/system-library-python-solaris-3.mf
+++ b/usr/src/pkg/manifests/system-library-python-solaris-3.mf
@@ -19,12 +19,14 @@
# CDDL HEADER END
#
-# Copyright 2018 OmniOS Community Edition (OmniOSce) Association.
+# Copyright 2020 OmniOS Community Edition (OmniOSce) Association.
set name=pkg.fmri \
value=pkg:/system/library/python/solaris$(PYTHON3_PKGVERS)@$(PKGVERS)
set name=pkg.description value="Solaris Python3 Module"
set name=pkg.summary value="solaris module, python3"
+set name=info.classification \
+ value=org.opensolaris.category.2008:System/Libraries
set name=variant.arch value=$(ARCH)
dir path=usr group=sys
dir path=usr/lib
diff --git a/usr/src/pkg/manifests/system-library-python-zfs-2.mf b/usr/src/pkg/manifests/system-library-python-zfs-2.mf
index b95b383e76..f53029d45a 100644
--- a/usr/src/pkg/manifests/system-library-python-zfs-2.mf
+++ b/usr/src/pkg/manifests/system-library-python-zfs-2.mf
@@ -20,13 +20,15 @@
#
#
-# Copyright 2018 OmniOS Community Edition (OmniOSce) Association.
+# Copyright 2020 OmniOS Community Edition (OmniOSce) Association.
#
set name=pkg.fmri \
value=pkg:/system/library/python/zfs$(PYTHON_PKGVERS)@$(PKGVERS)
set name=pkg.description value="ZFS Python2 Module"
set name=pkg.summary value="zfs module, python2"
+set name=info.classification \
+ value=org.opensolaris.category.2008:System/Libraries
set name=variant.arch value=$(ARCH)
dir path=usr group=sys
dir path=usr/lib
diff --git a/usr/src/pkg/manifests/system-library-python-zfs-3.mf b/usr/src/pkg/manifests/system-library-python-zfs-3.mf
index 86236f5127..804dc80c64 100644
--- a/usr/src/pkg/manifests/system-library-python-zfs-3.mf
+++ b/usr/src/pkg/manifests/system-library-python-zfs-3.mf
@@ -20,13 +20,15 @@
#
#
-# Copyright 2018 OmniOS Community Edition (OmniOSce) Association.
+# Copyright 2020 OmniOS Community Edition (OmniOSce) Association.
#
set name=pkg.fmri \
value=pkg:/system/library/python/zfs$(PYTHON3_PKGVERS)@$(PKGVERS)
set name=pkg.description value="ZFS Python3 Module"
set name=pkg.summary value="zfs module, python3"
+set name=info.classification \
+ value=org.opensolaris.category.2008:System/Libraries
set name=variant.arch value=$(ARCH)
dir path=usr group=sys
dir path=usr/lib
diff --git a/usr/src/pkg/manifests/system-library.man3scf.inc b/usr/src/pkg/manifests/system-library.man3scf.inc
index d26af9e51b..7d8c7380cd 100644
--- a/usr/src/pkg/manifests/system-library.man3scf.inc
+++ b/usr/src/pkg/manifests/system-library.man3scf.inc
@@ -12,6 +12,7 @@
#
# Copyright 2011, Richard Lowe
# Copyright 2012 Nexenta Systems, Inc. All rights reserved.
+# Copyright 2020 Joyent, Inc.
#
file path=usr/share/man/man3scf/scf_entry_create.3scf
@@ -425,6 +426,8 @@ link path=usr/share/man/man3scf/smf_degrade_instance.3scf \
target=smf_enable_instance.3scf
link path=usr/share/man/man3scf/smf_disable_instance.3scf \
target=smf_enable_instance.3scf
+link path=usr/share/man/man3scf/smf_disable_instance_with_comment.3scf \
+ target=smf_enable_instance.3scf
link path=usr/share/man/man3scf/smf_get_state.3scf \
target=smf_enable_instance.3scf
link path=usr/share/man/man3scf/smf_maintain_instance.3scf \
diff --git a/usr/src/pkg/manifests/system-microcode-amd.mf b/usr/src/pkg/manifests/system-microcode-amd.mf
index 22d43700f8..7a15f6ea12 100644
--- a/usr/src/pkg/manifests/system-microcode-amd.mf
+++ b/usr/src/pkg/manifests/system-microcode-amd.mf
@@ -25,7 +25,7 @@
# Copyright 2014 Gary Mills
# Copyright 2019 Peter Tribble.
# Copyright 2019 Joyent, Inc.
-# Copyright 2019 OmniOS Community Edition (OmniOSce) Association.
+# Copyright 2020 OmniOS Community Edition (OmniOSce) Association.
#
#
@@ -37,6 +37,8 @@
set name=pkg.fmri \
value=pkg:/system/microcode/amd@201203,$(PKGVERS_BUILTON)-$(PKGVERS_BRANCH)
set name=pkg.description value="Microcode for AMD CPUs"
+set name=pkg.summary value="Microcode for AMD CPUs"
+set name=info.classification value=org.opensolaris.category.2008:System/Core
set name=org.opensolaris.incorp-facet value=true
set name=variant.arch value=i386
dir path=platform group=sys
diff --git a/usr/src/pkg/manifests/system-microcode-intel.mf b/usr/src/pkg/manifests/system-microcode-intel.mf
index bac6419d24..70a0acb483 100644
--- a/usr/src/pkg/manifests/system-microcode-intel.mf
+++ b/usr/src/pkg/manifests/system-microcode-intel.mf
@@ -37,6 +37,8 @@
set name=pkg.fmri \
value=pkg:/system/microcode/intel@20200508,$(PKGVERS_BUILTON)-$(PKGVERS_BRANCH)
set name=pkg.description value="Microcode for Intel CPUs"
+set name=pkg.summary value="Microcode for Intel CPUs"
+set name=info.classification value=org.opensolaris.category.2008:System/Core
set name=org.opensolaris.incorp-facet value=true
set name=variant.arch value=i386
dir path=platform group=sys
diff --git a/usr/src/pkg/manifests/system-test-testrunner.mf b/usr/src/pkg/manifests/system-test-testrunner.mf
index 2043b84ea6..0b011b7cf6 100644
--- a/usr/src/pkg/manifests/system-test-testrunner.mf
+++ b/usr/src/pkg/manifests/system-test-testrunner.mf
@@ -11,6 +11,7 @@
#
# Copyright (c) 2012 by Delphix. All rights reserved.
+# Copyright 2020 OmniOS Community Edition (OmniOSce) Association.
#
set name=pkg.fmri value=pkg:/system/test/testrunner@$(PKGVERS)
@@ -27,7 +28,9 @@ dir path=opt/test-runner/stf
dir path=opt/test-runner/stf/contrib
dir path=opt/test-runner/stf/contrib/include
dir path=opt/test-runner/stf/include
-file path=opt/test-runner/bin/run mode=0555
+# In python2, the module is "ConfigParser" and in python3 it's "configparser"
+file path=opt/test-runner/bin/run mode=0555 \
+ pkg.depend.bypass-generate=.*[cC]onfig[pP]arser.*
file path=opt/test-runner/man/man1/run.1 mode=0444
file path=opt/test-runner/stf/contrib/include/ctiutils.shlib mode=0555
file path=opt/test-runner/stf/contrib/include/logapi.shlib mode=0555
diff --git a/usr/src/pkg/osnet-incorporation.mf b/usr/src/pkg/osnet-incorporation.mf
index bd079564cf..2528bd4d7a 100644
--- a/usr/src/pkg/osnet-incorporation.mf
+++ b/usr/src/pkg/osnet-incorporation.mf
@@ -23,12 +23,15 @@
# Copyright 2010 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
+# Copyright 2020 OmniOS Community Edition (OmniOSce) Association.
+#
set name=pkg.fmri value=pkg:/consolidation/osnet/osnet-incorporation@$(PKGVERS)
set name=variant.arch value=$(ARCH)
set name=pkg.description value="This incorporation constrains packages from the OS/Net consolidation."
set name=pkg.summary value="OS/Net consolidation incorporation"
set name=pkg.depend.install-hold value=core-os.osnet
+set name=pkg.linted.opensolaris.manifest001.1 value=True
<include packages.redist.current>
<include packages.redist.renamed>
<include packages.redist.obsolete>
diff --git a/usr/src/pkg/osnet-redist.mf b/usr/src/pkg/osnet-redist.mf
index 7a20e0a9c0..ea2bf12f6f 100644
--- a/usr/src/pkg/osnet-redist.mf
+++ b/usr/src/pkg/osnet-redist.mf
@@ -23,9 +23,12 @@
# Copyright 2010 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
+# Copyright 2020 OmniOS Community Edition (OmniOSce) Association.
+#
set name=pkg.fmri value=pkg:/consolidation/osnet/osnet-redistributable@$(PKGVERS)
set name=variant.arch value=$(ARCH)
set name=pkg.description value="This group package installs all packages from the OS/Net consolidation."
+set name=pkg.linted.opensolaris.manifest001.1 value=True
set name=pkg.summary value="OS/Net consolidation group package"
<include packages.redist.current>
diff --git a/usr/src/pkg/transforms/strip_dependinfo b/usr/src/pkg/transforms/strip_dependinfo
new file mode 100644
index 0000000000..bf205008f6
--- /dev/null
+++ b/usr/src/pkg/transforms/strip_dependinfo
@@ -0,0 +1,29 @@
+#
+# This file and its contents are supplied under the terms of the
+# Common Development and Distribution License ("CDDL"). You may
+# only use this file in accordance with the terms 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 Alexander Pyhalov
+# Copyright 2020 OmniOS Community Edition (OmniOSce) Association.
+#
+
+#
+# These transforms drop the information that we don't want to appear
+# in final package versions.
+#
+
+# Drop pkg.depend.bypass-generate attributes
+<transform file -> delete pkg.depend.bypass-generate .*>
+
+# Drop pkg.depend.runpath attributes
+<transform file -> delete pkg.depend.runpath .*>
+
+# Remove pkg debug information
+<transform set name=pkg.debug.* -> drop>
+
diff --git a/usr/src/tools/scripts/nightly b/usr/src/tools/scripts/nightly
index f6b536c924..760b549231 100755
--- a/usr/src/tools/scripts/nightly
+++ b/usr/src/tools/scripts/nightly
@@ -27,9 +27,9 @@
# Copyright 2012 Joshua M. Clulow <josh@sysmgr.org>
# Copyright (c) 2017 by Delphix. All rights reserved.
# Copyright 2020 Joyent, Inc.
-# Copyright 2018 OmniOS Community Edition (OmniOSce) Association.
# Copyright 2019 Peter Trible.
# Copyright 2020 Oxide Computer Company
+# Copyright 2020 OmniOS Community Edition (OmniOSce) Association.
#
# Based on the nightly script from the integration folks,
# Mostly modified and owned by mike_s.
@@ -509,6 +509,7 @@ NIGHTLY_OPTIONS variable in the <env_file> as follows:
-F do _not_ do a non-DEBUG build
-G gate keeper default group of options (-au)
-I integration engineer default group of options (-ampu)
+ -L do not run pkglint
-M do not run pmodes (safe file permission checker)
-N do not run protocmp
-R default group of options for building a release (-mp)
@@ -539,6 +540,7 @@ D_FLAG=n
F_FLAG=n
f_FLAG=n
i_FLAG=n; i_CMD_LINE_FLAG=n
+L_FLAG=n
M_FLAG=n
m_FLAG=n
N_FLAG=n
@@ -718,7 +720,7 @@ check_closed_bins
#
NIGHTLY_OPTIONS=-${NIGHTLY_OPTIONS#-}
OPTIND=1
-while getopts +ABCDdFfGIiMmNnpRrtUuwW FLAG $NIGHTLY_OPTIONS
+while getopts +ABCDdFfGIiLMmNnpRrtUuwW FLAG $NIGHTLY_OPTIONS
do
case $FLAG in
A ) A_FLAG=y
@@ -741,6 +743,8 @@ do
;;
i ) i_FLAG=y
;;
+ L ) L_FLAG=y
+ ;;
M ) M_FLAG=y
;;
m ) m_FLAG=y
@@ -1974,17 +1978,17 @@ if [ "$CHECK_PATHS" = y -a "$N_FLAG" != y ]; then
fi
fi
+abspkg=
+for d in $abssrcdirs; do
+ if [ -d "$d/pkg" ]; then
+ abspkg="$abspkg $d"
+ fi
+done
+
if [ "$M_FLAG" != "y" -a "$build_ok" = y ]; then
echo "\n==== Impact on file permissions ====\n" \
>> $mail_msg_file
- abspkg=
- for d in $abssrcdirs; do
- if [ -d "$d/pkg" ]; then
- abspkg="$abspkg $d"
- fi
- done
-
if [ -n "$abspkg" ]; then
for d in "$abspkg"; do
( cd $d/pkg ; $MAKE -e pmodes ) >> $mail_msg_file
@@ -1992,6 +1996,22 @@ if [ "$M_FLAG" != "y" -a "$build_ok" = y ]; then
fi
fi
+if [ "$L_FLAG" != "y" -a "$build_ok" = y ]; then
+ echo "\n==== Linting packages ====\n" | \
+ tee -a $LOGFILE >> $mail_msg_file
+
+ if [ -n "$abspkg" ]; then
+ for d in "$abspkg"; do
+ ( cd $d/pkg ; $MAKE -e pkglint ) | \
+ tee -a $LOGFILE | \
+ egrep -v 'Lint engine setup|Starting lint run'
+ done 2>&1 | tee $TMPDIR/pkglint_noise >> $mail_msg_file
+ if [[ -s $TMPDIR/pkglint_noise ]]; then
+ build_extras_ok=n
+ fi
+ fi
+fi
+
if [ "$w_FLAG" = "y" -a "$build_ok" = "y" ]; then
if [[ "$MULTI_PROTO" = no || "$D_FLAG" = y ]]; then
do_wsdiff DEBUG $ROOT.prev $ROOT
diff --git a/usr/src/tools/scripts/nightly.1onbld b/usr/src/tools/scripts/nightly.1onbld
index 51ce222862..d66e8247c0 100644
--- a/usr/src/tools/scripts/nightly.1onbld
+++ b/usr/src/tools/scripts/nightly.1onbld
@@ -19,15 +19,15 @@
.\" "Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
.\" "Copyright 2012 Joshua M. Clulow <josh@sysmgr.org>
.\" "Copyright 2019 Peter Tribble.
+.\" "Copyright 2020 OmniOS Community Edition (OmniOSce) Association.
.\" "
-.TH NIGHTLY 1ONBLD "Jun 9, 2019"
+.TH NIGHTLY 1ONBLD "May 12, 2020"
.SH NAME
.I nightly
\- build an OS-Net consolidation overnight
.SH SYNOPSIS
\fBnightly [-in] [-V VERS] <env_file>\fP
.SH DESCRIPTION
-.LP
.I nightly,
the mother of all build scripts,
can bringover, build, archive, package, error check, and
@@ -85,6 +85,12 @@ check for unreferenced files
report on which proto area objects have changed (since the last build)
.TP
\(bu
+compare the proto area with package manifests
+.TP
+\(bu
+lint the generated packages
+.TP
+\(bu
report the total build time
.TP
\(bu
@@ -128,6 +134,9 @@ Do a build with DEBUG on (non-DEBUG is built by default)
.B \-F
Do _not_ do a non-DEBUG build (use with -D to get just a DEBUG build)
.TP
+.B \-L
+Do not run pkglint
+.TP
.B \-M
Do not run pmodes (safe file permission checker)
.TP
@@ -170,7 +179,7 @@ Send mail to $MAILTO at end of build
.B \-t
Build and use the tools in $SRC/tools (default setting).
.TP
-.B \+t
+.B +t
Use the build tools in "$ONBLD_TOOLS/bin".
.LP
@@ -221,7 +230,6 @@ Default group of options for building a release (-mp)
set the build version string to VERS, overriding VERSION
.SH ENVIRONMENT VARIABLES
-.LP
Here is a list of prominent environment variables that
.I nightly
references and the meaning of each variable.
@@ -446,7 +454,6 @@ the DEBUG build will go in $ROOT and the non-DEBUG build will go in
$ROOT-nd. Other values will be treated as "no".
.RE
.SH NIGHTLY HOOK ENVIRONMENT VARIABLES
-.LP
Several optional environment variables may specify commands to run at
various points during the build. Commands specified in the hook
variable will be run in a subshell; command output will be appended to
@@ -488,7 +495,6 @@ This is reserved for per-build-machine customizations, and runs
immedately after POST_NIGHTLY.
.RE
.SH FILES
-.LP
.RS 5
/etc/nightly.conf
.RE
@@ -497,9 +503,8 @@ If present, nightly executes this file just prior to executing the
.I env
file.
.SH EXAMPLES
-.LP
-Start with the example file in usr/src/tools/env/developer.sh
-(or gatekeeper.sh), copy to myenv and make your changes.
+Start with the example file in usr/src/tools/env/illumos.sh,
+copy to myenv and make your changes.
.LP
.PD 0
# grep NIGHTLY_OPTIONS myenv
diff --git a/usr/src/uts/common/os/clock_highres.c b/usr/src/uts/common/os/clock_highres.c
index 1280c8a1b6..27bc319ee6 100644
--- a/usr/src/uts/common/os/clock_highres.c
+++ b/usr/src/uts/common/os/clock_highres.c
@@ -93,7 +93,7 @@ clock_highres_fire(void *arg)
static int
clock_highres_timer_settime(itimer_t *it, int flags,
- const struct itimerspec *when)
+ const struct itimerspec *when)
{
cyclic_id_t cyc, *cycp = it->it_arg;
proc_t *p = curproc;
diff --git a/usr/src/uts/intel/ipd/Makefile b/usr/src/uts/intel/ipd/Makefile
index 27a0b6b79c..701e24cf73 100644
--- a/usr/src/uts/intel/ipd/Makefile
+++ b/usr/src/uts/intel/ipd/Makefile
@@ -12,6 +12,7 @@
#
# Copyright 2012 Joyent, Inc. All rights reserved.
# Use is subject to license terms.
+# Copyright 2020 OmniOS Community Edition (OmniOSce) Association.
#
UTSBASE = ../..
@@ -28,7 +29,7 @@ ALL_TARGET = $(BINARY) $(SRC_CONFILE)
LINT_TARGET = $(MODULE).lint
INSTALL_TARGET = $(BINARY) $(ROOTMODULE) $(ROOT_CONFFILE)
-LDFLAGS += -dy -Nmisc/neti -Nmisch/hook
+LDFLAGS += -dy -Nmisc/neti -Nmisc/hook
.KEEP_STATE:
diff --git a/usr/src/uts/sparc/ipd/Makefile b/usr/src/uts/sparc/ipd/Makefile
index 9239c97203..597bf0fb8d 100644
--- a/usr/src/uts/sparc/ipd/Makefile
+++ b/usr/src/uts/sparc/ipd/Makefile
@@ -13,6 +13,7 @@
# Copyright 2012 Joyent, Inc. All rights reserved.
# Copyright (c) 2014 Igor Kozhukhov <ikozhukhov@gmail.com>
# Use is subject to license terms.
+# Copyright 2020 OmniOS Community Edition (OmniOSce) Association.
#
UTSBASE = ../..
@@ -29,7 +30,7 @@ ALL_TARGET = $(BINARY) $(SRC_CONFILE)
LINT_TARGET = $(MODULE).lint
INSTALL_TARGET = $(BINARY) $(ROOTMODULE) $(ROOT_CONFFILE)
-LDFLAGS += -dy -Nmisc/neti -Nmisch/hook
+LDFLAGS += -dy -Nmisc/neti -Nmisc/hook
.KEEP_STATE: