Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SOLVED][Debian apt-get install] How to hide/ignore squashfs file system type? #177

Closed
mixpc opened this issue May 1, 2019 · 7 comments
Closed

Comments

@mixpc
Copy link

mixpc commented May 1, 2019

Hello,

I have created a config.yaml as per Man Page to use udiskie in Debian Stretch 9.9 amd64. udiskie works excellent. The doubt is how to hide/ignore squashfs fstype since all my snap apps are loaded as squashfs. lsblk -lf command shows it. When clicking on the tray icon a large nested list shows with 21 snaps, eg.
/dev/loop0: /var/lib...snap

Any ideas on how to hide them that does not have to do with using 21 times...

- device_file: /dev/loop0
  ignore:      false

is appreciated.

Thank you in advance,

@coldfix
Copy link
Owner

coldfix commented May 1, 2019

Hi,

you have several options.

  • the config should understand wildcards (device_file: /dev/loop*)
  • you can try matching by is_loop: true instead of device_file
  • you may try matching by id_type, id_usage, id_label or similar. Type udiskie-info -o '{device_file}:{id_usage}:{id_type}:id_label' /dev/loop* to see a list of those

In particular, if these devices have id_type = squashfs, you can do id_type: squashfs instead of the device_file line.

@mixpc
Copy link
Author

mixpc commented May 2, 2019

Hello,

Thank you for your feedback. I have been running many tests since yesterday. And here is a basic summary. You can see there's a Windows install, a Toshiba USB flashdrive, Linux partitions and snaps:

myuser@mycomputer:~$ lsblk -lf
NAME   FSTYPE   LABEL            UUID                                 MOUNTPOINT
loop0  squashfs                                                       /snap/core/6673
loop1  squashfs                                                       /snap/wine-platform/117
loop2  squashfs                                                       /snap/wine-platform/125
loop3  squashfs                                                       /snap/snap-store/60
loop4  squashfs                                                       /snap/speedy-duplicate-finder/9
loop5  squashfs                                                       /snap/core18/782
loop6  squashfs                                                       /snap/core18/941
loop7  squashfs                                                       /snap/core/6818
loop8  squashfs                                                       /snap/notepad-plus-plus/202
loop9  squashfs                                                       /snap/sublime-text/51
loop10 squashfs                                                       /snap/sublime-text/58
loop11 squashfs                                                       /snap/notepad-plus-plus/199
loop12 squashfs                                                       /snap/gnome-3-28-1804/23
loop13 squashfs                                                       /snap/gnome-3-28-1804/36
loop14 squashfs                                                       /snap/freemind/2
loop15 squashfs                                                       /snap/cool-retro-term/150
loop16 squashfs                                                       /snap/wine-platform/122
loop17 squashfs                                                       /snap/gtk-common-themes/1198
loop18 squashfs                                                       /snap/gnome-software/38
loop19 squashfs                                                       /snap/foobar2000/242
loop20 squashfs                                                       /snap/picard/3
loop21 squashfs                                                       /snap/gnome-3-28-1804/31
sda                                                                   
sda1   vfat     SYSTEM           7884-45C4                            /boot/efi
sda2                                                                  
sda3   ntfs     Windows          5A468554468531B5                     
sda4   ntfs     Windows RE tools 5C72863A72861942                     
sda5   ext4                      e29e2407-a057-4fb1-9607-27a260c16e45 /
sda6   swap                      13725326-6edd-4b25-8e18-f4500a8c8b45 [SWAP]
sda7   ext4                      393c0a9a-8804-4fd1-8b0e-8cda2a7d9e3f /home
sdb                                                                   
sdb1   vfat     TOSHIBA          746B-7ECF                            /media/myuser/TOSHIBA

I should note Debian installs version 1.5.1

myuser@mycomputer:~$ udiskie -V
udiskie 1.5.1

USB flashdrive inserted...

myuser@mycomputer:~$ udiskie-info -o 'id_type' /dev/sdb1
vfat

However, it breaks when when searching for /dev/loop

myuser@mycomputer:~$ udiskie-info -o 'id_type' /dev/loop*
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/udiskie/cli.py", line 289, in _start_async_tasks
    results = yield self._init()
  File "/usr/lib/python3/dist-packages/udiskie/cli.py", line 724, in _init
    devices = [self.udisks.find(path) for path in options['<device>']]
  File "/usr/lib/python3/dist-packages/udiskie/cli.py", line 724, in <listcomp>
    devices = [self.udisks.find(path) for path in options['<device>']]
  File "/usr/lib/python3/dist-packages/udiskie/udisks2.py", line 584, in find
    raise ValueError(_('no device found owning "{0}"', path))
ValueError: master device was not found for "/dev/loop-control"
myuser@mycomputer:~$ udiskie-info -o 'device_file' -a
/dev/loop0
/dev/loop1
/dev/loop10
/dev/loop11
/dev/loop12
/dev/loop13
/dev/loop14
/dev/loop15
/dev/loop16
/dev/loop17
/dev/loop18
/dev/loop19
/dev/loop2
/dev/loop20
/dev/loop21
/dev/loop3
/dev/loop4
/dev/loop5
/dev/loop6
/dev/loop7
/dev/loop8
/dev/loop9
/dev/sdb
/dev/sdb1


myuser@mycomputer:~$ udiskie-info -o 'id_type' -a
squashfs
squashfs
squashfs
squashfs
squashfs
squashfs
squashfs
squashfs
squashfs
squashfs
squashfs
squashfs
squashfs
squashfs
squashfs
squashfs
squashfs
squashfs
squashfs
squashfs
squashfs
squashfs

vfat


config/udiskie/config.yml
program_options:
  tray: yes
  menu: nested
  notify: yes
device_config:
- device_file: /dev/loop*
  ignore: true

myuser@mycomputer:~$ udiskie -c /home/myuser/.config/udiskie/config.yml 

All /dev/loop* are listed when clicking on the icon

config/udiskie/config.yml
program_options:
  tray: yes
  menu: nested
  notify: yes
device_config:
- id_type: squashfs
  ignore: true

Same, all /dev/loop* are listed

config/udiskie/config.yml
program_options:
  tray: yes
  menu: nested
  notify: yes
device_config:
  is_loop: true
  ignore: true

Same, all /dev/loop* are listed

I don't know what else to try. Maybe /dev/loop* should be escaped? Or setting in config.yml be set in a different way?

Thank you in any case in advance for your attention.

Regards,

@coldfix
Copy link
Owner

coldfix commented May 2, 2019

I should note Debian installs version 1.5.1

That might be the problem. Try using 1.7.7 by installing from PyPI. I can't support old versions, because you'd have to install a newer version for the fix anyways;) Also, uninstall the udiskie package to make sure that it doesn't accidentally load the wrong package later on (but don't uninstall dependencies):

apt remove udiskie

pip install --user udiskie

However, it breaks when when searching for /dev/loop

myuser@mycomputer:~$ udiskie-info -o 'id_type' /dev/loop*
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/udiskie/cli.py", line 289, in _start_async_tasks
    results = yield self._init()
  File "/usr/lib/python3/dist-packages/udiskie/cli.py", line 724, in _init
    devices = [self.udisks.find(path) for path in options['<device>']]
  File "/usr/lib/python3/dist-packages/udiskie/cli.py", line 724, in <listcomp>
    devices = [self.udisks.find(path) for path in options['<device>']]
  File "/usr/lib/python3/dist-packages/udiskie/udisks2.py", line 584, in find
    raise ValueError(_('no device found owning "{0}"', path))
ValueError: master device was not found for "/dev/loop-control"

I see, there seems to be a non-blockdevice in their midst. I should probably handle this case more gracefully and show info for all valid devices.

config/udiskie/config.yml
program_options:
  tray: yes
  menu: nested
  notify: yes
device_config:
- device_file: /dev/loop*
  ignore: true

myuser@mycomputer:~$ udiskie -c /home/myuser/.config/udiskie/config.yml 

All /dev/loop* are listed when clicking on the icon

config/udiskie/config.yml
program_options:
  tray: yes
  menu: nested
  notify: yes
device_config:
- id_type: squashfs
  ignore: true

Same, all /dev/loop* are listed

Did you restart udiskie after modifying config? It doesn't reload config during after initial startup. (Anyway, could just be due to a bug / missing feature in the old version, I don't know whether e.g. wildcards were supported back then)

config/udiskie/config.yml
program_options:
  tray: yes
  menu: nested
  notify: yes
device_config:
  is_loop: true
  ignore: true

Same, all /dev/loop* are listed

There is a - missing, should be:

device_config:
- is_loop: true
  ignore: true

I don't know what else to try. Maybe /dev/loop* should be escaped? Or setting in config.yml be set in a different way?

What is the exact path of your config.yml? Have you verified that it is loaded?

Start udiskie with udiskie -v to see which filters were applied for which devices.

Best, Thomas

Thank you in any case in advance for your attention.

Regards,

@mixpc
Copy link
Author

mixpc commented May 2, 2019

Thank you so much for your feeback and attention. I will try a bit more with Debian default udiskie as in my tests below. If no success after more tries, I will opt for your PyIP.

So with Debian default...

myuser@mycomputer:~$ pwd
/home/myuser

You can see my current path and config file path. dir udiskie and config.yaml owned by user myuser

myuser@mycomputer:~$ udiskie -c /home/myuser/.config/udiskie/config.yml

program_options:
  tray: yes
  menu: nested
  notify: yes
device_config:
- is_loop: true
  ignore: true

I don't know how to restart udiskie. What I do is run it and then either Ctrl+D, modify config file and run again or run it, click icon and click Exit button.

This time I have done reboot computer an run... Here is the verification:

myuser@mycomputer:~$ udiskie -v
DEBUG [2019-05-02 14:44:14,826] udiskie.config: IgnoreDevice(match={'symlinks': '/dev/mapper/docker-*'}, value=True) created
DEBUG [2019-05-02 14:44:14,826] udiskie.config: IgnoreDevice(match={'symlinks': '/dev/disk/by-id/dm-name-docker-*'}, value=True) created
DEBUG [2019-05-02 14:44:14,826] udiskie.config: IgnoreDevice(match={'is_loop': True, 'loop_file': '/*'}, value=False) created
DEBUG [2019-05-02 14:44:14,827] udiskie.config: IgnoreDevice(match={'is_block': False}, value=True) created
DEBUG [2019-05-02 14:44:14,827] udiskie.config: IgnoreDevice(match={'is_external': False}, value=True) created
DEBUG [2019-05-02 14:44:14,827] udiskie.config: IgnoreDevice(match={'is_ignored': True}, value=True) created
DEBUG [2019-05-02 14:44:15,018] udiskie.config: IgnoreDevice(match={'is_loop': True, 'loop_file': '/*'}, value=False) used for /org/freedesktop/UDisks2/block_devices/loop9
DEBUG [2019-05-02 14:44:15,019] udiskie.config: IgnoreDevice(match={'is_loop': True, 'loop_file': '/*'}, value=False) used for /org/freedesktop/UDisks2/block_devices/loop1
DEBUG [2019-05-02 14:44:15,019] udiskie.config: IgnoreDevice(match={'is_loop': True, 'loop_file': '/*'}, value=False) used for /org/freedesktop/UDisks2/block_devices/loop0
DEBUG [2019-05-02 14:44:15,022] udiskie.config: IgnoreDevice(match={'is_external': False}, value=True) used for /org/freedesktop/UDisks2/block_devices/sda4
DEBUG [2019-05-02 14:44:15,023] udiskie.config: IgnoreDevice(match={'is_loop': True, 'loop_file': '/*'}, value=False) used for /org/freedesktop/UDisks2/block_devices/loop16
DEBUG [2019-05-02 14:44:15,024] udiskie.config: IgnoreDevice(match={'is_external': False}, value=True) used for /org/freedesktop/UDisks2/block_devices/sda3
DEBUG [2019-05-02 14:44:15,025] udiskie.config: IgnoreDevice(match={'is_loop': True, 'loop_file': '/*'}, value=False) used for /org/freedesktop/UDisks2/block_devices/loop5
DEBUG [2019-05-02 14:44:15,025] udiskie.config: IgnoreDevice(match={'is_loop': True, 'loop_file': '/*'}, value=False) used for /org/freedesktop/UDisks2/block_devices/loop6
DEBUG [2019-05-02 14:44:15,026] udiskie.config: IgnoreDevice(match={'is_loop': True, 'loop_file': '/*'}, value=False) used for /org/freedesktop/UDisks2/block_devices/loop19
DEBUG [2019-05-02 14:44:15,026] udiskie.config: IgnoreDevice(match={'is_loop': True, 'loop_file': '/*'}, value=False) used for /org/freedesktop/UDisks2/block_devices/loop10
DEBUG [2019-05-02 14:44:15,027] udiskie.config: IgnoreDevice(match={'is_loop': True, 'loop_file': '/*'}, value=False) used for /org/freedesktop/UDisks2/block_devices/loop18
DEBUG [2019-05-02 14:44:15,027] udiskie.config: IgnoreDevice(match={'is_loop': True, 'loop_file': '/*'}, value=False) used for /org/freedesktop/UDisks2/block_devices/loop11
DEBUG [2019-05-02 14:44:15,027] udiskie.config: IgnoreDevice(match={'is_loop': True, 'loop_file': '/*'}, value=False) used for /org/freedesktop/UDisks2/block_devices/loop7
DEBUG [2019-05-02 14:44:15,028] udiskie.config: IgnoreDevice(match={'is_external': False}, value=True) used for /org/freedesktop/UDisks2/block_devices/sda1
DEBUG [2019-05-02 14:44:15,029] udiskie.config: IgnoreDevice(match={'is_loop': True, 'loop_file': '/*'}, value=False) used for /org/freedesktop/UDisks2/block_devices/loop4
DEBUG [2019-05-02 14:44:15,029] udiskie.config: IgnoreDevice(match={'is_loop': True, 'loop_file': '/*'}, value=False) used for /org/freedesktop/UDisks2/block_devices/loop20
DEBUG [2019-05-02 14:44:15,029] udiskie.config: IgnoreDevice(match={'is_loop': True, 'loop_file': '/*'}, value=False) used for /org/freedesktop/UDisks2/block_devices/loop21
DEBUG [2019-05-02 14:44:15,030] udiskie.config: IgnoreDevice(match={'is_loop': True, 'loop_file': '/*'}, value=False) used for /org/freedesktop/UDisks2/block_devices/loop14
DEBUG [2019-05-02 14:44:15,030] udiskie.config: IgnoreDevice(match={'is_block': False}, value=True) used for /org/freedesktop/UDisks2/drives/WDC_WD10JPVX_22JC3T0_WD_WXA1A7305463
DEBUG [2019-05-02 14:44:15,030] udiskie.config: IgnoreDevice(match={'is_loop': True, 'loop_file': '/*'}, value=False) used for /org/freedesktop/UDisks2/block_devices/loop12
DEBUG [2019-05-02 14:44:15,031] udiskie.config: IgnoreDevice(match={'is_external': False}, value=True) used for /org/freedesktop/UDisks2/block_devices/sda2
DEBUG [2019-05-02 14:44:15,032] udiskie.config: IgnoreDevice(match={'is_loop': True, 'loop_file': '/*'}, value=False) used for /org/freedesktop/UDisks2/block_devices/loop17
DEBUG [2019-05-02 14:44:15,032] udiskie.config: IgnoreDevice(match={'is_loop': True, 'loop_file': '/*'}, value=False) used for /org/freedesktop/UDisks2/block_devices/loop3
DEBUG [2019-05-02 14:44:15,033] udiskie.config: IgnoreDevice(match={'is_external': False}, value=True) used for /org/freedesktop/UDisks2/block_devices/sda6
DEBUG [2019-05-02 14:44:15,033] udiskie.config: IgnoreDevice(match={'is_loop': True, 'loop_file': '/*'}, value=False) used for /org/freedesktop/UDisks2/block_devices/loop15
DEBUG [2019-05-02 14:44:15,033] udiskie.config: IgnoreDevice(match={'is_loop': True, 'loop_file': '/*'}, value=False) used for /org/freedesktop/UDisks2/block_devices/loop8
DEBUG [2019-05-02 14:44:15,034] udiskie.config: IgnoreDevice(match={'is_external': False}, value=True) used for /org/freedesktop/UDisks2/block_devices/sda5
DEBUG [2019-05-02 14:44:15,035] udiskie.config: IgnoreDevice(match={'is_external': False}, value=True) used for /org/freedesktop/UDisks2/block_devices/loop22
DEBUG [2019-05-02 14:44:15,035] udiskie.config: IgnoreDevice(match={'is_loop': True, 'loop_file': '/*'}, value=False) used for /org/freedesktop/UDisks2/block_devices/loop13
DEBUG [2019-05-02 14:44:15,036] udiskie.config: IgnoreDevice(match={'is_external': False}, value=True) used for /org/freedesktop/UDisks2/block_devices/sda7
DEBUG [2019-05-02 14:44:15,036] udiskie.config: IgnoreDevice(match={'is_loop': True, 'loop_file': '/*'}, value=False) used for /org/freedesktop/UDisks2/block_devices/loop2
DEBUG [2019-05-02 14:44:15,037] udiskie.config: IgnoreDevice(match={'is_external': False}, value=True) used for /org/freedesktop/UDisks2/block_devices/sda
DEBUG [2019-05-02 14:44:15,041] udiskie.config: IgnoreDevice(match={'is_loop': True, 'loop_file': '/*'}, value=False) used for /org/freedesktop/UDisks2/block_devices/loop0
DEBUG [2019-05-02 14:44:15,042] udiskie.config: IgnoreDevice(match={'is_loop': True, 'loop_file': '/*'}, value=False) used for /org/freedesktop/UDisks2/block_devices/loop1
DEBUG [2019-05-02 14:44:15,042] udiskie.config: IgnoreDevice(match={'is_loop': True, 'loop_file': '/*'}, value=False) used for /org/freedesktop/UDisks2/block_devices/loop10
DEBUG [2019-05-02 14:44:15,042] udiskie.config: IgnoreDevice(match={'is_loop': True, 'loop_file': '/*'}, value=False) used for /org/freedesktop/UDisks2/block_devices/loop11
DEBUG [2019-05-02 14:44:15,043] udiskie.config: IgnoreDevice(match={'is_loop': True, 'loop_file': '/*'}, value=False) used for /org/freedesktop/UDisks2/block_devices/loop12
DEBUG [2019-05-02 14:44:15,043] udiskie.config: IgnoreDevice(match={'is_loop': True, 'loop_file': '/*'}, value=False) used for /org/freedesktop/UDisks2/block_devices/loop13
DEBUG [2019-05-02 14:44:15,043] udiskie.config: IgnoreDevice(match={'is_loop': True, 'loop_file': '/*'}, value=False) used for /org/freedesktop/UDisks2/block_devices/loop14
DEBUG [2019-05-02 14:44:15,043] udiskie.config: IgnoreDevice(match={'is_loop': True, 'loop_file': '/*'}, value=False) used for /org/freedesktop/UDisks2/block_devices/loop15
DEBUG [2019-05-02 14:44:15,044] udiskie.config: IgnoreDevice(match={'is_loop': True, 'loop_file': '/*'}, value=False) used for /org/freedesktop/UDisks2/block_devices/loop16
DEBUG [2019-05-02 14:44:15,044] udiskie.config: IgnoreDevice(match={'is_loop': True, 'loop_file': '/*'}, value=False) used for /org/freedesktop/UDisks2/block_devices/loop17
DEBUG [2019-05-02 14:44:15,044] udiskie.config: IgnoreDevice(match={'is_loop': True, 'loop_file': '/*'}, value=False) used for /org/freedesktop/UDisks2/block_devices/loop18
DEBUG [2019-05-02 14:44:15,045] udiskie.config: IgnoreDevice(match={'is_loop': True, 'loop_file': '/*'}, value=False) used for /org/freedesktop/UDisks2/block_devices/loop19
DEBUG [2019-05-02 14:44:15,045] udiskie.config: IgnoreDevice(match={'is_loop': True, 'loop_file': '/*'}, value=False) used for /org/freedesktop/UDisks2/block_devices/loop2
DEBUG [2019-05-02 14:44:15,045] udiskie.config: IgnoreDevice(match={'is_loop': True, 'loop_file': '/*'}, value=False) used for /org/freedesktop/UDisks2/block_devices/loop20
DEBUG [2019-05-02 14:44:15,046] udiskie.config: IgnoreDevice(match={'is_loop': True, 'loop_file': '/*'}, value=False) used for /org/freedesktop/UDisks2/block_devices/loop21
DEBUG [2019-05-02 14:44:15,046] udiskie.config: IgnoreDevice(match={'is_loop': True, 'loop_file': '/*'}, value=False) used for /org/freedesktop/UDisks2/block_devices/loop3
DEBUG [2019-05-02 14:44:15,046] udiskie.config: IgnoreDevice(match={'is_loop': True, 'loop_file': '/*'}, value=False) used for /org/freedesktop/UDisks2/block_devices/loop4
DEBUG [2019-05-02 14:44:15,047] udiskie.config: IgnoreDevice(match={'is_loop': True, 'loop_file': '/*'}, value=False) used for /org/freedesktop/UDisks2/block_devices/loop5
DEBUG [2019-05-02 14:44:15,047] udiskie.config: IgnoreDevice(match={'is_loop': True, 'loop_file': '/*'}, value=False) used for /org/freedesktop/UDisks2/block_devices/loop6
DEBUG [2019-05-02 14:44:15,047] udiskie.config: IgnoreDevice(match={'is_loop': True, 'loop_file': '/*'}, value=False) used for /org/freedesktop/UDisks2/block_devices/loop7
DEBUG [2019-05-02 14:44:15,048] udiskie.config: IgnoreDevice(match={'is_loop': True, 'loop_file': '/*'}, value=False) used for /org/freedesktop/UDisks2/block_devices/loop8
DEBUG [2019-05-02 14:44:15,048] udiskie.config: IgnoreDevice(match={'is_loop': True, 'loop_file': '/*'}, value=False) used for /org/freedesktop/UDisks2/block_devices/loop9

If you need additional data or all all data as indicated in Debug section, I can gladly provide it. Anything.

Regards and thanks,

@coldfix
Copy link
Owner

coldfix commented May 2, 2019

I don't know how to restart udiskie. What I do is run it and then either Ctrl+D, modify config file and run again or run it, click icon and click Exit button.

that should be fine (Ctrl+C / exit).

This time I have done reboot computer an run... Here is the verification:

myuser@mycomputer:~$ udiskie -v
DEBUG [2019-05-02 14:44:14,826] udiskie.config: IgnoreDevice(match={'symlinks': '/dev/mapper/docker-*'}, value=True) created
DEBUG [2019-05-02 14:44:14,826] udiskie.config: IgnoreDevice(match={'symlinks': '/dev/disk/by-id/dm-name-docker-*'}, value=True) created
DEBUG [2019-05-02 14:44:14,826] udiskie.config: IgnoreDevice(match={'is_loop': True, 'loop_file': '/*'}, value=False) created
[...]

Doesn't seem to use the defined filters. Now that I see this, I recall that udiskie learned device_config only recently. Try to replace device_config by ignore_device: instead (same syntax).

If you need additional data or all all data as indicated in Debug section, I can gladly provide it. Anything.

Regards and thanks,

@mixpc
Copy link
Author

mixpc commented May 2, 2019

Doesn't seem to use the defined filters. Now that I see this, I recall that udiskie learned device_config only recently. Try to replace device_config by ignore_device: instead (same syntax).

Success! 👌 😄

Please, let me know if you would like me to submit a request to edit the info files to document this case for Debian users. After your reply, I am closing this case and tagging it as solved.

Regards,

@coldfix
Copy link
Owner

coldfix commented May 2, 2019

You can write something in the wiki. Other than that, there are currently no coherent docs anyway (I might add some from the wiki at some point) and I'd rather not document old syntax that I want to remove eventually in the man pages.

@mixpc mixpc changed the title How to hide/ignore squashfs file system type? [SOLVED][Debian apt-get install] How to hide/ignore squashfs file system type? May 2, 2019
@mixpc mixpc closed this as completed May 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants