Re: [PATCH] Support --encrypted --useexisting on kickstart installs (#497147).

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

 



On Thu, 2009-04-23 at 13:28 -0400, Chris Lumens wrote:
> ---
>  kickstart.py |   58 +++++++++++++++++++++++++++++++++++++---------------------
>  1 files changed, 37 insertions(+), 21 deletions(-)

The hunks starting at 586 and 702 don't look like they should be there,
but the rest of it looks fine. It seems that we don't have a way to say
"create a filesystem on this preexisting encrypted device", since we
insist on pretending that there is only one device in the encryption
case instead of the actual two.

> 
> diff --git a/kickstart.py b/kickstart.py
> index dca282d..ba551dd 100644
> --- a/kickstart.py
> +++ b/kickstart.py
> @@ -391,8 +391,7 @@ class LogVol(commands.logvol.F9_LogVol):
>              if tmp:
>                  raise KickstartValueError, formatErrorMsg(self.lineno, msg="Logical volume name already used in volume group %s" % vg.name)
>  
> -        # Size specification checks
> -        if not lvd.preexist:
> +            # Size specification checks
>              if lvd.percent == 0:
>                  if lvd.size == 0:
>                      raise KickstartValueError, formatErrorMsg(self.lineno, msg="Size required")
> @@ -437,11 +436,18 @@ class LogVol(commands.logvol.F9_LogVol):
>              if lvd.passphrase and not storage.encryptionPassphrase:
>                  storage.encryptionPassphrase = lvd.passphrase
>  
> -            luksformat = request.format
> -            request.format = getFormat("luks", passphrase=lvd.passphrase, device=request.path)
> -            luksdev = LUKSDevice("luks%d" % storage.nextID,
> -                                 format=luksformat,
> -                                 parents=request)
> +            if lvd.preexist:
> +                luksformat = format
> +                device.format = getFormat("luks", passphrase=lvd.passphrase, device=device.path)
> +                luksdev = LUKSDevice("luks%d" % storage.nextID,
> +                                     format=luksformat,
> +                                     parents=device)
> +            else:
> +                luksformat = request.format
> +                request.format = getFormat("luks", passphrase=lvd.passphrase, device=request.path)
> +                luksdev = LUKSDevice("luks%d" % storage.nextID,
> +                                     format=luksformat,
> +                                     parents=request)
>              storage.createDevice(luksdev)
>  
>          self.handler.skipSteps.extend(["partition", "zfcpconfig", "parttype"])
> @@ -586,8 +592,6 @@ class Partition(commands.partition.F9_Partition):
>              type = "EFI System Partition"
>              pd.fsopts = "defaults,uid=0,gid=0,umask=0077,shortname=winnt"
>              kwargs["weight"] = self.handler.anaconda.platform.weight(fstype="efi")
> -        elif pd.mountpoint == "/boot":
> -            type = self.handler.anaconda.platform.bootFSType
>          else:
>              if pd.fstype != "":
>                  type = pd.fstype
> @@ -663,11 +667,18 @@ class Partition(commands.partition.F9_Partition):
>              if pd.passphrase and not storage.encryptionPassphrase:
>                 storage.encryptionPassphrase = pd.passphrase
>  
> -            luksformat = request.format
> -            request.format = getFormat("luks", passphrase=pd.passphrase, device=request.path)
> -            luksdev = LUKSDevice("luks%d" % storage.nextID,
> -                                 format=luksformat,
> -                                 parents=request)
> +            if pd.preexist:
> +                luksformat = format
> +                device.format = getFormat("luks", passphrase=pd.passphrase, device=device.path)
> +                luksdev = LUKSDevice("luks%d" % storage.nextID,
> +                                     format=luksformat,
> +                                     parents=device)
> +            else:
> +                luksformat = request.format
> +                request.format = getFormat("luks", passphrase=pd.passphrase, device=request.path)
> +                luksdev = LUKSDevice("luks%d" % storage.nextID,
> +                                     format=luksformat,
> +                                     parents=request)
>              storage.createDevice(luksdev)
>  
>          self.handler.skipSteps.extend(["partition", "zfcpconfig", "parttype"])
> @@ -702,8 +713,6 @@ class Raid(commands.raid.F9_Raid):
>                  raise KickstartValueError, formatErrorMsg(self.lineno, msg="PV partition defined multiple times")
>  
>              rd.mountpoint = ""
> -        elif rd.mountpoint == "/boot" and self.handler.anaconda.platform.supportsMdRaidBoot:
> -            type = self.handler.anaconda.platform.bootFSType
>          else:
>              if rd.fstype != "":
>                  type = rd.fstype
> @@ -782,11 +791,18 @@ class Raid(commands.raid.F9_Raid):
>              if rd.passphrase and not storage.encryptionPassphrase:
>                 storage.encryptionPassphrase = rd.passphrase
>  
> -            luksformat = request.format
> -            request.format = getFormat("luks", passphrase=rd.passphrase, device=request.path)
> -            luksdev = LUKSDevice("luks%d" % storage.nextID,
> -                                 format=luksformat,
> -                                 parents=request)
> +            if rd.preexist:
> +                luksformat = format
> +                device.format = getFormat("luks", passphrase=rd.passphrase, device=device.path)
> +                luksdev = LUKSDevice("luks%d" % storage.nextID,
> +                                     format=luksformat,
> +                                     parents=device)
> +            else:
> +                luksformat = request.format
> +                request.format = getFormat("luks", passphrase=rd.passphrase, device=request.path)
> +                luksdev = LUKSDevice("luks%d" % storage.nextID,
> +                                     format=luksformat,
> +                                     parents=request)
>              storage.createDevice(luksdev)
>  
>          self.handler.skipSteps.extend(["partition", "zfcpconfig", "parttype"])

_______________________________________________
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