mirror of
				https://github.com/xcat2/xcat-core.git
				synced 2025-11-04 05:12:30 +00:00 
			
		
		
		
	sysclone support sles11 on uefi mode
This commit is contained in:
		@@ -1860,7 +1860,7 @@ sub mksysclone
 | 
			
		||||
                    $kcmdline .= "n8r";
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
            $kcmdline .= " xcatd=$xcatmaster:$xcatdport SCRIPTNAME=$imagename";
 | 
			
		||||
            $kcmdline .= " XCAT=$xcatmaster:$xcatdport xcatd=$xcatmaster:$xcatdport SCRIPTNAME=$imagename";
 | 
			
		||||
            #$kcmdline .= " noipv6";
 | 
			
		||||
            # add the addkcmdline attribute  to the end
 | 
			
		||||
            # of the command, if it exists
 | 
			
		||||
 
 | 
			
		||||
@@ -1284,7 +1284,7 @@ sub mksysclone
 | 
			
		||||
    copy("$installroot/postscripts/configefi","$pspath/15all.configefi");
 | 
			
		||||
    copy("$installroot/postscripts/updatenetwork","$pspath/16all.updatenetwork");
 | 
			
		||||
    copy("$installroot/postscripts/runxcatpost","$pspath/17all.runxcatpost");
 | 
			
		||||
    copy("$installroot/postscripts/killsyslog","$pspath/17all.killsyslog");
 | 
			
		||||
    copy("$installroot/postscripts/killsyslog","$pspath/99all.killsyslog");
 | 
			
		||||
 | 
			
		||||
    unless (-r "$pspath/10all.fix_swap_uuids")
 | 
			
		||||
    {
 | 
			
		||||
@@ -1355,10 +1355,9 @@ sub mksysclone
 | 
			
		||||
        # copy kernel and initrd from image dir to /tftpboot
 | 
			
		||||
        my $ramdisk_size = 200000;
 | 
			
		||||
 | 
			
		||||
        if (
 | 
			
		||||
            -r "$tftpdir/xcat/genesis.kernel.$arch"
 | 
			
		||||
            and -r "$tftpdir/xcat/genesis.fs.$arch.gz"
 | 
			
		||||
        )
 | 
			
		||||
        if ( -r "$tftpdir/xcat/genesis.kernel.$arch"
 | 
			
		||||
            and ( -r "$tftpdir/xcat/genesis.fs.$arch.gz"
 | 
			
		||||
                  or -r "$tftpdir/xcat/genesis.fs.$arch.lzma" ))
 | 
			
		||||
        {
 | 
			
		||||
            #We have a shot...
 | 
			
		||||
             my $ent    = $rents{$node}->[0];
 | 
			
		||||
@@ -1411,13 +1410,17 @@ sub mksysclone
 | 
			
		||||
                    }
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
            $kcmdline .= " xcatd=$xcatmaster:$xcatdport SCRIPTNAME=$imagename";
 | 
			
		||||
            $kcmdline .= " XCAT=$xcatmaster:$xcatdport xcatd=$xcatmaster:$xcatdport SCRIPTNAME=$imagename";
 | 
			
		||||
 | 
			
		||||
            my $i = "xcat/genesis.fs.$arch.gz";
 | 
			
		||||
            if ( -r "$tftpdir/xcat/genesis.fs.$arch.lzma" ){
 | 
			
		||||
                $i = "xcat/genesis.fs.$arch.lzma";
 | 
			
		||||
            }
 | 
			
		||||
            $bptab->setNodeAttribs(
 | 
			
		||||
                $node,
 | 
			
		||||
                {
 | 
			
		||||
                    kernel   => "xcat/genesis.kernel.$arch",
 | 
			
		||||
                    initrd   => "xcat/genesis.fs.$arch.gz",
 | 
			
		||||
                    initrd   => $i,
 | 
			
		||||
                    kcmdline => $kcmdline
 | 
			
		||||
                }
 | 
			
		||||
            );
 | 
			
		||||
 
 | 
			
		||||
@@ -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" ];then
 | 
			
		||||
    rm -f "/opt/xcat/xcatinfo"
 | 
			
		||||
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
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user