Commit 6053a89b authored by David Johnson's avatar David Johnson

Make systemd swap hack run on Ubuntu 15.

So, the scripts are now in clientside/tmcc/linux since they're the same
for any systemd-based Linux, and the centos7 and ubuntu15 makefiles
install those files.

Also had to improve fixup-fstab-swaps to handle the case where the / is
something like /dev/disk/by-uuid/<UUID> which is a symlink to the real
dev.  So try readlink -f to handle that.
parent b5e24ed2
......@@ -87,7 +87,7 @@ common-install: dir-install
@echo "no centos-specific common files"
bin-install: dir-install
$(INSTALL) -m 755 $(SRCDIR)/emulab-systemd-swaps $(BINDIR)
$(INSTALL) -m 755 $(SRCDIR)/../linux/emulab-systemd-swaps $(BINDIR)
@echo "centos7 systemd swap.service"
etc-install: dir-install sysetc-remove sysetc-install
......@@ -107,7 +107,7 @@ sysetc-install: ifcfgs dir-install
$(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
$(INSTALL) -m 644 $(SRCDIR)/emulab-fstab-fixup.service $(SYSETCDIR)/systemd/system
$(INSTALL) -m 644 $(SRCDIR)/../linux/emulab-fstab-fixup.service $(SYSETCDIR)/systemd/system
$(INSTALL) -m 644 $(SRCDIR)/ntpd.service $(SYSETCDIR)/systemd/system
rm -f $(SYSETCDIR)/systemd/system/multi-user.target.wants/ntpd.service
systemctl enable emulab-fstab-fixup.service
......
......@@ -128,7 +128,19 @@ sub findswaps()
my $rootfs = `df / | grep /dev/`;
if ($rootfs =~ /^(\/dev\/[a-z]+)\d+/) {
$rdisk = $1;
} else {
}
elsif ($rootfs =~ /^(\/dev\/[^\s]+)\s/) {
$rootfs = `readlink -f $1`;
if ($rootfs =~ /^(\/dev\/[a-z]+)\d+/) {
$rdisk = $1;
}
else {
print STDERR "*** WARNING: could not identify root disk, ".
"no swap enabled\n";
return;
}
}
else {
print STDERR "*** WARNING: could not identify root disk, ".
"no swap enabled\n";
return;
......
......@@ -56,7 +56,7 @@ COMMON = $(SRCDIR)/../common
DEFRUNLVLDIR ?= $(SYSETCDIR)/rc3.d
install client-install: common-install etc-install \
script-install bin-install sysetc-fixup
script-install bin-install sysetc-fixup systemd-fixup
@echo "Remember to install the PEM files if necessary"
simple-install: common-install script-install bin-install
......@@ -73,6 +73,8 @@ common-install: dir-install
bin-install: dir-install
(cd ../linux; $(MAKE) DESTDIR=$(DESTDIR) RCDIR=$(RCDIR) bin-install)
$(INSTALL) -m 755 $(SRCDIR)/findcnet $(BINDIR)/findcnet
$(INSTALL) -m 755 $(SRCDIR)/../linux/emulab-systemd-swaps $(BINDIR)
@echo "Emulab systemd swap.service"
etc-install: dir-install common-sysetc-install
$(INSTALL) -m 644 $(SRCDIR)/group $(ETCDIR)/group
......@@ -106,6 +108,9 @@ systemd-fixup:
rm -f /lib/systemd/system/network-online.target.wants/ifup-wait-all-auto.service
ln -sf ../ifup-wait-emulab-cnet.service \
/lib/systemd/system/network-online.target.wants/ifup-wait-emulab-cnet.service
$(INSTALL) -m 644 $(SRCDIR)/../linux/emulab-fstab-fixup.service \
/lib/systemd/system
systemctl enable emulab-fstab-fixup.service
script-install: dir-install $(SCRIPTS)
(cd ../linux; $(MAKE) DESTDIR=$(DESTDIR) RCDIR=$(RCDIR) script-install)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment