From: cajus Date: Thu, 6 Apr 2006 10:30:12 +0000 (+0000) Subject: Added boot kernel hook X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=0b9cae829b8b18828a3487fdc7e2332907d01138;p=gosa.git Added boot kernel hook git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@3005 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/plugins/admin/systems/class_terminalStartup.inc b/plugins/admin/systems/class_terminalStartup.inc index 35b521d49..f893dd0f6 100644 --- a/plugins/admin/systems/class_terminalStartup.inc +++ b/plugins/admin/systems/class_terminalStartup.inc @@ -9,11 +9,12 @@ class termstartup extends plugin /* Generic terminal attributes */ var $bootmode= "G"; var $goLdapServerList= array("default"); - var $gotoBootKernel= "default"; + var $gotoBootKernel= ""; var $gotoKernelParameters= ""; var $gotoLdapServer= ""; var $gotoModules= array(); var $gotoTerminalPath= ""; + var $gotoBootKernels= array("default"); /* Share */ var $gotoShares = array();// Currently Share Option @@ -81,6 +82,26 @@ class termstartup extends plugin $this->gotoAvailableShares= $config->getShareList(false); $this->orig_dn= $this->dn; + + /* Get list of boot kernels */ + if (isset($this->config->data['TABS'])){ + $command= search_config($this->config->data['TABS'], get_class($this), "KERNELS"); + + if (!check_command($command)){ + $message[]= sprintf(_("Command '%s', specified as KERNELS hook for plugin '%s' doesn't seem to exist."), $command, + get_class($this)); + } else { + $fh= popen($command, "r"); + while (!feof($fh)) { + $buffer= fgets($fh, 256); + $this->gotoBootKernels[]= $buffer; + } + pclose($fh); + sort($this->gotoBootKernels); + } + + } + } function execute() @@ -124,6 +145,7 @@ class termstartup extends plugin */ $smarty->assign("gotoShareSelections", $this->gotoShareSelections); $smarty->assign("gotoShareSelectionKeys", array_flip($this->gotoShareSelections)); + $smarty->assign("gotoBootKernels",$this->gotoBootKernels); /* if $_POST['gotoShareAdd'] is set, we will try to add a new entry * This entry will be, a combination of mountPoint and sharedefinitions diff --git a/plugins/admin/systems/class_workstationStartup.inc b/plugins/admin/systems/class_workstationStartup.inc index c43f70d47..54929b931 100644 --- a/plugins/admin/systems/class_workstationStartup.inc +++ b/plugins/admin/systems/class_workstationStartup.inc @@ -9,7 +9,7 @@ class workstartup extends plugin /* Generic terminal attributes */ var $bootmode = "G"; var $goLdapServerList = array("default"); - var $gotoBootKernel = "default"; + var $gotoBootKernel = ""; var $gotoKernelParameters = ""; var $gotoLdapServer = ""; var $gotoModules = array(); @@ -17,7 +17,7 @@ class workstartup extends plugin var $gotoFilesystem = array(); var $gotoTerminalPath = ""; var $FAIstatus = ""; - + var $gotoBootKernels = array("default"); /* attribute list for save action */ var $attributes = array("gotoLdapServer", "gotoBootKernel", "gotoKernelParameters", "FAIclass", "FAIstatus", "gotoShare","FAIdebianMirror", "FAIrelease"); @@ -220,6 +220,25 @@ class workstartup extends plugin } $this->orig_dn= $this->dn; + + /* Get list of boot kernels */ + if (isset($this->config->data['TABS'])){ + $command= search_config($this->config->data['TABS'], get_class($this), "KERNELS"); + + if (!check_command($command)){ + $message[]= sprintf(_("Command '%s', specified as KERNELS hook for plugin '%s' doesn't seem to exist."), $command, + get_class($this)); + } else { + $fh= popen($command, "r"); + while (!feof($fh)) { + $buffer= fgets($fh, 256); + $this->gotoBootKernels[]= $buffer; + } + pclose($fh); + sort($this->gotoBootKernels); + } + + } } @@ -360,6 +379,7 @@ class workstartup extends plugin function execute() { + /* Call parent execute */ plugin::execute(); @@ -522,6 +542,7 @@ class workstartup extends plugin $smarty->assign("gotoShares",$this->printOutAssignedShares()); $smarty->assign("gotoShareKeys",array_flip($this->printOutAssignedShares())); + $smarty->assign("gotoBootKernels",$this->gotoBootKernels); /* Arrays */ $tmp = $this->config->data['SERVERS']['LDAP']; @@ -810,10 +831,7 @@ class workstartup extends plugin /* Add semi automatic values */ // FIXME: LDAP Server may not be set here... - $this->gotoKernelParameters= "root=/dev/nfs nfsroot=". - $this->gotoTerminalPath. - ",ro,hard,nolock,fg,rsize=8192 ". - "ip=::::::dhcp ldap=".base64_encode($this->gotoLdapServer); + $this->gotoKernelParameters= "ldap=".base64_encode($this->gotoLdapServer); switch ($this->bootmode){ case "D": diff --git a/plugins/admin/systems/terminalStartup.tpl b/plugins/admin/systems/terminalStartup.tpl index 3360d9f81..9d3897710 100644 --- a/plugins/admin/systems/terminalStartup.tpl +++ b/plugins/admin/systems/terminalStartup.tpl @@ -3,16 +3,20 @@ - +
- - - + + diff --git a/plugins/admin/systems/workstationStartup.tpl b/plugins/admin/systems/workstationStartup.tpl index 996e6aba4..cfb1112da 100644 --- a/plugins/admin/systems/workstationStartup.tpl +++ b/plugins/admin/systems/workstationStartup.tpl @@ -11,8 +11,12 @@ - +
+ {$SelectBoxLdapServer}
+ +
+ +