[PATCH skeleton] Add update rest interface to bmc

OpenBMC Patches openbmc-patches at stwcx.xyz
Sat May 21 08:01:47 AEST 2016


From: Chris Austen <austenc at us.ibm.com>

Currentling /org/openbmc/control/flash/bmc only has updateViaTftp
I am adding the update method to allow for bmc code updates with
requiring a remote tftp server.

Something like this will now work.  Ofcourse the update method is not in charge of getting the code on to the bmc server.  That's the job of something else (i.e. scp)
curl -k -H "Content-Type: application/json" -x POST -d "{\"data\": [\"/tmp/flash-barreleye\"]}" https://<ip>/org/openbmc/control/flash/bmc/action/update
---
 bin/bmc_update.py | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/bin/bmc_update.py b/bin/bmc_update.py
index a3032cf..5d66be2 100755
--- a/bin/bmc_update.py
+++ b/bin/bmc_update.py
@@ -49,6 +49,12 @@ class BmcFlashControl(Openbmc.DbusProperties,Openbmc.DbusObjectManager):
 		self.TftpDownload(ip,filename)
 		self.Set(DBUS_NAME,"status","Downloading")
 		
+	@dbus.service.method(DBUS_NAME,
+		in_signature='s', out_signature='')
+	def update(self,filename):
+		self.Set(DBUS_NAME,"filename",filename)
+		self.download_complete_handler(filename, filename)
+
 	@dbus.service.signal(DOWNLOAD_INTF,signature='ss')
 	def TftpDownload(self,ip,filename):
 		self.Set(DBUS_NAME,"filename",filename)
-- 
2.8.2




More information about the openbmc mailing list