xref: /illumos-gate/usr/src/cmd/svc/seed/Makefile (revision 45526e9775395f5d44bad3f5430041f32c84ce1e)
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/datalink.xml \
57	../milestone/devices-local.xml \
58	../milestone/identity.xml \
59	../milestone/local-fs.xml \
60	../milestone/manifest-import.xml \
61	../milestone/minimal-fs.xml \
62	../milestone/multi-user.xml \
63	../milestone/name-services.xml \
64	../milestone/network-initial.xml \
65	../milestone/network-loopback.xml \
66	../milestone/network-physical.xml \
67	../milestone/restarter.xml \
68	../milestone/root-fs.xml \
69	../milestone/single-user.xml \
70	../milestone/usr-fs.xml \
71	../../rpcbind/bind.xml \
72
73#
74# Additional manifests for standalone Solaris
75#
76GLOBAL_ZONE_DESCRIPTIONS = \
77	../milestone/console-login.xml \
78	../milestone/datalink-init.xml \
79	../milestone/multi-user-server.xml \
80	../milestone/aggregation.xml \
81	../../cmd-inet/usr.lib/inetd/inetd-upgrade.xml \
82	../../utmpd/utmp.xml \
83	../../lvm/util/metainit.xml \
84	../../ipf/svc/pfil.xml
85
86#
87# Additional manifests for a Solaris zone
88#
89NONGLOBAL_ZONE_DESCRIPTIONS = \
90	../milestone/console-login.xml \
91	../milestone/multi-user-server.xml \
92	../milestone/aggregation.xml \
93	../../utmpd/utmp.xml
94
95#
96# Additional manifests for the install miniroot.
97#
98MINIROOT_DESCRIPTIONS= \
99	../milestone/datalink-init.xml \
100	../milestone/sysconfig.xml \
101	../../cmd-inet/usr.lib/inetd/inetd.xml \
102	../../cmd-inet/usr.sbin/login.xml \
103	../milestone/network-service.xml \
104	../../cmd-inet/usr.sbin/telnet.xml \
105	../../../lib/libresolv2/client.xml \
106	../../ldapcachemgr/client.xml \
107	../../ypcmd/client.xml \
108	../../ypcmd/server.xml \
109	../../keyserv/keyserv.xml \
110	../../rpcsvc/nisplus.xml \
111	../../cmd-crypto/scripts/cryptosvc.xml \
112	../../nscd/name-service-cache.xml \
113	../../syslogd/system-log.xml
114
115OWNER = root
116GROUP = sys
117FILEMODE = 0600
118SEEDFILEMODE = 0444		# seeds are not intended for editing, but may
119				# be copied
120
121CONFIGD = ../configd/svc.configd-native
122SVCCFG = ../svccfg/svccfg-native
123
124.KEEP_STATE:
125
126all: global.db nonglobal.db miniroot.db
127
128$(CONFIGD): FRC
129	@cd ../configd; pwd; $(MAKE) $(MFLAGS) native
130
131$(SVCCFG): FRC
132	@cd ../svccfg; pwd; $(MAKE) $(MFLAGS) native
133
134../milestone/console-login.xml:
135	@cd ../milestone; pwd; $(MAKE) $(MFLAGS) console-login.xml
136
137common.db: $(COMMON_DESCRIPTIONS) $(CONFIGD) $(SVCCFG)
138	$(RM) -f common.db common.db-journal
139	for m in $(COMMON_DESCRIPTIONS); do \
140		echo $$m; \
141		SVCCFG_DTD=../dtd/service_bundle.dtd.1 \
142		SVCCFG_REPOSITORY=$(SRC)/cmd/svc/seed/common.db \
143		SVCCFG_CONFIGD_PATH=$(CONFIGD) \
144		$(SVCCFG) import $$m; \
145	done
146
147global.db: common.db $(GLOBAL_ZONE_DESCRIPTIONS) $(CONFIGD) $(SVCCFG)
148	$(RM) -f global.db global.db-journal
149	$(CP) common.db global.db
150	for m in $(GLOBAL_ZONE_DESCRIPTIONS); do \
151		echo $$m; \
152		SVCCFG_DTD=../dtd/service_bundle.dtd.1 \
153		SVCCFG_REPOSITORY=$(SRC)/cmd/svc/seed/global.db \
154		SVCCFG_CONFIGD_PATH=$(CONFIGD) \
155		$(SVCCFG) import $$m; \
156	done
157
158nonglobal.db: common.db $(NONGLOBAL_ZONE_DESCRIPTIONS) $(CONFIGD) $(SVCCFG)
159	$(RM) -f nonglobal.db nonglobal.db-journal
160	$(CP) common.db nonglobal.db
161	for m in $(NONGLOBAL_ZONE_DESCRIPTIONS); do \
162		echo $$m; \
163		SVCCFG_DTD=../dtd/service_bundle.dtd.1 \
164		SVCCFG_REPOSITORY=$(SRC)/cmd/svc/seed/nonglobal.db \
165		SVCCFG_CONFIGD_PATH=$(CONFIGD) \
166		$(SVCCFG) import $$m; \
167	done
168
169miniroot.db: common.db $(MINIROOT_DESCRIPTIONS) $(CONFIGD) $(SVCCFG)
170	$(RM) -f miniroot.db miniroot.db-journal
171	$(CP) common.db miniroot.db
172	for m in $(MINIROOT_DESCRIPTIONS); do \
173		echo $$m; \
174		SVCCFG_DTD=../dtd/service_bundle.dtd.1 \
175		SVCCFG_REPOSITORY=$(SRC)/cmd/svc/seed/miniroot.db \
176		SVCCFG_CONFIGD_PATH=$(CONFIGD) \
177		$(SVCCFG) import $$m; \
178	done
179
180install: install_global install_nonglobal install_miniroot
181
182install_global: global.db
183	$(RM) $(LIBSVCSEED)/global.db
184	$(INS) -f $(LIBSVCSEED) -m $(SEEDFILEMODE) -s global.db
185
186install_nonglobal: nonglobal.db
187	$(RM) $(LIBSVCSEED)/nonglobal.db
188	$(INS) -f $(LIBSVCSEED) -m $(SEEDFILEMODE) -s nonglobal.db
189
190install_miniroot: $(INSTALLSEED) miniroot.db
191	$(RM) $(INSTALLSEED)/miniroot.db
192	$(INS) -f $(INSTALLSEED) -m $(SEEDFILEMODE) -s miniroot.db
193
194$(INSTALLSEED):
195	$(INS.dir)
196
197clean lint:
198	$(RM) common.db
199
200clobber:
201	$(RM) common.db global.db nonglobal.db miniroot.db
202
203FRC:
204