From 3ff48453e894990ea6495574037e70ed9b91947e Mon Sep 17 00:00:00 2001 From: Laurent Vivier Date: Thu, 8 Mar 2018 11:48:59 +0100 Subject: linux-user: allows to use "--systemd ALL" with qemu-binfmt-conf.sh qemu-binfmt-conf.sh when it is used with systemd needs to know for which CPU the systemd-binfmt.service file must be created (i.e. "--systemd ppc"). But sometime, for instance for test purpose, we need to create an entry for all known architectures. This patch entroduce the "ALL" parameter for this purpose. Signed-off-by: Laurent Vivier Message-Id: <20180308104859.3315-1-laurent@vivier.eu> --- scripts/qemu-binfmt-conf.sh | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) (limited to 'scripts') diff --git a/scripts/qemu-binfmt-conf.sh b/scripts/qemu-binfmt-conf.sh index bdb21bdd58..edaa98b070 100755 --- a/scripts/qemu-binfmt-conf.sh +++ b/scripts/qemu-binfmt-conf.sh @@ -154,7 +154,8 @@ Usage: qemu-binfmt-conf.sh [--qemu-path PATH][--debian][--systemd CPU] instead generate update-binfmts templates --systemd: don't write into /proc, instead generate file for systemd-binfmt.service - for the given CPU + for the given CPU. If CPU is "ALL", generate a + file for all known cpus --exportdir: define where to write configuration files (default: $SYSTEMDDIR or $DEBIANDIR) --credential: if yes, credential and security tokens are @@ -301,18 +302,20 @@ while true ; do EXPORTDIR=${EXPORTDIR:-$SYSTEMDDIR} shift # check given cpu is in the supported CPU list - for cpu in ${qemu_target_list} ; do + if [ "$1" != "ALL" ] ; then + for cpu in ${qemu_target_list} ; do + if [ "$cpu" = "$1" ] ; then + break + fi + done + if [ "$cpu" = "$1" ] ; then - break + qemu_target_list="$1" + else + echo "ERROR: unknown CPU \"$1\"" 1>&2 + usage + exit 1 fi - done - - if [ "$cpu" = "$1" ] ; then - qemu_target_list="$1" - else - echo "ERROR: unknown CPU \"$1\"" 1>&2 - usage - exit 1 fi ;; -Q|--qemu-path) -- cgit v1.2.3 From d4090306c8079ca3df426f82c493314c3537064e Mon Sep 17 00:00:00 2001 From: Max Filippov Date: Wed, 28 Feb 2018 14:16:08 -0800 Subject: qemu-binfmt-conf.sh: add qemu-xtensa Register qemu-xtensa and qemu-xtensaeb for transparent linux userspace emulation. Cc: Riku Voipio Cc: Laurent Vivier Signed-off-by: Max Filippov Reviewed-by: Laurent Vivier Message-Id: <20180228221609.11265-11-jcmvbkbc@gmail.com> Signed-off-by: Laurent Vivier --- scripts/qemu-binfmt-conf.sh | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/qemu-binfmt-conf.sh b/scripts/qemu-binfmt-conf.sh index edaa98b070..f39ad344fc 100755 --- a/scripts/qemu-binfmt-conf.sh +++ b/scripts/qemu-binfmt-conf.sh @@ -1,10 +1,10 @@ #!/bin/sh -# enable automatic i386/ARM/M68K/MIPS/SPARC/PPC/s390/HPPA +# enable automatic i386/ARM/M68K/MIPS/SPARC/PPC/s390/HPPA/Xtensa # program execution by the kernel qemu_target_list="i386 i486 alpha arm armeb sparc32plus ppc ppc64 ppc64le m68k \ mips mipsel mipsn32 mipsn32el mips64 mips64el \ -sh4 sh4eb s390x aarch64 aarch64_be hppa riscv32 riscv64" +sh4 sh4eb s390x aarch64 aarch64_be hppa riscv32 riscv64 xtensa xtensaeb" i386_magic='\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x03\x00' i386_mask='\xff\xff\xff\xff\xff\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff' @@ -108,6 +108,14 @@ riscv64_magic='\x7fELF\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x riscv64_mask='\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff' riscv64_family=riscv +xtensa_magic='\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x5e\x00' +xtensa_mask='\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff' +xtensa_family=xtensa + +xtensaeb_magic='\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x5e' +xtensaeb_mask='\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff' +xtensaeb_family=xtensaeb + qemu_get_family() { cpu=${HOST_ARCH:-$(uname -m)} case "$cpu" in -- cgit v1.2.3