From ba0a428afbadccb61d526fb4b752f6dfa38744fc Mon Sep 17 00:00:00 2001 From: Jose Luis Duran Date: Tue, 15 Oct 2024 16:32:20 +0000 Subject: [PATCH 1/2] jail: Use the right arch for a pkgbase jail This is currently a problem for anything not amd64 when building pkgbase jails. Strip the `ARCH` and use only what corresponds to `TARGET_ARCH`. --- src/share/poudriere/jail.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/share/poudriere/jail.sh b/src/share/poudriere/jail.sh index 846ac6e845..58be5ca1db 100755 --- a/src/share/poudriere/jail.sh +++ b/src/share/poudriere/jail.sh @@ -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) @@ -889,7 +889,7 @@ install_from_pkgbase() { mkdir -p "${JAILMNT}/etc/pkg" cat < "${JAILMNT}/etc/pkg/pkgbase.conf" pkgbase: { - url: "${SOURCES_URL}/FreeBSD:${VERSION}:${ARCH}/${PKGBASEREPO}" + url: "${SOURCES_URL}/FreeBSD:${VERSION}:${ARCH#*.}/${PKGBASEREPO}" enabled: yes } EOF @@ -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 From 8a239369b868f3c4b0198e48c3510d0d3a3a8d9a Mon Sep 17 00:00:00 2001 From: Jose Luis Duran Date: Wed, 16 Oct 2024 00:28:33 +0000 Subject: [PATCH 2/2] jail: Use the real path Depending on the installation type, the symbolic link may not be present. --- src/share/poudriere/jail.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/share/poudriere/jail.sh b/src/share/poudriere/jail.sh index 58be5ca1db..6b4026bb2a 100755 --- a/src/share/poudriere/jail.sh +++ b/src/share/poudriere/jail.sh @@ -117,8 +117,8 @@ list_jail() { _jget method ${name} method _jget mnt ${name} mnt _jget timestamp ${name} timestamp || : - if [ -r "${mnt}/sys/sys/param.h" ]; then - osversion=$(awk '/^\#define[[:blank:]]__FreeBSD_version/ {print $3}' "${mnt}/sys/sys/param.h") + if [ -r "${mnt}/usr/src/sys/sys/param.h" ]; then + osversion=$(awk '/^\#define[[:blank:]]__FreeBSD_version/ {print $3}' "${mnt}/usr/src/sys/sys/param.h") else osversion= fi