From: "Brian C. Lane" <bcl(a)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)
--
1.8.3.1