summaryrefslogtreecommitdiffstats
path: root/pyflashbmc
Commit message (Collapse)AuthorAgeFilesLines
* bmc_update.py: Use BMC state manager to reboot BMCLei YU2018-04-041-4/+6
| | | | | | | | | | | | | | | It was using BMC control service to call warmReset() to reboot BMC. But now legacy BMC control service is removed so the call will fail. Use BMC state manager instead to trigger BMC reboot. Partially resolves openbmc/openbmc#3064. Tested: Run legacy code update and verify PrepareForupdate() does reboot the BMC. Change-Id: I9f0fcddce9fb8f4007db0dd17b3cd3840c8848fc Signed-off-by: Lei YU <mine260309@gmail.com>
* Port to python 3CamVan Nguyen2018-03-121-8/+12
| | | | | | | | | | Port code to python 3 yet remain backward compatible to python 2. This port is in preparation for yocto 2.4 upgrade. Partially resolves openbmc/openbmc#2920 Change-Id: If174ce9444bde4e21fb086764f4def017e423201 Signed-off-by: CamVan Nguyen <ctnguyen@us.ibm.com>
* pep8 fixesAdriana Kobylak2018-02-121-12/+15
| | | | | | | | Also ignore the configs/ directory since it only contains system configuration files named <system>.py. Change-Id: I0416239c4030ce5bc39473e65e560016cd4ffc75 Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
* bmc_update.py: Call fw_setenv twice for PrepareForUpdateAdriana Kobylak2017-10-021-0/+7
| | | | | | | | | | | | | | | Support for u-boot redundant environment variables was added where u-boot alternates writing to each environment every time an variable is written. But initramfs doesn't know which environment is active so it always reads from the same one. Therefore need to twice set the environments that initramfs reads so that they're written to both environments and initramfs can read it. Part of openbmc/openbmc#2292 Change-Id: Ifaa9a55067cdd2f42b534b680809552f6574a56a Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
* bmc_update: explictly save firmware environmentMilton Miller2017-08-151-1/+20
| | | | | | | | | | | | | | | Find the file to copy from the firmware environent config, and assume the complete file should be saved as an image to the u-boot-env mtd partition. Preserve network settings has worked to save the u-boot-env by copying the runtime copy of the env saved by the initramfs init script to /run/fw_env. That copy was created as a workaround for a flash erase problem that can not be created with the current driver. Change-Id: Ie42ddbb4f821447349f70ab21d1333194aba08cf Signed-off-by: Milton Miller <miltonm@us.ibm.com>
* pyflashbmc: Remove initramfs from list of expected imagesMilton Miller2017-08-151-1/+0
| | | | | | | | | | | | Remove the no longer present initramfs image as the initramfs is no longer stored in a seperate partition. Individual flash partition updates have not worked via rest (Update will return "Unpack Error") since the switch to storing the initramfs in the FIT image. Change-Id: Ie01fc18704fca2296cb7436dfea07ba4773a0ace Signed-off-by: Milton Miller <miltonm@us.ibm.com>
* python: add vim modelinesBrad Bishop2016-09-231-0/+2
| | | | | Change-Id: Ic13d79892e3efe6f7bad357ad747e6fd25299d02 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Use super to construct dbus.service.ObjectBrad Bishop2016-09-121-4/+3
| | | | | Change-Id: I830decfc523d435c6b9ecdc9ffffec7956c3b85d Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* bmcupdate: pep8 fixesBrad Bishop2016-09-061-263/+265
| | | | | Change-Id: I44b65bc0c22bc137c2e7daf3f5933de3a1fc0063 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Remove unnecessary InterfacesAdded signalsBrad Bishop2016-07-101-2/+0
| | | | | | | | | | Remove ObjectManager signals emitted before a bus name is owned. This isn't necessary now that the system_manager can detect objects via NameOwnerChanged. Change-Id: Ia2b626a926392b50d20c26474e6c9a9fdb3ca2f0 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Export objects prior to bus name grabBrad Bishop2016-07-101-0/+2
| | | | | | | | | The default behavior in pyphosphor changed such that ObjectManager and Properties signals are not emitted by default. Enable signals just prior to bus name grab. Change-Id: I27a2de4b60482dd843702396f33c7cdccaf17277 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Defer busname ownership until init completeBrad Bishop2016-07-101-1/+1
| | | | | | | | | Avoid race conditions where applications expecting an object to be present upon recipt of NameOwnerChanged find that the object hasn't been created yet. Change-Id: I4236a3898055a84b00e1eaf37f32e0192b683a0f Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* pyflashbmc: Remove unused variableBrad Bishop2016-07-101-1/+0
| | | | | Change-Id: I0c795151f723fdfa41aa24d9213ffb8490b03349 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* flash_bmc: Add Apply method to flash updates from runtimeMilton Miller2016-06-301-9/+154
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit adds methods to Validate (not exposed), Apply, GetUpdateProgress, and Abort along with an auto_apply attribute. A PrepareForUpdate method is also added that will write bootloader environment to instruct the initramfs init script to copy necessary file system state into RAM to allow the flash to be updated. Together these methods take the prior Update method and chain on the Validate phase which checks the image can be applied concurrently (and could be extended to check signatures). If validation fails auto_apply is cleared. If auto_apply remains true then Apply is called which will perform the check again (implicitly in the update script) and update the flash contents, saving its output to a temporary file. The GetUpdateProgress will return the status variable followed by the output from the update script, with status that was overwritten with a carriage return stripped. As each new phase (erase, write, and verify) of each image is encountered the message will be extended. An Abort method will kill an in-progress update, erase the logfile, and remove any pending images. A new image can be unpacked at this time. Note: the current method to clear all persistent files removes the whitelist and all future calls will clear all files from the read write layer. This maybe addressed in a future update. Signed-off-by: Milton Miller <miltonm@us.ibm.com>
* bmc_update: allow whitelist to be files in a directoryMilton Miller2016-06-301-1/+21
| | | | | | | | | | The whitelist is moveing from a file to a set of files in a directory. Use try when deleting whitelist entries. It would be better to call update without saving the files in the first place but this will suffice for now. Signed-off-by: Milton Miller <miltonm@us.ibm.com>
* bmc_update: save runtime modified u-boot environmentMilton Miller2016-06-301-2/+2
| | | | | | | | | | | | | | | | | Copy the version saved by our initfs and pointed to by our fw_setenv tools via /etc/fw_setenv. Do this copy by default. The /etc/fw_env.cnf config file points to /run/fw_env in our systems. The bmc_update object was copying /dev/mtd2. That could be very system specific, and it misses any changes made from elsewhere in the system. This variable causes the u-boot environment to be written back after writing the whole image. This will save the ethernet mac which for systems which don't store it elsewhere. Signed-off-by: Milton Miller <miltonm@us.ibm.com>
* Reorganize directory structureBrad Bishop2016-06-104-0/+146
Moving to directory per-application layout. This facilitates building single applications which is useful in the Yocto build environment since different applications satisfy different OpenBMC build requirements. A number of issues are also addressed: - All applications were pulling in libsystemd and the gdbus libs irrespective of whether or not they were needed. - gpio.o duplicated in every application - moved to libopenbmc_intf - Added install target Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
OpenPOWER on IntegriCloud