diff --git a/doc/setup.txt b/doc/setup.txt index 434b4e54b4d90929f1c7b03b1f2e47d207a5c29a..84ebdd5c3ee5093d76ce1e82c83733e05cb86bc6 100644 --- a/doc/setup.txt +++ b/doc/setup.txt @@ -79,7 +79,11 @@ to make sure that /usr is at least 8GB and at least a million inodes. If you want, you can go ahead and create an account for yourself on boss. For now, just stick the home directory somewhere local, and move it to /users/ once you've got it mounted from ops (the boss-install script will set this up). In -general, it's probably simpler to just use 'root' for now. +general, it's probably simpler to just use 'root' for now. BE SURE to +give root a password and REMEMBER it! You are going to need it later. To +set the root password: + + passwd root ##### Step 1 - Installing packages diff --git a/install/boss-install.in b/install/boss-install.in index 8e25a901f15cac5be76aa8829fbbe1c33de4b856..00cbf2066cd4b59245e0077d09b51b02e7421b96 100644 --- a/install/boss-install.in +++ b/install/boss-install.in @@ -360,6 +360,25 @@ Phase "ports", "Installing ports", sub { "then re-run this script."); }; +# XXX Temporary. +Phase "portfixup", "Fixing up packages", sub { + Phase "rsync", "Looking for rsync", sub { + if (!ExecQuiet("$PKG_INFO -x rsync")) { + PhaseSkip("rsync already installed"); + } + + # + # This port is dead-simple, so it's safe to do it from this script + # + my $pwd = `$PWD`; + chomp $pwd; + chdir "$PORTSDIR/net/rsync" or + PhaseFail "Unable to change to $PORTSDIR/net/rsync: $!"; + ExecQuietFatal("make -DBATCH install"); + chdir $pwd; + }; +}; + Phase "patches", "Applying patches", sub { Phase "g++patch", "Patching g++'s STL", sub { if (!ExecQuiet("$PATCH -C -f -R -p0 -i $STL_PATCH")) { @@ -894,10 +913,7 @@ Phase "named", "Setting up initial named configuration", sub { Phase "firstuser", "Setting up initial user (elabman)", sub { PhaseSkip("elabman already created") if (-d "/users/elabman"); - PhaseSkip("Not needed unless in batch mode") - if (!$batchmode); - ExecQuietFatal("perl $TOP_OBJDIR/utils/firstuser ". - ($batchmode ? " -b" : "") . + ExecQuietFatal("perl $TOP_OBJDIR/utils/firstuser -b ". (defined($password) ? " -p $password" : "")); }; diff --git a/install/ops-install.in b/install/ops-install.in index 8de13678c15373a37343e4ad5dbddfd36fc1296c..6eb3909603db9c5233b99f89a98663050fe793d8 100644 --- a/install/ops-install.in +++ b/install/ops-install.in @@ -250,6 +250,25 @@ Phase "ports", "Installing ports", sub { }; }; +# XXX Temporary. +Phase "portfixup", "Fixing up packages", sub { + Phase "rsync", "Looking for rsync", sub { + if (!ExecQuiet("$PKG_INFO -x rsync")) { + PhaseSkip("rsync already installed"); + } + + # + # This port is dead-simple, so it's safe to do it from this script + # + my $pwd = `$PWD`; + chomp $pwd; + chdir "$PORTSDIR/net/rsync" or + PhaseFail "Unable to change to $PORTSDIR/net/rsync: $!"; + ExecQuietFatal("make -DBATCH install"); + chdir $pwd; + }; +}; + Phase "patches", "Applying patches", sub { Phase "m2cryptopatch", "Patching m2crypto", sub { if (!ExecQuiet("$PATCH -C -f -l -R -p0 -i $M2CRYPTO_PATCH")) { diff --git a/utils/firstuser.in b/utils/firstuser.in index b696cd2b836719e60d853d3336e328dec3f85fa8..a9c24577d6670948505e82910bc689b16eff482d 100755 --- a/utils/firstuser.in +++ b/utils/firstuser.in @@ -30,6 +30,7 @@ my $protoproj = 'emulab-ops'; my $protoproj_desc = 'Operations Meta-Project'; my $batchmode = 0; my $password; +my $encpass; my %opts; # @@ -64,14 +65,26 @@ print "meta-project.\n\n"; # Get a password for the user if (!defined($password)) { - print "Pick a password for $protouser (warning, will be echoed): "; - $password = <>; - chomp($password); + # + # In batch mode, we get it from the root user password entry. + # Otherwise prompt user for it. + # + if ($batchmode) { + (undef,$encpass) = getpwnam("root") or + die("No root user!\n"); + } + else { + print "Pick a password for $protouser (warning, will be echoed): "; + $password = <>; + chomp($password); + } +} +if (!defined($encpass)) { + my @salt_chars = ('a'..'z','A'..'Z','0'..'9'); + my $salt = $salt_chars[rand(@salt_chars)] . + $salt_chars[rand(@salt_chars)]; + $encpass = crypt($password, "\$1\$${salt}"); } -my @salt_chars = ('a'..'z','A'..'Z','0'..'9'); -my $salt = $salt_chars[rand(@salt_chars)] . - $salt_chars[rand(@salt_chars)]; -my $encpass = crypt($password, "\$1\$${salt}"); # Get uid for the user and a gid for the project my $uid = 10000;