tinclude qemu-wrapper.c - libdevuansdk - common library for devuan's simple distro kits HTML git clone https://git.parazyd.org/libdevuansdk DIR Log DIR Files DIR Refs DIR Submodules DIR README DIR LICENSE --- DIR commit 76560688fd00a1c29c2707e79d7e3ca4ad4bbe16 DIR parent 5d2b73fe623926ba11a85bf191edabfcc0eb3274 HTML Author: parazyd <parazyd@dyne.org> Date: Wed, 15 Jun 2016 17:58:56 +0200 include qemu-wrapper.c Diffstat: A src/qemu-wrapper.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+), 0 deletions(-) --- DIR diff --git a/src/qemu-wrapper.c b/src/qemu-wrapper.c t@@ -0,0 +1,20 @@ +/* qemu wrapper + * wrapper for executing qemu in build chroots + * pass arguments to qemu binary + * + * ~ parazyd */ + +#include <string.h> +#include <unistd.h> + +int main(int argc, char **argv, char **envp) { + char *newargv[argc + 3]; + + newargv[0] = argv[0]; + newargv[1] = "-cpu"; + newargv[2] = "cortex-a8"; /* here you can set the cpu you are building for */ + + memcpy(&newargv[3], &argv[1], sizeof(*argv) * (argc -1)); + newargv[argc + 2] = NULL; + return execve("/usr/bin/qemu-arm", newargv, envp); +}