From fe22e2c9801bfa6af683825b63f31f389d03874d Mon Sep 17 00:00:00 2001 From: jbjohnso Date: Mon, 10 May 2010 14:21:41 +0000 Subject: [PATCH] -Fix driver name syntax on dracut mode -Fix permission preservation on dracut module copy-in git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@6052 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/share/xcat/netboot/rh/genimage | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/xCAT-server/share/xcat/netboot/rh/genimage b/xCAT-server/share/xcat/netboot/rh/genimage index 466e959e3..349a48fc2 100755 --- a/xCAT-server/share/xcat/netboot/rh/genimage +++ b/xCAT-server/share/xcat/netboot/rh/genimage @@ -7,7 +7,7 @@ use lib "$::XCATROOT/lib/perl"; use File::Basename; use File::Path; -use File::Copy; +use File::Copy qw/copy cp mv move/; use File::Find; use Getopt::Long; use Cwd qw(realpath); @@ -476,8 +476,11 @@ sub getlibs { sub mkinitrd_dracut { mkpath("$rootimg_dir/usr/share/dracut/modules.d/97xcat"); foreach (<$fullpath/dracut/*>) { - copy($_,"$rootimg_dir/usr/share/dracut/modules.d/97xcat"); + my $perm = (stat($_))[2]; + cp($_,"$rootimg_dir/usr/share/dracut/modules.d/97xcat"); + chmod($perm&07777,"$rootimg_dir/usr/share/dracut/modules.d/97xcat/".basename($_)); } + foreach (@ndrivers) { s/\.ko$//; } system("chroot '$rootimg_dir' dracut -d '".join(' ',@ndrivers)."' -m 'xcat base' /tmp/initrd.$$.gz"); move("$rootimg_dir/tmp/initrd.$$.gz","$destdir/initrd.gz"); }