Commit eb04f6b9 authored by Leigh B. Stoller's avatar Leigh B. Stoller
Browse files

Make rebooting an option to rc.frisbee (-noreboot).

Pass that argument from rc.cdboot since after a successful disk load,
there is no need to reboot before asking bootinfo what to do next.
This will avoid a full reboot cycle.
parent c898da51
......@@ -127,6 +127,7 @@ sub doboot()
$bootdev = WhichRawDisk();
print("Using $bootdev for config sector ...\n");
bootinfo:
#
# If this is first install on this disk, or if the disk has just been
# loaded, initialize the magic sector so that it boots from the CD.
......@@ -148,6 +149,7 @@ sub doboot()
# by the bootinfo server, returning only when bootinfo says that the node
# should boot (has been allocated or needs to be reloaded).
#
print("Asking bootinfo what to do; warning, this might block ...\n");
my $bootwhat = `bootinfoclient -s $bossname`;
if ($?) {
print("Error running bootinfoclient; falling back to MFS boot\n");
......@@ -196,7 +198,6 @@ sub doboot()
#
# We know about a couple of different MFSs, but thats it!
#
if ($mfs eq "freebsd.newnode") {
system("$BINDIR/newclient");
#
......@@ -207,11 +208,15 @@ sub doboot()
}
elsif ($mfs =~ /^frisbee.*$/) {
#
# Run the frisbee script. If all goes well it will reboot.
# Any problems we land back here, so go into the MFS so we
# can possibly diagnose the problem.
# Run the frisbee script. We do not want rc.frisbee to reboot
# though since once the frisbee is done, we can immediately go
# back through bootinfo to see what to do next, avoiding a full
# reboot cycle!
#
system("$RCDIR/rc.frisbee");
if (system("$RCDIR/rc.frisbee -noreboot") == 0) {
goto bootinfo;
}
# Failed, drop into MFS for easy debug and reboot later.
goto mfs;
}
elsif ($mfs =~ /^freebsd.*$/) {
......
......@@ -4,6 +4,13 @@
# Copyright (c) 2000-2004 University of Utah and the Flux Group.
# All rights reserved.
#
# Optional flag argument says "do not reboot"
#
reboot=1
if [ $# -eq 1 -a "$1" = "-noreboot" ]; then
reboot=0
fi
#
# Amount of memory in MB to leave for everyone else in the system. If you
......@@ -123,10 +130,15 @@ if [ x"$ADDRESS" != x ]; then
echo "Adjusting slice-related files";
$BINDIR/slicefix $PARTITION $DISK
fi
echo "Image load complete, rebooting ..."
echo "Image load complete"
$BINDIR/tmcc state RELOADDONE
/sbin/reboot
sleep 100
if [ $reboot -eq 1 ]; then
echo "Rebooting ..."
/sbin/reboot
sleep 100
fi
exit 0
;;
*)
echo "Frisbee run failed, status $?"
......@@ -136,3 +148,4 @@ else
echo "Unable to get address for loading image"
fi
echo "Failed to load disk, dropping to login prompt"
exit 1
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