[PATCH 2/2] Hook formatByDefault back up to the storage spoke.

David Shea dshea at redhat.com
Thu Jan 22 15:18:48 UTC 2015


On 01/21/2015 05:58 PM, David Shea wrote:
> Disallow the reuse of /boot and /var and some other things.
> ---
>   pyanaconda/ui/gui/spokes/custom.py | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/pyanaconda/ui/gui/spokes/custom.py b/pyanaconda/ui/gui/spokes/custom.py
> index 2866011..fc1e7ad 100644
> --- a/pyanaconda/ui/gui/spokes/custom.py
> +++ b/pyanaconda/ui/gui/spokes/custom.py
> @@ -654,8 +654,8 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker):
>               error = _("%s cannot be encrypted") % mountpoint
>           elif encrypted and new_fs_type in PARTITION_ONLY_FORMAT_TYPES:
>               error = _("%s cannot be encrypted") % new_fs_type
> -        elif mountpoint == "/" and device.format.exists and not reformat:
> -            error = _("You must create a new file system on the root device.")
> +        elif not reformat and not self.storage.formatByDefault(device):
> +            error = _("You must create a new file system on the %s device.") % mountpoint
>   
>           if not error and \
>              (raid_level is not None or requiresRaidSelection(device_type)) and \

Just in case this doesn't pan out for whatever reason, the other idea 
discussed on IRC was to query the rpm database for what kernels were 
installed by a package payload, so that would be to implement 
PackagePayload.kernelVersionList as something like

ts = rpm.TransactionSet(iutil.getSysroot())
mi = ts.dbMatch('providename', 'kernel')
for hdr in mi:
    (do something with hdr.filenames)




More information about the anaconda-patches mailing list