summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTails developers <tails@boum.org>2014-05-26 08:08:27 +0000
committerTails developers <tails@boum.org>2014-05-26 08:11:34 +0000
commit4fe5467707f93b47a442c58547fb56346adaa927 (patch)
tree4b9c3fd02fecb47daab2545a4137bc2cd3db3593
parente9fb5d913e448b46f0aa15a0d42483a17295171b (diff)
Pass the device to modify to _set_partition_flags.
We'll need this to ensure we pass a parent device (e.g. /dev/sdb) instead of a partition (e.g. /dev/sdb1) to sgdisk, from update_system_partition_properties.
-rwxr-xr-xliveusb/creator.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/liveusb/creator.py b/liveusb/creator.py
index d76a590..1ae4691 100755
--- a/liveusb/creator.py
+++ b/liveusb/creator.py
@@ -213,10 +213,10 @@ class LiveUSBCreator(object):
""" Unmount the device mounted at self.mount """
raise NotImplementedError
- def _set_partition_flags(self, part_number, flags):
+ def _set_partition_flags(self, device, part_number, flags):
cmd = ( [ '/sbin/sgdisk' ]
+ [ ('--attributes=%d:set:' % part_number) + str(flag) for flag in flags ]
- + [ self.drive['device'] ])
+ + [ device ])
self.popen(cmd, shell=False)
def partition_device(self):
@@ -241,7 +241,7 @@ class LiveUSBCreator(object):
self.drive['device']
]
self.popen(cmd, shell=False)
- self._set_partition_flags(1, SYSTEM_PARTITION_FLAGS)
+ self._set_partition_flags(self.drive['device'], 1, SYSTEM_PARTITION_FLAGS)
def update_system_partition_properties(self):
cmd = ( [ '/sbin/sgdisk' ]
@@ -871,7 +871,7 @@ class LinuxLiveUSBCreator(LiveUSBCreator):
# We still need to set the system partition flags as udisks cannot
# do it (yet?).
- self._set_partition_flags(1, SYSTEM_PARTITION_FLAGS)
+ self._set_partition_flags(self.drive['device'], 1, SYSTEM_PARTITION_FLAGS)
def update_system_partition_properties(self):
self.log.info(_('Updating properties of system partition on device %(device)s') % {
@@ -888,7 +888,7 @@ class LinuxLiveUSBCreator(LiveUSBCreator):
# We still need to set the system partition flags as udisks cannot
# do it (yet?).
- self._set_partition_flags(1, SYSTEM_PARTITION_FLAGS)
+ self._set_partition_flags(self.drive['device'], 1, SYSTEM_PARTITION_FLAGS)
def switch_drive_to_system_partition(self):
self._full_drive = self._drive