From fdaadb9d59dbba67845fface3fefa87140e8ee0a Mon Sep 17 00:00:00 2001 From: Mac Newbold Date: Fri, 27 Sep 2002 00:07:09 +0000 Subject: [PATCH] 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. --- www/newosid.php3 | 17 +++++++++++++++-- www/newosid_form.php3 | 34 +++++++++++++++++++++++++++++++++- www/showstuff.php3 | 10 +++++++++- 3 files changed, 57 insertions(+), 4 deletions(-) diff --git a/www/newosid.php3 b/www/newosid.php3 index ae03898fc..1c4e16c19 100644 --- a/www/newosid.php3 +++ b/www/newosid.php3 @@ -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())"); diff --git a/www/newosid_form.php3 b/www/newosid_form.php3 index d00776ef4..f72816d1d 100644 --- a/www/newosid_form.php3 +++ b/www/newosid_form.php3 @@ -87,7 +87,7 @@ echo " echo " *Select OS: ping   ssh   + ipod   + isup   +

+ Guidelines for setting os_features for your OS: +

    +
  1. Mark ping and/or ssh if they are supported. +
  2. If you use a testbed kernel, or are based on a + testbed kernel config, mark the ipod box. +
  3. If it is based on a testbed image or sends its own + isup, mark isup. +
+ + \n"; + +# +# Choose an op_mode state machine +# + +echo " + *Operational Mode (op_mode): + +

+ Guidelines for setting op_mode for your OS: +

    +
  1. If it is based on a testbed image, use the same + op_mode as that image (should be NORMAL or NORMALv1). +
  2. If not, use MINIMAL. +
\n"; diff --git a/www/showstuff.php3 b/www/showstuff.php3 index 20edd98a0..aec424801 100644 --- a/www/showstuff.php3 +++ b/www/showstuff.php3 @@ -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 = " "; if (!$os_osfeatures) $os_osfeatures = " "; + if (!$os_op_mode) + $os_op_mode = " "; if (!$created) $created = "N/A"; @@ -801,6 +804,11 @@ function SHOWOSINFO($osid) { $os_osfeatures \n"; + echo " + Operational Mode: + $os_op_mode + \n"; + echo " Shared?: \n"; @@ -1365,4 +1373,4 @@ function SPITOSINFOLINK($osid) # # This is an included file. # -?> \ No newline at end of file +?> -- GitLab