GNUmakefile.in 5.07 KB
Newer Older
Dan Reading's avatar
Dan Reading committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
#
# Copyright (c) 2000-2015 University of Utah and the Flux Group.
# 
# {{{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/>.
# 
# }}}
#

#
# 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		= @top_builddir@
SUBDIR		= $(subst $(TESTBED_SRCDIR)/,,$(SRCDIR))

include $(OBJDIR)/Makeconf

SCRIPTS		= 

MYINSTALL	= $(SRCDIR)/myinstall

#
# Force dependencies on the scripts so that they will be rerun through
# configure if the .in file is changed.
# 
46
all:	ifcfgs
Dan Reading's avatar
Dan Reading committed
47 48 49 50 51 52 53 54 55 56 57 58 59

include $(TESTBED_SRCDIR)/GNUmakerules

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

install client-install:	baselinux-client-install common-install etc-install \
60
			script-install bin-install \
Dan Reading's avatar
Dan Reading committed
61
			sysetc-onceonly-install
Dan Reading's avatar
Dan Reading committed
62 63 64 65 66 67 68 69 70 71 72 73 74
	@echo "Remember to install the PEM files if necessary"

mfs-install: client-install baselinux-mfs-install

frisbee-mfs-install: baselinux-frisbee-mfs-install

simple-install:	common-install script-install bin-install

openvz-install:	baselinux-common-install common-install \
                baselinux-script-install script-install \
		baselinux-openvz-install etc-install

dir-install:
75 76 77 78 79
	$(INSTALL) -m 755 -o root -g root -d $(SYSETCDIR)/init.d
	$(INSTALL) -m 755 -o root -g root -d $(SYSETCDIR)/dhcp
	$(INSTALL) -m 755 -o root -g root -d $(SYSETCDIR)/logrotate.d
	$(INSTALL) -m 755 -o root -g root -d $(SYSETCDIR)/systemd
	$(INSTALL) -m 755 -o root -g root -d $(SYSETCDIR)/systemd/system
Dan Reading's avatar
Dan Reading committed
80
	$(INSTALL) -m 755 -o root -g root -d $(SYSETCDIR)/dracut.conf.d
81
	@echo "dir-install"
Dan Reading's avatar
Dan Reading committed
82 83 84 85 86 87 88 89

baselinux-%: dir-install
	(cd ../linux; $(MAKE) DESTDIR=$(DESTDIR) $(subst baselinux-,,$@))

common-install:	dir-install
	@echo "no centos-specific common files"

bin-install:	dir-install
90
	$(INSTALL) -m 755 $(SRCDIR)/../linux/emulab-systemd-swaps $(BINDIR)
91
	@echo "centos7 systemd swap.service"
Dan Reading's avatar
Dan Reading committed
92 93 94 95 96 97 98 99 100

etc-install:	dir-install sysetc-remove sysetc-install
	$(INSTALL) -m 755 $(SRCDIR)/rc.local $(RCDIR)/rc.local
	$(INSTALL) -m 755 $(SRCDIR)/testbed $(RCDIR)/init.d/testbed
	@echo "centos-specific etc-install done"

sysetc-install:	ifcfgs dir-install
	# Clean up stuff from the base linux install. Ick.
	# See ntpd.service below.
101 102 103 104 105 106 107 108 109
	rm -f $(RCDIR)/init.d/ntpd
	rm -f $(DEFRUNLVLDIR)/S58ntpd
	ln -sf /etc/dhclient-enter-hooks $(SYSETCDIR)/dhcp/
	ln -sf /etc/dhclient-exit-hooks $(SYSETCDIR)/dhcp/
	$(INSTALL) -m 644 $(SRCDIR)/ntp.conf $(SYSETCDIR)/ntp.conf
	$(INSTALL) -m 644 $(SRCDIR)/ifcfg-eth99 $(SYSETCDIR)/sysconfig/network-scripts
	$(INSTALL) -m 644 ifcfg-eth[0-9]* $(SYSETCDIR)/sysconfig/network-scripts
	$(INSTALL) -m 744 $(SRCDIR)/ifup-emulabcnet $(SYSETCDIR)/sysconfig/network-scripts
	$(INSTALL) -m 644 $(SRCDIR)/logrotate-syslog $(SYSETCDIR)/logrotate.d/syslog
110
	$(INSTALL) -m 644 $(SRCDIR)/../linux/emulab-fstab-fixup.service $(SYSETCDIR)/systemd/system
111 112
	$(INSTALL) -m 644 $(SRCDIR)/ntpd.service $(SYSETCDIR)/systemd/system
	rm -f $(SYSETCDIR)/systemd/system/multi-user.target.wants/ntpd.service
Dan Reading's avatar
Dan Reading committed
113
	systemctl enable emulab-fstab-fixup.service
114
	systemctl enable ntpd.service
Dan Reading's avatar
Dan Reading committed
115 116

sysetc-remove:
117
	rm -rf $(SYSETCDIR)/modules.conf $(SYSETCDIR)/ntp.conf $(SYSETCDIR)/cron.pend
Dan Reading's avatar
Dan Reading committed
118 119 120 121

# stuff we don't really need to do all the time and may not even be correct
# or sufficient for all FCs
sysetc-onceonly-install:
122
	@$(MYINSTALL) $(SRCDIR)/emulab-ld.so.conf $(SYSETCDIR)/ld.so.conf.d/emulab.conf
Dan Reading's avatar
Dan Reading committed
123
	@$(MYINSTALL) $(SRCDIR)/network $(SYSETCDIR)/sysconfig/network
124 125 126
	@$(MYINSTALL) $(SRCDIR)/init $(SYSETCDIR)/sysconfig/init
	@$(MYINSTALL) -m 600 $(SRCDIR)/login.defs $(SYSETCDIR)/login.defs
	@$(MYINSTALL) -m 600 $(SRCDIR)/securetty $(SYSETCDIR)/securetty
Dan Reading's avatar
Dan Reading committed
127
	@$(MYINSTALL) -m 440 $(SRCDIR)/sudoers $(SYSETCDIR)/sudoers
Dan Reading's avatar
Dan Reading committed
128
	@$(MYINSTALL) $(SRCDIR)/rsyslog.conf $(SYSETCDIR)/rsyslog.conf
Dan Reading's avatar
Dan Reading committed
129
	@$(MYINSTALL) $(SRCDIR)/selinux-config $(SYSETCDIR)/selinux/config
Dan Reading's avatar
Dan Reading committed
130
	@$(MYINSTALL) $(SRCDIR)/emulab-dracut.conf $(SYSETCDIR)/dracut.conf.d/01-dist.conf
131
	@echo "sysetc-onceonly-install"
Dan Reading's avatar
Dan Reading committed
132 133

script-install:	dir-install $(SCRIPTS)
134
	$(INSTALL) -m 755 $(SRCDIR)/delaysetup $(BINDIR)/delaysetup
Dan Reading's avatar
Dan Reading committed
135 136 137 138 139 140 141 142 143 144

sfs-install:
	@echo "no centos-specific sfs files"

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

clean:
	rm -f ifcfg-eth? supfile