GNUmakefile.in 15.8 KB
Newer Older
Leigh B. Stoller's avatar
Leigh B. Stoller committed
1
#
2
# Copyright (c) 2000-2015 University of Utah and the Flux Group.
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# 
# {{{EMULAB-LICENSE
# 
# This file is part of the Emulab network testbed software.
# 
# This file is free software: you can redistribute it and/or modify it
# under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or (at
# your option) any later version.
# 
# This file is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Affero General Public
# License for more details.
# 
# You should have received a copy of the GNU Affero General Public License
# along with this file.  If not, see <http://www.gnu.org/licenses/>.
# 
# }}}
Leigh B. Stoller's avatar
Leigh B. Stoller committed
22
23
#

24
25
26
27
28
29
30
31
32
#
# XXX ONLY RUN THIS INSTALL ON A LINUX TESTBED NODE!
#
# Trivial. These things just need to be installed into the right place
# on a testbed node before cutting an image.
#
#
SRCDIR		= @srcdir@
TESTBED_SRCDIR	= @top_srcdir@
33
34
OBJDIR		= @top_builddir@
SUBDIR		= $(subst $(TESTBED_SRCDIR)/,,$(SRCDIR))
35
36
37

include $(OBJDIR)/Makeconf

38
SCRIPTS		= sethostname.dhclient
39
40
41
42
43

#
# Force dependencies on the scripts so that they will be rerun through
# configure if the .in file is changed.
# 
Mike Hibler's avatar
Mike Hibler committed
44
all:	supfile $(SCRIPTS)
45
46
47

include $(TESTBED_SRCDIR)/GNUmakerules

Kirk Webb's avatar
   
Kirk Webb committed
48
49
50
51
SYSETCDIR	?= $(DESTDIR)/etc
ETCDIR		?= $(DESTDIR)$(CLIENT_ETCDIR)
BINDIR		?= $(DESTDIR)$(CLIENT_BINDIR)
VARDIR		?= $(DESTDIR)$(CLIENT_VARDIR)
52
VSDIR		?= $(BINDIR)/vserver
53
LBINDIR		?= $(DESTDIR)/usr/local/bin
Kirk Webb's avatar
   
Kirk Webb committed
54
55
56
57
RCDIR		?= $(SYSETCDIR)/rc.d
INSTALL		?= /usr/bin/install -c 
COMMON		?= $(SRCDIR)/../common
DEFRUNLVLDIR	?= $(RCDIR)/rc3.d
58
ISMFS		= $(ETCDIR)/ismfs
59

Mike Hibler's avatar
Mike Hibler committed
60
61
62
# group to use for directories (dir-install)
DIRGROUP	?= root

63
# without DESTDIR, used for the value of symlinks
64
RRCDIR		?= /etc/rc.d
65

66
67
68
69
70
71
72
73
74
75
destdircheck:
	@if [ -z "$(DESTDIR)" ]; then \
	    echo "You must define DESTDIR for this target!"; \
	    false; \
	fi
	@if [ "$(DESTDIR)" = "/" ]; then \
	    echo "DESTDIR is '/', really really bad idea!"; \
	    false; \
	fi

76
77
78
79
subboss-install:	subboss-common-install etc-install \
			sup-install script-install bin-install
	@echo "Remember to install the PEM files if necessary"

80
install client-install:	common-install etc-install \
81
			sup-install script-install bin-install vserver-install
82
	@echo "Remember to install the PEM files if necessary"
83

84
85
86
87
88
89
90
91
92
93
mfs-install:	destdircheck common-install etc-install \
			script-install bin-install
	rm -f $(BINDIR)/rc/rc.mkelab
	rm -f $(RCDIR)/elvind.sh
	@if [ ! -f $(ISMFS) ]; then \
	    echo >$(ISMFS) "This file indicates its the MFS. DO NOT DELETE!"; \
	fi

frisbee-mfs-install:	destdircheck
	$(INSTALL) -m 644 $(SRCDIR)/frisbee/rc.local $(SYSETCDIR)/rc.local
94
95
96
97
	$(INSTALL) -m 755 $(SRCDIR)/dhclient-exit-hooks \
			$(SYSETCDIR)/dhclient-exit-hooks
	$(INSTALL) -m 755 $(SRCDIR)/dhclient-enter-hooks \
			$(SYSETCDIR)/dhclient-enter-hooks
98
99
100
101
102
103
104
105
106
107
	#@if [ -r $(SRCDIR)/master.passwd ]; then \
	#    $(INSTALL) -m 600 $(SRCDIR)/master.passwd $(SYSETCDIR); \
	#    pwd_mkdb -d $(SYSETCDIR) $(SYSETCDIR)/master.passwd; \
	#    if [ ! -e $(DESTDIR)/bin/csh ]; then \
	#	ln $(DESTDIR)/bin/sh $(DESTDIR)/bin/csh; \
	#    fi \
	#fi
	#@if [ -r $(SRCDIR)/group ]; then \
	#    $(INSTALL) -m 644 $(SRCDIR)/group $(SYSETCDIR); \
	#fi
108
	(cd ../../tools/binoffset; $(MAKE) DESTDIR=$(DESTDIR) client-install)
109
110
111
112
	$(INSTALL) -m 755 $(SRCDIR)/control_interface $(SYSETCDIR)/testbed
	$(INSTALL) -m 755 $(SRCDIR)/rc.frisbee $(SYSETCDIR)/testbed
	$(INSTALL) -m 755 $(SRCDIR)/rc.ipod $(SYSETCDIR)/testbed
	$(INSTALL) -m 755 $(SRCDIR)/slicefix $(SYSETCDIR)/testbed
113
114
	$(INSTALL) -m 755 $(SRCDIR)/freebsd_to_linux_disk $(SYSETCDIR)/testbed
	$(INSTALL) -m 755 $(SRCDIR)/check_disklabel $(SYSETCDIR)/testbed
115
116
	$(INSTALL) -m 755 $(SRCDIR)/linux_slicefix $(SYSETCDIR)/testbed
	$(INSTALL) -m 755 $(SRCDIR)/extract_kernel_info $(SYSETCDIR)/testbed
117
	$(INSTALL) -m 755 $(SRCDIR)/mount_bsd_slice $(SYSETCDIR)/testbed
118
119
	$(INSTALL) -m 755 $(SRCDIR)/extract_initrd_info $(SYSETCDIR)/testbed
	$(INSTALL) -m 755 $(SRCDIR)/extract_image_info $(SYSETCDIR)/testbed
120
	$(INSTALL) -m 755 $(SRCDIR)/get_edd_map $(SYSETCDIR)/testbed
121
122
123
124
125
	$(INSTALL) -m 755 -s ../tmcc-nossl $(SYSETCDIR)/testbed/tmcc
	$(INSTALL) -m 755 -s ../findif $(SYSETCDIR)/testbed
	rm -f $(BINDIR)/rc/rc.mkelab
	rm -f $(RCDIR)/elvind.sh

126
127
simple-install:	common-install script-install bin-install

128
dir-install:
Mike Hibler's avatar
Mike Hibler committed
129
130
131
132
133
134
135
	$(INSTALL) -m 755 -o root -g $(DIRGROUP) -d $(SYSETCDIR)
	$(INSTALL) -m 755 -o root -g $(DIRGROUP) -d $(SYSETCDIR)/sysconfig
	$(INSTALL) -m 755 -o root -g $(DIRGROUP) -d $(SYSETCDIR)/sysconfig/network-scripts
	$(INSTALL) -m 755 -o root -g $(DIRGROUP) -d $(RCDIR)
	$(INSTALL) -m 755 -o root -g $(DIRGROUP) -d $(RCDIR)/init.d
	$(INSTALL) -m 755 -o root -g $(DIRGROUP) -d $(RCDIR)/rc1.d
	$(INSTALL) -m 755 -o root -g $(DIRGROUP) -d $(DEFRUNLVLDIR)
136
	$(INSTALL) -m 755 -o root -g $(DIRGROUP) -d $(RCDIR)/rc0.d
Mike Hibler's avatar
Mike Hibler committed
137
138
139
140
141
142
143
144
145
146
	$(INSTALL) -m 755 -o root -g $(DIRGROUP) -d $(RCDIR)/rc6.d
	$(INSTALL) -m 755 -o root -g $(DIRGROUP) -d $(ETCDIR)
	$(INSTALL) -m 755 -o root -g $(DIRGROUP) -d $(BINDIR)
	$(INSTALL) -m 755 -o root -g $(DIRGROUP) -d $(RCDIR)
	$(INSTALL) -m 755 -o root -g $(DIRGROUP) -d $(VARDIR)
	$(INSTALL) -m 755 -o root -g $(DIRGROUP) -d $(VARDIR)/db
	$(INSTALL) -m 755 -o root -g $(DIRGROUP) -d $(VARDIR)/jails
	$(INSTALL) -m 755 -o root -g $(DIRGROUP) -d $(VARDIR)/logs
	$(INSTALL) -m 755 -o root -g $(DIRGROUP) -d $(VARDIR)/sup
	$(INSTALL) -m 755 -o root -g $(DIRGROUP) -d $(VARDIR)/boot
147
148
149
150
	-rm -rf $(DESTDIR)/etc/testbed
	ln -s emulab $(DESTDIR)/etc/testbed
	-rm -rf $(DESTDIR)/usr/local/etc/testbed
	ln -s emulab $(DESTDIR)/usr/local/etc/testbed
151

152
common-install:	dir-install
153
	(cd ../common; $(MAKE) DESTDIR=$(DESTDIR) local-install)
154

155
156
157
subboss-common-install:	dir-install
	(cd ../common; $(MAKE) DESTDIR=$(DESTDIR) subboss-local-install)

Mike Hibler's avatar
Mike Hibler committed
158
sup-install:	dir-install supfile
159
	$(INSTALL) -m 755 ./supfile $(ETCDIR)/supfile
Mike Hibler's avatar
Mike Hibler committed
160
	$(INSTALL) -m 750 -o root -g $(DIRGROUP) -d $(DESTDIR)/root/.cvsup
161
	$(INSTALL) -m 600 $(SRCDIR)/cvsup.auth $(DESTDIR)/root/.cvsup/auth
162
163

bin-install:	dir-install
Timothy Stack's avatar
   
Timothy Stack committed
164
	$(INSTALL) -m 755 ../tmcc-nossl$(EXE) $(BINDIR)/tmcc.bin$(EXE)
Leigh B Stoller's avatar
Leigh B Stoller committed
165
	$(INSTALL) -m 755 ../tmcc$(EXE) $(BINDIR)/tmcc-ssl.bin$(EXE)
Timothy Stack's avatar
   
Timothy Stack committed
166
	$(INSTALL) -m 755 ../findif$(EXE) $(BINDIR)/findif$(EXE)
167
	$(INSTALL) -m 755 ../dostype$(EXE) $(BINDIR)/dostype$(EXE)
168

169
etc-install:	dir-install sysetc-remove sysetc-install
170
171
172
173
174
175
	$(INSTALL) -m 644 $(SRCDIR)/group $(ETCDIR)/group
	$(INSTALL) -m 644 $(SRCDIR)/passwd $(ETCDIR)/passwd
	$(INSTALL) -m 600 $(SRCDIR)/shadow $(ETCDIR)/shadow
	$(INSTALL) -m 600 $(SRCDIR)/gshadow $(ETCDIR)/gshadow
	$(INSTALL) -m 644 $(SRCDIR)/hosts $(ETCDIR)/hosts

Mike Hibler's avatar
Mike Hibler committed
176
sysetc-install:	dir-install ifcfgs
177
178
	$(INSTALL) -m 755 $(SRCDIR)/dhclient-enter-hooks $(SYSETCDIR)/dhclient-enter-hooks
	$(INSTALL) -m 755 $(SRCDIR)/dhclient-exit-hooks $(SYSETCDIR)/dhclient-exit-hooks
179
	$(INSTALL) -m 644 $(SRCDIR)/modules.conf $(SYSETCDIR)/modules.conf
Mike Hibler's avatar
Mike Hibler committed
180
181
	$(INSTALL) -m 644 $(SRCDIR)/ifcfg-eth99 $(SYSETCDIR)/sysconfig/network-scripts
	$(INSTALL) -m 644 ifcfg-eth[0-9]* $(SYSETCDIR)/sysconfig/network-scripts
182
183
	$(INSTALL) -m 755 $(SRCDIR)/ntpd.sh $(RCDIR)/init.d/ntpd
	$(INSTALL) -m 755 $(SRCDIR)/testbed $(RCDIR)/init.d/testbed
184
	-ln -sf $(RRCDIR)/init.d/ntpd $(DEFRUNLVLDIR)/S58ntpd
185
	-ln -sf $(RRCDIR)/init.d/testbed $(DEFRUNLVLDIR)/S96testbed
186
	-ln -sf $(RRCDIR)/init.d/testbed $(RCDIR)/rc0.d/K12testbed
187
188
	-ln -sf $(RRCDIR)/init.d/testbed $(RCDIR)/rc1.d/K12testbed
	-ln -sf $(RRCDIR)/init.d/testbed $(RCDIR)/rc6.d/K12testbed
189
	$(INSTALL) -m 755 $(SRCDIR)/tbprepare $(RCDIR)/init.d/tbprepare
190
	-ln -sf $(RRCDIR)/init.d/tbprepare $(RCDIR)/rc0.d/K89tbprepare
191
192
	-ln -sf $(RRCDIR)/init.d/tbprepare $(RCDIR)/rc1.d/K89tbprepare
	-ln -sf $(RRCDIR)/init.d/tbprepare $(RCDIR)/rc6.d/K89tbprepare
Mike Hibler's avatar
Mike Hibler committed
193
	$(INSTALL) -m 755 -o root -g $(DIRGROUP) -d $(SYSETCDIR)/cron.pend
194
195
196
197
198
199
200
201
	if [ -e $(SYSETCDIR)/cron.daily/slocate.cron ]; then \
		mv -f $(SYSETCDIR)/cron.daily/slocate.cron \
				$(SYSETCDIR)/cron.pend; \
	fi
	if [ -e $(SYSETCDIR)/cron.daily/makewhatis.cron ]; then \
		mv -f $(SYSETCDIR)/cron.daily/makewhatis.cron \
				$(SYSETCDIR)/cron.pend; \
	fi
202
	$(INSTALL) -m 755 $(SRCDIR)/rc.local $(RCDIR)/rc.local
203
204
205
	if [ "$(RCDIR)" != "$(SYSETCDIR)" ]; then \
	    ln -sf $(RRCDIR)/rc.local $(SYSETCDIR)/rc.local; \
        fi
206
207
208
	if [ -e $(SYSETCDIR)/sysctl.conf ]; then \
		cat $(SRCDIR)/sysctl.conf.tail >> $(SYSETCDIR)/sysctl.conf; \
	fi
209
210
211
212

sysetc-remove:
	-rm -f $(RCDIR)/*/S95anacron $(RCDIR)/*/K05anacron 

213
script-install:	dir-install $(SCRIPTS)
214
	$(INSTALL) -m 755 $(SRCDIR)/liblocsetup.pm $(BINDIR)/liblocsetup.pm
215
	$(INSTALL) -m 755 $(SRCDIR)/liblocstorage.pm $(BINDIR)/liblocstorage.pm
216
	$(INSTALL) -m 755 $(SRCDIR)/rc.ipod $(BINDIR)/rc/rc.ipod
217
	$(INSTALL) -m 755 $(SRCDIR)/rc.kname $(BINDIR)/rc/rc.kname
218
	$(INSTALL) -m 755 $(SRCDIR)/prepare $(BINDIR)/prepare
219
	$(INSTALL) -m 755 $(SRCDIR)/reboot_prepare $(BINDIR)/reboot_prepare
220
	$(INSTALL) -m 755 $(SRCDIR)/ixpboot $(BINDIR)/ixpboot
221
	$(INSTALL) -m 755 $(SRCDIR)/rc.ixp $(BINDIR)/rc/rc.ixp
222
	$(INSTALL) -m 755 ./sethostname.dhclient $(BINDIR)/sethostname.dhclient
223
	$(INSTALL) -m 755 $(SRCDIR)/rc.healthd $(BINDIR)/rc/rc.healthd
224
	$(INSTALL) -m 755 $(SRCDIR)/healthd.conf $(BINDIR)/healthd.conf
225
	$(INSTALL) -m 755 $(SRCDIR)/delaysetup $(BINDIR)/delaysetup
226
	$(INSTALL) -m 755 $(SRCDIR)/mkextrafs.pl $(BINDIR)/mkextrafs.pl
Mike Hibler's avatar
Mike Hibler committed
227
228
229
230
	$(INSTALL) -m 755 $(SRCDIR)/control_interface $(BINDIR)/control_interface
	$(INSTALL) -m 755 $(SRCDIR)/nodetype $(BINDIR)/nodetype
	$(INSTALL) -m 755 $(SRCDIR)/chipset.awk $(BINDIR)/chipset.awk
	$(INSTALL) -m 755 $(SRCDIR)/cpuspeed.awk $(BINDIR)/cpuspeed.awk
231
	$(INSTALL) -m 755 $(SRCDIR)/rc.mfs $(BINDIR)/rc/rc.mfs
232
	$(INSTALL) -m 755 $(SRCDIR)/control_interface $(BINDIR)/control_interface
233
234
235
236
	$(INSTALL) -m 755 $(SRCDIR)/rc.frisbee $(BINDIR)/rc/rc.frisbee
	$(INSTALL) -m 755 $(SRCDIR)/slicefix $(BINDIR)/slicefix
	$(INSTALL) -m 755 $(SRCDIR)/freebsd_to_linux_disk $(BINDIR)/freebsd_to_linux_disk
	$(INSTALL) -m 755 $(SRCDIR)/check_disklabel $(BINDIR)/check_disklabel
237
238
239
240
	$(INSTALL) -m 755 $(SRCDIR)/linux_slicefix $(BINDIR)
	$(INSTALL) -m 755 $(SRCDIR)/extract_kernel_info $(BINDIR)
	$(INSTALL) -m 755 $(SRCDIR)/extract_initrd_info $(BINDIR)
	$(INSTALL) -m 755 $(SRCDIR)/extract_image_info $(BINDIR)
241
242
	$(INSTALL) -m 755 $(SRCDIR)/mount_bsd_slice $(BINDIR)
	$(INSTALL) -m 755 $(SRCDIR)/get_edd_map $(BINDIR)
243
	$(INSTALL) -m 755 $(SRCDIR)/rc.linux $(BINDIR)/rc
244
	$(INSTALL) -m 755 $(SRCDIR)/fixup-fstab-swaps $(BINDIR)
245
246

sfs-install:
Mike Hibler's avatar
Mike Hibler committed
247
	$(INSTALL) -m 755 -o root -g $(DIRGROUP) -d $(DESTDIR)/etc/sfs
248
	$(INSTALL) -m 755 $(SRCDIR)/sfs.sh $(RCDIR)/init.d/sfs
249
250
	-ln -sf $(RRCDIR)/init.d/nfs $(DEFRUNLVLDIR)/S20nfs
	-ln -sf $(RRCDIR)/init.d/sfs $(RCDIR)/rc6.d/K19sfs
251
252
253
254
255
256
257
	$(INSTALL) -m 644 $(SRCDIR)/exports $(ETCDIR)/exports
	$(INSTALL) -m 644 $(SRCDIR)/sfsrwsd_config $(ETCDIR)/sfs/sfsrwsd_config
	$(INSTALL) -m 644 $(SRCDIR)/sfssd_config $(ETCDIR)/sfs/sfssd_config
	$(INSTALL) -m 755 -o sfs -g sfs -d $(DESTDIR)/var/sfs
	$(INSTALL) -m 775 -o sfs -g sfs -d $(DESTDIR)/var/sfs/root
	$(INSTALL) -m 775 -o sfs -g sfs -d $(DESTDIR)/var/sfs/var
	$(INSTALL) -m 775 -o sfs -g sfs -d $(DESTDIR)/var/sfs/usr
Mike Hibler's avatar
Mike Hibler committed
258
259
260
261

# create ifcfg-eth? files
ifcfgs:	$(SRCDIR)/mkifcfgs $(SRCDIR)/ifcfg.template
	$(SRCDIR)/mkifcfgs $(SRCDIR)/ifcfg.template
262
263

vserver-install:	dir-install
Mike Hibler's avatar
Mike Hibler committed
264
	$(INSTALL) -m 755 -o root -g $(DIRGROUP) -d $(VSDIR)
Mike Hibler's avatar
Mike Hibler committed
265
266
267
268
	$(INSTALL) -m 755 $(SRCDIR)/vserver/rc.invserver $(VSDIR)/
	$(INSTALL) -m 755 $(SRCDIR)/vserver/vserver-cnet.sh $(VSDIR)/
	$(INSTALL) -m 755 $(SRCDIR)/vserver/vserver-init.sh $(VSDIR)/
	$(INSTALL) -m 755 $(SRCDIR)/vserver/vserver-rc.sh $(VSDIR)/
269
	$(INSTALL) -m 755 $(SRCDIR)/mkvserver.pl $(BINDIR)/mkvserver.pl
270
	-ln -sf $(CLIENT_BINDIR)/mkvserver.pl $(BINDIR)/mkjail.pl
271
272

openvz-install:	dir-install
273
	$(INSTALL) -m 755 $(SRCDIR)/../common/vnodesetup $(BINDIR)/
274
275
	$(INSTALL) -m 755 $(SRCDIR)/../common/mkvnode.pl $(BINDIR)/
	$(INSTALL) -m 755 $(SRCDIR)/../common/libutil.pm $(BINDIR)/
276
	$(INSTALL) -m 755 $(SRCDIR)/../common/bootvnodes $(BINDIR)/
277
278
279
280
	$(INSTALL) -m 755 $(SRCDIR)/libvnode.pm $(BINDIR)/
	$(INSTALL) -m 755 $(SRCDIR)/openvz/libvnode_openvz.pm $(BINDIR)/
	$(INSTALL) -m 755 $(SRCDIR)/openvz/vznetinit-elab.sh $(BINDIR)/
	$(INSTALL) -m 755 $(SRCDIR)/vnodectl $(BINDIR)/
281
	$(INSTALL) -m 755 $(SRCDIR)/openvz/create-image $(LBINDIR)/
Leigh B Stoller's avatar
Leigh B Stoller committed
282
	$(INSTALL) -m 755 $(SRCDIR)/openvz/mkimagecache $(BINDIR)/
283
284
	$(INSTALL) -m 755 $(SRCDIR)/openvz/prunelvms $(BINDIR)/
	$(INSTALL) -m 755 $(SRCDIR)/openvz/prunelvms.cron $(SYSETCDIR)/cron.daily
285
286
	echo "openvz" > $(ETCDIR)/genvmtype
	$(INSTALL) -m 755 $(SRCDIR)/openvz/vzmount-elab.sh $(BINDIR)/
287
288
	# No destdir in this symlink!
	-ln -sf $(CLIENT_BINDIR)/vzmount-elab.sh /etc/vz/conf/vps.mount
289
	$(INSTALL) -m 755 $(SRCDIR)/openvz/vzumount-elab.sh $(BINDIR)/
290
291
	# No destdir in this symlink!
	-ln -sf $(CLIENT_BINDIR)/vzumount-elab.sh /etc/vz/conf/vps.umount
Mike Hibler's avatar
Mike Hibler committed
292

293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
xen-udev-install:
	@if [ -d "/etc/udev/rules.d" ]; then \
	    for f in $(SRCDIR)/xen/udev/*.rules; do \
		echo $(INSTALL) -m 644 $$f /etc/udev/rules.d/; \
		$(INSTALL) -m 644 $$f /etc/udev/rules.d/; \
	    done; \
	fi

xen-upstart-install:
	@if [ -d "/etc/init" ]; then \
	    for f in $(SRCDIR)/xen/init/*; do \
		echo $(INSTALL) -m 644 $$f /etc/init/; \
		$(INSTALL) -m 644 $$f /etc/init/; \
	    done; \
	fi

xen-install:	dir-install xen-udev-install xen-upstart-install
310
311
	$(INSTALL) -m 755 $(SRCDIR)/../common/vnodesetup $(BINDIR)/
	$(INSTALL) -m 755 $(SRCDIR)/../common/mkvnode.pl $(BINDIR)/
312
313
	$(INSTALL) -m 755 $(SRCDIR)/../common/bootvnodes $(BINDIR)/
	$(INSTALL) -m 755 $(SRCDIR)/../common/localize_image $(BINDIR)/
314
	$(INSTALL) -m 755 $(SRCDIR)/../common/libutil.pm $(BINDIR)/
Mike Hibler's avatar
Mike Hibler committed
315
316
317
	$(INSTALL) -m 755 $(SRCDIR)/libvnode.pm $(BINDIR)/
	$(INSTALL) -m 755 $(SRCDIR)/xen/libvnode_xen.pm $(BINDIR)/
	echo "xen" > $(ETCDIR)/genvmtype
318
	$(INSTALL) -m 755 $(SRCDIR)/xen/xenbridge-setup $(BINDIR)/
319
320
	$(INSTALL) -m 755 $(SRCDIR)/xen/restorevm.pl $(BINDIR)/restorevm.pl
	$(INSTALL) -m 755 $(SRCDIR)/xen/capturevm.pl $(BINDIR)/capturevm.pl
Mike Hibler's avatar
Mike Hibler committed
321
	$(INSTALL) -m 755 $(SRCDIR)/xen/xend-config.sxp $(SYSETCDIR)/xen/
322
	$(INSTALL) -m 755 $(SRCDIR)/xen/xl.conf $(SYSETCDIR)/xen/
323
	$(INSTALL) -m 755 $(SRCDIR)/xen/30-emulab.conf $(SYSETCDIR)/sysctl.d/
324
	$(INSTALL) -m 755 $(SRCDIR)/xen/rsyslog $(SYSETCDIR)/logrotate.d/
325
	$(INSTALL) -m 755 $(SRCDIR)/xen/xen $(SYSETCDIR)/init.d/
326
	$(INSTALL) -m 755 $(SRCDIR)/xen/interfaces $(SYSETCDIR)/network/
Leigh B Stoller's avatar
Leigh B Stoller committed
327
	$(INSTALL) -m 755 $(SRCDIR)/xen/emulab-cnet.pl $(SYSETCDIR)/xen/scripts/
328
	$(INSTALL) -m 755 $(SRCDIR)/xen/emulab-enet.pl $(SYSETCDIR)/xen/scripts/
329
	$(INSTALL) -m 755 $(SRCDIR)/xen/vif-route-emulab $(SYSETCDIR)/xen/scripts/
330
	$(INSTALL) -m 755 $(SRCDIR)/xen/emulab-tun.pl $(SYSETCDIR)/xen/scripts/
331
332
333
	$(INSTALL) -m 755 $(SRCDIR)/xen/create-xen-image $(LBINDIR)/
	$(INSTALL) -m 755 $(SRCDIR)/../../os/create-versioned-image $(LBINDIR)/
	$(INSTALL) -m 755 $(SRCDIR)/../../os/create-image $(LBINDIR)/
Leigh B Stoller's avatar
Leigh B Stoller committed
334
	$(INSTALL) -m 755 $(SRCDIR)/xen/mkimagecache $(BINDIR)/
335
	$(INSTALL) -m 755 $(SRCDIR)/xen/gc-xen-images $(BINDIR)/
336
337
	$(INSTALL) -m 755 -o root -g $(DIRGROUP) -d $(BINDIR)/grub
	$(INSTALL) -m 755 $(SRCDIR)/xen/pygrub $(BINDIR)/
338
339
	@if [ ! -e "/usr/lib/xen-default" -a -d "/usr/lib/xen-4.4" ]; then \
	    ln -sf xen-4.4 /usr/lib/xen-default; \
340
	fi
341
342
	$(INSTALL) -m 755 $(SRCDIR)/xen/GrubConf.py \
		/usr/lib/xen-default/lib/python/grub/
343

344
345
346
347
genirack-install:
	$(INSTALL) -m 755 $(SRCDIR)/xen/restorevm.pl $(BINDIR)/restorevm.pl
	$(INSTALL) -m 755 $(SRCDIR)/xen/capturevm.pl $(BINDIR)/capturevm.pl
	$(INSTALL) -m 755 $(SRCDIR)/xen/xenbridge-setup $(BINDIR)/
348
	$(INSTALL) -m 755 $(SRCDIR)/xen/xenbridge-setup-genirack $(SYSETCDIR)/xen/
349

350
351
352
OPENVZGUEST_TEMPLATE  = /vz.save/template/cache/emulab-default.tar.gz
OPENVZGUEST           = /vz/template/cache/emulab-default.tar.gz

353
354
355
openvz-guest: openvz-guest-unpack openvz-guest-install openvz-guest-pack

openvz-guest-unpack: $(OPENVZGUEST_TEMPLATE)
356
357
	-$(RM) -rf /tmp/guest
	mkdir /tmp/guest
358
	tar xzf $(OPENVZGUEST_TEMPLATE) -C /tmp/guest
359
360

openvz-guest-install: $(OPENVZGUEST_TEMPLATE)
361
362
	(cd $(OBJDIR) ; \
		$(MAKE) DESTDIR=/tmp/guest client-install)
363
364

openvz-guest-pack: $(OPENVZGUEST_TEMPLATE)
365
	tar czf $(OPENVZGUEST_TEMPLATE) -C /tmp/guest .
366
	-$(RM) -rf /tmp/guest
367
368
369
	@if [ -e "$(OPENVZGUEST)" ]; then \
		cp -fp $(OPENVZGUEST_TEMPLATE) $(OPENVZGUEST); \
	fi