X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=resources%2Ftools%2Fdisk-image-builder%2Fcentos%2Fscripts-remote%2Fpost-install.sh;h=fdaeebd58cf413e62be581642481fbba9b655095;hb=fc11dba19e92609e0631c567ac25756f0c3697df;hp=9ae16082035f56186b7c1bcb59c13662e16a09bb;hpb=7af34879d4c2a0c0994d93ded5d9a686c860e8da;p=csit.git diff --git a/resources/tools/disk-image-builder/centos/scripts-remote/post-install.sh b/resources/tools/disk-image-builder/centos/scripts-remote/post-install.sh index 9ae1608203..fdaeebd58c 100644 --- a/resources/tools/disk-image-builder/centos/scripts-remote/post-install.sh +++ b/resources/tools/disk-image-builder/centos/scripts-remote/post-install.sh @@ -15,24 +15,36 @@ TEMP_PATH="/root/temp" +echo ==========================Remove NetworkManager============================ +systemctl disable NetworkManager +systemctl enable network +yum -y remove NetworkManager + +cat - > /etc/sysconfig/network-scripts/ifcfg-eth0 <<"_EOF" +DEVICE=eth0 +BOOTPROTO=dhcp +ONBOOT=yes +_EOF +echo =======================End Remove NetworkManager=========================== + ### ### RPMs ### echo "********** INSTALLING RPMs **********" -# We're doing this the hard way as we're dealing with a bunch of -# rpm packages without using yum. +# If it exists, copy in a specific Centos Repo for the Centos version for this image . # Attempt up to five cycles of unpack/configure. There may be dependency # problems during the first one(s). -echo ==========================yum update============================== -yum clean all -yum install -y @base -yum install -y deltarpm -yum update -y -yum -y install epel-release -yum update -y -echo ==========================end yum update============================== +echo ==========================yum repos============================== +if [ -f ${TEMP_PATH}/rpm/Centos-Vault.repo ] ; then + echo ==========================Install specific yum repo====================== + sed -i '/gpgcheck=1/s/.*/&\nenabled=0/' /etc/yum.repos.d/CentOS-Base.repo + cp -f ${TEMP_PATH}/rpm/Centos-Vault.repo /etc/yum.repos.d +else + echo ==========================Update from base repo and updates================ + : ; +fi attempt=1 MAX_ATTEMPTS=3 try_again=1 @@ -45,7 +57,7 @@ do do # use rpm command if url is present in the package file if [ ! -z $url ] ; then - rpm -i $url$name || try_again=1 + rpm -i $url$name.rpm || try_again=1 else yum install -y $name || try_again=1 fi