From 1e21a2350bff784e1cc58dad1caaf340524d6512 Mon Sep 17 00:00:00 2001 From: Steven Noble Date: Tue, 2 Feb 2016 14:56:22 -0800 Subject: [PATCH 1/2] Updates to docker_shell to setup binfmt --- docker/tools/docker_shell | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/docker/tools/docker_shell b/docker/tools/docker_shell index 9c49883e..7ad78047 100755 --- a/docker/tools/docker_shell +++ b/docker/tools/docker_shell @@ -154,6 +154,17 @@ for u in ops.addusers: if ops.start_cacher: execute("/etc/init.d/apt-cacher-ng start", "The apt-cacher-ng service could not be started.") +logger.debug("checking if qemu-ppc exists") + +if os.path.isfile("/proc/sys/fs/binfmt_misc/qemu-ppc"): + logger.debug("qemu-ppc already exists") +else: + if os.path.ismount("/proc/sys/fs/binfmt_misc"): + execute("sudo /etc/init.d/binfmt-support start", "The binfmt-support service could not be started.") + else: + execute("sudo mount binfmt_misc -t binfmt_misc /proc/sys/fs/binfmt_misc", "The binfmt_misc system could not be mounted.") + execute("sudo /etc/init.d/binfmt-support start", "The binfmt-support service could not be started.") + # Fixme: change this to os.execvp() c = "/usr/bin/sudo -E -u %s %s" % (g_user.name, " ".join(ops.command)) sys.exit(execute(c)) From a9371065859c1a44addfb1c8363940bba6d84f32 Mon Sep 17 00:00:00 2001 From: Steven Noble Date: Tue, 2 Feb 2016 23:23:36 +0000 Subject: [PATCH 2/2] updated per capveg suggestions --- docker/tools/docker_shell | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/docker/tools/docker_shell b/docker/tools/docker_shell index 7ad78047..6376b7b1 100755 --- a/docker/tools/docker_shell +++ b/docker/tools/docker_shell @@ -159,11 +159,9 @@ logger.debug("checking if qemu-ppc exists") if os.path.isfile("/proc/sys/fs/binfmt_misc/qemu-ppc"): logger.debug("qemu-ppc already exists") else: - if os.path.ismount("/proc/sys/fs/binfmt_misc"): - execute("sudo /etc/init.d/binfmt-support start", "The binfmt-support service could not be started.") - else: - execute("sudo mount binfmt_misc -t binfmt_misc /proc/sys/fs/binfmt_misc", "The binfmt_misc system could not be mounted.") - execute("sudo /etc/init.d/binfmt-support start", "The binfmt-support service could not be started.") + if not os.path.ismount("/proc/sys/fs/binfmt_misc"): + execute("sudo mount binfmt_misc -t binfmt_misc /proc/sys/fs/binfmt_misc", "The binfmt_misc system could not be mounted.") + execute("sudo /etc/init.d/binfmt-support start", "The binfmt-support service could not be started.") # Fixme: change this to os.execvp() c = "/usr/bin/sudo -E -u %s %s" % (g_user.name, " ".join(ops.command))