fetch() { wget -N -c --show-progress -q -P "$SOURCES" $1 } create_sysroot() { mkdir -p "$SYSROOT"/{etc,cross,usr} mkdir -p "$SYSROOT"/usr/{bin,sbin,lib,include} for directory in bin sbin lib; do ln -fs "usr/$directory" "$SYSROOT/$directory" done ln -fs lib "$SYSROOT/usr/lib64" ln -fs usr/lib64 "$SYSROOT/lib64" } discard_out() { "$@" > /dev/null } redirect_out() { local path=$1; shift "$@" > "$path" } discard_all() { "$@" > /dev/null 2>&1 } redirect_all() { local path=$1; shift "$@" > "$path" 2>&1 }