Ignore EFI partition on Intel Macs

Bug #394088 reported by John Haitas
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mactel Support
Fix Released
Undecided
Unassigned
gvfs
Unknown
Low
obsolete
Fix Released
Medium
devicekit-disks (Ubuntu)
Fix Released
Undecided
Martin Pitt
Karmic
Fix Released
Undecided
Martin Pitt

Bug Description

Binary package hint: devicekit

$ lsb_release -rd
Description: Ubuntu karmic (development branch)
Release: 9.10

$ apt-cache policy devicekit
devicekit:
  Installed: 003-1
  Candidate: 003-1
  Version table:
 *** 003-1 0
        500 http://us.archive.ubuntu.com karmic/main Packages
        100 /var/lib/dpkg/status

What is expected:
Login without additional password prompts after GDM login

What happened instead:
DeviceKit tries to automount EFI partition on Intel Mac under dual boot conditions during GNOME login.

User is presented with password prompt at GNOME login (see attached screenshot)

Revision history for this message
John Haitas (jhaitas) wrote :
Revision history for this message
Martin Pitt (pitti) wrote :

Please include the output of

  devkit-disks --dump
  gvfs-mount -li

Thanks!

Changed in devicekit (Ubuntu):
status: New → Incomplete
Revision history for this message
Martin Pitt (pitti) wrote :

The automounting problem is already covered in bug 396448, but it seems that we shouldn't offer the EFI partition at all (which I'll use this bug for).

summary: - DeviceKit tries to automount EFI partition on Intel Mac at GNOME login
+ Ignore EFI partition on Intel Macs
Martin Pitt (pitti)
affects: devicekit (Ubuntu) → devicekit-disks (Ubuntu)
Revision history for this message
John Haitas (jhaitas) wrote :

devkit-disks --dump

Revision history for this message
John Haitas (jhaitas) wrote :

gvfs-mount -li

Revision history for this message
Martin Pitt (pitti) wrote :

John,

I'm afraid you accidentally attached the devkit-disks dump twice. Can you please attach the gvfs-mont -li output?

Revision history for this message
John Haitas (jhaitas) wrote :

Martin,
Apologies for my sloppiness there. Here is the output of gvfs-mount -li

gvfs-mount -li

Revision history for this message
In , Zeuthen (zeuthen) wrote :
Revision history for this message
In , Martin Pitt (pitti) wrote :

Right, makes sense. I'll cook a patch for this.

affects: devicekit-disks (Ubuntu) → gvfs (Ubuntu)
Changed in gvfs (Ubuntu):
status: Incomplete → Triaged
Changed in gvfs:
status: Unknown → New
Revision history for this message
In , Martin Pitt (pitti) wrote :

I tested this with my /dev/sda3 which is an unused ext3 partition:

ENV{ID_FS_TYPE}=="ext3", ENV{ID_FS_LABEL}=="test", ENV{DKD_PRESENTATION_HIDE}="1"

This works for udev (I get exactly one match):

$ udevadm info --export-db|grep PRES
E: DKD_PRESENTATION_HIDE=1

and I confirm that the current gdu exports this property correctly and gvfs honors it ("test" does not appear in computer place and places menu any more).

Revision history for this message
In , Martin Pitt (pitti) wrote :

Created an attachment (id=27563)
patch

Here's the git format-patch. Can't commit this yet (requested in bug 22578).

Revision history for this message
In , Zeuthen (zeuthen) wrote :

Hi, thanks for working on this.

> +# Apple Bootstrap partitions
> +ENV{ID_FS_TYPE}=="hfs", ENV{ID_FS_LABEL}=="bootstrap", ENV{DKD_PRESENTATION_HIDE}="1"

It's probably better keying off partition type, here's the relevant udev data from my Powerbook 12" G4

 E: DKD_PARTITION=1
 E: DKD_PARTITION_SCHEME=apm
 E: DKD_PARTITION_NUMBER=2
 E: DKD_PARTITION_TYPE=Apple_Bootstrap
 E: DKD_PARTITION_SIZE=1048576
 E: DKD_PARTITION_LABEL=untitled
 E: DKD_PARTITION_FLAGS=allocated allow_read allow_write

So I think we can just key off SCHEME=="apm" and TYPE=="Apple_Bootstrap".

> +
> +# EFI firmware partitions
> +ENV{ID_FS_TYPE}=="vfat", ENV{ID_FS_LABEL}=="EFI", > ENV{DKD_PRESENTATION_HIDE}="1"

Would also be better to key off partition type here, see below

> +# recovery partitions

This looks fine. Except that the line is really long; does udev support breaking string literals into multiple lines the same way you can do in C? If not, it's not a big deal...

Also For MBR, we should set PRESENTATION_IGNORE to 1 if

 - (DKD_PARTITION_TYPE=0x00 or
    DKD_PARTITION_TYPE=0x11 or
    DKD_PARTITION_TYPE=0x14 or
    DKD_PARTITION_TYPE=0x16 or
    DKD_PARTITION_TYPE=0x17 or
    DKD_PARTITION_TYPE=0x1b or
    DKD_PARTITION_TYPE=0x1c or
    DKD_PARTITION_TYPE=0x1e or
    DKD_PARTITION_TYPE=0x27 or
    DKD_PARTITION_TYPE=0x3d or
    DKD_PARTITION_TYPE=0x84 or
    DKD_PARTITION_TYPE=0x8d or
    DKD_PARTITION_TYPE=0x90 or
    DKD_PARTITION_TYPE=0x91 or
    DKD_PARTITION_TYPE=0x92 or
    DKD_PARTITION_TYPE=0x93 or
    DKD_PARTITION_TYPE=0x97 or
    DKD_PARTITION_TYPE=0x98 or
    DKD_PARTITION_TYPE=0x9a or
    DKD_PARTITION_TYPE=0x9b or
    DKD_PARTITION_TYPE=0xbb or
    DKD_PARTITION_TYPE=0xc2 or
    DKD_PARTITION_TYPE=0xc3 or
    DKD_PARTITION_TYPE=0xdd or
    DKD_PARTITION_TYPE=0xfe)
   and
    DKD_PARTITION_SCHEME=mbr

cf. http://www.win.tue.nl/~aeb/partitions/partition_types-1.html

and for GPT

 - (DKD_PARTITION_TYPE=C12A7328-F81F-11D2-BA4B-00A0C93EC93B or
    DKD_PARTITION_TYPE=21686148-6449-6E6F-744E-656564454649)
   and
    DKD_PARTITION_SCHEME=gpt

   cf. http://en.wikipedia.org/wiki/GUID_Partition_Table#Partition_type_GUIDs

I think the former match should take care of EFI partitions.

Would also be good to reference those websites in the rules file. Probably also easier to use udev's | or operator e.g. TYPE=0x00|0x11|0x14|...

You should be able to change the partition type with Palimpsest to check that things are hidden/unhidden on the fly...

Revision history for this message
In , Martin Pitt (pitti) wrote :

> Except that the line is really long; does udev support breaking string literals > into multiple lines the same way you can do in C

Unfortunately it doesn't know about the

   "string"
   "continuation"

schema; you can do

ENV{ID_FS_TYPE}=="ntfs|vfat|ext3", ENV{ID_FS_LABEL}=="RECOVERY|PQSERVICE|HP_RECOVERY|test|\
Recovery Partition|DellUtility|DellRestore|IBM_SERVICE|SERVICEV001|SERVICEV002", \
  ENV{DKD_PRESENTATION_HIDE}="1"

but IMHO that looks worse.

Revision history for this message
In , Zeuthen (zeuthen) wrote :

(In reply to comment #5)
> Unfortunately it doesn't know about the
>
> "string"
> "continuation"
>
> schema; you can do
>
> ENV{ID_FS_TYPE}=="ntfs|vfat|ext3",
> ENV{ID_FS_LABEL}=="RECOVERY|PQSERVICE|HP_RECOVERY|test|\
> Recovery
> Partition|DellUtility|DellRestore|IBM_SERVICE|SERVICEV001|SERVICEV002", \
> ENV{DKD_PRESENTATION_HIDE}="1"
>
> but IMHO that looks worse.
>

Agreed, let's just go for a single line then.

Revision history for this message
In , Martin Pitt (pitti) wrote :

Sorry, bugzilla broke lines unfortunately. So, you can break a line (including string literals) with \, but nothing else (see udev/udev-rules.c, parse_file()).

Thanks for the bootstrap udev/dk values and the links, I'll update the patch accordingly.

Revision history for this message
In , Martin Pitt (pitti) wrote :

Taking notes...

 - EFI mbr partition is 0xef, not 0xfe
 - we can drop PQSERVICE label check, it's mbr type 0x27

Revision history for this message
In , Martin Pitt (pitti) wrote :

Created an attachment (id=27569)
now with checking schema/type

I asked the original reporter in https://launchpad.net/bugs/394088 to supply an udev db dump, just to make double-sure that his EFI partition indeed matches these properties.

I tested these rules on my system by changing the partition type in palimpsest, and confirm that GNOME hides/shows partitions on the fly according to their type.

Revision history for this message
In , Martin Pitt (pitti) wrote :

Hah, nice. The original reporter sent his udev db dump (http://launchpadlibrarian.net/28891060/udev-db.txt) which perfectly matches your URLs and the patch:

E: DEVNAME=/dev/sda1
E: ID_FS_LABEL=EFI
E: ID_FS_LABEL_ENC=EFI
E: DKD_PARTITION_SCHEME=gpt
E: DKD_PARTITION_NUMBER=1
E: DKD_PARTITION_TYPE=C12A7328-F81F-11D2-BA4B-00A0C93EC93B
E: DKD_PARTITION_LABEL=EFI System Partition

Martin Pitt (pitti)
affects: gvfs (Ubuntu) → devicekit-disks (Ubuntu)
Changed in devicekit-disks (Ubuntu):
assignee: nobody → Martin Pitt (pitti)
Changed in devicekit:
status: Unknown → Confirmed
Martin Pitt (pitti)
Changed in devicekit-disks (Ubuntu):
status: Triaged → In Progress
Martin Pitt (pitti)
Changed in mactel-support:
status: New → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package devicekit-disks - 005-0ubuntu2

---------------
devicekit-disks (005-0ubuntu2) karmic; urgency=low

  * Add 0001-hide-recovery-and-boot-partitions-from-desktops.patch: Hide
    system, recovery, and boostrap partitions from desktops by setting the
    DKD_PRESENTATION_HIDE property. Direct port from the old hal rules.
    (submitted to FD #22707) (LP: #394088)

 -- Martin Pitt <email address hidden> Fri, 10 Jul 2009 17:08:50 +0200

Changed in devicekit-disks (Ubuntu Karmic):
status: In Progress → Fix Released
Revision history for this message
Martin Pitt (pitti) wrote :

John,

with upstream I'm just discussing a refinement of these rules to cover more partition types, etc. For that I need an udev dump. Could you please do

  udevadm info --export-db > /tmp/udev-db.txt

and attach /tmp/udev-db.txt here? Thanks!

Revision history for this message
John Haitas (jhaitas) wrote :

Martin,

No problem, thanks for you effort resolving this bug.

Cheers

udevadm info --export-db > udev-db.txt

Changed in devicekit:
status: Confirmed → In Progress
Changed in gvfs:
status: New → Invalid
Revision history for this message
In , Zeuthen (zeuthen) wrote :

Pushed to master, thanks!

Changed in devicekit:
status: In Progress → Fix Released
Changed in devicekit:
importance: Unknown → Medium
Changed in gvfs:
importance: Unknown → Low
status: Invalid → Unknown
Changed in devicekit:
importance: Medium → Unknown
Changed in devicekit:
importance: Unknown → Medium
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.