mirror of
				https://github.com/xcat2/xcat-core.git
				synced 2025-11-03 21:02:34 +00:00 
			
		
		
		
	RH7/Centos7 and recent versions of fedora relocate `/*bin/*` into `/usr/*bin/`. This causes conflicts for upgrades against xCAT-genesis-scripts-* packages which expect the `/bin` a to be a directory while `xCAT-genesis-base-*` packages provide a link. Relocating all files into `/usr` fixes that conflict and allows a clean upgrade from all old versions.
		
			
				
	
	
		
			137 lines
		
	
	
		
			2.9 KiB
		
	
	
	
		
			Bash
		
	
	
		
			Executable File
		
	
	
	
	
			
		
		
	
	
			137 lines
		
	
	
		
			2.9 KiB
		
	
	
	
		
			Bash
		
	
	
		
			Executable File
		
	
	
	
	
#!/bin/bash
 | 
						|
#
 | 
						|
#  There are functions to handle iprconfig commands.
 | 
						|
#
 | 
						|
iprconfig="iprconfig"
 | 
						|
 | 
						|
########################################
 | 
						|
#
 | 
						|
#  iprconfig show-config
 | 
						|
#
 | 
						|
########################################
 | 
						|
function cmd_show_config {
 | 
						|
    local lines=""
 | 
						|
    lines=`$iprconfig -c show-config`
 | 
						|
    echo "$lines"
 | 
						|
}
 | 
						|
 | 
						|
########################################
 | 
						|
#
 | 
						|
#  iprconfig show-ioas
 | 
						|
#
 | 
						|
########################################
 | 
						|
function cmd_show_ioas {
 | 
						|
    local lines=""
 | 
						|
    lines=`$iprconfig -c show-ioas`
 | 
						|
    echo "$lines"
 | 
						|
}
 | 
						|
 | 
						|
########################################
 | 
						|
#
 | 
						|
#  iprconfig -c show-details
 | 
						|
#
 | 
						|
########################################
 | 
						|
function cmd_show_details {
 | 
						|
    local lines=""
 | 
						|
    local dev=$*
 | 
						|
    lines=`$iprconfig -c show-details $dev`
 | 
						|
    echo "$lines"
 | 
						|
}
 | 
						|
 | 
						|
########################################
 | 
						|
#
 | 
						|
#  iprconfig -c show-arrays
 | 
						|
#
 | 
						|
########################################
 | 
						|
function cmd_show_arrays {
 | 
						|
    local lines=""
 | 
						|
    lines=`$iprconfig -c show-arrays`
 | 
						|
    echo "$lines"
 | 
						|
}
 | 
						|
 | 
						|
###################################################################
 | 
						|
#
 | 
						|
#  dev is raid array or not
 | 
						|
#  input : dev
 | 
						|
#  return : 1 ----- not raid array
 | 
						|
#           0 ----- raid array
 | 
						|
#
 | 
						|
###################################################################
 | 
						|
function is_array {
 | 
						|
    local lines=""
 | 
						|
    local dev=$*
 | 
						|
    lines=`$iprconfig -c show-details $dev | grep -sq "RAID Level"`
 | 
						|
    echo "$?"
 | 
						|
}
 | 
						|
 | 
						|
########################################
 | 
						|
#
 | 
						|
#  iprconfig -c alt-status <dev>
 | 
						|
#
 | 
						|
########################################
 | 
						|
function cmd_alt_status {
 | 
						|
    local lines=""
 | 
						|
    local dev=$*
 | 
						|
    lines=`$iprconfig -c alt-status $dev`
 | 
						|
    echo "$lines"
 | 
						|
}
 | 
						|
 | 
						|
########################################
 | 
						|
#
 | 
						|
#  iprconfig -c show-status <dev>
 | 
						|
#
 | 
						|
########################################
 | 
						|
function cmd_show_status {
 | 
						|
    local lines=""
 | 
						|
    local dev=$*
 | 
						|
    lines=`$iprconfig -c status $dev`
 | 
						|
    echo "$lines"
 | 
						|
}
 | 
						|
 | 
						|
########################################
 | 
						|
#
 | 
						|
#  iprconfig -c  show-alt-config
 | 
						|
#
 | 
						|
########################################
 | 
						|
function cmd_show_alt_config {
 | 
						|
    local lines=""
 | 
						|
    local dev=$*
 | 
						|
    lines=`$iprconfig -c  show-alt-config`
 | 
						|
    echo "$lines"
 | 
						|
}
 | 
						|
 | 
						|
########################################
 | 
						|
#
 | 
						|
#  iprconfig -c  query-raid-delete <ioa>
 | 
						|
#
 | 
						|
########################################
 | 
						|
function cmd_query_raid_delete {
 | 
						|
    local lines=""
 | 
						|
    local ioa=$*
 | 
						|
    lines=`$iprconfig -c  query-raid-delete $ioa`
 | 
						|
    echo "$lines"
 | 
						|
}
 | 
						|
 | 
						|
########################################
 | 
						|
#
 | 
						|
#  iprconfig -c  raid-delete <array>
 | 
						|
#
 | 
						|
########################################
 | 
						|
function cmd__raid_delete {
 | 
						|
    local lines=""
 | 
						|
    local array=$*
 | 
						|
    lines=`$iprconfig -c  raid-delete "$array"`
 | 
						|
}
 | 
						|
 | 
						|
##################################################################
 | 
						|
#
 | 
						|
#  iprconfig -c raid-create $iprconfig_args $member_sgs
 | 
						|
#
 | 
						|
###################################################################
 | 
						|
function cmd_raid_create {
 | 
						|
    local iprconfig_args=$1
 | 
						|
    local member_sgs=$2
 | 
						|
    lines=`$iprconfig -c raid-create $iprconfig_args $member_sgs`
 | 
						|
}
 | 
						|
 |