diff options
author | Andrew Jeffery <andrew@aj.id.au> | 2021-04-01 14:58:43 +0300 |
---|---|---|
committer | Brad Bishop <bradleyb@fuzziesquirrel.com> | 2021-05-03 17:08:58 +0300 |
commit | 9e08ff4ce98a4fa7f7ed5135affc91778b37d7f6 (patch) | |
tree | 9022998021355e0b1176df4cf354f7dce3117bbf /meta-phosphor | |
parent | 2d52a389366be11fed6a81378b0669e2c274f220 (diff) | |
download | openbmc-9e08ff4ce98a4fa7f7ed5135affc91778b37d7f6.tar.xz |
phosphor-mmc-init: Determine EFI partition presence via exit code
Testing if $magic is empty is an indirect test of whether the grep
succeeded. Instead, just use the grep exit code.
Change-Id: I3eba40e8b54863ab9a1a4436f1419b69c5bea8e1
Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
Diffstat (limited to 'meta-phosphor')
-rw-r--r-- | meta-phosphor/recipes-phosphor/initrdscripts/phosphor-mmc-init/mmc-init.sh | 3 |
1 files changed, 1 insertions, 2 deletions
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 41c1ad32b..3fad5e6fa 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 @@ -31,8 +31,7 @@ done # Move the secondary GPT to the end of the device if needed. Look for the GPT # header signature "EFI PART" located 512 bytes from the end of the device. -magic=$(tail -c 512 "${mmcdev}" | hexdump -C -n 8 | grep "EFI PART") -if test -z "${magic}"; then +if ! tail -c 512 "${mmcdev}" | hexdump -C -n 8 | grep -q "EFI PART"; then sgdisk -e "${mmcdev}" partprobe fi |