xref: /titanic_41/usr/src/cmd/svc/seed/Makefile (revision 6e91bba0d6c6bdabbba62cefae583715a4a58e2a)
17c478bd9Sstevel@tonic-gate#
27c478bd9Sstevel@tonic-gate# CDDL HEADER START
37c478bd9Sstevel@tonic-gate#
47c478bd9Sstevel@tonic-gate# The contents of this file are subject to the terms of the
50ea5e3a5Sjjj# Common Development and Distribution License (the "License").
60ea5e3a5Sjjj# You may not use this file except in compliance with the License.
77c478bd9Sstevel@tonic-gate#
87c478bd9Sstevel@tonic-gate# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
97c478bd9Sstevel@tonic-gate# or http://www.opensolaris.org/os/licensing.
107c478bd9Sstevel@tonic-gate# See the License for the specific language governing permissions
117c478bd9Sstevel@tonic-gate# and limitations under the License.
127c478bd9Sstevel@tonic-gate#
137c478bd9Sstevel@tonic-gate# When distributing Covered Code, include this CDDL HEADER in each
147c478bd9Sstevel@tonic-gate# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
157c478bd9Sstevel@tonic-gate# If applicable, add the following below this CDDL HEADER, with the
167c478bd9Sstevel@tonic-gate# fields enclosed by brackets "[]" replaced with your own identifying
177c478bd9Sstevel@tonic-gate# information: Portions Copyright [yyyy] [name of copyright owner]
187c478bd9Sstevel@tonic-gate#
197c478bd9Sstevel@tonic-gate# CDDL HEADER END
207c478bd9Sstevel@tonic-gate#
216ba597c5SAnurag S. Maskey# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
227c478bd9Sstevel@tonic-gate# Use is subject to license terms.
237c478bd9Sstevel@tonic-gate#
247c478bd9Sstevel@tonic-gate
257c478bd9Sstevel@tonic-gateinclude ../../Makefile.cmd
267c478bd9Sstevel@tonic-gate
277c478bd9Sstevel@tonic-gateETCSVC = $(ROOTETC)/svc
287c478bd9Sstevel@tonic-gateLIBSVCSEED = $(ROOT)/lib/svc/seed
292269adc8SszhouINSTALLSEED = $(ROOT)/usr/sadm/install
307c478bd9Sstevel@tonic-gate
317c478bd9Sstevel@tonic-gate#
327c478bd9Sstevel@tonic-gate# Because seed repository construction requires a functioning repository, a
337c478bd9Sstevel@tonic-gate# working svccfg(1) binary, and XML support, the following libraries must exist
347c478bd9Sstevel@tonic-gate# on the build system or in the proto area:  libscf, libuutil, and libxml2.
357c478bd9Sstevel@tonic-gate#
367c478bd9Sstevel@tonic-gate
377c478bd9Sstevel@tonic-gate#
382269adc8Sszhou# We build and deliver 3 seed repositories:
392269adc8Sszhou#	global.db	-- for a standalone Solaris (global zone)
402269adc8Sszhou#	nonglobal.db	-- for a Solaris Zone
412269adc8Sszhou#	miniroot.db	-- for the install miniroot
422269adc8Sszhou# COMMON_DESCRIPTIONS contains manifests needed by all 3 repositories.
432269adc8Sszhou# GLOBAL_ZONE_DESCRIPTIONS/NONGLOBAL_ZONE_DESCRIPTIONS/MINIROOT_DESCRIPTIONS
442269adc8Sszhou# contain additional manifests needed.
457c478bd9Sstevel@tonic-gate#
462269adc8Sszhou
472269adc8Sszhou#
482269adc8Sszhou# Manifests needed by all seed repositories. If you change this, you
492269adc8Sszhou# must test Solaris standalone, Solaris zone, and Install miniroot.
502269adc8Sszhou#
512269adc8SszhouCOMMON_DESCRIPTIONS = \
527c478bd9Sstevel@tonic-gate	../milestone/boot-archive.xml \
537c478bd9Sstevel@tonic-gate	../milestone/devices-local.xml \
541f6eb021SLiane Praza	../milestone/global.xml \
557c478bd9Sstevel@tonic-gate	../milestone/identity.xml \
567c478bd9Sstevel@tonic-gate	../milestone/local-fs.xml \
577c478bd9Sstevel@tonic-gate	../milestone/manifest-import.xml \
587c478bd9Sstevel@tonic-gate	../milestone/minimal-fs.xml \
597c478bd9Sstevel@tonic-gate	../milestone/multi-user.xml \
607c478bd9Sstevel@tonic-gate	../milestone/name-services.xml \
617c478bd9Sstevel@tonic-gate	../milestone/network-initial.xml \
627c478bd9Sstevel@tonic-gate	../milestone/network-loopback.xml \
636ba597c5SAnurag S. Maskey	../milestone/network-netcfg.xml \
647c478bd9Sstevel@tonic-gate	../milestone/network-physical.xml \
657c478bd9Sstevel@tonic-gate	../milestone/restarter.xml \
667c478bd9Sstevel@tonic-gate	../milestone/root-fs.xml \
677c478bd9Sstevel@tonic-gate	../milestone/single-user.xml \
687c478bd9Sstevel@tonic-gate	../milestone/usr-fs.xml \
69d62bc4baSyz147064	../../dlmgmtd/dlmgmt.xml \
70*6e91bba0SGirish Moodalbail	../../cmd-inet/lib/ipmgmtd/network-ipmgmt.xml \
71*6e91bba0SGirish Moodalbail	../../rpcbind/bind.xml
722269adc8Sszhou
732269adc8Sszhou#
742269adc8Sszhou# Additional manifests for standalone Solaris
752269adc8Sszhou#
762269adc8SszhouGLOBAL_ZONE_DESCRIPTIONS = \
772269adc8Sszhou	../milestone/console-login.xml \
782269adc8Sszhou	../milestone/multi-user-server.xml \
797c478bd9Sstevel@tonic-gate	../../cmd-inet/usr.lib/inetd/inetd-upgrade.xml \
807c478bd9Sstevel@tonic-gate	../../utmpd/utmp.xml \
81381a2a9aSdr146992	../../lvm/util/metainit.xml
827c478bd9Sstevel@tonic-gate
832269adc8Sszhou#
842269adc8Sszhou# Additional manifests for a Solaris zone
852269adc8Sszhou#
867c478bd9Sstevel@tonic-gateNONGLOBAL_ZONE_DESCRIPTIONS = \
877c478bd9Sstevel@tonic-gate	../milestone/console-login.xml \
887c478bd9Sstevel@tonic-gate	../milestone/multi-user-server.xml \
897c478bd9Sstevel@tonic-gate	../../utmpd/utmp.xml
907c478bd9Sstevel@tonic-gate
912269adc8Sszhou#
922269adc8Sszhou# Additional manifests for the install miniroot.
932269adc8Sszhou#
942269adc8SszhouMINIROOT_DESCRIPTIONS= \
952269adc8Sszhou	../milestone/sysconfig.xml \
962269adc8Sszhou	../../cmd-inet/usr.lib/inetd/inetd.xml \
972269adc8Sszhou	../../cmd-inet/usr.sbin/login.xml \
982269adc8Sszhou	../milestone/network-service.xml \
992269adc8Sszhou	../../cmd-inet/usr.sbin/telnet.xml \
1002269adc8Sszhou	../../../lib/libresolv2/client.xml \
1012269adc8Sszhou	../../ldapcachemgr/client.xml \
1022269adc8Sszhou	../../ypcmd/client.xml \
1032269adc8Sszhou	../../ypcmd/server.xml \
1042269adc8Sszhou	../../keyserv/keyserv.xml \
1052269adc8Sszhou	../../cmd-crypto/scripts/cryptosvc.xml \
1062269adc8Sszhou	../../nscd/name-service-cache.xml \
1072269adc8Sszhou	../../syslogd/system-log.xml
1082269adc8Sszhou
1097c478bd9Sstevel@tonic-gateFILEMODE = 0600
1107c478bd9Sstevel@tonic-gateSEEDFILEMODE = 0444		# seeds are not intended for editing, but may
1117c478bd9Sstevel@tonic-gate				# be copied
1127c478bd9Sstevel@tonic-gate
1137c478bd9Sstevel@tonic-gateCONFIGD = ../configd/svc.configd-native
1147c478bd9Sstevel@tonic-gateSVCCFG = ../svccfg/svccfg-native
1157c478bd9Sstevel@tonic-gate
1167c478bd9Sstevel@tonic-gate.KEEP_STATE:
1177c478bd9Sstevel@tonic-gate
1182269adc8Sszhouall: global.db nonglobal.db miniroot.db
1197c478bd9Sstevel@tonic-gate
1207c478bd9Sstevel@tonic-gate$(CONFIGD): FRC
1217c478bd9Sstevel@tonic-gate	@cd ../configd; pwd; $(MAKE) $(MFLAGS) native
1227c478bd9Sstevel@tonic-gate
1237c478bd9Sstevel@tonic-gate$(SVCCFG): FRC
1247c478bd9Sstevel@tonic-gate	@cd ../svccfg; pwd; $(MAKE) $(MFLAGS) native
1257c478bd9Sstevel@tonic-gate
1267c478bd9Sstevel@tonic-gate../milestone/console-login.xml:
1277c478bd9Sstevel@tonic-gate	@cd ../milestone; pwd; $(MAKE) $(MFLAGS) console-login.xml
1287c478bd9Sstevel@tonic-gate
1292269adc8Sszhoucommon.db: $(COMMON_DESCRIPTIONS) $(CONFIGD) $(SVCCFG)
1302269adc8Sszhou	$(RM) -f common.db common.db-journal
1312269adc8Sszhou	for m in $(COMMON_DESCRIPTIONS); do \
1322269adc8Sszhou		echo $$m; \
1332269adc8Sszhou		SVCCFG_DTD=../dtd/service_bundle.dtd.1 \
1342269adc8Sszhou		SVCCFG_REPOSITORY=$(SRC)/cmd/svc/seed/common.db \
1352269adc8Sszhou		SVCCFG_CONFIGD_PATH=$(CONFIGD) \
1362269adc8Sszhou		$(SVCCFG) import $$m; \
1372269adc8Sszhou	done
1382269adc8Sszhou
1392269adc8Sszhouglobal.db: common.db $(GLOBAL_ZONE_DESCRIPTIONS) $(CONFIGD) $(SVCCFG)
1407c478bd9Sstevel@tonic-gate	$(RM) -f global.db global.db-journal
1412269adc8Sszhou	$(CP) common.db global.db
1427c478bd9Sstevel@tonic-gate	for m in $(GLOBAL_ZONE_DESCRIPTIONS); do \
1437c478bd9Sstevel@tonic-gate		echo $$m; \
1447c478bd9Sstevel@tonic-gate		SVCCFG_DTD=../dtd/service_bundle.dtd.1 \
1457c478bd9Sstevel@tonic-gate		SVCCFG_REPOSITORY=$(SRC)/cmd/svc/seed/global.db \
1467c478bd9Sstevel@tonic-gate		SVCCFG_CONFIGD_PATH=$(CONFIGD) \
1477c478bd9Sstevel@tonic-gate		$(SVCCFG) import $$m; \
1487c478bd9Sstevel@tonic-gate	done
1497c478bd9Sstevel@tonic-gate
1502269adc8Sszhounonglobal.db: common.db $(NONGLOBAL_ZONE_DESCRIPTIONS) $(CONFIGD) $(SVCCFG)
1512269adc8Sszhou	$(RM) -f nonglobal.db nonglobal.db-journal
1522269adc8Sszhou	$(CP) common.db nonglobal.db
1537c478bd9Sstevel@tonic-gate	for m in $(NONGLOBAL_ZONE_DESCRIPTIONS); do \
1547c478bd9Sstevel@tonic-gate		echo $$m; \
1557c478bd9Sstevel@tonic-gate		SVCCFG_DTD=../dtd/service_bundle.dtd.1 \
1567c478bd9Sstevel@tonic-gate		SVCCFG_REPOSITORY=$(SRC)/cmd/svc/seed/nonglobal.db \
1577c478bd9Sstevel@tonic-gate		SVCCFG_CONFIGD_PATH=$(CONFIGD) \
1587c478bd9Sstevel@tonic-gate		$(SVCCFG) import $$m; \
1597c478bd9Sstevel@tonic-gate	done
1607c478bd9Sstevel@tonic-gate
1612269adc8Sszhouminiroot.db: common.db $(MINIROOT_DESCRIPTIONS) $(CONFIGD) $(SVCCFG)
1622269adc8Sszhou	$(RM) -f miniroot.db miniroot.db-journal
1632269adc8Sszhou	$(CP) common.db miniroot.db
1642269adc8Sszhou	for m in $(MINIROOT_DESCRIPTIONS); do \
1652269adc8Sszhou		echo $$m; \
1662269adc8Sszhou		SVCCFG_DTD=../dtd/service_bundle.dtd.1 \
1672269adc8Sszhou		SVCCFG_REPOSITORY=$(SRC)/cmd/svc/seed/miniroot.db \
1682269adc8Sszhou		SVCCFG_CONFIGD_PATH=$(CONFIGD) \
1692269adc8Sszhou		$(SVCCFG) import $$m; \
1702269adc8Sszhou	done
1710ea5e3a5Sjjj	#
1720ea5e3a5Sjjj	# Make sure the miniroot's syslogd and rpcbind do not respond
1730ea5e3a5Sjjj	# to packets from outside the machine. Since we cannot set property
1740ea5e3a5Sjjj	# values by applying a profile yet, we need to set them explicitly
1750ea5e3a5Sjjj	# with svccfg commands.
1760ea5e3a5Sjjj	#
1770ea5e3a5Sjjj	SVCCFG_DTD=../dtd/service_bundle.dtd.1 \
1780ea5e3a5Sjjj	SVCCFG_REPOSITORY=$(SRC)/cmd/svc/seed/miniroot.db \
1790ea5e3a5Sjjj	SVCCFG_CONFIGD_PATH=$(CONFIGD) \
1800ea5e3a5Sjjj	$(SVCCFG) -s svc:/system/system-log \
1810ea5e3a5Sjjj	    setprop config/log_from_remote = false
1820ea5e3a5Sjjj	#
1830ea5e3a5Sjjj	SVCCFG_DTD=../dtd/service_bundle.dtd.1 \
1840ea5e3a5Sjjj	SVCCFG_REPOSITORY=$(SRC)/cmd/svc/seed/miniroot.db \
1850ea5e3a5Sjjj	SVCCFG_CONFIGD_PATH=$(CONFIGD) \
1860ea5e3a5Sjjj	$(SVCCFG) -s svc:/network/rpc/bind setprop config/local_only = true
1872269adc8Sszhou
1882269adc8Sszhouinstall: install_global install_nonglobal install_miniroot
1897c478bd9Sstevel@tonic-gate
1907c478bd9Sstevel@tonic-gateinstall_global: global.db
1917c478bd9Sstevel@tonic-gate	$(RM) $(LIBSVCSEED)/global.db
1927c478bd9Sstevel@tonic-gate	$(INS) -f $(LIBSVCSEED) -m $(SEEDFILEMODE) -s global.db
1937c478bd9Sstevel@tonic-gate
1947c478bd9Sstevel@tonic-gateinstall_nonglobal: nonglobal.db
1957c478bd9Sstevel@tonic-gate	$(RM) $(LIBSVCSEED)/nonglobal.db
1967c478bd9Sstevel@tonic-gate	$(INS) -f $(LIBSVCSEED) -m $(SEEDFILEMODE) -s nonglobal.db
1977c478bd9Sstevel@tonic-gate
1982269adc8Sszhouinstall_miniroot: $(INSTALLSEED) miniroot.db
1992269adc8Sszhou	$(RM) $(INSTALLSEED)/miniroot.db
2002269adc8Sszhou	$(INS) -f $(INSTALLSEED) -m $(SEEDFILEMODE) -s miniroot.db
2012269adc8Sszhou
2022269adc8Sszhou$(INSTALLSEED):
2032269adc8Sszhou	$(INS.dir)
2042269adc8Sszhou
2057c478bd9Sstevel@tonic-gateclean lint:
2062269adc8Sszhou	$(RM) common.db
2077c478bd9Sstevel@tonic-gate
2087c478bd9Sstevel@tonic-gateclobber:
2092269adc8Sszhou	$(RM) common.db global.db nonglobal.db miniroot.db
2107c478bd9Sstevel@tonic-gate
2117c478bd9Sstevel@tonic-gateFRC:
212