Commit fa1e3c8b authored by Leigh Stoller's avatar Leigh Stoller

Checkpoint latest changes made while getting stuff to work better for

Dave and RON node installation.
parent 43c0bf7f
......@@ -627,13 +627,15 @@ sub FinishedInstructions()
return 0;
}
my $roottag = GetRootTag();
again:
while (1) {
print "Letting Netbed Central know we finished ...\n";
mysystem("$wget -q -O $path ".
"'${WWW}/cdromcheckin.php3".
"?cdkey=$cdkey&IP=$IP&privkey=$privkey".
"?cdkey=$cdkey&IP=$IP&privkey=$privkey&roottag=$roottag".
"&wahostname=$hostname&updated=1'");
if (!$?) {
last;
......@@ -841,10 +843,6 @@ sub LocalizeRoot()
my $root = "${blockdevice}${rootdevice}";
my $ED;
if (! defined($config{"slice1_image"})) {
return 0;
}
print "Localizing root filesystem on $root ...\n";
MountRoot();
......@@ -861,6 +859,14 @@ sub LocalizeRoot()
fatal("Failed to copy /etc/namedb/localhost.rev to /mnt/etc!")
if ($?);
#
# The rest happens only if a newly installed slice.
#
if (! defined($config{"slice1_image"})) {
UnMountMnt();
return 0;
}
#
# Write MD5 to toplevel. Serves as poor version info.
#
......@@ -907,9 +913,7 @@ sub LocalizeRoot()
chdir("/") or
fatal("Could not chdir to /!");
mysystem("umount /mnt");
$needumount = 0;
UnMountMnt();
return 0;
}
......
......@@ -46,7 +46,7 @@ STDERR->autoflush(1);
# Untaint the environment.
#
$ENV{'PATH'} = "/tmp:/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:".
"/usr/local/bin:/usr/site/bin:/usr/site/sbin:/usr/local/etc/testbed";
"/usr/local/bin:/usr/site/bin:/usr/site/sbin";
delete @ENV{'IFS', 'CDPATH', 'ENV', 'BASH_ENV'};
#
......@@ -84,7 +84,7 @@ my $IP = $ARGV[1];
# See if we want to continue. Useful for debugging.
#
print "\n";
if (! (Prompt("Dance with Netbed?", "Yes", 10) =~ /yes/i)) {
if (! (Prompt("Dance with Netbed?", "Yes", 15) =~ /yes/i)) {
exit(0);
}
......
......@@ -57,7 +57,7 @@ STDERR->autoflush(1);
# Untaint the environment.
#
$ENV{'PATH'} = "/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:".
"/usr/local/bin:/usr/site/bin:/usr/site/sbin:/usr/local/etc/testbed";
"/usr/local/bin:/usr/site/bin:/usr/site/sbin";
delete @ENV{'IFS', 'CDPATH', 'ENV', 'BASH_ENV'};
#
......@@ -121,10 +121,14 @@ exit(0);
sub BootFromCD()
{
#
# First check for a config file on the CD.
# If found, use that info. bootdisk must be set.
# Always check for a hardwired config. However, it takes precedence
# only when the disk is raw. The config block overrides the config
# file, except for bootdisk of course.
#
if (CheckConfigFile() != 0 || !defined($config{'bootdisk'})) {
my $hardwired = (CheckConfigFile() == 0 ? 1 : 0);
# Either no config file, or bootdisk unspecified. Must figure it out.
if (!defined($config{'bootdisk'})) {
#
# Give them multiple tries to find a disk with an existing
# configuration block.
......@@ -137,16 +141,28 @@ sub BootFromCD()
print "No existing configuration was found on $rawbootdisk\n";
if (Prompt("Try another disk for existing configuration?",
"No", 10) =~ /no/i) {
#
# Don't want to try another disk,
# consider this a first time install.
#
GetNewConfig();
if (! $hardwired) {
#
# Don't want to try another disk,
# consider this a first time install.
#
GetNewConfig();
$rawbootdisk = $config{'bootdisk'};
}
last;
}
}
}
$rawbootdisk = $config{'bootdisk'};
else {
#
# A hardwired config with a disk spec. Allow for overriding by
# the config block. If the disk is raw (no config block) then
# nothing will have be changed.
#
$rawbootdisk = $config{'bootdisk'};
CheckConfigBlock();
}
#
# Give the user a chance to override the normal operation, and specify
......@@ -255,8 +271,9 @@ sub GetUserConfig()
$config{'bootdisk'} = Prompt("System boot disk", $rawbootdisk);
$config{'interface'} = Prompt("Network Interface", WhichInterface());
$config{'hostname'} = Prompt("Hostname (no domain)", $config{'hostname'});
$config{'domain'} = Prompt("Domain", $config{'domain'});
$config{'hostname'} = Prompt("Hostname (without the domain!)",
$config{'hostname'});
$config{'IP'} = Prompt("IP Address", $config{'IP'});
$config{'netmask'} = Prompt("Netmask", WhichNetMask());
$config{'gateway'} = Prompt("Gateway IP", WhichGateway());
......@@ -341,7 +358,7 @@ sub WhichInterface()
#
foreach my $iface (@allifaces) {
if ($iface =~ /([a-zA-z]+)(\d+)/) {
if ($1 eq "lo") {
if ($1 eq "lo" || $1 eq "faith" || $1 eq "gif" || $1 eq "tun") {
next;
}
......
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