Charles Kearney | 1b1fb84 | 2023-05-30 14:27:49 -0500 | [diff] [blame^] | 1 | #!/bin/sh |
| 2 | |
| 3 | # |
| 4 | # Copyright (c) 2021 Hewlett-Packard Development Company, L.P. |
| 5 | # |
| 6 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 7 | # you may not use this file except in compliance with the License. |
| 8 | # You may obtain a copy of the License at |
| 9 | # |
| 10 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 11 | # |
| 12 | # Unless required by applicable law or agreed to in writing, software |
| 13 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 15 | # See the License for the specific language governing permissions and |
| 16 | # limitations under the License. |
| 17 | # |
| 18 | |
| 19 | # RL300 doesn't support VROM, so we will be reading directly from |
| 20 | # SPI-NOR. The whole process is a little bit slow but works |
| 21 | |
| 22 | # Find an MTD /dev file by name |
| 23 | findmtd() { |
| 24 | echo "parameter $1" |
| 25 | m=$(grep -xl "$1" /sys/class/mtd/*/name) |
| 26 | m=${m%/name} |
| 27 | m=${m##*/} |
| 28 | echo "$m" |
| 29 | } |
| 30 | |
| 31 | rom=uefi-master |
| 32 | echo "Checking for mtd partition ${rom}" |
| 33 | image=$(findmtd ${rom}) |
| 34 | if test -z "$image" |
| 35 | then |
| 36 | echo "Unable to find mtd partition for ${rom}" |
| 37 | exit 1 |
| 38 | fi |
| 39 | rom_mtd=${image} |
| 40 | |
| 41 | uefi_version="hpe-uefi-version /dev/${rom_mtd}" |
| 42 | busctl set-property xyz.openbmc_project.Software.BMC.Updater /xyz/openbmc_project/software/bios_active xyz.openbmc_project.Software.Version Version s "$uefi_version" |
| 43 | busctl get-property xyz.openbmc_project.Software.BMC.Updater /xyz/openbmc_project/software/bios_active xyz.openbmc_project.Software.Version Version |