hal/tools Makefile.am,1.8,1.9 fstab-sync.c,1.13,1.14
David Zeuthen
david at freedesktop.org
Wed Aug 25 13:55:15 PDT 2004
- Previous message: hal/hald/linux class_device.c, 1.26, 1.27 common.h, 1.8,
1.9 osspec.c, 1.34, 1.35
- Next message: hal ChangeLog,1.258,1.259 configure.in,1.34,1.35
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /cvs/hal/hal/tools
In directory gabe:/tmp/cvs-serv31962/tools
Modified Files:
Makefile.am fstab-sync.c
Log Message:
2004-08-25 David Zeuthen <david at fubar.dk>
* configure.in: Add option for new callout hal-hotplug-map
* hald/device.[ch]: Add the "cancelled" signal and hal_device_cancel
method
* hald/hald.c (main): Avoid daemonization for now; will make hald
hang if anything fails up-until device probing (RH bug 130849)
* hald/linux/class_device.c (class_device_got_device_file):
Cancel the device if don't get the device file
* hald/linux/common.h: Increase timeout to 60 secs. Make note
about we really need the SEQNUM support in udev
* hald/linux/osspec.c:
(process_coldplug_list_device_cancelled): New function
(process_coldplug_list): Add support for cancelling
(reenable_hotplug_proc_on_device_cancel): New function
(hald_helper_hotplug): Add support for cancelling
(hotplug_sem_up): Add some helpful debug
(hotplug_sem_down): Add some helpful debug
(hald_helper_data): Add some helpful debug
* tools/Makefile.am: Also remove callout on uninstall
* tools/fstab-sync.c:
(fs_table_remove_volume): Only require device_file not complete Volume
object
(remove_udi): Don't require storage device to be present (fixes some
problems when unplugging unpartitioned media as we don't get hotplug
event and things are thus not serialised)
* tools/linux/Makefile.am: Build and, optionally, install
hal-hotplug-map callout
* tools/linux/hal_hotplug_map.c: New program; a tad Red Hat specific
wrt. file locations; patches are welcome. The single purpose of
this callout is to detect gphoto2 supported cameras and libsane
supported scanners using usermap files in /etc/hotplug.
Index: Makefile.am
===================================================================
RCS file: /cvs/hal/hal/tools/Makefile.am,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- Makefile.am 23 Aug 2004 18:44:23 -0000 1.8
+++ Makefile.am 25 Aug 2004 20:55:13 -0000 1.9
@@ -13,8 +13,7 @@
sbin_PROGRAMS = fstab-sync
lshal_SOURCES = lshal.c
-lshal_LDADD = @PACKAGE_LIBS@ \
- $(top_builddir)/libhal/libhal.la
+lshal_LDADD = @PACKAGE_LIBS@ $(top_builddir)/libhal/libhal.la
hal_get_property_SOURCES = hal_get_property.c
hal_get_property_LDADD = @DBUS_LIBS@ $(top_builddir)/libhal/libhal.la
@@ -29,8 +28,11 @@
install-data-local :
$(mkinstalldirs) $(DESTDIR)$(SYSCONFDIR)/hal/device.d
- cd $(DESTDIR)$(SYSCONFDIR)/hal/device.d && $(LN_S) $(sbindir)/fstab-sync 50-fstab-sync.hal
+
+uninstall-local :
+ - rm -f $(DESTDIR)$(SYSCONFDIR)/hal/device.d/50-fstab-sync.hal
endif
-## FSTAB_SYNC_INSTALL end
+## FSTAB_SYNC_ENABLED end
clean-local :
rm -f *~
Index: fstab-sync.c
===================================================================
RCS file: /cvs/hal/hal/tools/fstab-sync.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- fstab-sync.c 23 Aug 2004 14:40:55 -0000 1.13
+++ fstab-sync.c 25 Aug 2004 20:55:13 -0000 1.14
@@ -85,7 +85,7 @@
#define FALSE !TRUE
#endif
-#define fstab_update_debug(...) if (verbose) fprintf (stderr, __VA_ARGS__)
+#define fstab_update_debug(...) do {if (verbose) fprintf (stderr, __VA_ARGS__);} while (0)
/** This structure represents either a volume with a mountable filesystem
@@ -172,7 +172,7 @@
static void volume_free (Volume *volume);
static boolean create_mount_point_for_volume (Volume *volume);
static boolean fs_table_add_volume (FSTable *table, Volume *volume);
-static FSTableLine *fs_table_remove_volume (FSTable *table, Volume *volume);
+static FSTableLine *fs_table_remove_volume (FSTable *table, const char *volume);
static boolean fs_table_line_has_mount_option (FSTableLine *line, const char *option);
static boolean add_udi (const char *udi);
@@ -1269,7 +1269,7 @@
* removed for convenience (a bit strange, I know)
*/
static FSTableLine *
-fs_table_remove_volume (FSTable *table, Volume *volume)
+fs_table_remove_volume (FSTable *table, const char *block_device)
{
FSTableLine *line, *previous_line;
@@ -1278,7 +1278,7 @@
while (line != NULL)
{
if (line->block_device != NULL
- && strcmp (line->block_device, volume->block_device) == 0
+ && strcmp (line->block_device, block_device) == 0
&& fs_table_line_is_generated (line))
{
if (previous_line == NULL)
@@ -1440,24 +1440,25 @@
static boolean
remove_udi (const char *udi)
{
- Volume *volume;
+ char *block_device;
FSTable *fs_table = NULL;
FSTableLine *line = NULL;
char *temp_filename = NULL;
time_t fstab_modification_time;
int fd;
+ boolean is_volume;
+
+ is_volume = hal_device_query_capability (hal_context, udi, "volume");
/* don't remove the fstab entry if we were spawned of a device with
* storage.no_partitions_hint set to TRUE. Per the spec this is
- * exactly when block.no_partitions is TRUE on the volume */
- if (hal_device_query_capability (hal_context, udi, "volume") &&
- hal_device_get_property_bool (hal_context, udi, "block.no_partitions"))
+ * exactly when block.no_partitions is TRUE on the volume. E.g.
+ * floppies and optical discs
+ */
+ if (is_volume && hal_device_get_property_bool (hal_context, udi, "block.no_partitions"))
return FALSE;
- volume = volume_new (udi);
-
- if (volume == NULL)
- return FALSE;
+ block_device = hal_device_get_property_string (hal_context, udi, "block.device");
fs_table = fs_table_new (_PATH_FSTAB);
@@ -1471,13 +1472,13 @@
if (fstab_modification_time == 0)
goto error;
- line = fs_table_remove_volume (fs_table, volume);
+ line = fs_table_remove_volume (fs_table, block_device);
if (line == NULL)
{
fstab_update_debug (_("%d: Could not remove device '%s' with UDI '%s' from "
"fs table: not found\n"),
- pid, volume->block_device, udi);
+ pid, block_device, udi);
goto error;
}
@@ -1500,7 +1501,7 @@
{
close (fd);
unlink (temp_filename);
- volume_free (volume);
+ free (block_device);
return remove_udi (udi);
}
@@ -1512,11 +1513,11 @@
}
fstab_update_debug (_("%d: removed mount point for device '%s'\n"),
- pid, volume->block_device);
- syslog (LOG_INFO, _("removed mount point %s for %s"), line->mount_point, volume->block_device);
+ pid, block_device);
+ syslog (LOG_INFO, _("removed mount point %s for %s"), line->mount_point, block_device);
close (fd);
- volume_free (volume);
+ free (block_device);
fs_table_line_free (line);
return TRUE;
@@ -1525,7 +1526,7 @@
if (fd >= 0)
close (fd);
- volume_free (volume);
+ free (block_device);
if (temp_filename != NULL)
unlink (temp_filename);
- Previous message: hal/hald/linux class_device.c, 1.26, 1.27 common.h, 1.8,
1.9 osspec.c, 1.34, 1.35
- Next message: hal ChangeLog,1.258,1.259 configure.in,1.34,1.35
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the hal-commit
mailing list