For additional reference, you can refer to lib/SystemImager/Common.pm.
Just search for LABEL.  This is something that prepareclient has to do.

Here's the function of interest:

# Usage:
# %array = get_mounted_devs_by_mount_point_array();
# my %mounted_devs_by_mount_point =
# get_mounted_devs_by_mount_point_array();
sub get_mounted_devs_by_mount_point_array {

    # Create an array that we can use to put appropriate LABEL and UUID
    # info
    # into the fstab stanza of the autoinstallscript.conf file. -BEF-
    #
    my %mounted_devs_by_mount_point;
    my $cmd = "mount";
    open (FH, "$cmd|") or croak("Couldn't execute $cmd to read the output.");
        while (<FH>) {
            my ($dev, $on, $mp) = split;
            $mounted_devs_by_mount_point{$mp}=$dev;
    }
    close(FH);
    return %mounted_devs_by_mount_point;
}


-Brian



Thus spake Sean Dague ([EMAIL PROTECTED]):
> 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.
> __________________________________________________________________



-- 
---------------------------------------------------------
 Brian Elliott Finley                Phone: 630.803.8183
 GPG: 3FF8 D096 0E0C D3F3 29B7  6518 D20B 1931 10F8 EE52
---------------------------------------------------------


-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
SourceForge.net hosts over 70,000 Open Source Projects.
See the people who have HELPED US provide better services:
Click here: http://sourceforge.net/supporters.php
_______________________________________________
Sisuite-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/sisuite-devel

Reply via email to