seperated flash download
diff --git a/bin/Palmetto.py b/bin/Palmetto.py
index 80dccf0..2786723 100644
--- a/bin/Palmetto.py
+++ b/bin/Palmetto.py
@@ -167,13 +167,13 @@
'instances' : [ { 'name' : 'Bios_0' } ]
}
-SYSTEM_CONFIG['org.openbmc.manager.Flash'] = {
+SYSTEM_CONFIG['org.openbmc.manager.Download'] = {
'system_state' : 'STANDBY',
'start_process' : True,
'monitor_process' : True,
- 'process_name' : 'flash_manager.py',
+ 'process_name' : 'download_manager.py',
'heartbeat' : 'no',
- 'instances' : [ { 'name' : 'FlashManager_0' } ]
+ 'instances' : [ { 'name' : 'DownloadManager_0' } ]
}
SYSTEM_CONFIG['org.openbmc.control.Host'] = {
diff --git a/bin/download_manager.py b/bin/download_manager.py
new file mode 100644
index 0000000..842b45e
--- /dev/null
+++ b/bin/download_manager.py
@@ -0,0 +1,58 @@
+#!/usr/bin/env python
+
+import sys
+import gobject
+import dbus
+import dbus.service
+import dbus.mainloop.glib
+import tftpy
+
+
+
+DBUS_NAME = 'org.openbmc.managers.Download'
+OBJ_NAME = '/org/openbmc/managers/Download'
+TFTP_PORT = 69
+DOWNLOAD_DIR = '/tmp'
+
+class DownloadManagerObject(dbus.service.Object):
+ def __init__(self,bus,name):
+ dbus.service.Object.__init__(self,bus,name)
+ bus = dbus.SessionBus()
+ bus.add_signal_receiver(self.DownloadHandler,
+ dbus_interface = "org.openbmc.Flash", signal_name = "Download")
+
+ @dbus.service.signal(DBUS_NAME,signature='s')
+ def DownloadComplete(self,outfile):
+ print "Download Complete: "+outfile
+ return outfile
+
+ @dbus.service.signal(DBUS_NAME)
+ def DownloadError(self):
+ pass
+
+ def DownloadHandler(self,url,filename):
+ try:
+ filename = str(filename)
+ client = tftpy.TftpClient(url, TFTP_PORT)
+ print "Downloading: "+filename+" from "+url
+ outfile = DOWNLOAD_DIR+"/"+filename
+ client.download(filename,outfile)
+ self.DownloadComplete(outfile)
+
+ except Exception as e:
+ print "ERROR DownloadManager: "+str(e)
+ self.DownloadError()
+
+
+
+if __name__ == '__main__':
+ dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)
+
+ bus = dbus.SessionBus()
+ name = dbus.service.BusName(DBUS_NAME, bus)
+ obj = DownloadManagerObject(bus, OBJ_NAME)
+ mainloop = gobject.MainLoop()
+
+ print "Running Download Manager"
+ mainloop.run()
+
diff --git a/bin/ipmi_example.py b/bin/ipmi_example.py
index 7fb6a86..fc9123b 100644
--- a/bin/ipmi_example.py
+++ b/bin/ipmi_example.py
@@ -89,8 +89,9 @@
for k in data[i].keys():
print k+" = "+str(data[i][k])
elif (cmd == "updatefw"):
- intf = Openbmc.getManagerInterface(bus,"Flash")
- intf.updateFromTftp("bios","bakerstreet.aus.stglabs.ibm.com","firmware.bin")
+ obj = bus.get_object('org.openbmc.flash.Bios','/org/openbmc/flash/Bios_0')
+ intf = dbus.Interface(obj,"org.openbmc.Flash")
+ intf.updateViaTftp("bakerstreet.aus.stglabs.ibm.com","firmware.bin")
elif (cmd == "fwstatus"):
intf = Openbmc.getManagerInterface(bus,"Flash")
status = intf.getStatus()