xref: /illumos-gate/usr/src/cmd/svc/seed/Makefile (revision 814a60b13c0ad90e5d2edfd29a7a84bbf416cc1a)
1#
2# CDDL HEADER START
3#
4# The contents of this file are subject to the terms of the
5# Common Development and Distribution License, Version 1.0 only
6# (the "License").  You may not use this file except in compliance
7# with the License.
8#
9# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10# or http://www.opensolaris.org/os/licensing.
11# See the License for the specific language governing permissions
12# and limitations under the License.
13#
14# When distributing Covered Code, include this CDDL HEADER in each
15# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16# If applicable, add the following below this CDDL HEADER, with the
17# fields enclosed by brackets "[]" replaced with your own identifying
18# information: Portions Copyright [yyyy] [name of copyright owner]
19#
20# CDDL HEADER END
21#
22#
23# Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
24# Use is subject to license terms.
25#
26#ident	"%Z%%M%	%I%	%E% SMI"
27
28include ../../Makefile.cmd
29
30ETCSVC = $(ROOTETC)/svc
31LIBSVCSEED = $(ROOT)/lib/svc/seed
32INSTALLSEED = $(ROOT)/usr/sadm/install
33
34#
35# Because seed repository construction requires a functioning repository, a
36# working svccfg(1) binary, and XML support, the following libraries must exist
37# on the build system or in the proto area:  libscf, libuutil, and libxml2.
38#
39
40#
41# We build and deliver 3 seed repositories:
42#	global.db	-- for a standalone Solaris (global zone)
43#	nonglobal.db	-- for a Solaris Zone
44#	miniroot.db	-- for the install miniroot
45# COMMON_DESCRIPTIONS contains manifests needed by all 3 repositories.
46# GLOBAL_ZONE_DESCRIPTIONS/NONGLOBAL_ZONE_DESCRIPTIONS/MINIROOT_DESCRIPTIONS
47# contain additional manifests needed.
48#
49
50#
51# Manifests needed by all seed repositories. If you change this, you
52# must test Solaris standalone, Solaris zone, and Install miniroot.
53#
54COMMON_DESCRIPTIONS = \
55	../milestone/boot-archive.xml \
56	../milestone/devices-local.xml \
57	../milestone/identity.xml \
58	../milestone/local-fs.xml \
59	../milestone/manifest-import.xml \
60	../milestone/minimal-fs.xml \
61	../milestone/multi-user.xml \
62	../milestone/name-services.xml \
63	../milestone/network-initial.xml \
64	../milestone/network-loopback.xml \
65	../milestone/network-physical.xml \
66	../milestone/restarter.xml \
67	../milestone/root-fs.xml \
68	../milestone/single-user.xml \
69	../milestone/usr-fs.xml \
70	../../rpcbind/bind.xml \
71
72#
73# Additional manifests for standalone Solaris
74#
75GLOBAL_ZONE_DESCRIPTIONS = \
76	../milestone/console-login.xml \
77	../milestone/multi-user-server.xml \
78	../../cmd-inet/usr.lib/inetd/inetd-upgrade.xml \
79	../../utmpd/utmp.xml \
80	../../lvm/util/metainit.xml \
81	../../ipf/svc/pfil.xml
82
83#
84# Additional manifests for a Solaris zone
85#
86NONGLOBAL_ZONE_DESCRIPTIONS = \
87	../milestone/console-login.xml \
88	../milestone/multi-user-server.xml \
89	../../utmpd/utmp.xml
90
91#
92# Additional manifests for the install miniroot.
93#
94MINIROOT_DESCRIPTIONS= \
95	../milestone/sysconfig.xml \
96	../../cmd-inet/usr.lib/inetd/inetd.xml \
97	../../cmd-inet/usr.sbin/login.xml \
98	../milestone/network-service.xml \
99	../../cmd-inet/usr.sbin/telnet.xml \
100	../../../lib/libresolv2/client.xml \
101	../../ldapcachemgr/client.xml \
102	../../ypcmd/client.xml \
103	../../ypcmd/server.xml \
104	../../keyserv/keyserv.xml \
105	../../rpcsvc/nisplus.xml \
106	../../cmd-crypto/scripts/cryptosvc.xml \
107	../../nscd/name-service-cache.xml \
108	../../syslogd/system-log.xml
109
110OWNER = root
111GROUP = sys
112FILEMODE = 0600
113SEEDFILEMODE = 0444		# seeds are not intended for editing, but may
114				# be copied
115
116CONFIGD = ../configd/svc.configd-native
117SVCCFG = ../svccfg/svccfg-native
118
119.KEEP_STATE:
120
121all: global.db nonglobal.db miniroot.db
122
123$(CONFIGD): FRC
124	@cd ../configd; pwd; $(MAKE) $(MFLAGS) native
125
126$(SVCCFG): FRC
127	@cd ../svccfg; pwd; $(MAKE) $(MFLAGS) native
128
129../milestone/console-login.xml:
130	@cd ../milestone; pwd; $(MAKE) $(MFLAGS) console-login.xml
131
132common.db: $(COMMON_DESCRIPTIONS) $(CONFIGD) $(SVCCFG)
133	$(RM) -f common.db common.db-journal
134	for m in $(COMMON_DESCRIPTIONS); do \
135		echo $$m; \
136		SVCCFG_DTD=../dtd/service_bundle.dtd.1 \
137		SVCCFG_REPOSITORY=$(SRC)/cmd/svc/seed/common.db \
138		SVCCFG_CONFIGD_PATH=$(CONFIGD) \
139		$(SVCCFG) import $$m; \
140	done
141
142global.db: common.db $(GLOBAL_ZONE_DESCRIPTIONS) $(CONFIGD) $(SVCCFG)
143	$(RM) -f global.db global.db-journal
144	$(CP) common.db global.db
145	for m in $(GLOBAL_ZONE_DESCRIPTIONS); do \
146		echo $$m; \
147		SVCCFG_DTD=../dtd/service_bundle.dtd.1 \
148		SVCCFG_REPOSITORY=$(SRC)/cmd/svc/seed/global.db \
149		SVCCFG_CONFIGD_PATH=$(CONFIGD) \
150		$(SVCCFG) import $$m; \
151	done
152
153nonglobal.db: common.db $(NONGLOBAL_ZONE_DESCRIPTIONS) $(CONFIGD) $(SVCCFG)
154	$(RM) -f nonglobal.db nonglobal.db-journal
155	$(CP) common.db nonglobal.db
156	for m in $(NONGLOBAL_ZONE_DESCRIPTIONS); do \
157		echo $$m; \
158		SVCCFG_DTD=../dtd/service_bundle.dtd.1 \
159		SVCCFG_REPOSITORY=$(SRC)/cmd/svc/seed/nonglobal.db \
160		SVCCFG_CONFIGD_PATH=$(CONFIGD) \
161		$(SVCCFG) import $$m; \
162	done
163
164miniroot.db: common.db $(MINIROOT_DESCRIPTIONS) $(CONFIGD) $(SVCCFG)
165	$(RM) -f miniroot.db miniroot.db-journal
166	$(CP) common.db miniroot.db
167	for m in $(MINIROOT_DESCRIPTIONS); do \
168		echo $$m; \
169		SVCCFG_DTD=../dtd/service_bundle.dtd.1 \
170		SVCCFG_REPOSITORY=$(SRC)/cmd/svc/seed/miniroot.db \
171		SVCCFG_CONFIGD_PATH=$(CONFIGD) \
172		$(SVCCFG) import $$m; \
173	done
174
175install: install_global install_nonglobal install_miniroot
176
177install_global: global.db
178	$(RM) $(LIBSVCSEED)/global.db
179	$(INS) -f $(LIBSVCSEED) -m $(SEEDFILEMODE) -s global.db
180
181install_nonglobal: nonglobal.db
182	$(RM) $(LIBSVCSEED)/nonglobal.db
183	$(INS) -f $(LIBSVCSEED) -m $(SEEDFILEMODE) -s nonglobal.db
184
185install_miniroot: $(INSTALLSEED) miniroot.db
186	$(RM) $(INSTALLSEED)/miniroot.db
187	$(INS) -f $(INSTALLSEED) -m $(SEEDFILEMODE) -s miniroot.db
188
189$(INSTALLSEED):
190	$(INS.dir)
191
192clean lint:
193	$(RM) common.db
194
195clobber:
196	$(RM) common.db global.db nonglobal.db miniroot.db
197
198FRC:
199