diff --git a/xCAT-server/share/xcat/netboot/rh/genimage b/xCAT-server/share/xcat/netboot/rh/genimage index 9fce9b6c6..a5800a888 100755 --- a/xCAT-server/share/xcat/netboot/rh/genimage +++ b/xCAT-server/share/xcat/netboot/rh/genimage @@ -1713,6 +1713,21 @@ sub load_dd () print "Error: Cannot read the rpm $rpm.\n"; } } + + # To skip the conflict of files that some rpm uses the xxx.ko.new as the name of the driver + # Change it back to xxx.ko here + $driver_name = "\*ko.new"; + @all_real_path = (); + find(\&get_all_path, <$dd_dir/rpm/*>); + foreach my $file (@all_real_path) { + my $newname = $file; + $newname =~ s/\.new$//; + if (system ("mv -f $file $newname")) { + print "Error: Could not rename $file\n"; + + } + } + # Copy the firmware to the rootimage if (-d "$dd_dir/rpm/lib/firmware") { system ("cp -rf $dd_dir/rpm/lib/firmware $rootimg_dir/lib"); diff --git a/xCAT-server/share/xcat/netboot/sles/genimage b/xCAT-server/share/xcat/netboot/sles/genimage index 8aa157a5e..e23820158 100755 --- a/xCAT-server/share/xcat/netboot/sles/genimage +++ b/xCAT-server/share/xcat/netboot/sles/genimage @@ -1806,6 +1806,21 @@ sub load_dd() print "Error: Cannot read the rpm $rpm.\n"; } } + + # To skip the conflict of files that some rpm uses the xxx.ko.new as the name of the driver + # Change it back to xxx.ko here + $driver_name = "\*ko.new"; + @all_real_path = (); + find(\&get_all_path, <$dd_dir/rpm/*>); + foreach my $file (@all_real_path) { + my $newname = $file; + $newname =~ s/\.new$//; + if (system ("mv -f $file $newname")) { + print "Error: Could not rename $file\n"; + + } + } + # Copy the firmware to the rootimage if (-d "$dd_dir/rpm/lib/firmware") { system ("cp -rf $dd_dir/rpm/lib/firmware $rootimg_dir/lib");