[PATCH 2/2] Add kickstart liveimg install command

Vratislav Podzimek vpodzime at redhat.com
Thu May 9 10:32:48 UTC 2013


On Thu, 2013-05-02 at 17:54 -0700, Brian C. Lane wrote:
> From: "Brian C. Lane" <bcl at redhat.com>
> 
> This implements a new kickstart install command:
> 
> liveimg --url=<url> [--proxy=<proxy>] [--checksum=<sha256>] [--noverifyssl]
> 
> This will skip source and software spoke, partition the drive and then
> download the image from the url location to the disk. http, https, ftp
> and file methods are supported. An optional proxy can be specified,
> including auth. If --checksum is passed the image checksum is confirmed
> before starting to copy the files to the target system and --noverifyssl
> skips checking the SSL cert when using https.
> 
> The disk images need to be able to be mounted by the installer image.
> eg. extX, squashfs. If the image contains a LiveOS directory with an
> image file ending in .img inside it (eg. like a live iso squashfs.img)
> it will mount the inner image as the source and copy the files from
> there.
> 
> eg. squashfs.img -> LiveOS/ext3fs.img -> root filesystem
> 
> Note that the system being installed *must* have the various utilities
> that Anaconda expect to be installed in a normal system. This list may
> change at any time, it is up to the image creator to confirm that they
> have everything Anaconda needs to complete the post-install setup.
> ---
>  anaconda.spec.in                     |   2 +-
>  pyanaconda/__init__.py               |   3 +
>  pyanaconda/constants.py              |   1 +
>  pyanaconda/packaging/livepayload.py  | 226 +++++++++++++++++++++++++++++++++--
>  pyanaconda/ui/gui/spokes/software.py |   2 +-
>  pyanaconda/ui/gui/spokes/source.py   |   2 +-
>  6 files changed, 224 insertions(+), 12 deletions(-)
> 
> diff --git a/anaconda.spec.in b/anaconda.spec.in
> index 84161d9..4a08d0e 100644
> --- a/anaconda.spec.in
> +++ b/anaconda.spec.in
> @@ -21,7 +21,7 @@ Source0: %{name}-%{version}.tar.bz2
>  %define gconfversion 2.28.1
>  %define intltoolver 0.31.2-3
>  %define libnlver 1.0
> -%define pykickstartver 1.99.28
> +%define pykickstartver 1.99.29
>  %define yumver 3.4.3-32
>  %define partedver 1.8.1
>  %define pypartedver 2.5-2
> diff --git a/pyanaconda/__init__.py b/pyanaconda/__init__.py
> index 7804d16..02e7d1c 100644
> --- a/pyanaconda/__init__.py
> +++ b/pyanaconda/__init__.py
> @@ -129,6 +129,9 @@ class Anaconda(object):
>                  if flags.livecdInstall:
>                      from pyanaconda.packaging.livepayload import LiveImagePayload
>                      klass = LiveImagePayload
> +                elif self.ksdata.method.method == "liveimg":
> +                    from pyanaconda.packaging.livepayload import LiveImageKSPayload
> +                    klass = LiveImageKSPayload
>                  else:
>                      from pyanaconda.packaging.yumpayload import YumPayload
>                      klass = YumPayload
> diff --git a/pyanaconda/constants.py b/pyanaconda/constants.py
> index 7adb9b6..b4922d6 100644
> --- a/pyanaconda/constants.py
> +++ b/pyanaconda/constants.py
> @@ -83,6 +83,7 @@ MOUNT_DIR = "/mnt/install"
>  DRACUT_REPODIR = "/run/install/repo"
>  DRACUT_ISODIR = "/run/install/source"
>  ISO_DIR = MOUNT_DIR + "/isodir"
> +IMAGE_DIR = MOUNT_DIR + "/image"
>  INSTALL_TREE = MOUNT_DIR + "/source"
>  BASE_REPO_NAME = "anaconda"
>  
> diff --git a/pyanaconda/packaging/livepayload.py b/pyanaconda/packaging/livepayload.py
> index 1fdfff2..f0e352f 100644
> --- a/pyanaconda/packaging/livepayload.py
> +++ b/pyanaconda/packaging/livepayload.py
> @@ -33,18 +33,24 @@ import os
>  import stat
>  from time import sleep
>  from threading import Lock
> +from urlgrabber.grabber import URLGrabber
> +from urlgrabber.grabber import URLGrabError
> +from pyanaconda.iutil import ProxyString, ProxyStringError
> +import urllib
> +import hashlib
> +import glob
>  
> -from . import *
> +from . import ImagePayload, PayloadSetupError, PayloadInstallError
I'd rather see "from pyanaconda.packaging import ..." here. We really
don't use the relative imports often and AFAICT they don't work with our
updates.img.

Otherwise this looks good to me.

-- 
Vratislav Podzimek

Anaconda Rider | Red Hat, Inc. | Brno - Czech Republic



More information about the anaconda-patches mailing list