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 08:36:41 -04:00
parent 016a947428
commit 67a48e2ee6

View File

@ -1851,6 +1851,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