[oe-commits] [openembedded-core] 03/28: kernel-module-split.bbclass: Fix modinfo decoding in old kernels

git at git.openembedded.org git at git.openembedded.org
Thu Jan 3 12:39:59 UTC 2019


This is an automated email from the git hooks/post-receive script.

rpurdie pushed a commit to branch master
in repository openembedded-core.

commit 503b977acf6984120818cbc5cfd35ff2cffb39cd
Author: Pau Espin Pedrol <pespin at sysmocom.de>
AuthorDate: Mon Dec 31 01:04:50 2018 +0100

    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
    
    Signed-off-by: Pau Espin Pedrol <pespin at sysmocom.de>
    Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
 meta/classes/kernel-module-split.bbclass | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/meta/classes/kernel-module-split.bbclass b/meta/classes/kernel-module-split.bbclass
index 67ab416..e8996cf 100644
--- a/meta/classes/kernel-module-split.bbclass
+++ b/meta/classes/kernel-module-split.bbclass
@@ -48,7 +48,8 @@ python split_kernel_module_packages () {
         tmpfile = tf[1]
         cmd = "%sobjcopy -j .modinfo -O binary %s %s" % (d.getVar("HOST_PREFIX") or "", file, tmpfile)
         subprocess.check_call(cmd, shell=True)
-        f = open(tmpfile)
+        # errors='replace': Some old kernel versions contain invalid utf-8 characters in mod descriptions (like 0xf6, 'ö')
+        f = open(tmpfile, errors='replace')
         l = f.read().split("\000")
         f.close()
         os.close(tf[0])

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list