defect 3726: for the initrd of sles, the /modules in initrd should symbol link to the new kernel dir if there's new kernel dir

This commit is contained in:
daniceexi 2013-08-07 09:59:54 -04:00
parent b868858de3
commit 2810fbea3f

View File

@ -1832,6 +1832,15 @@ sub insert_dd () {
# if the new kernel from update distro is not existed in initrd, create the path for it
if (! -r "$dd_dir/initrd_img/lib/modules/$new_kernel_ver/") {
mkpath ("$dd_dir/initrd_img/lib/modules/$new_kernel_ver/");
# link the /modules to this new kernel dir
unlink "$dd_dir/initrd_img/modules";
$cmd = "/bin/ln -sf lib/modules/$new_kernel_ver/initrd $dd_dir/initrd_img/modules";
xCAT::Utils->runcmd($cmd, -1);
if ($::RUNCMD_RC != 0) {
my $rsp;
push @{$rsp->{data}}, "Handle the driver update failed. Could not create link to the new kernel dir.";
xCAT::MsgUtils->message("I", $rsp, $callback);
}
}
# Copy the drivers to the rootimage