Commit 90cf963d authored by Mike Hibler's avatar Mike Hibler
Browse files

More updates/cleanup in the fs-install path

parent d63fe071
......@@ -2,7 +2,7 @@
#
# EMULAB-COPYRIGHT
# Copyright (c) 2003, 2004, 2005, 2006 University of Utah and the Flux Group.
# Copyright (c) 2003, 2004, 2005, 2006, 2007 University of Utah and the Flux Group.
# All rights reserved.
#
......@@ -62,7 +62,8 @@ use Getopt::Std;
# Handle command-line options
#
sub usage {
print "Usage: fs-install [-b] [-p packagedir] [-P portname]\n";
print "Usage: fs-install [-b] [-p packagedir] [-s] [-P portname]\n";
print " Required: -p (for binary packages) or -s (for source makes.)\n";
exit(1);
}
......@@ -83,8 +84,9 @@ my $FS_PORT = (($FBSD_VERSION == 4) ? "emulab-fs-1.4" : "emulab-fs-2.0");
my $packagedir = "";
my $batchmode = 0;
my $domakes = 0;
my %opts;
if (! getopts("P:p:b", \%opts)) {
if (! getopts("P:p:bs", \%opts)) {
usage();
}
if (defined($opts{p})) {
......@@ -93,10 +95,21 @@ if (defined($opts{p})) {
if (defined($opts{b})) {
$batchmode = 1;
}
if (defined($opts{s})) {
$domakes = 1;
}
if (defined($opts{P})) {
$FS_PORT = $opts{P};
}
# Don't just charge into making ports from source by default.
if ($packagedir eq "" and $domakes eq 0) {
print "At least one of -p and -s must be given.\n";
usage();
}
if ($packagedir ne "" and $domakes eq 1) {
print "Only one of -p and -s can be given.\n";
usage();
}
if (@ARGV) {
usage();
}
......@@ -139,15 +152,12 @@ my $LOCAL_HOSTNAMES = "/etc/mail/local-host-names";
my $ALIASES_FILE = "/etc/mail/aliases";
my $EXPORTS_FILE = "/etc/exports";
my $EXPORTS_HEAD = "$EXPORTS_FILE.head";
my $SYSLOG_CONF = "/etc/syslog.conf";
my $NEWSYSLOG_CONF = "/etc/newsyslog.conf";
my $SUDOERS = "/usr/local/etc/sudoers";
my $SSHD_CONFIG = "/etc/ssh/sshd_config";
my $INETD_CONF = "/etc/inetd.conf";
my $AUTHKEYS = "/root/.ssh/authorized_keys";
my $SMBCONF_FILE = "/usr/local/etc/smb.conf";
my $SMBCONF_HEAD = "$SMBCONF_FILE.head";
my $SAMBA_PATCH = "$TOP_SRCDIR/patches/samba.patch";
#
# Some directories we care about
......@@ -242,24 +252,13 @@ Phase "ports", "Installing ports", sub {
}
ExecQuietFatal("$ENV PKG_PATH=$packagedir $PKG_ADD $FS_PORT");
};
if ($packagedir) {
PhaseSkip("Packages installed okay");
}
PhaseSkip("Package directory provided; not installing from sources")
if ($packagedir);
Phase "pcopy", "Copying ports into place", sub {
DoneIfExists("$PORTSMISCDIR/emulab-fs");
ExecQuietFatal("$SH $SRCDIR/ports/ports-install");
};
Phase "ppatch", "Patching ports", sub {
Phase "samba-patch", "Patching samba port", sub {
if (!$WINSUPPORT) {
PhaseSkip("Windows support not enabled");
}
if (!ExecQuiet("$PATCH -C -f -l -R -p0 -i $SAMBA_PATCH")) {
PhaseSkip("$SAMBA_PATCH already applied");
}
ExecQuietFatal("$PATCH -f -l -p0 -i $SAMBA_PATCH");
};
};
Phase "pinstall", "Installing ports (may take a while)", sub {
#
# No interaction or options to worry about,
......
Supports Markdown
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