hal/hald Makefile.am, 1.44, 1.45 debug-hald.sh, 1.2, 1.3 device.c, 1.13, 1.14 device_info.c, 1.22, 1.23 device_info.h, 1.3, 1.4 hald.c, 1.25, 1.26 hald.conf, 1.4, NONE hald_conf.c, 1.5, NONE hald_conf.h, 1.4, NONE run-hald.sh, 1.5, 1.6 util.c, 1.4, 1.5 util.h, 1.3, 1.4

David Zeuthen david at freedesktop.org
Thu Feb 24 08:50:37 PST 2005


Update of /cvs/hal/hal/hald
In directory gabe:/tmp/cvs-serv5124/hald

Modified Files:
	Makefile.am debug-hald.sh device.c device_info.c device_info.h 
	hald.c run-hald.sh util.c util.h 
Removed Files:
	hald.conf hald_conf.c hald_conf.h 
Log Message:
2005-02-24  David Zeuthen  <davidz at redhat.com>

	* tools/linux/hal_hotplug_map.c: Removed

	* tools/linux/Makefile.am: Remove build rules for hal-hotplug-map

	* hald/linux2/physdev.c: Callouts now take two userdata pointers
	(physdev_callouts_preprobing_done): New function
	(hotplug_event_begin_add_physdev): Run preprobing callouts
	just before real probing (flow continues in the above function)

	* hald/linux2/osspec.c: Callouts now take two userdata pointers

	* hald/linux2/classdev.c: Callouts now take two userdata pointers
	(classdev_callouts_preprobing_done): New function
	(hotplug_event_begin_add_classdev): Run preprobing callouts
	just before real probing (flow continues in the above function)

	* hald/linux2/blockdev.c: Callouts now take two userdata pointers
	(blockdev_callouts_preprobing_storage_done): New function
	(blockdev_callouts_preprobing_volume_done): New function
	(hotplug_event_begin_add_blockdev): Run preprobing callouts just
	before real probing (flow continues in the two above
	functions)

	* hald/linux2/apm.c: Callouts now take two userdata pointers

	* hald/linux2/acpi.c: Callouts now take two userdata pointers

	* hald/util.h: Fix up prototypes for callouts to take two userdata
	pointers. Add hal_util_callout_device_preprobe prototype.

	* hald/util.c: Change callouts to take two userdata pointers
	(hal_util_callout_device_preprobe): New function

	* hald/hald.c (main): Don't call hald_read_conf_file() as this
	is now gone.

	* hald/device_info.h (di_search_and_merge): Tweak prototype for
	di_search_and_merge to take a DeviceInfoType parameter

	* hald/device_info.c (di_search_and_merge): Lookup new environment
	variables

	* hald/run-hald.sh: Use new environment variables for specifying
	fdi file location

	* hald/debug-hald.sh: Use new environment variables for specifying
	fdi file location

	* hald/Makefile.am: Don't link with libselinux and don't install
	callout directories
	(hald_test_SOURCES): Remove hald_conf.[ch]
	(hald_SOURCES): Remove hald_conf.[ch].

	* configure.in: Add notes about how to tweak the hal tarball for a
	particular distribution or OS. Rework the details a bit. Remove the
	hotplug_map rules. Remove selinux bits (for now). Rework what fdi
	file directory Makefile's to generate.

	* hald/hald.conf: Removed

	* hald/hald_conf.[ch]: Removed

	* fdi/Makefile.am (SUBDIRS): Specificy new subdirs

	* fdi/preprobe: New

	* fdi/preprobe/Makefile.am: New

	* fdi/preprobe/10osvendor: New

	* fdi/preprobe/10osvendor/10-ide-drives.fdi: New

	* fdi/preprobe/10osvendor/Makefile.am: New

	* fdi/preprobe/20thirdparty: New

	* fdi/preprobe/20thirdparty/Makefile.am: New

	* fdi/preprobe/30user: New

	* fdi/preprobe/30user/Makefile.am: New

	* fdi/information: New

	* fdi/information/Makefile.am: New

	* fdi/information/10freedesktop: New

	* fdi/information/10freedesktop/Makefile.am: New

	* fdi/information/20thirdparty: New

	* fdi/information/20thirdparty/Makefile.am: New

	* fdi/information/30user: New

	* fdi/information/30user/Makefile.am: New

	* fdi/policy: New

	* fdi/policy/Makefile.am: New

	* fdi/policy/10osvendor: New

	* fdi/policy/10osvendor/10-storage-policy.fdi: New

	* fdi/policy/10osvendor/10-power-mgmt-policy.fdi: New

	* fdi/policy/10osvendor/90-fstab-sync.fdi: New

	* fdi/policy/10osvendor/Makefile.am: New

	* fdi/policy/20thirdparty: New

	* fdi/policy/20thirdparty/Makefile.am: New

	* fdi/policy/30user: New

	* fdi/policy/30user/Makefile.am: New

	* fdi/README: New file to describe the new directory structure



Index: Makefile.am
===================================================================
RCS file: /cvs/hal/hal/hald/Makefile.am,v
retrieving revision 1.44
retrieving revision 1.45
diff -u -d -r1.44 -r1.45
--- Makefile.am	16 Feb 2005 18:39:56 -0000	1.44
+++ Makefile.am	24 Feb 2005 16:50:34 -0000	1.45
@@ -20,7 +20,6 @@
 	device_store.h			device_store.c			\
 	logger.h			logger.c			\
 	property.h			property.c                      \
-	hald_conf.h                     hald_conf.c			\
 	hald_dbus.h			hald_dbus.c			\
 	hald_test.c							\
 	hald_test_libhal.c
@@ -46,20 +45,15 @@
 	hald_dbus.h			hald_dbus.c			\
 	logger.h			logger.c			\
 	osspec.h							\
-	property.h			property.c                      \
-	hald_conf.h                     hald_conf.c
+	property.h			property.c
 
 hald_LDADD = @PACKAGE_LIBS@ -lm @EXPAT_LIB@ $(top_builddir)/hald/$(HALD_BACKEND)/libhald_$(HALD_BACKEND).la
 
-if HAVE_SELINUX
-hald_LDADD += -lselinux
-endif
-
 #### Init scripts fun
 SCRIPT_IN_FILES=haldaemon.in
 
 ## Red Hat start
-if INIT_SCRIPTS_RED_HAT
+if OS_TYPE_RED_HAT
 
 initddir=$(sysconfdir)/rc.d/init.d
 
@@ -88,13 +82,3 @@
 	rm -f *~
 	rm -f hald_marshal.c hald_marshal.h
 
-confdir = $(sysconfdir)/hal
-
-dist_conf_DATA = hald.conf
-
-install-data-local :
-	$(mkinstalldirs) $(DESTDIR)$(SYSCONFDIR)/hal/device.d
-	$(mkinstalldirs) $(DESTDIR)$(SYSCONFDIR)/hal/capability.d
-	$(mkinstalldirs) $(DESTDIR)$(SYSCONFDIR)/hal/property.d
-	$(mkinstalldirs) $(DESTDIR)$(LOCALSTATEDIR)/lib/hal
-

Index: debug-hald.sh
===================================================================
RCS file: /cvs/hal/hal/hald/debug-hald.sh,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- debug-hald.sh	23 Feb 2005 18:25:43 -0000	1.2
+++ debug-hald.sh	24 Feb 2005 16:50:34 -0000	1.3
@@ -1,7 +1,9 @@
 #!/bin/sh
 
 export PATH=linux2:linux2/probing:linux2/addons:.:../tools:$PATH
-export HAL_FDI_SOURCE=../fdi
+export HAL_FDI_SOURCE_PREPROBE=../fdi/preprobe
+export HAL_FDI_SOURCE_INFORMATION=../fdi/information
+export HAL_FDI_SOURCE_POLICY=../fdi/policy
 echo ========================================
 echo Just type \'run\' to start debugging hald
 echo ========================================

Index: device.c
===================================================================
RCS file: /cvs/hal/hal/hald/device.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- device.c	14 Feb 2005 18:20:04 -0000	1.13
+++ device.c	24 Feb 2005 16:50:34 -0000	1.14
@@ -35,7 +35,6 @@
 #include "device.h"
 #include "hald_marshal.h"
 #include "logger.h"
-#include "hald_conf.h"
 
 static GObjectClass *parent_class;
 

Index: device_info.c
===================================================================
RCS file: /cvs/hal/hal/hald/device_info.c,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -d -r1.22 -r1.23
--- device_info.c	14 Feb 2005 18:20:04 -0000	1.22
+++ device_info.c	24 Feb 2005 16:50:34 -0000	1.23
@@ -1406,23 +1406,41 @@
  *  @return                     #TRUE if information was merged
  */
 dbus_bool_t
-di_search_and_merge (HalDevice *d)
+di_search_and_merge (HalDevice *d, DeviceInfoType type)
 {
 	static gboolean have_checked_hal_fdi_source = FALSE;
-	static char *hal_fdi_source = NULL;
-	char *source;
+	static char *hal_fdi_source_preprobe = NULL;
+	static char *hal_fdi_source_information = NULL;
+	static char *hal_fdi_source_policy = NULL;
+	char *s;
 
 	if (!have_checked_hal_fdi_source) {
-		hal_fdi_source = getenv ("HAL_FDI_SOURCE");
+		hal_fdi_source_preprobe    = getenv ("HAL_FDI_SOURCE_PREPROBE");
+		hal_fdi_source_information = getenv ("HAL_FDI_SOURCE_INFORMATION");
+		hal_fdi_source_policy      = getenv ("HAL_FDI_SOURCE_POLICY");
 		have_checked_hal_fdi_source = TRUE;
 	}
 
-	if (hal_fdi_source != NULL)
-		source = hal_fdi_source;
-	else
-		source = PACKAGE_DATA_DIR "/hal/fdi";
+	switch (type) {
+	case DEVICE_INFO_TYPE_PREPROBE:
+		s = hal_fdi_source_preprobe != NULL ? hal_fdi_source_preprobe : PACKAGE_SYSCONF_DIR "/hal/preprobe";
+		break;
 
-	return scan_fdi_files (source, d);
+	case DEVICE_INFO_TYPE_INFORMATION:
+		s = hal_fdi_source_information != NULL ? hal_fdi_source_information : PACKAGE_DATA_DIR "/hal/fdi";
+		break;
+
+	case DEVICE_INFO_TYPE_POLICY:
+		s = hal_fdi_source_policy != NULL ? hal_fdi_source_policy : PACKAGE_SYSCONF_DIR "/hal/policy";
+		break;
+
+	default:
+		HAL_ERROR (("Bogus device information type %d", type));
+		return FALSE;
+		break;
+	}
+
+	return scan_fdi_files (s, d);
 }
 
 /** @} */

Index: device_info.h
===================================================================
RCS file: /cvs/hal/hal/hald/device_info.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- device_info.h	3 Apr 2004 07:46:33 -0000	1.3
+++ device_info.h	24 Feb 2005 16:50:34 -0000	1.4
@@ -32,6 +32,12 @@
 
 #include "device_store.h"
 
-dbus_bool_t di_search_and_merge (HalDevice *d);
+typedef enum {
+	DEVICE_INFO_TYPE_PREPROBE,
+	DEVICE_INFO_TYPE_INFORMATION,
+	DEVICE_INFO_TYPE_POLICY
+} DeviceInfoType;
+
+dbus_bool_t di_search_and_merge (HalDevice *d, DeviceInfoType type);
 
 #endif				/* DEVICE_INFO_H */

Index: hald.c
===================================================================
RCS file: /cvs/hal/hal/hald/hald.c,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -d -r1.25 -r1.26
--- hald.c	11 Feb 2005 22:01:08 -0000	1.25
+++ hald.c	24 Feb 2005 16:50:34 -0000	1.26
@@ -54,7 +54,6 @@
 #include "device_info.h"
 #include "osspec.h"
 #include "hald_dbus.h"
-#include "hald_conf.h"
 #include "util.h"
 
 static void delete_pid(void) {
@@ -520,9 +519,6 @@
 	/* Finally, setup unix signal handler for TERM */
 	signal (SIGTERM, handle_sigterm);
 
-
-	hald_read_conf_file ();
-
 	/* set up the dbus services */
 	if (!hald_dbus_init ())
 		return 1;

--- hald.conf DELETED ---

--- hald_conf.c DELETED ---

--- hald_conf.h DELETED ---

Index: run-hald.sh
===================================================================
RCS file: /cvs/hal/hal/hald/run-hald.sh,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- run-hald.sh	16 Feb 2005 22:25:20 -0000	1.5
+++ run-hald.sh	24 Feb 2005 16:50:34 -0000	1.6
@@ -1,7 +1,9 @@
 #!/bin/sh
 
 export PATH=linux2:linux2/probing:linux2/addons:.:../tools:$PATH
-export HAL_FDI_SOURCE=../fdi
+export HAL_FDI_SOURCE_PREPROBE=../fdi/preprobe
+export HAL_FDI_SOURCE_INFORMATION=../fdi/information
+export HAL_FDI_SOURCE_POLICY=../fdi/policy
 ./hald --daemon=no --verbose=yes --retain-privileges
 #./hald --daemon=no --retain-privileges
 

Index: util.c
===================================================================
RCS file: /cvs/hal/hal/hald/util.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- util.c	14 Feb 2005 18:20:04 -0000	1.4
+++ util.c	24 Feb 2005 16:50:34 -0000	1.5
@@ -47,7 +47,6 @@
 #include "logger.h"
 #include "hald.h"
 #include "device_info.h"
-#include "hald_conf.h"
 
 #include "util.h"
 
@@ -916,7 +915,8 @@
 	guint next_program;
 
 	HalCalloutsDone callback;
-	gpointer userdata;
+	gpointer userdata1;
+	gpointer userdata2;
 
 } Callout;
 
@@ -939,18 +939,20 @@
 	/* Check if we're done */
 	if (c->programs[c->next_program] == NULL) {
 		HalDevice *d;
-		gpointer userdata;
+		gpointer userdata1;
+		gpointer userdata2;
 		HalCalloutsDone callback;
 
 		d = c->d;
-		userdata = c->userdata;
+		userdata1 = c->userdata1;
+		userdata2 = c->userdata2;
 		callback = c->callback;
 
 		g_strfreev (c->programs);
 		g_strfreev (c->extra_env);
 		g_free (c);
 
-		callback (d, userdata);
+		callback (d, userdata1, userdata2);
 
 	} else {
 		hal_util_helper_invoke (c->programs[c->next_program], c->extra_env, c->d, 
@@ -960,14 +962,16 @@
 }
 
 static void
-hal_callout_device (HalDevice *d, HalCalloutsDone callback, gpointer userdata, GSList *programs, gchar **extra_env)
+hal_callout_device (HalDevice *d, HalCalloutsDone callback, gpointer userdata1, gpointer userdata2, 
+		    GSList *programs, gchar **extra_env)
 {
 	Callout *c;
 
 	c = g_new0 (Callout, 1);
 	c->d = d;
 	c->callback = callback;
-	c->userdata = userdata;
+	c->userdata1 = userdata1;
+	c->userdata2 = userdata2;
 	c->programs = hal_util_dup_strv_from_g_slist (programs);
 	c->extra_env = g_strdupv (extra_env);
 	c->next_program = 0;
@@ -976,37 +980,55 @@
 }
 
 void
-hal_util_callout_device_add (HalDevice *d, HalCalloutsDone callback, gpointer userdata)
+hal_util_callout_device_add (HalDevice *d, HalCalloutsDone callback, gpointer userdata1, gpointer userdata2)
 {
 	GSList *programs;
 	gchar *extra_env[2] = {"HALD_ACTION=add", NULL};
 
 	if ((programs = hal_device_property_get_strlist (d, "info.callouts.add")) == NULL) {
-		callback (d, userdata);
+		callback (d, userdata1, userdata2);
 		goto out;
 	}	
 
 	HAL_INFO (("Add callouts for udi=%s", d->udi));
 
-	hal_callout_device (d, callback, userdata, programs, extra_env);
+	hal_callout_device (d, callback, userdata1, userdata2, programs, extra_env);
 out:
 	;
 }
 
 void
-hal_util_callout_device_remove (HalDevice *d, HalCalloutsDone callback, gpointer userdata)
+hal_util_callout_device_remove (HalDevice *d, HalCalloutsDone callback, gpointer userdata1, gpointer userdata2)
 {
 	GSList *programs;
 	gchar *extra_env[2] = {"HALD_ACTION=remove", NULL};
 
 	if ((programs = hal_device_property_get_strlist (d, "info.callouts.remove")) == NULL) {
-		callback (d, userdata);
+		callback (d, userdata1, userdata2);
 		goto out;
 	}	
 
 	HAL_INFO (("Remove callouts for udi=%s", d->udi));
 
-	hal_callout_device (d, callback, userdata, programs, extra_env);
+	hal_callout_device (d, callback, userdata1, userdata2, programs, extra_env);
+out:
+	;
+}
+
+void
+hal_util_callout_device_preprobe (HalDevice *d, HalCalloutsDone callback, gpointer userdata1, gpointer userdata2)
+{
+	GSList *programs;
+	gchar *extra_env[2] = {"HALD_ACTION=preprobe", NULL};
+
+	if ((programs = hal_device_property_get_strlist (d, "info.callouts.preprobe")) == NULL) {
+		callback (d, userdata1, userdata2);
+		goto out;
+	}	
+
+	HAL_INFO (("Preprobe callouts for udi=%s", d->udi));
+
+	hal_callout_device (d, callback, userdata1, userdata2, programs, extra_env);
 out:
 	;
 }

Index: util.h
===================================================================
RCS file: /cvs/hal/hal/hald/util.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- util.h	10 Feb 2005 17:03:57 -0000	1.3
+++ util.h	24 Feb 2005 16:50:34 -0000	1.4
@@ -102,10 +102,11 @@
 
 gchar **hal_util_dup_strv_from_g_slist (GSList *strlist);
 
-typedef void (*HalCalloutsDone) (HalDevice *d, gpointer userdata);
+typedef void (*HalCalloutsDone) (HalDevice *d, gpointer userdata1, gpointer userdata2);
 
-void hal_util_callout_device_add (HalDevice *d, HalCalloutsDone callback, gpointer userdata);
-void hal_util_callout_device_remove (HalDevice *d, HalCalloutsDone callback, gpointer userdata);
+void hal_util_callout_device_add (HalDevice *d, HalCalloutsDone callback, gpointer userdata1, gpointer userdata2);
+void hal_util_callout_device_remove (HalDevice *d, HalCalloutsDone callback, gpointer userdata1, gpointer userdata2);
+void hal_util_callout_device_preprobe (HalDevice *d, HalCalloutsDone callback, gpointer userdata1, gpointer userdata2);
 
 #define HAL_HELPER_TIMEOUT 10000
 




More information about the hal-commit mailing list