qemu_0.13.0.bb: Add new recipe for 0.13
authorKhem Raj <raj.khem@gmail.com>
Tue, 23 Nov 2010 23:29:59 +0000 (15:29 -0800)
committerKhem Raj <raj.khem@gmail.com>
Tue, 23 Nov 2010 23:29:59 +0000 (15:29 -0800)
Signed-off-by: Khem Raj <raj.khem@gmail.com>
recipes/qemu/qemu-0.13.0/03_fix_syscalls_on_arches_that_do_not_use_UID16.patch [new file with mode: 0644]
recipes/qemu/qemu-0.13.0/91-oh-sdl-cursor.patch [new file with mode: 0644]
recipes/qemu/qemu-0.13.0/fallback.to.safe.mmap_min_addr.patch [new file with mode: 0644]
recipes/qemu/qemu-0.13.0/fix_baum_c_compilation.patch [new file with mode: 0644]
recipes/qemu/qemu-0.13.0/leftover.patch [new file with mode: 0644]
recipes/qemu/qemu_0.13.0.bb [new file with mode: 0644]

diff --git a/recipes/qemu/qemu-0.13.0/03_fix_syscalls_on_arches_that_do_not_use_UID16.patch b/recipes/qemu/qemu-0.13.0/03_fix_syscalls_on_arches_that_do_not_use_UID16.patch
new file mode 100644 (file)
index 0000000..61a5644
--- /dev/null
@@ -0,0 +1,271 @@
+maybe partially fixes Bug#562887: qemu-user-static mipsel emulation
+
+from:
+
+https://build.opensuse.org/package/view_file?file=qemu-0.11-git-user-linux-uid16_fix.patch&package=qemu-svn&project=openSUSE%3ATools
+---
+
+Quite a number of syscalls are only defined on systems with USE_UID16
+defined; this patch defines them on other systems as well.
+
+Fixes a large number of uid/gid-related testcases on the s390x target
+(and most likely on other targets as well)
+
+Signed-off-by: Ulrich Hecht &lt;uli@suse.de&gt;
+---
+ linux-user/syscall.c |  125 ++++++++++++++++++++++++++++++++++++++++++--------
+ 1 files changed, 105 insertions(+), 20 deletions(-)
+
+diff --git a/linux-user/syscall.c b/linux-user/syscall.c
+index c9e0194..6892880 100644
+--- a/linux-user/syscall.c
++++ b/linux-user/syscall.c
+@@ -305,7 +305,7 @@ static int sys_fchmodat(int dirfd, const char *pathname, mode_t mode)
+   return (fchmodat(dirfd, pathname, mode, 0));
+ }
+ #endif
+-#if defined(TARGET_NR_fchownat) && defined(USE_UID16)
++#if defined(TARGET_NR_fchownat)
+ static int sys_fchownat(int dirfd, const char *pathname, uid_t owner,
+     gid_t group, int flags)
+ {
+@@ -414,7 +414,7 @@ _syscall3(int,sys_faccessat,int,dirfd,const char *,pathname,int,mode)
+ #if defined(TARGET_NR_fchmodat) && defined(__NR_fchmodat)
+ _syscall3(int,sys_fchmodat,int,dirfd,const char *,pathname, mode_t,mode)
+ #endif
+-#if defined(TARGET_NR_fchownat) && defined(__NR_fchownat) && defined(USE_UID16)
++#if defined(TARGET_NR_fchownat) && defined(__NR_fchownat)
+ _syscall5(int,sys_fchownat,int,dirfd,const char *,pathname,
+           uid_t,owner,gid_t,group,int,flags)
+ #endif
+@@ -6353,18 +6353,35 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
+     case TARGET_NR_setfsgid:
+         ret = get_errno(setfsgid(arg1));
+         break;
++#else /* USE_UID16 */
++#if defined(TARGET_NR_fchownat) && defined(__NR_fchownat)
++    case TARGET_NR_fchownat:
++        if (!(p = lock_user_string(arg2))) 
++            goto efault;
++        ret = get_errno(sys_fchownat(arg1, p, arg3, arg4, arg5));
++        unlock_user(p, arg2, 0);
++        break;
++#endif
+ #endif /* USE_UID16 */
+-#ifdef TARGET_NR_lchown32
++#if defined(TARGET_NR_lchown32) || !defined(USE_UID16)
++#if defined(TARGET_NR_lchown32)
+     case TARGET_NR_lchown32:
++#else
++    case TARGET_NR_lchown:
++#endif
+         if (!(p = lock_user_string(arg1)))
+             goto efault;
+         ret = get_errno(lchown(p, arg2, arg3));
+         unlock_user(p, arg1, 0);
+         break;
+ #endif
+-#ifdef TARGET_NR_getuid32
++#if defined(TARGET_NR_getuid32) || (defined(TARGET_NR_getuid) && !defined(USE_UID16))
++#if defined(TARGET_NR_getuid32)
+     case TARGET_NR_getuid32:
++#else
++    case TARGET_NR_getuid:
++#endif
+         ret = get_errno(getuid());
+         break;
+ #endif
+@@ -6392,33 +6409,57 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
+         break;
+ #endif
+-#ifdef TARGET_NR_getgid32
++#if defined(TARGET_NR_getgid32) || (defined(TARGET_NR_getgid) && !defined(USE_UID16))
++#if defined(TARGET_NR_getgid32)
+     case TARGET_NR_getgid32:
++#else
++    case TARGET_NR_getgid:
++#endif
+         ret = get_errno(getgid());
+         break;
+ #endif
+-#ifdef TARGET_NR_geteuid32
++#if defined(TARGET_NR_geteuid32) || (defined(TARGET_NR_geteuid) && !defined(USE_UID16))
++#if defined(TARGET_NR_geteuid32)
+     case TARGET_NR_geteuid32:
++#else
++    case TARGET_NR_geteuid:
++#endif
+         ret = get_errno(geteuid());
+         break;
+ #endif
+-#ifdef TARGET_NR_getegid32
++#if defined(TARGET_NR_getegid32) || (defined(TARGET_NR_getegid) && !defined(USE_UID16))
++#if defined(TARGET_NR_getegid32)
+     case TARGET_NR_getegid32:
++#else
++    case TARGET_NR_getegid:
++#endif
+         ret = get_errno(getegid());
+         break;
+ #endif
+-#ifdef TARGET_NR_setreuid32
++#if defined(TARGET_NR_setreuid32) || !defined(USE_UID16)
++#if defined(TARGET_NR_setreuid32)
+     case TARGET_NR_setreuid32:
++#else
++    case TARGET_NR_setreuid:
++#endif
+         ret = get_errno(setreuid(arg1, arg2));
+         break;
+ #endif
+-#ifdef TARGET_NR_setregid32
++#if defined(TARGET_NR_setregid32) || !defined(USE_UID16)
++#if defined(TARGET_NR_setregid32)
+     case TARGET_NR_setregid32:
++#else
++    case TARGET_NR_setregid:
++#endif
+         ret = get_errno(setregid(arg1, arg2));
+         break;
+ #endif
+-#ifdef TARGET_NR_getgroups32
++#if defined(TARGET_NR_getgroups32) || !defined(USE_UID16)
++#if defined(TARGET_NR_getgroups32)
+     case TARGET_NR_getgroups32:
++#else
++    case TARGET_NR_getgroups:
++#endif
+         {
+             int gidsetsize = arg1;
+             uint32_t *target_grouplist;
+@@ -6442,8 +6483,12 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
+         }
+         break;
+ #endif
+-#ifdef TARGET_NR_setgroups32
++#if defined(TARGET_NR_setgroups32) || !defined(USE_UID16)
++#if defined(TARGET_NR_setgroups32)
+     case TARGET_NR_setgroups32:
++#else
++    case TARGET_NR_setgroups:
++#endif
+         {
+             int gidsetsize = arg1;
+             uint32_t *target_grouplist;
+@@ -6463,18 +6508,30 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
+         }
+         break;
+ #endif
+-#ifdef TARGET_NR_fchown32
++#if defined(TARGET_NR_fchown32) || !defined(USE_UID16)
++#if defined(TARGET_NR_fchown32)
+     case TARGET_NR_fchown32:
++#else
++    case TARGET_NR_fchown:
++#endif
+         ret = get_errno(fchown(arg1, arg2, arg3));
+         break;
+ #endif
+-#ifdef TARGET_NR_setresuid32
++#if defined(TARGET_NR_setresuid32) || !defined(USE_UID16)
++#if defined(TARGET_NR_setresuid32)
+     case TARGET_NR_setresuid32:
++#else
++    case TARGET_NR_setresuid:
++#endif
+         ret = get_errno(setresuid(arg1, arg2, arg3));
+         break;
+ #endif
+-#ifdef TARGET_NR_getresuid32
++#if defined(TARGET_NR_getresuid32) || !defined(USE_UID16)
++#if defined(TARGET_NR_getresuid32)
+     case TARGET_NR_getresuid32:
++#else
++    case TARGET_NR_getresuid:
++#endif
+         {
+             uid_t ruid, euid, suid;
+             ret = get_errno(getresuid(&ruid, &euid, &suid));
+@@ -6487,13 +6544,21 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
+         }
+         break;
+ #endif
+-#ifdef TARGET_NR_setresgid32
++#if defined(TARGET_NR_setresgid32) || !defined(USE_UID16)
++#if defined(TARGET_NR_setresgid32)
+     case TARGET_NR_setresgid32:
++#else
++    case TARGET_NR_setresgid:
++#endif
+         ret = get_errno(setresgid(arg1, arg2, arg3));
+         break;
+ #endif
++#if defined(TARGET_NR_getresgid32) || !defined(USE_UID16)
+ #ifdef TARGET_NR_getresgid32
+     case TARGET_NR_getresgid32:
++#else
++    case TARGET_NR_getresgid:
++#endif
+         {
+             gid_t rgid, egid, sgid;
+             ret = get_errno(getresgid(&rgid, &egid, &sgid));
+@@ -6506,31 +6571,51 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
+         }
+         break;
+ #endif
+-#ifdef TARGET_NR_chown32
++#if defined(TARGET_NR_chown32) || !defined(USE_UID16)
++#if defined(TARGET_NR_chown32)
+     case TARGET_NR_chown32:
++#else
++    case TARGET_NR_chown:
++#endif
+         if (!(p = lock_user_string(arg1)))
+             goto efault;
+         ret = get_errno(chown(p, arg2, arg3));
+         unlock_user(p, arg1, 0);
+         break;
+ #endif
+-#ifdef TARGET_NR_setuid32
++#if defined(TARGET_NR_setuid32) || !defined(USE_UID16)
++#if defined(TARGET_NR_setuid32)
+     case TARGET_NR_setuid32:
++#else
++    case TARGET_NR_setuid:
++#endif
+         ret = get_errno(setuid(arg1));
+         break;
+ #endif
+-#ifdef TARGET_NR_setgid32
++#if defined(TARGET_NR_setgid32) || !defined(USE_UID16)
++#if defined(TARGET_NR_setgid32)
+     case TARGET_NR_setgid32:
++#else
++    case TARGET_NR_setgid:
++#endif
+         ret = get_errno(setgid(arg1));
+         break;
+ #endif
+-#ifdef TARGET_NR_setfsuid32
++#if defined(TARGET_NR_setfsuid32) || !defined(USE_UID16)
++#if defined(TARGET_NR_setfsuid32)
+     case TARGET_NR_setfsuid32:
++#else
++    case TARGET_NR_setfsuid:
++#endif
+         ret = get_errno(setfsuid(arg1));
+         break;
+ #endif
+-#ifdef TARGET_NR_setfsgid32
++#if defined(TARGET_NR_setfsgid32) || !defined(USE_UID16)
++#if defined(TARGET_NR_setfsgid32)
+     case TARGET_NR_setfsgid32:
++#else
++    case TARGET_NR_setfsgid:
++#endif
+         ret = get_errno(setfsgid(arg1));
+         break;
+ #endif
+-- 
diff --git a/recipes/qemu/qemu-0.13.0/91-oh-sdl-cursor.patch b/recipes/qemu/qemu-0.13.0/91-oh-sdl-cursor.patch
new file mode 100644 (file)
index 0000000..dc0064b
--- /dev/null
@@ -0,0 +1,18 @@
+=== modified file 'sdl.c'
+---
+ sdl.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+Index: qemu-0.13.0/ui/sdl.c
+===================================================================
+--- qemu-0.13.0.orig/ui/sdl.c
++++ qemu-0.13.0/ui/sdl.c
+@@ -442,7 +442,7 @@ static void sdl_hide_cursor(void)
+     if (kbd_mouse_is_absolute()) {
+         SDL_ShowCursor(1);
+-        SDL_SetCursor(sdl_cursor_hidden);
++        /* SDL_SetCursor(sdl_cursor_hidden); */
+     } else {
+         SDL_ShowCursor(0);
+     }
diff --git a/recipes/qemu/qemu-0.13.0/fallback.to.safe.mmap_min_addr.patch b/recipes/qemu/qemu-0.13.0/fallback.to.safe.mmap_min_addr.patch
new file mode 100644 (file)
index 0000000..7c782b9
--- /dev/null
@@ -0,0 +1,37 @@
+From c313f89c33217ac0e471554dace2144718f86669 Mon Sep 17 00:00:00 2001
+From: Martin Jansa <Martin.Jansa@gmail.com>
+Date: Thu, 13 May 2010 12:23:40 +0200
+Subject: [PATCH] linux-user: use default mmap_min_addr 65536 when /proc/sys/vm/mmap_min_addr cannot be read
+
+* 65536 is default at least for ubuntu and fedora.
+---
+ linux-user/main.c |    5 +++++
+ 1 files changed, 5 insertions(+), 0 deletions(-)
+
+Index: qemu-0.13.0/linux-user/main.c
+===================================================================
+--- qemu-0.13.0.orig/linux-user/main.c
++++ qemu-0.13.0/linux-user/main.c
+@@ -36,6 +36,7 @@
+ #include "envlist.h"
+ #define DEBUG_LOGFILE "/tmp/qemu.log"
++#define MMAP_MIN_ADDR_DEFAULT 65536
+ char *exec_path;
+@@ -2973,8 +2974,14 @@ int main(int argc, char **argv, char **e
+             if (fscanf(fp, "%lu", &tmp) == 1) {
+                 mmap_min_addr = tmp;
+                 qemu_log("host mmap_min_addr=0x%lx\n", mmap_min_addr);
++            } else {
++                qemu_log("cannot read value from /proc/sys/vm/mmap_min_addr, assuming %d\n", MMAP_MIN_ADDR_DEFAULT);
++                mmap_min_addr = MMAP_MIN_ADDR_DEFAULT;
+             }
+             fclose(fp);
++        } else {
++            qemu_log("cannot open /proc/sys/vm/mmap_min_addr for reading, assuming %d\n", MMAP_MIN_ADDR_DEFAULT);
++            mmap_min_addr = MMAP_MIN_ADDR_DEFAULT;
+         }
+     }
diff --git a/recipes/qemu/qemu-0.13.0/fix_baum_c_compilation.patch b/recipes/qemu/qemu-0.13.0/fix_baum_c_compilation.patch
new file mode 100644 (file)
index 0000000..a2eb438
--- /dev/null
@@ -0,0 +1,30 @@
+Index: trunk/hw/baum.c
+===================================================================
+--- trunk.orig/hw/baum.c       2008-11-29 05:12:40.418390606 +0300
++++ trunk/hw/baum.c    2008-11-29 05:13:11.498378426 +0300
+@@ -569,8 +569,10 @@ CharDriverState *chr_baum_init(void)
+     CharDriverState *chr;
+     brlapi_handle_t *handle;
+ #ifdef CONFIG_SDL
++#ifdef SDL_VIDEO_DRIVER_X11
+     SDL_SysWMinfo info;
+ #endif
++#endif
+     int tty;
+
+     baum = qemu_mallocz(sizeof(BaumDriverState));
+@@ -605,12 +607,14 @@ CharDriverState *chr_baum_init(void)
+     }
+
+ #ifdef CONFIG_SDL
++#ifdef SDL_VIDEO_DRIVER_X11
+     memset(&info, 0, sizeof(info));
+     SDL_VERSION(&info.version);
+     if (SDL_GetWMInfo(&info))
+         tty = info.info.x11.wmwindow;
+     else
+ #endif
++#endif
+         tty = BRLAPI_TTY_DEFAULT;
+
+     if (brlapi__enterTtyMode(handle, tty, NULL) == -1) {
diff --git a/recipes/qemu/qemu-0.13.0/leftover.patch b/recipes/qemu/qemu-0.13.0/leftover.patch
new file mode 100644 (file)
index 0000000..c840d3e
--- /dev/null
@@ -0,0 +1,25 @@
+Index: qemu-0.10.0/hw/pc.c
+===================================================================
+--- qemu-0.10.0.orig/hw/pc.c   2009-03-07 13:47:27.000000000 +0100
++++ qemu-0.10.0/hw/pc.c        2009-03-07 13:47:30.000000000 +0100
+@@ -390,7 +390,8 @@
+     case 0x400:
+     case 0x401:
+         fprintf(stderr, "BIOS panic at rombios.c, line %d\n", val);
+-        exit(1);
++        /* according to documentation, these can be safely ignored */
++        break;
+     case 0x402:
+     case 0x403:
+ #ifdef DEBUG_BIOS
+@@ -413,8 +414,9 @@
+         /* LGPL'ed VGA BIOS messages */
+     case 0x501:
+     case 0x502:
++        /* according to documentation, these can be safely ignored */
+         fprintf(stderr, "VGA BIOS panic, line %d\n", val);
+-        exit(1);
++        break;
+     case 0x500:
+     case 0x503:
+ #ifdef DEBUG_BIOS
diff --git a/recipes/qemu/qemu_0.13.0.bb b/recipes/qemu/qemu_0.13.0.bb
new file mode 100644 (file)
index 0000000..8e9539c
--- /dev/null
@@ -0,0 +1,26 @@
+LICENSE = "GPL"
+DEPENDS = "zlib ncurses gnutls"
+
+SRC_URI = "\
+    http://download.savannah.gnu.org/releases/qemu/qemu-${PV}.tar.gz \
+    file://leftover.patch \
+    file://91-oh-sdl-cursor.patch \
+    file://fix_baum_c_compilation.patch \
+    file://fallback.to.safe.mmap_min_addr.patch \
+    "
+SRC_URI[md5sum] = "397a0d665da8ba9d3b9583629f3d6421"
+SRC_URI[sha256sum] = "1e6f5851b05cea6e377c835f4668408d4124cfb845f9948d922808743c5fd877"
+BBCLASSEXTEND="native"
+
+S = "${WORKDIR}/qemu-${PV}"
+
+EXTRA_OECONF += " --disable-curl --disable-sdl --disable-strip \
+                "
+
+EXTRA_OECONF_append_virtclass-native = " --extra-cflags="-I${STAGING_INCDIR_NATIVE}""
+
+inherit autotools
+
+do_configure() {
+       ${S}/configure --prefix=${prefix} ${EXTRA_OECONF}
+}