From 35869b7a8150cea0f15746d7697b7a78a93b3f4f Mon Sep 17 00:00:00 2001 From: jbjohnso Date: Tue, 26 Jun 2012 15:49:17 +0000 Subject: [PATCH] Correct various mistakes in the RHEL5 driver disk injection code git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@13170 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/xcat/plugins/anaconda.pm | 25 +++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/anaconda.pm b/xCAT-server/lib/xcat/plugins/anaconda.pm index 6d9bcfb78..c2a8b1521 100644 --- a/xCAT-server/lib/xcat/plugins/anaconda.pm +++ b/xCAT-server/lib/xcat/plugins/anaconda.pm @@ -1835,11 +1835,13 @@ sub insert_dd { xCAT::Utils->runcmd($cmd, -1); # Get the entries from modinfo + my $drivername; open (DDMODINFO, "<", "$dd_dir/mnt/modinfo"); while () { if ($_ =~ /^Version/) { next; } - if ($_ =~ /^(\S*)/) { + if ($_ =~ /^(\S+)/) { push @dd_drivers, $1; + $drivername=$1; } push @modinfo, $_; } @@ -1850,12 +1852,29 @@ sub insert_dd { xCAT::Utils->runcmd($cmd, -1); # Append the modules.dep - $cmd = "cat $dd_dir/mnt/modules.dep >> $dd_dir/initrd_img/modules/modules.dep"; - xCAT::Utils->runcmd($cmd, -1); + my $depfile; + my $target; + open($target,">>","$dd_dir/initrd_img/modules/modules.dep"); + open($depfile,"<","$dd_dir/mnt/modules.dep"); + my $curline; + while ($curline=<$depfile>) { + if ($curline !~ /:/) { #missing the rather important first half of the equation here.... + $curline = $drivername.": ".$curline; + } + print $target $curline; + } + close($target); + close($depfile); # Append the pcitable + if (-r "$dd_dir/mnt/pcitable") { $cmd = "cat $dd_dir/mnt/pcitable >> $dd_dir/initrd_img/modules/pcitable"; xCAT::Utils->runcmd($cmd, -1); + } + if (-r "$dd_dir/mnt/modules.pcimap") { + $cmd = "cat $dd_dir/mnt/modules.pcimap >> $dd_dir/initrd_img/modules/modules.pcimap"; + xCAT::Utils->runcmd($cmd, -1); + } $cmd = "umount -f $dd_dir/mnt"; xCAT::Utils->runcmd($cmd, -1);