summaryrefslogtreecommitdiff
path: root/hald/linux2
AgeCommit message (Collapse)AuthorFilesLines
2006-08-21move hald/linux2 to hald/linux and renamed backendDanny Kukawka45-16316/+0
Since there is no longer a hald/linux dir in the repository, we can move hald/linux2 to hald/linux and rename the related HALD_BACKEND to linux.
2006-08-21fix overseen left dbg() calls in probe-{storage,volume}.cDanny Kukawka2-5/+5
Replaced left dbg() calls in probe-storage.c and probe-volume.c with HAL_DEBUG().
2006-08-21remove shared.h for addons/prober and some little fixesDanny Kukawka22-484/+304
This remove hald/linux2/probing/shared.h for better reuse of related functions and to avoid compiler warnings about defined but unused functions. Major changes: * removed shared.h and switched addons and prober to use with logger.[c,h] the same functions and format as the hal daemon. * split off powermanagement related code from util.c/h to a new file util_pm.[c,h]. * added a new file util_helper.[c,h] to collect functions drop_privileges() and hal_set_proc_title*(). * removed unused function strdup_valid_utf8() from probe-storage.c and updated hal_util_strdup_valid_utf8() to do the same as strdup_valid_utf8() before. * fixed compiler warning in ids.c (use now *_ids_free() functions instead of call free() directly without checks). * fixed compiler warning in addon-macbookpro-backlight.c (added '#if 0' around unused function)
2006-08-21properly convert mAh to mWh rather than uWhRichard Hughes1-12/+12
We should convert the mAh reading (battery.reporting.rate) into mWh (battery.charge_level.rate) by multiplying it by the voltage (in Volts), but we are multiplying it by the voltage in mV, and so the rate information is a factor of 3 too large. This *really* breaks calculating the time for multibattery laptops.
2006-08-19Merge branch 'master' of ssh://david@git.freedesktop.org/git/halDavid Zeuthen25-388/+181
2006-08-19introduce some new properties for MS-DOS partition tablesDavid Zeuthen3-12/+70
Introduce volume.partition.msdos_part_table_start, .msdos_part_table_size, and storage.removable.media_size.
2006-08-17reduce useless changes on APM battery.remaining_timeDanny Kukawka1-4/+19
Changed update property battery.remaining_time on APM to avoid change the value every 2 seconds. APM calculate with each poll a new value for remaining battery time, which could result in high dbus load if a application listen for the event and check do something over the bus. On the other side the remaining time from the APM interface is not trustworthy on the most machines if you poll to often, increase the poll intervall (and emit a new value to HAL) should smooth the time curve and reduce back and forth jumping values. Now the value is updated ever 30 seconds, this should preduce the needless events.
2006-08-16add more scsi.type mapping and add property info to specDanny Kukawka1-13/+28
Added missing scsi.type mappings which are e.g. needed to identify scsi printer/scanner or media changer/raid devices. Added also the property information about scsi.type to the spec. Mapping of kernel types is: TYPE_DISK, TYPE_MOD, TYPE_RBC --> disk TYPE_TAPE --> tape TYPE_PROCESSOR --> processor TYPE_WORM, TYPE_ROM --> cdrom TYPE_SCANNER --> scanner TYPE_MEDIUM_CHANGER --> medium_changer TYPE_COMM --> comm TYPE_RAID --> raid
2006-08-16cleanup includes in hald/linux2/*Danny Kukawka25-258/+132
This cleanup the includes in the files under hald/linux/ . I removed not needed and multiple included headers (-120 includes) and sorted/arranged the remaining includes alphabetically.
2006-08-15fixed build of HALDanny Kukawka1-1/+1
Replaced in blockdev.c is_mounted_by_hald() with hal_util_is_mounted_by_hald and included <sys/file.h> in utils.c for flock(). NOTE: Please run make or make dist before commit.
2006-08-14share is_mounted_by_hald() and non-gcc nitsArtem Kachitchkine1-112/+1
Moved linux2/blockdev.c:is_mounted_by_hald() to util.c:hal_util_is_mounted_by_hald() so all backends can use it. Fixed some compilation warnings when compiling with non-GNU compiler and libc.
2006-08-12fix up how we handle non-partitioned volumesDavid Zeuthen3-6/+26
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-07add API to hald (and libhal) to change multiple properties at onceDavid Zeuthen1-68/+81
Also converted probe-volume to use this new API.
2006-08-06actually remove the ide-cs special handling codeDavid Zeuthen1-106/+0
2006-08-06fix removal of fakevolume objects and remove special handling for ide-csDavid Zeuthen2-7/+52
It appears that ide-cs in the Linux kernel finally got fixed, see https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=130232 for details. So remove some code to make our handling of block devices more robust. Also add a note about it would be nice to add > 1 fakevolume objects for multisession / partitioned optical discs.
2006-08-06set proc title for acpi/hid-ups/usb-csr addonsDanny Kukawka3-0/+14
This patch sets the proc title for this addons: * hald-addon-acpi: add the current source of ACPI events * hald-addon-hid-ups: add "listening on $device_file" * hald-addon-usb-csr: add "listening on '$info.product'"
2006-08-06fixed several compiler warnings (warn_unused_result and format stuff)Danny Kukawka1-4/+4
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-04sleep before looking for slaves/ in sysfs for device mapperDavid Zeuthen1-1/+15
Also make a note that this is a hack and that it can go away once the patch for device mapper in the kernel emitted "changed" is in a relased kernel.
2006-08-04use a more robust way of detecting partitions and fix block.is_volumeDavid Zeuthen3-17/+15
2006-08-04fix up device mapper device handlingDavid Zeuthen3-7/+19
2006-08-03fix device mapper block device handling as last commit broke thisDavid Zeuthen1-1/+4
Introduce new property volume.linux.is_device_mapper and check for this on remove events to avoid looping in hotplug remove.
2006-08-02add properties required by a hypothetical disk utility and some bug fixesDavid Zeuthen1-4/+39
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-08-02add support for Xen devicesMark McLoughlin1-0/+66
Add a xen namespace to the spec and make HAL recognize bus devices exported by Xen. This patch comes from Mark McLoughlin. Fixed freedesktop.org bug #7521.
2006-08-02fixed compiler warnings and added doc/api/tmpl/.gitignoreDanny Kukawka2-0/+2
Fixed compiler warnings because of missing include of string.h and added doc/api/tmpl/.gitignore.
2006-07-29introduce new option --disable-policy-kit and streamline the buildDavid Zeuthen3-9/+9
You explicitly have to pass --disable-policy-kit to configure and/or autogen.sh and if you do, a big fat warning will be displayed: NOTE: WARNING! WARNING! WARNING! PolicyKit is not enabled. HAL will allow any user to invoke any method. THIS IS A SECURITY RISK. Use this only if you really know what you are doing. Bugs, security issues and similar filed against HAL versions built without PolicyKit may be ignored by the HAL maintainers. Disable PolicyKit usage only if you really know what you are doing. This option might be removed in the future. Also clean up the build system by removing PACKAGE_CFLAGS and PACKAGE_LIBS. Binaries now have to specify exactly what libs they want.
2006-07-29add *~ to all .gitignore files for emacs usersDavid Zeuthen3-0/+3
2006-07-28Check for the new suspend2 sysfs location. Advised by Nigel Cunningham, many ↵Richard1-0/+2
thanks.
2006-07-27Change license of hald/linux2/blockdev.c to GPL only as I justDavid Zeuthen1-2/+0
introduced some copy-pasted LGPL code.
2006-07-27Fix up LUKS stuff by using new kernel feature in Linux 2.6.17.David Zeuthen2-76/+147
Use slaves/ directory in sysfs to figure out whether we set up a LUKS partition - enables us to remove a gross hack. Remove sleep3 after cryptsetup as it's no longer needed due to use fixing this right. Remove defunct hal-luks-remove.in file.
2006-07-27(forgot to pass -a the first time) git stuff, mount/umount/eject allDavid Zeuthen6-39/+522
in C, .hal-mtab usage, light_sensor and keyboard_backlight additions including example. Remove ChangeLog and add rules to Makefile.am (from cairo) to generate the ChangeLog file from git history. Add support for light_sensor and keyboard_backlight on my Macbook Pro. Add an examply python script to examples/ to show how it's done. Move Unmount, Eject and related stuff to C. Start using the file /media/.hal-mtab instead of .created-by-hal to specify if HAL created the mount point. Also list tons of metadata such as uid, session id (still unused). Fixes the bug where the unprivileged hald couldn't look into /media/foobar/ for the .created-by-hal file. So now doing 'umount /dev/sda1' on a volume mounted by HAL, makes hald remove the mount point as one would expect.
2006-07-27add .o files to .gitignoreKay Sievers3-0/+3
2006-07-27.cvsignore -> .gitignoreKay Sievers3-0/+0
2006-07-26fixed compiler warning about incompatible pointer typesDanny Kukawka1-0/+1
include ctype.h to fix compiler warning
2006-07-11If HAL finds already created partitions, it will not longer probe for aKay Sievers1-2/+31
filesystem on the disk. This should work with kernel 2.6.17.
2006-07-10Depend on external shared version of libvolume_id.Kay Sievers3-43/+175
2006-07-10Prepare for new class devices showing up in /sys/devices instead ofKay Sievers1-29/+90
/sys/class.
2006-07-10set volume.block_size for blank CD/DVD to 0 to avoid stange values forDanny Kukawka1-0/+2
volume size if volume.block_size and volume.num_blocks.
2006-06-09Update these with the new files to keep cvs diff happy.Richard Hughes1-0/+1
2006-06-09Adds code so addons can claim interfaces and handle the methods on them inDavid Zeuthen2-0/+264
the addon daemon code. The example here is setting the LCD backlight on a Macbook Pro. Actual code for setting the backlight is based on code from Nicolas Boichat found on the mactel-linux mailing list. New file. Bugfix so the right backend script is invoked. Add prototype for libhal_device_claim_interface(). New function. Add rules for hald-addon-macbookpro-backlight. Only allow helpers, e.g. only messages from direct connections. (device_claim_interface): New function to handle the ClaimInterface() method (do_introspect): Include introspection XML for ClaimInterface() and the introspection XML returned by ClaimInterface() invocations. (reply_from_fwd_message): New function (hald_dbus_filter_handle_methods): Handle ClaimInterface() and forward messages to the claimed interfaces on the appropriate objects. (local_server_message_handler): Forward signals from helpers onto the system message bus and DTRT when a helper disconnects. New function. One can now do a <spawn udi="foo"> to spawn a child device. See the fdi file below for usage. (start, spawned_device_callouts_add_done, end): Handle spawning device objects in response to <spawn>. Add rules for matching the Macbook Pro in order to spawn a new device object with an addon for handing methods on the org.fd.H.D.LaptopPanel interface. Allow some interfaces to also emit signals. Check for libpci so we can use it as an optional dependency.
2006-06-06Set capability volume.disc as required by the spec. Patch from Kevin OttensDavid Zeuthen1-0/+3
<ervin@kde.org>.
2006-05-25removed net.interface_up property because we never refresh the value, sinceDanny Kukawka1-1/+0
this info is gone into NetworkMananger and removed from HAL (see fd.o bug #6233). changed net.interface_up to not mandatory
2006-05-21Fixed mapping of system.formfactor from smbios.chassis.type. Added a checkDanny Kukawka1-59/+64
if the key is already set to avoid overwrite values e.g. set in the ACPI/APM/PMU code. Added check for exit_type to skip mapping if execution of the smbios prober failed. (osspec_probe): Removed set default value for system.formfactor for all cases and readded to case if !should_decode_dmi is set.
2006-05-19Don't stat autofs mounts. Patch from John (J5) Palmieri <johnp@redhat.com>.David Zeuthen1-1/+39
2006-05-12removed (again) unneeded code and validate the returned string directly.Danny Kukawka1-3/+1
2006-05-12In Ubuntu we got several bug reports about device label gibberish, forDavid Zeuthen1-1/+12
example: https://launchpad.net/bugs/27897. This happens if the label is either truly bogus, or in a non-UTF-8 compatible encoding. The blunt solution would be to just ignore any non-UTF-8 labels, but since it might be preferable to retain labels which are only 'lightly' damaged (maybe one Umlaut in an otherwise valid string), I wrote a small patch to ignore invalid labels if they contain more than 20% illegal characters. Patch from Martin Pitt <martin@piware.de>.
2006-05-10replaced fprintf () with dbg ()Danny Kukawka1-6/+6
2006-05-10removed unneeded code and validate the returned string directly.Danny Kukawka1-3/+2
validate the returned string and not the original, which we duplicated for return.
2006-05-09Added support for --use-syslog option to prober and addons. This shouldDanny Kukawka13-34/+36
allow easy logging complete hal debug information to syslog if hald run in daemon mode: added HALD_USE_SYSLOG to env added support for HALD_USE_SYSLOG Replaced in prober and addons old debug code with support for --use-syslog instead of log to sterr. also fixed set debug option before use dbg() the first time replaced printf with dbg() and removed some needless debug lines.
2006-05-09fixed problem with parse information from output of dmidecode where theDanny Kukawka1-1/+1
search string is shorter than 7 chars: replaced in strbegin() 'sizeof(char *) -1' (which returns the size of the pointer) with 'strlen(char *)' which returns the size of the string.
2006-05-09added property for DVD+RW DL to specDanny Kukawka3-46/+46
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