GNUmakefile.in 8.99 KB
Newer Older
1
#
2
# Copyright (c) 2000-2013 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/>.
# 
# }}}
22
23
24
25
26
27
28
29
30
31
32
#
#
# XXX ONLY RUN THIS INSTALL ON A TESTBED NODE!
#
# These things need to be installed into the right place on a testbed
# node before cutting an image. This directory is installed first,
# followed by the system-specific directory.
#
#
SRCDIR		= @srcdir@
TESTBED_SRCDIR	= @top_srcdir@
33
34
OBJDIR		= @top_builddir@
SUBDIR		= $(subst $(TESTBED_SRCDIR)/,,$(SRCDIR))
35
36
37

include $(OBJDIR)/Makeconf

38
all:
39
40
41
42
43
44
45

include $(TESTBED_SRCDIR)/GNUmakerules

DESTDIR		=
ETCDIR		= $(DESTDIR)$(CLIENT_ETCDIR)
BINDIR		= $(DESTDIR)$(CLIENT_BINDIR)
VARDIR		= $(DESTDIR)$(CLIENT_VARDIR)
46
RCDIR		= $(BINDIR)/rc
47
SYSRCDIR	= $(DESTDIR)/usr/local/etc/rc.d
48
TBBINDIR	= $(DESTDIR)/usr/testbed/bin
49
TBLIBDIR	= $(DESTDIR)/usr/testbed/lib
50
51
INSTALL		= /usr/bin/install -c

52
install client-install:
53
	@echo "You should probably not run this install directly!"
54
	@echo "If you do, be sure to install from the system specific "
55
56
57
	@echo "directory afterwards."


58
local-install:		path-install local-script-install symlinks
59
60
remote-install:		path-install remote-script-install
control-install:	path-install control-script-install
61
fs-install:		path-install fs-script-install
62
subboss-local-install:	path-install subboss-local-script-install symlinks
63
64

other-install:
65
66
67
68
	(cd ../../os; $(MAKE) DESTDIR=$(DESTDIR) client-install)
	(cd ../../event; $(MAKE) DESTDIR=$(DESTDIR) client-install)
	(cd ../../sensors/slothd; $(MAKE) DESTDIR=$(DESTDIR) client-install)
	(cd ../../tools; $(MAKE) DESTDIR=$(DESTDIR) client-install)
69
70

dir-install:
71
72
73
74
75
76
77
78
79
80
	$(INSTALL) -m 755 -o root -d $(ETCDIR)
	$(INSTALL) -m 755 -o root -d $(BINDIR)
	$(INSTALL) -m 755 -o root -d $(RCDIR)
	$(INSTALL) -m 755 -o root -d $(VARDIR)
	$(INSTALL) -m 755 -o root -d $(VARDIR)/db
	$(INSTALL) -m 755 -o root -d $(VARDIR)/jails
	$(INSTALL) -m 755 -o root -d $(VARDIR)/logs
	$(INSTALL) -m 755 -o root -d $(VARDIR)/boot
	$(INSTALL) -m 755 -o root -d $(VARDIR)/lock
	$(INSTALL) -m 755 -o root -d $(TBBINDIR)
81
82
83
84
85

path-install:	dir-install
	$(INSTALL) -m 755 $(SRCDIR)/paths.pm $(ETCDIR)/paths.pm
	$(INSTALL) -m 755 $(SRCDIR)/paths.sh $(ETCDIR)/paths.sh

86
87
88
89
90
91
92
93
nodecheck-install:	dir-install
	$(INSTALL) -m 644 $(SRCDIR)/checknode/checkutils.sh $(BINDIR)/checkutils.sh
	$(INSTALL) -m 644 $(SRCDIR)/checknode/hbis.sh $(BINDIR)/hbis.sh

	$(INSTALL) -m 755 $(SRCDIR)/checknode/cpucheck $(BINDIR)/cpucheck
	$(INSTALL) -m 755 $(SRCDIR)/checknode/diskcheck $(BINDIR)/diskcheck
	$(INSTALL) -m 755 $(SRCDIR)/checknode/memcheck $(BINDIR)/memcheck
	$(INSTALL) -m 755 $(SRCDIR)/checknode/niccheck $(BINDIR)/niccheck
94
	$(INSTALL) -m 755 $(SRCDIR)/checknode/timecheck $(BINDIR)/timecheck
95
	$(INSTALL) -m 755 $(SRCDIR)/checknode/checknode $(BINDIR)/checknode
96
97
	$(INSTALL) -m 755 $(SRCDIR)/checknode/rc.nodecheck $(BINDIR)/rc/rc.checknode

98
common-script-install:	dir-install
99
	$(INSTALL) -m 755 $(SRCDIR)/libsetup.pm $(BINDIR)/libsetup.pm
100
	$(INSTALL) -m 755 $(SRCDIR)/libtmcc.pm $(BINDIR)/libtmcc.pm
101
	$(INSTALL) -m 755 $(SRCDIR)/libtestbed.pm $(BINDIR)/libtestbed.pm
102
103
	$(INSTALL) -m 755 $(SRCDIR)/libgenvnode.pm $(BINDIR)/libgenvnode.pm
	$(INSTALL) -m 755 $(SRCDIR)/libutil.pm $(BINDIR)/libutil.pm
104
	$(INSTALL) -m 755 $(SRCDIR)/tmcc.pl $(BINDIR)/tmcc
105
	$(INSTALL) -m 755 $(SRCDIR)/logboot $(BINDIR)/logboot
106
	$(INSTALL) -m 755 $(SRCDIR)/watchdog $(BINDIR)/watchdog
107
108
109
	$(INSTALL) -m 755 $(SRCDIR)/ntpstart $(BINDIR)/ntpstart
	$(INSTALL) -m 755 $(SRCDIR)/runstartup $(BINDIR)/runstartup
	$(INSTALL) -m 755 $(SRCDIR)/runcvsup.sh $(BINDIR)/runcvsup.sh
110
	$(INSTALL) -m 755 $(SRCDIR)/update $(BINDIR)/update
111
	$(INSTALL) -m 755 $(SRCDIR)/ifsetup $(BINDIR)/ifsetup
112
	$(INSTALL) -m 755 $(SRCDIR)/ifdynconfig $(BINDIR)/ifdynconfig
113
	$(INSTALL) -m 755 $(SRCDIR)/vnodesetup $(BINDIR)/vnodesetup
114
	$(INSTALL) -m 755 $(SRCDIR)/mkvnode.pl $(BINDIR)/mkvnode.pl
115
	$(INSTALL) -m 755 $(SRCDIR)/bootsubnodes $(BINDIR)/bootsubnodes
116
	$(INSTALL) -m 755 $(SRCDIR)/bootvnodes $(BINDIR)/bootvnodes
117
	$(INSTALL) -m 755 $(SRCDIR)/startcmddone $(BINDIR)/startcmddone
118
	$(INSTALL) -m 755 $(SRCDIR)/getblob $(BINDIR)/getblob
119
	$(INSTALL) -m 755 $(SRCDIR)/fixarpinfo $(BINDIR)/fixarpinfo
120
	(cd config; $(MAKE) DESTDIR=$(DESTDIR) script-install)
121

122
123
124
125
126
127
128
129
130
131
132
133
134
subboss-common-script-install:	dir-install
	$(INSTALL) -m 755 $(SRCDIR)/libsetup.pm $(BINDIR)/libsetup.pm
	$(INSTALL) -m 755 $(SRCDIR)/libtmcc.pm $(BINDIR)/libtmcc.pm
	$(INSTALL) -m 755 $(SRCDIR)/libtestbed.pm $(BINDIR)/libtestbed.pm
	$(INSTALL) -m 755 $(SRCDIR)/tmcc.pl $(BINDIR)/tmcc
	$(INSTALL) -m 755 $(SRCDIR)/logboot $(BINDIR)/logboot
	$(INSTALL) -m 755 $(SRCDIR)/watchdog $(BINDIR)/watchdog
	$(INSTALL) -m 755 $(SRCDIR)/ntpstart $(BINDIR)/ntpstart
	$(INSTALL) -m 755 $(SRCDIR)/runstartup $(BINDIR)/runstartup
	$(INSTALL) -m 755 $(SRCDIR)/update $(BINDIR)/update
	$(INSTALL) -m 755 $(SRCDIR)/ifsetup $(BINDIR)/ifsetup
	$(INSTALL) -m 755 $(SRCDIR)/ifdynconfig $(BINDIR)/ifdynconfig
	$(INSTALL) -m 755 $(SRCDIR)/startcmddone $(BINDIR)/startcmddone
135
	$(INSTALL) -m 755 $(SRCDIR)/localize_image $(BINDIR)/localize_image
136
	$(INSTALL) -m 755 $(SRCDIR)/getblob $(BINDIR)/getblob
137
	$(INSTALL) -m 755 $(SRCDIR)/fixarpinfo $(BINDIR)/fixarpinfo
138
139
	(cd config; $(MAKE) DESTDIR=$(DESTDIR) subboss-script-install)

140
symlinks:	dir-install
141
142
143
144
	rm -f $(TBBINDIR)/tevc$(EXE)
	ln -s $(CLIENT_BINDIR)/tevc$(EXE) $(TBBINDIR)/tevc$(EXE)
	rm -f $(TBBINDIR)/emulab-sync$(EXE)
	ln -s $(CLIENT_BINDIR)/emulab-sync$(EXE) $(TBBINDIR)/emulab-sync$(EXE)
Mike Hibler's avatar
Mike Hibler committed
145
146
	rm -f $(TBBINDIR)/mkextrafs
	ln -s $(CLIENT_BINDIR)/mkextrafs.pl $(TBBINDIR)/mkextrafs
147
	rm -f $(TBLIBDIR)
148
	ln -s $(CLIENT_BINDIR) $(TBLIBDIR)
149
150

local-script-install:	common-script-install
151
	$(INSTALL) -m 755 $(SRCDIR)/sendevent $(BINDIR)/sendevent
152
153
154
	$(INSTALL) -m 755 $(SRCDIR)/rc.testbed $(RCDIR)/rc.testbed
	$(INSTALL) -m 755 $(SRCDIR)/rc.bootsetup $(RCDIR)/rc.bootsetup
	$(INSTALL) -m 755 $(SRCDIR)/rc.slothd $(RCDIR)/rc.slothd
Timothy Stack's avatar
   
Timothy Stack committed
155
	$(INSTALL) -m 755 $(SRCDIR)/rc.canaryd $(RCDIR)/rc.canaryd
156
	$(INSTALL) -m 755 $(SRCDIR)/rc.linktest $(RCDIR)/rc.linktest
157
	$(INSTALL) -m 755 $(SRCDIR)/rc.inelab $(RCDIR)/rc.inelab
158
	$(INSTALL) -m 755 $(SRCDIR)/rc.pgeni $(RCDIR)/rc.pgeni
159
160
161
	# Symlink this cause we invoke it from boss, and its too much
	# of a hassle to worry about right now.
	rm -f $(ETCDIR)/update
162
	-ln -s $(CLIENT_BINDIR)/update $(ETCDIR)/update
163
164
165
166
167
168
169
170
171
172
173

subboss-local-script-install:	subboss-common-script-install
	$(INSTALL) -m 755 $(SRCDIR)/sendevent $(BINDIR)/sendevent
	$(INSTALL) -m 755 $(SRCDIR)/rc.testbed $(RCDIR)/rc.testbed
	$(INSTALL) -m 755 $(SRCDIR)/rc.bootsetup $(RCDIR)/rc.bootsetup
	$(INSTALL) -m 755 $(SRCDIR)/rc.inelab $(RCDIR)/rc.inelab
	$(INSTALL) -m 755 $(SRCDIR)/rc.pgeni $(RCDIR)/rc.pgeni
	# Symlink this cause we invoke it from boss, and its too much
	# of a hassle to worry about right now.
	rm -f $(ETCDIR)/update
	-ln -s $(CLIENT_BINDIR)/update $(ETCDIR)/update
174

175
remote-script-install:	common-script-install
176
177
	-chown root $(BINDIR)/vnodesetup
	-chmod u+s $(BINDIR)/vnodesetup
178

179
control-script-install:	dir-install bossnode
180
	$(INSTALL) -m 755 $(SRCDIR)/libsetup.pm $(BINDIR)/libsetup.pm
181
	$(INSTALL) -m 755 $(SRCDIR)/libtmcc.pm $(BINDIR)/libtmcc.pm
182
183
184
185
186
187
188
189
190
191
192
193
	$(INSTALL) -m 755 $(SRCDIR)/libtestbed.pm $(BINDIR)/libtestbed.pm
	$(INSTALL) -m 755 $(SRCDIR)/tmcc.pl $(BINDIR)/tmcc
	$(INSTALL) -m 755 $(SRCDIR)/ctrlnode.sh $(SYSRCDIR)/ctrlnode.sh
	$(INSTALL) -m 755 $(SRCDIR)/rc.ctrlnode $(RCDIR)/rc.ctrlnode
	$(INSTALL) -m 755 $(SRCDIR)/config/librc.pm $(BINDIR)/librc.pm
	$(INSTALL) -m 755 $(SRCDIR)/fixarpinfo $(BINDIR)/fixarpinfo
	$(INSTALL) bossnode $(ETCDIR)/bossnode

fs-script-install:	dir-install bossnode
	$(INSTALL) -m 755 $(SRCDIR)/libsetup.pm $(BINDIR)/libsetup.pm
	$(INSTALL) -m 755 $(SRCDIR)/libtmcc.pm $(BINDIR)/libtmcc.pm
	$(INSTALL) -m 755 $(SRCDIR)/libtestbed.pm $(BINDIR)/libtestbed.pm
194
195
196
197
	$(INSTALL) -m 755 $(SRCDIR)/tmcc.pl $(BINDIR)/tmcc
	$(INSTALL) -m 755 $(SRCDIR)/ctrlnode.sh $(SYSRCDIR)/ctrlnode.sh
	$(INSTALL) -m 755 $(SRCDIR)/rc.ctrlnode $(RCDIR)/rc.ctrlnode
	$(INSTALL) -m 755 $(SRCDIR)/config/librc.pm $(BINDIR)/librc.pm
198
	$(INSTALL) -m 755 $(SRCDIR)/fixarpinfo $(BINDIR)/fixarpinfo
199
200
	$(INSTALL) bossnode $(ETCDIR)/bossnode

201
PGENIFILES = rc.ifconfig rc.topomap rc.progagent rc.pgeni \
Leigh B Stoller's avatar
Leigh B Stoller committed
202
		rc.tarfiles rc.rpms rc.trafgen
203
204
205
206
207
208
209

pgeni-tarball:
	-rm -f $(TBROOT)/www/downloads/geniclient.tar
	rm -rf /tmp/mk1
	($(MAKE) DESTDIR=/tmp/mk1 local-install)
	tar cf $(TBROOT)/www/downloads/geniclient.tar \
                -C /tmp/mk1/usr/local/etc/emulab \
210
		libsetup.pm libtmcc.pm runstartup watchdog \
211
212
213
		$(addprefix rc/, $(PGENIFILES))
	rm -rf /tmp/mk1

214
215
bossnode:	GNUmakefile
	echo >$@ "$(BOSSNODE)"