commit | b6cd31e162b25779a68344d3c0bde7c6cfb1af7f | [log] [tgz] |
---|---|---|
author | Ed Tanous <edtanous@google.com> | Mon Feb 07 10:02:28 2022 -0800 |
committer | Ed Tanous <ed@tanous.net> | Mon Feb 28 18:10:34 2022 +0000 |
tree | 0eb98a9a9188e239f073c219068f62ba62e156d8 | |
parent | 93c0202ad93c4bace9c8c79286a788300c86d08e [diff] |
Simplify message registry to save binary size Internally to bmcweb, we actually store two copies of every string in the base privilege registry. As history played out, the error_messages.cpp was created first, then when logging was added, we needed more fine grained programatic lookups into the message registries, so we invented the constexpr array. Previously, it was thought that xz basically deduplicated the duplicated strings. While this is true to some extent, it using the actual processing code seems to be a win on binary size. This is also a -500 line diff, so it's reducing the amount of code we have at the same time. Note, the "InvalidUpload" message is incorrect per the standard, which this patchset sort of teases out, as it's the only one that can't be updated. This patchset leaves it as-written. Tested: xz compressed bmcweb went from 1174632 bytes, down to 1157040 bytes, or a 1.4% (17592 bytes) reduction in compressed binary size. curl --insecure --user root:0penBmc https://192.168.7.2/redfish/v1/Chassis/foobar { "error": { "@Message.ExtendedInfo": [ { "@odata.type": "#Message.v1_1_1.Message", "Message": "The requested resource of type #Chassis.v1_16_0.Chassis named 'foobar' was not found.", "MessageArgs": [ "#Chassis.v1_16_0.Chassis", "foobar" ], "MessageId": "Base.1.11.0.ResourceNotFound", "MessageSeverity": "Critical", "Resolution": "Provide a valid resource identifier and resubmit the request." } ], "code": "Base.1.11.0.ResourceNotFound", "message": "The requested resource of type #Chassis.v1_16_0.Chassis named 'foobar' was not found." } } Note, the MessageId property has changed its version from Base.1.8 to Base.1.11. This is correct and matches the version of the registry we use. Also, the second argument is now quoted, as the ResourceNotFound schema requires. Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: Ifd0bd71a26eebeba8ba89704a1eca425f0776aa8
This component attempts to be a "do everything" embedded webserver for openbmc.
At this time, the webserver implements a few interfaces:
BMCWeb is configured by setting -D
flags that correspond to options in bmcweb/meson_options.txt
and then compiling. For example, meson <builddir> -Dkvm=disabled ...
followed by ninja
in build directory. The option names become C++ preprocessor symbols that control which code is compiled into the program.
meson builddir ninja -C builddir
meson builddir -Dbuildtype=minsize -Db_lto=true -Dtests=disabled ninja -C buildir
If any of the dependencies are not found on the host system during configuration, meson automatically gets them via its wrap dependencies mentioned in bmcweb/subprojects
.
meson builddir -Dwrap_mode=nofallback ninja -C builddir
meson builddir -Dbuildtype=debug ninja -C builddir
meson builddir -Db_coverage=true -Dtests=enabled ninja coverage -C builddir test
When BMCWeb starts running, it reads persistent configuration data (such as UUID and session data) from a local file. If this is not usable, it generates a new configuration.
When BMCWeb SSL support is enabled and a usable certificate is not found, it will generate a self-sign a certificate before launching the server. The keys are generated by the secp384r1
algorithm. The certificate
C=US, O=OpenBMC, CN=testhost
,SHA-256
algorithm.