summaryrefslogtreecommitdiff
path: root/meta-openbmc-mods
diff options
context:
space:
mode:
authorLoic Prylli <lprylli@netflix.com>2019-08-26 22:09:49 +0300
committerLoic Prylli <lprylli@netflix.com>2019-08-26 22:16:53 +0300
commit11aca1d6bf839d173947f47f95f66d481f4ccba9 (patch)
tree133bde4e54053df8ea62d954e3476215f342747f /meta-openbmc-mods
parent35e295e2a161fcf146ea031de53431b2888521fa (diff)
downloadopenbmc-11aca1d6bf839d173947f47f95f66d481f4ccba9.tar.xz
openbmc-mods/preinit-mount: fix restore_op/reformat_ubi_volume case
The ubi_format command should be applied to the MTD device rather than the ubi device (otherwise trying .restore_op == 3 ends-up not doing anything). Tested: - echo 3 > /tmp/.rwfs/.restore_op [ use debug-init on kernel command-line ] - reboot - checks output of /tmp/init.log, and pristine dflts
Diffstat (limited to 'meta-openbmc-mods')
-rwxr-xr-xmeta-openbmc-mods/meta-common/recipes-phosphor/preinit-mounts/preinit-mounts/init3
1 files changed, 2 insertions, 1 deletions
diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/preinit-mounts/preinit-mounts/init b/meta-openbmc-mods/meta-common/recipes-phosphor/preinit-mounts/preinit-mounts/init
index e97c40c1c..ee70e7b0f 100755
--- a/meta-openbmc-mods/meta-common/recipes-phosphor/preinit-mounts/preinit-mounts/init
+++ b/meta-openbmc-mods/meta-common/recipes-phosphor/preinit-mounts/preinit-mounts/init
@@ -128,11 +128,12 @@ reformat_ubi_volume() {
local nv_num="$1"
local mnt="$2"
local ubi="/dev/ubi${nv_num}"
+ local mtd="/dev/mtd${nv_num}"
local vol="${ubi}_0"
# unmount the volume to reformat it
umount -f "$mnt"
ubidetach -m $nv_num
- ubiformat -y "$ubi"
+ ubiformat -y "$mtd"
prepare_ubi_volume $nv_num
# remount the UBIFS on the UBI volume
mount -t ubifs "$vol" "$mnt"