GNUmakefile.in 6.03 KB
Newer Older
Leigh B. Stoller's avatar
Leigh B. Stoller committed
1
2
#
# EMULAB-COPYRIGHT
Timothy Stack's avatar
   
Timothy Stack committed
3
# Copyright (c) 2000-2005 University of Utah and the Flux Group.
Leigh B. Stoller's avatar
Leigh B. 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 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@
OBJDIR		= ../..
17
SUBDIR		= tmcd/linux
18
19
20

include $(OBJDIR)/Makeconf

21
SCRIPTS		= sethostname.dhclient
22
23
24
25
26

#
# 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
27
all:	supfile $(SCRIPTS)
28
29
30

include $(TESTBED_SRCDIR)/GNUmakerules

31
DESTDIR		=
Kirk Webb's avatar
   
Kirk Webb committed
32
33
34
35
36
37
38
39
SYSETCDIR	?= $(DESTDIR)/etc
ETCDIR		?= $(DESTDIR)$(CLIENT_ETCDIR)
BINDIR		?= $(DESTDIR)$(CLIENT_BINDIR)
VARDIR		?= $(DESTDIR)$(CLIENT_VARDIR)
RCDIR		?= $(SYSETCDIR)/rc.d
INSTALL		?= /usr/bin/install -c 
COMMON		?= $(SRCDIR)/../common
DEFRUNLVLDIR	?= $(RCDIR)/rc3.d
40

41
install client-install:	common-install etc-install \
42
43
			sup-install script-install bin-install
	@echo "Remember to install the PEM files if necessary"
44

45
46
simple-install:	common-install script-install bin-install

47
dir-install:
48
49
50
51
52
53
	$(INSTALL) -m 755 -o root -g wheel -d $(SYSETCDIR)
	$(INSTALL) -m 755 -o root -g wheel -d $(SYSETCDIR)/sysconfig
	$(INSTALL) -m 755 -o root -g wheel -d $(SYSETCDIR)/sysconfig/network-scripts
	$(INSTALL) -m 755 -o root -g wheel -d $(RCDIR)
	$(INSTALL) -m 755 -o root -g wheel -d $(RCDIR)/init.d
	$(INSTALL) -m 755 -o root -g wheel -d $(RCDIR)/rc1.d
Kirk Webb's avatar
   
Kirk Webb committed
54
	$(INSTALL) -m 755 -o root -g wheel -d $(DEFRUNLVLDIR)
55
	$(INSTALL) -m 755 -o root -g wheel -d $(RCDIR)/rc6.d
56
57
58
59
60
61
62
63
64
65
66
67
68
	$(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
	-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
69

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

Mike Hibler's avatar
Mike Hibler committed
73
sup-install:	dir-install supfile
74
	$(INSTALL) -m 755 ./supfile $(ETCDIR)/supfile
75
76
	$(INSTALL) -m 750 -o root -g wheel -d $(DESTDIR)/root/.cvsup
	$(INSTALL) -m 600 $(SRCDIR)/cvsup.auth $(DESTDIR)/root/.cvsup/auth
77
78

bin-install:	dir-install
Timothy Stack's avatar
   
Timothy Stack committed
79
80
	$(INSTALL) -m 755 ../tmcc-nossl$(EXE) $(BINDIR)/tmcc.bin$(EXE)
	$(INSTALL) -m 755 ../findif$(EXE) $(BINDIR)/findif$(EXE)
81

82
etc-install:	dir-install sysetc-remove sysetc-install
83
84
85
86
87
88
	$(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
89
sysetc-install:	dir-install ifcfgs
90
91
	$(INSTALL) -m 755 $(SRCDIR)/dhclient-enter-hooks $(SYSETCDIR)/dhclient-enter-hooks
	$(INSTALL) -m 755 $(SRCDIR)/dhclient-exit-hooks $(SYSETCDIR)/dhclient-exit-hooks
92
	$(INSTALL) -m 644 $(SRCDIR)/modules.conf $(SYSETCDIR)/modules.conf
Mike Hibler's avatar
Mike Hibler committed
93
94
	$(INSTALL) -m 644 $(SRCDIR)/ifcfg-eth99 $(SYSETCDIR)/sysconfig/network-scripts
	$(INSTALL) -m 644 ifcfg-eth[0-9]* $(SYSETCDIR)/sysconfig/network-scripts
95
96
	$(INSTALL) -m 755 $(SRCDIR)/ntpd.sh $(RCDIR)/init.d/ntpd
	$(INSTALL) -m 755 $(SRCDIR)/testbed $(RCDIR)/init.d/testbed
Kirk Webb's avatar
   
Kirk Webb committed
97
	-ln -sf $(RCDIR)/init.d/testbed $(DEFRUNLVLDIR)/S96testbed
98
99
	-ln -sf $(RCDIR)/init.d/testbed $(RCDIR)/rc1.d/K12testbed
	-ln -sf $(RCDIR)/init.d/testbed $(RCDIR)/rc6.d/K12testbed
100
101
102
103
104
105
106
107
108
	$(INSTALL) -m 755 -o root -g wheel -d $(SYSETCDIR)/cron.pend
	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
109
	$(INSTALL) -m 755 $(SRCDIR)/elvin.sh $(RCDIR)/init.d/elvin
Kirk Webb's avatar
   
Kirk Webb committed
110
	-ln -sf $(RCDIR)/init.d/elvin $(DEFRUNLVLDIR)/S96elvin
111
112
113
114
	-ln -sf $(RCDIR)/init.d/elvin $(RCDIR)/rc1.d/K12elvin
	-ln -sf $(RCDIR)/init.d/elvin $(RCDIR)/rc6.d/K12elvin
	$(INSTALL) -m 755 $(SRCDIR)/rc.local $(RCDIR)/rc.local
	-ln -sf $(RCDIR)/rc.local $(SYSETCDIR)/rc.local
115
116
117
118

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

119
script-install:	dir-install $(SCRIPTS)
120
	$(INSTALL) -m 755 $(SRCDIR)/liblocsetup.pm $(BINDIR)/liblocsetup.pm
121
	$(INSTALL) -m 755 $(SRCDIR)/rc.ipod $(BINDIR)/rc/rc.ipod
122
	$(INSTALL) -m 755 $(SRCDIR)/rc.kname $(BINDIR)/rc/rc.kname
123
	$(INSTALL) -m 755 $(SRCDIR)/prepare $(BINDIR)/prepare
124
	$(INSTALL) -m 755 $(SRCDIR)/ixpboot $(BINDIR)/ixpboot
125
	$(INSTALL) -m 755 $(SRCDIR)/rc.ixp $(BINDIR)/rc/rc.ixp
126
	$(INSTALL) -m 755 ./sethostname.dhclient $(BINDIR)/sethostname.dhclient
127
	$(INSTALL) -m 755 $(SRCDIR)/rc.healthd $(BINDIR)/rc/rc.healthd
128
	$(INSTALL) -m 755 $(SRCDIR)/healthd.conf $(BINDIR)/healthd.conf
129
	$(INSTALL) -m 755 $(SRCDIR)/delaysetup $(BINDIR)/delaysetup
130
	$(INSTALL) -m 755 $(SRCDIR)/mkextrafs.pl $(BINDIR)/mkextrafs.pl
Mike Hibler's avatar
Mike Hibler committed
131
132
133
134
	$(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
135
136
137

sfs-install:
	$(INSTALL) -m 755 -o root -g wheel -d $(DESTDIR)/etc/sfs
138
	$(INSTALL) -m 755 $(SRCDIR)/sfs.sh $(RCDIR)/init.d/sfs
Kirk Webb's avatar
   
Kirk Webb committed
139
	-ln -sf $(RCDIR)/init.d/nfs $(DEFRUNLVLDIR)/S20nfs
140
	-ln -sf $(RCDIR)/init.d/sfs $(RCDIR)/rc6.d/K19sfs
141
142
143
144
145
146
147
	$(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
148
149
150
151

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