Ticket #626 (reopened defect)

Opened 4 years ago

Last modified 7 weeks ago

SoaS: spurious storage devices in Frame on bootup

Reported by: tomeu Owned by: tomeu
Priority: Immediate Milestone: 0.90
Component: sugar Version: Git as of bugdate
Severity: Critical Keywords:
Cc: sascha_silbe, m_anish Distribution/OS: Fedora
Bug Status: Assigned

Description

On Soas-2, when you boot, two devices appear in the frame: /media/boot and /media/F10-PR-i686-Live

None of those bring value to the user, so shouldn't appear there.

Change History

  Changed 4 years ago by FGrose

  • summary changed from spurious storage devices on bootup to spurious storage devices in Frame on bootup
  • status_field changed from Unconfirmed to New

  Changed 4 years ago by tomeu

  • severity changed from Unspecified to Blocker

  Changed 4 years ago by tomeu

This seems to work here:

diff --git a/extensions/deviceicon/volume.py b/extensions/deviceicon/volume.py
index 5c4c49e..1dcabfb 100644
--- a/extensions/deviceicon/volume.py
+++ b/extensions/deviceicon/volume.py
@@ -109,6 +109,9 @@ def _mount_removed_cb(volume_monitor, mount, tray):
     del _icons[mount]
 
 def _add_device(mount, tray):
+    if mount.get_drive() is None or not mount.get_drive().is_media_removable():
+        return
+
     icon = DeviceView(mount)
     _icons[mount] = icon
     tray.add_device(icon)
diff --git a/src/jarabe/journal/volumestoolbar.py b/src/jarabe/journal/volumestoolbar.py
index b21832e..69516c4 100644
--- a/src/jarabe/journal/volumestoolbar.py
+++ b/src/jarabe/journal/volumestoolbar.py
@@ -78,6 +78,9 @@ class VolumesToolbar(gtk.Toolbar):
     def _add_button(self, mount):
         logging.debug('VolumeToolbar._add_button: %r' % mount.get_name())
 
+        if mount.get_drive() is None or not mount.get_drive().is_media_removable():
+            return
+
         button = VolumeButton(mount)
         button.props.group = self._volume_buttons[0]
         button.connect('toggled', self._button_toggled_cb)

follow-up: ↓ 6   Changed 4 years ago by sascha_silbe

  • cc sascha_silbe added

What about USB harddisks? Is it fine that they won't be automounted (which would probably happen after applying the patch, as they're not removable media)?

  Changed 4 years ago by tomeu

A better patch, because in some systems mounts won't have a drive associated:

diff --git a/extensions/deviceicon/volume.py b/extensions/deviceicon/volume.py
index 96d0796..4b12eab 100644
--- a/extensions/deviceicon/volume.py
+++ b/extensions/deviceicon/volume.py
@@ -33,6 +33,7 @@ from sugar.graphics import style
 from jarabe.journal import journalactivity
 from jarabe.view.palettes import VolumePalette
 from jarabe.frame.frameinvoker import FrameWidgetInvoker
+from jarabe import util
 
 _icons = {}
 
@@ -115,6 +116,10 @@ def _mount_removed_cb(volume_monitor, mount, tray):
     del _icons[mount]
 
 def _add_device(mount, tray):
+
+    if util.should_ignore_mount(mount):
+        return
+
     icon = DeviceView(mount)
     _icons[mount] = icon
     tray.add_device(icon)
diff --git a/src/jarabe/journal/volumestoolbar.py b/src/jarabe/journal/volumestoolbar.py
index b21832e..651962f 100644
--- a/src/jarabe/journal/volumestoolbar.py
+++ b/src/jarabe/journal/volumestoolbar.py
@@ -28,6 +28,7 @@ from sugar.graphics.xocolor import XoColor
 
 from jarabe.journal import model
 from jarabe.view.palettes import VolumePalette
+from jarabe import util
 
 class VolumesToolbar(gtk.Toolbar):
     __gtype_name__ = 'VolumesToolbar'
@@ -78,6 +79,9 @@ class VolumesToolbar(gtk.Toolbar):
     def _add_button(self, mount):
         logging.debug('VolumeToolbar._add_button: %r' % mount.get_name())
 
+        if util.should_ignore_mount(mount):
+            return
+
         button = VolumeButton(mount)
         button.props.group = self._volume_buttons[0]
         button.connect('toggled', self._button_toggled_cb)
@@ -165,8 +169,6 @@ class VolumeButton(BaseButton):
 
     def create_palette(self):
         palette = VolumePalette(self._mount)
-        #palette.props.invoker = FrameWidgetInvoker(self)
-        #palette.set_group_id('frame')
         return palette
 
 class JournalButton(BaseButton):
diff --git a/src/jarabe/util/__init__.py b/src/jarabe/util/__init__.py
index 1610dd0..267208a 100644
--- a/src/jarabe/util/__init__.py
+++ b/src/jarabe/util/__init__.py
@@ -17,3 +17,10 @@
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 
+def should_ignore_mount(mount):
+    drive = mount.get_drive()
+    if drive is not None and not drive.is_media_removable():
+        # Mounts in drives that aren't removable aren't interesting
+        return True
+
+    return False

in reply to: ↑ 4   Changed 4 years ago by tomeu

Replying to sascha_silbe:

What about USB harddisks? Is it fine that they won't be automounted (which would probably happen after applying the patch, as they're not removable media)?

Sascha is right, just plugged in a usb hard disk and it wasn't recognized in the same way as usb sticks are.

  Changed 4 years ago by tomeu

Have checked the way Nautilus displays removable devices and is quite similar to ours, probably displaying the same problem on fedora live images. We should check if that's the case and work with upstream in a common solution.

  Changed 4 years ago by tomeu

Entered bugs for nautilus, I hope the solution that is found for nautilus is also valid for Sugar:

 https://bugzilla.redhat.com/show_bug.cgi?id=495029
 https://bugzilla.redhat.com/show_bug.cgi?id=495033

  Changed 4 years ago by tomeu

Good progress happened yesterday, will update soas after the weekend and check where we are at.

  Changed 4 years ago by sdz

  • status changed from new to closed
  • resolution set to fixed
  • status_field changed from New to Resolved

Confirmed to be fixed with latest gvfs and DeviceKit-disks from Rawhide.

  Changed 4 years ago by tomeu

  • status changed from closed to reopened
  • resolution fixed deleted

This one seems to have come to life again, reopened:

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

  Changed 4 years ago by erikos

  • status_field changed from Resolved to Assigned

sdz, we have to be watch out for this one as well - as it was not on our list yesterday.

  Changed 4 years ago by alsroot

  • priority changed from Unspecified by Maintainer to Immediate
  • milestone changed from 0.84 to 0.86

Another related use cases: #995, #1357

  Changed 4 years ago by erikos

  • severity changed from Blocker to Critical

  Changed 3 years ago by sascha_silbe

  • distribution changed from SoaS to Unspecified
  • component changed from sugar to SoaS

Bulk change distribution=SoaS -> component=SoaS

  Changed 3 years ago by sdz

  • component changed from SoaS to sugar

This is a sugar issue that got accidentally assigned to SoaS during an auto-tag. Reassigning - sorry for the confusion.

  Changed 3 years ago by bernie

Is this still a problem in 0.88 or 0.90? If so, we should change milestone

  Changed 3 years ago by sascha_silbe

At least with Sugar 0.89 on Debian Squeeze I get Frame device icons for partitions and LVs mounted at boot time.
On one of my systems it even tries to mount / a second time:

1282377612.372566 DEBUG root: _mount_cb <__main__.GProxyVolume at 0xa43c57c: xo15-sascha-root> <gio.SimpleAsyncResult object at 0xa91293c (GSimpleAsyncResult at 0xa94f700)>
Traceback (most recent call last):
  File "/usr/share/sugar/extensions/deviceicon/volume.py", line 107, in _mount_cb
    volume.mount_finish(result)
glib.GError: Error mounting: mount exited with exit code 1: helper failed with:
mount: according to mtab, /dev/mmcblk0p1 is already mounted on /
mount failed

I can open a new ticket for the latter issue if you think it's unrelated.

Why is this set to Critical, BTW? I don't see any potential for data loss, crashes or similar.

  Changed 3 years ago by sascha_silbe

  • milestone changed from 0.86 to 0.90

  Changed 2 years ago by m_anish

  • cc m_anish added

  Changed 7 weeks ago by manuq

  • distribution changed from Unspecified to Fedora
  • summary changed from spurious storage devices in Frame on bootup to SoaS: spurious storage devices in Frame on bootup
Note: See TracTickets for help on using tickets.