[PATCH] xfree86: Disable all hotplugging features without CONFIG_HAL

Dan Nicholson dbn.lists at gmail.com
Wed Jan 28 15:16:45 PST 2009


If HAL configuration has not been built into the server, force
AutoAddDevices, AutoEnableDevices and AllowEmptyInput to FALSE. The only
way to use input devices in this configuration is through xorg.conf.

Signed-off-by: Dan Nicholson <dbn.lists at gmail.com>
---
 There are still people out there not riding the HAL wave, and this allows
 them to carry on without applying special server flags.

 Technically, I think this should also consider CONFIG_DBUS_API, but
 nothing else in the code does.

 hw/xfree86/common/xf86Config.c       |   14 ++++++++++++++
 hw/xfree86/doc/man/xorg.conf.man.pre |   11 ++++++-----
 2 files changed, 20 insertions(+), 5 deletions(-)

diff --git a/hw/xfree86/common/xf86Config.c b/hw/xfree86/common/xf86Config.c
index 8df9780..20fa631 100644
--- a/hw/xfree86/common/xf86Config.c
+++ b/hw/xfree86/common/xf86Config.c
@@ -833,6 +833,7 @@ configServerFlags(XF86ConfFlagsPtr flagsconf, XF86OptionPtr layoutopts)
 	    xf86Msg(X_CONFIG, "Ignoring ABI Version\n");
     }
 
+#ifdef CONFIG_HAL
     if (xf86IsOptionSet(FlagOptions, FLAG_AUTO_ADD_DEVICES)) {
         xf86GetOptValBool(FlagOptions, FLAG_AUTO_ADD_DEVICES,
                           &xf86Info.autoAddDevices);
@@ -841,9 +842,14 @@ configServerFlags(XF86ConfFlagsPtr flagsconf, XF86OptionPtr layoutopts)
     else {
         from = X_DEFAULT;
     }
+#else
+    xf86Info.autoAddDevices = FALSE;
+    from = X_DEFAULT;
+#endif
     xf86Msg(from, "%sutomatically adding devices\n",
             xf86Info.autoAddDevices ? "A" : "Not a");
 
+#ifdef CONFIG_HAL
     if (xf86IsOptionSet(FlagOptions, FLAG_AUTO_ENABLE_DEVICES)) {
         xf86GetOptValBool(FlagOptions, FLAG_AUTO_ENABLE_DEVICES,
                           &xf86Info.autoEnableDevices);
@@ -852,6 +858,10 @@ configServerFlags(XF86ConfFlagsPtr flagsconf, XF86OptionPtr layoutopts)
     else {
         from = X_DEFAULT;
     }
+#else
+    xf86Info.autoEnableDevices = FALSE;
+    from = X_DEFAULT;
+#endif
     xf86Msg(from, "%sutomatically enabling devices\n",
             xf86Info.autoEnableDevices ? "A" : "Not a");
 
@@ -952,9 +962,13 @@ configServerFlags(XF86ConfFlagsPtr flagsconf, XF86OptionPtr layoutopts)
     }
 #endif
 
+#ifdef CONFIG_HAL
     /* AllowEmptyInput is automatically true if we're hotplugging */
     xf86Info.allowEmptyInput = (xf86Info.autoAddDevices && xf86Info.autoEnableDevices);
     xf86GetOptValBool(FlagOptions, FLAG_ALLOW_EMPTY_INPUT, &xf86Info.allowEmptyInput);
+#else
+    xf86Info.allowEmptyInput = FALSE;
+#endif
 
     /* AEI on? Then we're not using kbd, so use the evdev rules set. */
 #ifdef XKB
diff --git a/hw/xfree86/doc/man/xorg.conf.man.pre b/hw/xfree86/doc/man/xorg.conf.man.pre
index f5c49e1..987a290 100644
--- a/hw/xfree86/doc/man/xorg.conf.man.pre
+++ b/hw/xfree86/doc/man/xorg.conf.man.pre
@@ -640,19 +640,20 @@ the X server to load. Disabled by default.
 .TP 7
 .BI "Option \*qAllowEmptyInput\*q \*q" boolean \*q
 If enabled, don't add the standard keyboard and mouse drivers, if there are no
-input devices in the config file.  Enabled by default if AutoAddDevices and
-AutoEnableDevices is enabled, otherwise disabled.
-If AllowEmptyInput is on, devices using the kbd, mouse or vmmouse driver are ignored.
+input devices in the config file.  Enabled by default if Xorg has HAL support
+and AutoAddDevices and AutoEnableDevices are enabled, otherwise disabled.
+If AllowEmptyInput is on, devices using the kbd, mouse or vmmouse driver are
+ignored.
 .TP 7
 .BI "Option \*qAutoAddDevices\*q \*q" boolean \*q
 If this option is disabled, then no devices will be added from HAL events.
-Enabled by default.
+Enabled by default if Xorg has HAL support.
 .TP 7
 .BI "Option \*qAutoEnableDevices\*q \*q" boolean \*q
 If this option is disabled, then the devices will be added (and the
 DevicePresenceNotify event sent), but not enabled, thus leaving policy up
 to the client.
-Enabled by default.
+Enabled by default if Xorg has HAL support.
 .TP 7
 .BI "Option \*qLog\*q \*q" string \*q
 This option controls whether the log is flushed and/or synced to disk after
-- 
1.5.6.6




More information about the xorg mailing list