Re: Cross compiling user applications for armv7

Warner Losh <[email protected]>
Newsgroups gmane.os.freebsd.devel.arm
Message-ID <CANCZdfrupWD_yL_78mg5SRO0A9hWhBgeQM4hC8EX-P0jvLrF1A@mail.gmail.com>
On Tue, Sep 23, 2025 at 3:24 AM Michał Kruszewski <[email protected]>
wrote:

> > make installworld/kernel won’t work without root privileges because it
> would create an invalid ‘world’
> > how would a setuid binary work after non-root install lets say passwd(1)
>
> I have no idea.
> However, embedded Linux build tools, for example Buildroot, are able to
> prepare valid target root files systems with valid permissions without
> requiring root privileges on the host machine.
>

For FreeBSD, NO_ROOT installs write a manifest files that things like
makefs use to get the permissions write in the final images. The metadata
for the files on the host do not match what they be in the final image, but
the METALOG that's produced in NO_ROOT installs allows makefs to get them
right.

Linux does similar things, I'm told, but I'm not familiar with all the
details.

Here's a silly proof of concept script I wrote to generate images for
14.3/15.0 w/o root privs using pkgbase and boot them in qemu. pkgbase as a
non-privileged user also does the metalog, and the script adds some extra
data to the metalog for the files that are created to get the boot in qemu
working.

https://people.freebsd.org/~imp/poc-imaging-pkgbase.sh

I wrote it to start to bring pkgbase support to nanobsd.sh, which is a work
in progress.

Warner
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.