From 18d6398e029759137f6949f1e83e54ff8e603595 Mon Sep 17 00:00:00 2001 From: daniceexi Date: Wed, 25 Sep 2013 02:05:39 -0400 Subject: [PATCH] defect 3783: add the missing driver for sles11.3; fix the bug of adding new drivers with incorrect order --- xCAT-server/share/xcat/netboot/sles/genimage | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/xCAT-server/share/xcat/netboot/sles/genimage b/xCAT-server/share/xcat/netboot/sles/genimage index a619a80e0..98f0b77be 100755 --- a/xCAT-server/share/xcat/netboot/sles/genimage +++ b/xCAT-server/share/xcat/netboot/sles/genimage @@ -794,7 +794,7 @@ if (@new_order) { } # add drivers for local disk support -push @ndrivers, ("ext3.ko", "virtio_pci.ko", "virtio_blk.ko", "ata_piix.ko", "libata.ko", "scsi_mod.ko", "ibmvscsi.ko", "megaraid_sas.ko", "pcieport.ko", "scsi_mod.ko", "sd_mod.ko"); +push @ndrivers, ("ext3.ko", "ext4.ko", "virtio_pci.ko", "virtio_blk.ko", "ata_piix.ko", "libata.ko", "scsi_mod.ko", "ibmvscsi.ko", "ibmvscsic.ko", "megaraid_sas.ko", "pcieport.ko", "sd_mod.ko"); open($moddeps,"<","$rootimg_dir/lib/modules/$kernelver/modules.dep"); my @moddeps = <$moddeps>; @@ -811,15 +811,24 @@ while (scalar @checkdeps) { foreach $dep (@deps) { $dep =~ s/.*\///; unless (grep { $_ eq $dep } @ndrivers) { #only add if not added - unshift (@checkdeps,$dep); #recursively check dependencies - unshift (@ndrivers,$dep); print "Added $dep as an autodetected depedency\n"; } + unshift (@checkdeps,$dep); #recursively check dependencies + unshift (@ndrivers,$dep); } } } close($moddeps); +#remove the duplicated drivers +my @fulldrivers; +foreach my $dn (@ndrivers) { + unless (grep {$_ eq $dn} @fulldrivers) { + push @fulldrivers, $dn; + } +} +@ndrivers = @fulldrivers; + # before mkinitrd, run depmod to generate the modules.dep system("chroot $rootimg_dir depmod $kernelver");