fogproject  1.5.9
About: FOG is a Linux-based network computer cloning solution for Windows, Mac OSX and various Linux distributions that ties together a few open-source tools with a PHP-based web interface. FOG doesn’t use any boot disks, or CDs; everything is done via TFTP and PXE.
  Fossies Dox: fogproject-1.5.9.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

boottask.hook.php
Go to the documentation of this file.
1 <?php
22 class BootTask extends Hook
23 {
29  public $name = 'BootTask';
35  public $description = 'Alter the boot task to make a custom task hook';
41  public $active = false;
47  public function __construct()
48  {
49  parent::__construct();
50  self::$HookManager
51  ->register(
52  'IPXE_EDIT',
53  array(
54  $this,
55  'changeTask'
56  )
57  );
58  }
66  public function changeTask($arguments)
67  {
68  if (!isset($arguments['ipxe']['task'])) {
69  return;
70  }
71  $TaskType = self::getClass('TaskType')
72  ->set('name', 'trusty-install')
73  ->load('name');
74  if (!$TaskType->isValid()) {
75  return;
76  }
77  $keys = array_keys($arguments['ipxe']['task']);
78  if (!in_array($TaskType->get('id'), $keys)) {
79  return;
80  }
81  $arguments['ipxe']['task'][$TaskType->get('id')] = array(
82  'set path /OS_IMAGES/ubuntu-14.04.3-DVD',
83  'set nfs_path /images/OS_IMAGES/ubuntu-14.04.3-DVD',
84  'kernel ${boot-url}${path}/install/netboot/ubuntu'
85  . '-installer/amd64/linux || read void',
86  'initrd ${boot-url}${path}/install/netboot/ubuntu-installer'
87  . '/amd64/initrd.gz || read void',
88  'imgargs linux root=/dev/nfs boot=casper live-installer'
89  . '/net-image=${boot-url}${path}/install/filesystem.squashfs '
90  . 'ks=${boot-url}/OS_IMAGES/kickstarts/precise_ks.cfg '
91  . 'ip=dhcp splash quiet - || read void',
92  'boot || read void',
93  );
94  $arguments['Host']
95  ->get('task')
96  ->set(
97  'stateID',
98  self::getCompleteState()
99  )->save();
100  }
101 }
BootTask\$name
$name
Definition: boottask.hook.php:29
BootTask\$active
$active
Definition: boottask.hook.php:41
FOGBase\getClass
static getClass($class, $data='', $props=false)
Definition: fogbase.class.php:439
BootTask\$description
$description
Definition: boottask.hook.php:35
BootTask
Definition: boottask.hook.php:23
BootTask\changeTask
changeTask($arguments)
Definition: boottask.hook.php:66
FOGController\get
get($key='')
Definition: fogcontroller.class.php:207
$keys
$keys
Definition: schema.php:1610
BootTask\__construct
__construct()
Definition: boottask.hook.php:47
Hook
Definition: hook.class.php:31
$TaskType
if(FOGCore::$useragent) if(! $Task->isValid()) $TaskType
Definition: hostinfo.php:33
FOGController\isValid
isValid()
Definition: fogcontroller.class.php:865