[master] Correctly generate rescue initrd (#1013087)

David Shea dshea at redhat.com
Fri Oct 11 20:48:31 UTC 2013


On 10/11/2013 02:47 PM, Brian C. Lane wrote:
> From: "Brian C. Lane" <bcl at redhat.com>
>
> This solves a couple issues:
>   * we should not be copying the machine-id from the live image
>   * The live image shouldn't have rescue images, skip copying them
>   * call rpmposttrans to generate the rescue image. This has to be done
>     before the bootloader config is written.
> ---
>   pyanaconda/packaging/livepayload.py | 10 +++++++++-
>   1 file changed, 9 insertions(+), 1 deletion(-)
>
> diff --git a/pyanaconda/packaging/livepayload.py b/pyanaconda/packaging/livepayload.py
> index 6964c95..add80ab 100644
> --- a/pyanaconda/packaging/livepayload.py
> +++ b/pyanaconda/packaging/livepayload.py
> @@ -119,7 +119,8 @@ class LiveImagePayload(ImagePayload):
>           # go recursively, include devices and special files, don't cross
>           # file system boundaries
>           args = ["-pogAXtlHrDx", "--exclude", "/dev/", "--exclude", "/proc/",
> -                "--exclude", "/sys/", "--exclude", "/run/", INSTALL_TREE+"/", ROOT_PATH]
> +                "--exclude", "/sys/", "--exclude", "/run/", "--exclude", "/boot/*rescue*",
> +                "--exclude", "/etc/machine-id", INSTALL_TREE+"/", ROOT_PATH]
>           try:
>               rc = iutil.execWithRedirect(cmd, args)
>           except (OSError, RuntimeError) as e:
> @@ -148,6 +149,13 @@ class LiveImagePayload(ImagePayload):
>   
>           super(LiveImagePayload, self).postInstall()
>   
> +        # Live needs to create the rescue image before bootloader is written
> +        for kernel in self.kernelVersionList:
> +            log.info("Generating rescue image for %s", kernel)
> +            iutil.execWithRedirect("new-kernel-pkg",
> +                                   ["--rpmposttrans", kernel],
> +                                   root=ROOT_PATH)
> +
>       @property
>       def spaceRequired(self):
>           return Size(bytes=iutil.getDirSize("/")*1024)
Ack.


More information about the anaconda-patches mailing list