diff options
| author | Zoltán Böszörményi <zboszor@gmail.com> | 2021-08-23 16:54:47 +0200 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2021-08-27 11:54:33 +0100 |
| commit | 2190abe8bbd633b72d8605c7808df634dd33274c (patch) | |
| tree | 2cedd6b7bb531fa1578ddb5c1dadbb6cd9f1c19c /meta/classes/kernel-module-split.bbclass | |
| parent | 95f0ce92b6fda26543fb0002321f1363bef9758e (diff) | |
| download | poky-2190abe8bbd633b72d8605c7808df634dd33274c.tar.gz | |
kernel-module-split.bbclass: Support zstd-compressed modules
(From OE-Core rev: 796d4661a6121dba878c29d2388258c795be3aeb)
Signed-off-by: Zoltán Böszörményi <zboszor@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/kernel-module-split.bbclass')
| -rw-r--r-- | meta/classes/kernel-module-split.bbclass | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/meta/classes/kernel-module-split.bbclass b/meta/classes/kernel-module-split.bbclass index b56dd4a9c7..6c1de4c992 100644 --- a/meta/classes/kernel-module-split.bbclass +++ b/meta/classes/kernel-module-split.bbclass | |||
| @@ -44,17 +44,20 @@ python split_kernel_module_packages () { | |||
| 44 | def extract_modinfo(file): | 44 | def extract_modinfo(file): |
| 45 | import tempfile, subprocess | 45 | import tempfile, subprocess |
| 46 | tempfile.tempdir = d.getVar("WORKDIR") | 46 | tempfile.tempdir = d.getVar("WORKDIR") |
| 47 | compressed = re.match( r'.*\.([xg])z$', file) | 47 | compressed = re.match( r'.*\.(gz|xz|zst)$', file) |
| 48 | tf = tempfile.mkstemp() | 48 | tf = tempfile.mkstemp() |
| 49 | tmpfile = tf[1] | 49 | tmpfile = tf[1] |
| 50 | if compressed: | 50 | if compressed: |
| 51 | tmpkofile = tmpfile + ".ko" | 51 | tmpkofile = tmpfile + ".ko" |
| 52 | if compressed.group(1) == 'g': | 52 | if compressed.group(1) == 'gz': |
| 53 | cmd = "gunzip -dc %s > %s" % (file, tmpkofile) | 53 | cmd = "gunzip -dc %s > %s" % (file, tmpkofile) |
| 54 | subprocess.check_call(cmd, shell=True) | 54 | subprocess.check_call(cmd, shell=True) |
| 55 | elif compressed.group(1) == 'x': | 55 | elif compressed.group(1) == 'xz': |
| 56 | cmd = "xz -dc %s > %s" % (file, tmpkofile) | 56 | cmd = "xz -dc %s > %s" % (file, tmpkofile) |
| 57 | subprocess.check_call(cmd, shell=True) | 57 | subprocess.check_call(cmd, shell=True) |
| 58 | elif compressed.group(1) == 'zst': | ||
| 59 | cmd = "zstd -dc %s > %s" % (file, tmpkofile) | ||
| 60 | subprocess.check_call(cmd, shell=True) | ||
| 58 | else: | 61 | else: |
| 59 | msg = "Cannot decompress '%s'" % file | 62 | msg = "Cannot decompress '%s'" % file |
| 60 | raise msg | 63 | raise msg |
| @@ -153,7 +156,7 @@ python split_kernel_module_packages () { | |||
| 153 | kernel_package_name = d.getVar("KERNEL_PACKAGE_NAME") or "kernel" | 156 | kernel_package_name = d.getVar("KERNEL_PACKAGE_NAME") or "kernel" |
| 154 | kernel_version = d.getVar("KERNEL_VERSION") | 157 | kernel_version = d.getVar("KERNEL_VERSION") |
| 155 | 158 | ||
| 156 | module_regex = r'^(.*)\.k?o(?:\.[xg]z)?$' | 159 | module_regex = r'^(.*)\.k?o(?:\.(gz|xz|zst))?$' |
| 157 | 160 | ||
| 158 | module_pattern_prefix = d.getVar('KERNEL_MODULE_PACKAGE_PREFIX') | 161 | module_pattern_prefix = d.getVar('KERNEL_MODULE_PACKAGE_PREFIX') |
| 159 | module_pattern_suffix = d.getVar('KERNEL_MODULE_PACKAGE_SUFFIX') | 162 | module_pattern_suffix = d.getVar('KERNEL_MODULE_PACKAGE_SUFFIX') |
