From 18c8045c66b41c340364ab20820ac00500c0cc89 Mon Sep 17 00:00:00 2001 From: jjhua Date: Tue, 23 Jul 2013 05:27:34 +0000 Subject: [PATCH] fixed bug 3706, enabled=0 in the Centos-Base.repo git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@17011 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/share/xcat/netboot/rh/genimage | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/xCAT-server/share/xcat/netboot/rh/genimage b/xCAT-server/share/xcat/netboot/rh/genimage index c9622b0b2..8d92bf32c 100755 --- a/xCAT-server/share/xcat/netboot/rh/genimage +++ b/xCAT-server/share/xcat/netboot/rh/genimage @@ -538,6 +538,13 @@ if (-d "$rootimg_dir/usr/share/dracut") { print "Enter the dracut mode. Dracut version: $dracutver. Dracut directory: $dracutdir.\n"; } +#-- for centos, disable the internet repository +if( -e "$rootimg_dir/etc/yum.repos.d/CentOS-Base.repo" ) { + my $repo_content=`sed -e '/enabled/d' $rootimg_dir/etc/yum.repos.d/CentOS-Base.repo | sed -e '/^gpgkey/i enabled=0'`; + system("echo '$repo_content' > $rootimg_dir/etc/yum.repos.d/CentOS-Base.repo"); +} +# + #-- run postinstall script unless ($imagename) { $postinstall_filename= imgutils::get_profile_def_filename($osver, $profile, $arch, $customdir, "postinstall");