From 27982a9e39e5e0043fa9066ed1a6874cac4e8340 Mon Sep 17 00:00:00 2001 From: mxi1 Date: Fri, 16 Apr 2010 10:48:27 +0000 Subject: [PATCH] -defect 2987052 is fixed; before the copy command, make sure the required kernel file is there, if there's no one, returen one error message; git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@5795 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/share/xcat/netboot/sles/genimage | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/xCAT-server/share/xcat/netboot/sles/genimage b/xCAT-server/share/xcat/netboot/sles/genimage index a00afec7e..fe6d7f9f1 100755 --- a/xCAT-server/share/xcat/netboot/sles/genimage +++ b/xCAT-server/share/xcat/netboot/sles/genimage @@ -1211,9 +1211,23 @@ sub generic_post { #This function is meant to leave the image in a state approxi system("ln -s ../gettyset $rootimg_dir/etc/init.d/rc3.d/S60gettyset"); } if(($osver =~ /sles11/) || ($osver =~ /sles10/)) {#for sles11,sles10 - copy(<$rootimg_dir/boot/vmlinux-*>,"$destdir/kernel"); + if(-e <$rootimg_dir/boot/vmlinux-*>) { + copy(<$rootimg_dir/boot/vmlinux-*>,"$destdir/kernel"); + } else { + unless (-e "$destdir/kernel") { + print qq{Error: couldn't find the suitable kernel in $rootimg_dir/boot/ directory and $destdir directory}; + exit 1; + } + } }else { - copy(<$rootimg_dir/boot/vmlinuz-*>,"$destdir/kernel"); + if(-e <$rootimg_dir/boot/vmlinuz-*>) { + copy(<$rootimg_dir/boot/vmlinuz-*>,"$destdir/kernel"); + } else { + unless (-e "$destdir/kernel") { + print qq{Error: couldn't find the suitable kernel in $rootimg_dir/boot/ directory and $destdir directory}; + exit 1; + } + } } }