$rval was the return code of pkg_available and not of build.sh, since pkg_available returns 0. because of this install_cross_pkg() would always return 0 for success.
$rval was the return code of pkg_available and not of build.sh, since pkg_available returns 0. because of this install_cross_pkg() would always return 0 for success.