// Common functions
require_once 'plc_functions.php';
-require_once 'plc_sorts.php';
+require_once 'plc_config.php';
include 'plc_objects.php';
$basename=PLC_NAME."-BootCD.usb";
}
- $api->UpdateNode( $hostname, array( "boot_state" => 'disable',
+ $api->UpdateNode( $hostname, array( "boot_state" => 'disabled',
"version" => $this->get_bootcd_version() ) );
/* exits on success */
$success = $this->deliver_bootmedium($node_id, $boot_action, $basename);
}
$hostname= $node_detail['hostname'];
- $return= $api->GetNodeNetworks( array( "node_id" => $node_id ), NULL );
+ $return= $api->GetInterfaces( array( "node_id" => $node_id ), NULL );
$can_gen_config= 1;
$data['has_primary']= 0;
}
if ($action != 'download-node-floppy')
{
- $api->UpdateNode( $hostname, array( "boot_state" => 'disable',
+ $api->UpdateNode( $hostname, array( "boot_state" => 'disabled',
"version" => $this->get_bootcd_version() ) );
}
/* exits on success */
}
function get_bootcd_version()
{
- $BOOTCD="/usr/share/bootcd";
+ // pick default bootcd flavors. need more flexibility
+ // TODO: find a way to handle 32/64 bit.
+ if ( defined("PLC_FLAVOUR_NODE_PLDISTRO") )
+ {
+ // This approach only works for 5.0
+ $BOOTCD = "/usr/share/bootcd-" . PLC_FLAVOUR_NODE_PLDISTRO . "-" . PLC_FLAVOUR_NODE_FCDISTRO . "-" . PLC_FLAVOUR_NODE_ARCH;
+ } else {
+ $BOOTCD = exec ("ls -d /usr/share/bootcd*");
+ }
+
$BOOTCDVERSION="$BOOTCD/build/version.txt";
$version = trim(file_get_contents($BOOTCDVERSION));
$bootcd_version = PLC_NAME . "-BootCD-".$version;
function deliver_bootmedium($node_id, $action, $filename)
{
global $api;
- ini_set("memory_limit","300M");
+ ini_set("memory_limit","450M");
$options = array();
switch ($action) {
case "node-usb-partition":