below is my current config.pl that does this.  It helps reduce space on the 
HDD by copying only the required drivers to the hdd.  All textmode stuff is 
still turned on, but I don't have anything much in that section of the 
install.

$u->{'_meta'}->{'drivers_dir'} = 'none';

# Function to set Driver Paths for Each Machine
# Drivers Should be stored in Z:\Drivers\<driver-set>\
# all drivers for a given machine/type should be stored here.
# drivers will be copied to machines before installation
sub oem_pnp_dirs ($;$) {
    my $media_obj = Unattend::WinMedia->new ($u->{'_meta'}->{'OS_media'});
    my $oem_system_dir = "z:\\Drivers\\".$u->{'_meta'}->{'drivers_dir'};

    print "Looking for drivers under $oem_system_dir...\n";

    my @ret = $media_obj->oem_pnp_dirs (1, $oem_system_dir);
    #my @ret = $media_obj->oem_pnp_dirs (1);

    $verbose && scalar @ret == 0
        and print "...no driver directories found.\n";

    foreach $dir (@ret)
    {
      push(@dirs, "Drivers\\".$dir);
    }

    return join ';', @dirs;
}

sub pnp_drivers_path () {
    my $oem_system_dir = "z:\\Drivers\\".$u->{'_meta'}->{'drivers_dir'};
    print "Looking for drivers under $oem_system_dir...\n";
    unless (-d $oem_system_dir) {
        print "...no such directory.  Continuing.\n";
        return undef;
    }

# FIXE: Must support new methods of finding PNP drivers
    my @pnp_driver_dirs = oem_pnp_dirs ($oem_system_dir);
    if (scalar @pnp_driver_dirs == 0) {
        print "...no driver directories found.  Continuing\n";
        return undef;
    }

    print "...found some driver directories.  Please choose which to add.\n";
    # Use references to strings as magic return tokens.
    my @dirs;
    foreach $dir (@pnp_driver_dirs)
    {
      push(@dirs, "Drivers\\".$dir);
    }


    return join ';', @dirs;
}

#Open PC file and find The Current PC as its parameters
# File format Tab seperated list
#       Computer Name           MYCOMPUTER
#       MAC Address             00004455AACC
#       Operating System        <win2k|winxp|winxpoem>
#       Software Script         top (runs top.bat to install apps)
#       Driver Directory        IBM6288
#       Admin Password          password

# New Method, use database
# get all data to stdout in \t seperated format
# if exit_status is not 0 there was a problem.
my $exit_status = system( "/z/linuxaux/bin/qsql \"select pc, netcard, mac, os, 
apps, drivers, admin_pass from pc where mac='".
$u->{'_meta'}->{'macaddr'}."'\"");

if ($exit_status == 0) {
        #$! get stdout from previous system call
        ($pc,$card,$mac,$os,$software,$drivers,$passd) = split(/\t/,chop($!));
        $u->{'_meta'}->{'OS'} = $os;
        $u->{'GuiUnattended'}->{'AdminPassword'} = $passd;
        $u->{'Identification'}->{'DomainAdmin'} = 'DVCNET\buildcreate';
        $u->{'Identification'}->{'DomainAdminPassword'} = 'build23logout';
        $u->{'_meta'}->{'top'} = $software;
        $u->{'UserData'}->{'ComputerName'} = $pc;
        $u->{'_meta'}->{'drivers_dir'} = $drivers;
} else {
        # Computer Not in database
        print $!;
        croak "Computer Not Found, Please Add it do the list";
}

if ( $mac != $u->{'_meta'}->{'macaddr'}) {
    print $u->{'_meta'}->{'macaddr'};
    croak "Computer Not Found, Please Add it do the list";
    # I should ask questions here, and get it added to the list
    # of newpc's like in the old version.
}

#Make boot mac address, strip leading 0's from bytes, last 8 bytes.
#00AABB0DCCE0 -> 0AABBDCCE0 -> ABBDCCE0

my $mac = $u->{'_meta'}->{'macaddr'};
my $newmac = "";
for ($i=0; $i<6 ;$i++) {
    $j=substr($mac,($i*2),2);
    if (substr($j,0,1) eq "0") {
        $j=substr($j,1);
    }
    $newmac = $newmac . $j;
}
$newmac = substr($newmac,-8);

#Now set doit to tell machine to boot from local machine
my $copying;
if ($is_linux) {
   copy (dos_to_host('z:\\tftpboot\\pxelinux.cfg\\hdd'),
         dos_to_host('z:\\tftpboot\\pxelinux.cfg\\$newmac'));
   undef $u->{'_meta'}->{'format_cmd'};
   $copying = "mkdir C:\\Drivers;xcopy /S /Y Z:\\Drivers\\$drivers C:
\\Drivers;";
} else {
   $copying = "copy /Y z:\\tftpboot\\pxelinux.cfg\\hdd z:
\\tftpboot\\pxelinux.cfg\\$newmac;";
   # Set doit.bat to copy drivers to machine to install.
   $copying .= "mkdir C:\\Drivers;xcopy /Y /S z:\\Drivers\\$drivers c:
\\Drivers\\;";
}
$u->{'_meta'}->{'doit_cmds'} = $copying . $u->{'_meta'}->{'doit_cmds'};

# Set PNP drivers.
$u->{'Unattended'}->{'OemPnPDriversPath'} = \&oem_pnp_dirs;

On Mon, 14 Jun 2004 10:02 pm, Krismark Consulting Pty Ltd wrote:
> Hi
> Is it possible to modify the install for OEM drivers.
>
> I want to group drivers in a directory ( eg by motherboard) and only have
> these directories shown in the list of oem drivers to install. Any driver
> under that directory is to be automatically installed
>
>
> Regards
>
> Mark Gibbons


-------------------------------------------------------
This SF.Net email is sponsored by The 2004 JavaOne(SM) Conference
Learn from the experts at JavaOne(SM), Sun's Worldwide Java Developer
Conference, June 28 - July 1 at the Moscone Center in San Francisco, CA
REGISTER AND SAVE! http://java.sun.com/javaone/sf Priority Code NWMGYKND
_______________________________________________
unattended-info mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/unattended-info

Reply via email to