Commit 0461d118 authored by Côme Chilliet's avatar Côme Chilliet

feat(fai) Add support for randinit option, fix mount option support

issue #5821
parent bd4b9598
...@@ -259,6 +259,10 @@ class faiDiskEntry extends simplePlugin ...@@ -259,6 +259,10 @@ class faiDiskEntry extends simplePlugin
array('msdos', 'gpt'), '', array('msdos', 'gpt'), '',
array('MSDOS', 'GPT') array('MSDOS', 'GPT')
), ),
new BooleanAttribute (
_('Random init'), _('Initialise all encrypted partitions with random data'),
'randinit', FALSE
),
new HiddenAttribute ('FAIdiskType') new HiddenAttribute ('FAIdiskType')
) )
), ),
...@@ -299,6 +303,9 @@ class faiDiskEntry extends simplePlugin ...@@ -299,6 +303,9 @@ class faiDiskEntry extends simplePlugin
if ($this->FAIdiskType == 'cryptsetup') { if ($this->FAIdiskType == 'cryptsetup') {
$this->attributesAccess['fstabkey']->setDisabled(TRUE); $this->attributesAccess['fstabkey']->setDisabled(TRUE);
$this->attributesAccess['fstabkey']->setVisible(FALSE); $this->attributesAccess['fstabkey']->setVisible(FALSE);
} else {
$this->attributesAccess['randinit']->setDisabled(TRUE);
$this->attributesAccess['randinit']->setVisible(FALSE);
} }
if ($disk) { if ($disk) {
...@@ -366,6 +373,11 @@ class faiDiskEntry extends simplePlugin ...@@ -366,6 +373,11 @@ class faiDiskEntry extends simplePlugin
} }
continue; continue;
} }
if ($option == 'randinit') {
$this->randinit = TRUE;
continue;
}
} }
} }
...@@ -434,7 +446,11 @@ class faiDiskEntry extends simplePlugin ...@@ -434,7 +446,11 @@ class faiDiskEntry extends simplePlugin
if ($this->FAIdiskType == 'disk') { if ($this->FAIdiskType == 'disk') {
$tmp['FAIdiskOption'] = array('fstabkey:'.$this->fstabkey, 'disklabel:'.$this->disklabel); $tmp['FAIdiskOption'] = array('fstabkey:'.$this->fstabkey, 'disklabel:'.$this->disklabel);
} elseif ($this->FAIdiskType == 'cryptsetup') { } elseif ($this->FAIdiskType == 'cryptsetup') {
$tmp['FAIdiskOption'] = array(); if ($this->randinit) {
$tmp['FAIdiskOption'] = array('randinit');
} else {
$tmp['FAIdiskOption'] = array();
}
} else { } else {
$tmp['FAIdiskOption'] = array('fstabkey:'.$this->fstabkey); $tmp['FAIdiskOption'] = array('fstabkey:'.$this->fstabkey);
} }
......
...@@ -330,6 +330,11 @@ class faiPartition extends simplePlugin ...@@ -330,6 +330,11 @@ class faiPartition extends simplePlugin
'options' => array( 'options' => array(
'name' => _('Options'), 'name' => _('Options'),
'attrs' => array( 'attrs' => array(
new StringAttribute (
_('Mount options'), _('Filesystem mount options'),
'FAImountOptions', FALSE,
'defaults'
),
new StringAttribute ( new StringAttribute (
_('Create options'), _('Filesystem create options'), _('Create options'), _('Filesystem create options'),
'FAIfsCreateOptions', FALSE 'FAIfsCreateOptions', FALSE
...@@ -338,10 +343,6 @@ class faiPartition extends simplePlugin ...@@ -338,10 +343,6 @@ class faiPartition extends simplePlugin
_('Tune options'), _('Filesystem tune options'), _('Tune options'), _('Filesystem tune options'),
'FAIfsTuneOptions', FALSE 'FAIfsTuneOptions', FALSE
), ),
new StringAttribute (
_('Mount options'), _('Filesystem mount options'),
'FAIfsOptions', FALSE
),
) )
) )
); );
...@@ -427,6 +428,7 @@ class faiPartition extends simplePlugin ...@@ -427,6 +428,7 @@ class faiPartition extends simplePlugin
if ($this->FAIdiskType == 'cryptsetup') { if ($this->FAIdiskType == 'cryptsetup') {
$this->attributesAccess['cryptsetupPartition']->setChoices($this->getPartitionList()); $this->attributesAccess['cryptsetupPartition']->setChoices($this->getPartitionList());
$this->attributesAccess['cryptsetupPartition']->setRequired(TRUE);
$this->attributesAccess['FAIpartitionSize']->setDisabled(TRUE); $this->attributesAccess['FAIpartitionSize']->setDisabled(TRUE);
$this->attributesAccess['FAIpartitionSize']->setVisible(FALSE); $this->attributesAccess['FAIpartitionSize']->setVisible(FALSE);
$this->attributesInfo['flags']['name'] = _('Encryption settings'); $this->attributesInfo['flags']['name'] = _('Encryption settings');
......
...@@ -80,10 +80,11 @@ class PartitionTableAttribute extends DialogOrderedArrayAttribute ...@@ -80,10 +80,11 @@ class PartitionTableAttribute extends DialogOrderedArrayAttribute
protected $dialogClass = 'DiskEntryDialog'; protected $dialogClass = 'DiskEntryDialog';
protected $partitionAttributes = array( protected $partitionAttributes = array(
'cn','description', 'cn','description',
'FAIpartitionNr', 'FAIpartitionSize', 'FAImountPoint', 'FAIpartitionNr', 'FAIpartitionSize',
'FAIfsType', 'FAIpartitionType', 'FAImountOptions', 'FAIpartitionType', 'FAIpartitionFlags',
'FAIfsOptions', 'FAIpartitionFlags', 'FAIfsCreateOptions', 'FAImountPoint', 'FAImountOptions',
'FAIfsTuneOptions', 'FAIfsOptions', 'FAIpartitionFlags', 'FAIfsType',
'FAIfsCreateOptions', 'FAIfsTuneOptions',
'FAIlvmDevice' 'FAIlvmDevice'
); );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment