From 9e08ff4ce98a4fa7f7ed5135affc91778b37d7f6 Mon Sep 17 00:00:00 2001 From: Andrew Jeffery Date: Thu, 1 Apr 2021 22:28:43 +1030 Subject: 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 --- .../recipes-phosphor/initrdscripts/phosphor-mmc-init/mmc-init.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'meta-phosphor/recipes-phosphor/initrdscripts/phosphor-mmc-init') 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 -- cgit v1.2.3