summaryrefslogtreecommitdiff
path: root/libhal-storage
AgeCommit message (Collapse)AuthorFilesLines
2006-09-11fix some compiler warningsDavid Zeuthen1-2/+2
2006-09-11replaced LIBHAL_FREE_DBUS_ERROR with dbus_error_free()Danny Kukawka1-1/+1
Replaced usage of macro LIBHAL_FREE_DBUS_ERROR with dbus_error_free(). NOTE: if you use dbus_error_is_set() to check if the error is set, you should not use LIBHAL_FREE_DBUS_ERROR to free the error. Better use dbus_error_free() directly in this case to avoid double call of dbus_error_is_set().
2006-09-11make Mount() support option remountDavid Zeuthen1-1/+3
Now we also export 'exec' as a valid mount option. This way, for example, g-v-m can now remount a removable storage device with 'exec' to e.g. run an autolauncher. Had to put an #error into a Solaris specific code path, should be easy to fix, sorry Artem.
2006-09-10add new partition probing code and adapt hal code to use itDavid Zeuthen2-26/+97
Added a new static library in partutil/ that serves two purposes 1. Probe for partition tables and the entries in them. This is done without any new dependencies and is in general efficient. Right now we understand Master Boot Record (and Extended MBR), GUID Partitioning Tables and Apple Partition Map. The interface is generic enough to add support for other disk labels too should the need arise. 2. Create partition tables, add partition table entries, alter partition table entries, delete partition table entries. This is done using libparted to ensure maximal robustness and correctness. Beware that libparted is kinda silly in a few ways, it probes all drives (even when asked to only look at one drive - the audicity!), and we have to poke at the internals to get/set vital raw properties. As such, we only officially support libparted 1.7.1 at this point. If you use anything else but that, you are on your own. We should start a dialouge with the libparted guys to make them export official API suitable for our needs. configure now takes a new --enable-parted and by default (for the upcoming 0.5.8 release), this is set to "no". As such, the upcoming 0.5.8 release will not depend on libparted. Also we now use this infrastructure in probe-volume and probe-storage to export the following new properties storage.partitioning_scheme (string) on storage devices and volume.partition.scheme (string) volume.partition.type (string) volume.partition.label (string) volume.partition.uuid (string) volume.partition.flags (strlist) on volumes. These new properties are also now exported through libhal-storage. Also moves some more code over to using LibHalChangeSet for nicer and much more efficient handling.
2006-08-19introduce some new properties for MS-DOS partition tablesDavid Zeuthen2-1/+47
Introduce volume.partition.msdos_part_table_start, .msdos_part_table_size, and storage.removable.media_size.
2006-08-12fix up how we handle non-partitioned volumesDavid Zeuthen2-0/+9
We used to only creat a fakevolume if a mountable file system was detected. This is wrong as you can have LUKS, RAID or LVM on the main block device and we should detect this just like we do on partitions. This patch fixes that. Second, assume a piece of media is all zero'ed out. Then, on insertion, we don't find anything on the main block device and neither does the kernel so no child block devices are created. Hence, HAL won't spit out any event when such media is inserted. And that, so far, is correct as we don't detect any useful volumes. However, it would be useful in e.g. a disk utility program to know if media is actually available or not. This patch introduces a new property called storage.removable.media_available that is TRUE if, and only if, we have detected media on the storage device. Also expose this new property in libhal-storage.
2006-08-06fixed several compiler warnings (warn_unused_result and format stuff)Danny Kukawka1-1/+1
This fixes several compiler warnings from warn_unused_result compiler flag and some "format '%*' expects type 'x', but argument z has type 'xy'" warnings on 64bit systems.
2006-08-02add properties required by a hypothetical disk utility and some bug fixesDavid Zeuthen2-1/+31
Don't mark device-mapper as volume.is_partition. Export new properties storage.size, volume.partition.start and volume.partition.media_size. Also define these in the spec. Actually make the existing functions libhal_volume_is_partition() and libhal_volume_get_partition_number() work. Also add a couple of new functions libhal_drive_get_size(), libhal_volume_get_partition_start_offset() and libhal_volume_get_partition_media_size().
2006-07-29Close memory leaks from not freed DBusError in libhal and libhal-storageDanny Kukawka1-13/+41
Added a macro to libhal to free a DBusError (including a check if the error was really set and a debug message if this is not the case) and closed several memory leaks in the libhal and libhal-storage library. Did some little cleanups in the libraries and fixed wrong displayed/returned DBusError in libhal_ctx_shutdown().
2006-07-29add *~ to all .gitignore files for emacs usersDavid Zeuthen1-0/+1
2006-07-27add .o files to .gitignoreKay Sievers1-0/+1
2006-07-27.cvsignore -> .gitignoreKay Sievers1-0/+0
2006-07-10fix typoKay Sievers1-1/+1
2006-07-10Fixed libhal_volume_get_size to return volume.size if available instead ofDanny Kukawka2-2/+17
compute the value from volume.block_size and volume.num_blocks which can be wrong values. Added slightly adopted patch from Wouter Paesen <wouter@kangaroot.net> to get disc_capacity of a volume via lib (fd.o bug #6496) fd.o bug #6496
2006-07-03set pointer adress to NULL after free()Danny Kukawka1-0/+3
Fixed some memory leaks.
2006-05-09added property for DVD+RW DL to specDanny Kukawka2-17/+20
reworked detection of device capabilities to get correct DVD-RW info and added DVD+RW DL detection. fixed mapping of return value of get_dvd_r_rw_profile() related to changes added property DVD+RW DL
2006-03-10Patch from Christian Neumair <chris@gnome-de.org>.David Zeuthen2-0/+9
Set FALSE for volume.is_mounted_read_only Extract volume.is_mounted_read_only (libhal_volume_is_mounted_read_only): New function Export prototype for libhal_volume_is_mounted_read_only() Set volume.is_mounted_read_only Document volume.is_mounted_read_only
2006-02-25Convert doc comments from Doxygen to gtk-docDavid Zeuthen2-20/+0
Convert doc comments from Doxygen to gtk-doc (not completely done) New file Remove Use gtk-doc instead of Doxygen Various cleanups; use gtk-doc instead of Doxygen Pass --enable-gtk-doc to configure. Add GTK_DOC_CHECK, from cairo, thanks.
2006-02-23Patch from Artem Kachitchkine <Artem.Kachitchkin@Sun.COM>, slightly tweakedDavid Zeuthen2-5/+89
by myself. Teach libhal-storage about Blu-ray and HD DVD.
2006-02-22Export prototypes for libhal_volume_crypto_get_clear_volume_udi andDavid Zeuthen2-0/+44
libhal_volume_crypto_get_backing_volume_udi New function (libhal_volume_crypto_get_backing_volume_udi): New function fix my commit entry for 2006-02-19 - missed changes to hald/hald_runner.c
2006-02-18Remeber to free structures; reported by Brendan Creane <bcreane@yahoo.com>.David Zeuthen1-0/+4
2006-02-16Forgot to set uuid, fsversion so libhal_volume_get_uuid(), get_fsversion()David Zeuthen1-0/+1
would always return NULL.
2006-02-16Forgot to set uuid so libhal_volume_get_uuid() would always return NULL.David Zeuthen1-0/+1
2006-01-15Respect volume.ignore and refuse to mount if set to TRUEDavid Zeuthen2-0/+13
Export libhal_volume_should_ignore as a public method (API addition, no breakage) New function. (libhal_volume_from_udi): Set vol->ignore_volume from property Introduce volume.ignore as a way for vendors and admins to signify a volume should be ignored. Add an entry for my Firewire card reader (yes, it works perfectly on my PB 12" G4 running Fedora Rawhide - it's fast too.. vroom vroom).
2006-01-15Auch, volume.fsusage may be an empty string and our string extraction macroDavid Zeuthen1-0/+1
then yields NULL. Hence vol->fsusage is never set and just left as a 0 from the memset meaning _USAGE_MOUNTABLE_FILESYSTEM. Thus, gnome-vfs thinks the volume is mountable and displays it. Fix this by initializing vol->fsuage to _USAGE_UNKNOWN.
2006-01-09added slightly adopted patch from Chris Spiegel <l@happyjack.org> to fixDanny Kukawka1-0/+2
fd.o bug #5279 (added NULL termination of array).
2005-11-02Update to Academic Free License 2.1. Also fix all C source and headerDavid Zeuthen2-2/+2
files.
2005-11-01fixed code documentation to remove warnings from doxygenDanny Kukawka1-1/+5
2005-08-10Actually export the right volume.fsusageDavid Zeuthen2-1/+22
2005-07-29The FSF moved to a new address, so I updated all license headers and theDavid Zeuthen1-1/+1
COPYING file. Patch from Danny Kukawka <danny.kukawka@web.de>.
2005-07-29Patch from Danny Kukawka <danny.kukawka@web.de>.David Zeuthen1-20/+19
this is a patch to fix typos of translatable strings. New translation files will follow due to end of August.
2005-07-22Here a little patch (against CVS) to fix several compiler warnings. PatchDavid Zeuthen1-2/+5
from Danny Kukawka <danny.kukawka@web.de>.
2005-07-21Move the LIBHAL_CHECK_LIBHALCONTEXT down to after declerations so we don'tDavid Zeuthen1-17/+21
depend on C99.
2005-07-21Patch from Danny Kukawka <danny.kukawka@web.de>: here the new patch with aDavid Zeuthen1-0/+20
macro instead of always the same codeblock in so many funtions.
2005-07-15I added support for detection of DVD+R Dual-Layer write support (new key:David Zeuthen2-5/+23
storage.cdrom.dvdplusrdl). Here a fix for DVD+R DL media in libhal_volume_policy_compute_display_name(). Patches from Danny Kukawka <danny.kukawka@web.de>.
2005-06-28Add new LibHalVolumeDiscType field LIBHAL_VOLUME_DISC_TYPE_DVDPLUSR_DL. AddDavid Zeuthen2-12/+18
new LibHalDriveBus field LIBHAL_DRIVE_BUS_CCW. Set drive->bus to LIBHAL_DRIVE_BUS_CCW if appropriate (libhal_volume_from_udi): Fix a bug: it's dvd_plus_[r|rw] not dvd_plus[r|rw]. Add support for dvd_plus_r_dl.
2005-06-21update this and add a bunch of other .cvsignore files. Patch from WilliamDavid Zeuthen1-0/+6
Jon McCann <mccannwj@pha.jhu.edu>.
2005-04-04Fix for when gettext is not available. From Steve GrubbDavid Zeuthen1-1/+1
<sgrubb@redhat.com>.
2005-02-26Add new LibHalDriveType entries for ZIP, JAZ and FLASH_KEY - the latterDavid Zeuthen2-20/+46
represents a USB memory stick. New function (libhal_drive_from_udi): Fixup new detection of cameras and musicplayers. Also handle storage.drive_type zip, jaz and flash_key and convert to LibHalDriveType as appropriate Fixup type for LibHalDeviceCondition Fix up condition handling now that it's a name and details string rather than a whole DBusMessage trailing off. Fix up a bunch of free's due to new memory ownership semantics in the new D-BUS (libhal_device_query_capability): Handle this now that capabilities is a strlist info.capabilities is now a strlist (hal_device_add_capability): -do- (hal_device_has_capability): -do- (hal_device_property_strlist_add): Return whether element was actually added New file New file New file
2005-02-16Fix up more sloppy errors incuded from patches that I should have reviewedDavid Zeuthen1-16/+18
more carefully :-/ Match against LIBHAL_PROPERTY_TYPE_*, not DBUS_TYPE_* (libhal_drive_policy_default_use_managed_keyword): (libhal_drive_policy_default_get_mount_root): (libhal_drive_policy_default_use_managed_keyword): (libhal_drive_policy_default_get_managed_keyword_primary): (libhal_drive_policy_default_get_managed_keyword_secondary): (libhal_drive_policy_get_mount_options): (libhal_volume_policy_get_mount_options): Yikes, Yikes, rename "/org/freedesktop/LibHal" back to "/org/freedesktop/Hal" p->type wasn't being assigned :-/. Also, DBUS_TYPE_BOOLEAN wasn't handled. Fix this test
2005-02-16Patch from John (J5) Palmieri <johnp@redhat.com>.David Zeuthen2-506/+540
Rename all functions, symbols and defines from hal_storage to libhal_storage. Update for changes in libhal-storage
2005-01-31Prebump to 0.5.0 - but we're not doing a release yet! Add libtoolDavid Zeuthen2-70/+101
versioning since libhal and libhal-storage are going to break API and ABI backwards compatibility. Add the beginnings of a test suite -do- Add build rules for test suite Update to use new libhal API. Update to use new libhal API. Update to use new libhal API. Update to use new libhal API. Update to use new libhal API. Update to use new libhal API. This library will also go through a renaming/cleanup before 0.5.0. Use library versioning Prefix all function names and other identifiers with libhal instead of hal. Add code for string lists. Change the way libhal is initialized to be a multistep process. Use HAL_PROPERTY_ TYPE_* instead of DBUS_TYPE_*. Make all functions using IPC take a DBusError argument for better error handling. Notable changes (libhal_device_get_all_properties): Teach this function about string lists (libhal_psi_get_strlist): New function (hal_initialize): Removed (hal_shutdown): Removed (libhal_device_get_property_strlist): New function (libhal_device_property_strlist_append): New function (libhal_device_property_strlist_prepend): New function (libhal_device_property_strlist_remove_index): New function (libhal_device_property_strlist_remove): New function (libhal_ctx_new): New function (libhal_ctx_set_cache): New function (libhal_ctx_set_dbus_connection): New function (libhal_ctx_init): New function (libhal_ctx_shutdown): New function (libhal_ctx_free): New function (libhal_ctx_set_device_added): New function (libhal_ctx_set_device_removed): New function (libhal_ctx_set_device_new_capability): New function (libhal_ctx_set_device_lost_capability): New function (libhal_ctx_set_device_property_modified): New function (libhal_ctx_set_device_condition): New function Use library versioning Port to new libhal API Rename property types to HAL_PROPERTY_TYPE_*. Add prototypes for new string list properties. Rename property types to HAL_PROPERTY_TYPE_*. (hal_property_free): Teach this function about string lists. (hal_property_new_strlist): New function (hal_property_get_strlist): New function (hal_property_strlist_append): New function (hal_property_strlist_prepend): New function (hal_property_strlist_remove_elem): New function (hal_property_strlist_add): New function (hal_property_strlist_remove): New function Rename property types to HAL_PROPERTY_TYPE_*. Add new ugly code to handle string lists with the current D-BUS. (device_string_list_append_prepend): New function (hald_dbus_filter_function): Rename from filter_function. Add handlers for new D-BUS methods. Export this function Rip out persistent property code. Rename property types to HAL_PROPERTY_TYPE_*. Rename to property to HAL_PROPERTY_TYPE_*. Rip out persistent property code. (hal_device_property_get_as_string): Add code for strlist type (hal_device_property_get_strlist): New function (hal_device_property_strlist_append): New function (hal_device_property_strlist_prepend): New function (hal_device_property_strlist_remove_elem): New function (hal_device_property_strlist_add): New function (hal_device_property_strlist_remove): New function Add new strlist prototypes Remove for now as persistent properties needs to be reworked
2005-01-25Add HAL_INFO's around coldplug event synthesization so we can see how longDavid Zeuthen1-19/+36
it takes. Undefine HAL_COLDPLUG_VERBOSE by default to reduce log spamming. Merge the changes applied to the hal-0_4-stable-branch yesterday Remove debugging fprintf's Also remove mount options if something is set to FALSE (based on patch from Sebastian Dransfeld <sebastid@stud.ntnu.no>; also fix a pretty bad bug where the computation of is_imply_opt were totally wrong. (hal_volume_policy_get_mount_options), (hal_drive_policy_get_mount_options): Collect imply options in the correct order now that mopts_collect is fixed : -do-
2004-12-14Merged all changes from the stable branch so HEAD is on par.David Zeuthen2-2/+17
2004-10-18New convenience function (hal_drive_policy_get_mount_options): Ensure thatDavid Zeuthen1-71/+64
'pamconsole', 'user', 'users' and 'console' before any other option as an intricate detail of the mount program require that e.g. exec is after each of these as they imply e.g. noexec. (hal_volume_policy_get_mount_options): -do-
2004-10-14Add fstab-sync.8 to AC_OUTPUTDavid Zeuthen1-4/+8
New file, example New file, example Dist and install two new .fdi files Fix a typo in a comment New function (scan_fdi_files): Use my_alphasort to sort in the right order. Process all .fdi files instead of bailing out on the first match. New function, copied over from tools/fstab-sync.c (not currently used) (osspec_probe): Use get_selinux_removable_context (not currently used) Check if mount_option property is actually FALSE. (hal_volume_policy_get_mount_options): Same Check if object to free is NULL and just return. Allows hal_free_property_set (NULL). Add rules for building fstab-sync.8 man page New file Much rewritten to use libhal-storage and the new policy properties. See diff for details.
2004-10-13Add docs for is_ascii attribute on the match directive.David Zeuthen2-3/+235
Don't add volume policy if the drive has the no_partitions_hint set to TRUE. Require label to be ASCII if using the label as a mount point. Use whitelist of msdos partition types if volume stems from a drive with a msdos partition table. Add the is_ascii match check. Free newly added fields (hal_volume_free): Free newly added fields (hal_drive_from_udi): Add should_mount, mount_filesystem, desired_mount_point properties (hal_volume_from_udi): Add should_mount, mount_filesystem, desired_mount_point properties (hal_drive_policy_default_get_mount_root): New function (hal_drive_policy_default_use_managed_keyword): New function (hal_drive_policy_default_get_managed_keyword_primary): New function (hal_drive_policy_default_get_managed_keyword_secondary): New function (hal_drive_policy_is_mountable): New function (hal_drive_policy_get_desired_mount_point): New function (hal_drive_policy_get_mount_options): New function (hal_drive_policy_get_mount_fs): New function (hal_volume_policy_is_mountable): New function (hal_volume_policy_get_desired_mount_point): New function (hal_volume_policy_get_mount_options): New function (hal_volume_policy_get_mount_fs): New function (hal_drive_no_partitions_hint): New function Add prototypes for new functions
2004-10-08look for BLKGETSIZE64 to be provided. From Jonathan BlandfordDavid Zeuthen1-1/+1
<jrb@gnome.org> Only use one underscore, not two. Reported by Jérôme Lodewyck <lodewyck@clipper.ens.fr>.
2004-09-27Remember to init error varDavid Zeuthen2-0/+21
Add a whitelist so if a volume stems from a msdos style partition table we require that type to be in the whitelist; initially includes various FAT formats, NTFS and Linux. (volume_new): Fix a bug in size computation Add prototype for hal_volume_get_msdos_part_table_type New function Rename x86_type to msdos_part_table_type Fixup URL
2004-09-24Added fr to ALL_LINGUASDavid Zeuthen2-2/+31
Added french translations from Jérôme Lodewyck <lodewyck@clipper.ens.fr> Add prototypes for new functions hal_drive_(requires_eject|get_dedication_icon_(drive|volume)). Remove printf debug statement. (hal_drive_get_dedicated_icon_drive): New function (hal_drive_get_dedicated_icon_volume): New function (hal_drive_from_udi): Read storage.icon.* and storage.requires_eject (hal_drive_requires_eject): New function Add and set boolean property storage.requires_eject; right now we only add it for optical drives. Interestingly enough, my iPod Mini requires to be ejected as well (see RH bug #132195 for some discussion). Add docs for storage.requires_eject, storage.icon.drive and storage.icon.volume