Re: set : illegal option -o pipefail error while trying to upgrade pkg.

From: Warner Losh <imp_at_bsdimp.com>
Date: Sun, 28 Jan 2024 18:18:47 UTC
On Sun, Jan 28, 2024 at 11:08 AM Craig Leres <leres@freebsd.org> wrote:

> On 1/28/24 09:55, Warner Losh wrote:
> > On Sun, Jan 28, 2024 at 10:53 AM Warner Losh <imp@bsdimp.com
> > <mailto:imp@bsdimp.com>> wrote:
> >
> >     OK. On your 10.x arm system, you need to build /bin/sh using sources
> >     from FreeBSD 13.
> >     Binaries from 12 or 13 won't work on your 10.x system: libc doesn't
> >     have the right symbols.
> >     But source build against a 10.x system should work. That was my
> >     suggestion. Too bad
> >     pipefail didn't arrive until 14. So you'll need to build that on
> >     your 14 system.
> >
> > ... need to build stable/14 on your 10.x system this should say. Rather
> > an important
> > detail I didn't catch on first proofreading.
> What about just copying /rescue/sh from a new enough system?
>
> My build server is 13.2 but it has a 14.0-RELEASE-p4 poudriere jail and
> the sh from that runs on 13.2 at least (and has pipefail). I tried to
> test with an older version of FreeBSD but it looks like my spare machine
> is too new for its usb keyboard to work with FreeBSD 10 or 11...
>

/rescue/sh will have system calls embedded in it that the old FreeBSD 10
kernel will not understand. Between FreeBSD 11 and 12 we moved to
64bit inode sizes, adding a bunch of system calls that we don't fall back
to the old versions of. Plus we've added a bunch of *at system calls that
we now use always (they are more general than the old system calls, so
those have changed into library routines that call the *at function in the
right way).

Warner