From 6e8df4f3f4a81a229ed0ca652a9036e7a3585d75207f31b5fd13da67e610322f Mon Sep 17 00:00:00 2001 From: Stefan Dirsch Date: Sat, 10 Apr 2010 10:49:13 +0000 Subject: [PATCH] - adjusted moblin-xserver-no-root-2.patch, renamed it to xorg-server-nohwaccess.diff and enable it by default - rename moblin-xorg-x11-nonroot-vesa.patch to xorg-x11-nonroot-vesa.patch - removed obsolete patch 'xserver-boottime.patch' OBS-URL: https://build.opensuse.org/package/show/X11:XOrg/xorg-x11-server?expand=0&rev=249 --- moblin-xserver-no-root-2.patch | 105 ------------------ xorg-server-nohwaccess.diff | 52 +++++++++ ...-vesa.patch => xorg-x11-nonroot-vesa.patch | 0 xorg-x11-server.changes | 9 ++ xorg-x11-server.spec | 24 ++-- xserver-boottime.patch | 38 ------- 6 files changed, 69 insertions(+), 159 deletions(-) delete mode 100644 moblin-xserver-no-root-2.patch create mode 100644 xorg-server-nohwaccess.diff rename moblin-xorg-x11-nonroot-vesa.patch => xorg-x11-nonroot-vesa.patch (100%) delete mode 100644 xserver-boottime.patch diff --git a/moblin-xserver-no-root-2.patch b/moblin-xserver-no-root-2.patch deleted file mode 100644 index 73091aa..0000000 --- a/moblin-xserver-no-root-2.patch +++ /dev/null @@ -1,105 +0,0 @@ -Index: xorg-server-1.6.3/hw/xfree86/os-support/linux/lnx_init.c -=================================================================== ---- xorg-server-1.6.3.orig/hw/xfree86/os-support/linux/lnx_init.c -+++ xorg-server-1.6.3/hw/xfree86/os-support/linux/lnx_init.c -@@ -49,6 +49,7 @@ static Bool KeepTty = FALSE; - static int VTnum = -1; - static Bool VTSwitch = TRUE; - static Bool ShareVTs = FALSE; -+Bool NoHwAccess = FALSE; - static int activeVT = -1; - - static int vtPermSave[4]; -@@ -80,9 +81,11 @@ saveVtPerms(void) - static void - restoreVtPerms(void) - { -- /* Set the terminal permissions back to before we started. */ -- chown("/dev/tty0", vtPermSave[0], vtPermSave[1]); -- chown(vtname, vtPermSave[2], vtPermSave[3]); -+ if (geteuid() == 0) { -+ /* Set the terminal permissions back to before we started. */ -+ (void)chown("/dev/tty0", vtPermSave[0], vtPermSave[1]); -+ (void)chown(vtname, vtPermSave[2], vtPermSave[3]); -+ } - } - - static void *console_handler; -@@ -210,20 +213,22 @@ xf86OpenConsole(void) - xf86Msg(X_WARNING, - "xf86OpenConsole: Could not save ownership of VT\n"); - -- /* change ownership of the vt */ -- if (chown(vtname, getuid(), getgid()) < 0) -- xf86Msg(X_WARNING,"xf86OpenConsole: chown %s failed: %s\n", -- vtname, strerror(errno)); -- -- /* -- * the current VT device we're running on is not "console", we want -- * to grab all consoles too -- * -- * Why is this needed?? -- */ -- if (chown("/dev/tty0", getuid(), getgid()) < 0) -- xf86Msg(X_WARNING,"xf86OpenConsole: chown /dev/tty0 failed: %s\n", -- strerror(errno)); -+ if (geteuid() == 0) { -+ /* change ownership of the vt */ -+ if (chown(vtname, getuid(), getgid()) < 0) -+ xf86Msg(X_WARNING,"xf86OpenConsole: chown %s failed: %s\n", -+ vtname, strerror(errno)); -+ -+ /* -+ * the current VT device we're running on is not -+ * "console", we want to grab all consoles too -+ * -+ * Why is this needed?? -+ */ -+ if (chown("/dev/tty0", getuid(), getgid()) < 0) -+ xf86Msg(X_WARNING,"xf86OpenConsole: chown /dev/tty0 failed: %s\n", -+ strerror(errno)); -+ } - } - - /* -@@ -434,6 +439,11 @@ xf86ProcessArgument(int argc, char *argv - ShareVTs = TRUE; - return(1); - } -+ if (!strcmp(argv[i], "-nohwaccess")) -+ { -+ NoHwAccess = TRUE; -+ return(1); -+ } - if ((argv[i][0] == 'v') && (argv[i][1] == 't')) - { - if (sscanf(argv[i], "vt%2d", &VTnum) == 0) -@@ -455,5 +465,6 @@ xf86UseMsg() - ErrorF("don't detach controlling tty (for debugging only)\n"); - ErrorF("-novtswitch don't immediately switch to new VT\n"); - ErrorF("-sharevts share VTs with another X server\n"); -+ ErrorF("-nohwaccess don't access hardware ports directly\n"); - return; - } -Index: xorg-server-1.6.3/hw/xfree86/os-support/linux/lnx_video.c -=================================================================== ---- xorg-server-1.6.3.orig/hw/xfree86/os-support/linux/lnx_video.c -+++ xorg-server-1.6.3/hw/xfree86/os-support/linux/lnx_video.c -@@ -51,6 +51,7 @@ - #define MAP_FAILED ((void *)-1) - #endif - -+extern Bool NoHwAccess; - static Bool ExtendedEnabled = FALSE; - - #ifdef __ia64__ -@@ -509,6 +510,9 @@ xf86EnableIO(void) - int fd; - unsigned int ioBase_phys; - #endif -+ /* Fake it... */ -+ if (NoHwAccess) -+ return TRUE; - - if (ExtendedEnabled) - return TRUE; diff --git a/xorg-server-nohwaccess.diff b/xorg-server-nohwaccess.diff new file mode 100644 index 0000000..b630f8f --- /dev/null +++ b/xorg-server-nohwaccess.diff @@ -0,0 +1,52 @@ +Index: xorg-server-1.6.3/hw/xfree86/os-support/linux/lnx_init.c +=================================================================== +--- xorg-server-1.6.3.orig/hw/xfree86/os-support/linux/lnx_init.c ++++ xorg-server-1.6.3/hw/xfree86/os-support/linux/lnx_init.c +@@ -49,6 +49,7 @@ static Bool KeepTty = FALSE; + static int VTnum = -1; + static Bool VTSwitch = TRUE; + static Bool ShareVTs = FALSE; ++Bool NoHwAccess = FALSE; + static int activeVT = -1; + + static int vtPermSave[4]; +@@ -434,6 +439,11 @@ xf86ProcessArgument(int argc, char *argv + ShareVTs = TRUE; + return(1); + } ++ if (!strcmp(argv[i], "-nohwaccess")) ++ { ++ NoHwAccess = TRUE; ++ return(1); ++ } + if ((argv[i][0] == 'v') && (argv[i][1] == 't')) + { + if (sscanf(argv[i], "vt%2d", &VTnum) == 0) +@@ -455,4 +465,5 @@ xf86UseMsg() + ErrorF("don't detach controlling tty (for debugging only)\n"); + ErrorF("-novtswitch don't immediately switch to new VT\n"); + ErrorF("-sharevts share VTs with another X server\n"); ++ ErrorF("-nohwaccess don't access hardware ports directly\n"); + } +Index: xorg-server-1.6.3/hw/xfree86/os-support/linux/lnx_video.c +=================================================================== +--- xorg-server-1.6.3.orig/hw/xfree86/os-support/linux/lnx_video.c ++++ xorg-server-1.6.3/hw/xfree86/os-support/linux/lnx_video.c +@@ -51,6 +51,7 @@ + #define MAP_FAILED ((void *)-1) + #endif + ++extern Bool NoHwAccess; + static Bool ExtendedEnabled = FALSE; + + #ifdef __ia64__ +@@ -509,6 +510,9 @@ xf86EnableIO(void) + int fd; + unsigned int ioBase_phys; + #endif ++ /* Fake it... */ ++ if (NoHwAccess) ++ return TRUE; + + if (ExtendedEnabled) + return TRUE; diff --git a/moblin-xorg-x11-nonroot-vesa.patch b/xorg-x11-nonroot-vesa.patch similarity index 100% rename from moblin-xorg-x11-nonroot-vesa.patch rename to xorg-x11-nonroot-vesa.patch diff --git a/xorg-x11-server.changes b/xorg-x11-server.changes index 6342814..0fb49cd 100644 --- a/xorg-x11-server.changes +++ b/xorg-x11-server.changes @@ -1,3 +1,12 @@ +------------------------------------------------------------------- +Sat Apr 10 12:26:46 CEST 2010 - sndirsch@suse.de + +- adjusted moblin-xserver-no-root-2.patch, renamed it to + xorg-server-nohwaccess.diff and enable it by default +- rename moblin-xorg-x11-nonroot-vesa.patch to + xorg-x11-nonroot-vesa.patch +- removed obsolete patch 'xserver-boottime.patch' + ------------------------------------------------------------------- Thu Apr 8 13:42:43 UTC 2010 - eich@novell.com diff --git a/xorg-x11-server.spec b/xorg-x11-server.spec index 9183e93..67785a1 100644 --- a/xorg-x11-server.spec +++ b/xorg-x11-server.spec @@ -107,18 +107,11 @@ Patch132: fixed-SYNC-extension-trigger-BlockHandler-test.diff Patch143: autoconfig_fallback_fbdev_first.diff Patch145: driver-autoconfig.diff Patch147: xserver-1.6.1-nouveau.patch -# Moblin Patch162: cache-xkbcomp-output-for-fast-start-up.patch Patch163: xserver-bg-none-root.patch Patch164: xorg-detect-psb.patch -%if %moblin -Patch168: moblin-xserver-no-root-2.patch -%endif -Patch169: moblin-xorg-x11-nonroot-vesa.patch -%if %moblin -Patch170: xserver-boottime.patch -Patch171: moblin-use_preferred_mode_for_all_outputs.diff -%endif +Patch168: xorg-server-nohwaccess.diff +Patch169: xorg-x11-nonroot-vesa.patch Patch200: bug534768-prefer_local_symbols.patch Patch202: 0001-Check-harder-for-primary-PCI-device.patch Patch203: 0001-Fix-segfault-when-killing-X-with-ctrl-alt-backspace.patch @@ -129,6 +122,9 @@ Patch207: xorg-server-option_libxf86config.diff Patch208: xorg-evdev-conf.diff Patch209: sw_cursor_on_randr.patch Patch210: pio_ia64.diff +%if %moblin +Patch300: moblin-use_preferred_mode_for_all_outputs.diff +%endif %description This package contains the X.Org Server. @@ -236,15 +232,8 @@ popd %patch162 -p1 %patch163 -p1 %patch164 -p1 -%if %moblin %patch168 -p1 -%endif %patch169 -p1 -%if %moblin -%patch170 -p1 -%patch171 -p1 -%endif -# %patch200 -p1 %patch202 -p1 %patch203 -p1 @@ -255,6 +244,9 @@ popd %patch208 -p0 %patch209 -p1 %patch210 -p1 +%if %moblin +%patch300 -p1 +%endif %build pushd xorg-docs-* diff --git a/xserver-boottime.patch b/xserver-boottime.patch deleted file mode 100644 index 34011e2..0000000 --- a/xserver-boottime.patch +++ /dev/null @@ -1,38 +0,0 @@ -Index: xorg-server-1.6.3/os/log.c -=================================================================== ---- xorg-server-1.6.3.orig/os/log.c -+++ xorg-server-1.6.3/os/log.c -@@ -255,6 +255,33 @@ LogVWrite(int verb, const char *f, va_li - static char tmpBuffer[1024]; - int len = 0; - -+ struct timeval time; -+ time_t tv_sec; -+ suseconds_t tv_usec; -+ static Bool first = TRUE; -+ static time_t start_tv_sec; -+ static suseconds_t start_usec; -+ int diff_sec, diff_usec; -+ -+ gettimeofday(&time, NULL); -+ tv_sec = time.tv_sec; -+ tv_usec = time.tv_usec; -+ if (first == TRUE) { -+ start_tv_sec = tv_sec; -+ start_usec = tv_usec; -+ first = FALSE; -+ } -+ diff_sec = (int)difftime(tv_sec, start_tv_sec); -+ diff_usec = (tv_usec - start_usec); -+ if (diff_usec < 0) { -+ diff_sec--; -+ diff_usec += 1000000; -+ } -+ sprintf(tmpBuffer, "[%d sec: %06d usec]", diff_sec , diff_usec); -+ len = strlen(tmpBuffer); -+ if (logFile) -+ fwrite(tmpBuffer, len, 1, logFile); -+ - /* - * Since a va_list can only be processed once, write the string to a - * buffer, and then write the buffer out to the appropriate output