375547c6 | 25-Oct-2019 |
Adriana Kobylak <anoo@us.ibm.com> |
Move usr-local.mount to common code
The usr-local.mount service is intended to be a directory to patch firmware. It currently resides under the ubi feature because there the filesystem is mounted re
Move usr-local.mount to common code
The usr-local.mount service is intended to be a directory to patch firmware. It currently resides under the ubi feature because there the filesystem is mounted read-only, whereas in the static layout the root filesystem is mounted on a read-write overlay.
But this service file is not tied to a ubi filesystem, for example the static layout could be changed to not have an overlay over root, or a emmc chip would not be formatted as ubi, but would benefit from this patch directory.
The only current user of this mount service file is the virtual pnor implementation (openpower-pnor-code-mgmt), which a bmc not formatted as ubi could choose to use. Therefore move the service to the common code.
Tested: - Witherspoon: Verified service is still in the image and was started successfully by the pnor updater. - Romulus: Verified the service is in the image, but does not start because it doesn't have the virtual pnor feature. But calling 'systemctl start usr-local.mount' mounts the directory successfully.
Change-Id: I40d405e0a73f011a3c4de17cdddd8caace80587f Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
show more ...
|
f6144e9e | 18-Oct-2019 |
Lei YU <mine260309@gmail.com> |
version manager: Check all software objects
For uploaded tarball, the version manager will check if there is an existing version, and log "Software Object with the same version already exists" error
version manager: Check all software objects
For uploaded tarball, the version manager will check if there is an existing version, and log "Software Object with the same version already exists" error. However it only checks the versions that it creates, but not for existing versions on D-Bus.
This commit adds additional check, by getting all software objects and check if the uploaded version exists or not.
Tested: On a BMC running a version, upload the same BMC tarball. Before this change, it creates a version object at the same D-Bus path; With this commit, it logs "Software Object with the same version already exists", and REST API returns 400 Bad Request, with "description": "Version already exists or failed to be extracted"
Signed-off-by: Lei YU <mine260309@gmail.com> Change-Id: I0532ea99eb330060f61c9bbfea4bf2bd746432a7
show more ...
|
5a7363b4 | 18-Oct-2019 |
Lei YU <mine260309@gmail.com> |
Version: support CRLF line feed in MANIFEST
When a MANIFEST is generated from Windows and it contains CRLF as line feed, the code was getting each line with '\r' at the end, and thus the parsed stri
Version: support CRLF line feed in MANIFEST
When a MANIFEST is generated from Windows and it contains CRLF as line feed, the code was getting each line with '\r' at the end, and thus the parsed string contains '\r' and it incorrectly parses the string.
Add a piece of code to support CRLF line feed so support such MANIFEST files.
Tested: Update the unit test case to verify CRLF is correctly handled.
Signed-off-by: Lei YU <mine260309@gmail.com> Change-Id: I872bb59dbde5647e833f5c335357a3f6ae0765a5
show more ...
|
b7c062ef | 18-Sep-2019 |
Vijay Khemka <vijaykhemka@fb.com> |
Verify machine name
Verifying machine name from os-release file vs MANIFEST file in image. Also supporting backword compatibility for older version where machine name is not defined.
Tested: tested
Verify machine name
Verifying machine name from os-release file vs MANIFEST file in image. Also supporting backword compatibility for older version where machine name is not defined.
Tested: tested this with latest image build and manifest file patch
Signed-off-by: Vijay Khemka <vijaykhemka@fb.com> Change-Id: Icb0ac3f884ea1131e2ffd2bde6b8a37185dc55ea
show more ...
|
85c356f7 | 11-Sep-2019 |
John Wang <wangzqbj@inspur.com> |
Move to new association interface
A new association interface is defined in phosphor-dbus-interfaces It would be nice to move the local version of the interface to the new one.
The behavior of how
Move to new association interface
A new association interface is defined in phosphor-dbus-interfaces It would be nice to move the local version of the interface to the new one.
The behavior of how association work is described here: https://github.com/openbmc/docs/blob/master/object-mapper.md#associations
Partially resolves openbmc/openbmc#3584
Tested: See the org.openbmc.Associations interface has been replaced by the xyz one in /xyz/openbmc_project/software/version_id object
Signed-off-by: John Wang <wangzqbj@inspur.com> Change-Id: I249b7fea26f720b57e60e0bf8ba8bc71c620af98
show more ...
|
a013560f | 22-Apr-2019 |
Jayashankar Padath <jayashankar.padath@in.ibm.com> |
Code Update: ApplyTime software manager support
Get the requested image apply time value provided through the UpdateService redfish schema. If the apply time value is Immediate, then BMC reboot will
Code Update: ApplyTime software manager support
Get the requested image apply time value provided through the UpdateService redfish schema. If the apply time value is Immediate, then BMC reboot will be triggered just after the new image activation. The default apply time value is OnReset in which the new image remains at Active state and user has to manualy reboot the BMC for applying the new image.
Tested: Verified that BMC is getting rebooted if the apply time value is Immediate. OnReset scenario was also tested in which new image remained at Active state as code update application did not trigger the BMC reboot.
Signed-off-by: Jayashankar Padath <jayashankar.padath@in.ibm.com> Change-Id: I5efb51f7f36e196d6113cfca6d37c8c6bef70aa2
show more ...
|
d5b8f75c | 01-May-2019 |
Adriana Kobylak <anoo@us.ibm.com> |
item_updater: Return NotAllowed when attempting to clear FieldMode
Clearing FieldMode used to be a no-op, but by returning success, the user wouldn't necessarily know that the PUT request did not ta
item_updater: Return NotAllowed when attempting to clear FieldMode
Clearing FieldMode used to be a no-op, but by returning success, the user wouldn't necessarily know that the PUT request did not take effect, unless they checked the property value. Changed it to return an error to let the user know that their request did not take effect.
Tested: Verified an error is returned if the property is requested to be cleared when it's already set, but no error is returned if it's already cleared:
$ curl -b cjar -k -H "X-Auth-Token:$sha" -X PUT -d '{"data":"false"}' https://$bmc/xyz/openbmc_project/software/attr/FieldModeEnabled { "data": null, "message": "200 OK", "status": "ok" } $ curl -b cjar -k -H "X-Auth-Token:$sha" -X PUT -d '{"data":"true"}' https://$bmc/xyz/openbmc_project/software/attr/FieldModeEnabled { "data": null, "message": "200 OK", "status": "ok" $ curl -b cjar -k -H "X-Auth-Token: $sha" -X PUT -d '{"data":"false"}' https://$bmc/xyz/openbmc_project/software/attr/FieldModeEnabled { "data": { "description": "The specified property cannot be created" }, "message": "Input/output error", "status": "error" }
May 01 19:36:16 witherspoon phosphor-image-updater[1465]: The operation is not allowed
"MESSAGE" : "The operation is not allowed", "REASON" : "FieldMode is not allowed to be cleared", "SYSLOG_IDENTIFIER" : "phosphor-image-updater",
Change-Id: I1c0226c58956a28d903a85dfe98ac11daca4c7d4 Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
show more ...
|
9cbfa2ef | 25-Apr-2019 |
Adriana Kobylak <anoo@us.ibm.com> |
Move script, systemd conf, service files into repo
Move the common scripts, systemd configuration and service files from openbmc/openbmc to the local one.
Tested: The moved files are installed in t
Move script, systemd conf, service files into repo
Move the common scripts, systemd configuration and service files from openbmc/openbmc to the local one.
Tested: The moved files are installed in their respective locations and code update on Witherspoon is successful.
Change-Id: I2dc435db49dfbaf6e0a97cb58a9678c3462d1528 Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
show more ...
|
a8eb7810 | 23-Apr-2019 |
Adriana Kobylak <anoo@us.ibm.com> |
Move UBI service files into repo
Move the service files for the UBI layout from the openbmc/openbmc repo to the local one.
Tested: The service files are installed in /lib/systemd/system/ and
Move UBI service files into repo
Move the service files for the UBI layout from the openbmc/openbmc repo to the local one.
Tested: The service files are installed in /lib/systemd/system/ and code update on Witherspoon is successful.
Change-Id: I988045886fadbd2216ca91aba952a40ca1228e33 Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
show more ...
|
5d930286 | 08-Mar-2019 |
Lei YU <mine260309@gmail.com> |
Refactor: only untar once
The code in processImage() execute "tar xf" twice, the first time to extract the MANIFEST, and the second time to extract the whole tarball.
On a tarball without compressi
Refactor: only untar once
The code in processImage() execute "tar xf" twice, the first time to extract the MANIFEST, and the second time to extract the whole tarball.
On a tarball without compression, it's OK. But if the tarball is compressed, it takes much longer time to de-compress the tarball for twice.
This commit changes the behavior by: 1. Untar the whole tarball into a temp dir; 2. Parse the manifest as before; 3. If something is wrong, remove the temp dir as before; 4. If it's valid, rename the temp dir to the valid image dir.
It also fixes an issue that it uses const_cast in mkdtemp, which is undefined behavior because the returned const char* shall be read-only, writing this memory could cause undefined behavior.
Partially resovles openbmc/bmcweb#60
Tested: Verify the image upload works well, and it takes much less time on a gzip compressed tarball.
Change-Id: I0af81acbd948e9c54d5d168c9f72e8ebbf8daebe Signed-off-by: Lei YU <mine260309@gmail.com>
show more ...
|
ab8231c6 | 28-Mar-2019 |
Patrick Venture <venture@google.com> |
build: install into bin instead of sbin
Installs into bin instead of sbin per guidelines.
Signed-off-by: Patrick Venture <venture@google.com> Change-Id: I77f4082b9d55da775b0af59328d504f9ac9cd163 |
efd8e910 | 13-Feb-2019 |
Patrick Venture <venture@google.com> |
build: pkg anti-pattern: use defaults
Use the defaults in the pkg check where the default error message is sufficient to identify which package is missing.
Change-Id: I505ebc57cc86595df294d6e9cf7e5
build: pkg anti-pattern: use defaults
Use the defaults in the pkg check where the default error message is sufficient to identify which package is missing.
Change-Id: I505ebc57cc86595df294d6e9cf7e57513ffc3aa5 Signed-off-by: Patrick Venture <venture@google.com>
show more ...
|
991af7ec | 10-Dec-2018 |
Adriana Kobylak <anoo@us.ibm.com> |
item_updater: Call remove association on delete
The remove association function was supposed to be called on delete but was never implemented so if the associations are queried but the version has b
item_updater: Call remove association on delete
The remove association function was supposed to be called on delete but was never implemented so if the associations are queried but the version has been deleted, that'd be false information, so call to remove the associations on delete, also rename it to delete all associations, because the delete function already determined if the requested version is functional.
Tested: Verified the associations for the requested version are deleted with a DeleteAll and Delete call.
Change-Id: Ia4fde01c9500b648660bc9a4c355d44a35af7cc5 Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
show more ...
|
3b6a4cd7 | 10-Dec-2018 |
Adriana Kobylak <anoo@us.ibm.com> |
Remove deprecated is_method_error code
The is_method_error() function is no longer needed, instead a try-catch block should be used instead. Reference: https://lists.ozlabs.org/pipermail/openbmc/201
Remove deprecated is_method_error code
The is_method_error() function is no longer needed, instead a try-catch block should be used instead. Reference: https://lists.ozlabs.org/pipermail/openbmc/2018-October/013696.html,
Change-Id: I1919ea33fc18be2b8afd51fb1f85ddef15041e7c Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
show more ...
|
02516d3f | 19-Nov-2018 |
Brad Bishop <bradleyb@fuzziesquirrel.com> |
sync/watch: reduce memory usage
Currently we get a different inotify handle for every file in the synclist, and register all of them with sd_event. A single fd will work and saves memory in libsyst
sync/watch: reduce memory usage
Currently we get a different inotify handle for every file in the synclist, and register all of them with sd_event. A single fd will work and saves memory in libsystemd and the kernel, so do that instead.
This in turn allows the fileMap structure to be simplified down to a basic map of watch descriptor / filename pairs.
Remove redundant calls to both close and inotify_rm_watch - let the kernel do the work for us. From the inotify man page:
When all file descriptors referring to an inotify instance have been closed (using close(2)), the underlying object and its resources are freed for reuse by the kernel; all associated watches are auto‐ matically freed.
Change-Id: Ia63cb667cdf41c171276a0351d95347a54578f2f Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com> Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
show more ...
|
3a19e62a | 09-Nov-2018 |
Adriana Kobylak <anoo@us.ibm.com> |
sync_watch: Handle IN_IGNORED
When the hostname is updated via systemd, it modifies the /etc/hostname file in a way that triggers a IN_CLOSE_NOWRITE and IN_IGNORED signal.
* When IN_IGNORED is rec
sync_watch: Handle IN_IGNORED
When the hostname is updated via systemd, it modifies the /etc/hostname file in a way that triggers a IN_CLOSE_NOWRITE and IN_IGNORED signal.
* When IN_IGNORED is received, re-subscribe the file, since it means that the inotify watch was removed.
* A subsequent IN_CLOSE_WRITE signal is received after the re-subscribe which takes care of syncing the hostname file.
Tested: The hostname was synced when changed multiple times in a row using the REST API.
Change-Id: I30abfcdc8b33f77adc6349d345cc957b07898018 Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
show more ...
|
43699ca7 | 17-Oct-2018 |
Adriana Kobylak <anoo@us.ibm.com> |
Rename Version::Errors to Image::Errors
The Version interface is a public interface, and errors are being added to it: https://gerrit.openbmc-project.xyz/#/c/openbmc/phosphor-dbus-interfaces/+/13836
Rename Version::Errors to Image::Errors
The Version interface is a public interface, and errors are being added to it: https://gerrit.openbmc-project.xyz/#/c/openbmc/phosphor-dbus-interfaces/+/13836/
This conflicts with the internal Version errors, so rename the internal one to an Image namespace since that's not a public interface and make more sense since the errors deal with failures during image file extraction.
Tested: Uploaded an invalid tar file (u-boot.bin) and the new Image::Error was created:
"/xyz/openbmc_project/logging/entry/2": { "AdditionalData": [ "PATH=/tmp/images/u-boot.bin", "_PID=1348" ], "Description": "An internal BMC error occurred", "EventID": "None", "Id": 2, "Message": "xyz.openbmc_project.Software.Image.Error.UnTarFailure",
Change-Id: I6f6c84e2ea782c8ebc952bba4d5cee6be232f08f Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
show more ...
|
71f6e739 | 24-Sep-2018 |
Adriana Kobylak <anoo@us.ibm.com> |
Switch to C++17
Change-Id: I18db16de1fa603e366a25f564610c63076108eb9 Signed-off-by: Adriana Kobylak <anoo@us.ibm.com> |
a6963590 | 07-Sep-2018 |
Adriana Kobylak <anoo@us.ibm.com> |
Fix being able to activate a Failed version
When an activation fails, the version is marked as Failed. On a subsequent activation, the bmc updater core dumps due to 2 issues during the freeSpace cal
Fix being able to activate a Failed version
When an activation fails, the version is marked as Failed. On a subsequent activation, the bmc updater core dumps due to 2 issues during the freeSpace call: 1. The Failed activation doesn't have a Priority object, so default its priority to a large value. 2. If the subsequent activation is to the same version id, then freeSpace should not do an erase on it, because that removes the activations object that it's trying to activate.
Tested: Verified that doing an activation after a version was marked as Failed did not core dump the updater anymore.
Change-Id: Iba36497b53738e00283cfec55e8c666f943cd5d5 Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
show more ...
|
1e648729 | 17-Sep-2018 |
Gunnar Mills <gmills@us.ibm.com> |
MAINTAINERS: Update my email and IRC
Updated to correct IRC username and preferred email address.
Change-Id: I8dda2450bfc53e5a022ffdb35df3fed501dc30c2 Signed-off-by: Gunnar Mills <gmills@us.ibm.co
MAINTAINERS: Update my email and IRC
Updated to correct IRC username and preferred email address.
Change-Id: I8dda2450bfc53e5a022ffdb35df3fed501dc30c2 Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
show more ...
|
d9341b4a | 14-Sep-2018 |
Gunnar Mills <gmills@us.ibm.com> |
clang-format: Update to match docs repo
Update the .clang-format file and run clang-format-6.0. This .clang-format matches the example one in https://github.com/openbmc/docs/blob/master/cpp-style-an
clang-format: Update to match docs repo
Update the .clang-format file and run clang-format-6.0. This .clang-format matches the example one in https://github.com/openbmc/docs/blob/master/cpp-style-and-conventions.md#clang-formatting
Change-Id: Ia1edfe21e4b1ff9591b411212c77a310ec4bed68 Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
show more ...
|
b0ce996a | 07-Sep-2018 |
Gunnar Mills <gmills@us.ibm.com> |
clang-format: Update to match docs repo
Update the .clang-format file. Now includes header sorting and updating PointerAlignment.
Change-Id: I5c7690d8d83cdebe26ff3a73b90a2a8c17dd8054 Signed-off-by:
clang-format: Update to match docs repo
Update the .clang-format file. Now includes header sorting and updating PointerAlignment.
Change-Id: I5c7690d8d83cdebe26ff3a73b90a2a8c17dd8054 Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
show more ...
|
5ed9b2d7 | 06-Sep-2018 |
Adriana Kobylak <anoo@us.ibm.com> |
image_verify: Add support for OpenSSL 1.1.0
With OpenSSL 1.1.0, some of the functions were renamed, for example EVP_MD_CTX_create() and EVP_MD_CTX_destroy() were renamed to EVP_MD_CTX_new() and EVP_
image_verify: Add support for OpenSSL 1.1.0
With OpenSSL 1.1.0, some of the functions were renamed, for example EVP_MD_CTX_create() and EVP_MD_CTX_destroy() were renamed to EVP_MD_CTX_new() and EVP_MD_CTX_free(). Reference: https://wiki.openssl.org/index.php/OpenSSL_1.1.0_Changes Abstract them to support old and new APIs.
Resolves openbmc/openbmc#3136
Tested: Verified the signature verification was successful.
Change-Id: I2297243fdd652055fe9ea88f26eb2dcf473d24e6 Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
show more ...
|
fa34e023 | 04-Sep-2018 |
Gunnar Mills <gmills@us.ibm.com> |
Clang 6 updates
Just some minor fixes.
Change-Id: I000c456e51c62220d7a5fed8100cfc6c13ef9551 Signed-off-by: Gunnar Mills <gmills@us.ibm.com> |
76c79df3 | 27-Aug-2018 |
Lei YU <mine260309@gmail.com> |
static layout: Support field mode
Enable support for field mode, which sets "fieldmode=true" in u-boot env.
Tested: Verify field mode is enabled via REST API, and verify it is still enabled
static layout: Support field mode
Enable support for field mode, which sets "fieldmode=true" in u-boot env.
Tested: Verify field mode is enabled via REST API, and verify it is still enabled after BMC reboot.
Change-Id: I9ff01a51260d1f08021e0ba7ade16fd48c8bb24e Signed-off-by: Lei YU <mine260309@gmail.com>
show more ...
|