Patrick Venture | 22e3875 | 2018-11-21 08:52:49 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2018 Google Inc. |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
Patrick Venture | c7ca291 | 2018-11-02 11:38:33 -0700 | [diff] [blame] | 17 | #include "firmware_handler.hpp" |
| 18 | |
Patrick Venture | a78e39f | 2018-11-06 18:37:06 -0800 | [diff] [blame] | 19 | #include "image_handler.hpp" |
Patrick Venture | 7dad86f | 2019-05-17 08:52:20 -0700 | [diff] [blame] | 20 | #include "util.hpp" |
Patrick Venture | 26a1726 | 2019-05-20 11:03:35 -0700 | [diff] [blame] | 21 | #include "verify.hpp" |
Patrick Venture | a78e39f | 2018-11-06 18:37:06 -0800 | [diff] [blame] | 22 | |
Patrick Venture | 137ad2c | 2018-11-06 11:30:43 -0800 | [diff] [blame] | 23 | #include <algorithm> |
Patrick Venture | 192d60f | 2018-11-06 11:11:59 -0800 | [diff] [blame] | 24 | #include <cstdint> |
Patrick Venture | 18235e6 | 2018-11-08 10:21:09 -0800 | [diff] [blame] | 25 | #include <cstring> |
Patrick Venture | b3b4db7 | 2019-05-15 11:30:24 -0700 | [diff] [blame] | 26 | #include <fstream> |
Patrick Venture | 68cf64f | 2018-11-06 10:46:51 -0800 | [diff] [blame] | 27 | #include <memory> |
Patrick Venture | d333a87 | 2018-12-03 16:24:26 -0800 | [diff] [blame] | 28 | #include <phosphor-logging/log.hpp> |
Patrick Venture | fa6c4d9 | 2018-11-02 18:34:53 -0700 | [diff] [blame] | 29 | #include <string> |
| 30 | #include <vector> |
| 31 | |
Patrick Venture | d333a87 | 2018-12-03 16:24:26 -0800 | [diff] [blame] | 32 | using namespace phosphor::logging; |
| 33 | |
Patrick Venture | 1d5a31c | 2019-05-20 11:38:22 -0700 | [diff] [blame^] | 34 | namespace ipmi_flash |
Patrick Venture | c7ca291 | 2018-11-02 11:38:33 -0700 | [diff] [blame] | 35 | { |
Patrick Venture | b3b4db7 | 2019-05-15 11:30:24 -0700 | [diff] [blame] | 36 | |
Patrick Venture | 1d5a31c | 2019-05-20 11:38:22 -0700 | [diff] [blame^] | 37 | std::unique_ptr<blobs::GenericBlobInterface> |
Patrick Venture | 148cd65 | 2018-11-06 10:59:47 -0800 | [diff] [blame] | 38 | FirmwareBlobHandler::CreateFirmwareBlobHandler( |
Patrick Venture | 3ecb350 | 2019-05-17 11:03:51 -0700 | [diff] [blame] | 39 | const std::vector<HandlerPack>& firmwares, |
Patrick Venture | 74059d6 | 2019-05-17 10:40:26 -0700 | [diff] [blame] | 40 | const std::vector<DataHandlerPack>& transports, |
Patrick Venture | 3ecb350 | 2019-05-17 11:03:51 -0700 | [diff] [blame] | 41 | std::unique_ptr<VerificationInterface> verification) |
Patrick Venture | 68cf64f | 2018-11-06 10:46:51 -0800 | [diff] [blame] | 42 | { |
Patrick Venture | 5285462 | 2018-11-06 12:30:00 -0800 | [diff] [blame] | 43 | /* There must be at least one. */ |
| 44 | if (!firmwares.size()) |
| 45 | { |
Patrick Venture | d333a87 | 2018-12-03 16:24:26 -0800 | [diff] [blame] | 46 | log<level::ERR>("Must provide at least one firmware handler."); |
Patrick Venture | 5285462 | 2018-11-06 12:30:00 -0800 | [diff] [blame] | 47 | return nullptr; |
| 48 | } |
Patrick Venture | 1cde5f9 | 2018-11-07 08:26:47 -0800 | [diff] [blame] | 49 | if (!transports.size()) |
| 50 | { |
| 51 | return nullptr; |
| 52 | } |
Patrick Venture | 5285462 | 2018-11-06 12:30:00 -0800 | [diff] [blame] | 53 | |
Patrick Venture | a78e39f | 2018-11-06 18:37:06 -0800 | [diff] [blame] | 54 | std::vector<std::string> blobs; |
| 55 | for (const auto& item : firmwares) |
| 56 | { |
| 57 | blobs.push_back(item.blobName); |
| 58 | } |
Patrick Venture | 7dad86f | 2019-05-17 08:52:20 -0700 | [diff] [blame] | 59 | blobs.push_back(verifyBlobId); /* Add blob_id to always exist. */ |
Patrick Venture | 18235e6 | 2018-11-08 10:21:09 -0800 | [diff] [blame] | 60 | |
Patrick Venture | 7dad86f | 2019-05-17 08:52:20 -0700 | [diff] [blame] | 61 | if (0 == std::count(blobs.begin(), blobs.end(), hashBlobId)) |
Patrick Venture | 18235e6 | 2018-11-08 10:21:09 -0800 | [diff] [blame] | 62 | { |
| 63 | return nullptr; |
| 64 | } |
Patrick Venture | 4cceb8e | 2018-11-06 11:56:48 -0800 | [diff] [blame] | 65 | |
Patrick Venture | 1cde5f9 | 2018-11-07 08:26:47 -0800 | [diff] [blame] | 66 | std::uint16_t bitmask = 0; |
| 67 | for (const auto& item : transports) |
| 68 | { |
| 69 | /* TODO: can use std::accumulate() unless I'm mistaken. :D */ |
| 70 | bitmask |= item.bitmask; |
| 71 | } |
| 72 | |
Patrick Venture | 3ecb350 | 2019-05-17 11:03:51 -0700 | [diff] [blame] | 73 | return std::make_unique<FirmwareBlobHandler>( |
| 74 | firmwares, blobs, transports, bitmask, std::move(verification)); |
Patrick Venture | 68cf64f | 2018-11-06 10:46:51 -0800 | [diff] [blame] | 75 | } |
| 76 | |
Patrick Venture | d6461d6 | 2018-11-09 17:30:25 -0800 | [diff] [blame] | 77 | /* Check if the path is in our supported list (or active list). */ |
Patrick Venture | c7ca291 | 2018-11-02 11:38:33 -0700 | [diff] [blame] | 78 | bool FirmwareBlobHandler::canHandleBlob(const std::string& path) |
| 79 | { |
Patrick Venture | 6032dc0 | 2019-05-17 11:01:44 -0700 | [diff] [blame] | 80 | return (std::count(blobIDs.begin(), blobIDs.end(), path) > 0); |
Patrick Venture | c7ca291 | 2018-11-02 11:38:33 -0700 | [diff] [blame] | 81 | } |
Patrick Venture | 5397796 | 2018-11-02 18:59:35 -0700 | [diff] [blame] | 82 | |
Patrick Venture | d6461d6 | 2018-11-09 17:30:25 -0800 | [diff] [blame] | 83 | /* |
| 84 | * Grab the list of supported firmware. |
| 85 | * |
| 86 | * If there's an open firmware session, it'll already be present in the |
| 87 | * list as "/flash/active/image", and if the hash has started, |
| 88 | * "/flash/active/hash" regardless of mechanism. This is done in the open |
| 89 | * comamnd, no extra work is required here. |
| 90 | */ |
Patrick Venture | c7ca291 | 2018-11-02 11:38:33 -0700 | [diff] [blame] | 91 | std::vector<std::string> FirmwareBlobHandler::getBlobIds() |
| 92 | { |
Patrick Venture | 4cceb8e | 2018-11-06 11:56:48 -0800 | [diff] [blame] | 93 | return blobIDs; |
Patrick Venture | c7ca291 | 2018-11-02 11:38:33 -0700 | [diff] [blame] | 94 | } |
Patrick Venture | 5397796 | 2018-11-02 18:59:35 -0700 | [diff] [blame] | 95 | |
Patrick Venture | d6461d6 | 2018-11-09 17:30:25 -0800 | [diff] [blame] | 96 | /* |
| 97 | * Per the design, this mean abort, and this will trigger whatever |
| 98 | * appropriate actions are required to abort the process. |
Patrick Venture | 9e5aab2 | 2018-11-09 20:49:28 -0800 | [diff] [blame] | 99 | * |
| 100 | * You cannot delete a blob that has an open handle in the system, therefore |
| 101 | * this is never called if there's an open session. Guaranteed by the blob |
| 102 | * manager. |
Patrick Venture | d6461d6 | 2018-11-09 17:30:25 -0800 | [diff] [blame] | 103 | */ |
Patrick Venture | c7ca291 | 2018-11-02 11:38:33 -0700 | [diff] [blame] | 104 | bool FirmwareBlobHandler::deleteBlob(const std::string& path) |
| 105 | { |
Patrick Venture | 9e5aab2 | 2018-11-09 20:49:28 -0800 | [diff] [blame] | 106 | const std::string* toDelete; |
| 107 | |
Patrick Venture | ffcc550 | 2018-11-16 12:32:38 -0800 | [diff] [blame] | 108 | /* You cannot delete the verify blob -- trying to delete it, currently has |
| 109 | * no impact. |
| 110 | * TODO: Should trying to delete this cause an abort? |
| 111 | */ |
Patrick Venture | 7dad86f | 2019-05-17 08:52:20 -0700 | [diff] [blame] | 112 | if (path == verifyBlobId) |
Patrick Venture | ffcc550 | 2018-11-16 12:32:38 -0800 | [diff] [blame] | 113 | { |
| 114 | return false; |
| 115 | } |
| 116 | |
Patrick Venture | 7dad86f | 2019-05-17 08:52:20 -0700 | [diff] [blame] | 117 | if (path == hashBlobId || path == activeHashBlobId) |
Patrick Venture | 9e5aab2 | 2018-11-09 20:49:28 -0800 | [diff] [blame] | 118 | { |
| 119 | /* They're deleting the hash. */ |
Patrick Venture | 7dad86f | 2019-05-17 08:52:20 -0700 | [diff] [blame] | 120 | toDelete = &activeHashBlobId; |
Patrick Venture | 9e5aab2 | 2018-11-09 20:49:28 -0800 | [diff] [blame] | 121 | } |
| 122 | else |
| 123 | { |
| 124 | /* They're deleting the image. */ |
Patrick Venture | 7dad86f | 2019-05-17 08:52:20 -0700 | [diff] [blame] | 125 | toDelete = &activeImageBlobId; |
Patrick Venture | 9e5aab2 | 2018-11-09 20:49:28 -0800 | [diff] [blame] | 126 | } |
| 127 | |
| 128 | auto it = std::find_if( |
| 129 | blobIDs.begin(), blobIDs.end(), |
| 130 | [toDelete](const auto& iter) { return (iter == *toDelete); }); |
| 131 | if (it == blobIDs.end()) |
| 132 | { |
| 133 | /* Somehow they've asked to delete something we didn't say we could |
| 134 | * handle. |
| 135 | */ |
| 136 | return false; |
| 137 | } |
| 138 | |
| 139 | blobIDs.erase(it); |
| 140 | |
| 141 | /* TODO: Handle aborting the process and fixing up the state. */ |
| 142 | |
| 143 | return true; |
Patrick Venture | c7ca291 | 2018-11-02 11:38:33 -0700 | [diff] [blame] | 144 | } |
Patrick Venture | 5397796 | 2018-11-02 18:59:35 -0700 | [diff] [blame] | 145 | |
Patrick Venture | d6461d6 | 2018-11-09 17:30:25 -0800 | [diff] [blame] | 146 | /* |
| 147 | * Stat on the files will return information such as what supported |
| 148 | * transport mechanisms are available. |
| 149 | * |
| 150 | * Stat on an active file or hash will return information such as the size |
| 151 | * of the data cached, and any additional pertinent information. The |
| 152 | * blob_state on the active files will return the state of the update. |
| 153 | */ |
Patrick Venture | 1d5a31c | 2019-05-20 11:38:22 -0700 | [diff] [blame^] | 154 | bool FirmwareBlobHandler::stat(const std::string& path, |
| 155 | struct blobs::BlobMeta* meta) |
Patrick Venture | c7ca291 | 2018-11-02 11:38:33 -0700 | [diff] [blame] | 156 | { |
Patrick Venture | 46637c8 | 2018-11-06 15:20:24 -0800 | [diff] [blame] | 157 | /* We know we support this path because canHandle is called ahead */ |
Patrick Venture | 7dad86f | 2019-05-17 08:52:20 -0700 | [diff] [blame] | 158 | if (path == verifyBlobId) |
Patrick Venture | ffcc550 | 2018-11-16 12:32:38 -0800 | [diff] [blame] | 159 | { |
Patrick Venture | 699750d | 2019-05-15 09:24:09 -0700 | [diff] [blame] | 160 | /* TODO: We need to return information for the verify state -- did they |
| 161 | * call commit() did things start? |
Patrick Venture | ffcc550 | 2018-11-16 12:32:38 -0800 | [diff] [blame] | 162 | */ |
| 163 | } |
Patrick Venture | 7dad86f | 2019-05-17 08:52:20 -0700 | [diff] [blame] | 164 | else if (path == activeImageBlobId) |
Patrick Venture | 46637c8 | 2018-11-06 15:20:24 -0800 | [diff] [blame] | 165 | { |
Patrick Venture | 699750d | 2019-05-15 09:24:09 -0700 | [diff] [blame] | 166 | /* TODO: We need to return information for the image that's staged. */ |
Patrick Venture | 46637c8 | 2018-11-06 15:20:24 -0800 | [diff] [blame] | 167 | } |
Patrick Venture | 7dad86f | 2019-05-17 08:52:20 -0700 | [diff] [blame] | 168 | else if (path == activeHashBlobId) |
Patrick Venture | 46637c8 | 2018-11-06 15:20:24 -0800 | [diff] [blame] | 169 | { |
Patrick Venture | 699750d | 2019-05-15 09:24:09 -0700 | [diff] [blame] | 170 | /* TODO: We need to return information for the hash that's staged. */ |
Patrick Venture | 46637c8 | 2018-11-06 15:20:24 -0800 | [diff] [blame] | 171 | } |
| 172 | else |
| 173 | { |
| 174 | /* They are requesting information about the generic blob_id. */ |
Patrick Venture | 1cde5f9 | 2018-11-07 08:26:47 -0800 | [diff] [blame] | 175 | meta->blobState = bitmask; |
Patrick Venture | 46637c8 | 2018-11-06 15:20:24 -0800 | [diff] [blame] | 176 | meta->size = 0; |
| 177 | |
| 178 | /* The generic blob_ids state is only the bits related to the transport |
Patrick Venture | d6461d6 | 2018-11-09 17:30:25 -0800 | [diff] [blame] | 179 | * mechanisms. |
| 180 | */ |
Patrick Venture | 46637c8 | 2018-11-06 15:20:24 -0800 | [diff] [blame] | 181 | return true; |
| 182 | } |
| 183 | |
Patrick Venture | c7ca291 | 2018-11-02 11:38:33 -0700 | [diff] [blame] | 184 | return false; |
| 185 | } |
Patrick Venture | 5397796 | 2018-11-02 18:59:35 -0700 | [diff] [blame] | 186 | |
Patrick Venture | c02849b | 2018-11-06 17:31:15 -0800 | [diff] [blame] | 187 | /* |
Patrick Venture | d6461d6 | 2018-11-09 17:30:25 -0800 | [diff] [blame] | 188 | * Return stat information on an open session. It therefore must be an active |
| 189 | * handle to either the active image or active hash. |
| 190 | * |
| 191 | * The stat() and sessionstat() commands will return the same information in |
| 192 | * many cases, therefore the logic will be combined. |
| 193 | * |
| 194 | * TODO: combine the logic for stat and sessionstat(). |
| 195 | */ |
Patrick Venture | 1d5a31c | 2019-05-20 11:38:22 -0700 | [diff] [blame^] | 196 | bool FirmwareBlobHandler::stat(uint16_t session, struct blobs::BlobMeta* meta) |
Patrick Venture | d6461d6 | 2018-11-09 17:30:25 -0800 | [diff] [blame] | 197 | { |
Patrick Venture | cc7d160 | 2018-11-15 13:58:33 -0800 | [diff] [blame] | 198 | auto item = lookup.find(session); |
| 199 | if (item == lookup.end()) |
| 200 | { |
| 201 | return false; |
| 202 | } |
| 203 | |
Patrick Venture | b3b4db7 | 2019-05-15 11:30:24 -0700 | [diff] [blame] | 204 | /* The size here refers to the size of the file -- of something analagous. |
| 205 | */ |
| 206 | meta->size = (item->second->imageHandler) |
| 207 | ? item->second->imageHandler->getSize() |
| 208 | : 0; |
| 209 | |
| 210 | meta->metadata.clear(); |
| 211 | |
Patrick Venture | 699750d | 2019-05-15 09:24:09 -0700 | [diff] [blame] | 212 | /* TODO: Implement this for the verification blob, which is what we expect. |
| 213 | * Calling stat() on the verify blob without an active session should not |
| 214 | * provide insight. |
| 215 | */ |
Patrick Venture | 7dad86f | 2019-05-17 08:52:20 -0700 | [diff] [blame] | 216 | if (item->second->activePath == verifyBlobId) |
Patrick Venture | b3b4db7 | 2019-05-15 11:30:24 -0700 | [diff] [blame] | 217 | { |
Patrick Venture | 3ecb350 | 2019-05-17 11:03:51 -0700 | [diff] [blame] | 218 | auto value = verification->checkVerificationState(); |
Patrick Venture | 699750d | 2019-05-15 09:24:09 -0700 | [diff] [blame] | 219 | |
Patrick Venture | e955e07 | 2019-05-15 16:16:46 -0700 | [diff] [blame] | 220 | meta->metadata.push_back(static_cast<std::uint8_t>(value)); |
| 221 | |
| 222 | /* Change the firmware handler's state and the blob's stat value |
| 223 | * depending. |
| 224 | */ |
| 225 | if (value == VerifyCheckResponses::success || |
| 226 | value == VerifyCheckResponses::failed) |
| 227 | { |
| 228 | state = UpdateState::verificationCompleted; |
Patrick Venture | 1d5a31c | 2019-05-20 11:38:22 -0700 | [diff] [blame^] | 229 | item->second->flags &= ~blobs::StateFlags::committing; |
Patrick Venture | e955e07 | 2019-05-15 16:16:46 -0700 | [diff] [blame] | 230 | |
| 231 | if (value == VerifyCheckResponses::success) |
| 232 | { |
Patrick Venture | 1d5a31c | 2019-05-20 11:38:22 -0700 | [diff] [blame^] | 233 | item->second->flags |= blobs::StateFlags::committed; |
Patrick Venture | e955e07 | 2019-05-15 16:16:46 -0700 | [diff] [blame] | 234 | } |
| 235 | else |
| 236 | { |
Patrick Venture | 1d5a31c | 2019-05-20 11:38:22 -0700 | [diff] [blame^] | 237 | item->second->flags |= blobs::StateFlags::commit_error; |
Patrick Venture | e955e07 | 2019-05-15 16:16:46 -0700 | [diff] [blame] | 238 | } |
| 239 | } |
Patrick Venture | b3b4db7 | 2019-05-15 11:30:24 -0700 | [diff] [blame] | 240 | } |
Patrick Venture | cc7d160 | 2018-11-15 13:58:33 -0800 | [diff] [blame] | 241 | |
Patrick Venture | e955e07 | 2019-05-15 16:16:46 -0700 | [diff] [blame] | 242 | /* The blobState here relates to an active sesion, so we should return the |
| 243 | * flags used to open this session. |
| 244 | */ |
| 245 | meta->blobState = item->second->flags; |
| 246 | |
Patrick Venture | cc7d160 | 2018-11-15 13:58:33 -0800 | [diff] [blame] | 247 | /* The metadata blob returned comes from the data handler... it's used for |
| 248 | * instance, in P2A bridging to get required information about the mapping, |
| 249 | * and is the "opposite" of the lpc writemeta requirement. |
| 250 | */ |
Patrick Venture | cc7d160 | 2018-11-15 13:58:33 -0800 | [diff] [blame] | 251 | if (item->second->dataHandler) |
| 252 | { |
Patrick Venture | 7430464 | 2019-01-17 09:31:04 -0800 | [diff] [blame] | 253 | auto bytes = item->second->dataHandler->readMeta(); |
Patrick Venture | cc7d160 | 2018-11-15 13:58:33 -0800 | [diff] [blame] | 254 | meta->metadata.insert(meta->metadata.begin(), bytes.begin(), |
| 255 | bytes.end()); |
| 256 | } |
| 257 | |
Patrick Venture | cc7d160 | 2018-11-15 13:58:33 -0800 | [diff] [blame] | 258 | return true; |
Patrick Venture | d6461d6 | 2018-11-09 17:30:25 -0800 | [diff] [blame] | 259 | } |
| 260 | |
| 261 | /* |
Patrick Venture | c02849b | 2018-11-06 17:31:15 -0800 | [diff] [blame] | 262 | * If you open /flash/image or /flash/tarball, or /flash/hash it will |
| 263 | * interpret the open flags and perform whatever actions are required for |
| 264 | * that update process. The session returned can be used immediately for |
| 265 | * sending data down, without requiring one to open the new active file. |
| 266 | * |
| 267 | * If you open the active flash image or active hash it will let you |
| 268 | * overwrite pieces, depending on the state. |
| 269 | * |
| 270 | * Once the verification process has started the active files cannot be |
| 271 | * opened. |
| 272 | * |
| 273 | * You can only have one open session at a time. Which means, you can only |
| 274 | * have one file open at a time. Trying to open the hash blob_id while you |
| 275 | * still have the flash image blob_id open will fail. Opening the flash |
| 276 | * blob_id when it is already open will fail. |
| 277 | */ |
Patrick Venture | c7ca291 | 2018-11-02 11:38:33 -0700 | [diff] [blame] | 278 | bool FirmwareBlobHandler::open(uint16_t session, uint16_t flags, |
| 279 | const std::string& path) |
| 280 | { |
Patrick Venture | 6e307a7 | 2018-11-09 18:21:17 -0800 | [diff] [blame] | 281 | /* Check that they've opened for writing - read back not currently |
| 282 | * supported. |
| 283 | */ |
Patrick Venture | 1d5a31c | 2019-05-20 11:38:22 -0700 | [diff] [blame^] | 284 | if ((flags & blobs::OpenFlags::write) == 0) |
Patrick Venture | c02849b | 2018-11-06 17:31:15 -0800 | [diff] [blame] | 285 | { |
| 286 | return false; |
| 287 | } |
| 288 | |
Patrick Venture | b1b68fc | 2018-11-09 09:37:04 -0800 | [diff] [blame] | 289 | /* Is the verification process underway? */ |
| 290 | if (state == UpdateState::verificationStarted) |
| 291 | { |
| 292 | return false; |
| 293 | } |
Patrick Venture | c02849b | 2018-11-06 17:31:15 -0800 | [diff] [blame] | 294 | |
| 295 | /* Is there an open session already? We only allow one at a time. |
Patrick Venture | 6e307a7 | 2018-11-09 18:21:17 -0800 | [diff] [blame] | 296 | * |
Patrick Venture | c02849b | 2018-11-06 17:31:15 -0800 | [diff] [blame] | 297 | * TODO: Temporarily using a simple boolean flag until there's a full |
| 298 | * session object to check. |
Patrick Venture | 7c8b97e | 2018-11-08 09:14:30 -0800 | [diff] [blame] | 299 | * |
| 300 | * Further on this, if there's an active session to the hash we don't allow |
| 301 | * re-opening the image, and if we have the image open, we don't allow |
| 302 | * opening the hash. This design decision may be re-evaluated, and changed |
| 303 | * to only allow one session per object type (of the two types). But, |
| 304 | * consider if the hash is open, do we want to allow writing to the image? |
| 305 | * And why would we? But, really, the point of no-return is once the |
| 306 | * verification process has begun -- which is done via commit() on the hash |
| 307 | * blob_id, we no longer want to allow updating the contents. |
Patrick Venture | 5397796 | 2018-11-02 18:59:35 -0700 | [diff] [blame] | 308 | */ |
Patrick Venture | c02849b | 2018-11-06 17:31:15 -0800 | [diff] [blame] | 309 | if (fileOpen) |
| 310 | { |
| 311 | return false; |
| 312 | } |
| 313 | |
Patrick Venture | ffcc550 | 2018-11-16 12:32:38 -0800 | [diff] [blame] | 314 | /* Handle opening the verifyBlobId --> we know the image and hash aren't |
| 315 | * open because of the fileOpen check. |
| 316 | * |
| 317 | * The file must be opened for writing, but no transport mechanism specified |
| 318 | * since it's irrelevant. |
| 319 | */ |
Patrick Venture | 7dad86f | 2019-05-17 08:52:20 -0700 | [diff] [blame] | 320 | if (path == verifyBlobId) |
Patrick Venture | ffcc550 | 2018-11-16 12:32:38 -0800 | [diff] [blame] | 321 | { |
| 322 | /* In this case, there's no image handler to use, or data handler, |
| 323 | * simply set up a session. |
| 324 | */ |
| 325 | verifyImage.flags = flags; |
| 326 | verifyImage.state = Session::State::open; |
| 327 | |
| 328 | lookup[session] = &verifyImage; |
| 329 | |
| 330 | fileOpen = true; |
| 331 | |
| 332 | return true; |
| 333 | } |
| 334 | |
Patrick Venture | c02849b | 2018-11-06 17:31:15 -0800 | [diff] [blame] | 335 | /* There are two abstractions at play, how you get the data and how you |
| 336 | * handle that data. such that, whether the data comes from the PCI bridge |
| 337 | * or LPC bridge is not connected to whether the data goes into a static |
| 338 | * layout flash update or a UBI tarball. |
| 339 | */ |
| 340 | |
| 341 | /* Check the flags for the transport mechanism: if none match we don't |
Patrick Venture | 18235e6 | 2018-11-08 10:21:09 -0800 | [diff] [blame] | 342 | * support what they request. |
| 343 | */ |
Patrick Venture | 1cde5f9 | 2018-11-07 08:26:47 -0800 | [diff] [blame] | 344 | if ((flags & bitmask) == 0) |
Patrick Venture | c02849b | 2018-11-06 17:31:15 -0800 | [diff] [blame] | 345 | { |
| 346 | return false; |
| 347 | } |
| 348 | |
| 349 | /* 2) there isn't, so what are they opening? */ |
Patrick Venture | 7dad86f | 2019-05-17 08:52:20 -0700 | [diff] [blame] | 350 | if (path == activeImageBlobId) |
Patrick Venture | c02849b | 2018-11-06 17:31:15 -0800 | [diff] [blame] | 351 | { |
| 352 | /* 2a) are they opening the active image? this can only happen if they |
Patrick Venture | 18235e6 | 2018-11-08 10:21:09 -0800 | [diff] [blame] | 353 | * already started one (due to canHandleBlob's behavior). |
| 354 | */ |
Patrick Venture | 21c62c1 | 2018-11-09 17:46:58 -0800 | [diff] [blame] | 355 | return false; |
Patrick Venture | c02849b | 2018-11-06 17:31:15 -0800 | [diff] [blame] | 356 | } |
Patrick Venture | 7dad86f | 2019-05-17 08:52:20 -0700 | [diff] [blame] | 357 | else if (path == activeHashBlobId) |
Patrick Venture | c02849b | 2018-11-06 17:31:15 -0800 | [diff] [blame] | 358 | { |
| 359 | /* 2b) are they opening the active hash? this can only happen if they |
Patrick Venture | 18235e6 | 2018-11-08 10:21:09 -0800 | [diff] [blame] | 360 | * already started one (due to canHandleBlob's behavior). |
| 361 | */ |
Patrick Venture | 21c62c1 | 2018-11-09 17:46:58 -0800 | [diff] [blame] | 362 | return false; |
Patrick Venture | c02849b | 2018-11-06 17:31:15 -0800 | [diff] [blame] | 363 | } |
Patrick Venture | 18235e6 | 2018-11-08 10:21:09 -0800 | [diff] [blame] | 364 | |
| 365 | /* How are they expecting to copy this data? */ |
| 366 | auto d = std::find_if( |
| 367 | transports.begin(), transports.end(), |
| 368 | [&flags](const auto& iter) { return (iter.bitmask & flags); }); |
| 369 | if (d == transports.end()) |
Patrick Venture | c02849b | 2018-11-06 17:31:15 -0800 | [diff] [blame] | 370 | { |
Patrick Venture | 18235e6 | 2018-11-08 10:21:09 -0800 | [diff] [blame] | 371 | return false; |
| 372 | } |
| 373 | |
| 374 | /* We found the transport handler they requested, no surprise since |
| 375 | * above we verify they selected at least one we wanted. |
| 376 | */ |
Patrick Venture | c02849b | 2018-11-06 17:31:15 -0800 | [diff] [blame] | 377 | |
Patrick Venture | 6e307a7 | 2018-11-09 18:21:17 -0800 | [diff] [blame] | 378 | /* Elsewhere I do this check by checking "if ::ipmi" because that's the |
| 379 | * only non-external data pathway -- but this is just a more generic |
| 380 | * approach to that. |
| 381 | */ |
| 382 | if (d->handler) |
| 383 | { |
| 384 | /* If the data handler open call fails, open fails. */ |
| 385 | if (!d->handler->open()) |
| 386 | { |
| 387 | return false; |
| 388 | } |
| 389 | } |
| 390 | |
Patrick Venture | 70e30bf | 2019-01-17 10:29:28 -0800 | [diff] [blame] | 391 | /* Do we have a file handler for the type of file they're opening. |
| 392 | * Note: This should only fail if something is somehow crazy wrong. |
| 393 | * Since the canHandle() said yes, and that's tied into the list of explicit |
| 394 | * firmware handers (and file handlers, like this'll know where to write the |
| 395 | * tarball, etc). |
Patrick Venture | 18235e6 | 2018-11-08 10:21:09 -0800 | [diff] [blame] | 396 | */ |
Patrick Venture | 18235e6 | 2018-11-08 10:21:09 -0800 | [diff] [blame] | 397 | auto h = std::find_if( |
| 398 | handlers.begin(), handlers.end(), |
| 399 | [&path](const auto& iter) { return (iter.blobName == path); }); |
| 400 | if (h == handlers.end()) |
| 401 | { |
| 402 | return false; |
| 403 | } |
| 404 | |
| 405 | /* Ok, so we found a handler that matched, so call open() */ |
| 406 | if (!h->handler->open(path)) |
| 407 | { |
| 408 | return false; |
| 409 | } |
| 410 | |
Patrick Venture | 70e30bf | 2019-01-17 10:29:28 -0800 | [diff] [blame] | 411 | Session* curr; |
| 412 | const std::string* active; |
| 413 | |
Patrick Venture | 7dad86f | 2019-05-17 08:52:20 -0700 | [diff] [blame] | 414 | if (path == hashBlobId) |
Patrick Venture | 70e30bf | 2019-01-17 10:29:28 -0800 | [diff] [blame] | 415 | { |
| 416 | /* 2c) are they opening the /flash/hash ? (to start the process) */ |
| 417 | curr = &activeHash; |
Patrick Venture | 7dad86f | 2019-05-17 08:52:20 -0700 | [diff] [blame] | 418 | active = &activeHashBlobId; |
Patrick Venture | 70e30bf | 2019-01-17 10:29:28 -0800 | [diff] [blame] | 419 | } |
| 420 | else |
| 421 | { |
| 422 | curr = &activeImage; |
Patrick Venture | 7dad86f | 2019-05-17 08:52:20 -0700 | [diff] [blame] | 423 | active = &activeImageBlobId; |
Patrick Venture | 70e30bf | 2019-01-17 10:29:28 -0800 | [diff] [blame] | 424 | } |
| 425 | |
Patrick Venture | 18235e6 | 2018-11-08 10:21:09 -0800 | [diff] [blame] | 426 | curr->flags = flags; |
| 427 | curr->dataHandler = d->handler; |
| 428 | curr->imageHandler = h->handler; |
Patrick Venture | cd31022 | 2018-11-09 18:47:13 -0800 | [diff] [blame] | 429 | curr->state = Session::State::open; |
Patrick Venture | 18235e6 | 2018-11-08 10:21:09 -0800 | [diff] [blame] | 430 | |
| 431 | lookup[session] = curr; |
| 432 | |
Patrick Venture | daf4707 | 2019-05-10 15:21:55 -0700 | [diff] [blame] | 433 | /* This may be them re-opening a blob, so let's only push it onto the list |
| 434 | * when appropriate. |
| 435 | */ |
| 436 | auto blobIdMatch = |
| 437 | std::find_if(blobIDs.begin(), blobIDs.end(), |
| 438 | [active](const auto& iter) { return (iter == *active); }); |
| 439 | if (blobIdMatch == blobIDs.end()) |
| 440 | { |
| 441 | blobIDs.push_back(*active); |
| 442 | } |
Patrick Venture | db253bf | 2018-11-09 19:36:03 -0800 | [diff] [blame] | 443 | |
Patrick Venture | 12233c5 | 2019-05-16 09:26:59 -0700 | [diff] [blame] | 444 | state = UpdateState::uploadInProgress; |
Patrick Venture | 991910a | 2018-11-09 19:43:48 -0800 | [diff] [blame] | 445 | fileOpen = true; |
| 446 | |
Patrick Venture | 18235e6 | 2018-11-08 10:21:09 -0800 | [diff] [blame] | 447 | return true; |
Patrick Venture | c7ca291 | 2018-11-02 11:38:33 -0700 | [diff] [blame] | 448 | } |
Patrick Venture | 5397796 | 2018-11-02 18:59:35 -0700 | [diff] [blame] | 449 | |
Patrick Venture | 18235e6 | 2018-11-08 10:21:09 -0800 | [diff] [blame] | 450 | /** |
| 451 | * The write command really just grabs the data from wherever it is and sends it |
| 452 | * to the image handler. It's the image handler's responsibility to deal with |
| 453 | * the data provided. |
Patrick Venture | d6461d6 | 2018-11-09 17:30:25 -0800 | [diff] [blame] | 454 | * |
| 455 | * This receives a session from the blob manager, therefore it is always called |
| 456 | * between open() and close(). |
Patrick Venture | 18235e6 | 2018-11-08 10:21:09 -0800 | [diff] [blame] | 457 | */ |
Patrick Venture | c7ca291 | 2018-11-02 11:38:33 -0700 | [diff] [blame] | 458 | bool FirmwareBlobHandler::write(uint16_t session, uint32_t offset, |
| 459 | const std::vector<uint8_t>& data) |
| 460 | { |
Patrick Venture | 18235e6 | 2018-11-08 10:21:09 -0800 | [diff] [blame] | 461 | auto item = lookup.find(session); |
| 462 | if (item == lookup.end()) |
| 463 | { |
| 464 | return false; |
| 465 | } |
| 466 | |
Patrick Venture | b1b68fc | 2018-11-09 09:37:04 -0800 | [diff] [blame] | 467 | /* Prevent writing during verification. */ |
| 468 | if (state == UpdateState::verificationStarted) |
| 469 | { |
| 470 | return false; |
| 471 | } |
| 472 | |
Patrick Venture | 8af15eb | 2019-05-15 09:39:22 -0700 | [diff] [blame] | 473 | /* Prevent writing to the verification blob before they trigger |
Patrick Venture | 699750d | 2019-05-15 09:24:09 -0700 | [diff] [blame] | 474 | * verification. |
| 475 | */ |
Patrick Venture | 7dad86f | 2019-05-17 08:52:20 -0700 | [diff] [blame] | 476 | if (item->second->activePath == verifyBlobId) |
Patrick Venture | 8af15eb | 2019-05-15 09:39:22 -0700 | [diff] [blame] | 477 | { |
| 478 | return false; |
| 479 | } |
Patrick Venture | 699750d | 2019-05-15 09:24:09 -0700 | [diff] [blame] | 480 | |
Patrick Venture | 18235e6 | 2018-11-08 10:21:09 -0800 | [diff] [blame] | 481 | std::vector<std::uint8_t> bytes; |
| 482 | |
Patrick Venture | 05abf7e | 2018-11-09 11:02:56 -0800 | [diff] [blame] | 483 | if (item->second->flags & UpdateFlags::ipmi) |
Patrick Venture | 18235e6 | 2018-11-08 10:21:09 -0800 | [diff] [blame] | 484 | { |
| 485 | bytes = data; |
| 486 | } |
| 487 | else |
| 488 | { |
| 489 | /* little endian required per design, and so on, but TODO: do endianness |
| 490 | * with boost. |
| 491 | */ |
| 492 | struct ExtChunkHdr header; |
| 493 | |
| 494 | if (data.size() != sizeof(header)) |
| 495 | { |
| 496 | return false; |
| 497 | } |
| 498 | |
| 499 | std::memcpy(&header, data.data(), data.size()); |
| 500 | bytes = item->second->dataHandler->copyFrom(header.length); |
| 501 | } |
| 502 | |
| 503 | return item->second->imageHandler->write(offset, bytes); |
Patrick Venture | c7ca291 | 2018-11-02 11:38:33 -0700 | [diff] [blame] | 504 | } |
Patrick Venture | 18235e6 | 2018-11-08 10:21:09 -0800 | [diff] [blame] | 505 | |
Patrick Venture | 8c53533 | 2018-11-08 15:58:00 -0800 | [diff] [blame] | 506 | /* |
| 507 | * If the active session (image or hash) is over LPC, this allows |
| 508 | * configuring it. This option is only available before you start |
| 509 | * writing data for the given item (image or hash). This will return |
| 510 | * false at any other part. -- the lpc handler portion will know to return |
| 511 | * false. |
| 512 | */ |
Patrick Venture | c7ca291 | 2018-11-02 11:38:33 -0700 | [diff] [blame] | 513 | bool FirmwareBlobHandler::writeMeta(uint16_t session, uint32_t offset, |
| 514 | const std::vector<uint8_t>& data) |
| 515 | { |
Patrick Venture | 8c53533 | 2018-11-08 15:58:00 -0800 | [diff] [blame] | 516 | auto item = lookup.find(session); |
| 517 | if (item == lookup.end()) |
| 518 | { |
| 519 | return false; |
| 520 | } |
| 521 | |
Patrick Venture | 05abf7e | 2018-11-09 11:02:56 -0800 | [diff] [blame] | 522 | if (item->second->flags & UpdateFlags::ipmi) |
Patrick Venture | 8c53533 | 2018-11-08 15:58:00 -0800 | [diff] [blame] | 523 | { |
| 524 | return false; |
| 525 | } |
| 526 | |
Patrick Venture | d56097a | 2019-05-15 09:47:55 -0700 | [diff] [blame] | 527 | /* Prevent writing meta to the verification blob (it has no data handler). |
| 528 | */ |
| 529 | if (item->second->dataHandler) |
| 530 | { |
| 531 | return item->second->dataHandler->writeMeta(data); |
| 532 | } |
Patrick Venture | 699750d | 2019-05-15 09:24:09 -0700 | [diff] [blame] | 533 | |
Patrick Venture | d56097a | 2019-05-15 09:47:55 -0700 | [diff] [blame] | 534 | return false; |
Patrick Venture | c7ca291 | 2018-11-02 11:38:33 -0700 | [diff] [blame] | 535 | } |
Patrick Venture | 8c53533 | 2018-11-08 15:58:00 -0800 | [diff] [blame] | 536 | |
Patrick Venture | d6461d6 | 2018-11-09 17:30:25 -0800 | [diff] [blame] | 537 | /* |
Patrick Venture | 7dad86f | 2019-05-17 08:52:20 -0700 | [diff] [blame] | 538 | * If this command is called on the session for the verifyBlobId, it'll |
Patrick Venture | d6461d6 | 2018-11-09 17:30:25 -0800 | [diff] [blame] | 539 | * trigger a systemd service `verify_image.service` to attempt to verify |
Patrick Venture | ffcc550 | 2018-11-16 12:32:38 -0800 | [diff] [blame] | 540 | * the image. |
| 541 | * |
| 542 | * For this file to have opened, the other two must be closed, which means any |
| 543 | * out-of-band transport mechanism involved is closed. |
Patrick Venture | d6461d6 | 2018-11-09 17:30:25 -0800 | [diff] [blame] | 544 | */ |
Patrick Venture | c7ca291 | 2018-11-02 11:38:33 -0700 | [diff] [blame] | 545 | bool FirmwareBlobHandler::commit(uint16_t session, |
| 546 | const std::vector<uint8_t>& data) |
| 547 | { |
Patrick Venture | ffcc550 | 2018-11-16 12:32:38 -0800 | [diff] [blame] | 548 | auto item = lookup.find(session); |
| 549 | if (item == lookup.end()) |
| 550 | { |
| 551 | return false; |
| 552 | } |
| 553 | |
| 554 | /* You can only commit on the verifyBlodId */ |
Patrick Venture | 7dad86f | 2019-05-17 08:52:20 -0700 | [diff] [blame] | 555 | if (item->second->activePath != verifyBlobId) |
Patrick Venture | ffcc550 | 2018-11-16 12:32:38 -0800 | [diff] [blame] | 556 | { |
| 557 | return false; |
| 558 | } |
| 559 | |
Patrick Venture | be19870 | 2019-05-15 09:46:02 -0700 | [diff] [blame] | 560 | /* Calling repeatedly has no effect within an update process. */ |
Patrick Venture | ffcc550 | 2018-11-16 12:32:38 -0800 | [diff] [blame] | 561 | if (state == UpdateState::verificationStarted) |
| 562 | { |
Patrick Venture | be19870 | 2019-05-15 09:46:02 -0700 | [diff] [blame] | 563 | return true; |
Patrick Venture | ffcc550 | 2018-11-16 12:32:38 -0800 | [diff] [blame] | 564 | } |
| 565 | |
| 566 | /* Set state to committing. */ |
Patrick Venture | 1d5a31c | 2019-05-20 11:38:22 -0700 | [diff] [blame^] | 567 | item->second->flags |= blobs::StateFlags::committing; |
Patrick Venture | ffcc550 | 2018-11-16 12:32:38 -0800 | [diff] [blame] | 568 | |
| 569 | return triggerVerification(); |
Patrick Venture | c7ca291 | 2018-11-02 11:38:33 -0700 | [diff] [blame] | 570 | } |
Patrick Venture | d6461d6 | 2018-11-09 17:30:25 -0800 | [diff] [blame] | 571 | |
| 572 | /* |
| 573 | * Close must be called on the firmware image before triggering |
| 574 | * verification via commit. Once the verification is complete, you can |
| 575 | * then close the hash file. |
| 576 | * |
| 577 | * If the `verify_image.service` returned success, closing the hash file |
| 578 | * will have a specific behavior depending on the update. If it's UBI, |
| 579 | * it'll perform the install. If it's static layout, it'll do nothing. The |
| 580 | * verify_image service in the static layout case is responsible for placing |
| 581 | * the file in the correct staging position. |
| 582 | */ |
Patrick Venture | c7ca291 | 2018-11-02 11:38:33 -0700 | [diff] [blame] | 583 | bool FirmwareBlobHandler::close(uint16_t session) |
| 584 | { |
Patrick Venture | 68bb143 | 2018-11-09 20:08:48 -0800 | [diff] [blame] | 585 | auto item = lookup.find(session); |
| 586 | if (item == lookup.end()) |
| 587 | { |
| 588 | return false; |
| 589 | } |
| 590 | |
Patrick Venture | ffcc550 | 2018-11-16 12:32:38 -0800 | [diff] [blame] | 591 | /* Are you closing the verify blob? */ |
Patrick Venture | 7dad86f | 2019-05-17 08:52:20 -0700 | [diff] [blame] | 592 | if (item->second->activePath == verifyBlobId) |
Patrick Venture | ffcc550 | 2018-11-16 12:32:38 -0800 | [diff] [blame] | 593 | { |
Patrick Venture | ffcc550 | 2018-11-16 12:32:38 -0800 | [diff] [blame] | 594 | if (state == UpdateState::verificationStarted) |
| 595 | { |
Patrick Venture | 12233c5 | 2019-05-16 09:26:59 -0700 | [diff] [blame] | 596 | /* TODO: If they close this blob before verification finishes, |
| 597 | * that's an abort. |
| 598 | */ |
Patrick Venture | ffcc550 | 2018-11-16 12:32:38 -0800 | [diff] [blame] | 599 | return false; |
| 600 | } |
Patrick Venture | 12233c5 | 2019-05-16 09:26:59 -0700 | [diff] [blame] | 601 | else if (state == UpdateState::verificationCompleted) |
| 602 | { |
| 603 | /* TODO: Should this delete the verification artifact? */ |
| 604 | state = UpdateState::notYetStarted; |
| 605 | |
| 606 | /* A this point, delete the active blob IDs from the blob_list. */ |
| 607 | blobIDs.erase( |
Patrick Venture | 7dad86f | 2019-05-17 08:52:20 -0700 | [diff] [blame] | 608 | std::remove(blobIDs.begin(), blobIDs.end(), activeImageBlobId)); |
Patrick Venture | 12233c5 | 2019-05-16 09:26:59 -0700 | [diff] [blame] | 609 | blobIDs.erase( |
Patrick Venture | 7dad86f | 2019-05-17 08:52:20 -0700 | [diff] [blame] | 610 | std::remove(blobIDs.begin(), blobIDs.end(), activeHashBlobId)); |
Patrick Venture | 12233c5 | 2019-05-16 09:26:59 -0700 | [diff] [blame] | 611 | } |
| 612 | /* Must be verificationPending... not yet started, they may re-open and |
| 613 | * trigger verification. |
| 614 | */ |
| 615 | } |
| 616 | else |
| 617 | { |
| 618 | /* They are closing a data pathway (image, tarball, hash). */ |
| 619 | state = UpdateState::verificationPending; |
Patrick Venture | ffcc550 | 2018-11-16 12:32:38 -0800 | [diff] [blame] | 620 | } |
| 621 | |
Patrick Venture | 68bb143 | 2018-11-09 20:08:48 -0800 | [diff] [blame] | 622 | if (item->second->dataHandler) |
| 623 | { |
| 624 | item->second->dataHandler->close(); |
| 625 | } |
Patrick Venture | ffcc550 | 2018-11-16 12:32:38 -0800 | [diff] [blame] | 626 | if (item->second->imageHandler) |
| 627 | { |
| 628 | item->second->imageHandler->close(); |
| 629 | } |
| 630 | |
Patrick Venture | 68bb143 | 2018-11-09 20:08:48 -0800 | [diff] [blame] | 631 | item->second->state = Session::State::closed; |
| 632 | /* Do not delete the active blob_id from the list of blob_ids, because that |
| 633 | * blob_id indicates there is data stored. Delete will destroy it. |
| 634 | */ |
| 635 | |
| 636 | lookup.erase(item); |
| 637 | |
Patrick Venture | 991910a | 2018-11-09 19:43:48 -0800 | [diff] [blame] | 638 | fileOpen = false; |
| 639 | |
Patrick Venture | 68bb143 | 2018-11-09 20:08:48 -0800 | [diff] [blame] | 640 | return true; |
Patrick Venture | c7ca291 | 2018-11-02 11:38:33 -0700 | [diff] [blame] | 641 | } |
Patrick Venture | d6461d6 | 2018-11-09 17:30:25 -0800 | [diff] [blame] | 642 | |
Patrick Venture | c7ca291 | 2018-11-02 11:38:33 -0700 | [diff] [blame] | 643 | bool FirmwareBlobHandler::expire(uint16_t session) |
| 644 | { |
| 645 | return false; |
| 646 | } |
Patrick Venture | d6461d6 | 2018-11-09 17:30:25 -0800 | [diff] [blame] | 647 | |
| 648 | /* |
| 649 | * Currently, the design does not provide this with a function, however, |
| 650 | * it will likely change to support reading data back. |
| 651 | */ |
| 652 | std::vector<uint8_t> FirmwareBlobHandler::read(uint16_t session, |
| 653 | uint32_t offset, |
| 654 | uint32_t requestedSize) |
| 655 | { |
| 656 | return {}; |
| 657 | } |
| 658 | |
Patrick Venture | ffcc550 | 2018-11-16 12:32:38 -0800 | [diff] [blame] | 659 | bool FirmwareBlobHandler::triggerVerification() |
| 660 | { |
Patrick Venture | 3ecb350 | 2019-05-17 11:03:51 -0700 | [diff] [blame] | 661 | bool result = verification->triggerVerification(); |
| 662 | if (result) |
Patrick Venture | cabc117 | 2018-11-16 16:14:26 -0800 | [diff] [blame] | 663 | { |
Patrick Venture | 453f06a | 2019-01-17 10:02:12 -0800 | [diff] [blame] | 664 | state = UpdateState::verificationStarted; |
Patrick Venture | cabc117 | 2018-11-16 16:14:26 -0800 | [diff] [blame] | 665 | } |
Patrick Venture | cabc117 | 2018-11-16 16:14:26 -0800 | [diff] [blame] | 666 | |
Patrick Venture | 3ecb350 | 2019-05-17 11:03:51 -0700 | [diff] [blame] | 667 | return result; |
Patrick Venture | ffcc550 | 2018-11-16 12:32:38 -0800 | [diff] [blame] | 668 | } |
| 669 | |
Patrick Venture | 1d5a31c | 2019-05-20 11:38:22 -0700 | [diff] [blame^] | 670 | } // namespace ipmi_flash |