* fixed an issue with the creation of the configuration partition due to an index offset change with the new blockdevice module (Closes: #215)
* increased the size of configuration partitions to pass the "is_valid" test in cryptobox.core.blockdevice (also related to #215)
This commit is contained in:
parent
864d7091f6
commit
df2a8a0db9
|
@ -37,7 +37,7 @@ PARTTYPES = {
|
||||||
"linux" : ["L", "ext3"]}
|
"linux" : ["L", "ext3"]}
|
||||||
|
|
||||||
CONFIGPARTITION = {
|
CONFIGPARTITION = {
|
||||||
"size" : 5, # size of configuration partition (if necessary) in MB
|
"size" : 10, # size of configuration partition (if necessary) in MB
|
||||||
"type" : "L",
|
"type" : "L",
|
||||||
"fs" : "ext2"}
|
"fs" : "ext2"}
|
||||||
|
|
||||||
|
@ -184,6 +184,7 @@ class partition(cryptobox.plugins.base.CryptoBoxPlugin):
|
||||||
block_devices = [ e for e in
|
block_devices = [ e for e in
|
||||||
blockdevice_tools.Blockdevices().get_partitionable_devices()
|
blockdevice_tools.Blockdevices().get_partitionable_devices()
|
||||||
if self.cbox.is_device_allowed(e) ]
|
if self.cbox.is_device_allowed(e) ]
|
||||||
|
block_devices.sort()
|
||||||
counter = 0
|
counter = 0
|
||||||
for dev in block_devices:
|
for dev in block_devices:
|
||||||
self.hdf[self.hdf_prefix + "BlockDevices.%d.name" % counter] = \
|
self.hdf[self.hdf_prefix + "BlockDevices.%d.name" % counter] = \
|
||||||
|
@ -461,7 +462,7 @@ class partition(cryptobox.plugins.base.CryptoBoxPlugin):
|
||||||
self.cbox.log.info("failed to reread the modified partition table: %s" % error)
|
self.cbox.log.info("failed to reread the modified partition table: %s" % error)
|
||||||
# refresh the device list
|
# refresh the device list
|
||||||
self.cbox.reread_container_list()
|
self.cbox.reread_container_list()
|
||||||
# update the blockdevice - especially the new partitioned children
|
# update the current blockdevice - especially the new partitioned children
|
||||||
self.blockdevice.reset()
|
self.blockdevice.reset()
|
||||||
return (fdisk_status == 0)
|
return (fdisk_status == 0)
|
||||||
|
|
||||||
|
@ -504,7 +505,7 @@ class partition(cryptobox.plugins.base.CryptoBoxPlugin):
|
||||||
"""Format all partitions of the device.
|
"""Format all partitions of the device.
|
||||||
"""
|
"""
|
||||||
parts = param_parts[:]
|
parts = param_parts[:]
|
||||||
part_num = 1
|
part_num = 0
|
||||||
## maybe a config partition?
|
## maybe a config partition?
|
||||||
if self.with_config_partition:
|
if self.with_config_partition:
|
||||||
dev_name = self.__get_partition_device(self.blockdevice, part_num)
|
dev_name = self.__get_partition_device(self.blockdevice, part_num)
|
||||||
|
@ -548,8 +549,8 @@ class partition(cryptobox.plugins.base.CryptoBoxPlugin):
|
||||||
valid_children.sort()
|
valid_children.sort()
|
||||||
self.cbox.log.debug("Valid children of %s: %s" % \
|
self.cbox.log.debug("Valid children of %s: %s" % \
|
||||||
(blockdev, [child.name for child in valid_children]))
|
(blockdev, [child.name for child in valid_children]))
|
||||||
if number <= len(valid_children):
|
if number < len(valid_children):
|
||||||
childdev = valid_children[number-1]
|
childdev = valid_children[number]
|
||||||
if childdev:
|
if childdev:
|
||||||
return childdev.get_device()
|
return childdev.get_device()
|
||||||
## return some guessed value - we should never get here ...
|
## return some guessed value - we should never get here ...
|
||||||
|
|
Loading…
Reference in a new issue