-
Notifications
You must be signed in to change notification settings - Fork 141
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update Grub on component devices if /boot is on md device
Previously, if /boot was on md device such as RAID consisting of multiple partitions on different drives, the part of Grub residing in the 512 Mb after MBR was only updated for one of the drives. This resulted in broken Grub. Now, Grub is updated on all the component devices of an md array if Grub was already installed on them before the upgrade.
- Loading branch information
1 parent
948c782
commit c21a763
Showing
7 changed files
with
79 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
from leapp.exceptions import StopActorExecution | ||
from leapp.libraries.stdlib import api, CalledProcessError, run | ||
|
||
def is_mdraid_dev(dev): | ||
try: | ||
result = run(['mdadm', '--query', dev]) | ||
except CalledProcessError: | ||
api.current_logger().warning( | ||
'Could not check if device is an md device' | ||
) | ||
raise StopActorExecution() | ||
return '--detail' in result['stdout'] | ||
|
||
|
||
def get_component_devices(raid_dev): | ||
try: | ||
result = run(['mdadm', '--detail', '--verbose', '--brief', raid_dev]) | ||
except CalledProcessError as err: | ||
api.current_logger().warning( | ||
'Could not get md array component devices: {}'.format(err) | ||
) | ||
raise StopActorExecution() | ||
# example output: | ||
# ARRAY /dev/md0 level=raid1 num-devices=2 metadata=1.2 name=localhost.localdomain:0 UUID=c4acea6e:d56e1598:91822e3f:fb26832c | ||
# devices=/dev/vda1,/dev/vdb1 | ||
return result['stdout'].rsplit('=', 2)[-1].strip().split(',') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters