Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
emulab-devel
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
143
Issues
143
List
Boards
Labels
Service Desk
Milestones
Merge Requests
6
Merge Requests
6
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
emulab
emulab-devel
Commits
8e5b2b2a
Commit
8e5b2b2a
authored
Mar 16, 2012
by
Leigh B Stoller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Initialize the image password from the supplied password when running
emulab-install, or from the current root password.
parent
0a0217b7
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
45 additions
and
0 deletions
+45
-0
install/phases/boss/mfs
install/phases/boss/mfs
+45
-0
No files found.
install/phases/boss/mfs
View file @
8e5b2b2a
...
@@ -4,6 +4,7 @@
...
@@ -4,6 +4,7 @@
use strict;
use strict;
use libinstall;
use libinstall;
use installvars;
use installvars;
use emutil;
my $MFSTARBALL = "tftpboot-elabinelab.tar.gz";
my $MFSTARBALL = "tftpboot-elabinelab.tar.gz";
my $MFSURL = "http://www.emulab.net/downloads/$MFSTARBALL";
my $MFSURL = "http://www.emulab.net/downloads/$MFSTARBALL";
...
@@ -100,6 +101,50 @@ sub Install($$$)
...
@@ -100,6 +101,50 @@ sub Install($$$)
}
}
};
};
#
# Before we localize, need to set the MFS password sitevar,
# since localize will break otherwise.
#
Phase "password", "Setting up MFS password", sub {
my $passhash;
my ($status, @output) =
ExecQuiet("$PREFIX/sbin/setsitevar -c $IMAGEPASSWORDSITEVAR");
PhaseFail("setsitevar failed")
if ($status);
if (@output) {
chomp($output[0]);
PhaseSkip("already set")
if ($output[0] ne "");
}
#
# Use the same password for everything.
#
if (defined($password)) {
$passhash = PassWordHash($password);
}
else {
#
# Use current root password, since we know people will
# choose reasonable root passwords.
#
($status,@output) =
ExecQuiet("egrep '^root:' /etc/master.passwd");
PhaseFail("egrep failed")
if ($status);
if (@output && $output[0] ne '' &&
$output[0] =~ /^root:([^:]*)/) {
$passhash = $1;
}
}
PhaseFail("Could not determine image password")
if (!defined($passhash));
ExecQuietFatal("$PREFIX/sbin/setsitevar ".
" $IMAGEPASSWORDSITEVAR '$passhash'");
};
#
#
# Localize the MFSs
# Localize the MFSs
#
#
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment