[prev in list] [next in list] [prev in thread] [next in thread]
List: initramfs
Subject: Re: [PATCH 20/18] Abstract out vol_id vs. blkid usage
From: Karel Zak <kzak () redhat ! com>
Date: 2009-08-20 13:08:15
Message-ID: 20090820130815.GB6653 () nb ! net ! home
[Download RAW message or body]
On Thu, Aug 20, 2009 at 07:32:30AM -0500, Victor Lowther wrote:
> On Thu, 2009-08-20 at 11:44 +0200, Karel Zak wrote:
> > On Wed, Aug 19, 2009 at 10:25:01PM -0500, Victor Lowther wrote:
> > > Since different distros may or may not use vol_id in udev, and blkid
> > > is generally replacing vol_id, abstract them out into a function which
> > > tries to use vol_id first and blkid second, on the assumption that
> > > blkid can take over for vol_id if vol_id is no longer there.
> > > ---
> > > dracut-functions | 11 +++++++++++
> > > modules.d/90crypt/check | 2 +-
> > > modules.d/90dmraid/check | 2 +-
> > > modules.d/90lvm/check | 4 ++--
> > > modules.d/90mdraid/check | 2 +-
> > > 5 files changed, 16 insertions(+), 5 deletions(-)
> > >
> > > diff --git a/dracut-functions b/dracut-functions
> > > index 1df2045..655d311 100755
> > > --- a/dracut-functions
> > > +++ b/dracut-functions
> > > @@ -48,6 +48,17 @@ derror() {
> > > [[ -w $dracutlogfile ]] && echo "E: $@" >>"$dracutlogfile"
> > > }
> > >
> > > +get_fs_type() (
> > > + if [[ -x /lib/udev/vol_id ]]; then
> > > + eval /usr/udev/vol_id --export $1
> > > + echo $ID_FS_TYPE
> > > + elif find_binary >/dev/null; then
> > > + blkid -o value -s TYPE $1
> >
> > This is to expensive, the blkid(8) supports two modes: low-level and
> > high-level. The low-level mode together with "-o udev" is replacement
> > of vol_id.
>
> Expensive in what way?
The high-level mode (blkid without -p option) parses and updates
/etc/blkid.tab cache.
Karel
--
Karel Zak <kzak@redhat.com>
--
To unsubscribe from this list: send the line "unsubscribe initramfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic