blob: 0cc8f2368aea57c5cc3fd89f9290a7b96060290a [file] [log] [blame]
Charles Kearney1b1fb842023-05-30 14:27:49 -05001#!/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
23findmtd() {
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
31rom=uefi-master
32echo "Checking for mtd partition ${rom}"
33image=$(findmtd ${rom})
34if test -z "$image"
35then
36 echo "Unable to find mtd partition for ${rom}"
37 exit 1
38fi
39rom_mtd=${image}
40
41uefi_version="hpe-uefi-version /dev/${rom_mtd}"
42busctl set-property xyz.openbmc_project.Software.BMC.Updater /xyz/openbmc_project/software/bios_active xyz.openbmc_project.Software.Version Version s "$uefi_version"
43busctl get-property xyz.openbmc_project.Software.BMC.Updater /xyz/openbmc_project/software/bios_active xyz.openbmc_project.Software.Version Version