From 67a48e2ee648a44e99884802fdb8d8b6c01aad5f Mon Sep 17 00:00:00 2001 From: daniceexi Date: Wed, 7 Aug 2013 08:36:41 -0400 Subject: [PATCH] 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 --- xCAT-server/lib/xcat/plugins/sles.pm | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/xCAT-server/lib/xcat/plugins/sles.pm b/xCAT-server/lib/xcat/plugins/sles.pm index b2e9cf4c1..e4abb066f 100644 --- a/xCAT-server/lib/xcat/plugins/sles.pm +++ b/xCAT-server/lib/xcat/plugins/sles.pm @@ -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