diff --git a/xCAT/postscripts/configefi b/xCAT/postscripts/configefi index 4db78507c..5fb3d6295 100644 --- a/xCAT/postscripts/configefi +++ b/xCAT/postscripts/configefi @@ -1,6 +1,20 @@ if [ -d /sys/firmware/efi ]; then echo "Setting Boot Manager for the next boot." - efibootmgr -c -l \\EFI\\redhat\\grub.efi -L Linux + echo "delete all sysclone boot list" + str_bootnums=`efibootmgr | grep 'syscloneLinux' | awk '{print $1}' | sed 's/boot//i' | sed 's/*//'` + for str_num in $str_bootnums + do + efibootmgr -b $str_num -B -q + done + + if [ -f "/boot/efi/EFI/redhat/grub.efi" ];then + efibootmgr -c -l \\EFI\\redhat\\grub.efi -L syscloneLinux + elif [ -f "/boot/efi/efi/SuSE/elilo.efi" ];then + efibootmgr -c -l \\efi\\SuSE\\elilo.efi -L syscloneLinux + else + echo "Can not find the boot loader." + exit 1 + fi else echo "run grub-install to configure the MBR." if [ -e /etc/mtab ];then diff --git a/xCAT/postscripts/runxcatpost b/xCAT/postscripts/runxcatpost index 9d4647342..7fe3f07ec 100644 --- a/xCAT/postscripts/runxcatpost +++ b/xCAT/postscripts/runxcatpost @@ -1,4 +1,7 @@ #!/bin/bash +if [ -f "/opt/xcat/xcatinfo" ]; + mv -f "/opt/xcat/xcatinfo" "/opt/xcat/xcatinfo.bak" +fi /opt/xcat/xcatdsklspost . /tmp/post-install/variables.txt diff --git a/xCAT/postscripts/updatenetwork b/xCAT/postscripts/updatenetwork index fc82ab64d..4f4e2dfca 100644 --- a/xCAT/postscripts/updatenetwork +++ b/xCAT/postscripts/updatenetwork @@ -14,22 +14,39 @@ if [ -d "/etc/sysconfig/network-scripts/" ];then #redhat str_cfg_file="/etc/sysconfig/network-scripts/ifcfg-$DEVICE" sed -i "s/HOSTNAME=.*/HOSTNAME=$HOSTNAME/g" /etc/sysconfig/network + if [ -f $str_cfg_file ];then + echo "Old ifcfg-$DEVICE is:" + cat $str_cfg_file + HWADDR=`ifconfig $DEVICE|grep HWaddr|awk '{print $5}'` + sed -i "s/HWADDR=.*/HWADDR="$HWADDR"/g" $str_cfg_file + sed -i "s/UUID=.*//g" $str_cfg_file + else + echo "DEVICE=\"$DEVICE\"" > $str_cfg_file + echo "BOOTPROTO=\"dhcp\"" >> $str_cfg_file + echo "NM_CONTROLLED=\"yes\"" >> $str_cfg_file + echo "ONBOOT=\"yes\"" >> $str_cfg_file + fi elif [ -d "/etc/sysconfig/network/" ];then #suse str_cfg_file="/etc/sysconfig/network/ifcfg-$DEVICE" echo "$HOSTNAME" > /etc/HOSTNAME + if [ -f $str_cfg_file ];then + echo "Old ifcfg-$DEVICE is:" + cat $str_cfg_file + HWADDR=`ifconfig $DEVICE|grep HWaddr|awk '{print $5}'` + sed -i "s/HWADDR=.*/HWADDR=$HWADDR/g" $str_cfg_file + sed -i "s/UUID=.*//g" $str_cfg_file + else + echo "DEVICE=\"$DEVICE\"" > $str_cfg_file + echo "BOOTPROTO=dhcp" >> $str_cfg_file + echo "STARTMODE=onboot" >> $str_cfg_file + echo "DHCLIENT_PRIMARY_DEVICE=yes" >> $str_cfg_file + fi else #ubuntu - str_cfg_file="/etc/network/interfaces.d/$DEVICE" - echo "$HOSTNAME" > /etc/hostname + echo "Does not support ubuntu." + exit 1 fi -echo "Old ifcfg-$DEVICE is:" -cat $str_cfg_file - -HWADDR=`ifconfig $DEVICE|grep HWaddr|awk '{print $5}'` -sed -i "s/HWADDR=.*/HWADDR="$HWADDR"/g" $str_cfg_file -sed -i "s/UUID=.*//g" $str_cfg_file - echo "New ifcfg-$DEVICE is:" cat $str_cfg_file