platform/upstream/udisks2.git
12 years agoFix typo
David Zeuthen [Sat, 7 Jul 2012 21:46:44 +0000 (17:46 -0400)]
Fix typo

... now 'make distcheck' works again.

Signed-off-by: David Zeuthen <zeuthen@gmail.com>
12 years agoDisable -Wformat-nonliteral for a tiny block of code
David Zeuthen [Sat, 7 Jul 2012 21:34:20 +0000 (17:34 -0400)]
Disable -Wformat-nonliteral for a tiny block of code

... in this case, we happen to know better than the compiler what we
are doing.

Signed-off-by: David Zeuthen <zeuthen@gmail.com>
12 years agoAdd more compiler warnings
David Zeuthen [Fri, 6 Jul 2012 17:33:48 +0000 (13:33 -0400)]
Add more compiler warnings

You'd think GNOME_COMPILE_WARNINGS([maximum]) would be good enough but
apparently not. I hate build systems.

Signed-off-by: David Zeuthen <zeuthen@gmail.com>
12 years agoFix some uninitialized variable warnings
David Zeuthen [Thu, 5 Jul 2012 21:07:58 +0000 (17:07 -0400)]
Fix some uninitialized variable warnings

These only occur when building with -O2, not -O0, ofcourse, thanks gcc.

Pointed out by Colin Walters <walters@verbum.org>.

Signed-off-by: David Zeuthen <zeuthen@gmail.com>
12 years agoDon't return uninitialized variable on inhibitor error path
David Zeuthen [Thu, 5 Jul 2012 20:55:50 +0000 (16:55 -0400)]
Don't return uninitialized variable on inhibitor error path

Signed-off-by: David Zeuthen <zeuthen@gmail.com>
12 years agoInhibit system shutdown, sleep and idle when formatting and erasing devices
David Zeuthen [Thu, 5 Jul 2012 20:38:00 +0000 (16:38 -0400)]
Inhibit system shutdown, sleep and idle when formatting and erasing devices

Formatting and ATA secure erase are both potentially long-running
tasks that can easily take hours to complete. Especially for ATA
secure erase, losing power while the command is pending can be very
very bad.

Here's udisks taking an inhibitor lock:

 # gdbus call --system --dest org.freedesktop.login1 --object-path /org/freedesktop/login1 --method org.freedesktop.login1.Manager.ListInhibitors
 ([('shutdown:sleep:idle', 'Disk Manager', 'Formatting Device', 'block', uint32 0, uint32 14172)],)

On non-systemd systems, this does nothing.

Signed-off-by: David Zeuthen <zeuthen@gmail.com>
12 years agoWhen setting up LUKS, erase the cleartext device rather than the cryptotext one
David Zeuthen [Thu, 5 Jul 2012 18:20:27 +0000 (14:20 -0400)]
When setting up LUKS, erase the cleartext device rather than the cryptotext one

That way the cryptotext device will be full of noise instead of
zeroes, that way not conveying that there isn't a lot of data on the
device.

Signed-off-by: David Zeuthen <zeuthen@gmail.com>
12 years agoDon't report progress for ATA Secure Erase when expected time is >508 minutes
David Zeuthen [Wed, 4 Jul 2012 16:11:48 +0000 (12:11 -0400)]
Don't report progress for ATA Secure Erase when expected time is >508 minutes

I have a Samsung drive, see [1], that reports 510 in its IDENTIFY data
but the secure erase only takes around 214 minutes:

 Jul  3 00:18:18 mars udisksd[9480]: Commencing ATA enhanced secure erase of /dev/sdd (SAMSUNG-HD103UJ-S13PJ90S703014). This operation is expected to take at least 510 minutes to complete
 [...]
 Jul  3 03:52:01 mars udisksd[9480]: Finished securely erasing /dev/sdd (SAMSUNG-HD103UJ-S13PJ90S703014)

See

 http://people.freedesktop.org/~david/gnome-disks-secure-erase-with-greater-than-508-min.png

for an example of how GNOME Disks interprets this and compare it with

 http://people.freedesktop.org/~david/gnome-disks-ata-secure-erase-progress.png

for when progress is available.

[1] :

/org/freedesktop/UDisks2/drives/SAMSUNG_HD103UJ_S13PJ90S703015:
  org.freedesktop.UDisks2.Drive:
    Configuration:              {}
    ConnectionBus:
    Ejectable:                  false
    Id:                         SAMSUNG-HD103UJ-S13PJ90S703015
    Media:
    MediaAvailable:             true
    MediaChangeDetected:        true
    MediaCompatibility:
    MediaRemovable:             false
    Model:                      SAMSUNG HD103UJ
    Optical:                    false
    OpticalBlank:               false
    OpticalNumAudioTracks:      0
    OpticalNumDataTracks:       0
    OpticalNumSessions:         0
    OpticalNumTracks:           0
    Removable:                  false
    Revision:                   1AA01181
    RotationRate:               -1
    Seat:                       seat0
    Serial:                     S13PJ90S703015
    Size:                       1000204886016
    SortKey:                    01hotplug/1341418168551507
    TimeDetected:               1341418168551507
    TimeMediaDetected:          1341418168551507
    Vendor:
    WWN:                        0x50024e9200c0c694
  org.freedesktop.UDisks2.Drive.Ata:
    AamEnabled:                                 false
    AamSupported:                               true
    AamVendorRecommendedValue:                  254
    ApmEnabled:                                 false
    ApmSupported:                               true
    PmEnabled:                                  true
    PmSupported:                                true
    SecurityEnhancedEraseUnitMinutes:           510
    SecurityEraseUnitMinutes:                   510
    SecurityFrozen:                             false
    SmartEnabled:                               true
    SmartFailing:                               false
    SmartNumAttributesFailedInThePast:          0
    SmartNumAttributesFailing:                  0
    SmartNumBadSectors:                         0
    SmartPowerOnSeconds:                        31629600
    SmartSelftestPercentRemaining:              0
    SmartSelftestStatus:                        success
    SmartSupported:                             true
    SmartTemperature:                           295.14999999999998
    SmartUpdated:                               1341418168

Signed-off-by: David Zeuthen <zeuthen@gmail.com>
12 years agointegration-test: More robust syncing
Martin Pitt [Tue, 3 Jul 2012 15:24:41 +0000 (17:24 +0200)]
integration-test: More robust syncing

Repeatedly settle the client until all main loop events have been processed,
instead of just calling it once. This avoids a lot of spurious, but obstinate
test failures due to properties not being updated yet.

Also add an extra sleep after the manual mount and dd call to allow some more
time for the changes to get picked up. This is a hack, but not easily fixed in
a cleaner way.

12 years agoDon't use g_propagate_error() with a NULL GError
David Zeuthen [Tue, 3 Jul 2012 13:06:32 +0000 (09:06 -0400)]
Don't use g_propagate_error() with a NULL GError

Signed-off-by: David Zeuthen <zeuthen@gmail.com>
12 years agoAdd support for VMWare filesystem types and GPT partition types
David Zeuthen [Tue, 3 Jul 2012 10:49:23 +0000 (06:49 -0400)]
Add support for VMWare filesystem types and GPT partition types

Signed-off-by: David Zeuthen <zeuthen@gmail.com>
12 years agointegration-test: Use Gio.TestDBus() again
Martin Pitt [Mon, 18 Jun 2012 12:34:27 +0000 (14:34 +0200)]
integration-test: Use Gio.TestDBus() again

Now that we do not need to call tests under a different UID any more, we can
drop the custom D-BUS config and dbus-launch, and go back to the much simpler
Gio.TestDBus().

12 years agointegration-test: Use mock polkitd
Martin Pitt [Mon, 18 Jun 2012 12:26:36 +0000 (14:26 +0200)]
integration-test: Use mock polkitd

Add src/tests/test_polkitd.py which provides a simple mock polkitd on a given
bus, as well as some convenience API. This allows test cases to precisely
control which actions get permitted and forbidden without having to assume
anything about the system polkit configuration, users, active/inactive consoles
etc. This is meant to go into polkit itself at some point.

Simplify integration-test to use test_polkitd and get rid of the uid changing
and calling of udisksctl.

12 years agoAdd ATA Secure Erase functionality
David Zeuthen [Mon, 2 Jul 2012 21:41:20 +0000 (17:41 -0400)]
Add ATA Secure Erase functionality

This is available via a new Drive.Ata.SecurityEraseUnit() method but
also via the Block.Format() method by setting the @erase parameter to
'ata-secure-erase' or 'ata-secure-erase-enhanced'. The latter is the
preferred way of using the new functionality.

Secure erase requires the calling user to be authorized for the (newly
added) org.freedesktop.udisks2.ata-secure-erase polkit action. By
default this requires administrator authentication no matter what kind
of drive is being used.

Since a secure erase cannot be canceled, a new Job:Cancelable property
has been added so the UI can avoid displaying a cancel button.

Considerable care have been taken in the implementation so things are
properly logged to the system log in case something goes wrong - for
example, if a device is yanked it may remain locked and needs to be
unlocked using the temporary 'xxxx' password that is used.

http://people.freedesktop.org/~david/gnome-disks-ata-secure-erase.png
http://people.freedesktop.org/~david/gnome-disks-ata-secure-erase-warning.png
http://people.freedesktop.org/~david/gnome-disks-ata-secure-erase-confirmation.png
http://people.freedesktop.org/~david/gnome-disks-ata-secure-erase-progress.png

Signed-off-by: David Zeuthen <zeuthen@gmail.com>
12 years agoInit interface proxies on hotplug too
David Zeuthen [Sat, 30 Jun 2012 16:28:46 +0000 (12:28 -0400)]
Init interface proxies on hotplug too

GDBusObjectManagerClient only emits object-added for an object with N
interface (not N separate interface-added signals).

Signed-off-by: David Zeuthen <zeuthen@gmail.com>
12 years agoIssue BLKRRPART if wiping a device with an existing partition table
David Zeuthen [Wed, 27 Jun 2012 16:46:32 +0000 (12:46 -0400)]
Issue BLKRRPART if wiping a device with an existing partition table

Signed-off-by: David Zeuthen <zeuthen@gmail.com>
12 years agoSet Job:ExpectedEndTime when erasing a device
David Zeuthen [Tue, 26 Jun 2012 23:32:48 +0000 (19:32 -0400)]
Set Job:ExpectedEndTime when erasing a device

Do this by introducing some plumbing in UDisksBaseJob to estimate the
end time based on the UDisksJob:progress property. We do this by using
a 100-period moving average (actually, up to 100 periods). Works out
great in practice.

Also switch the format of the time used on the org.fd.UDisks.Job
interface to be micro-seconds instead of seconds. This is not really a
break as these properties were always zero in any released udisks2
version.

http://people.freedesktop.org/~david/gnome-disks-estimated-time-remaining.png

Signed-off-by: David Zeuthen <zeuthen@gmail.com>
12 years agoBug 51439 – udisks should hide lvm PVs
David Zeuthen [Tue, 26 Jun 2012 17:56:20 +0000 (13:56 -0400)]
Bug 51439 – udisks should hide lvm PVs

Hide partitions marked as containing LVM and RAID. This is only useful
for encrypted partitions.

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

Signed-off-by: David Zeuthen <zeuthen@gmail.com>
12 years agoAdd erase parameter to Block.Format() to zero out device before formatting it
David Zeuthen [Mon, 25 Jun 2012 15:38:29 +0000 (11:38 -0400)]
Add erase parameter to Block.Format() to zero out device before formatting it

... and also provide new job properties so it's possible to build a
meaningful UI around it. This makes things like this possible

 http://people.freedesktop.org/~david/gnome-disks-erase-overwrite-option.png
 http://people.freedesktop.org/~david/gnome-disks-long-running-operations.png

Signed-off-by: David Zeuthen <zeuthen@gmail.com>
12 years agoMove Drive:Configuration property up a bit
David Zeuthen [Sun, 24 Jun 2012 15:34:05 +0000 (11:34 -0400)]
Move Drive:Configuration property up a bit

Makes the docs look better.

Signed-off-by: David Zeuthen <zeuthen@gmail.com>
12 years agoDrop the 'drive-' prefix for drive configuration files
David Zeuthen [Sun, 24 Jun 2012 15:31:37 +0000 (11:31 -0400)]
Drop the 'drive-' prefix for drive configuration files

In the future we may want to use the same configuration file format
for block devices.

Signed-off-by: David Zeuthen <zeuthen@gmail.com>
12 years agoDefault to mode 0600 for drive config files
David Zeuthen [Sun, 24 Jun 2012 15:24:35 +0000 (11:24 -0400)]
Default to mode 0600 for drive config files

This is important because we *may* want to store passwords in them at
some point (such as the ATA security stuff).

Signed-off-by: David Zeuthen <zeuthen@gmail.com>
12 years agoAdd DriveAta.PmWakeup() method
David Zeuthen [Sun, 24 Jun 2012 14:03:44 +0000 (10:03 -0400)]
Add DriveAta.PmWakeup() method

The UI already has a "Standby" so for symmetri it's desirable to also
have a "Wakeup" menu item.

http://people.freedesktop.org/~david/gnome-disks-resume-from-standby.png

For now it seems to be good enough to just read some sectors from the
disk. We can always change this to something more sophisticated later
if needed.

Signed-off-by: David Zeuthen <zeuthen@gmail.com>
12 years agoDon't require auth for Standby'ing non-system drives on own seat
David Zeuthen [Sat, 23 Jun 2012 22:36:10 +0000 (18:36 -0400)]
Don't require auth for Standby'ing non-system drives on own seat

Signed-off-by: David Zeuthen <zeuthen@gmail.com>
12 years agoAdd drive configuration interfaces and configuration files
David Zeuthen [Sat, 23 Jun 2012 14:18:53 +0000 (10:18 -0400)]
Add drive configuration interfaces and configuration files

Signed-off-by: David Zeuthen <zeuthen@gmail.com>
12 years agointegration-test: Fix parsing of daemon path in system mode
Martin Pitt [Wed, 13 Jun 2012 14:44:54 +0000 (16:44 +0200)]
integration-test: Fix parsing of daemon path in system mode

Only take the first word of the Exec= line in the udisks D-BUS service file, so
that extra arguments like --no-debug get ignored.

With that, integration-test runs fine against the system installed binaries
again.

12 years agoShip integration-test in the tarball
Martin Pitt [Wed, 13 Jun 2012 14:27:55 +0000 (16:27 +0200)]
Ship integration-test in the tarball

12 years agointegration-test: Fix Polkit.test_internal_fs_nobody test case
Martin Pitt [Wed, 13 Jun 2012 13:33:36 +0000 (15:33 +0200)]
integration-test: Fix Polkit.test_internal_fs_nobody test case

Do not call tools/udisksctl libtool wrapper as nobody, call the actual ELF
binary in tools/.libs. Otherwise libtool cannot write its temporary file as
user nobody.

12 years agoAdd Block.OpenForBenchmark() method
David Zeuthen [Wed, 13 Jun 2012 13:00:44 +0000 (09:00 -0400)]
Add Block.OpenForBenchmark() method

Signed-off-by: David Zeuthen <zeuthen@gmail.com>
12 years agoMark Realtek rts5229 based card readers as flash drives.
Ayan George [Thu, 24 May 2012 19:24:11 +0000 (19:24 +0000)]
Mark Realtek rts5229 based card readers as flash drives.

Signed-off-by: Martin Pitt <martinpitt@gnome.org>
12 years agointegration-test: Check polkit denial
Martin Pitt [Tue, 12 Jun 2012 14:41:41 +0000 (16:41 +0200)]
integration-test: Check polkit denial

Add a test case for a polkit-denied operation: we try to mount an internal disk
as user "nobody". Technically the system polkit configuration could allow this,
but let's hope that this is not the case (this is an integration test, after
all).

We need to supply our own D-BUS configuration for this to allow nobody to
access our temporary fake system bus. Thus drop the usage of Gio.TestDBus and
replace it with calling dbus-launch.

12 years agointegration-test: Explicit polkit tests
Martin Pitt [Tue, 12 Jun 2012 13:37:44 +0000 (15:37 +0200)]
integration-test: Explicit polkit tests

Since commit 203533a0 udisks can run without polkit, so run most of the
testsuite without polkitd. Introduce a new "Polkit" test that checks operation
with polkitd running. This only has a very shallow test for now, as further
tests require some reorganization.

12 years agointegration-test: Fix existance test of local state dirs
Martin Pitt [Mon, 11 Jun 2012 14:58:52 +0000 (16:58 +0200)]
integration-test: Fix existance test of local state dirs

12 years agoAdd Documentation key to systemd unit file
David Zeuthen [Sat, 9 Jun 2012 14:15:04 +0000 (10:15 -0400)]
Add Documentation key to systemd unit file

Signed-off-by: David Zeuthen <zeuthen@gmail.com>
12 years agoCatch up with latest polkit guidance
David Zeuthen [Fri, 8 Jun 2012 17:43:35 +0000 (13:43 -0400)]
Catch up with latest polkit guidance

See

 http://cgit.freedesktop.org/polkit/commit/?id=acf3a06e55f9ca8a7f7bfa012c24e8794d27c85f
 https://bugzilla.gnome.org/show_bug.cgi?id=677718

for details.

Signed-off-by: David Zeuthen <zeuthen@gmail.com>
12 years agoPost-release version bump to 1.99.0
David Zeuthen [Thu, 7 Jun 2012 18:43:23 +0000 (14:43 -0400)]
Post-release version bump to 1.99.0

Signed-off-by: David Zeuthen <zeuthen@gmail.com>
12 years agoUpdate NEWS for release
David Zeuthen [Thu, 7 Jun 2012 18:36:42 +0000 (14:36 -0400)]
Update NEWS for release

Signed-off-by: David Zeuthen <zeuthen@gmail.com>
12 years agoudisksd: work if polkitd is not available
David Zeuthen [Thu, 7 Jun 2012 15:45:02 +0000 (11:45 -0400)]
udisksd: work if polkitd is not available

Upstream polkit now recommends this, see

http://cgit.freedesktop.org/polkit/commit/?id=84e42887d413cba0039f92f0c56a25c70c20fe6e

Signed-off-by: David Zeuthen <zeuthen@gmail.com>
12 years agointegration-test: Run on temporary local DBus
Martin Pitt [Thu, 7 Jun 2012 09:26:45 +0000 (11:26 +0200)]
integration-test: Run on temporary local DBus

Run a temporary local session DBus, using the new Gio.TestDBus API from glib
2.34. Pretend that it is the system DBus, and run our udisksd as well as a
polkitd instance on that. This avoids interacting with the real system
DBus/udisksd and any currently running session, and obsoletes the need for
suspending gvfs-udisks2-volume-monitor (which has always been a GNOME specific
hack).

The polkitd debug output will now appear in the dameon log as well, if you use
the --log-file/-l option.

12 years agointegration-test: Quiesce wipefs output
Martin Pitt [Thu, 7 Jun 2012 08:48:52 +0000 (10:48 +0200)]
integration-test: Quiesce wipefs output

It previously cluttered the test output with the erased bytes, like:

test_ext3 (__main__.FS)
fs: ext3 ... [cli] 2 bytes were erased at offset 0x438 (ext3)
they were: 53 ef
[ud] ok

12 years agointegration-test: Update expected Luks mount points
Martin Pitt [Thu, 7 Jun 2012 08:43:23 +0000 (10:43 +0200)]
integration-test: Update expected Luks mount points

Mounts are now done in /run/media when there is a known user name. Update the
Luks tests to get along with both /media and /run/media/user.

12 years agoWait for the correct device after formatting
Martin Pitt [Thu, 7 Jun 2012 08:25:08 +0000 (10:25 +0200)]
Wait for the correct device after formatting

When creating a LUKS device, the object to wait on after mkfs (cleartext
device-mapper) is not the same as we originally started with (crypto_LUKS
device). Always wait on the object we called mkfs on.

12 years agointegration-test: Mitigate race after mounting
Martin Pitt [Thu, 7 Jun 2012 06:51:24 +0000 (08:51 +0200)]
integration-test: Mitigate race after mounting

Also wait for udev and the rest of the system after calling mount before
asserting the mount path exists. Fixes a common failure of FS tests.

12 years agoRework part of the polkit variable documentation
David Zeuthen [Wed, 6 Jun 2012 17:20:39 +0000 (13:20 -0400)]
Rework part of the polkit variable documentation

Signed-off-by: David Zeuthen <zeuthen@gmail.com>
12 years agoAdd id.* and partition.* polkit variables
David Zeuthen [Wed, 6 Jun 2012 14:54:16 +0000 (10:54 -0400)]
Add id.* and partition.* polkit variables

These variables can be useful for making authorization decisions.

Signed-off-by: David Zeuthen <zeuthen@gmail.com>
12 years agoUse "device" instead of "block_device" in the polkit variables
David Zeuthen [Wed, 6 Jun 2012 14:31:32 +0000 (10:31 -0400)]
Use "device" instead of "block_device" in the polkit variables

Signed-off-by: David Zeuthen <zeuthen@gmail.com>
12 years agoIf a block device has ID_PATH set, consider it to be a drive
David Zeuthen [Tue, 5 Jun 2012 18:44:48 +0000 (14:44 -0400)]
If a block device has ID_PATH set, consider it to be a drive

This fixes problems with the devices where ID_SERIAL or
ID_WWN_WITH_EXTENSION is not set. For example, block devices from the
rts_pstor driver.

See https://bugzilla.redhat.com/show_bug.cgi?id=828492

Signed-off-by: David Zeuthen <zeuthen@gmail.com>
12 years agoMove table with polkit variables to the "Authorization Checks" chapter
David Zeuthen [Mon, 4 Jun 2012 16:24:42 +0000 (12:24 -0400)]
Move table with polkit variables to the "Authorization Checks" chapter

Signed-off-by: David Zeuthen <zeuthen@gmail.com>
12 years agointegration-test: Update expected exception names
Martin Pitt [Fri, 1 Jun 2012 05:31:34 +0000 (07:31 +0200)]
integration-test: Update expected exception names

12 years agointegration tests: Suspend gvfs-udisks2-volume-monitor
Martin Pitt [Fri, 1 Jun 2012 05:20:35 +0000 (07:20 +0200)]
integration tests: Suspend gvfs-udisks2-volume-monitor

... instead of the old gdu one.

12 years agointegration tests: Update expected mount points
Martin Pitt [Fri, 1 Jun 2012 05:15:27 +0000 (07:15 +0200)]
integration tests: Update expected mount points

mounts are now done in /run/media when there is a known user name. Update the
tests to get along with both /media and /run/media/user.

12 years agoRename current polkit variables and also add some new ones
David Zeuthen [Wed, 23 May 2012 18:08:54 +0000 (14:08 -0400)]
Rename current polkit variables and also add some new ones

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoAdd some documentation about polkit variables
David Zeuthen [Fri, 18 May 2012 17:08:06 +0000 (13:08 -0400)]
Add some documentation about polkit variables

In particular, guarantee that $(udisks2.device) is always a device
file, if set.

We may want to add more variables in the future such as
udisks2.drive.{vendor,model,serial,wwn}.

This is related to the new experimental JS-based polkit authority, see

 https://plus.google.com/u/0/110773474140772402317/posts/LB1QjaoaEn2

for more details.

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoDrive: Refuse to eject drives that appear to be in use
David Zeuthen [Tue, 15 May 2012 15:12:57 +0000 (11:12 -0400)]
Drive: Refuse to eject drives that appear to be in use

Unfortunately eject(1) is trying to be "helpful" insofar that it will
unmount partitions in use. While this is indeed handy when running
eject(1) from the command-line it's not a very good idea for us since
with the way its used in udisks, it effectively allows unmounting
partitions possibly mounted by other users.

So check if block devices for the drive is either mounted or unlocked
and bail if this is the case.

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoBug 49842 – Unhandled rootfs on bind mount
David Zeuthen [Tue, 15 May 2012 14:17:22 +0000 (10:17 -0400)]
Bug 49842 – Unhandled rootfs on bind mount

Don't ignore a mount just because if a subtree of the filesystem is
mounted. Because if we do this, we may wrongly conclude the device is
not mounted at all, which then means that it's visible in the desktop
UI and subject to automounting.

In the future, we may want a "a(ss) MountPointsFull" property that in
addition to the mount point also contains the subtree that is mounted
at said mountpoint.

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

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoCall it "Disk Manager" and reword some sections of udisks(8) man page
David Zeuthen [Mon, 14 May 2012 17:10:02 +0000 (13:10 -0400)]
Call it "Disk Manager" and reword some sections of udisks(8) man page

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoudisksctl: describe 'loop-setup' and 'loop-delete' verbs
David Zeuthen [Sat, 12 May 2012 16:18:53 +0000 (12:18 -0400)]
udisksctl: describe 'loop-setup' and 'loop-delete' verbs

For some reason the man page didn't describe these verbs. Also remove
some references to udisksd(8) for the unmount and lock verbs.

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoudisksctl: add 'smart-simulate' verb
David Zeuthen [Sat, 12 May 2012 16:07:33 +0000 (12:07 -0400)]
udisksctl: add 'smart-simulate' verb

This makes it a lot easier to simulate failing disks. Also add proper
polkit support so the user don't have to run it as root.

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoPost-release version bump to 1.98.0
David Zeuthen [Wed, 9 May 2012 18:00:18 +0000 (14:00 -0400)]
Post-release version bump to 1.98.0

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoUpdate NEWS for release
David Zeuthen [Wed, 9 May 2012 17:57:01 +0000 (13:57 -0400)]
Update NEWS for release

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoLoop: try writing to loop/autoclear sysfs file before LO_{GET,SET}_STATUS
David Zeuthen [Wed, 9 May 2012 17:34:11 +0000 (13:34 -0400)]
Loop: try writing to loop/autoclear sysfs file before LO_{GET,SET}_STATUS

This will only work if the following kernel patch is applied

 http://people.freedesktop.org/~david/linux-3.4.0-rc5+-loop-make-it-possible-to-set-autoclear-through-sysfs.patch

however with this patch it's now possible to set autoclear for loop
devices backed on files on FUSE filesystems - without this patch we'll
fail when doing LO_GET_STATUS64.

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoSimplify loop device checking
David Zeuthen [Wed, 9 May 2012 16:54:03 +0000 (12:54 -0400)]
Simplify loop device checking

... and never automatically tear down loop devices.

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoUDisksCleanup: Remove stale entries when adding new ones
David Zeuthen [Wed, 9 May 2012 14:20:01 +0000 (10:20 -0400)]
UDisksCleanup: Remove stale entries when adding new ones

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoUpdate path to mounted-fs file in documentation
David Zeuthen [Wed, 9 May 2012 13:47:40 +0000 (09:47 -0400)]
Update path to mounted-fs file in documentation

It's been /run/udisks2, not /var/lib/udisks2, for a while now.

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoRevert "Add loop.autoclear option to Filesystem.Mount() method"
David Zeuthen [Fri, 4 May 2012 23:30:24 +0000 (19:30 -0400)]
Revert "Add loop.autoclear option to Filesystem.Mount() method"

Now that we have a Loop.SetAutoclear() method, this is no longer
needed.

This reverts commit 9a3939800e280efbac0efe22dca26799da894f4d.

12 years agoUDisksDaemon: rework wait_for_object_sync() method
David Zeuthen [Fri, 4 May 2012 21:04:42 +0000 (17:04 -0400)]
UDisksDaemon: rework wait_for_object_sync() method

Simpler and more intuitive this way. Also update all current users to
the new API and semantics.

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoUDisksDaemon: add get_objects() method
David Zeuthen [Fri, 4 May 2012 21:04:23 +0000 (17:04 -0400)]
UDisksDaemon: add get_objects() method

Mostly convenience to avoid casting and getting the object-manager.

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoManager: wait for partitions to appear before returning in LoopSetup()
David Zeuthen [Fri, 4 May 2012 18:21:37 +0000 (14:21 -0400)]
Manager: wait for partitions to appear before returning in LoopSetup()

This is needed for the Disk Image Mounter when mounting all
filesystems in a partitioned disk image.

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoDaemon: Add new find_block_*() convenience methods
David Zeuthen [Fri, 4 May 2012 18:19:44 +0000 (14:19 -0400)]
Daemon: Add new find_block_*() convenience methods

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoAdd work-around to show FS on CDs/USB sticks created using isohybrid
David Zeuthen [Thu, 3 May 2012 13:46:43 +0000 (09:46 -0400)]
Add work-around to show FS on CDs/USB sticks created using isohybrid

This happens at least in two cases - when using loop-devices with
LO_PARTSCAN and when dd(1)'ing the image to a USB stick.

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoLoop: add SetupByUID property
David Zeuthen [Thu, 3 May 2012 12:55:36 +0000 (08:55 -0400)]
Loop: add SetupByUID property

This is useful in GVfs where we don't want to show loop devices set up
by other users.

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoUDisksClient: add get_loop_for_block() convenience method
David Zeuthen [Thu, 3 May 2012 12:55:28 +0000 (08:55 -0400)]
UDisksClient: add get_loop_for_block() convenience method

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoWarn if /run/udisks2/loop has an existing entry when setting up a new loop device
David Zeuthen [Thu, 3 May 2012 12:54:28 +0000 (08:54 -0400)]
Warn if /run/udisks2/loop has an existing entry when setting up a new loop device

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoManager: Add locking around LoopSetup()
David Zeuthen [Tue, 1 May 2012 23:58:12 +0000 (19:58 -0400)]
Manager: Add locking around LoopSetup()

Surprisingly, contention did happen when trying to attach 20-some disk
images in a row.

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoManager: Add new 'no-part-scan' option in LoopSetup() method
David Zeuthen [Tue, 1 May 2012 23:46:05 +0000 (19:46 -0400)]
Manager: Add new 'no-part-scan' option in LoopSetup() method

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoFix up how we check if use is authorized for Loop.SetAutoclear()
David Zeuthen [Tue, 1 May 2012 22:02:24 +0000 (18:02 -0400)]
Fix up how we check if use is authorized for Loop.SetAutoclear()

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoDon't assign the Loop D-Bus interface to partitions of a loop device
David Zeuthen [Tue, 1 May 2012 22:01:34 +0000 (18:01 -0400)]
Don't assign the Loop D-Bus interface to partitions of a loop device

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoLoop: add :Autoclear property and SetAutoclear() method
David Zeuthen [Tue, 1 May 2012 04:05:21 +0000 (00:05 -0400)]
Loop: add :Autoclear property and SetAutoclear() method

Also add some UI in Disks for this

 http://people.freedesktop.org/~david/disks-loop-autoclear-switch.png

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoAlso check for "target is busy" when checking umount(8) output
David Zeuthen [Mon, 30 Apr 2012 21:29:22 +0000 (17:29 -0400)]
Also check for "target is busy" when checking umount(8) output

Apparently this changed recently... ideally umount(8) would simply
return a well-defined exit code but that's not the way things work
right now.

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoAdd loop.autoclear option to Filesystem.Mount() method
David Zeuthen [Mon, 30 Apr 2012 20:59:53 +0000 (16:59 -0400)]
Add loop.autoclear option to Filesystem.Mount() method

The main user of this could be the desktop shell / file manager
offering a "Attach Disk Image" option for e.g. ISO files - it would
first use Manager.LoopSetup() and then, on the returned block device,
invoke Filesystem.Mount() with this new option (assuming the returned
loop device has any interesting content). With this, the file manager
need not worry about the loop device - it goes away as soon as the
filesystem is unmounted.

Why is this an option to Filesystem.Mount() and not Manager.LoopSetup()?
Because right after setting up the loop device, the OS opens the
device so it can populate the udev database with the detected contents
of the newly created loop device and also to maintain symlinks in the
/dev/disk tree. If we had created the loop device with LO_AUTOCLEAR
the kernel would clear the loop device right after blkid(8) closes the
device. However, if we set the flag after successfully mounting the
file system on the loop device, there is already a single reference to
the block device.

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoPost-release version bump to 1.97.0
David Zeuthen [Mon, 30 Apr 2012 19:23:07 +0000 (15:23 -0400)]
Post-release version bump to 1.97.0

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoUpdate NEWS for release
David Zeuthen [Mon, 30 Apr 2012 19:20:28 +0000 (15:20 -0400)]
Update NEWS for release

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoActually link with libsystemd-login
David Zeuthen [Mon, 30 Apr 2012 18:53:59 +0000 (14:53 -0400)]
Actually link with libsystemd-login

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoPost-release version bump to 1.96.0
David Zeuthen [Mon, 30 Apr 2012 18:33:47 +0000 (14:33 -0400)]
Post-release version bump to 1.96.0

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoUpdate NEWS for release
David Zeuthen [Mon, 30 Apr 2012 18:27:36 +0000 (14:27 -0400)]
Update NEWS for release

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoMinor doc fixes
David Zeuthen [Mon, 30 Apr 2012 18:20:29 +0000 (14:20 -0400)]
Minor doc fixes

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoRemove unused .filesystem-unmount-others-shared polkit action
David Zeuthen [Mon, 30 Apr 2012 17:58:31 +0000 (13:58 -0400)]
Remove unused .filesystem-unmount-others-shared polkit action

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoRemove support for ID_SEAT=all
David Zeuthen [Mon, 30 Apr 2012 17:13:50 +0000 (13:13 -0400)]
Remove support for ID_SEAT=all

We might bring this back in one shape or the other, but remove it for
now until I get a chance to talk to Kay and Lennart some more.

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoAdd Transifex config and pull latest translations
David Zeuthen [Mon, 30 Apr 2012 16:53:20 +0000 (12:53 -0400)]
Add Transifex config and pull latest translations

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoRemove danish translation
David Zeuthen [Mon, 30 Apr 2012 15:23:36 +0000 (11:23 -0400)]
Remove danish translation

We'll get this from Transifex going forward.

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoMake $(udisks2.device) in authentication messages include the vendor/model
David Zeuthen [Sun, 29 Apr 2012 19:54:45 +0000 (15:54 -0400)]
Make $(udisks2.device) in authentication messages include the vendor/model

... if available. Here's an example of what it looks like

 http://people.freedesktop.org/~david/udisks2-detailed-auth-message.png

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoAdd some more translation context and strings
David Zeuthen [Fri, 27 Apr 2012 18:22:45 +0000 (14:22 -0400)]
Add some more translation context and strings

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoAdd a bunch of translation comments
David Zeuthen [Fri, 27 Apr 2012 16:52:02 +0000 (12:52 -0400)]
Add a bunch of translation comments

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoReword parts of the udisks(8) man page
David Zeuthen [Tue, 24 Apr 2012 20:03:51 +0000 (16:03 -0400)]
Reword parts of the udisks(8) man page

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoFix typo
David Zeuthen [Mon, 23 Apr 2012 20:51:04 +0000 (16:51 -0400)]
Fix typo

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoAdd separate polkit actions for ejecting media
David Zeuthen [Mon, 23 Apr 2012 20:45:25 +0000 (16:45 -0400)]
Add separate polkit actions for ejecting media

It's a little weird to overload the modify-device action especially
since this doesn't change any bits on the media.

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoFix typos in policy file
David Zeuthen [Mon, 23 Apr 2012 20:44:49 +0000 (16:44 -0400)]
Fix typos in policy file

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoAdd missing "on" in udisks(8) man page
David Zeuthen [Mon, 23 Apr 2012 19:16:26 +0000 (15:16 -0400)]
Add missing "on" in udisks(8) man page

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoRemove section about ID_DRIVE* properties
David Zeuthen [Mon, 23 Apr 2012 19:09:51 +0000 (15:09 -0400)]
Remove section about ID_DRIVE* properties

It is really inappropriate to mention these here. Instead these
properties should be mentioned in the udev docs, along with other key
properties such as ID_FS_TYPE, ID_MODEL, ID_VENDOR, ID_WWN, ID_CDROM*
and so on. I've talked to Kay about this several times and he seems to
agree, just needs to happen.

Signed-off-by: David Zeuthen <davidz@redhat.com>
12 years agoUse upper-case for all man page sections
David Zeuthen [Mon, 23 Apr 2012 18:58:55 +0000 (14:58 -0400)]
Use upper-case for all man page sections

Signed-off-by: David Zeuthen <davidz@redhat.com>