Commit 1e746ed9 authored by Timothy Stack's avatar Timothy Stack

For delay/jail nodes, consult the os_boot_cmd table for the boot

command line to use.  The old builtin defaults of '/kernel.delay' and
'/kernel.jail' are still used if nothing is found in the table.
parent fde58889
......@@ -56,7 +56,7 @@ CREATE TABLE archive_views (
date_created int(10) unsigned NOT NULL default '0',
branch_tag varchar(64) default NULL,
parent_view varchar(64) default NULL,
PRIMARY KEY (view,archive_idx)
PRIMARY KEY (view,archive_idx)
) TYPE=MyISAM;
--
......@@ -1521,6 +1521,18 @@ CREATE TABLE obstacles (
PRIMARY KEY (obstacle_id)
) TYPE=MyISAM;
--
-- Table structure for table `os_boot_cmd`
--
CREATE TABLE os_boot_cmd (
OS enum('Unknown','Linux','Fedora','FreeBSD','NetBSD','OSKit','Windows','TinyOS','Other') NOT NULL default 'Unknown',
version varchar(12) NOT NULL default '',
role enum('default','delay','linkdelay','vnodehost') NOT NULL default 'default',
boot_cmd_line text,
PRIMARY KEY (OS,version,role)
) TYPE=MyISAM;
--
-- Table structure for table `os_info`
--
......
......@@ -3123,3 +3123,17 @@ last_net_act,last_cpu_act,last_ext_act);
alter table os_info change osfeatures osfeatures \
set('ping','ssh','ipod','isup','veths','mlinks', \
'linktest','linkdelays') default NULL;
4.34: Table that maps an OS, version, and role to a boot command line.
It is referred to when assign_wrapper needs to assign a command
line to a delay or jail node.
CREATE TABLE os_boot_cmd (
OS enum('Unknown','Linux','Fedora','FreeBSD','NetBSD','OSKit',\
'Windows','TinyOS','Other') NOT NULL default 'Unknown',
version varchar(12) NOT NULL default '',
role enum('default','delay','linkdelay','vnodehost') \
NOT NULL default 'default',
boot_cmd_line text,
PRIMARY KEY (OS,version,role)
) TYPE=MyISAM;
......@@ -2688,7 +2688,8 @@ sub InitPnode($$)
# almost the same no matter what type.
#
my $routertype;
my $cmdline = ""; # XXX Gross hack.
my $cmdline_role = "default";
my $cmdline = "";
if (exists($delaynodes{$vnode})) {
#
......@@ -2705,6 +2706,7 @@ sub InitPnode($$)
$role = TBDB_RSRVROLE_DELAYNODE;
$routertype = TBDB_ROUTERTYPE_NONE;
$cmdline = "/kernel.delay";
$cmdline_role = "delay";
}
elsif (exists($virtnodes{$pnode})) {
#
......@@ -2725,10 +2727,21 @@ sub InitPnode($$)
# XXX Must have routing on jail hosting nodes. Change me.
$routertype = TBDB_ROUTERTYPE_MANUAL;
$cmdline = "/kernel.jail";
$cmdline_role = "vnodehost";
}
fatal("No OSID is defined for internal node $vname!")
if (!defined($osid));
my $query_result =
DBQueryFatal("SELECT ob.boot_cmd_line FROM os_info as oi ".
"LEFT JOIN os_boot_cmd as ob on ob.OS=oi.OS and ".
" ob.version=oi.version ".
"WHERE oi.osid='$osid' and ob.role='$cmdline_role'");
if ($query_result->num_rows == 1) {
($cmdline) = $query_result->fetchrow_array();
}
DBQueryFatal("UPDATE nodes set ".
" def_boot_cmd_line='$cmdline'," .
" startstatus=0, ".
......
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