GNUmakefile.in 6.11 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

Kirk Webb's avatar
   
Kirk Webb committed
31
32
33
34
35
36
37
38
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
39

40
41
42
# without DESTDIR, used for the value of symlinks
RRCDIR		?= $(CLIENT_ETCDIR)/rc.d

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

47
48
simple-install:	common-install script-install bin-install

49
dir-install:
50
51
52
53
54
55
	$(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
56
	$(INSTALL) -m 755 -o root -g wheel -d $(DEFRUNLVLDIR)
57
	$(INSTALL) -m 755 -o root -g wheel -d $(RCDIR)/rc6.d
58
59
60
61
62
63
64
65
66
67
68
69
70
	$(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
71

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

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

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

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

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

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

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

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