Re: Cross compiling user applications for armv7

Warner Losh <[email protected]>
Newsgroups gmane.os.freebsd.devel.arm
Message-ID <CANCZdfpTPMDsnxwFVfaZEpObyeaQUpa-vkKQMskCnpuih06Ehw@mail.gmail.com>
Top posting, but I found I  had to set
export METALOG=${TOP}/_.${ARCHOS}.metalog
export IGNORE_OSVERSION=yes             # of the host vs binaries
export OSVERSION=$(( OSMAJOR * 100000 + OSMINOR * 1000 + OSTRIV ))
export ABI=FreeBSD:${OSMAJOR}:${ARCH}
export PKG_CACHEDIR=${TOP}/repos/${ABI}
export REPOS_DIR=${W}/etc/pkg

and then do

pkg -o INSTALL_AS_USER=yes -r ${W} update
pkg -o INSTALL_AS_USER=yes -o FILES_IGNORE_GLOB='/usr/local/share/man*' -r
${W} install -y $PKG_LIST

to get things to work. I couldn't get INSTALL_AS_USER to work when set in
the environment, however. Maybe I did something wrong?

W/o doing that, I got the same error about uid/gid mismatch.

Warner

On Sat, Sep 20, 2025 at 11:56 AM Mark Millard <[email protected]> wrote:

> On Sep 20, 2025, at 10:10, Michał Kruszewski <[email protected]> wrote:
>
> > Basiclly everything has 1001/0.
> > Maybe because I install world and kernel with NO_ROOT=YES?
>
> Seems likely.
>
> > However, in such a case, why the following poudriere config does not
> work:
> > BUILD_AS_NON_ROOT=YES
> > PORTBUILD_USER=mkru
> > PORTBUILD_GROUP=wheel
> > PORTBUILD_UID=1001
> > PORTBUILD_GID=0
>
> poudriere(-devel) is not what is producing the error
> message or rejecting what you have. The pkg command
> is what is doing so and poudriere is just respecting
> that pkg indicated a failure.
>
> It looks like pkg is imposing ownership security to
> limit access to just root/wheel only --without
> poudriere(-devel) knowing that.
>
> I do not run into such because I do such activities
> as root in the first place. (Just me, with a small
> local network that does not provide external
> services and has a very limited range of activity on
> the FreeBSD systems.)
>
> ===
> Mark Millard
> marklmi at yahoo.com
>
>
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.