Re: [PATCH] Don't do format-specific processing on devices targeted by clearpart. (#492123)

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

 



> diff --git a/cmdline.py b/cmdline.py
> index f87550c..9b161ab 100644
> --- a/cmdline.py
> +++ b/cmdline.py
> @@ -104,6 +104,20 @@ class InstallInterface:
>              while 1:
>                  time.sleep(5)
>  
> +    def passphraseEntryWindow(self, device):
> +        print(_("Can't have a question in command line mode!"))
> +        print("(passphraseEntryWindow: '%s')" % device.path)
> +        # don't exit
> +        while 1:
> +            time.sleep(5)
> +
> +    def getLUKSPassphrase(self, passphrase = "", isglobal = False):
> +        print(_("Can't have a question in command line mode!"))
> +        print("(getLUKSPassphrase)")
> +        # don't exit
> +        while 1:
> +            time.sleep(5)
> +
>      def exceptionWindow(self, shortText, longTextFile):
>          print(shortText)

This part's good.

> diff --git a/storage/devicetree.py b/storage/devicetree.py
> index 458e5a8..fd5a1cc 100644
> --- a/storage/devicetree.py
> +++ b/storage/devicetree.py
> @@ -24,6 +24,8 @@ import os
>  import block
>  import re
>  
> +from pykickstart.constants import *
> +
>  from errors import *
>  from devices import *
>  from deviceaction import *
> @@ -188,13 +190,14 @@ class DeviceTree(object):
>  
>      def __init__(self, intf=None, ignored=[], exclusive=[], clear=[],
>                   zeroMbr=None, reinitializeDisks=None, protected=[],
> -                 passphrase=None, luksDict=None):
> +                 clearpart=None, passphrase=None, luksDict=None):
>          # internal data members
>          self._devices = []
>          self._actions = []
>  
>          self.intf = intf
>          self.exclusiveDisks = exclusive
> +        self.clearPartType = clearpart
>          self.clearPartDisks = clear
>          self.zeroMbr = zeroMbr
>          self.reinitializeDisks = reinitializeDisks
> @@ -1156,6 +1159,18 @@ class DeviceTree(object):
>              format = formats.getFormat(*args, **kwargs)
>              device.format = format
>  
> +        if self.clearPartType in (CLEARPART_TYPE_LINUX, CLEARPART_TYPE_ALL):
> +            if not self.clearPartDisks:
> +                # we're clearing all disks
> +                return
> +
> +            for disk in self.clearPartDisks:
> +                # if this device is going to be cleared we don't need to
> +                # continue messing with it
> +                dev = self.getDeviceByName(disk)
> +                if dev and dev == device or device.dependsOn(dev):
> +                    return
> +
>          #
>          # now lookup or create any compound devices we have discovered
>          #        

But I don't think this will work because we run storage.storageInitialize()
before any kickstart processing even happens.  The reason for this is in
case you do "part / --ondisk=sda", we can check that there's even an
sda.  The unfortunate side effect is that now we'll prompt for
passphrases even on disks that are going to be wiped, because we don't
yet have that information.

I need to work on how we handle processing the kickstart file before we
do the real processing.  But, that's too invasive for the beta.  We are
just going to have to live with this current behavior.

- 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