Patrick Venture | 9efef5d | 2019-06-19 08:45:44 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2019 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 | |
| 17 | #include "config.h" |
| 18 | |
| 19 | #include "cleanup.hpp" |
| 20 | #include "util.hpp" |
| 21 | |
| 22 | #include <blobs-ipmid/blobs.hpp> |
Patrick Venture | 9efef5d | 2019-06-19 08:45:44 -0700 | [diff] [blame] | 23 | #include <phosphor-logging/log.hpp> |
Patrick Venture | 9b37b09 | 2020-05-28 20:58:57 -0700 | [diff] [blame^] | 24 | |
| 25 | #include <memory> |
Patrick Venture | 9efef5d | 2019-06-19 08:45:44 -0700 | [diff] [blame] | 26 | #include <string> |
| 27 | #include <vector> |
| 28 | |
| 29 | namespace ipmi_flash |
| 30 | { |
Brandon Kim | cec91dd | 2019-09-16 17:24:40 -0700 | [diff] [blame] | 31 | std::vector<std::string> files = { |
| 32 | STATIC_HANDLER_STAGED_NAME, TARBALL_STAGED_NAME, HASH_FILENAME, |
| 33 | VERIFY_STATUS_FILENAME, UPDATE_STATUS_FILENAME}; |
Patrick Venture | 9efef5d | 2019-06-19 08:45:44 -0700 | [diff] [blame] | 34 | } |
| 35 | |
| 36 | extern "C" std::unique_ptr<blobs::GenericBlobInterface> createHandler() |
| 37 | { |
| 38 | using namespace phosphor::logging; |
| 39 | |
| 40 | auto handler = ipmi_flash::FileCleanupHandler::CreateCleanupHandler( |
| 41 | ipmi_flash::cleanupBlobId, ipmi_flash::files); |
| 42 | |
| 43 | if (!handler) |
| 44 | { |
| 45 | log<level::ERR>("Unable to create FileCleanupHandle for Firmware"); |
| 46 | return nullptr; |
| 47 | } |
| 48 | |
| 49 | return handler; |
| 50 | } |