2013-08-29 09:59:32 +00:00
|
|
|
#!/bin/bash
|
2014-06-19 08:08:53 +00:00
|
|
|
#Used only by sysclone
|
2013-08-29 09:59:32 +00:00
|
|
|
|
2014-07-02 09:12:22 +00:00
|
|
|
installmethods=''
|
|
|
|
if [ -f "/etc/xcat/xcatinstallinfo" ];then
|
|
|
|
installmethods=`cat /etc/xcat/xcatinstallinfo`
|
|
|
|
fi
|
|
|
|
|
2014-06-19 08:08:53 +00:00
|
|
|
if [ "$installmethods" != "sysclone" ];then
|
2014-07-02 09:12:22 +00:00
|
|
|
# echo "This node didn't be installed by sysclone"
|
2013-08-29 09:59:32 +00:00
|
|
|
exit 0
|
|
|
|
fi
|
2014-06-19 08:08:53 +00:00
|
|
|
|
2013-08-29 09:59:32 +00:00
|
|
|
#update the exclude configuration file
|
|
|
|
#do not sync the following files
|
2014-09-01 08:00:47 +00:00
|
|
|
for filename in \
|
|
|
|
/boot/efi \
|
|
|
|
/boot/grub \
|
|
|
|
/etc/fstab \
|
|
|
|
/etc/grub.conf \
|
|
|
|
/etc/lilo.conf \
|
|
|
|
/etc/elilo.conf \
|
|
|
|
/etc/xcat \
|
|
|
|
/etc/yaboot.conf \
|
|
|
|
/etc/hosts \
|
|
|
|
/etc/udev/rules.d \
|
|
|
|
/etc/modprobe.d/bond0.conf \
|
|
|
|
/etc/modprobe.d/bond1.conf \
|
|
|
|
/etc/ssh \
|
|
|
|
/etc/sysconfig/syslog \
|
|
|
|
/etc/syslog-ng/syslog-ng.conf \
|
|
|
|
/opt/xcat \
|
|
|
|
/root/.ssh \
|
|
|
|
/var/cache \
|
|
|
|
/xcatpost
|
2013-08-29 09:59:32 +00:00
|
|
|
do
|
|
|
|
if [ ! -e $filename ];then
|
|
|
|
continue
|
|
|
|
fi
|
|
|
|
|
|
|
|
grep -E "^\s*${filename}\s*$" "/etc/systemimager/updateclient.local.exclude"
|
|
|
|
if [ $? -ne 0 ];then
|
|
|
|
echo "$filename" >> "/etc/systemimager/updateclient.local.exclude"
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
#get the current image server
|
|
|
|
str_server_ip=''
|
|
|
|
. /opt/xcat/xcatinfo
|
|
|
|
if [ -n "$XCATSERVER" ];then
|
|
|
|
str_server_ip=$XCATSERVER
|
|
|
|
else
|
|
|
|
str_server_ip=$MASTER
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -z "$str_server_ip" ];then
|
|
|
|
echo "Can not find out the image server."
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
str_server_ip=`echo $str_server_ip | sed "s/'//g"`
|
|
|
|
#call system imager command to update the image
|
2014-06-19 08:08:53 +00:00
|
|
|
echo "si_updateclient --server $str_server_ip --yes"
|
2014-08-20 08:06:33 +00:00
|
|
|
export PERL5LIB=/usr/lib/perl5/site_perl/;LANG=C si_updateclient --server $str_server_ip --yes
|
2014-06-19 08:08:53 +00:00
|
|
|
|
|
|
|
if [[ -f /sbin/dracut ]]; then
|
2014-08-20 08:06:33 +00:00
|
|
|
# redhat6.x/centos6.x
|
2014-06-19 08:08:53 +00:00
|
|
|
echo "Running dracut to regenerate the initrd with the drivers needed by this node:"
|
|
|
|
dracut --force
|
|
|
|
else
|
2014-08-20 08:06:33 +00:00
|
|
|
# suse/sles and redhat5.x/centos5.x
|
2014-06-19 08:08:53 +00:00
|
|
|
echo "Running mkinitrd to regenerate the initrd with the drivers needed by this node:"
|
2014-08-20 08:06:33 +00:00
|
|
|
osvers=`cat /etc/*release|sed -e 's/.*\([0-9]\{1,\}\.[0-9]\{1,\}\).*/\1/'`
|
|
|
|
if [[ $osvers == 5\.* ]];then
|
|
|
|
initrdfile=`find /boot -name "initrd-*.img"`
|
|
|
|
kernelversion=`echo $initrdfile |sed -e 's:/boot/initrd-\(.*\)\.img:\1:g'`
|
|
|
|
mv $initrdfile $initrdfile.org
|
|
|
|
mkinitrd $initrdfile $kernelversion
|
|
|
|
else
|
|
|
|
mkinitrd
|
|
|
|
fi
|
2014-06-19 08:08:53 +00:00
|
|
|
fi
|