mirror of
https://github.com/ipmitool/ipmitool.git
synced 2025-05-11 02:57:22 +00:00
- Add more details for command chassis set boot params
This commit is contained in:
parent
14004d0749
commit
61318c0158
@ -465,6 +465,7 @@ ipmi_chassis_get_bootparam(struct ipmi_intf * intf, char * arg)
|
||||
struct ipmi_rs * rsp;
|
||||
struct ipmi_rq req;
|
||||
uint8_t msg_data[3];
|
||||
unsigned char param_id;
|
||||
|
||||
if (arg == NULL)
|
||||
return -1;
|
||||
@ -495,11 +496,232 @@ ipmi_chassis_get_bootparam(struct ipmi_intf * intf, char * arg)
|
||||
if (verbose > 2)
|
||||
printbuf(rsp->data, rsp->data_len, "Boot Option");
|
||||
|
||||
param_id = (rsp->data[1] & 0x7f);
|
||||
|
||||
printf("Boot parameter version: %d\n", rsp->data[0]);
|
||||
printf("Boot parameter %d is %s\n", rsp->data[1] & 0x7f,
|
||||
(rsp->data[1] & 0x80) ? "invalid/locked" : "valid/unlocked");
|
||||
printf("Boot parameter data: %s\n", buf2str(rsp->data+2, rsp->data_len - 2));
|
||||
|
||||
switch(param_id)
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
printf(" Set In Progress : ");
|
||||
switch((rsp->data[2]) &0x03)
|
||||
{
|
||||
case 0: printf("set complete\n"); break;
|
||||
case 1: printf("set in progress\n"); break;
|
||||
case 2: printf("commit write\n"); break;
|
||||
default: printf("error, reserved bit\n"); break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
{
|
||||
printf(" Service Partition Selector : ");
|
||||
if((rsp->data[2]) == 0)
|
||||
{
|
||||
printf("unspecified\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
printf("%d\n",(rsp->data[2]));
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
{
|
||||
printf( " Service Partition Scan :\n");
|
||||
if((rsp->data[2]&0x03) != 0)
|
||||
{
|
||||
if((rsp->data[2]&0x01) == 0x01)
|
||||
printf(" - Request BIOS to scan\n");
|
||||
if((rsp->data[2]&0x02) == 0x02)
|
||||
printf(" - Service Partition Discovered\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
printf(" No flag set\n");
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
{
|
||||
printf( " BMC boot flag valid bit clearing :\n");
|
||||
if((rsp->data[2]&0x1f) != 0)
|
||||
{
|
||||
if((rsp->data[2]&0x10) == 0x10)
|
||||
printf(" - Don't clear valid bit on reset/power cycle cause by PEF\n");
|
||||
if((rsp->data[2]&0x08) == 0x08)
|
||||
printf(" - Don't automatically clear boot flag valid bit on timeout\n");
|
||||
if((rsp->data[2]&0x04) == 0x04)
|
||||
printf(" - Don't clear valid bit on reset/power cycle cause by watchdog\n");
|
||||
if((rsp->data[2]&0x02) == 0x02)
|
||||
printf(" - Don't clear valid bit on push button reset // soft reset\n");
|
||||
if((rsp->data[2]&0x01) == 0x01)
|
||||
printf(" - Don't clear valid bit on power up via power push button or wake event\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
printf(" No flag set\n");
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
{
|
||||
printf( " Boot Info Acknoledge :\n");
|
||||
if((rsp->data[3]&0x1f) != 0)
|
||||
{
|
||||
if((rsp->data[3]&0x10) == 0x10)
|
||||
printf(" - OEM has handled boot info\n");
|
||||
if((rsp->data[3]&0x08) == 0x08)
|
||||
printf(" - SMS has handled boot info\n");
|
||||
if((rsp->data[3]&0x04) == 0x04)
|
||||
printf(" - OS // service partition has handled boot info\n");
|
||||
if((rsp->data[3]&0x02) == 0x02)
|
||||
printf(" - OS Loader has handled boot info\n");
|
||||
if((rsp->data[3]&0x01) == 0x01)
|
||||
printf(" - BIOS/POST has handled boot info\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
printf(" No flag set\n");
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 5:
|
||||
{
|
||||
printf( " Boot Flags :\n");
|
||||
|
||||
if((rsp->data[2]&0x80) == 0x80)
|
||||
printf(" - Boot Flag Valid\n");
|
||||
else
|
||||
printf(" - Boot Flag Invalid\n");
|
||||
|
||||
if((rsp->data[2]&0x40) == 0x40)
|
||||
printf(" - Options apply to all future boots\n");
|
||||
else
|
||||
printf(" - Options apply to only next boot\n");
|
||||
|
||||
if((rsp->data[2]&0x20) == 0x20)
|
||||
printf(" - BIOS EFI boot \n");
|
||||
else
|
||||
printf(" - BIOS PC Compatible (legacy) boot \n");
|
||||
|
||||
if((rsp->data[3]&0x80) == 0x80)
|
||||
printf(" - CMOS Clear\n");
|
||||
if((rsp->data[3]&0x40) == 0x40)
|
||||
printf(" - Lock Keyboard\n");
|
||||
printf(" - Boot Device Selector : ");
|
||||
switch( ((rsp->data[3]>>2)&0x0f))
|
||||
{
|
||||
case 0: printf("No override\n"); break;
|
||||
case 1: printf("Force PXE\n"); break;
|
||||
case 2: printf("Force Boot from default Hard-Drive\n"); break;
|
||||
case 3: printf("Force Boot from default Hard-Drive, request Safe-Mode\n"); break;
|
||||
case 4: printf("Force Boot from Diagnostic Partition\n"); break;
|
||||
case 5: printf("Force Boot from CD/DVD\n"); break;
|
||||
case 6: printf("Force Boot into BIOS Setup\n"); break;
|
||||
case 15: printf("Force Boot from Floppy/primary removable media\n"); break;
|
||||
default: printf("Flag error\n"); break;
|
||||
}
|
||||
if((rsp->data[3]&0x02) == 0x02)
|
||||
printf(" - Screen blank\n");
|
||||
if((rsp->data[3]&0x01) == 0x01)
|
||||
printf(" - Lock out Reset buttons\n");
|
||||
|
||||
if((rsp->data[4]&0x80) == 0x80)
|
||||
printf(" - Lock out (power off/sleep request) vi Power Button\n");
|
||||
printf(" - Console Redirection control : ");
|
||||
switch( ((rsp->data[4]>>5)&0x03))
|
||||
{
|
||||
case 0: printf("System Default\n"); break;
|
||||
case 1: printf("Request Quiet Display\n"); break;
|
||||
case 2: printf("Request Verbose Display\n"); break;
|
||||
default: printf("Flag error\n"); break;
|
||||
}
|
||||
if((rsp->data[4]&0x10) == 0x10)
|
||||
printf(" - Force progress event traps\n");
|
||||
if((rsp->data[4]&0x08) == 0x08)
|
||||
printf(" - User password bypass\n");
|
||||
if((rsp->data[4]&0x04) == 0x04)
|
||||
printf(" - Lock Out Sleep Button\n");
|
||||
if((rsp->data[4]&0x02) == 0x02)
|
||||
printf(" - Lock Out Sleep Button\n");
|
||||
printf(" - BIOS verbosity : ");
|
||||
switch( ((rsp->data[4]>>0)&0x03))
|
||||
{
|
||||
case 0: printf("Console redirection occurs per BIOS configuration setting (default)\n"); break;
|
||||
case 1: printf("Suppress (skip) console redirection if enabled\n"); break;
|
||||
case 2: printf("Request console redirection be enabled\n"); break;
|
||||
default: printf("Flag error\n"); break;
|
||||
}
|
||||
|
||||
if((rsp->data[5]&0x08) == 0x08)
|
||||
printf(" - BIOS Shared Mode Override\n");
|
||||
printf(" - BIOS Mux Control Override : ");
|
||||
switch( ((rsp->data[5]>>0)&0x07))
|
||||
{
|
||||
case 0: printf("BIOS uses recommended setting of the mux at the end of POST\n"); break;
|
||||
case 1: printf("Requests BIOS to force mux to BMC at conclusion of POST/start of OS boot\n"); break;
|
||||
case 2: printf("Requests BIOS to force mux to system at conclusion of POST/start of OS boot\n"); break;
|
||||
default: printf("Flag error\n"); break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 6:
|
||||
{
|
||||
unsigned long session_id;
|
||||
unsigned long timestamp;
|
||||
char time_buf[40];
|
||||
time_t out_time;
|
||||
|
||||
session_id = ((unsigned long) rsp->data[3]);
|
||||
session_id |= (((unsigned long) rsp->data[4])<<8);
|
||||
session_id |= (((unsigned long) rsp->data[5])<<16);
|
||||
session_id |= (((unsigned long) rsp->data[6])<<24);
|
||||
|
||||
timestamp = ((unsigned long) rsp->data[7]);
|
||||
timestamp |= (((unsigned long) rsp->data[8])<<8);
|
||||
timestamp |= (((unsigned long) rsp->data[9])<<16);
|
||||
timestamp |= (((unsigned long) rsp->data[10])<<24);
|
||||
|
||||
memset(time_buf, 0, 40);
|
||||
strftime(
|
||||
time_buf,
|
||||
sizeof(time_buf),
|
||||
"%m/%d/%Y %H:%M:%S", localtime(&out_time)
|
||||
);
|
||||
|
||||
printf(" Boot Initiator Info :\n");
|
||||
printf(" Channel Number : %d\n", (rsp->data[2] & 0x0f));
|
||||
printf(" Session Id : %08Xh\n",session_id);
|
||||
if(timestamp != 0)
|
||||
{
|
||||
printf(" Timestamp : %08Xh, %s\n",timestamp,time_buf);
|
||||
}
|
||||
else
|
||||
{
|
||||
printf(" Timestamp : %08Xh, undefined\n",timestamp);
|
||||
}
|
||||
|
||||
}
|
||||
break;
|
||||
case 7:
|
||||
{
|
||||
printf(" Selector : %d\n", rsp->data[2] );
|
||||
printf(" Block Data : %s\n", buf2str(rsp->data+3, rsp->data_len - 2));
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
printf(" Undefined byte\n");
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user