summaryrefslogtreecommitdiff
path: root/meta-phosphor/common/recipes-phosphor/flash
diff options
context:
space:
mode:
authorEddie James <eajames@us.ibm.com>2018-04-12 21:47:49 +0300
committerBrad Bishop <bradleyb@fuzziesquirrel.com>2018-05-04 18:16:19 +0300
commitd1e3b586a767d01f2b2c18f889afba9faad0c6da (patch)
treefb31f0e31456f4509aab053a71216c860e6d7e42 /meta-phosphor/common/recipes-phosphor/flash
parentafd4941577e27a702d0d1edd5221554e4a454c4d (diff)
downloadopenbmc-d1e3b586a767d01f2b2c18f889afba9faad0c6da.tar.xz
U-Boot mirroring: remove check_is_alt()
The BMC automatically changes the mtd device numbers (and udev names) when we're on the alternate chip. As such, we can always copy the current BMC chip u-boot to the alt chip, without checking whether we're on the alternate chip or not; "alt" always means the other chip than the one we're booted from. Change-Id: Iedf9f3aae2196434b7972be6b73b4bc7bfb608d0 Signed-off-by: Eddie James <eajames@us.ibm.com>
Diffstat (limited to 'meta-phosphor/common/recipes-phosphor/flash')
-rw-r--r--meta-phosphor/common/recipes-phosphor/flash/phosphor-software-manager/obmc-flash-bmc40
1 files changed, 3 insertions, 37 deletions
diff --git a/meta-phosphor/common/recipes-phosphor/flash/phosphor-software-manager/obmc-flash-bmc b/meta-phosphor/common/recipes-phosphor/flash/phosphor-software-manager/obmc-flash-bmc
index 8327ad92dd..26f99cc130 100644
--- a/meta-phosphor/common/recipes-phosphor/flash/phosphor-software-manager/obmc-flash-bmc
+++ b/meta-phosphor/common/recipes-phosphor/flash/phosphor-software-manager/obmc-flash-bmc
@@ -1,33 +1,6 @@
#!/bin/bash
set -eo pipefail
-# Check if BMC is currently booted from the alternate chip; returns "1" if true
-check_if_alt() {
- res=0
- wdiof_cardreset_bit=5
- wdiof_cardreset=$((1 << $wdiof_cardreset_bit))
-
- # Read the systemd watchdog config to see which device we should use
- line=$(cat /etc/systemd/system.conf | grep "WatchdogDevice")
- if [ ! -z ${line} ]; then
- watchdog_device=${line##WatchdogDevice=/dev/}
-
- # Check for legacy symlink to /dev/watchdog0
- if [ ${watchdog_device} == "watchdog" ]; then
- watchdog_device="watchdog0"
- fi
-
- # Check the bootstatus to see if we've been reset
- path="/sys/class/watchdog/${watchdog_device}/bootstatus"
- if [ -f ${path} ]; then
- bootstatus=$(cat ${path})
- res=$((($bootstatus & $wdiof_cardreset) >> $wdiof_cardreset_bit))
- fi
- fi
-
- echo "${res}"
-}
-
# Get the root mtd device number (mtdX) from "/dev/ubiblockX_Y on /"
findrootmtd() {
rootmatch=" on / "
@@ -449,17 +422,10 @@ mirroruboot() {
bmcenvdev="/dev/${bmcenv}"
altenv="$(findmtd "alt-u-boot-env")"
altenvdev="/dev/${altenv}"
- is_alt="$(check_if_alt)"
- if [[ "${is_alt}" == "1" ]]; then
- echo "Mirroring U-boot; alt to bmc"
- mtd_copy "${altdev}" "${bmcdev}"
- mtd_copy "${altenvdev}" "${bmcenvdev}"
- else
- echo "Mirroring U-boot; bmc to alt"
- mtd_copy "${bmcdev}" "${altdev}"
- mtd_copy "${bmcenvdev}" "${altenvdev}"
- fi
+ echo "Mirroring U-boot to alt chip"
+ mtd_copy "${bmcdev}" "${altdev}"
+ mtd_copy "${bmcenvdev}" "${altenvdev}"
copy_ubiblock_to_alt
copy_root_to_alt