From 0d80208657cd28c3d071a496fdd9b4377f8ea931 Mon Sep 17 00:00:00 2001 From: Jaroslaw G Date: Tue, 19 May 2020 09:47:26 +0200 Subject: [PATCH] fixing issue with fdisk GPT message In function find_unused_disks() there is a potential bug. In some situation message from the fdisk about GPT support is delayed: > WARNING: fdisk GPT support is currently new, and therefore in an experimental phase. Use at your own discretion. This affecting possibility to do awk on the specific disks following code: `fdisks=$(fdisk -l |& awk '/^Disk .* bytes/{print $2}' |sort)` can be replaced with `(fdisk -l 2>/dev/null | awk '/^Disk .* bytes/{print $2}' |sort)` --- pre-install/disk-test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pre-install/disk-test.sh b/pre-install/disk-test.sh index 014d230..faab15c 100755 --- a/pre-install/disk-test.sh +++ b/pre-install/disk-test.sh @@ -62,7 +62,7 @@ done find_unused_disks() { [[ -n "$DBG" ]] && set -x disklist="" - fdisks=$(fdisk -l |& awk '/^Disk .* bytes/{print $2}' |sort) + fdisks=$(fdisk -l 2>/dev/null | awk '/^Disk .* bytes/{print $2}' |sort) for d in $fdisks; do [[ -n "$DBG" ]] && echo Fdisk list loop, Checking Device: $dev dev=${d%:} # Strip colon off the dev path string