diff options
author | Jason M. Bills <jason.m.bills@linux.intel.com> | 2021-08-26 22:04:05 +0300 |
---|---|---|
committer | Jason M. Bills <jason.m.bills@linux.intel.com> | 2021-08-26 22:04:05 +0300 |
commit | ae908254d22318b9e27acf6e5e28d1a4ab5e2195 (patch) | |
tree | 0d057ad30ca7f77c7c299762d60929e34ff51ab5 /meta-phosphor/recipes-phosphor/initrdscripts | |
parent | 67327ddc580cb9a85219a534844832a1682780d4 (diff) | |
parent | 66d661a7f7784d58c8a437f1cdeb0c0ab03f0364 (diff) | |
download | openbmc-ae908254d22318b9e27acf6e5e28d1a4ab5e2195.tar.xz |
Merge tag '0.70' of ssh://git-amr-1.devtools.intel.com:29418/openbmc-openbmc into update
Diffstat (limited to 'meta-phosphor/recipes-phosphor/initrdscripts')
-rw-r--r-- | meta-phosphor/recipes-phosphor/initrdscripts/phosphor-mmc-init.bb | 2 | ||||
-rw-r--r-- | meta-phosphor/recipes-phosphor/initrdscripts/phosphor-mmc-init/mmc-init.sh | 12 |
2 files changed, 14 insertions, 0 deletions
diff --git a/meta-phosphor/recipes-phosphor/initrdscripts/phosphor-mmc-init.bb b/meta-phosphor/recipes-phosphor/initrdscripts/phosphor-mmc-init.bb index 0c7a88cd9..aa55d1be9 100644 --- a/meta-phosphor/recipes-phosphor/initrdscripts/phosphor-mmc-init.bb +++ b/meta-phosphor/recipes-phosphor/initrdscripts/phosphor-mmc-init.bb @@ -8,8 +8,10 @@ PR = "r1" inherit allarch RDEPENDS_${PN} += " \ + ${@d.getVar('PREFERRED_PROVIDER_u-boot-fw-utils', True) or 'u-boot-fw-utils'} \ ${VIRTUAL-RUNTIME_base-utils} \ e2fsprogs-e2fsck \ + e2fsprogs-mke2fs \ gptfdisk \ parted \ udev \ diff --git a/meta-phosphor/recipes-phosphor/initrdscripts/phosphor-mmc-init/mmc-init.sh b/meta-phosphor/recipes-phosphor/initrdscripts/phosphor-mmc-init/mmc-init.sh index 3fad5e6fa..575b7605a 100644 --- a/meta-phosphor/recipes-phosphor/initrdscripts/phosphor-mmc-init/mmc-init.sh +++ b/meta-phosphor/recipes-phosphor/initrdscripts/phosphor-mmc-init/mmc-init.sh @@ -49,6 +49,18 @@ if ! mount /dev/disk/by-partlabel/"$(get_root)" $rodir -t ext4 -o ro; then fi rwfsdev="/dev/disk/by-partlabel/rwfs" +mkdir -p /var/lock +if test $(fw_printenv -n rwreset) = "true"; then + echo "Factory reset requested." + if ! mkfs.ext4 -F "${rwfsdev}"; then + echo "Reformat for factory reset failed." + /bin/sh + else + fw_setenv rwreset + echo "Formatting of rwfs is complete." + fi +fi + fsck.ext4 -p "${rwfsdev}" if ! mount "${rwfsdev}" $rodir/var -t ext4 -o rw; then /bin/sh |