scripts: better handling of printf: stdout/stderr
in some cases, messages that should be considered errors or warnings, were being written to the standard output, rather than written as error messages. also: one or two printf statements should specifically avoid printing errors (to any file); in these cases, stdout has been redirected to /dev/null Signed-off-by: Leah Rowe <leah@libreboot.org>btrfsvols
parent
b78009e28a
commit
84bf47b5b9
2
lbmk
2
lbmk
|
@ -86,7 +86,7 @@ main()
|
||||||
fail "Invalid mode '${mode}'. Run: ${0} help"
|
fail "Invalid mode '${mode}'. Run: ${0} help"
|
||||||
elif [ ! -f "${buildpath}/${mode}/${option}" ]; then
|
elif [ ! -f "${buildpath}/${mode}/${option}" ]; then
|
||||||
usage $0
|
usage $0
|
||||||
printf "Invalid option for '%s'." ${mode}
|
printf "Invalid option for '%s'." ${mode} 1>&2
|
||||||
fail "Run: ${0} ${mode} list'."
|
fail "Run: ${0} ${mode} list'."
|
||||||
fi
|
fi
|
||||||
"${buildpath}/${mode}/${option}" $@ || fail "lbmk error"
|
"${buildpath}/${mode}/${option}" $@ || fail "lbmk error"
|
||||||
|
|
|
@ -22,7 +22,7 @@ listitems()
|
||||||
# -e used because this is for files *or* directories
|
# -e used because this is for files *or* directories
|
||||||
[ -e "${x}" ] || continue
|
[ -e "${x}" ] || continue
|
||||||
[ "${x##*/}" = "build.list" ] && continue
|
[ "${x##*/}" = "build.list" ] && continue
|
||||||
printf "%s\n" "${x##*/}"
|
printf "%s\n" "${x##*/}" 2>/dev/null
|
||||||
items=0
|
items=0
|
||||||
done
|
done
|
||||||
return ${items}
|
return ${items}
|
||||||
|
|
|
@ -191,9 +191,9 @@ strip_ucode()
|
||||||
"${cbfstool}" "${_newrom_b}" remove -n \
|
"${cbfstool}" "${_newrom_b}" remove -n \
|
||||||
cpu_microcode_blob.bin 2>/dev/null || microcode_present="n"
|
cpu_microcode_blob.bin 2>/dev/null || microcode_present="n"
|
||||||
if [ "${microcode_present}" = "n" ]; then
|
if [ "${microcode_present}" = "n" ]; then
|
||||||
printf "REMARK: '%s' already lacks microcode\n" \
|
printf "REMARK: '%s' already lacks microcode\n" "${romfile}" \
|
||||||
"${romfile}"
|
1>&2
|
||||||
printf "Renaming default ROM file instead.\n"
|
printf "Renaming default ROM file instead.\n" 1>&2
|
||||||
mv "${romfile}" "${_newrom_b}" || \
|
mv "${romfile}" "${_newrom_b}" || \
|
||||||
err "strip_rom_image: can't rename no-u ${romfile}"
|
err "strip_rom_image: can't rename no-u ${romfile}"
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -114,7 +114,7 @@ handle_defconfig()
|
||||||
config="${y}"
|
config="${y}"
|
||||||
config_name="${config#$target_dir/config/}"
|
config_name="${config#$target_dir/config/}"
|
||||||
|
|
||||||
printf "build/defconfig/%s %s: handling config %s\n" \
|
printf "handle/make/config %s %s: handling config %s\n" \
|
||||||
"${project}" "${target}" "${config_name}"
|
"${project}" "${target}" "${config_name}"
|
||||||
|
|
||||||
[ "${mode}" != "all" ] || check_config || continue
|
[ "${mode}" != "all" ] || check_config || continue
|
||||||
|
|
|
@ -38,7 +38,8 @@ detect_firmware()
|
||||||
[ "${CONFIG_INCLUDE_SMSC_SCH5545_EC_FW}" = "y" ] && \
|
[ "${CONFIG_INCLUDE_SMSC_SCH5545_EC_FW}" = "y" ] && \
|
||||||
needs="${needs} SCH5545EC"
|
needs="${needs} SCH5545EC"
|
||||||
[ -z ${needs+x} ] && \
|
[ -z ${needs+x} ] && \
|
||||||
printf "No binary blobs needed for this board\n" && \
|
printf "No binary blobs needed for board: %s\n" "${board}" \
|
||||||
|
1>&2 && \
|
||||||
return 1
|
return 1
|
||||||
printf "Firmware needed for board '%s':\n%s\n" "${board}" "${needs}"
|
printf "Firmware needed for board '%s':\n%s\n" "${board}" "${needs}"
|
||||||
}
|
}
|
||||||
|
|
|
@ -62,11 +62,11 @@ check_existing()
|
||||||
{
|
{
|
||||||
[ -f "${_mrc_complete}" ] || \
|
[ -f "${_mrc_complete}" ] || \
|
||||||
return 0
|
return 0
|
||||||
printf 'found existing mrc.bin\n'
|
printf "found existing mrc.bin\n" 1>&2
|
||||||
[ "$(sha512sum "${_mrc_complete}" | awk '{print $1}')" \
|
[ "$(sha512sum "${_mrc_complete}" | awk '{print $1}')" \
|
||||||
= "${_mrc_complete_hash}" ] && \
|
= "${_mrc_complete_hash}" ] && \
|
||||||
return 1
|
return 1
|
||||||
printf 'hashes did not match, starting over\n'
|
printf "hashes did not match, starting over\n" 1>&2
|
||||||
}
|
}
|
||||||
|
|
||||||
build_dependencies()
|
build_dependencies()
|
||||||
|
|
Loading…
Reference in New Issue