diff options
author | Bryan Drewery <bryan@shatow.net> | 2022-11-04 18:19:31 +0300 |
---|---|---|
committer | Bryan Drewery <bryan@shatow.net> | 2022-11-05 00:43:09 +0300 |
commit | 17846eb959ce9847d9845b6b027b14007a837c05 (patch) | |
tree | 2374925b524f66c3a0030c1b424be981b20f3647 | |
parent | ad6bd98a65af67e32315a00efbe1e51614f2ad3a (diff) |
testport -c: Fix not using proper jail arch.
Fixes #1012
-rwxr-xr-x | src/share/poudriere/common.sh | 21 | ||||
-rwxr-xr-x | src/share/poudriere/jail.sh | 2 |
2 files changed, 19 insertions, 4 deletions
diff --git a/src/share/poudriere/common.sh b/src/share/poudriere/common.sh index 2fa10165..2d815756 100755 --- a/src/share/poudriere/common.sh +++ b/src/share/poudriere/common.sh @@ -2896,14 +2896,21 @@ update_version_env() { } export_cross_env() { - [ $# -eq 2 ] || eargs cross_env arch version - local arch="$1" - local version="$2" + [ $# -eq 3 ] || eargs jailname cross_env arch version + local jailname="$1" + local arch="$2" + local version="$3" + local mnt osversion export "UNAME_r=${version% *}" export "UNAME_v=FreeBSD ${version}" export "UNAME_m=${arch%.*}" export "UNAME_p=${arch#*.}" + if _jget mnt ${JAILNAME} mnt; then + osversion=$(awk '/\#define __FreeBSD_version/ { print $3 }' \ + "${mnt}/usr/include/sys/param.h") + export "OSVERSION=${osversion}" + fi } unset_cross_env() { @@ -2911,6 +2918,7 @@ unset_cross_env() { unset UNAME_v unset UNAME_m unset UNAME_p + unset OSVERSION } jail_start() { @@ -3337,6 +3345,13 @@ setup_makeconf() { MACHINE_ARCH=${arch#*.} ARCH=\${MACHINE_ARCH} EOF + if [ -n "${name}" ]; then + if _jget version ${name} version; then + export_cross_env "${JAILNAME}" \ + "${arch}" \ + "${version}" + fi + fi fi fi diff --git a/src/share/poudriere/jail.sh b/src/share/poudriere/jail.sh index 37b040a5..5c901d1a 100755 --- a/src/share/poudriere/jail.sh +++ b/src/share/poudriere/jail.sh @@ -301,7 +301,7 @@ update_jail() { FREEBSD_UPDATE="${FREEBSD_UPDATE} --currently-running ${version}" FREEBSD_UPDATE="${FREEBSD_UPDATE} -f ${JAILMNT}/etc/freebsd-update.conf" - export_cross_env "${ARCH}" "${version}" + export_cross_env "${JAILNAME}" "${ARCH}" "${version}" if [ -z "${TORELEASE}" ]; then # New updates are identified by a symlink containing # the basedir hash and -install as suffix. If we |