Browse Source

Добавлена поддержка lz4 сжатия для initramfs

develop^2
Mike Hiretsky 6 years ago
parent
commit
90902838cd
1 changed files with 9 additions and 1 deletions
  1. +9
    -1
      pym/cl_utils.py

+ 9
- 1
pym/cl_utils.py View File

@@ -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)


Loading…
Cancel
Save