update scripts for sysclone supports sles
This commit is contained in:
parent
1fc54f6bdc
commit
aa892335de
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user