Re: [PATCH 1/1] Make sure we turn on swap flag. (#503457)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> diff --git a/storage/devices.py b/storage/devices.py
> index b5e32af..2a9578d 100644
> --- a/storage/devices.py
> +++ b/storage/devices.py
> @@ -1130,6 +1130,15 @@ class PartitionDevice(StorageDevice):
>          log_method_call(self, self.name)
>          StorageDevice._setFormat(self, format)
>  
> +        if format.type == "swap":
> +            if self.flagAvailable(parted.PARTITION_SWAP):
> +                self.setFlag(parted.PARTITION_SWAP)
> +            else:
> +                # Swap will still work if we fail.
> +                log.error("Failed to activate swap flag on %s" % self.name)
> +        else:
> +            self.unsetFlag(parted.PARTITION_SWAP)
> +
>      def _setBootable(self, bootable):
>          """ Set the bootable flag for this partition. """
>          if self.partedPartition:

Looks good to me, though we may not want to log an error.  Non-i386
platforms may not even support the concept of partition flags so this
could be a distracting error message on those.

- Chris

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list

[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux