Skip to content

Commit

Permalink
CA-395582: Fix installation with multipath enabled
Browse files Browse the repository at this point in the history
Commit 6495353 ("CA-392317: Make sure kernel is up to date using
Gdisk") added a check to ensure that issues with rereading the partition
table are detected. However, rereading the partition table always fails
when device-mapper is used (BLKRRPART returns EINVAL) which causes
spurious installation failures. The host installer correctly uses kpartx
to recreate partitions after repartitioning device-mapper devices so
simply ignore the warning from sgdisk when using device-mapper.

Signed-off-by: Ross Lagerwall <[email protected]>
  • Loading branch information
rosslagerwall committed Jul 22, 2024
1 parent df8417b commit 0d91e2d
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions disktools.py
Original file line number Diff line number Diff line change
Expand Up @@ -1103,7 +1103,11 @@ def writeThisPartitionTable(self, table, dryrun=False, log=False):
except:
# Ignore error code which results from inconsistent initial state
pass
self.gdiskCheck([self.SGDISK, '--mbrtogpt', '--clear', self.device])
args = [self.SGDISK, '--mbrtogpt', '--clear', self.device]
if isDeviceMapperNode(self.device):
self.cmdWrap(args)
else:
self.gdiskCheck(args)

has_esp = False
for part in table.values():
Expand Down Expand Up @@ -1141,7 +1145,10 @@ def writeThisPartitionTable(self, table, dryrun=False, log=False):
if 'partuuid' in part:
args += ['--partition-guid=%d:%s' % (num,part['partuuid'])]
args += [self.device]
self.gdiskCheck(args)
if isDeviceMapperNode(self.device):
self.cmdWrap(args)
else:
self.gdiskCheck(args)

if isDeviceMapperNode(self.device):
# Create partitions using device mapper
Expand Down

0 comments on commit 0d91e2d

Please sign in to comment.