1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125
|
Author: Rogier 'DocWilco' Mulhuijzen <github@bsdchicks.com>
DescriptioN: add config option to set Xorg binary to run
Also add Xorg commandline binary to debug output
Origin: commit:11ac2211e97823ee7fda9fa5978eb2e12358cceb
Applied-Upstream: commit:11ac2211e97823ee7fda9fa5978eb2e12358cceb
--- a/Makefile.am
+++ b/Makefile.am
@@ -70,6 +70,7 @@
do_subst = sed -e 's|[@]GITVERSION[@]|$(GITVERSION)|g' \
-e 's|[@]CONF_XDISP[@]|$(CONF_XDISP)|g' \
+ -e 's|[@]CONF_XORG_BINARY[@]|$(CONF_XORG_BINARY)|g' \
-e 's|[@]CONF_SOCKPATH[@]|$(CONF_SOCKPATH)|g' \
-e 's|[@]CONF_GID[@]|$(CONF_GID)|g' \
-e 's|[@]CONF_PM_METHOD[@]|$(CONF_PM_METHOD)|g' \
--- a/conf/bumblebee.conf.in
+++ b/conf/bumblebee.conf.in
@@ -22,6 +22,8 @@
Driver=@CONF_DRIVER@
# Directory with a dummy config file to pass as a -configdir to secondary X
XorgConfDir=@XCONFDDIR@
+# Xorg binary to run
+XorgBinary=@CONF_XORG_BINARY@
## Client options. Will take effect on the next optirun executed.
[optirun]
--- a/configure.ac
+++ b/configure.ac
@@ -32,6 +32,16 @@
AC_DEFINE_SUBST(CONF_VGLCOMPRESS, "proxy", [vglclient transport method])
AC_DEFINE_SUBST(CONF_TURNOFFATEXIT, "false", [state of card when shutting off daemon])
+# OpenSUSE: /usr/bin/X -> /var/lib/X11/X -> /usr/bin/Xorg
+# Fedora, Arch Linux: /usr/bin/X -> /usr/bin/Xorg
+# Ubuntu: /usr/bin/X is a custom binary doing authorization and then executes
+# /etc/X11/X -> /usr/bin/Xorg
+AC_DEFINE_CONF(CONF_XORG_BINARY, [Xorg binary to run], [
+if test "x" = "x$CONF_XORG_BINARY"; then
+ CONF_XORG_BINARY=Xorg
+fi
+])
+
AC_DEFINE_CONF(CONF_BRIDGE, [optirun display/render bridge, valid values are auto (default), primus and virtualgl], [
case $CONF_BRIDGE in
auto|primus|virtualgl) ;;
--- a/src/bbconfig.c
+++ b/src/bbconfig.c
@@ -425,6 +425,10 @@
if (g_key_file_has_key(bbcfg, section, key, NULL)) {
free_and_set_value(&bb_config.x_conf_dir, g_key_file_get_string(bbcfg, section, key, NULL));
}
+ key = "XorgBinary";
+ if (g_key_file_has_key(bbcfg, section, key, NULL)) {
+ free_and_set_value(&bb_config.xorg_binary, g_key_file_get_string(bbcfg, section, key, NULL));
+ }
return bbcfg;
}
@@ -517,6 +521,7 @@
set_string_value(&bb_config.gid_name, CONF_GID);
set_string_value(&bb_config.x_conf_file, CONF_XORG);
set_string_value(&bb_config.x_conf_dir, CONF_XORG_DIR);
+ set_string_value(&bb_config.xorg_binary, CONF_XORG_BINARY);
set_string_value(&bb_config.optirun_bridge, CONF_BRIDGE);
set_string_value(&bb_config.primus_ld_path, CONF_PRIMUS_LD_PATH);
set_string_value(&bb_config.vgl_compress, CONF_VGLCOMPRESS);
@@ -550,6 +555,7 @@
#endif
bb_log(LOG_DEBUG, " xorg.conf file: %s\n", bb_config.x_conf_file);
bb_log(LOG_DEBUG, " xorg.conf.d dir: %s\n", bb_config.x_conf_dir);
+ bb_log(LOG_DEBUG, " Xorg binary: %s\n", bb_config.xorg_binary);
bb_log(LOG_DEBUG, " ModulePath: %s\n", bb_config.mod_path);
bb_log(LOG_DEBUG, " GID name: %s\n", bb_config.gid_name);
bb_log(LOG_DEBUG, " Power method: %s\n",
--- a/src/bbconfig.h
+++ b/src/bbconfig.h
@@ -122,6 +122,7 @@
/* Structure containing the configuration. */
struct bb_config_struct {
+ char * xorg_binary; /// Xorg binary to run.
char * x_display; /// X display number to use.
char * x_conf_file; /// Path to the X configuration file.
char * x_conf_dir; /// Path to the dummy X configuration directory.
--- a/src/bbsecondary.c
+++ b/src/bbsecondary.c
@@ -146,7 +146,7 @@
bb_log(LOG_INFO, "Starting X server on display %s.\n", bb_config.x_display);
char *x_argv[] = {
- XORG_BINARY,
+ bb_config.xorg_binary,
bb_config.x_display,
"-config", x_conf_file,
"-configdir", bb_config.x_conf_dir,
@@ -158,6 +158,12 @@
"-modulepath", bb_config.mod_path, // keep last
NULL
};
+ char **argvp;
+ bb_log(LOG_DEBUG, "X server command line:");
+ for (argvp = x_argv; argvp && *argvp; argvp++) {
+ bb_log(LOG_DEBUG, " %s", *argvp);
+ }
+ bb_log(LOG_DEBUG, "\n");
enum {n_x_args = sizeof(x_argv) / sizeof(x_argv[0])};
if (!*bb_config.mod_path) {
x_argv[n_x_args - 3] = 0; //remove -modulepath if not set
--- a/src/bbsecondary.h
+++ b/src/bbsecondary.h
@@ -20,14 +20,6 @@
*/
#pragma once
-/**
- * OpenSUSE: /usr/bin/X -> /var/lib/X11/X -> /usr/bin/Xorg
- * Fedora, Arch Linux: /usr/bin/X -> /usr/bin/Xorg
- * Ubuntu: /usr/bin/X is a custom binary doing authorization and then executes
- * /etc/X11/X -> /usr/bin/Xorg
- */
-#define XORG_BINARY "Xorg"
-
/* PCI Bus ID of the discrete video card */
struct pci_bus_id *pci_bus_id_discrete;
|