mirror of
				https://github.com/xcat2/xcat-core.git
				synced 2025-11-03 21:02:34 +00:00 
			
		
		
		
	rflash activate initial pass
This commit is contained in:
		@@ -1,5 +1,6 @@
 | 
			
		||||
#!/usr/bin/perl
 | 
			
		||||
## IBM(c) 2017 EPL license http://www.eclipse.org/legal/epl-v10.html
 | 
			
		||||
#MG June 26
 | 
			
		||||
 | 
			
		||||
package xCAT_plugin::openbmc;
 | 
			
		||||
 | 
			
		||||
@@ -164,6 +165,14 @@ my %status_info = (
 | 
			
		||||
    RFLASH_UPDATE_ACTIVATE_RESPONSE => {
 | 
			
		||||
        process        => \&rflash_response,
 | 
			
		||||
    },
 | 
			
		||||
    RFLASH_UPDATE_PRIORITY_REQUEST  => {
 | 
			
		||||
        method         => "PUT",
 | 
			
		||||
        init_url       => "$openbmc_project_url/software",
 | 
			
		||||
        data           => "xyz.openbmc_project.Software.Activation.RequestedPriority.0",
 | 
			
		||||
    },
 | 
			
		||||
    RFLASH_UPDATE_PRIORITY_RESPONSE => {
 | 
			
		||||
        process        => \&rflash_response,
 | 
			
		||||
    },
 | 
			
		||||
 | 
			
		||||
    RINV_REQUEST => {
 | 
			
		||||
        method         => "GET",
 | 
			
		||||
@@ -856,6 +865,7 @@ sub parse_command_status {
 | 
			
		||||
                if ($update_file =~ /^[[:xdigit:]]+$/i) {
 | 
			
		||||
                    # Update init_url to include the id of the update to activate
 | 
			
		||||
                    $status_info{RFLASH_UPDATE_ACTIVATE_REQUEST}{init_url} .= "/$update_file/attr/RequestedActivation";
 | 
			
		||||
                    $status_info{RFLASH_UPDATE_ACTIVATE_REQUEST}{init_url} .= "/$update_file/attr/RequestedActivation";
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
@@ -883,6 +893,8 @@ sub parse_command_status {
 | 
			
		||||
            print "Current value of activate request $status_info{RFLASH_UPDATE_ACTIVATE_REQUEST}{init_url} \n";
 | 
			
		||||
            $next_status{LOGIN_RESPONSE} = "RFLASH_UPDATE_ACTIVATE_REQUEST";
 | 
			
		||||
            $next_status{"RFLASH_UPDATE_ACTIVATE_REQUEST"} = "RFLASH_UPDATE_ACTIVATE_RESPONSE";
 | 
			
		||||
            $next_status{"RFLASH_UPDATE_ACTIVATE_RESPOSNE"} = "RFLASH_UPDATE_PRIORITY_REQUEST";
 | 
			
		||||
            $next_status{"RFLASH_UPDATE_PRIORITY_REQUEST"} = "RFLASH_UPDATE_PRIORITY_RESPONSE";
 | 
			
		||||
            #xCAT::SvrUtils::sendmsg("Activate option is not yet supported.", $callback);
 | 
			
		||||
            #return 1;
 | 
			
		||||
        }
 | 
			
		||||
@@ -1840,7 +1852,10 @@ sub rflash_response {
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
    if ($node_info{$node}{cur_status} eq "RFLASH_UPDATE_ACTIVATE_RESPONSE") {
 | 
			
		||||
        print "Update activatiion response\n";
 | 
			
		||||
        print "Update activation response\n";
 | 
			
		||||
    }
 | 
			
		||||
    if ($node_info{$node}{cur_status} eq "RFLASH_UPDATE_PRIORITY_RESPONSE") {
 | 
			
		||||
        print "Update priority response\n";
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if ($next_status{ $node_info{$node}{cur_status} }) {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user