Re: Linux & FAT32 label
From: Karel Zak
Date: Mon Nov 06 2017 - 05:14:56 EST
On Sun, Nov 05, 2017 at 03:34:11PM +0100, Pali Rohár wrote:
> On Sunday 05 November 2017 16:25:54 Andy Shevchenko wrote:
> > On Sun, Nov 5, 2017 at 4:07 PM, Pali Rohár <pali.rohar@xxxxxxxxx> wrote:
> > > On Sunday 05 November 2017 15:56:53 Andy Shevchenko wrote:
> > >> On Sun, Nov 5, 2017 at 3:39 PM, Pali Rohár <pali.rohar@xxxxxxxxx> wrote:
> > >> > On Tuesday 31 October 2017 10:35:48 Andy Shevchenko wrote:
> > >> >> On Mon, Oct 16, 2017 at 4:12 AM, Andreas Bombe <aeb@xxxxxxxxxx> wrote:
> > >> >> > On Thu, Oct 12, 2017 at 10:49:31PM +0200, Pali Rohár wrote:
> > >> >> >> On Thursday 12 October 2017 12:13:11 Karel Zak wrote:
> > >>
> > >> >> > I was worried that there might be some scripts or programs that expect
> > >> >>
> > >> >> If we really care about such scripts another approach might be to
> > >> >> introduce a CLI switch to "spec compatible mode" to each tool and
> > >> >> suggest in documentation to use it.
> > >> >>
> > >> >> There are also variants:
> > >> >> - spec compatible
> > >> >> - WinXX compatible
> > >> >> - DOS compatible
> > >> >> - etc
> > >> >
> > >> > I did tests with MS-DOS and Windows versions (results in previous
> > >> > email), and they seems to be compatible how they read label.
> > >> >
> > >> > Based on results I would suggest to ignore label from the boot sector
> > >> > when reading label.
> > >>
> > >> So, for tools which are not doing that to add
> > >>
> > >> --ignore-boot-sector-label (or alike) [recommended]
> > >>
> > >> right?
> > >>
> > >> We don't actually know how many users (scripts) are relying on current
> > >> behaviour.
> > >> If there are only few, we may introduce backward compatibility switch
> > >>
> > >> --read-boot-sector-label
The current recommended way how to get filesystem label is to read it
from udev db. For example this is the way how lsblk reads labels by
default.
And udevd and some another tools are linked with libblkid. I don't
see an elegant way how to support something like "read-boot-sector-label"
switch for the library to switch it on the fly.
Maybe it would be good enough to change the default behavior and add
#ifdef to the library to switch to the old behavior. This is elegant
way how to move the decision to downstream maintainers. They have more
clue about importance of the FAT32 usage. I can imagine that for example
for some embedded systems it's more important than for example for
Fedora desktop. I prefer this solution.
The another way is to add an option to blkid.conf, but it will make
filesystems probing more complex and slow (we don't read the file
during superblocks probing now). I'm sure udev guys will hate me with
this solution. I'd like to avoid something like this.
Karel
--
Karel Zak <kzak@xxxxxxxxxx>
http://karelzak.blogspot.com