[CRIU] [PATCH 04/10] scripts/build/binfmt_misc: fix for ppc64le

Kir Kolyshkin kolyshkin at gmail.com
Mon Oct 2 03:33:59 MSK 2017


Got this error trying to build criu on ppc64le under qemu, after
updating the Dockerfile to use Ubuntu Xenial (rather than Trusty):

> $ rm -rf .ccache; make -C scripts/build ppc64le-clang
>
> ...
>
> Processing triggers for libc-bin (2.24-9ubuntu2.2) ...
> /sbin/ldconfig.real: 1: /sbin/ldconfig.real: Syntax error: "(" unexpected
> /sbin/ldconfig.real: 1: /sbin/ldconfig.real: Syntax error: "(" unexpected
> dpkg: error processing package libc-bin (--configure):
>  subprocess installed post-installation script returned error exit status 2
> ...

Apparently, ldconfig.real binary header differs from others:

root at 3c7593d3298d:/# od -x /bin/ls | head -2
0000000 457f 464c 0102 0001 0000 0000 0000 0000
0000020 0002 0015 0001 0000 5680 1000 0000 0000

root at 3c7593d3298d:/# od -x /sbin/ldconfig.real | head -2
0000000 457f 464c 0102 0301 0000 0000 0000 0000
0000020 0002 0015 0001 0000 1d58 1000 0000 0000

Amend the mask in binfmt_misc entry to take this into account.

Signed-off-by: Kir Kolyshkin <kolyshkin at gmail.com>
---
 scripts/build/binfmt_misc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/build/binfmt_misc b/scripts/build/binfmt_misc
index 3e76b660..bf2a2eca 100755
--- a/scripts/build/binfmt_misc
+++ b/scripts/build/binfmt_misc
@@ -7,7 +7,7 @@ test -f /proc/sys/fs/binfmt_misc/aarch64 ||
 	echo ':aarch64:M::\x7fELF\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\xb7:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/bin/qemu-aarch64-static:' > /proc/sys/fs/binfmt_misc/register
 
 test -f /proc/sys/fs/binfmt_misc/ppc64le ||
-	echo ':ppc64le:M::\x7fELF\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x15\x00:\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\x00:/usr/bin/qemu-ppc64le-static:' > /proc/sys/fs/binfmt_misc/register
+	echo ':ppc64le:M::\x7fELF\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x15\x00:\xff\xff\xff\xff\xff\xff\xff\xfc\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\x00:/usr/bin/qemu-ppc64le-static:' > /proc/sys/fs/binfmt_misc/register
 
 test -f /proc/sys/fs/binfmt_misc/s390x ||
 	echo ':s390x:M::\x7fELF\x02\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x16:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/bin/qemu-s390x-static:' > /proc/sys/fs/binfmt_misc/register
-- 
2.14.1



More information about the CRIU mailing list