I have been trying, unsuccessfull so far, to get some systems to respect
the chassis bootdev request.

I'm running Ubuntu 6.06.1 and, in this case, I'm talking to a Dell 2950
with a DRAC5 installed. Most operations work, but not the bootdev feature.

Duncan recently put in "use_progress" in ipmi_chassis.c. So I tried with
and without the additional messages it generates. There was no change in
behavior.

See attached diffs for addition of bootdev option parsing and flags.

Running "ipmitool -U user -P xxxx -H drac5 -I lan chassis bootdev pxe
options=persistent,verbose=yes" did not make the options stick and did not
result in a PXE boot attempt.

Manual request for PXE boot by hitting F12 during boot works as expected.

Attached are the tcpdump traces, viewable with Ethereal.

Suggestions welcome.

Thanks,

 Ben

Here is the help message from the bootdev options parsing I added:

ipmitool ... chassis bootdev pxe options=help
Legal options are:
        help:   print this message
        valid:  Boot flags valid
        persistent:     Changes are persistent for all future boots
        efiboot:        Extensible Firmware Interface Boot (EFI)
        clear-cmos:     CMOS clear
        lockkbd:        Lock Keyboard
        screenblank:    Screen Blank
        lockoutreset:   Lock out Resetbuttons
        lockout_power:  Lock out (power off/sleep request) via Power Button
        verbose=default:        Request quiet BIOS display
        verbose=no:     Request quiet BIOS display
        verbose=yes:    Request verbose BIOS display
        force_pet:      Force progress event traps
        upw_bypass:     User password bypass
        lockout_sleep:  Log Out Sleep Button
        cons_redirect=default:  Console redirection occurs per BIOS
configuration setting
        cons_redirect=skip:     Suppress (skip) console redirection if
enabled
        cons_redirect=enable:   Suppress (skip) console redirection if
enabled

Index: include/ipmitool/helper.h
===================================================================
RCS file: /cvsroot/ipmitool/ipmitool/include/ipmitool/helper.h,v
retrieving revision 1.18
diff -C3 -r1.18 helper.h
*** include/ipmitool/helper.h	19 Mar 2006 17:59:38 -0000	1.18
--- include/ipmitool/helper.h	8 Sep 2006 23:19:19 -0000
***************
*** 54,60 ****
  void printbuf(const uint8_t * buf, int len, const char * desc);
  uint8_t ipmi_csum(uint8_t * d, int s);
  FILE * ipmi_open_file(const char * file, int rw);
! void ipmi_start_daemon(void);
  
  #define ipmi_open_file_read(file)	ipmi_open_file(file, 0)
  #define ipmi_open_file_write(file)	ipmi_open_file(file, 1)
--- 54,60 ----
  void printbuf(const uint8_t * buf, int len, const char * desc);
  uint8_t ipmi_csum(uint8_t * d, int s);
  FILE * ipmi_open_file(const char * file, int rw);
! void ipmi_start_daemon(struct ipmi_intf *intf);
  
  #define ipmi_open_file_read(file)	ipmi_open_file(file, 0)
  #define ipmi_open_file_write(file)	ipmi_open_file(file, 1)
Index: include/ipmitool/ipmi.h
===================================================================
RCS file: /cvsroot/ipmitool/ipmitool/include/ipmitool/ipmi.h,v
retrieving revision 1.23
diff -C3 -r1.23 ipmi.h
*** include/ipmitool/ipmi.h	19 Mar 2006 17:59:38 -0000	1.23
--- include/ipmitool/ipmi.h	8 Sep 2006 23:19:19 -0000
***************
*** 38,43 ****
--- 38,44 ----
  #include <inttypes.h>
  #include <sys/types.h>
  #include <netinet/in.h>
+ #include <ipmitool/ipmi_intf.h>
  #include <ipmitool/helper.h>
  
  #define IPMI_BUF_SIZE 1024
Index: include/ipmitool/ipmi_oem.h
===================================================================
RCS file: /cvsroot/ipmitool/ipmitool/include/ipmitool/ipmi_oem.h,v
retrieving revision 1.2
diff -C3 -r1.2 ipmi_oem.h
*** include/ipmitool/ipmi_oem.h	19 Mar 2006 17:59:39 -0000	1.2
--- include/ipmitool/ipmi_oem.h	8 Sep 2006 23:19:19 -0000
***************
*** 31,37 ****
  #ifndef IPMI_OEM_H
  #define IPMI_OEM_H
  
! #include <ipmitool/ipmi.h>
  
  /* oem handler, see lib/ipmi_oem.c */
  struct ipmi_oem_handle {
--- 31,38 ----
  #ifndef IPMI_OEM_H
  #define IPMI_OEM_H
  
! #include <ipmitool/ipmi_intf.h>
! /* #include <ipmitool/ipmi.h> */
  
  /* oem handler, see lib/ipmi_oem.c */
  struct ipmi_oem_handle {
Index: lib/helper.c
===================================================================
RCS file: /cvsroot/ipmitool/ipmitool/lib/helper.c,v
retrieving revision 1.30
diff -C3 -r1.30 helper.c
*** lib/helper.c	31 Aug 2006 22:14:29 -0000	1.30
--- lib/helper.c	8 Sep 2006 23:19:19 -0000
***************
*** 54,59 ****
--- 54,60 ----
  # define _PATH_VARRUN "/var/run/"
  #endif
  
+ #include <ipmitool/ipmi.h>
  #include <ipmitool/helper.h>
  #include <ipmitool/log.h>
  
Index: lib/ipmi_chassis.c
===================================================================
RCS file: /cvsroot/ipmitool/ipmitool/lib/ipmi_chassis.c,v
retrieving revision 1.29
diff -C3 -r1.29 ipmi_chassis.c
*** lib/ipmi_chassis.c	23 Aug 2006 17:25:37 -0000	1.29
--- lib/ipmi_chassis.c	8 Sep 2006 23:19:19 -0000
***************
*** 504,522 ****
  }
  
  static int
! ipmi_chassis_set_bootdev(struct ipmi_intf * intf, char * arg, int clearcmos)
  {
  	uint8_t flags[5];
  	int rc = 0;
  	int use_progress = 1;
  
! 	/* set set-in-progress flag */
! 	memset(flags, 0, 5);
! 	flags[0] = 0x01;
! 	rc = ipmi_chassis_set_bootparam(intf,
! 		IPMI_CHASSIS_BOOTPARAM_SET_IN_PROGRESS, flags, 1);
! 	if (rc < 0)
! 		use_progress = 0;
  
  	memset(flags, 0, 5);
  	flags[0] = 0x01;
--- 504,524 ----
  }
  
  static int
! ipmi_chassis_set_bootdev(struct ipmi_intf * intf, char * arg, uint8_t *iflags)
  {
  	uint8_t flags[5];
  	int rc = 0;
  	int use_progress = 1;
  
! 	if (use_progress) {
! 		/* set set-in-progress flag */
! 		memset(flags, 0, 5);
! 		flags[0] = 0x01;
! 		rc = ipmi_chassis_set_bootparam(intf,
! 			IPMI_CHASSIS_BOOTPARAM_SET_IN_PROGRESS, flags, 1);
! 		if (rc < 0)
! 			use_progress = 0;
! 	}
  
  	memset(flags, 0, 5);
  	flags[0] = 0x01;
***************
*** 535,541 ****
  		return -1;
  	}
  
! 	memset(flags, 0, 5);
  	if (arg == NULL)
  		flags[1] = 0x00;
  	else if (strncmp(arg, "none", 4) == 0)
--- 537,547 ----
  		return -1;
  	}
  
! 	if (iflags == NULL)
! 			memset(flags, 0, 5);
! 	else
! 			memcpy(flags, iflags, sizeof (flags));
! 
  	if (arg == NULL)
  		flags[1] = 0x00;
  	else if (strncmp(arg, "none", 4) == 0)
***************
*** 573,583 ****
  		return -1;
  	}
  
- 	if (clearcmos)
- 		flags[1] |= 0x80;
- 
  	/* set flag valid bit */
! 	flags[0] = 0x80;
  	rc = ipmi_chassis_set_bootparam(intf, IPMI_CHASSIS_BOOTPARAM_BOOT_FLAGS,
  					flags, 5);
  	if (rc == 0) {
--- 579,587 ----
  		return -1;
  	}
  
  	/* set flag valid bit */
! 	flags[0] |= 0x80;
! 
  	rc = ipmi_chassis_set_bootparam(intf, IPMI_CHASSIS_BOOTPARAM_BOOT_FLAGS,
  					flags, 5);
  	if (rc == 0) {
***************
*** 697,703 ****
  	int rc = 0;
  
  	if ((argc == 0) || (strncmp(argv[0], "help", 4) == 0)) {
! 		lprintf(LOG_NOTICE, "Chassis Commands:  status, power, identify, policy, restart_cause, poh, bootdev, selftest");
  	}
  	else if (strncmp(argv[0], "status", 6) == 0) {
  		rc = ipmi_chassis_status(intf);
--- 701,707 ----
  	int rc = 0;
  
  	if ((argc == 0) || (strncmp(argv[0], "help", 4) == 0)) {
! 		lprintf(LOG_NOTICE, "Chassis Commands:  status, power, identify, policy, restart_cause, poh, bootdev, bootparam, selftest");
  	}
  	else if (strncmp(argv[0], "status", 6) == 0) {
  		rc = ipmi_chassis_status(intf);
***************
*** 798,804 ****
  					lprintf(LOG_NOTICE, "bootparam set <option> [value ...]");
  				} else {
  					if (strncmp(argv[2], "bootflag", 8) == 0)
! 						rc = ipmi_chassis_set_bootdev(intf, argv[3], 0);
  					else
  						lprintf(LOG_NOTICE, "bootparam set <option> [value ...]");
  				}
--- 802,808 ----
  					lprintf(LOG_NOTICE, "bootparam set <option> [value ...]");
  				} else {
  					if (strncmp(argv[2], "bootflag", 8) == 0)
! 						rc = ipmi_chassis_set_bootdev(intf, argv[3], NULL);
  					else
  						lprintf(LOG_NOTICE, "bootparam set <option> [value ...]");
  				}
***************
*** 810,815 ****
--- 814,820 ----
  	else if (strncmp(argv[0], "bootdev", 7) == 0) {
  		if ((argc < 2) || (strncmp(argv[1], "help", 4) == 0)) {
  			lprintf(LOG_NOTICE, "bootdev <device> [clear-cmos=yes|no]");
+ 			lprintf(LOG_NOTICE, "bootdev <device> [options=help,...]");
  			lprintf(LOG_NOTICE, "  none  : Do not change boot device order");
  			lprintf(LOG_NOTICE, "  pxe   : Force PXE boot");
  			lprintf(LOG_NOTICE, "  disk  : Force boot from default Hard-drive");
***************
*** 817,833 ****
  			lprintf(LOG_NOTICE, "  diag  : Force boot from Diagnostic Partition");
  			lprintf(LOG_NOTICE, "  cdrom : Force boot from CD/DVD");
  			lprintf(LOG_NOTICE, "  bios  : Force boot into BIOS Setup");
  		} else {
  			if (argc < 3)
! 				rc = ipmi_chassis_set_bootdev(intf, argv[1], 0);
  			else if (strncmp(argv[2], "clear-cmos=", 11) == 0) {
! 				if (strncmp(argv[2]+11, "yes", 3) == 0)
! 					rc = ipmi_chassis_set_bootdev(intf, argv[1], 1);
! 				else 
! 					rc = ipmi_chassis_set_bootdev(intf, argv[1], 0);
  			}
  			else
! 				rc = ipmi_chassis_set_bootdev(intf, argv[1], 0);
  		}
  	}
  	else {
--- 822,937 ----
  			lprintf(LOG_NOTICE, "  diag  : Force boot from Diagnostic Partition");
  			lprintf(LOG_NOTICE, "  cdrom : Force boot from CD/DVD");
  			lprintf(LOG_NOTICE, "  bios  : Force boot into BIOS Setup");
+ 			lprintf(LOG_NOTICE, "  floppy: Force boot from Floppy/primary removable media");
  		} else {
  			if (argc < 3)
! 				rc = ipmi_chassis_set_bootdev(intf, argv[1], NULL);
  			else if (strncmp(argv[2], "clear-cmos=", 11) == 0) {
! 				if (strncmp(argv[2]+11, "yes", 3) == 0) {
! 					uint8_t flags[5] = {0, (1<<7), 0, 0, 0};
! 
! 					rc = ipmi_chassis_set_bootdev(intf, argv[1], flags);
! 				} else 
! 					rc = ipmi_chassis_set_bootdev(intf, argv[1], NULL);
! 			}
! 			else if (strncmp(argv[2], "options=", 8) == 0) {
! 				char *token;
! 				char *saveptr = NULL;
! 				int optionError = 0;
! 				unsigned char flags[5];
! 				static struct {
! 					char *name;
! 					int i;
! 					unsigned char mask;
! 					unsigned char value;
! 					char *desc;
! 				} options[] = {
! 					/* data 1 */
! 					{"valid", 0, (1<<7), (1<<7),
! 					 "Boot flags valid"},
! 					{"persistent", 0, (1<<6), (1<<6),
! 					 "Changes are persistent for all future boots"},
! 					{"efiboot", 0, (1<<5), (1<<5),
! 					 "Extensible Firmware Interface Boot (EFI)"},
! 
! 					/* data 2 */
! 					{"clear-cmos", 1, (1<<7), (1<<7),
! 					 "CMOS clear"},
! 					{"lockkbd", 1, (1<<6), (1<<6),
! 					 "Lock Keyboard"},
! 					/* data2[5:2] is parsed elsewhere */
! 					{"screenblank", 1, (1<<1), (1<<1),
! 					 "Screen Blank"},
! 					{"lockoutreset", 1, (1<<0), (1<<0),
! 					 "Lock out Resetbuttons"},
! 
! 					/* data 3 */
! 					{"lockout_power", 2, (1<<7), (1<<7),
! 					 "Lock out (power off/sleep request) via Power Button"},
! 					{"verbose=default", 2, (3<<5), (0<<5),
! 					 "Request quiet BIOS display"},
! 					{"verbose=no", 2, (3<<5), (1<<5),
! 					 "Request quiet BIOS display"},
! 					{"verbose=yes", 2, (3<<5), (2<<5),
! 					 "Request verbose BIOS display"},
! 					{"force_pet", 2, (1<<4), (1<<4),
! 					 "Force progress event traps"},
! 					{"upw_bypass", 2, (1<<3), (1<<3),
! 					 "User password bypass"},
! 					{"lockout_sleep", 2, (1<<2), (1<<2),
! 					 "Log Out Sleep Button"},
! 					{"cons_redirect=default", 2, (3<<0), (0<<0),
! 					 "Console redirection occurs per BIOS configuration setting"},
! 					{"cons_redirect=skip", 2, (3<<0), (1<<0),
! 					 "Suppress (skip) console redirection if enabled"},
! 					{"cons_redirect=enable", 2, (3<<0), (2<<0),
! 					 "Suppress (skip) console redirection if enabled"},
! 
! 					/* data 4 */
! 					/* data4[7:4] reserved */
! 					/* data4[3] BIOS Shared Mode Override, not implemented here */
! 					/* data4[2:0] BIOS Mux Control Override, not implemented here */
! 
! 					/* data5 reserved */
! 					
! 					{NULL}	/* End marker */
! 				}, *op;
! 
! 				memset(&flags[0], 0, sizeof(flags));
! 				token = strtok_r(argv[2] + 8, ",", &saveptr);
! 				while (token != NULL) {
! 					int i;
! 
! 					if (strcmp(token, "help") == 0) {
! 						optionError = 1;
! 						break;
! 					}
! 					for (op = options; op->name != NULL; ++op) {
! 						if (strcmp(token, op->name) == 0) {
! 								flags[op->i] &= op->mask;
! 								flags[op->i] |= op->value;
! 								break;
! 						}
! 					}
! 					if (op->name == NULL) {
! 						/* Option not found */
! 						optionError = 1;
! 						lprintf(LOG_ERR, "Invalid option: %s", token);
! 					}
! 					token = strtok_r(NULL, ",", &saveptr);
! 				}
! 				if (optionError) {
! 						lprintf(LOG_NOTICE, "Legal options are:");
! 						lprintf(LOG_NOTICE, "\thelp:\tprint this message");
! 						for (op = options; op->name != NULL; ++op) {
! 								lprintf(LOG_NOTICE, "\t%s:\t%s", op->name, op->desc);
! 						}
! 						return (-1);
! 				}
! 				rc = ipmi_chassis_set_bootdev(intf, argv[1], flags);
  			}
  			else
! 				rc = ipmi_chassis_set_bootdev(intf, argv[1], NULL);
  		}
  	}
  	else {
Index: lib/ipmi_oem.c
===================================================================
RCS file: /cvsroot/ipmitool/ipmitool/lib/ipmi_oem.c,v
retrieving revision 1.9
diff -C3 -r1.9 ipmi_oem.c
*** lib/ipmi_oem.c	28 Jul 2006 16:39:18 -0000	1.9
--- lib/ipmi_oem.c	8 Sep 2006 23:19:20 -0000
***************
*** 30,37 ****
  
  #include <string.h>
  
! #include <ipmitool/ipmi.h>
  #include <ipmitool/ipmi_intf.h>
  #include <ipmitool/ipmi_constants.h>
  #include <ipmitool/log.h>
  #include <ipmitool/helper.h>
--- 30,38 ----
  
  #include <string.h>
  
! /* #include <ipmitool/ipmi.h> */
  #include <ipmitool/ipmi_intf.h>
+ /* #include <ipmitool/ipmi_intf.h> */
  #include <ipmitool/ipmi_constants.h>
  #include <ipmitool/log.h>
  #include <ipmitool/helper.h>

Attachment: ipmiboot-mods.pcap
Description: Binary data

Attachment: ipmiboot-mods-noprogress.pcap
Description: Binary data

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Ipmitool-devel mailing list
Ipmitool-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ipmitool-devel

Reply via email to