Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jail: Use the right arch for a pkgbase jail #1180

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

jlduran
Copy link
Member

@jlduran jlduran commented Oct 15, 2024

This is currently a problem for anything not amd64 when building pkgbase jails. Strip the ARCH and use only what corresponds to TARGET_ARCH.

@jlduran
Copy link
Member Author

jlduran commented Oct 15, 2024

Test plan:

# poudriere jail -c -j generic-15 -m pkgbase=base_latest -U https://pkg.freebsd.org -v 15 -K generic
# poudriere jail -l
JAILNAME    VERSION         OSVERSION ARCH          METHOD  TIMESTAMP           PATH
generic-15  15.0-CURRENT              arm64.aarch64 pkgbase 2024-10-15 16:27:01 /usr/local/poudriere/jails/generic-15

@jlduran
Copy link
Member Author

jlduran commented Oct 15, 2024

cc/ @emaste

@jlduran
Copy link
Member Author

jlduran commented Oct 15, 2024

Note

The OSVERSION does not show up because there is no /sys in the jail (not related to this change).

EDIT: A workaround/fix is offered in a separate commit.

@bdrewery
Copy link
Member

bdrewery commented Dec 9, 2024

I don't use pkgbase or touch image ever, so need a review from someone else to get this in.

This is currently a problem for anything not amd64 when building pkgbase
jails.  Strip the `ARCH` and use only what corresponds to `TARGET_ARCH`.
Depending on the installation type, the symbolic link may not be
present.
@jlduran
Copy link
Member Author

jlduran commented Dec 9, 2024

Rebase.

Let's wait for @bapt or @manu then. Thank you!

I'll take the rebase as an opportunity to explain the reasoning behind the changes.

This pull request contains two commits:

  1. get_host_arch() sets ARCH as $(uname -m).$(uname -p), if both are the same (as is the case for amd64), then it just uses one. For all the other architectures, both values will differ. pkg ABI uses FreeBSD:<version>:$(uname -p), so we must trim the uname -m part.

  2. On some installations, make distributeworld may have not been executed (as is the case for pkgbase). Among other things, it installs the symlink /sys ->/usr/src/sys (https://github.com/freebsd/freebsd-src/blob/c3f8900e696998c410dc16f9bd9d45c24c413e6b/Makefile.inc1#L1522). Arguably, this symlink can be added to the pkgbase as a post-install scrpt.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants