summaryrefslogtreecommitdiffstats
path: root/watch.cpp
Commit message (Collapse)AuthorAgeFilesLines
* clang-format: Update to match docs repoGunnar Mills2018-09-111-7/+11
| | | | | | | | Update the .clang-format file. Now includes header sorting and updating PointerAlignment. Change-Id: I5c7690d8d83cdebe26ff3a73b90a2a8c17dd8054 Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
* Always call close on fd if file has been openedVernon Mauery2018-05-231-2/+5
| | | | | | | | | The previous logic only called close if the file had been opened AND there was a valid inotify watch handle. Even if there is not a watch handle, the file should be closed. Change-Id: I0bfb3a0fac88d5b648790c4e60755e01af6f5bd7 Signed-off-by: Vernon Mauery <vernon.mauery@linux.intel.com>
* Enable clang code formatAdriana Kobylak2018-03-021-21/+12
| | | | | Change-Id: Ia899858c11cff6e4fa26b820b35b1e5dca1b57df Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
* Fix error loggingAdriana Kobylak2018-02-131-1/+1
| | | | | | | | | | | | | | | | - The logging interfaces don't support std::string, so need to pass c-strings to the metadata fields, or the pointer address will be the one added to the log. - Log the name of the file uploaded to the BMC instead of the manifest path when there is a manifest error. The manifest path is always /tmp/imgXXXX/MANIFEST which doesn't help debug. - Check the status of the child process after waitpid returns. The execl call returns when there was an error executing execl, not if the command executed failed. This will catch when tar returns a non-0 return code. Change-Id: Ia4bd2666fc6beec28dee7e821d959a336800d282 Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
* Create Image Dir if not presentGunnar Mills2017-11-131-4/+1
| | | | | | | | | | | Instead of throwing an error, create the image directory, if not present. The inotify code should create the image directory if not present, not the upload or TFTP code. Removed creating the image directory from the TFTP here and removed from the upload in another commit. Change-Id: I8c142283cfd5a3c87bdf2291d2e79729ec9ac319 Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
* Create version dbus objectGunnar Mills2017-05-241-4/+6
| | | | | | | | | | Read the version and purpose from the manifest. Compute the id from the version. Create the image dir, <IMAGE_UPLOAD_DIR>/<id>/. Create the version object with the version, purpose, id and image dir path. Change-Id: I6d2d710fb8eeeda085af8ab116f2dafc720a2ade Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
* Check if image upload dir existsGunnar Mills2017-05-241-0/+12
| | | | | | | | The inotify doesn't work if the image upload dir doesn't exist. If the image dir doesn't exist log an error. Change-Id: I2b8c49182f2f19b8343587f4723575b6f6fc8781 Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
* Call processImage from inotifyGunnar Mills2017-05-111-5/+10
| | | | | Change-Id: I0b748f93f8e34552cef67616317c28660284ac99 Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
* Change inotify to look at IN_CLOSE_WRITE flagGunnar Mills2017-04-271-2/+2
| | | | | | | | | The inotify is triggering before the image is done downloading. This leads to a corrupted tar. Look at the IN_CLOSE_WRITE flag instead. Change-Id: Ib9d3f97ae3c48960a0bdf84250a66d1f8254a7f5 Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
* image manager: add inotify watchDeepak Kodihalli2017-04-181-0/+104
Add an inotify watch to the known software image location. Hook the inotify fd with sd-event, so that on callback, version d-bus objects can be created based on the newly added software image. Resolves openbmc/openbmc#1444. Change-Id: I5c460f820c8d3a851b8ddc969f26d38870c36991 Signed-off-by: Deepak Kodihalli <dkodihal@in.ibm.com>
OpenPOWER on IntegriCloud