Browse Source

* 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)
master
lars 13 years ago
parent
commit
df2a8a0db9
  1. 11
      plugins/partition/partition.py

11
plugins/partition/partition.py

@ -37,7 +37,7 @@ PARTTYPES = {
"linux" : ["L", "ext3"]}
CONFIGPARTITION = {
"size" : 5, # size of configuration partition (if necessary) in MB
"size" : 10, # size of configuration partition (if necessary) in MB
"type" : "L",
"fs" : "ext2"}
@ -184,6 +184,7 @@ class partition(cryptobox.plugins.base.CryptoBoxPlugin):
block_devices = [ e for e in
blockdevice_tools.Blockdevices().get_partitionable_devices()
if self.cbox.is_device_allowed(e) ]
block_devices.sort()
counter = 0
for dev in block_devices:
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)
# refresh the device 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()
return (fdisk_status == 0)
@ -504,7 +505,7 @@ class partition(cryptobox.plugins.base.CryptoBoxPlugin):
"""Format all partitions of the device.
"""
parts = param_parts[:]
part_num = 1
part_num = 0
## maybe a config partition?
if self.with_config_partition:
dev_name = self.__get_partition_device(self.blockdevice, part_num)
@ -548,8 +549,8 @@ class partition(cryptobox.plugins.base.CryptoBoxPlugin):
valid_children.sort()
self.cbox.log.debug("Valid children of %s: %s" % \
(blockdev, [child.name for child in valid_children]))
if number <= len(valid_children):
childdev = valid_children[number-1]
if number < len(valid_children):
childdev = valid_children[number]
if childdev:
return childdev.get_device()
## return some guessed value - we should never get here ...

Loading…
Cancel
Save