Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
find valid mounted boot stage1 parts on any disk (#1168118)
This is another refinement to the patch I and Anne worked on around F21 final which aims to fix RHBZ #1168118. When the target platform requires the bootloader stage1 device to be a partition with a specific mount point, this patch causes the boot disk selection logic to prefer a disk with a correct partition on it as the 'boot disk' if there is one. If the platform also requires the partition to have a particular filesystem it also checks that. If no matching partition can be found the first disk in the list of available disks will be chosen, as before. This version of the patch does not apply the logic to platforms which require the stage1 device to be a partition but do not require it to be mounted, because that behaviour is more questionable. For instance, in the case where the user does an install to two disks, the second containing a partition of the appropriate type, and chooses guided partitioning, we would currently create a new stage1 partition on the first disk. If we applied this logic to such a platform, we would instead re-use the stage1 partition from the second disk. That's a somewhat more arguable behaviour change, so for the sake of conservatism this patch does not do it. The case where a mount point is involved is more clear-cut, because specifying a mount point *must* be done explicitly by the user, and if they explicitly specify a partition's mount point as the stage1 bootloader target mount point (and give it the correct filesystem), it seems inarguably correct to infer that they wish to use that partition as the stage1 target device. Requiring them to *also* explicitly select the disk on which it resides as the 'boot disk' and failing otherwise just seems obtuse. Revised by: mulhern <amulhern@redhat.com>
- Loading branch information
I kept this in from Anne's version, but I'm not sure why we couldn't just simplify it to:
or even simply drop the whole conditional and just do:
in all cases, because it'll just wind up picking
disks[0]
any times1disks
isNone
and the time it takes is surely negligible.