Commit fdaadb9d authored by Mac Newbold's avatar Mac Newbold

Add some missing os_features options and op_mode, along with guidelines for...

Add some missing os_features options and op_mode, along with guidelines for setting them properly. Add them to form handler and display as well.
parent 9da7375d
......@@ -153,8 +153,21 @@ if (isset($os_feature_ssh)) {
if (isset($os_feature_ipod)) {
$os_features_array[] = "ipod";
}
if (isset($os_feature_ipod)) {
$os_features_array[] = "isup";
}
$os_features = join(",", $os_features_array);
# Check op_mode
if (!isset($op_mode) ||
strcmp($op_mode, "") == 0 ||
(strcmp($op_mode, "MINIMAL") &&
strcmp($op_mode, "NORMAL") &&
strcmp($op_mode, "NORMALv1") &&
strcmp($op_mode, "Unknown"))) {
FORMERROR("Operational Mode (op_mode)");
}
#
# And insert the record!
#
......@@ -187,10 +200,10 @@ if (TBValidOSID($osid)) {
$query_result =
DBQueryFatal("INSERT INTO os_info ".
"(osname, osid, description, OS, version, path, magic, ".
"(osname, osid, description,OS,version,path,magic,op_mode, ".
" osfeatures, pid, shared, creator, mustclean, created) ".
"VALUES ('$osname', '$osid', '$description', '$OS', ".
" '$os_version', $os_path, '$os_magic', ".
" '$os_version', $os_path, '$os_magic', '$op_mode', ".
" '$os_features', '$pid', $os_shared, ".
" '$uid', $os_mustclean, now())");
......
......@@ -87,7 +87,7 @@ echo "<tr>
echo "<tr>
<td>*Select OS:</td>
<td><select name=OS>
<option value=none>Please Select &nbsp</option>
<option value=none>Please Select &nbsp;</option>
<option value=Linux>Linux </option>
<option value=FreeBSD>FreeBSD </option>
<option value=NetBSD>NetBSD </option>
......@@ -129,6 +129,38 @@ echo "<tr>
<td>OS Features:</td>
<td><input type=checkbox name=\"os_feature_ping\">ping &nbsp
<input type=checkbox name=\"os_feature_ssh\">ssh &nbsp
<input type=checkbox name=\"os_feature_ipod\">ipod &nbsp
<input type=checkbox name=\"os_feature_isup\">isup &nbsp
<p>
Guidelines for setting os_features for your OS:
<ol>
<li> Mark ping and/or ssh if they are supported.
<li> If you use a testbed kernel, or are based on a
testbed kernel config, mark the ipod box.
<li> If it is based on a testbed image or sends its own
isup, mark isup.
</ol>
</td>
</tr>\n";
#
# Choose an op_mode state machine
#
echo "<tr>
<td>*Operational Mode (op_mode):</td>
<td><select name=op_mode>
<option value=MINIMAL>MINIMAL &nbsp;</option>
<option value=NORMAL>NORMAL </option>
<option value=NORMALv1>NORMALv1 </option>
</select>
<p>
Guidelines for setting op_mode for your OS:
<ol>
<li> If it is based on a testbed image, use the same
op_mode as that image (should be NORMAL or NORMALv1).
<li> If not, use MINIMAL.
</ol>
</td>
</tr>\n";
......
......@@ -726,6 +726,7 @@ function SHOWOSINFO($osid) {
$os_path = $osrow[path];
$os_magic = $osrow[magic];
$os_osfeatures = $osrow[osfeatures];
$os_op_mode = $osrow[op_mode];
$os_pid = $osrow[pid];
$os_shared = $osrow[shared];
$os_osname = $osrow[osname];
......@@ -743,6 +744,8 @@ function SHOWOSINFO($osid) {
$os_magic = "&nbsp";
if (!$os_osfeatures)
$os_osfeatures = "&nbsp";
if (!$os_op_mode)
$os_op_mode = "&nbsp";
if (!$created)
$created = "N/A";
......@@ -801,6 +804,11 @@ function SHOWOSINFO($osid) {
<td class=\"left\">$os_osfeatures</td>
</tr>\n";
echo "<tr>
<td>Operational Mode: </td>
<td class=\"left\">$os_op_mode</td>
</tr>\n";
echo "<tr>
<td>Shared?: </td>
<td class=left>\n";
......@@ -1365,4 +1373,4 @@ function SPITOSINFOLINK($osid)
#
# This is an included file.
#
?>
\ No newline at end of file
?>
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