GNUmakefile.in 6.57 KB
Newer Older
Leigh Stoller's avatar
Leigh Stoller committed
1 2
#
# EMULAB-COPYRIGHT
3
# Copyright (c) 2000-2004 University of Utah and the Flux Group.
Leigh Stoller's avatar
Leigh Stoller committed
4 5 6
# All rights reserved.
#

7 8 9 10 11 12 13 14 15 16
#
# XXX ONLY RUN THIS INSTALL ON A FREEBSD 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@
OBJDIR		= ../..
17
SUBDIR		= tmcd/freebsd
18 19 20

include $(OBJDIR)/Makeconf

21 22 23 24 25 26 27
SCRIPTS		= sethostname

#
# Force dependencies on the scripts so that they will be rerun through
# configure if the .in file is changed.
# 
all:	supfile injail $(SCRIPTS)
28 29 30

include $(TESTBED_SRCDIR)/GNUmakerules

31
DESTDIR		=
32 33 34 35 36 37 38 39 40
SYSETCDIR	= $(DESTDIR)/etc
JAILDIR		= $(SYSETCDIR)/jail
ETCDIR		= $(DESTDIR)$(CLIENT_ETCDIR)
BINDIR		= $(DESTDIR)$(CLIENT_BINDIR)
VARDIR		= $(DESTDIR)$(CLIENT_VARDIR)
RCDIR		= $(DESTDIR)/usr/local/etc/rc.d
ISMFS		= $(ETCDIR)/ismfs
INSTALL		= /usr/bin/install -c

Mike Hibler's avatar
Mike Hibler committed
41 42 43
injail: $(SRCDIR)/jail/injail.c
	$(CC) $(CFLAGS) -O2 -o injail $<

44 45 46 47 48 49
install:	common-install etc-install \
			sup-install script-install bin-install jail-install
	@echo "Remember to install the PEM files if necessary"

mfs-install:	common-install etc-install \
			script-install bin-install
50
	cp $(SRCDIR)/mfs-rc.conf $(SYSETCDIR)/rc.conf
51
	echo >$(ISMFS) "This file indicates its the MFS. DO NOT DELETE!"
52

53 54 55 56 57 58 59
control-install:	dir-install
	cp /dev/null $(ETCDIR)/isctrl
	$(INSTALL) -m 755 ../tmcc $(BINDIR)/tmcc
	$(INSTALL) -m 755 $(SRCDIR)/liblocsetup.pm $(BINDIR)/liblocsetup.pm
	(cd ../common; $(MAKE) control-install)
	@echo "Remember to install the PEM files if necessary"

60
lbs-install:	simple-install
61 62 63 64
	cp /dev/null $(BINDIR)/isrem
	cp /dev/null $(ETCDIR)/isrem
	@echo "Remember to install the PEM files if necessary"

65 66 67
simple-install:	common-install \
			script-install bin-install jail-install

68
dir-install:
69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86
	$(INSTALL) -m 755 -o root -g wheel -d $(ETCDIR)
	$(INSTALL) -m 755 -o root -g wheel -d $(BINDIR)
	$(INSTALL) -m 755 -o root -g wheel -d $(RCDIR)
	$(INSTALL) -m 755 -o root -g wheel -d $(VARDIR)
	$(INSTALL) -m 755 -o root -g wheel -d $(VARDIR)/db
	$(INSTALL) -m 755 -o root -g wheel -d $(VARDIR)/jails
	$(INSTALL) -m 755 -o root -g wheel -d $(VARDIR)/logs
	$(INSTALL) -m 755 -o root -g wheel -d $(VARDIR)/sup
	$(INSTALL) -m 755 -o root -g wheel -d $(VARDIR)/boot
	$(INSTALL) -m 755 -o root -g wheel -d $(VARDIR)/lock
	-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

common-install:	dir-install
	(cd ../common; $(MAKE) local-install)

87
sup-install:	dir-install supfile
88
	$(INSTALL) -m 755 ./supfile $(ETCDIR)/supfile
89 90
	$(INSTALL) -m 750 -o root -g wheel -d $(DESTDIR)/root/.cvsup
	$(INSTALL) -m 600 $(SRCDIR)/cvsup.auth $(DESTDIR)/root/.cvsup/auth
91 92

bin-install:	dir-install
93 94
	$(INSTALL) -m 755 -s ../tmcc-nossl $(BINDIR)/tmcc.bin
	$(INSTALL) -m 755 -s ../findif $(BINDIR)/findif
95

96 97 98 99 100 101 102
etc-install:	dir-install sysetc-install
	$(INSTALL) -m 644 $(SRCDIR)/group $(ETCDIR)/group
	$(INSTALL) -m 600 $(SRCDIR)/master.passwd $(ETCDIR)/master.passwd
	$(INSTALL) -m 644 $(SRCDIR)/hosts $(ETCDIR)/hosts

sysetc-install:	dir-install
	$(INSTALL) -m 755 $(SRCDIR)/rc.conf $(SYSETCDIR)/rc.conf
103
	$(INSTALL) -m 755 $(SRCDIR)/dhclient-exit-hooks \
104 105 106 107 108
			$(SYSETCDIR)/dhclient-exit-hooks
	$(INSTALL) -m 755 $(SRCDIR)/start_if.fxp0 $(SYSETCDIR)/start_if.fxp0
	$(INSTALL) -m 755 $(SRCDIR)/start_if.fxp1 $(SYSETCDIR)/start_if.fxp1
	$(INSTALL) -m 755 $(SRCDIR)/start_if.fxp4 $(SYSETCDIR)/start_if.fxp4
	$(INSTALL) -m 755 $(SRCDIR)/start_if.xl0  $(SYSETCDIR)/start_if.xl0
Mike Hibler's avatar
Mike Hibler committed
109
	$(INSTALL) -m 755 $(SRCDIR)/start_if.em0  $(SYSETCDIR)/start_if.em0
110 111
	$(INSTALL) -m 755 $(SRCDIR)/periodic.conf $(SYSETCDIR)/periodic.conf
	$(INSTALL) -m 755 $(SRCDIR)/testbed.sh $(RCDIR)/testbed.sh
112
	$(INSTALL) -m 755 $(SRCDIR)/elvind.sh $(RCDIR)/elvind.sh
113

114
script-install:	dir-install $(SCRIPTS)
115 116
	$(INSTALL) -m 755 $(SRCDIR)/prepare $(BINDIR)/prepare
	$(INSTALL) -m 755 $(SRCDIR)/liblocsetup.pm $(BINDIR)/liblocsetup.pm
117 118
	$(INSTALL) -m 755 $(SRCDIR)/rc.delayagent $(BINDIR)/rc/rc.delayagent
	$(INSTALL) -m 755 $(SRCDIR)/rc.healthd $(BINDIR)/rc/rc.healthd
119
	$(INSTALL) -m 755 $(SRCDIR)/healthd.conf $(BINDIR)/healthd.conf
120 121 122
	$(INSTALL) -m 755 $(SRCDIR)/rc.ipod $(BINDIR)/rc/rc.ipod
	$(INSTALL) -m 755 $(SRCDIR)/rc.kname $(BINDIR)/rc/rc.kname
	$(INSTALL) -m 755 $(SRCDIR)/rc.mfs $(BINDIR)/rc/rc.mfs
123
	$(INSTALL) -m 755 ./sethostname $(BINDIR)/sethostname
124 125 126 127
	$(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
	$(INSTALL) -m 755 $(SRCDIR)/tbshutdown $(BINDIR)/tbshutdown
128
	$(INSTALL) -m 755 $(SRCDIR)/delaysetup $(BINDIR)/delaysetup
129
	$(INSTALL) -m 755 $(SRCDIR)/mkextrafs.pl $(BINDIR)/mkextrafs.pl
130
	$(INSTALL) -m 755 $(SRCDIR)/control_interface \
131
			$(BINDIR)/control_interface
132 133

sfs-install:
134
	$(INSTALL) -m 755 -o root -g wheel -d $(DESTDIR)/etc/sfs
135 136 137 138 139 140
	$(INSTALL) -m 755 $(SRCDIR)/sfs.sh $(RCDIR)/sfs.sh
	$(INSTALL) -m 644 $(SRCDIR)/exports $(SYSETCDIR)/exports
	$(INSTALL) -m 644 $(SRCDIR)/sfsrwsd_config \
			$(SYSETCDIR)/sfs/sfsrwsd_config
	$(INSTALL) -m 644 $(SRCDIR)/sfssd_config \
			$(SYSETCDIR)/sfs/sfssd_config
141 142 143 144
	$(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/root/var
	$(INSTALL) -m 775 -o sfs -g sfs -d $(DESTDIR)/var/sfs/root/usr
145

146
jail-install:	dir-install injail
147 148 149 150 151
	$(INSTALL) -m 755 -o root -g wheel -d $(JAILDIR)
	$(INSTALL) -m 644 $(SRCDIR)/jail/group $(JAILDIR)/group
	$(INSTALL) -m 640 $(SRCDIR)/jail/master.passwd $(JAILDIR)/master.passwd
	$(INSTALL) -m 755 $(SRCDIR)/jail/rc.conf $(JAILDIR)/rc.conf
	$(INSTALL) -m 755 $(SRCDIR)/jail/rc.local $(JAILDIR)/rc.local
152
	$(INSTALL) -m 755 $(SRCDIR)/jail/rc.injail $(BINDIR)/rc/rc.injail
153
	$(INSTALL) -m 755 $(SRCDIR)/jail/crontab $(JAILDIR)/crontab
154
	$(INSTALL) -m 755 $(SRCDIR)/jail/mkjail.pl $(BINDIR)/mkjail.pl
Mike Hibler's avatar
Mike Hibler committed
155
	$(INSTALL) -m 755 ./injail $(JAILDIR)/injail
156 157 158 159

# Invoked from ../ron
remote-install:	jail-install
	$(INSTALL) -m 755 $(SRCDIR)/rc.ipod $(BINDIR)/rc.ipod
160 161 162
	# Does tunnel stuff.
	$(INSTALL) -m 755 $(SRCDIR)/ifsetup $(BINDIR)/ifsetup
	$(INSTALL) -m 755 $(SRCDIR)/delaysetup $(BINDIR)/delaysetup
163
	$(INSTALL) -m 755 $(SRCDIR)/liblocsetup.pm $(BINDIR)/liblocsetup.pm
164 165 166 167 168 169 170 171 172 173

# Invoked from ../ron
locrem-install:
	-rm -f $(BINDIR)/sethostname
	-rm -f $(SYSETCDIR)/dhclient-exit-hooks
	$(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
	$(INSTALL) -m 755 $(SRCDIR)/control_interface \
			$(BINDIR)/control_interface
Mike Hibler's avatar
Mike Hibler committed
174 175

clean:
176
	/bin/rm -f injail