diff options
author | Pau Espin Pedrol <pespin@sysmocom.de> | 2018-12-31 01:04:50 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2019-01-03 12:35:53 +0000 |
commit | 48c0ed2aec236939d369ca3f0093dc43db1e1dd6 (patch) | |
tree | 53a70e14e43b9336cf36947bd0d06a3cd358e289 /meta/classes | |
parent | f07354a74497ec9d17107c9c54f1afd5bb1049f0 (diff) | |
download | poky-48c0ed2aec236939d369ca3f0093dc43db1e1dd6.tar.gz |
kernel-module-split.bbclass: Fix modinfo decoding in old kernels
Before linux commit d36b691077dc59c74efec0d54ed21b86f7a2a21a, some
strings contained invalid utf-8 character which made
split_kernel_module_packages unhappy when parsing ums-isd200.ko:
Exception: UnicodeDecodeError: 'utf-8' codec can't decode byte 0xf6 in position 21: invalid start byte
(From OE-Core rev: 503b977acf6984120818cbc5cfd35ff2cffb39cd)
Signed-off-by: Pau Espin Pedrol <pespin@sysmocom.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes')
-rw-r--r-- | meta/classes/kernel-module-split.bbclass | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/meta/classes/kernel-module-split.bbclass b/meta/classes/kernel-module-split.bbclass index 67ab4161da..e8996cf59b 100644 --- a/meta/classes/kernel-module-split.bbclass +++ b/meta/classes/kernel-module-split.bbclass | |||
@@ -48,7 +48,8 @@ python split_kernel_module_packages () { | |||
48 | tmpfile = tf[1] | 48 | tmpfile = tf[1] |
49 | cmd = "%sobjcopy -j .modinfo -O binary %s %s" % (d.getVar("HOST_PREFIX") or "", file, tmpfile) | 49 | cmd = "%sobjcopy -j .modinfo -O binary %s %s" % (d.getVar("HOST_PREFIX") or "", file, tmpfile) |
50 | subprocess.check_call(cmd, shell=True) | 50 | subprocess.check_call(cmd, shell=True) |
51 | f = open(tmpfile) | 51 | # errors='replace': Some old kernel versions contain invalid utf-8 characters in mod descriptions (like 0xf6, 'รถ') |
52 | f = open(tmpfile, errors='replace') | ||
52 | l = f.read().split("\000") | 53 | l = f.read().split("\000") |
53 | f.close() | 54 | f.close() |
54 | os.close(tf[0]) | 55 | os.close(tf[0]) |