diff --git a/xCAT-server/share/xcat/netboot/rh/compute.rhels7.ppc64.postinstall b/xCAT-server/share/xcat/netboot/rh/compute.rhels7.ppc64.postinstall index 0819752bb..02effbf98 100755 --- a/xCAT-server/share/xcat/netboot/rh/compute.rhels7.ppc64.postinstall +++ b/xCAT-server/share/xcat/netboot/rh/compute.rhels7.ppc64.postinstall @@ -35,7 +35,10 @@ echo "co:2345:respawn:/sbin/agetty -L 38400 console" >> $installroot/etc/inittab #-- Disable SELinux in the rootimg #-- Redhat 7.3 will install selinux-policy and selinux is enabled by default #-- Need to disable selinux, otherwise, the booting will hang on "Loading selinux policy" -sed -i 's/SELINUX=enforcing\|permissive/SELINUX=disabled/' $installroot/etc/selinux/config +if [ -f "$installroot/etc/selinux/config" ] +then + sed -i 's/SELINUX=enforcing\|permissive/SELINUX=disabled/' $installroot/etc/selinux/config +fi #-- Example of booted image versioning #-- We want to know, with what configuration (version of the image) each node was booted. diff --git a/xCAT-server/share/xcat/netboot/rh/compute.rhels7.x86_64.postinstall b/xCAT-server/share/xcat/netboot/rh/compute.rhels7.x86_64.postinstall index b8eee319e..e8883be8f 100755 --- a/xCAT-server/share/xcat/netboot/rh/compute.rhels7.x86_64.postinstall +++ b/xCAT-server/share/xcat/netboot/rh/compute.rhels7.x86_64.postinstall @@ -35,8 +35,10 @@ END #-- Disable SELinux in the rootimg #-- Redhat 7.3 will install selinux-policy and selinux is enabled by default #-- Need to disable selinux, otherwise, the booting will hang on "Loading selinux policy" -sed -i 's/SELINUX=enforcing\|permissive/SELINUX=disabled/' $installroot/etc/selinux/config - +if [ -f "$installroot/etc/selinux/config" ] +then + sed -i 's/SELINUX=enforcing\|permissive/SELINUX=disabled/' $installroot/etc/selinux/config +fi #-- Example of booted image versioning #-- We want to know, with what configuration (version of the image) each node was booted. diff --git a/xCAT-server/share/xcat/netboot/rh/service.postinstall b/xCAT-server/share/xcat/netboot/rh/service.postinstall index 86e295e45..192b22c78 100755 --- a/xCAT-server/share/xcat/netboot/rh/service.postinstall +++ b/xCAT-server/share/xcat/netboot/rh/service.postinstall @@ -39,7 +39,10 @@ echo "co:2345:respawn:/sbin/agetty -L 38400 console" >> $installroot/etc/inittab #-- Disable SELinux in the rootimg #-- Redhat 7.3 will install selinux-policy and selinux is enabled by default #-- Need to disable selinux, otherwise, the booting will hang on "Loading selinux policy" -sed -i 's/SELINUX=enforcing\|permissive/SELINUX=disabled/' $installroot/etc/selinux/config +if [ -f "$installroot/etc/selinux/config" ] +then + sed -i 's/SELINUX=enforcing\|permissive/SELINUX=disabled/' $installroot/etc/selinux/config +fi #-- Example of booted image versioning #-- We want to know, with what configuration (version of the image) each node was booted.