2010/9/24 Tomasz Torcz <[email protected]>: > On Fri, Sep 24, 2010 at 12:22:34PM +0200, Kay Sievers wrote: >> On Fri, Sep 24, 2010 at 12:06, <[email protected]> wrote: >> > From: Harald Hoyer <[email protected]> >> > >> > btrfs returns a major(0) for its device, so try to find the mountpoint and >> > real device. >> >> > + fp = fopen("/proc/self/mountinfo", "r"); >> > + if (fp == NULL) >> > + return NULL; >> > + while (fscanf(fp, "%*s %*s %i:%i %*s %1024s %*s %*s %*s %1024s >> > %*[^\n]", &maj, &min, mp, dev) >> >> Using device names from this file is not nice. I have just /dev/root >> here. Shouldn't we just read the kernel commandline instead? > > Kernel commandline could have root=UUID or LABEL there... and btrfs is > strange beast, being a multi-device filesystem. I believe it could return > any of underlaying device and run in raid0, 1, 10, soon raid 5/6 > configuration. > > "grubby" packages in fedora had similar problem with finding proper root > device, see: https://bugzilla.redhat.com/show_bug.cgi?id=530108 for comments > and patches.
Awesome! mtab parsing. Nobody sane has that file anymore. :) Kay _______________________________________________ systemd-devel mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/systemd-devel
