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>
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 41c1ad3..3fad5e6 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 @@
 
 # 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