Commit edfaf7a1 authored by Mike Hibler's avatar Mike Hibler

Modernize the default installation of elabinelab a bit.

In particular, make it work with d430s as inner nodes by supporting
an "sio2" pxeboot, the 64-bit MFS, and a more modern kernel in the MFS.
parent 80ce24fd
#!/usr/bin/perl -wT
#
# Copyright (c) 2000-2016 University of Utah and the Flux Group.
# Copyright (c) 2000-2017 University of Utah and the Flux Group.
#
# {{{EMULAB-LICENSE
#
......@@ -224,10 +224,10 @@ if (TBSiteVarExists("images/frisbee/maxrate_usr")) {
#
# Fixup pxeboot and MFS info.
#
# Right now we only load the standard BSD-based pxeboot and MFSes into
# an elabinelab, but many of our node types use the Linux-based tools instead.
# So for the moment, we tweak the DB to rewrite everything to use the BSD
# tools.
# Right now we only load versions of the standard BSD-based pxeboot and the
# standard BSD-based MFSes into an elabinelab. But many of our node types use
# the Linux-based tools instead so, for the moment, we tweak the DB to rewrite
# everything to use the BSD tools.
#
# Note that re-writing the pxe_boot_path doesn't have any effect for elabs
# NOT using the SINGLE_CONTROLNET setting. This is because as long as
......@@ -239,8 +239,8 @@ if (TBSiteVarExists("images/frisbee/maxrate_usr")) {
#
# Anyway, the way we work around the non-SINGLE_CONTROLNET problem is to
# find all the custom pxe_boot_path values (in nodes or node_type_attributes)
# and "create" them on the inner boss by symlinking them to the standard
# pxeboot. SWEET!
# and, if they do not exist, "create" them on the inner boss by symlinking
# them to the standard pxeboot. SWEET!
#
# XXX this should go away if/when we settle on a single set of tools.
#
......@@ -273,21 +273,29 @@ if (1) {
"where attrkey='pxe_boot_path' and attrvalue!='' ".
"group by attrvalue");
while (my ($path) = $qr->fetchrow_array()) {
push @bogoboots, $path;
# XXX we will install the various pxeboot.emu* files, so allow those
if ($path !~ /^\/tftpboot\/pxeboot.emu/) {
push @bogoboots, $path;
}
}
# ..and then from nodes
$qr = DBQueryFatal("select pxe_boot_path from nodes ".
"where pxe_boot_path is not NULL and role='testnode'");
while (my ($path) = $qr->fetchrow_array()) {
push @bogoboots, $path;
# XXX we will install the various pxeboot.emu* files, so allow those
if ($path !~ /^\/tftpboot\/pxeboot.emu-/) {
push @bogoboots, $path;
}
}
# and find all the node types and update their attributes.
$qr = DBQueryFatal("select type from node_types where class='pc'");
while (my ($ntype) = $qr->fetchrow_array()) {
# XXX assumes that BSD version is the default in dhcpd.conf.template
# XXX and again we can handle the assorted versions of pxeboot.emu
DBQueryFatal("delete from node_type_attributes ".
" where attrkey='pxe_boot_path' and type='$ntype'");
" where attrkey='pxe_boot_path' and type='$ntype' ".
" and not attrvalue like '/tftpboot/pxeboot.emu-%%'");
DBQueryFatal("update node_type_attributes set attrvalue='$amfs' ".
" where attrkey='adminmfs_osid' and type='$ntype'");
DBQueryFatal("update node_type_attributes set attrvalue='$dmfs' ".
......@@ -302,10 +310,17 @@ if (1) {
" where next_pxe_boot_path is not NULL");
#
# Now symlink all the alternate boots to pxeboot.emu
# XXX we assume everything is at the top level of /tftpboot right now.
# Make all versions of pxeboot.emu-* available
# XXX only worry about the most recent versions.
#
$EUID = 0;
system("cp -fp /tftpboot/pxeboot72/pxeboot.emu-* /tftpboot/")
if (-d "/tftpboot/pxeboot72");
#
# Now symlink all the unknown alternate boots to pxeboot.emu
# XXX we assume everything is at the top level of /tftpboot right now.
#
foreach my $boot (@bogoboots) {
if ($boot =~ /^\/tftpboot\/([^\/]+)$/) {
$boot = $1;
......
......@@ -119,7 +119,7 @@ MIN_UNIX_GID=2000
NODECONSOLE="sio2"
# Which version of the MFS.
MFSVERSION="82"
MFSVERSION="8-64"
PROTOGENI_SUPPORT=1
PROTOGENI_GENIRACK=0
PROTOGENI_DOMAIN="apt"
......
......@@ -109,7 +109,7 @@ MIN_UNIX_GID=2000
# Which console to use in the MFS. We need to set this for GeniRacks.
NODECONSOLE="vga"
# Which version of the MFS.
MFSVERSION="82"
MFSVERSION="8-64"
PROTOGENI_SUPPORT=1
PROTOGENI_DOMAIN="clemsoncloudlab"
PROTOGENI_LOCALUSER=1
......
......@@ -110,7 +110,7 @@ MIN_UNIX_GID=2000
NODECONSOLE="vga"
# Which version of the MFS.
MFSVERSION="82"
MFSVERSION="8-64"
PROTOGENI_SUPPORT=1
PROTOGENI_GENIRACK=0
PROTOGENI_DOMAIN="cloudlab"
......
......@@ -393,6 +393,19 @@ SPEWFROMOPS=1
#
NODECONSOLE="sio"
#
# Set the version of the MFSes used. Determines the version of FreeBSD
# used for the binaries and kernel.
#
# Note that you may need multiple versions of an MFS if you have really old
# and really new hardware. Such configurations will have to be setup manually.
#
# "72" Really old FreeBSD 7.2, 32-bit; do not use unless you have old nodes
# "82" Semi-old FreeBSD 8.2, 32-bit; use if you have 32-bit nodes
# "8-64" Semi-old FreeBSD 8.2, 64-bit; use if you have ALL 64-bit nodes
#
MFSVERSION="8-64"
#
# Set this if you are running:
# - Perl 5.8
......
......@@ -25,9 +25,9 @@ BOSSNODE=changeme
USERNODE=changeme
FSNODE=changeme
OURDOMAIN=changeme
FSDIR_GROUPS=/q/groups
FSDIR_PROJ=/q/proj
FSDIR_USERS=/q/users
FSDIR_GROUPS=changeme
FSDIR_PROJ=changeme
FSDIR_USERS=changeme
FSDIR_SHARE=/share
FSDIR_SCRATCH=changeme
WWWHOST=changeme
......
......@@ -348,6 +348,19 @@ SPEWFROMOPS=1
#
NODECONSOLE="sio"
#
# Set the version of the MFSes used. Determines the version of FreeBSD
# used for the binaries and kernel.
#
# Note that you may need multiple versions of an MFS if you have really old
# and really new hardware. Such configurations will have to be setup manually.
#
# "72" Really old FreeBSD 7.2, 32-bit; do not use unless you have old nodes
# "82" Semi-old FreeBSD 8.2, 32-bit; use if you have 32-bit nodes
# "8-64" Semi-old FreeBSD 8.2, 64-bit; use if you have ALL 64-bit nodes
#
MFSVERSION="82"
#
# Set this if you are running:
# - Perl 5.8
......
......@@ -19,10 +19,21 @@ sub Install($$$)
{
my ($server, $isupdate, $impotent) = @_;
#
# Configure can override setting it here.
#
# XXX defaulting this based on the OS running on the boss node is sketchy.
# It should really be based on the LCD of the experiment nodes. Quite
# likely, multiple MFSes will be needed as newer HW will not be supported
# by older MFSes and vice versa.
#
if ($MFSVERSION eq "") {
if ($FBSD_MAJOR > 8 || ($FBSD_MAJOR == 8 && $FBSD_MINOR >= 2)) {
$MFSVERSION = "82";
if ($FBSD_ARCH eq "amd64") {
$MFSVERSION = "8-64";
} else {
$MFSVERSION = "82";
}
}
elsif ($FBSD_MAJOR > 7 || $FBSD_MAJOR == 7 && $FBSD_MINOR >= 2) {
$MFSVERSION = "72";
......@@ -91,10 +102,20 @@ sub Install($$$)
Phase "freemv", "Using freebsd${fv} version of admin MFS", sub {
DoneIfExists("$TFTP_DIR/freebsd");
ExecQuietFatal("cd $TFTP_DIR; $MV freebsd${fv} freebsd");
# use the FreeBSD 9.x kernel if available
if (-x "$TFTP_DIR/freebsd/boot/kernel9") {
ExecQuietFatal("cd $TFTP_DIR/freebsd/boot; ".
"cp -fp kernel9 kernel");
}
};
Phase "frismv", "Using frisbee${fv} version of disk load MFS", sub {
DoneIfExists("$TFTP_DIR/frisbee");
ExecQuietFatal("cd $TFTP_DIR; $MV frisbee${fv} frisbee");
# use the FreeBSD 9.x kernel if available
if (-x "$TFTP_DIR/frisbee/boot/kernel9") {
ExecQuietFatal("cd $TFTP_DIR/frisbee/boot; ".
"cp -fp kernel9 kernel");
}
};
#
# Older tarballs didn't have FBSD-specific versions of newnode MFS.
......@@ -104,6 +125,11 @@ sub Install($$$)
DoneIfExists("$TFTP_DIR/freebsd.newnode");
ExecQuietFatal("cd $TFTP_DIR; ".
"$MV freebsd${fv}.newnode freebsd.newnode");
# use the FreeBSD 9.x kernel if available
if (-x "$TFTP_DIR/freebsd.newnode/boot/kernel9") {
ExecQuietFatal("cd $TFTP_DIR/freebsd.newnode/boot; ".
"cp -fp kernel9 kernel");
}
};
}
......
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