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
array('msdos', 'gpt'), '',
array('MSDOS', 'GPT')
),
new BooleanAttribute (
_('Random init'), _('Initialise all encrypted partitions with random data'),
'randinit', FALSE
),
new HiddenAttribute ('FAIdiskType')
)
),
......@@ -299,6 +303,9 @@ class faiDiskEntry extends simplePlugin
if ($this->FAIdiskType == 'cryptsetup') {
$this->attributesAccess['fstabkey']->setDisabled(TRUE);
$this->attributesAccess['fstabkey']->setVisible(FALSE);
} else {
$this->attributesAccess['randinit']->setDisabled(TRUE);
$this->attributesAccess['randinit']->setVisible(FALSE);
}
if ($disk) {
......@@ -366,6 +373,11 @@ class faiDiskEntry extends simplePlugin
}
continue;
}
if ($option == 'randinit') {
$this->randinit = TRUE;
continue;
}
}
}
......@@ -434,7 +446,11 @@ class faiDiskEntry extends simplePlugin
if ($this->FAIdiskType == 'disk') {
$tmp['FAIdiskOption'] = array('fstabkey:'.$this->fstabkey, 'disklabel:'.$this->disklabel);
} elseif ($this->FAIdiskType == 'cryptsetup') {
if ($this->randinit) {
$tmp['FAIdiskOption'] = array('randinit');
} else {
$tmp['FAIdiskOption'] = array();
}
} else {
$tmp['FAIdiskOption'] = array('fstabkey:'.$this->fstabkey);
}
......
......@@ -330,6 +330,11 @@ class faiPartition extends simplePlugin
'options' => array(
'name' => _('Options'),
'attrs' => array(
new StringAttribute (
_('Mount options'), _('Filesystem mount options'),
'FAImountOptions', FALSE,
'defaults'
),
new StringAttribute (
_('Create options'), _('Filesystem create options'),
'FAIfsCreateOptions', FALSE
......@@ -338,10 +343,6 @@ class faiPartition extends simplePlugin
_('Tune options'), _('Filesystem tune options'),
'FAIfsTuneOptions', FALSE
),
new StringAttribute (
_('Mount options'), _('Filesystem mount options'),
'FAIfsOptions', FALSE
),
)
)
);
......@@ -427,6 +428,7 @@ class faiPartition extends simplePlugin
if ($this->FAIdiskType == 'cryptsetup') {
$this->attributesAccess['cryptsetupPartition']->setChoices($this->getPartitionList());
$this->attributesAccess['cryptsetupPartition']->setRequired(TRUE);
$this->attributesAccess['FAIpartitionSize']->setDisabled(TRUE);
$this->attributesAccess['FAIpartitionSize']->setVisible(FALSE);
$this->attributesInfo['flags']['name'] = _('Encryption settings');
......
......@@ -80,10 +80,11 @@ class PartitionTableAttribute extends DialogOrderedArrayAttribute
protected $dialogClass = 'DiskEntryDialog';
protected $partitionAttributes = array(
'cn','description',
'FAIpartitionNr', 'FAIpartitionSize', 'FAImountPoint',
'FAIfsType', 'FAIpartitionType', 'FAImountOptions',
'FAIfsOptions', 'FAIpartitionFlags', 'FAIfsCreateOptions',
'FAIfsTuneOptions', 'FAIfsOptions', 'FAIpartitionFlags',
'FAIpartitionNr', 'FAIpartitionSize',
'FAIpartitionType', 'FAIpartitionFlags',
'FAImountPoint', 'FAImountOptions',
'FAIfsType',
'FAIfsCreateOptions', 'FAIfsTuneOptions',
'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