summaryrefslogtreecommitdiff
path: root/usr/src
diff options
context:
space:
mode:
Diffstat (limited to 'usr/src')
-rw-r--r--usr/src/cmd/svc/seed/Makefile279
1 files changed, 172 insertions, 107 deletions
diff --git a/usr/src/cmd/svc/seed/Makefile b/usr/src/cmd/svc/seed/Makefile
index 561d1cb700..32b27326fe 100644
--- a/usr/src/cmd/svc/seed/Makefile
+++ b/usr/src/cmd/svc/seed/Makefile
@@ -23,6 +23,7 @@
# Copyright 2010 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
# Copyright 2016 Nexenta Systems, Inc.
+# Copyright 2021 OmniOS Community Edition (OmniOSce) Association.
#
include ../../Makefile.cmd
@@ -37,80 +38,101 @@ INSTALLSEED = $(ROOT)/usr/sadm/install
# on the build system or in the proto area: libscf, libuutil, and libxml2.
#
+MFST_ROOT=lib/svc/manifest
+MFST_TYPE= \
+ system \
+ system/device \
+ system/filesystem \
+ system/svc \
+ milestone \
+ network \
+ network/dns \
+ network/ldap \
+ network/nis \
+ network/rpc
+
+MFST_DIRS = $(MFST_TYPE:%=$(MFST_ROOT)/%)
+
#
# We build and deliver 3 seed repositories:
-# global.db -- for a standalone Solaris (global zone)
-# nonglobal.db -- for a Solaris Zone
+# global.db -- for a standalone system (global zone)
+# nonglobal.db -- for a non-global zone
# miniroot.db -- for the install miniroot
-# COMMON_DESCRIPTIONS contains manifests needed by all 3 repositories.
-# GLOBAL_ZONE_DESCRIPTIONS/NONGLOBAL_ZONE_DESCRIPTIONS/MINIROOT_DESCRIPTIONS
-# contain additional manifests needed.
+#
+# COMMON_MANIFESTS contains manifests needed by all 3 repositories.
+# {GLOBAL_ZONE,NONGLOBAL_ZONE,MINIROOT}_MANIFESTS
+# contain additional manifests needed.
#
#
-# Manifests needed by all seed repositories. If you change this, you
-# must test Solaris standalone, Solaris zone, and Install miniroot.
+# Manifests needed by all seed repositories.
#
-COMMON_DESCRIPTIONS = \
- ../milestone/boot-archive.xml \
- ../milestone/devices-local.xml \
- ../milestone/global.xml \
- ../milestone/identity.xml \
- ../milestone/local-fs.xml \
- ../milestone/manifest-import.xml \
- ../milestone/minimal-fs.xml \
- ../milestone/multi-user.xml \
- ../milestone/name-services.xml \
- ../milestone/network-initial.xml \
- ../milestone/network-loopback.xml \
- ../milestone/network-netcfg.xml \
- ../milestone/network-physical.xml \
- ../milestone/restarter.xml \
- ../milestone/root-fs.xml \
- ../milestone/single-user.xml \
- ../milestone/usr-fs.xml \
- ../../dlmgmtd/dlmgmt.xml \
- ../../cmd-inet/lib/ipmgmtd/network-ipmgmt.xml \
- ../../rpcbind/bind.xml
+COMMON_MANIFESTS = \
+ milestone/multi-user.xml \
+ milestone/name-services.xml \
+ milestone/single-user.xml \
+ network/dlmgmt.xml \
+ network/network-initial.xml \
+ network/network-ipmgmt.xml \
+ network/network-loopback.xml \
+ network/network-netcfg.xml \
+ network/network-physical.xml \
+ network/rpc/bind.xml \
+ system/boot-archive.xml \
+ system/device/devices-local.xml \
+ system/filesystem/local-fs.xml \
+ system/filesystem/minimal-fs.xml \
+ system/filesystem/root-fs.xml \
+ system/filesystem/usr-fs.xml \
+ system/identity.xml \
+ system/manifest-import.xml \
+ system/svc/global.xml \
+ system/svc/restarter.xml
#
-# Additional manifests for standalone Solaris
+# Additional manifests for a standalone system (global zone)
#
-GLOBAL_ZONE_DESCRIPTIONS = \
- ../milestone/console-login.xml \
- ../milestone/multi-user-server.xml \
- ../../cmd-inet/usr.lib/inetd/inetd-upgrade.xml \
- ../../utmpd/utmp.xml
+GLOBAL_ZONE_MANIFESTS = \
+ milestone/multi-user-server.xml \
+ network/inetd-upgrade.xml \
+ system/console-login.xml \
+ system/utmp.xml
#
-# Additional manifests for a Solaris zone
+# Additional manifests for a non-global zone
#
-NONGLOBAL_ZONE_DESCRIPTIONS = \
- ../milestone/console-login.xml \
- ../milestone/multi-user-server.xml \
- ../../utmpd/utmp.xml
+NONGLOBAL_ZONE_MANIFESTS = \
+ milestone/multi-user-server.xml \
+ system/console-login.xml \
+ system/utmp.xml
#
# Additional manifests for the install miniroot.
#
-MINIROOT_DESCRIPTIONS= \
- ../milestone/sysconfig.xml \
- ../../cmd-inet/usr.lib/inetd/inetd.xml \
- ../../cmd-inet/usr.sbin/login.xml \
- ../milestone/network-service.xml \
- ../../cmd-inet/usr.sbin/telnet.xml \
- ../../../lib/libresolv2/client.xml \
- ../../ldapcachemgr/client.xml \
- ../../ypcmd/client.xml \
- ../../ypcmd/server.xml \
- ../../keyserv/keyserv.xml \
- ../../cmd-crypto/scripts/cryptosvc.xml \
- ../../nscd/name-service-cache.xml \
- ../../syslogd/system-log.xml
+MINIROOT_MANIFESTS= \
+ milestone/sysconfig.xml \
+ network/dns/client.xml \
+ network/inetd.xml \
+ network/ldap/client.xml \
+ network/login.xml \
+ network/network-service.xml \
+ network/nis/client.xml \
+ network/nis/server.xml \
+ network/rpc/keyserv.xml \
+ network/telnet.xml \
+ system/cryptosvc.xml \
+ system/name-service-cache.xml \
+ system/system-log.xml
+
+
+COMMON_DESCRIPTIONS=$(COMMON_MANIFESTS:%=$(MFST_ROOT)/%)
+GLOBAL_ZONE_DESCRIPTIONS=$(GLOBAL_ZONE_MANIFESTS:%=$(MFST_ROOT)/%)
+NONGLOBAL_ZONE_DESCRIPTIONS=$(NONGLOBAL_ZONE_MANIFESTS:%=$(MFST_ROOT)/%)
+MINIROOT_DESCRIPTIONS=$(MINIROOT_MANIFESTS:%=$(MFST_ROOT)/%)
FILEMODE = 0600
-SEEDFILEMODE = 0444 # seeds are not intended for editing, but may
- # be copied
+# seeds are not intended for editing, but may be copied
+SEEDFILEMODE = 0444
CONFIGD = ../configd/svc.configd-native
SVCCFG = ../svccfg/svccfg-native
@@ -128,64 +150,44 @@ $(SVCCFG): FRC
../milestone/console-login.xml:
@cd ../milestone; pwd; $(MAKE) console-login.xml
-common.db: $(COMMON_DESCRIPTIONS) $(CONFIGD) $(SVCCFG)
- $(RM) -f common.db common.db-journal
- for m in $(COMMON_DESCRIPTIONS); do \
- echo $$m; \
- SVCCFG_DTD=../dtd/service_bundle.dtd.1 \
- SVCCFG_REPOSITORY=$(SRC)/cmd/svc/seed/common.db \
- SVCCFG_CONFIGD_PATH=$(CONFIGD) \
- $(SVCCFG) import $$m; \
- done
-
-global.db: common.db $(GLOBAL_ZONE_DESCRIPTIONS) $(CONFIGD) $(SVCCFG)
- $(RM) -f global.db global.db-journal
- $(CP) common.db global.db
- for m in $(GLOBAL_ZONE_DESCRIPTIONS); do \
- echo $$m; \
- SVCCFG_DTD=../dtd/service_bundle.dtd.1 \
- SVCCFG_REPOSITORY=$(SRC)/cmd/svc/seed/global.db \
- SVCCFG_CONFIGD_PATH=$(CONFIGD) \
- $(SVCCFG) import $$m; \
- done
-
-nonglobal.db: common.db $(NONGLOBAL_ZONE_DESCRIPTIONS) $(CONFIGD) $(SVCCFG)
- $(RM) -f nonglobal.db nonglobal.db-journal
- $(CP) common.db nonglobal.db
- for m in $(NONGLOBAL_ZONE_DESCRIPTIONS); do \
- echo $$m; \
- SVCCFG_DTD=../dtd/service_bundle.dtd.1 \
- SVCCFG_REPOSITORY=$(SRC)/cmd/svc/seed/nonglobal.db \
- SVCCFG_CONFIGD_PATH=$(CONFIGD) \
- $(SVCCFG) import $$m; \
- done
-
-miniroot.db: common.db $(MINIROOT_DESCRIPTIONS) $(CONFIGD) $(SVCCFG)
- $(RM) -f miniroot.db miniroot.db-journal
- $(CP) common.db miniroot.db
- for m in $(MINIROOT_DESCRIPTIONS); do \
- echo $$m; \
- SVCCFG_DTD=../dtd/service_bundle.dtd.1 \
- SVCCFG_REPOSITORY=$(SRC)/cmd/svc/seed/miniroot.db \
- SVCCFG_CONFIGD_PATH=$(CONFIGD) \
- $(SVCCFG) import $$m; \
- done
+CONFIGD_ENV = \
+ SVCCFG_DTD=../dtd/service_bundle.dtd.1 \
+ PKG_INSTALL_ROOT=$(SRC)/cmd/svc/seed \
+ SVCCFG_REPOSITORY=$(SRC)/cmd/svc/seed/$@ \
+ SVCCFG_CONFIGD_PATH=$(CONFIGD)
+
+IMPORT.mfst = $(CONFIGD_ENV) $(SVCCFG) import
+
+common.db: $(MFST_DIRS) $(COMMON_DESCRIPTIONS) $(CONFIGD) $(SVCCFG)
+ $(RM) -f $@ $@-journal
+ $(IMPORT.mfst) $(COMMON_DESCRIPTIONS)
+
+global.db: common.db $(GLOBAL_ZONE_DESCRIPTIONS)
+ $(RM) -f $@ $@-journal
+ $(CP) common.db $@
+ $(IMPORT.mfst) $(GLOBAL_ZONE_DESCRIPTIONS)
+
+nonglobal.db: common.db $(NONGLOBAL_ZONE_DESCRIPTIONS)
+ $(RM) -f $@ $@-journal
+ $(CP) common.db $@
+ $(IMPORT.mfst) $(NONGLOBAL_ZONE_DESCRIPTIONS)
+
+miniroot.db: common.db $(MINIROOT_DESCRIPTIONS)
+ $(RM) -f $@ $@-journal
+ $(CP) common.db $@
+ $(IMPORT.mfst) $(MINIROOT_DESCRIPTIONS)
#
# Make sure the miniroot's syslogd and rpcbind do not respond
# to packets from outside the machine. Since we cannot set property
# values by applying a profile yet, we need to set them explicitly
# with svccfg commands.
#
- SVCCFG_DTD=../dtd/service_bundle.dtd.1 \
- SVCCFG_REPOSITORY=$(SRC)/cmd/svc/seed/miniroot.db \
- SVCCFG_CONFIGD_PATH=$(CONFIGD) \
- $(SVCCFG) -s svc:/system/system-log \
+ $(CONFIGD_ENV) $(SVCCFG) -s svc:/system/system-log \
setprop config/log_from_remote = false
- #
- SVCCFG_DTD=../dtd/service_bundle.dtd.1 \
- SVCCFG_REPOSITORY=$(SRC)/cmd/svc/seed/miniroot.db \
- SVCCFG_CONFIGD_PATH=$(CONFIGD) \
- $(SVCCFG) -s svc:/network/rpc/bind setprop config/local_only = true
+ $(CONFIGD_ENV) $(SVCCFG) -s svc:/network/rpc/bind \
+ setprop config/local_only = true
+
+.PARALLEL: global.db nonglobal.db miniroot.db
install: install_global install_nonglobal install_miniroot
@@ -204,10 +206,73 @@ install_miniroot: $(INSTALLSEED) miniroot.db
$(INSTALLSEED):
$(INS.dir)
-clean lint:
+clean:
$(RM) common.db
+ $(RM) $(COMMON_DESCRIPTIONS) $(GLOBAL_ZONE_DESCRIPTIONS)
+ $(RM) $(NON_GLOBAL_ZONE_DESCRIPTIONS) $(MINIROOT_DESCRIPTIONS)
clobber:
$(RM) common.db global.db nonglobal.db miniroot.db
+ $(RM) -r lib/
+
+$(MFST_DIRS): FRC
+ $(INS.dir)
+
+$(MFST_ROOT)/milestone/%: ../milestone/%
+ $(INS.file)
+
+$(MFST_ROOT)/network/%: ../../cmd-inet/lib/ipmgmtd/%
+ $(INS.file)
+
+$(MFST_ROOT)/network/%: ../../cmd-inet/usr.lib/inetd/%
+ $(INS.file)
+
+$(MFST_ROOT)/network/%: ../../cmd-inet/usr.sbin/%
+ $(INS.file)
+
+$(MFST_ROOT)/network/%: ../../dlmgmtd/%
+ $(INS.file)
+
+$(MFST_ROOT)/network/%: ../milestone/%
+ $(INS.file)
+
+$(MFST_ROOT)/network/dns/%: ../../../lib/libresolv2/%
+ $(INS.file)
+
+$(MFST_ROOT)/network/ldap/%: ../../ldapcachemgr/%
+ $(INS.file)
+
+$(MFST_ROOT)/network/nis/%: ../../ypcmd/%
+ $(INS.file)
+
+$(MFST_ROOT)/network/rpc/%: ../../keyserv/%
+ $(INS.file)
+
+$(MFST_ROOT)/network/rpc/%: ../../rpcbind/%
+ $(INS.file)
+
+$(MFST_ROOT)/system/%: ../../cmd-crypto/scripts/%
+ $(INS.file)
+
+$(MFST_ROOT)/system/%: ../../nscd/%
+ $(INS.file)
+
+$(MFST_ROOT)/system/%: ../../syslogd/%
+ $(INS.file)
+
+$(MFST_ROOT)/system/%: ../../utmpd/%
+ $(INS.file)
+
+$(MFST_ROOT)/system/%: ../milestone/%
+ $(INS.file)
+
+$(MFST_ROOT)/system/device/%: ../milestone/%
+ $(INS.file)
+
+$(MFST_ROOT)/system/filesystem/%: ../milestone/%
+ $(INS.file)
+
+$(MFST_ROOT)/system/svc/%: ../milestone/%
+ $(INS.file)
FRC: