From ea9ba933d955c569303e2c22089999b8903fbc59 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Mon, 26 Jul 2021 11:14:35 +0200 Subject: [dev] Silence some harmless errors/warnings --- modules/dev.inc | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/modules/dev.inc b/modules/dev.inc index 3330741..4f0ee51 100644 --- a/modules/dev.inc +++ b/modules/dev.inc @@ -75,11 +75,11 @@ dev_get_type() { label="$( grep -Po '(?<=^PARTNAME=).*$' "/sys/block/${devn}/${partn}/uevent" )" number="$( grep -Po '(?<=^PARTN=).*$' "/sys/block/${devn}/${partn}/uevent" )" local gpt= - if [ "$( dd if="$dev" bs=1 count=8 skip=512 2> /dev/null )" = "EFI PART" ] 2> /dev/null; then + if [ "$( dd if="$dev" bs=1 count=8 skip=512 )" = "EFI PART" ]; then gpt=512 - elif [ "$( dd if="$dev" bs=1 count=8 skip=4096 2> /dev/null )" = "EFI PART" ] 2> /dev/null; then + elif [ "$( dd if="$dev" bs=1 count=8 skip=4096 )" = "EFI PART" ]; then gpt=4096 - fi + fi 2> /dev/null echo "Checking $partn (on $dev) GPT='$gpt', label='$label'" >&2 # Check if mbr signatur is there, no GPT label was in uevent, and no protective MBR local t1="$( __read_mbrid "$dev" 0 1 )" @@ -215,9 +215,9 @@ __init() { #echo "Using hexdump" >&2 __bin2hex() { hexdump -ve '/1 "%02x"'; } else - echo "No suitable tool for converting binary to hex" >&2 + echo "No suitable tool for converting binary to hex" exit 1 - fi + fi >&2 2> /dev/null # init __hex2bin_le t="383736353433327a" if [ "$( printf z2345678 | xxd -e -g 8 | cut -d' ' -f2 )" = "$t" ]; then @@ -239,9 +239,9 @@ __init() { elif [ "$( printf z2345678 | xxd -g 8 | cut -d' ' -f2 | awk '{ for (i=length-1;i>0;i-=2)x=x substr($0,i,2);}END{print x}' )" = "$t" ]; then __bin2hex_le() { xxd -g "$1" | cut -d' ' -f2 | awk '{ for (i=length-1;i>0;i-=2)x=x substr($0,i,2);}END{print x}'; } else - echo "No suitable tool for converting binary data to little endian hex" >&2 + echo "No suitable tool for converting binary data to little endian hex" exit 1 - fi + fi >&2 2> /dev/null unset -f __init } -- cgit v1.2.3-55-g7522