platform/upstream/udisks2.git
13 years agoAlso export UDISKS_DM_TARGET_PARAMS for 'multipath' target
David Zeuthen [Fri, 1 Oct 2010 16:02:24 +0000 (12:02 -0400)]
Also export UDISKS_DM_TARGET_PARAMS for 'multipath' target

This is safe - no key material or similar is ever exported
cf. CVE-2010-1149. Additionally, this unbreaks multipath support, see

http://people.freedesktop.org/~david/multipath-restored.png

Signed-off-by: David Zeuthen <davidz@redhat.com>
13 years agotestsuite: Move to scsi_debug
Martin Pitt [Wed, 29 Sep 2010 11:50:17 +0000 (13:50 +0200)]
testsuite: Move to scsi_debug

Drop the usage of loop devices and move to scsi_debug. This provides much more
realistic behaviour (such as partitioning) and avoids using a kind of device
which udisks special-cases. scsi_debug fake devices can also be forcibly
removed (unlike loop and md), thus we can write test cases to check the cleanup
in this case.

Since scsi_debug only provides one (independent) test device, reorganize the
code a little to either just use one that one device (for most tests such as FS
or Smart), or use two partitions on that (for the LVM PVs).

Drop the "Loop" test case; it is not that interesting.

13 years agoFix creating NTFS on raw devices
Martin Pitt [Tue, 28 Sep 2010 07:53:20 +0000 (09:53 +0200)]
Fix creating NTFS on raw devices

Similarly to the other file systems, add a -F option to mkntfs, to avoid
failing on "this is not a partition blabla".

13 years agoFix mkfs.ext* arguments
Martin Pitt [Mon, 27 Sep 2010 18:40:22 +0000 (20:40 +0200)]
Fix mkfs.ext* arguments

Pass exactly one -F argument to mkfs.ext*, not one for each D-BUS method option
that we got (which meant none at all if there were no options). This fixes
creating ext* file systems on unpartitioned devices when supplying no option.

13 years agotestsuite: LVM: fix naming assumptions
Martin Pitt [Mon, 27 Sep 2010 15:05:20 +0000 (17:05 +0200)]
testsuite: LVM: fix naming assumptions

The LVM tests previously assumed that LVM devices had their primary device node
in /dev/mapper/. However, under the current udev rule device names should match
the kernel name, i. e. /dev/dm-*, and /dev/mapper/ should merely contain
symlinks.

Drop the /dev/mapper/* assumptions and just check whether there is a by-id/
symlink with the LV name.

13 years agotestsuite: Fix SMART test for SSDs
Martin Pitt [Mon, 27 Sep 2010 14:43:55 +0000 (16:43 +0200)]
testsuite: Fix SMART test for SSDs

SSDs do not have a "start-stop-count" (at least mine doesn't). Use
"power-on-hours" in the test suite instead.

13 years agotestsuite: fix race with SMART data
Martin Pitt [Mon, 27 Sep 2010 13:20:35 +0000 (15:20 +0200)]
testsuite: fix race with SMART data

On fast machines, the Smart.test_0_hd_status progresses too fast for the SMART
data to be collected at the time when its properties are tested. Now wait for
the data to become available.

13 years agoBug 30332 — udisks does not tear down LUKS devices when the slave is forcibly removed
Mathieu Trudel-Lapierre [Mon, 27 Sep 2010 12:52:26 +0000 (14:52 +0200)]
Bug 30332 — udisks does not tear down LUKS devices when the slave is forcibly removed

In the event of the forced removal of a crypto device, use the luks_holder
property since it is still available to figure out which underlying cleartext
LUKS device to teardown, instead of scanning through all available devices
(because the cleartext device already has had its properties cleaned up).

Signed-off-by: Martin Pitt <martin.pitt@ubuntu.com>
13 years agoprofile.h: Add missing include
Martin Pitt [Tue, 24 Aug 2010 12:44:31 +0000 (14:44 +0200)]
profile.h: Add missing include

access() and F_OK are defined in unistd.h. Not strictly necessary for udisks
itself, but easier for stealing the file for other projects.

13 years agoFix btrfs properties
Martin Pitt [Sun, 15 Aug 2010 15:39:42 +0000 (17:39 +0200)]
Fix btrfs properties

Fix the maximum label size, and availability for online resizing. Thanks Chris
Ball!

13 years agoBug 26258 — initial btrfs support
Martin Pitt [Sun, 15 Aug 2010 15:34:34 +0000 (17:34 +0200)]
Bug 26258 — initial btrfs support

Add basic support for creating and checking btrfs. This does not yet support
spanning multiple devices, RAID, etc.

We disable online fsck for now. It works, but is said to be too unstable still.

Also bump the size of the loop devices in the test suite, since btrfs needs at
least 256 MB.

13 years agoAdd nilfs2 file system support
Jiro SEKIBA [Sun, 15 Aug 2010 15:23:39 +0000 (17:23 +0200)]
Add nilfs2 file system support

This needs util-linux-ng > 2.18.

Signed-off-by: Martin Pitt <martin.pitt@ubuntu.com>
14 years agoAdd udisks --eject option
Matt Zimmerman [Mon, 28 Jun 2010 09:05:58 +0000 (11:05 +0200)]
Add udisks --eject option

As a companion to --mount, --unmount, and --detach, it's useful for testing and
provides a policykit-authenticated alternative to eject(1).

Signed-off-by: Martin Pitt <martin.pitt@ubuntu.com>
14 years agoBug 28075 — Do not have files executable on NTFS
Martin Pitt [Thu, 3 Jun 2010 10:09:29 +0000 (12:09 +0200)]
Bug 28075 — Do not have files executable on NTFS

Set fmask on NTFS devices to avoid having files being executable. This provides
a better default for almost all NTFS use cases under Linux, and avoids
confusing "show or execute?" questions in nautilus.

This is similar to what commit 7e7ec1 did for vfat, except that NTFS does not
have this handy "showexec" option.

14 years agoFix long hangs on probing nonexistant floppy drives
Martin Pitt [Wed, 2 Jun 2010 13:56:07 +0000 (15:56 +0200)]
Fix long hangs on probing nonexistant floppy drives

A lot of modern machines do not have a floppy drive any more, but still have a
floppy controller somewhere (or at least the BIOS pretends to). Trying to
open(/dev/fd0) on these machines causes long hangs, which lead to long desktop
startup times.

To fix this, avoid probing floppies for media in update_info().

https://launchpad.net/bugs/539515

14 years agoAvoid using entities in introspection XML
David Zeuthen [Tue, 1 Jun 2010 21:22:38 +0000 (17:22 -0400)]
Avoid using entities in introspection XML

Unfortunately GMarkup doesn't understand entities so
gdbus-binding-tool will not work with these XML files without this
patch.

14 years agoDon't probe non-data discs for partition tables
David Zeuthen [Tue, 25 May 2010 14:59:01 +0000 (10:59 -0400)]
Don't probe non-data discs for partition tables

Suggested by Kay Sievers. This is related to
https://bugzilla.kernel.org/show_bug.cgi?id=15757

Signed-off-by: David Zeuthen <davidz@redhat.com>
14 years agotestsuite: mkfs() code cleanup
Martin Pitt [Thu, 20 May 2010 20:12:44 +0000 (22:12 +0200)]
testsuite: mkfs() code cleanup

Replace the long if ladder for mkfs special cases with option dictionaries.
This makes it easier to extend in the future and the code easier to read.

14 years agoBug 28075 — Do not have all files executable on vfat
Martin Pitt [Wed, 12 May 2010 12:00:18 +0000 (14:00 +0200)]
Bug 28075 — Do not have all files executable on vfat

Enable the "showexec" vfat mount option, to avoid data files being executable
(which causes confusing question dialogs in nautilus which only have one
sensible answer).

See http://www.kernel.org/doc/Documentation/filesystems/vfat.txt (search for
"showexec") for the details of this option.

14 years agoUpdate to latest LVM2 API
David Zeuthen [Wed, 19 May 2010 17:01:31 +0000 (13:01 -0400)]
Update to latest LVM2 API

See

 http://lists.freedesktop.org/archives/devkit-devel/2010-April/000783.html

14 years agotestsuite: Check file permissions
Martin Pitt [Wed, 12 May 2010 11:00:16 +0000 (13:00 +0200)]
testsuite: Check file permissions

Add a check to the filesystem test cases for sane permissions of data files and
executables. In particular, this ensures that the executable bit is set where
it makes sense (directories and programs), but not on mere data files.

We currently ignore known-broken file systems like vfat and ntfs.

This is the groundwork to fix this behaviour at least on vfat. Its current
behaviour is quite unnerving, since trying to open a file on them in e. g.
GNOME will always ask for "do you want to open or run this file".

14 years agoPost-release version bump to 1.0.2
David Zeuthen [Fri, 9 Apr 2010 15:56:27 +0000 (11:56 -0400)]
Post-release version bump to 1.0.2

14 years agoUpdate NEWS for release
David Zeuthen [Fri, 9 Apr 2010 15:45:44 +0000 (11:45 -0400)]
Update NEWS for release

14 years agoadd information about CVE-2010-1149 to NEWS
Martin Pitt [Fri, 9 Apr 2010 11:19:44 +0000 (13:19 +0200)]
add information about CVE-2010-1149 to NEWS

14 years agoHide Sony E-Book launcher partition
Martin Pitt [Wed, 7 Apr 2010 07:50:19 +0000 (09:50 +0200)]
Hide Sony E-Book launcher partition

It only contains Windows software and is read-only, and thus useless.

https://launchpad.net/bugs/546924

14 years agojob-drive-benchmark.c: Fix data types in error messages
Martin Pitt [Wed, 7 Apr 2010 07:27:18 +0000 (09:27 +0200)]
job-drive-benchmark.c: Fix data types in error messages

We previously used wrongly sized data types in the error messages, which causes
crashes on platforms where they do not coincidentally match in size.

https://launchpad.net/bugs/527202

14 years agopart-id: Fix DM partition table detection
Martin Pitt [Wed, 7 Apr 2010 06:56:05 +0000 (08:56 +0200)]
part-id: Fix DM partition table detection

If DM_NAME does not end in 'pN' (i. e. is not a partition), do not treat it as
malformed, but just go ahead probing it. This fixes partition table detection
for kpartx'ed DM devices.

Re-enable the test case which originally uncovered this bug.

14 years agotestsuite: Check presence and properties of loop devices
Martin Pitt [Wed, 7 Apr 2010 06:36:42 +0000 (08:36 +0200)]
testsuite: Check presence and properties of loop devices

14 years agoBug 27494 — publicly exports dm key information
Martin Pitt [Wed, 7 Apr 2010 06:12:42 +0000 (08:12 +0200)]
Bug 27494 — publicly exports dm key information

Change udisks-dm-export to only export UDISKS_DM_TARGETS_PARAMS for "linear"
types. It is the only one we care about for now and know how to interpret.
"crypto" types have information about the encryption key in the target
parameters, which we must not leak.

Also add appropriate comments to the two places which currently evaluate
UDISKS_DM_TARGETS_PARAMS.

14 years agotestsuite: Test detection of kpartx LVM partitions
Martin Pitt [Tue, 6 Apr 2010 21:01:38 +0000 (23:01 +0200)]
testsuite: Test detection of kpartx LVM partitions

Add a new LVM test case where we create two partitions of the LV and check
their udisks properties.

This is primarily meant to test the rather involved logic of udisks-part-id to
determine which device that partition is a slave of (it involves parsing
UDISKS_DM_TARGETS_PARAMS and various DM_* properties).

This also apparently uncovered a bug: the partition table does not have correct
properties in udisks. Comment out the two checks for now, to be investigated
later.

14 years agotestsuite: Check that our udev probers do not leak key information
Martin Pitt [Tue, 6 Apr 2010 18:34:36 +0000 (20:34 +0200)]
testsuite: Check that our udev probers do not leak key information

This reproduces https://bugs.freedesktop.org/show_bug.cgi?id=27494

14 years agoFix exit code of umount.udisks
Martin Pitt [Fri, 19 Mar 2010 09:09:59 +0000 (10:09 +0100)]
Fix exit code of umount.udisks

Exit with return code 0 if the unmount succeeded.

https://launchpad.net/bugs/541740

14 years agoAllow other rules to set a more specific presentation icon
Martin Pitt [Thu, 18 Mar 2010 13:42:24 +0000 (14:42 +0100)]
Allow other rules to set a more specific presentation icon

If previous rules already set UDISKS_PRESENTATION_ICON_NAME (like in a future
media-player-info, to attach more specific icons to particular devices), do not
overwrite it with our generic icons; just set them if we do not have an icon at
all yet.

Also put the icon rules into their own visual section now, they were previously
in the middle of the "card reader type" rules.

14 years agoSet multimedia-player-ipod icon for iPod media players
Martin Pitt [Wed, 17 Mar 2010 14:46:03 +0000 (15:46 +0100)]
Set multimedia-player-ipod icon for iPod media players

Part of https://launchpad.net/bugs/540235

14 years agoUpdate NEWS for release
David Zeuthen [Mon, 15 Mar 2010 23:42:29 +0000 (19:42 -0400)]
Update NEWS for release

Ooops, should have done this before 1.0.0 - this will have to do.

14 years agoPost-release version bump to 1.0.1
David Zeuthen [Mon, 15 Mar 2010 23:38:42 +0000 (19:38 -0400)]
Post-release version bump to 1.0.1

Signed-off-by: David Zeuthen <davidz@redhat.com>
14 years agoAdd TODO item about UTF-8 and D-Bus properties
David Zeuthen [Mon, 15 Mar 2010 22:37:21 +0000 (18:37 -0400)]
Add TODO item about UTF-8 and D-Bus properties

14 years agoGuarantee that DeviceFilePresentation always contain something meaningful
David Zeuthen [Mon, 15 Mar 2010 22:31:58 +0000 (18:31 -0400)]
Guarantee that DeviceFilePresentation always contain something meaningful

This makes life easier for UI tools - they can always just display
:DeviceFilePresentation instead of having to check whether it's blank
and if so use :DeviceFile.

Signed-off-by: David Zeuthen <davidz@redhat.com>
14 years agoMake it possible to disable LVM2 and dm-multipath support
David Zeuthen [Mon, 15 Mar 2010 22:22:48 +0000 (18:22 -0400)]
Make it possible to disable LVM2 and dm-multipath support

Evidently, the device-mapper and LVM2 side of this needs some more
work so certain enterprise distros may want to disable this for now.

Signed-off-by: David Zeuthen <davidz@redhat.com>
14 years agoUpdate TODO
David Zeuthen [Mon, 15 Mar 2010 19:38:53 +0000 (15:38 -0400)]
Update TODO

Signed-off-by: David Zeuthen <davidz@redhat.com>
14 years agoFix partition table probing during coldplug
David Zeuthen [Mon, 15 Mar 2010 18:04:59 +0000 (14:04 -0400)]
Fix partition table probing during coldplug

Commit 8aa58f68ae3b53f6ba6d8c51b4f66bc8135b4123 introduced a subtle
assumption that the device file given on the command line for
udisks-part-id is the same as what udev_device_get_devnode() returns
for the udev_device object. This is actually not true when handling an
event as the node passed is a temporary one.

Signed-off-by: David Zeuthen <davidz@redhat.com>
14 years agoudisks-part-id: Simplify code
Martin Pitt [Mon, 15 Mar 2010 07:41:32 +0000 (08:41 +0100)]
udisks-part-id: Simplify code

In 8aa58f we changed part-id to keep one singe udev_device around. Simplify
get_part_table_device_file() to not get the syspath from our device, just to
get a new udev device from that syspath again (which is exactly the same as the
device that we already have).

This also fixes a double udev_device_unref(), although this seems to have been
harmless.

14 years agoBug 27072 — does not force-unmount for drives in fstab
Martin Pitt [Sun, 14 Mar 2010 19:58:28 +0000 (20:58 +0100)]
Bug 27072 — does not force-unmount for drives in fstab

force_removal() previously only checked for entries in our own mtab.
This caused forced unmounts for drives in /etc/fstab not to work.

Now check for drives in /etc/fstab as well.

14 years agoTODO update for property update race conditions
Martin Pitt [Fri, 12 Mar 2010 19:07:24 +0000 (20:07 +0100)]
TODO update for property update race conditions

14 years agotestsuite: Add option to disable workarounds for race conditions
Martin Pitt [Fri, 12 Mar 2010 18:56:34 +0000 (19:56 +0100)]
testsuite: Add option to disable workarounds for race conditions

Some D-BUS API methods cause properties to not be up to date yet when a method
call finishes, thus we do an udevadm settle as a workaround in the test suite.
Those bugs should eventually get fixed properly, but it's unnerving to have the
tests fail on them when you are working on something else.

Split the udevadm settles into the existing .sync() for legitimate syncs, and a
new sync_workaround() for race condition workarounds.

Add --no-workarounds CLI option to disable those workaround syncs, so that
these race conditions can be detected and fixed.

14 years agotestsuite: Use loop devices instead of ram disks
Martin Pitt [Fri, 12 Mar 2010 18:14:24 +0000 (19:14 +0100)]
testsuite: Use loop devices instead of ram disks

On many platforms, the default size of RAM disks is too small for some file
systems or LVM devices. Rewrite using temporary loop devices.

14 years agoudisks-part-id: Check ID_FS_TYPE from environment first
Martin Pitt [Fri, 12 Mar 2010 17:30:23 +0000 (18:30 +0100)]
udisks-part-id: Check ID_FS_TYPE from environment first

We need to do that for the initial udev run where blkid and udisks-part-id are
called in the same round; the database is not updated at that time yet.

14 years agoBug 26996 — wrongly detects partition on unpartitioned VFAT device
Martin Pitt [Fri, 12 Mar 2010 16:42:25 +0000 (17:42 +0100)]
Bug 26996 — wrongly detects partition on unpartitioned VFAT device

A standard VFAT header matches the signature of an MBR, so we detected VFAT
file systems on raw unpartitioned devices as both VFAT and MBR partition table.
This confuses gnome-disk-utility/gvfs, and causes them to be ignored in GNOME.

The standard approach in the kernel/blkid is to only detect an MBR if it does
not have a valid VFAT signature. Since blkid already does that for us, do not
output PARTITION_TABLE properties in udisks-part-id if we already know that we
have a valid ID_FS_TYPE.

14 years agoudisks-part-id: Shuffle code to keep udev_device in main()
Martin Pitt [Fri, 12 Mar 2010 16:27:03 +0000 (17:27 +0100)]
udisks-part-id: Shuffle code to keep udev_device in main()

Reorder the code to get and keep an udev_device struct in main() and pass it
down to get_part_table_device_file(), instead of temporarily creating them in
that function and get_syspath(). This avoids duplicate lookups and also
allows us to do further queries on the udev_device later on (which we need to
fix bz#26996)

14 years agotestsuite: Check partitions with filesystems
Martin Pitt [Fri, 12 Mar 2010 15:15:52 +0000 (16:15 +0100)]
testsuite: Check partitions with filesystems

So far we only checked handling of partitions without file systems, which did
not detect the regression from commit cfc6698. Now test both combinations.

Note that we have to jump through some hoops here, since
Partition{Create,Modify} internally writes the new partition type/flags/etc,
and thus does not care about a broken part-id. Thus we trigger a change event
on block devices to actually check what the udev probers do.

14 years agoBug 25424 — Update to stable API of udev/gudev/dbus
Michael Biebl [Tue, 17 Nov 2009 03:18:14 +0000 (21:18 -0600)]
Bug 25424 — Update to stable API of udev/gudev/dbus

Remove G_UDEV_API_IS_SUBJECT_TO_CHANGE and
LIBUDEV_I_KNOW_THE_API_IS_SUBJECT_TO_CHANGE.
Bump the build dependency on libudev to >= 143 and gudev-1.0 to >= 147
when those APIs were declared stable.
We also depend on dbus >= 1.0, so remove DBUS_API_SUBJECT_TO_CHANGE as
well.

Signed-off-by: David Zeuthen <davidz@redhat.com>
14 years agoBug 25012 ­Add "usefree" to vfat available options
tuxce [Fri, 12 Mar 2010 12:12:41 +0000 (13:12 +0100)]
Bug 25012 ­Add "usefree" to vfat available options

When mounting a vfat volume, system scan the entire partition to know free
space available, using "usefree" option avoid this scan and use the free
clusters info on file system.

Modern kernels should not really need this any more, even on a 500 GB vfat
external disk it only takes two or three seconds to probe the file system.

However, this regressed in the kernel already twice in the past, so merely
allowing the mount option (without making it the default) provides a workaround
for such cases.

Signed-off-by: Martin Pitt <martin.pitt@ubuntu.com>
14 years agotestsuite: Get along with running gvfs/nautilus
Martin Pitt [Fri, 12 Mar 2010 12:10:06 +0000 (13:10 +0100)]
testsuite: Get along with running gvfs/nautilus

Send a SIGSTOP to all gvfs-gdu-volume-monitor processes while the test suite is
running, to avoid nautilus windows popping up by the dozens, and causing "busy"
failures.

14 years agotestsuite: Add TODO item to test new support for loop devices
Martin Pitt [Fri, 12 Mar 2010 12:06:51 +0000 (13:06 +0100)]
testsuite: Add TODO item to test new support for loop devices

14 years agoHandle loopback devices
David Zeuthen [Thu, 11 Mar 2010 21:38:32 +0000 (16:38 -0500)]
Handle loopback devices

 http://people.freedesktop.org/~david/udisks-loop-devices.png

it even works with kpartx partitions

 http://people.freedesktop.org/~david/palimpsest-loop-kpartx-partition.png

In order for this to work well, you will this patch

 http://people.freedesktop.org/~david/0001-Generate-change-uevent-for-loop-device.patch

which is also needed in order to make the /dev/disk hierarchy work
well. In lieu of this patch, you can generate the 'change' uevent
yourself. I've submitted this patch upstream through Kay Sievers.

14 years agoRevert "Bug 26996 — wrongly detects partition on unpartitioned VFAT device"
David Zeuthen [Thu, 11 Mar 2010 19:21:02 +0000 (14:21 -0500)]
Revert "Bug 26996 — wrongly detects partition on unpartitioned VFAT device"

This commit actually broke partition table parsing for the partitions
itself, e.g. this output

UDISKS_PARTITION=1
UDISKS_PARTITION_SCHEME=mbr
UDISKS_PARTITION_NUMBER=1
UDISKS_PARTITION_TYPE=0x83
UDISKS_PARTITION_SIZE=51202335744
UDISKS_PARTITION_LABEL=
UDISKS_PARTITION_UUID=
UDISKS_PARTITION_FLAGS=boot
UDISKS_PARTITION_SLAVE=/sys/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda
UDISKS_PARTITION_OFFSET=32256
UDISKS_PARTITION_ALIGNMENT_OFFSET=0

if the partition in question had a recognizable filesystem.

This reverts commit cfc669846a53815517d32d0b7b96cbc4935cea7a.

14 years agoUpdate TODO
David Zeuthen [Thu, 11 Mar 2010 15:55:05 +0000 (10:55 -0500)]
Update TODO

14 years agoBug 26996 — wrongly detects partition on unpartitioned VFAT device
Martin Pitt [Thu, 11 Mar 2010 06:58:34 +0000 (07:58 +0100)]
Bug 26996 — wrongly detects partition on unpartitioned VFAT device

A standard VFAT header matches the signature of an MBR, so we detected
VFAT file systems on raw unpartitioned devices as both VFAT and MBR partition
table. This confuses gnome-disk-utility/gvfs, and causes them to be ignored in
GNOME.

The standard approach in the kernel/blkid is to only detect an MBR if it does
not have a valid VFAT signature. Since blkid already does that for us, just
skip the udisks-part-id invocation completely if we already know that we have a
valid ID_FS_TYPE.

14 years agotestsuite: Ensure that volumes on raw partitions don't have a partition table
Martin Pitt [Wed, 10 Mar 2010 16:45:38 +0000 (17:45 +0100)]
testsuite: Ensure that volumes on raw partitions don't have a partition table

This reproduces bz#26996.

14 years agoDrop obsolete rule for suspended LVM devices
Michael Biebl [Tue, 9 Mar 2010 13:12:20 +0000 (14:12 +0100)]
Drop obsolete rule for suspended LVM devices

udisks-dm-export does not set UDISKS_DM_{STATE,NAME} any more, and recent LVM
versions check and flag private devices themselves, so just drop our own rules
for that.

Signed-off-by: Martin Pitt <martin.pitt@ubuntu.com>
14 years agoDrop obsolete rules for private LVM devices
Michael Biebl [Tue, 9 Mar 2010 12:59:40 +0000 (13:59 +0100)]
Drop obsolete rules for private LVM devices

udisks-dm-export does not set UDISKS_DM_{UUID,NAME} any more, and recent LVM
versions check and flag private devices themselves, so just drop our own rules
for that.

Signed-off-by: Martin Pitt <martin.pitt@ubuntu.com>
14 years agoRespect DM_UDEV_DISABLE_DISK_RULES_FLAG from current LVM
Michael Biebl [Tue, 9 Mar 2010 12:55:54 +0000 (13:55 +0100)]
Respect DM_UDEV_DISABLE_DISK_RULES_FLAG from current LVM

14 years agoInclude udisks-tcp-bridge.xml in dist tarball
Michael Biebl [Fri, 5 Mar 2010 07:23:30 +0000 (08:23 +0100)]
Include udisks-tcp-bridge.xml in dist tarball

Signed-off-by: Martin Pitt <martin.pitt@ubuntu.com>
14 years agoInclude profile.h in dist tarball
Michael Biebl [Fri, 5 Mar 2010 07:19:54 +0000 (08:19 +0100)]
Include profile.h in dist tarball

Signed-off-by: Martin Pitt <martin.pitt@ubuntu.com>
14 years agoUpdate .gitignore files
Martin Pitt [Wed, 3 Mar 2010 21:48:50 +0000 (22:48 +0100)]
Update .gitignore files

14 years agofix compiler warnings
Martin Pitt [Wed, 3 Mar 2010 21:23:47 +0000 (22:23 +0100)]
fix compiler warnings

Fix a couple of unchecked function call results, and a strict pointer aliasing
violation, which resulted in compiler warnings.

14 years agoin maintainer mode, build with -Werror
Martin Pitt [Wed, 3 Mar 2010 21:06:09 +0000 (22:06 +0100)]
in maintainer mode, build with -Werror

With --enable-maintainer-mode, or with --enable-strict, build with -Werror.

14 years agoInitialize variable before use
David Zeuthen [Wed, 3 Mar 2010 21:12:47 +0000 (16:12 -0500)]
Initialize variable before use

14 years agoBug 26725 — add profiling
Martin Pitt [Wed, 3 Mar 2010 20:20:00 +0000 (21:20 +0100)]
Bug 26725 — add profiling

Add a PROFILE() macro (src/profile.h) which, when building with
--enable-profiling, adds fake access() calls as trace points for startup speed
profiling.

http://people.gnome.org/~federico/news-2006-03.html#login-time-2 describes how
to use strace and turn its output into a nice graph:

  # strace -tttfo /tmp/trace src/udisks-daemon
  [...]
  $ plot-timeline.py -o /tmp/trace.png /tmp/trace

Instrument the most important/complex methods in daemon.c and device.c, and
main().

14 years agoBug 26822 — Fix benchmarking for large files
Daniele Napolitano [Tue, 2 Mar 2010 07:18:47 +0000 (08:18 +0100)]
Bug 26822 — Fix benchmarking for large files

Use lseek64() instead of lseek() in job-drive-benchmark.c (as in the rest of
the code), to also work with large devices.

Signed-off-by: Martin Pitt <martin.pitt@ubuntu.com>
14 years agofix media detection of CD-ROMs
Martin Pitt [Mon, 1 Mar 2010 12:36:49 +0000 (13:36 +0100)]
fix media detection of CD-ROMs

Use ID_CDROM_MEDIA property for media detection in update_info(), not
ID_CDROM_MEDIA_STATE. The latter is not set by udev's cdrom_id for pure CD-ROM
media (since it's sometimes wrong), and we are already using ID_CDROM_MEDIA in
our udev rules, so let's be consistent here.

This was exposed by commit c8d02e0, which previously shadowed this bug.

14 years agoInclude stdout in mkfs error output
David Zeuthen [Sat, 27 Feb 2010 16:59:56 +0000 (11:59 -0500)]
Include stdout in mkfs error output

This is to help expose this bug

 mke2fs insists on user interaction even if stdin is not a tty and -F is passed
 https://bugzilla.redhat.com/show_bug.cgi?id=569021

14 years agoBug 24424 - Move UDISKS_MEDIA_AVAILABLE out of the part table prober
David Zeuthen [Thu, 25 Feb 2010 22:19:51 +0000 (17:19 -0500)]
Bug 24424 - Move UDISKS_MEDIA_AVAILABLE out of the part table prober

This change (magically) makes floppy disks work in GNOME. Woot.

14 years agoWe're using the UDISKS_ prefix, not DKD_
David Zeuthen [Thu, 25 Feb 2010 17:28:40 +0000 (12:28 -0500)]
We're using the UDISKS_ prefix, not DKD_

Also pointed out in

http://bugs.freedesktop.org/show_bug.cgi?id=26720

14 years agoAdd a --disable-remote-access option
David Zeuthen [Wed, 24 Feb 2010 16:36:21 +0000 (11:36 -0500)]
Add a --disable-remote-access option

Certain Enterprise Linux vendors might not want to support the udisks
1.0.x ABI for seven years.

14 years agoUpdate detach helper for current sysfs interface
David Zeuthen [Tue, 23 Feb 2010 21:48:33 +0000 (16:48 -0500)]
Update detach helper for current sysfs interface

Writing 'suspend' to power/level doesn't seem to work these days
(worked in F12 but broken in F13). Also use the new remove/ sysfs
attribute.

14 years agoImprove debug output and support for the detach helper
David Zeuthen [Tue, 23 Feb 2010 20:56:12 +0000 (15:56 -0500)]
Improve debug output and support for the detach helper

This allows easily invoking the tool from a shell, like this

 $ sudo /usr/libexec/udisks-helper-drive-detach /dev/sdb
 Detaching device: /dev/sdb
 SYNCHRONIZE CACHE: FAILED: No such file or directory
 (Continuing despite SYNCHRONIZE CACHE failure.)
 STOP UNIT: OK
 Unbind USB interface driver: OK
 Suspend USB Device: OK
 $ echo $?
 0

14 years agoUse DM_NAME instead of DM_UUID when determining partition number
David Zeuthen [Tue, 23 Feb 2010 17:31:07 +0000 (12:31 -0500)]
Use DM_NAME instead of DM_UUID when determining partition number

Gah, looks like DM_UUID is not always set for partitions on multipath
devices. Let's hope it's the case for DM_NAME.

14 years agotestsuite: Fix LVM tests
Martin Pitt [Wed, 17 Feb 2010 11:29:37 +0000 (12:29 +0100)]
testsuite: Fix LVM tests

Turns out that current LVM versions/rules do create by-id symlinks for RAID
mirror images, on purpose. So do not fail on them, just check that they do not
have a real IdUsage/IdUuid.

14 years agoUpdate for new liblvm2app library
David Zeuthen [Tue, 16 Feb 2010 19:24:27 +0000 (14:24 -0500)]
Update for new liblvm2app library

Several things changed in liblvm2app

 - sizes are now reported in bytes instead of sectors
 - a couple of new functions were added

You will need lvm2 version 2.02.61 or later (on Fedora Rawhide, this
is available as lvm2-2.02.61-1.fc13.x86_64). Unfortunately the liblvm2
pc version number is stuck at 2.1 so we can't require this version in
configure.in. I've asked the LVM team to fix that.

14 years agoAdd doc/udisks-overrides.txt so 'make dist' works
David Zeuthen [Mon, 15 Feb 2010 23:28:42 +0000 (18:28 -0500)]
Add doc/udisks-overrides.txt so 'make dist' works

Hmm, need to investigate later why this is needed.

14 years agoFix compiler warning
David Zeuthen [Mon, 15 Feb 2010 22:51:15 +0000 (17:51 -0500)]
Fix compiler warning

14 years agoExport alignment offset for a partition
David Zeuthen [Mon, 15 Feb 2010 20:15:42 +0000 (15:15 -0500)]
Export alignment offset for a partition

14 years agoRework partition table probing
David Zeuthen [Mon, 15 Feb 2010 19:53:54 +0000 (14:53 -0500)]
Rework partition table probing

In particular, always respect UDISKS_PARTITION_* and
UDISKS_PARTITION_TABLE_* udev properties.

Also, temporarily, use g_getenv() to retrieve properties in
udisks-part-id. It seems like libudev doesn't return properties
correctly in some cases involving dm-multipath. Will need to
investigate.

14 years agoAdd support for "disable polling" udev property
Martin Pitt [Mon, 15 Feb 2010 16:02:30 +0000 (17:02 +0100)]
Add support for "disable polling" udev property

Do not poll a device which has UDISKS_DISABLE_POLLING set. Some known-broken
CD-ROM drives cause a lot of CPU activity when being polled, so allow admins to
suppress polling with a local udev rule like

  SUBSYSTEM=="block", ENV{ID_VENDOR}=="Optiarc*", ENV{ID_MODEL}=="*AD-7640S*", \
      ENV{UDISKS_DISABLE_POLLING}="1"

https://bugs.freedesktop.org/show_bug.cgi?id=26508

14 years agoMake sure udisks-helper-mdadm-expand is included in the dist tarball
Michael Biebl [Fri, 12 Feb 2010 11:12:27 +0000 (12:12 +0100)]
Make sure udisks-helper-mdadm-expand is included in the dist tarball

Signed-off-by: Martin Pitt <martin.pitt@ubuntu.com>
14 years agotestsuite: check --localstatedir configuration
Martin Pitt [Thu, 11 Feb 2010 10:23:12 +0000 (11:23 +0100)]
testsuite: check --localstatedir configuration

If the local build tree is not built with a sensible --localstatedir, i. e.
${localstatedir}/{run,lib}/udisks/ does not exist, the test suite is doomed to
fail and requires lots of manual cleanup.

Detect this situation and fail early with a sensible error message. This will
also cause the test suite to not really run on a mere "distcheck" without
configure arguments.

14 years agoRobustify evaluation of DM_SUSPEND
Martin Pitt [Wed, 10 Feb 2010 20:57:32 +0000 (21:57 +0100)]
Robustify evaluation of DM_SUSPEND

If a DM device does not have DM_SUSPEND at all, do not consider it suspended.

14 years agoBug 24446 — automake integration of test suite
Martin Pitt [Fri, 4 Dec 2009 14:56:47 +0000 (15:56 +0100)]
Bug 24446 — automake integration of test suite

This ensures that the test script is shipped with the distribution tarball, and
the tests are run during "make check" through sudo.

14 years agoBug 24446 — Add a test suite
Martin Pitt [Wed, 10 Feb 2010 18:56:40 +0000 (19:56 +0100)]
Bug 24446 — Add a test suite

Add a test suite which checks operations on a fake device (currently a RAID-0
md built from a RAM disk).  This is useful for regression and system/distro
integration testing, since it will only succeed if working versions of
cryptsetup, udev rules, etc. are installed.

Current coverage:
 - tests local build tree or system binaries, depending from where it is run
 - udisks --show-info
 - create/relabel/mount/unmount/fsck/open files/take ownership for supported
file systems (ext[234], minix, xfs, ntfs, vfat, swap), with both command line
tools (and udisks detection) as well as udisks D-Bus interface
 - LUKS create/teardown/mount/unmount/change password
 - Partition create/flags/modify/delete for MBR and GPT (APM tests are present,
but disabled)
 - SMART status/real HD/simulate
 - LVM single LV/single LV with RAID-1
 - Manager functionality: Enumerate*, FindDeviceBy*, Inhibition

14 years agoBug 24446 — Add --helper-dir option
Martin Pitt [Wed, 10 Feb 2010 18:39:44 +0000 (19:39 +0100)]
Bug 24446 — Add --helper-dir option

Add daemon option --helper-dir to specify helper directory. This is useful for
running the daemon from the local build tree for testing (--helper-dir
src/helpers).

Remove explicit PACKAGE_LIBEXEC_DIR from job invocations, since job_new()
already searches $PATH and the daemon sets $PATH to a known-good value. So
--helper-dir only prepends the custom directory to $PATH.

14 years agoSupport building without lvm2app
Martin Pitt [Wed, 10 Feb 2010 18:21:05 +0000 (19:21 +0100)]
Support building without lvm2app

14 years agoAdd LinuxMdExpand method and rename LinuxMdAddComponent to LinuxMdAddSpare
David Zeuthen [Fri, 5 Feb 2010 21:56:11 +0000 (16:56 -0500)]
Add LinuxMdExpand method and rename LinuxMdAddComponent to LinuxMdAddSpare

14 years agoWhen creating a LV, ensure that it is part of PV metadata until returning
David Zeuthen [Thu, 4 Feb 2010 19:18:47 +0000 (14:18 -0500)]
When creating a LV, ensure that it is part of PV metadata until returning

This is important in gnome-disk-utility where we only displays LVs
that are part of PV metadata.

14 years agoMake sure all devices are returned, even when handling change events
David Zeuthen [Thu, 4 Feb 2010 19:15:53 +0000 (14:15 -0500)]
Make sure all devices are returned, even when handling change events

We actually remove the device from map_native_path_to_device during a
change event. This means that the device being handled in e.g. update_info()
isn't part of what daemon_local_get_all_devices() returns.

14 years agoExport multipath parameters as a textual string
David Zeuthen [Tue, 26 Jan 2010 22:50:43 +0000 (17:50 -0500)]
Export multipath parameters as a textual string

The string itself is defined here

http://christophe.varoqui.free.fr/refbook.html

We could play games like decoding the string daemon side and export a
complicated object model but it's much easier to pint that to the
client.

14 years agoCopy identifying data from multipath components onto the multipath device
David Zeuthen [Tue, 26 Jan 2010 19:22:34 +0000 (14:22 -0500)]
Copy identifying data from multipath components onto the multipath device

14 years agoDon't copy data from each path into the virtual multipath device
David Zeuthen [Tue, 26 Jan 2010 19:06:29 +0000 (14:06 -0500)]
Don't copy data from each path into the virtual multipath device

We punt this responsibility to the client.

14 years agoRequire both SERIAL and WWN to be non-empty when matching up similar drives
David Zeuthen [Tue, 26 Jan 2010 18:11:14 +0000 (13:11 -0500)]
Require both SERIAL and WWN to be non-empty when matching up similar drives

The previous behavior was to require either-or. Unfortunately this
easily matched N-in-one card readers which wasn't optimal.

14 years agoAdd udev rules for detecting some common USB card readers
David Zeuthen [Tue, 26 Jan 2010 17:55:18 +0000 (12:55 -0500)]
Add udev rules for detecting some common USB card readers

Should probably port everything from

 /usr/share/hal/fdi/information/10freedesktop/10-usb-card-readers.fdi

some day.