Commit f90deda0 authored by Mike Hibler's avatar Mike Hibler

<cdrom> is the CD-ROM filesystem that winds up in the .iso

        (~stoller/dga.cdrom)
<image> is the disk filesystem that winds up imagezipped
        (pc16's disk)
<floppy> is the floppy image for the CD-ROM
        (~stoller/dga.cdrom/floppies/boot.flp)
===========

<cdrom>/etc/rc.cdroot:
        Add "-c 16" to mount_mfs commands to get rid of warning message.

<cdrom>/usr/site/sbin/register.pl
        Added "showprogress" which, when set, will do more verbose
        output from wget and imageunzip.  Added more "be patient" messages,
        they now use a common string.  Warn about kernel messages when
        creating tmp filesystem.  Use installed emulab.net, not Leigh's
        development tree.  Get "Dance with Netbed" prompt off same line
        as "starting local daemons..."

<cdrom>/usr/site/sbin/waipconfig.pl
        Change WhichRawDisk to use non-'r' special files, there is no
        distinct raw device interface anymore.  Also add ATAPI RAID to
        the list to try.  Default netmask to 255.255.255.0.
        Split-off initial install path some so that we can introduce
        prompts which don't time out (like, "are you sure you want to
        do this?").  rawbootdisk becomes netbed_disk in the rc.conf.local,
        also add and writeout netbsd_IP for use in the register.pl
        script (which doesn't use it yet).

<image>/etc/ntp.conf:
        Change "remote peers" (servers) to utah.ron and mit.ron

<image>/var:
        Cleaned out logfiles and other cruft.  Logfiles had a little too
        much info in them for my tastes (hostnames, IPs, users...)

<floppy>/boot/loader:
        Fixed "Aborted" error message
parent 86c79118
......@@ -15,12 +15,12 @@
. /etc/rc.conf.local
#
# rawbootdisk is set in rc.conf.local by the CDROM boot image.
# netbed_disk is set in rc.conf.local by the CDROM boot image.
#
case "$1" in
start)
if [ -f /usr/site/sbin/tbbootconfig ]; then
/usr/site/sbin/tbbootconfig -c 1 $rawbootdisk
/usr/site/sbin/tbbootconfig -c 1 $netbed_disk
case $? in
0)
......
......@@ -28,6 +28,10 @@ EmulabCheckIPConfig()
case $? in
0)
;;
-277)
echo 'Installation aborted'
exit 1
;;
*)
echo 'Error in testbed configuration program'
#reboot
......
......@@ -40,9 +40,9 @@ delete @ENV{'IFS', 'CDPATH', 'ENV', 'BASH_ENV'};
#
# Locals
#
#my $WWW = "https://www.emulab.net";
my $WWW = "https://www.emulab.net";
#my $WWW = "http://golden-gw.ballmoss.com:8080/~stoller/testbed";
my $WWW = "https://www.emulab.net/~stoller/www";
#my $WWW = "https://www.emulab.net/~stoller/www";
my $etcdir = "/etc";
my $cdkeyfile = "$etcdir/emulab.cdkey";
my $setupconfig = "$etcdir/emulab-setup.txt";
......@@ -58,10 +58,13 @@ my $logfile = "/tmp/register.log";
my $needstore = 0;
my $fromscratch = 0;
my $needumount = 0;
my $showprogress= 1;
my $cdkey;
my $privkey;
my %slicesizes;
my $PATIENCEMSG = "This could take several minutes, please be patient!\n";
my %config = ( privkey => undef,
fdisk => undef,
slice1_image => undef,
......@@ -123,6 +126,7 @@ else {
#
# See if we want to continue. Useful for debugging.
#
print "\n";
if (! (Prompt("Dance with Netbed?", "Yes", 10) =~ /yes/i)) {
exit(0);
}
......@@ -131,7 +135,9 @@ if (! (Prompt("Dance with Netbed?", "Yes", 10) =~ /yes/i)) {
# Get the plain device names (ad0, rad0).
#
my $rawdevice = substr($rawbootdisk, rindex($rawbootdisk, '/') + 1);
my $blockdevice = substr($rawdevice, 1);
# XXX no difference in block/raw anymore
#my $blockdevice = substr($rawdevice, 1);
my $blockdevice = $rawdevice;
#
# See if this is the first time. Look for the magic boot header.
......@@ -178,6 +184,7 @@ if ($needstore) {
if (!defined($fdisk));
print "Creating a temporary filesystem on slice 2 to hold images.\n";
print " (ignore kernel generated \"no disk label\" messages.)\n";
#
# First time through we need to lay down a DOS partition table.
......@@ -306,9 +313,15 @@ for ($i = 1; $i <= 4; $i++) {
# If told to load a local image from the CDROM, its really easy!
#
if (! ($image =~ /^http:.*$/ || $image =~ /^ftp:.*$/)) {
print "Loading image for slice $i from $image. Be patient!\n";
mysystem("imageunzip -s $i -d /$image $rawbootdisk");
print "Loading image for slice $i from $image.\n";
print $PATIENCEMSG;
if ($showprogress) {
print "(Output indicates uncompressed bytes written to disk.)\n";
system("imageunzip -o -s $i -d /$image $rawbootdisk");
} else {
mysystem("imageunzip -s $i -d /$image $rawbootdisk");
}
fatal("Failed to lay down image /$image!")
if ($?);
goto finished;
......@@ -320,10 +333,14 @@ for ($i = 1; $i <= 4; $i++) {
if ($image =~ /^http:.*$/ || $image =~ /^ftp:.*$/) {
again:
print "Transferring image to temp storage for slice $i from:\n".
" $image \n".
" Please be patient! \n";
" $image \n";
print $PATIENCEMSG;
mysystem("$wget -nv -O /mnt/image.ndz $image");
if ($showprogress) {
system("$wget -O /mnt/image.ndz $image");
} else {
mysystem("$wget -nv -O /mnt/image.ndz $image");
}
fatal("Failed to transfer image!")
if ($?);
......@@ -331,7 +348,9 @@ for ($i = 1; $i <= 4; $i++) {
# If an md5 hash was provided, compare it.
#
if (defined($hash)) {
print "Checking MD5 hash of the image. Please be patient!\n";
print "Checking MD5 hash of the image.\n";
print $PATIENCEMSG;
my $hval = `md5 -q /mnt/image.ndz`;
chomp($hval);
......@@ -343,9 +362,14 @@ for ($i = 1; $i <= 4; $i++) {
}
print "Writing image from temp storage to slice $i.\n";
print "This could take several minutes. Please be *very* patient!\n";
mysystem("imageunzip -s $i -o /mnt/image.ndz $rawbootdisk");
print $PATIENCEMSG;
if ($showprogress) {
print "(Output indicates uncompressed bytes written to disk.)\n";
system("imageunzip -o -s $i /mnt/image.ndz $rawbootdisk");
} else {
mysystem("imageunzip -s $i /mnt/image.ndz $rawbootdisk");
}
fatal("Failed to lay down image!")
if ($?);
......@@ -485,7 +509,8 @@ sub GetInstructions()
}
else {
while (!defined($privkey)) {
$privkey = Prompt("Please enter you CD password?", undef);
$privkey = Prompt("Please enter your 16 character CD password",
undef);
}
}
......@@ -708,8 +733,8 @@ sub MakeFS($$)
# If told to use a local image from the CDROM, its really easy!
#
if (! ($tarball =~ /^http:.*$/ || $tarball =~ /^ftp:.*$/)) {
print "Unpacking $tarball to $mntpoint.\n".
" Please be patient!\n";
print "Unpacking $tarball to $mntpoint.\n";
print $PATIENCEMSG;
mysystem("tar -zxf /$tarball");
fatal("Failed to untar /$tarball!")
......@@ -720,14 +745,16 @@ sub MakeFS($$)
# Transfer the image to the temp store and then unzip to the slice.
#
print "Transferring tarball for $mntpoint from:\n".
" $tarball\n".
" Please be patient! \n";
" $tarball\n";
print $PATIENCEMSG;
mysystem("$wget -nv -O /mnt/slicex.tar.gz $tarball");
fatal("Failed to transfer tarball!")
if ($?);
print "Unpacking tarball. Please be patient!\n";
print "Unpacking tarball.\n";
print $PATIENCEMSG;
mysystem("tar -zxf /mnt/slicex.tar.gz");
fatal("Failed to untar /mnt/slicex.tar.gz!")
if ($?);
......@@ -867,7 +894,18 @@ sub MountRoot()
#
sub WriteConfigBlock()
{
my $cmd = "$tbboot -f -d -w $softconfig -k 1 -c 0 ";
my $cmd;
# XXX for now hack, tbbootconfig doesn't know about 'bootdisk'
if (1) {
mysystem("grep -v bootdisk $softconfig > /tmp/softcfg");
fatal("Could not prepare $softconfig for writing!")
if ($?);
$cmd = "$tbboot -f -d -w /tmp/softcfg -k 1 -c 0 ";
} else {
$cmd = "$tbboot -f -d -w $softconfig -k 1 -c 0 ";
}
if (defined($config{privkey})) {
$cmd .= "-e $config{privkey} ";
}
......
......@@ -8,7 +8,7 @@
#
# This file goes in /usr/local/etc/rc.d on the CDROM.
#
# Get the rawdisk and pass that to the registration program. It does
# Get the disk and pass that to the registration program. It does
# all the actual work.
#
......@@ -17,7 +17,7 @@
case "$1" in
start)
if [ -f /usr/site/sbin/register.pl ]; then
/usr/site/sbin/register.pl $rawbootdisk
/usr/site/sbin/register.pl $netbed_disk
exit $?
fi
;;
......
This diff is collapsed.
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