/usr/share/pyshared/firmware_addon_dell/biosHdr.py is in firmware-addon-dell 2.2.9-0ubuntu2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 | # vim:tw=0:expandtab:autoindent:tabstop=4:shiftwidth=4:filetype=python:
#############################################################################
#
# Copyright (c) 2005 Dell Computer Corporation
# Dual Licenced under GNU GPL and OSL
#
#############################################################################
"""module
some docs here eventually.
"""
from libsmbios_c import system_info as sysinfo
from libsmbios_c import rbu_update
from libsmbios_c import rbu_hdr
compareVersions = rbu_update.compareBiosVersions
class PermissionDenied (Exception): pass
class InternalError (Exception): pass
class InvalidHdr (Exception): pass
def getSystemId():
return sysinfo.get_dell_system_id()
def getProductName():
return sysinfo.get_system_name()
def getServiceTag():
return sysinfo.get_service_tag()
def getSystemBiosVer():
return sysinfo.get_bios_version()
# no good way to unit test this for now...
def isHdrFileNewer(file):
try:
ver = sysinfo.get_bios_version()
hdrfile = rbu_hdr.HdrFile(file)
return rbu_update.compareBiosVersions(hdrfile.biosVersion(), ver) > 0
except rbu_hdr.InvalidRbuHdr, e:
raise InvalidHdr(str(e))
def getBiosHdrVersion(file):
try:
f = rbu_hdr.HdrFile(file)
return f.biosVersion()
except rbu_hdr.InvalidRbuHdr, e:
raise InvalidHdr(str(e))
def getHdrSystemIds(file):
try:
f = rbu_hdr.HdrFile(file)
return [ id for id, hwrev in f.systemIds() ]
except rbu_hdr.InvalidRbuHdr, e:
raise InvalidHdr(str(e))
|