X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=application%2Fcontrollers%2Fdownload.php;h=843d29f1d0805c436c94c0ff7b059f8e9cb46f9b;hb=882f60e952c36b4ee5ef452df5cb4bae074a1198;hp=06e1737600ae3640da8bc7f263e5ea39a9b098e0;hpb=652223da644ffb9c9acbc04118a5c174fab10926;p=www-register-wizard.git diff --git a/application/controllers/download.php b/application/controllers/download.php index 06e1737..843d29f 100644 --- a/application/controllers/download.php +++ b/application/controllers/download.php @@ -11,7 +11,7 @@ include 'plc_header.php'; // Common functions require_once 'plc_functions.php'; -require_once 'plc_sorts.php'; +require_once 'plc_config.php'; include 'plc_objects.php'; @@ -108,7 +108,7 @@ class Download extends Controller { $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); @@ -140,7 +140,7 @@ class Download extends Controller { } $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; @@ -216,7 +216,7 @@ class Download extends Controller { } 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 */ @@ -251,7 +251,16 @@ class Download extends Controller { } 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; @@ -261,7 +270,7 @@ class Download extends Controller { 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":