diff --git a/pym/cl_utils.py b/pym/cl_utils.py index da5ef2e..2e1a607 100644 --- a/pym/cl_utils.py +++ b/pym/cl_utils.py @@ -1499,7 +1499,15 @@ class InitrdFile(object): if not path.exists(self._file): # raise IOError open(self._file) - gz = Popen(['/bin/gzip', "-dc", self._file], stdout=PIPE, stderr=PIPE, + ftype = typeFile(magic=0x4).getMType + rdtype = ftype(self._file) + if "LZ4" in rdtype: + arch_cmd = '/usr/bin/lz4' + elif "XZ" in rdtype: + arch_cmd = '/usr/bin/xz' + else: + arch_cmd = '/bin/gzip' + gz = Popen([arch_cmd, "-dc", self._file], stdout=PIPE, stderr=PIPE, close_fds=True) cpio = Popen(["/bin/cpio","-tf"], stdout=PIPE, stdin=gz.stdout, stderr=PIPE, close_fds=True)