Skip to content

Commit

Permalink
jail: Use the right arch for a pkgbase jail
Browse files Browse the repository at this point in the history
This is currently a problem for anything not amd64 when building pkgbase
jails.  Strip the `ARCH` and use only what corresponds to `TARGET_ARCH`.
  • Loading branch information
jlduran committed Oct 15, 2024
1 parent 616cf45 commit ba0a428
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/share/poudriere/jail.sh
Original file line number Diff line number Diff line change
Expand Up @@ -372,9 +372,9 @@ update_jail() {
pkgbase)
VERSION=$(jget ${JAILNAME} version | cut -d '.' -f 1)
[ -z "${ARCH}" ] && ARCH=$(jget ${JAILNAME} arch)
pkg -o IGNORE_OSVERSION=yes -o ABI="FreeBSD:${VERSION}:${ARCH}" -o REPOS_DIR="${JAILMNT}/etc/pkg" -r "${JAILMNT}" update || \
pkg -o IGNORE_OSVERSION=yes -o ABI="FreeBSD:${VERSION}:${ARCH#*.}" -o REPOS_DIR="${JAILMNT}/etc/pkg" -r "${JAILMNT}" update || \
err 1 "pkg update failed"
pkg -o IGNORE_OSVERSION=yes -o ABI="FreeBSD:${VERSION}:${ARCH}" -o REPOS_DIR="${JAILMNT}/etc/pkg" -r "${JAILMNT}" upgrade -y || \
pkg -o IGNORE_OSVERSION=yes -o ABI="FreeBSD:${VERSION}:${ARCH#*.}" -o REPOS_DIR="${JAILMNT}/etc/pkg" -r "${JAILMNT}" upgrade -y || \
err 1 "pkg upgrade failed"
;;
csup|null|tar)
Expand Down Expand Up @@ -889,7 +889,7 @@ install_from_pkgbase() {
mkdir -p "${JAILMNT}/etc/pkg"
cat <<EOF > "${JAILMNT}/etc/pkg/pkgbase.conf"
pkgbase: {
url: "${SOURCES_URL}/FreeBSD:${VERSION}:${ARCH}/${PKGBASEREPO}"
url: "${SOURCES_URL}/FreeBSD:${VERSION}:${ARCH#*.}/${PKGBASEREPO}"
enabled: yes
}
EOF
Expand All @@ -899,12 +899,12 @@ FreeBSD: {
}
EOF

pkg -o IGNORE_OSVERSION=yes -o REPOS_DIR="${JAILMNT}/etc/pkg" -o ABI="FreeBSD:${VERSION}:${ARCH}" -r ${JAILMNT}/ update
pkg -o IGNORE_OSVERSION=yes -o REPOS_DIR="${JAILMNT}/etc/pkg" -o ABI="FreeBSD:${VERSION}:${ARCH#*.}" -r ${JAILMNT}/ update
# Omit the man/debug/kernel/src and tests packages, uneeded for us.
pkg -o IGNORE_OSVERSION=yes -o REPOS_DIR="${JAILMNT}/etc/pkg" -o ABI="FreeBSD:${VERSION}:${ARCH}" -r ${JAILMNT}/ search -qCx '^FreeBSD-.*' | grep -vE -- '-man|-dbg|-kernel-|-tests|-src-' | xargs pkg -o REPOS_DIR="${JAILMNT}/etc/pkg" -r ${JAILMNT}/ install -y
pkg -o IGNORE_OSVERSION=yes -o REPOS_DIR="${JAILMNT}/etc/pkg" -o ABI="FreeBSD:${VERSION}:${ARCH}" -r ${JAILMNT}/ search -q '^FreeBSD-src-sys' | xargs pkg -o REPOS_DIR="${JAILMNT}/etc/pkg" -r ${JAILMNT}/ install -y
pkg -o IGNORE_OSVERSION=yes -o REPOS_DIR="${JAILMNT}/etc/pkg" -o ABI="FreeBSD:${VERSION}:${ARCH#*.}" -r ${JAILMNT}/ search -qCx '^FreeBSD-.*' | grep -vE -- '-man|-dbg|-kernel-|-tests|-src-' | xargs pkg -o REPOS_DIR="${JAILMNT}/etc/pkg" -r ${JAILMNT}/ install -y
pkg -o IGNORE_OSVERSION=yes -o REPOS_DIR="${JAILMNT}/etc/pkg" -o ABI="FreeBSD:${VERSION}:${ARCH#*.}" -r ${JAILMNT}/ search -q '^FreeBSD-src-sys' | xargs pkg -o REPOS_DIR="${JAILMNT}/etc/pkg" -r ${JAILMNT}/ install -y
if [ -n "${KERNEL}" ]; then
pkg -o IGNORE_OSVERSION=yes -o REPOS_DIR="${JAILMNT}/etc/pkg" -o ABI="FreeBSD:${VERSION}:${ARCH}" -r ${JAILMNT}/ install -y FreeBSD-kernel-"${KERNEL}" || \
pkg -o IGNORE_OSVERSION=yes -o REPOS_DIR="${JAILMNT}/etc/pkg" -o ABI="FreeBSD:${VERSION}:${ARCH#*.}" -r ${JAILMNT}/ install -y FreeBSD-kernel-"${KERNEL}" || \
err 1 "Failed to install FreeBSD-kernel-${KERNEL}"
fi

Expand Down

0 comments on commit ba0a428

Please sign in to comment.