diff --git a/dracut-functions.sh b/dracut-functions.sh index 5807b8c59e..8afbbd801e 100755 --- a/dracut-functions.sh +++ b/dracut-functions.sh @@ -1047,7 +1047,7 @@ pe_file_format() { if [[ $# -eq 1 ]]; then local magic magic=$(objdump -p "$1" \ - | awk '{if ($1 == "Magic"){print strtonum("0x"$2)}}') + | gawk '{if ($1 == "Magic"){print strtonum("0x"$2)}}') magic=$(printf "0x%x" "$magic") # 0x10b (PE32), 0x20b (PE32+) [[ $magic == 0x20b || $magic == 0x10b ]] && return 0 diff --git a/dracut.sh b/dracut.sh index 01aa437279..a67d124456 100755 --- a/dracut.sh +++ b/dracut.sh @@ -2467,7 +2467,7 @@ if [[ $uefi == yes ]]; then fi fi - offs=$(objdump -h "$uefi_stub" 2> /dev/null | awk 'NF==7 {size=strtonum("0x"$3);\ + offs=$(objdump -h "$uefi_stub" 2> /dev/null | gawk 'NF==7 {size=strtonum("0x"$3);\ offset=strtonum("0x"$4)} END {print size + offset}') if [[ $offs -eq 0 ]]; then dfatal "Failed to get the size of $uefi_stub to create UEFI image file"