diff -Nur -x '*.orig' -x '*.rej' smolt-0.9.8.1/client/smolt.py mezzanine_patched_smolt-0.9.8.1/client/smolt.py --- smolt-0.9.8.1/client/smolt.py 2007-06-07 10:32:03.000000000 -0600 +++ mezzanine_patched_smolt-0.9.8.1/client/smolt.py 2007-06-07 10:31:16.000000000 -0600 @@ -41,6 +41,9 @@ from urlparse import urljoin from urllib import urlencode +import os +import commands + smoonURL = 'http://smolt.smeserverpro.com/' smoltProtocol = '.91' user_agent = 'smolt/%s' % smoltProtocol @@ -210,17 +213,19 @@ ignore = 1 if device.bus == 'Unknown' or device.bus == 'unknown': return 1 - if device.bus == 'block' or device.bus == 'ide': - return 1 - if device.bus == 'usb' and device.type == None: - return 1 - if device.bus == 'usb' and device.type == 'OTHER': + if device.vendorid in (0, None) and device.type == None: return 1 if device.bus == 'usb' and device.driver == 'hub': return 1 + if device.bus == 'usb' and 'Hub' in device.description: + return 1 if device.bus == 'sound' and device.driver == 'Unknown': return 1 - if device.bus == 'pnp' and (device.driver == 'Unknown' or device.driver == 'system'): + if device.bus == 'pnp' and device.driver in ('Unknown', 'system'): + return 1 + if device.bus == 'block' and device.type == 'DISK': + return 1 + if device.bus == 'usb_device' and device.type == None: return 1 return 0 @@ -280,6 +285,60 @@ props = dev.GetAllProperties() self.devices[udi] = Device(props) if udi == '/org/freedesktop/Hal/devices/computer': + status, systemType = commands.getstatusoutput("config gettype SystemMode") + if status == 0: + props['system.formfactor'] = systemType + try: + vendor = props['system.vendor'] + if len(vendor.strip()) == 0: + vendor = None + except KeyError: + try: + vendor = props['vendor'] + if len(vendor.strip()) == 0: + vendor = None + except KeyError: + vendor = None + try: + product = props['system.product'] + if len(product.strip()) == 0: + product = None + except KeyError: + try: + product = props['product'] + if len(product.strip()) == 0: + product = None + except KeyError: + product = None + if vendor is None or product is None: + dmiOutput = os.popen("dmidecode", "r") + section = None + sysvendor = None + sysproduct = None + boardvendor = None + boardproduct = None + for line in dmiOutput: + line = line.strip() + if "Information" in line: + section = line + elif section is None: + continue + elif line.startswith("Manufacturer: ") and section.startswith("System"): + sysvendor = line.split("Manufacturer: ", 1)[1] + elif line.startswith("Product Name: ") and section.startswith("System"): + sysproduct = line.split("Product Name: ", 1)[1] + elif line.startswith("Manufacturer: ") and section.startswith("Base Board"): + boardvendor = line.split("Manufacturer: ", 1)[1] + elif line.startswith("Product Name: ") and section.startswith("Base Board"): + boardproduct = line.split("Product Name: ", 1)[1] + status = dmiOutput.close() + if status is None: + if sysvendor not in (None, 'System Manufacturer') and sysproduct not in (None, 'System Name'): + props['system.vendor'] = sysvendor + props['system.product'] = sysproduct + elif boardproduct is not None and boardproduct is not None: + props['system.vendor'] = boardvendor + props['system.product'] = boardproduct self.host = Host(props) self.hostSendString = urlencode({ 'UUID' : self.host.UUID, @@ -511,18 +570,7 @@ return 'SOCKET' if node.has_key('storage.drive_type'): - #CDROM - if node['storage.drive_type'] == 'cdrom': - return 'CDROM' - #HD - if node['storage.drive_type'] == 'disk': - return 'HD' - #FLOPPY - if node['storage.drive_type'] == 'floppy': - return 'FLOPPY' - #TAPE - if node['storage.drive_type'] == 'tape': - return 'TAPE' + return node['storage.drive_type'].upper() #PRINTER if node.has_key('printer.product'): diff -Nur -x '*.orig' -x '*.rej' smolt-0.9.8.1/smoon/hardware/templates/stats.kid mezzanine_patched_smolt-0.9.8.1/smoon/hardware/templates/stats.kid --- smolt-0.9.8.1/smoon/hardware/templates/stats.kid 2007-05-24 12:54:23.000000000 -0600 +++ mezzanine_patched_smolt-0.9.8.1/smoon/hardware/templates/stats.kid 2007-06-07 10:31:52.000000000 -0600 @@ -142,7 +142,7 @@ -

kernel

+

Kernel

@@ -152,7 +152,7 @@
${kernelVersion[0]}
-

type

+

Type

${formfactor[0]}