On Tue, Oct 14, 2003 at 12:18:53AM -0600, dann wrote:
> On Fri, Oct 10, 2003 at 10:05:40AM -0400, Gary Molenkamp wrote:
> >
> > I'm trying to get rid of the hacks in systemconfigurator, but I've hit
> > this problem.
> >
> > When you are calling get_mountinfo to find the boot device, you are doing
> > a pattern match search for the path as compared to entries in /etc/fstab:
> >
> > while(<FSTAB>) {
> > s/#.*//; ## strip comments
> > if (m,^\s*(/dev/\S+\d+)\s+$file\s,) {
> >
> > However, if the fstab file relies on labels (as is the default install
> > for redhat/not sure about debian), it will look something like
> > the following:
> >
> > LABEL=/ / ext3 defaults 1 1
> > LABEL=/boot /boot ext3 defaults 1 2
> >
> > The systemconfig will then fail to get the boot device.
> >
> > This info can be gleaned from mount in this case.
>
> on a normal running system, yes. however, mount just reads /etc/mtab,
> which is not accurate at the time sc runs.
>
> we can assume proc is mounted though, and this information is in
> /proc/mounts. i wonder if there's an issue with using it instead.
Dann,
Check out lib/Boot/Labels.pm. This was created to do just this for the grub
device conversion. The iterface isn't as great as I would like, but it does
get the job done, and will create a mapping of labels to devices to figure
out this information.
-Sean
--
__________________________________________________________________
Sean Dague Mid-Hudson Valley
sean at dague dot net Linux Users Group
http://dague.net http://mhvlug.org
There is no silver bullet. Plus, werewolves make better neighbors
than zombies, and they tend to keep the vampire population down.
__________________________________________________________________
pgp00000.pgp
Description: PGP signature
