From 05267bdd4d8d7d3904797f3b7028ed8af821525b Mon Sep 17 00:00:00 2001 From: jbjohnso Date: Mon, 19 May 2008 17:38:12 +0000 Subject: [PATCH] -Have genimage/genitrd look in the chroot target before local fs (sf bug 1966183) git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@1442 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server-2.0/share/xcat/netboot/rh/genimage | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/xCAT-server-2.0/share/xcat/netboot/rh/genimage b/xCAT-server-2.0/share/xcat/netboot/rh/genimage index e6ae98726..3b28f14f2 100755 --- a/xCAT-server-2.0/share/xcat/netboot/rh/genimage +++ b/xCAT-server-2.0/share/xcat/netboot/rh/genimage @@ -164,7 +164,9 @@ sub mkinitrd { rename(<$installroot/netboot/$osver/$arch/$profile/rootimg/boot/vmlinuz*>,"$installroot/netboot/$osver/$arch/$profile/kernel"); } else { - if(-r "/boot/vmlinuz-$kernelver") { + if(-r "$installroot/netboot/$osver/$arch/$profile/rootimg/boot/boot/vmlinuz-$kernelver") { + rename("$installroot/netboot/$osver/$arch/$profile/rootimg/boot/vmlinuz-$kernelver","$installroot/netboot/$osver/$arch/$profile/kernel"); + } elsif(-r "/boot/vmlinuz-$kernelver") { copy("/boot/vmlinuz-$kernelver","$installroot/netboot/$osver/$arch/$profile/kernel"); } else { @@ -354,12 +356,14 @@ EOMS push @filestoadd,keys %libhash; if($basekernelver ne $kernelver) { system("rm -rf $installroot/netboot/$osver/$arch/$profile/rootimg/lib/modules/$basekernelver"); - if(-d "/lib/modules/$kernelver") { - system("cd /lib/modules;cp -r $kernelver $installroot/netboot/$osver/$arch/$profile/rootimg/lib/modules/"); - } - else { - die("Cannot read /lib/modules/$kernelver"); - } + unless (-d "$installroot/netboot/$osver/$arch/$profile/rootimg/lib/modules/$kernelver") { + if(-d "/lib/modules/$kernelver") { + system("cd /lib/modules;cp -r $kernelver $installroot/netboot/$osver/$arch/$profile/rootimg/lib/modules/"); + } + else { + die("Cannot read /lib/modules/$kernelver"); + } + } } find(\&isnetdriver, <$installroot/netboot/$osver/$arch/$profile/rootimg/lib/modules/$kernelver/*>); foreach (@filestoadd) {