update_firmware - NameError: global name 'struct' is not defined.

Adam Auden adam at bondware.com
Wed Mar 18 10:56:17 CDT 2009


Hi there,

Not 100% if this should be going here or the libsmbios list, so  
apologies if I'm barking up the wrong tree.

Having just configured the various Dell repositories on my new PE2950  
running CentOS 5.2, running Openmanage tells me that I need a firmware  
update on my PERC5.  Happy to oblige I bootstrap the firmware repo and  
follow the steps on the wiki.  The RPMs are installed fine, however:

[adam at newmail ~]$ sudo /usr/sbin/update_firmware --yes

Running system inventory...

Searching storage directory for available BIOS updates...
Checking System BIOS for PowerEdge 2950 - 1.5.1
	Available: system_bios(ven_0x1028_dev_0x01b2) - 2.3.1
	Found Update: system_bios(ven_0x1028_dev_0x01b2) - 2.3.1

Found firmware which needs to be updated.

Running updates...
  100% Installing  
pci_firmware(ven_0x1028_dev_0x0015_subven_0x1028_subdev_0x1f03) -  
5.2.2-0072
Done: Update complete. You must perform a warm reboot for the update  
to take effect.

-	Installing system_bios(ven_0x1028_dev_0x01b2) - 2.3.1Installation  
failed for package: system_bios(ven_0x1028_dev_0x01b2) - 2.3.1
aborting update...

The error message from the low-level command was:

Could not update the system BIOS.

Many times, this is due to memory constraints. The BIOS update can  
require from
1 to 4 megabytes of physically contiguous free RAM in order to do the  
update.
Because memory can become fragmented, this is not always available. To  
correct
this, try rebooting and running the update immediately after reboot.

The output from the low-level bios update command was:

Performing BIOS update...
Traceback (most recent call last):
   File "/usr/sbin/dellBiosUpdate", line 185, in ?
     sys.exit( main() )
   File "/usr/sbin/dellBiosUpdate", line 153, in main
     exit_code = updateBios(HdrFile(options.hdr), options)
   File "<libsmbios_c._peak_util_decorators.rewrap wrapping  
libsmbios_c.rbu_update.updateBios at 0x-48334C54>", line 3, in  
updateBios
   File "/usr/lib/python2.4/site-packages/libsmbios_c/ 
trace_decorator.py", line 98, in trace
     result = func(*args, **kw)
   File "/usr/lib/python2.4/site-packages/libsmbios_c/rbu_update.py",  
line 95, in updateBios
     if compareBiosVersions(ver, hdrfile.biosVersion()) >= 0:
   File "<libsmbios_c._peak_util_decorators.rewrap wrapping  
libsmbios_c.rbu_hdr.biosVersion at 0x-483491D4>", line 3, in biosVersion
   File "/usr/lib/python2.4/site-packages/libsmbios_c/ 
trace_decorator.py", line 98, in trace
     result = func(*args, **kw)
   File "/usr/lib/python2.4/site-packages/libsmbios_c/rbu_hdr.py",  
line 87, in biosVersion
     ver = "%d.%d.%d" % struct.unpack("BBB", self.hdr.biosVersion)
NameError: global name 'struct' is not defined

-----

Now, I'm not a python guy, but after a little googling I added an  
include for struct, thus:

[adam at newmail ~]$ diff -u /usr/lib/python2.4/site-packages/libsmbios_c/ 
rbu_hdr.py.dist /usr/lib/python2.4/site-packages/libsmbios_c/rbu_hdr.py
--- /usr/lib/python2.4/site-packages/libsmbios_c/rbu_hdr.py.dist	 
2009-03-18 10:28:54.000000000 -0500
+++ /usr/lib/python2.4/site-packages/libsmbios_c/rbu_hdr.py	2009-03-18  
10:33:56.000000000 -0500
@@ -14,6 +14,7 @@
  # imports (alphabetical)
  import ctypes
  import exceptions
+import struct

-----

Which seems to have solved the problem.  My question, is there  
something odd with my python install that means struct isn't included  
by default, or would this code just never work if it hits that line?

Yours confusedly,

Adam.

-- 
Adam Auden                                           adam at bondware.com
Manager, Network & Systems                                615-521-1308


More information about the firmware-tools-devel mailing list