[rhel7-branch 7/29] Add support for tarfiles to liveimg kickstart command (#1080396)

bcl installerbot-noreply at redhat.com
Wed Jun 3 00:36:39 UTC 2015


From: "Brian C. Lane" <bcl at redhat.com>

With these changes you can now pass the url of a tarfile to liveimg and
it will install it to the target system. The same rules apply, the
correct utilities need to be included in the tar for the configuration
to work correctly.

The following extensions are recognized as tarfiles:

.tar .tbz .tgz .txz .tar.bz2 .tar.gz .tar.xz

Resolves: rhbz#1080396
(cherry picked from commit ccb9c7729234d681b85dca584a79170951ff0549)

Related: rhbz#1196721
---
 pyanaconda/constants.py             | 3 +++
 pyanaconda/packaging/livepayload.py | 3 +++
 2 files changed, 6 insertions(+)

diff --git a/pyanaconda/constants.py b/pyanaconda/constants.py
index ae2dcb4..c35df65 100644
--- a/pyanaconda/constants.py
+++ b/pyanaconda/constants.py
@@ -171,3 +171,6 @@
 IPMI_FINISHED = 0x8         # installation finished successfully
 IPMI_ABORTED  = 0x9         # installation finished unsuccessfully, due to some non-exn error
 IPMI_FAILED   = 0xA         # installation hit an exception
+
+# Recognizing a tarfile
+TAR_SUFFIX = (".tar", ".tbz", ".tgz", ".txz", ".tar.bz2", "tar.gz", "tar.xz")
diff --git a/pyanaconda/packaging/livepayload.py b/pyanaconda/packaging/livepayload.py
index f8051ff..63055e6 100644
--- a/pyanaconda/packaging/livepayload.py
+++ b/pyanaconda/packaging/livepayload.py
@@ -92,6 +92,9 @@ def unsetup(self):
         except OSError:
             pass
 
+        source = iutil.eintr_retry_call(os.statvfs, INSTALL_TREE)
+        self.source_size = source.f_frsize * (source.f_blocks - source.f_bfree)
+
     def preInstall(self, packages=None, groups=None):
         """ Perform pre-installation tasks. """
         super(LiveImagePayload, self).preInstall(packages=packages, groups=groups)


-- 
To view this commit on github, visit https://github.com/rhinstaller/anaconda/commit/4e5dfea4bb6fb6b68378f4b9d07e6fe1c38ee92d


More information about the anaconda-patches mailing list