This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Dolphin places panel and loop device name (iso)

Tags: None
(comma "," separated)
jeromev
Registered Member
Posts
4
Karma
0
OS
Hello,

When i mount an iso file with mount (sudo/root) command or with udisksctl (as user), dolphin automatically show it in "place panel". But i can't figure out why it's called "Loop Device" (in french, because i'm french ;) : "Périphérique de rebouclage" ?
I setup all my other "devices" (mean partition) with an label and they get show with there label. Is this a bug ?
So, i try my self to figure out why and i search trought solid-hardware and udiskctl command. Here is the output command from udiskctl and solid-hardware with an iso file mounted as loop device (as user)

udisksctl info -b /dev/loop0
Code: Select all
org/freedesktop/UDisks2/block_devices/loop0:
  org.freedesktop.UDisks2.Block:
    Configuration:              []
    CryptoBackingDevice:        '/'
    Device:                     /dev/loop0
    DeviceNumber:               1792
    Drive:                      '/'
    HintAuto:                   false
    HintIconName:               
    HintIgnore:                 false
    HintName:                   
    HintPartitionable:          true
    HintSymbolicIconName:       
    HintSystem:                 true
    Id:                         
    IdLabel:                    MARVELS_THOR_THE_DARK_WORLD_3D
    IdType:                     udf
    IdUUID:                     
    IdUsage:                    filesystem
    IdVersion:                 
    MDRaid:                     '/'
    MDRaidMember:               '/'
    PreferredDevice:            /dev/loop0
    ReadOnly:                   false
    Size:                       43750588416
    Symlinks:                   /dev/disk/by-label/MARVELS_THOR_THE_DARK_WORLD_3D\x1f
  org.freedesktop.UDisks2.Filesystem:
    MountPoints:       
  org.freedesktop.UDisks2.Loop:
    Autoclear:          false
    BackingFile:        /home/jerome/H62vA1uMpq5452vQBcVjK.iso
    SetupByUID:         1000


solid-hardware details /org/freedesktop/UDisks2/block_devices/loop0
Code: Select all
udi = '/org/freedesktop/UDisks2/block_devices/loop0'
  parent = '/'  (string)
  vendor = ''  (string)
  product = ''  (string)
  description = 'Loop Device'  (string)
  Block.major = 7  (0x7)  (int)
  Block.minor = 0  (0x0)  (int)
  Block.device = '/dev/loop0'  (string)
  StorageAccess.accessible = false  (bool)
  StorageAccess.filePath = ''  (string)
  StorageAccess.ignored = false  (bool)
  StorageVolume.ignored = false  (bool)
  StorageVolume.usage = 'FileSystem'  (0x2)  (enum)
  StorageVolume.fsType = 'udf'  (string)
  StorageVolume.label = 'MARVELS_THOR_THE_DARK_WORLD_3D'  (string)
  StorageVolume.uuid = ''  (string)
  StorageVolume.size = 43750588416  (0xa2fbd0000)  (qulonglong)


And for compare here is the output for my root partition (aka "/") :
udisksctl info -b /dev/sda3
Code: Select all
/org/freedesktop/UDisks2/block_devices/sda3
org.freedesktop.UDisks2.Block:
    Configuration:              [('fstab', {'fsname': <b'/dev/sda3'>, 'dir': <b'/'>, 'type': <b'ext4'>, 'opts': <b'noatime,nodiratime,data=writeback,stripe=16,barrier=0,errors=remount-ro'>, 'freq': <0>, 'passno': <1>})]
    CryptoBackingDevice:        '/'
    Device:                     /dev/sda3
    DeviceNumber:               2051
    Drive:                      '/org/freedesktop/UDisks2/drives/Adaptec_raid0_gentoo'
    HintAuto:                   true
    HintIconName:               
    HintIgnore:                 false
    HintName:                   
    HintPartitionable:          true
    HintSymbolicIconName:       
    HintSystem:                 false
    Id:                         by-uuid-6ef2a786-e1d2-4e30-992c-9120296dc2a8
    IdLabel:                    root
    IdType:                     ext4
    IdUUID:                     6ef2a786-e1d2-4e30-992c-9120296dc2a8
    IdUsage:                    filesystem
    IdVersion:                  1.0
    MDRaid:                     '/'
    MDRaidMember:               '/'
    PreferredDevice:            /dev/sda3
    ReadOnly:                   false
    Size:                       32212254720
    Symlinks:                   /dev/disk/by-id/scsi-SAdaptec_raid0_gentoo_5996142D-part3
                                /dev/disk/by-label/root
                                /dev/disk/by-path/pci-0000:03:00.0-scsi-0:0:0:0-part3
                                /dev/disk/by-uuid/6ef2a786-e1d2-4e30-992c-9120296dc2a8
                                /dev/root
  org.freedesktop.UDisks2.Filesystem:
    MountPoints:        /
  org.freedesktop.UDisks2.Partition:
    Flags:              0
    IsContained:        false
    IsContainer:        false
    Name:               
    Number:             3
    Offset:             4610588672
    Size:               32212254720
    Table:              '/org/freedesktop/UDisks2/block_devices/sda'
    Type:               0x83
    UUID:               297d5d94-03


solid-hardware details /org/freedesktop/UDisks2/block_devices/sda3
Code: Select all
udi = '/org/freedesktop/UDisks2/block_devices/sda3'
  parent = '/org/freedesktop/UDisks2/drives/Adaptec_raid0_gentoo'  (string)
  vendor = 'Adaptec'  (string)
  product = 'raid0_gentoo'  (string)
  description = 'root'  (string)
  Block.major = 8  (0x8)  (int)
  Block.minor = 3  (0x3)  (int)
  Block.device = '/dev/sda3'  (string)
  StorageAccess.accessible = true  (bool)
  StorageAccess.filePath = '/'  (string)
  StorageAccess.ignored = false  (bool)
  StorageVolume.ignored = false  (bool)
  StorageVolume.usage = 'FileSystem'  (0x2)  (enum)
  StorageVolume.fsType = 'ext4'  (string)
  StorageVolume.label = 'root'  (string)
  StorageVolume.uuid = '6ef2a786-e1d2-4e30-992c-9120296dc2a8'  (string)
  StorageVolume.size = 32212254720  (0x780000000)  (qulonglong)


The only diff i seen between info about device loop and root partition is with solid-hardware command :

Code: Select all
description = 'Loop Device'  (string)
description = 'root'  (string)


For now, i don't really know if this is a bug or a feature ;)
Any way, i really want to have my iso mounted show in dolphin with is "real" label, mean this :

Code: Select all
StorageVolume.label = 'MARVELS_THOR_THE_DARK_WORLD_3D'  (string)


By the way, the iso's mounted point is : /run/media/jerome/MARVELS_THOR_THE_DARK_WORLD_3D/, so this is extract from the code above.

Should i filled a bug report ?
How to get the "real" label display in dolphin's places panel ?

EDIT : Kde 4.12.3 / gentoo linux

Thanks !
Ps: sorry for my poor english.

Jérôme.
freininghaus
Moderator
Posts
224
Karma
1
OS
If I read the code correctly, the Places Panel always shows what is returned by Solid::Device::description(). It appears that this 'description' is equal to the label in the case of your 'root' drive, but not for the loop device.

I don't know if this is intended by Solid or if it is a bug.
jeromev
Registered Member
Posts
4
Karma
0
OS
Ok thanks,

So this is solid's fault. Found something in source code 'solid/solid/backends/udisks2/udiskdevice.cpp'

Code: Select all
QString Device::description() const
{
    const QString hintName = property("HintName").toString(); // non-cached
    if (!hintName.isEmpty())
        return hintName;

    if (isLoop())
        return QObject::tr("Loop Device");
    else if (isSwap())
        return QObject::tr("Swap Space");
    else if (queryDeviceInterface(Solid::DeviceInterface::StorageDrive))
        return storageDescription();
    else if (queryDeviceInterface(Solid::DeviceInterface::StorageVolume))
        return volumeDescription();
    else
        return product();
}


Why hard coding name "Loop device" ?
jeromev
Registered Member
Posts
4
Karma
0
OS
Ok, found a way but don't know if this is a right way to do ;)

Code: Select all
--- solid/solid/backends/udisks2/udisksdevice.cpp       2014-02-28 00:04:10.000000000 +0100
+++ solid/solid/backends/udisks2/udisksdevice.cpp.new   2014-03-27 16:53:18.865813003 +0100
@@ -251,7 +251,7 @@
         return hintName;
 
     if (isLoop())
-        return QObject::tr("Loop Device");
+        return volumeDescription();
     else if (isSwap())
         return QObject::tr("Swap Space");
     else if (queryDeviceInterface(Solid::DeviceInterface::StorageDrive))


I recompile kde libs and it's working i get the label in the dolphin places !
Maybe i could propose this upstream ?
freininghaus
Moderator
Posts
224
Karma
1
OS
Thanks for looking into it!

I don't know if there was a reason why the Solid people decided to return "Loop device" there. I think that you should discuss it with them and ask if this patch can be merged.
jeromev
Registered Member
Posts
4
Karma
0
OS
Hello,

Thanks, i just send an mail to Kde-hardware-devel, will see with them.


Bookmarks



Who is online

Registered users: Bing [Bot], Google [Bot], lockheed