From nobody Sun Jan 28 17:55:14 2024 X-Original-To: freebsd-questions@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TNJxW2JQqz5916k for ; Sun, 28 Jan 2024 17:55:27 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-ed1-x52e.google.com (mail-ed1-x52e.google.com [IPv6:2a00:1450:4864:20::52e]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TNJxV08WDz4VVX for ; Sun, 28 Jan 2024 17:55:26 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bsdimp-com.20230601.gappssmtp.com header.s=20230601 header.b=Sxl9BmPU; dmarc=none; spf=none (mx1.freebsd.org: domain of wlosh@bsdimp.com has no SPF policy when checking 2a00:1450:4864:20::52e) smtp.mailfrom=wlosh@bsdimp.com Received: by mail-ed1-x52e.google.com with SMTP id 4fb4d7f45d1cf-55ef4a66008so319265a12.3 for ; Sun, 28 Jan 2024 09:55:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20230601.gappssmtp.com; s=20230601; t=1706464525; x=1707069325; darn=freebsd.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=Cr4pmuCjEia9gNXh6kKvbdEjk6NyD2Hdi/Hi+29q0wA=; b=Sxl9BmPUgNLMcqAfFuQ+wyIKtie/yXimftEGJ1aOdWQMr1Qd/JdMIcIuSm1CkoM5S/ 3J6ovqtqSB66CAtP24Zkjirh99lLs/b72Cb46F0vAYakM43Oihiv/rr+vUQjMStYKBqi UsNcwwUWoSLUyq/GoNBgKAIa81CplccT9w63HdICBWUWkWOMA3o/Gi2T9AKRfMzgV3ET Xqdqo4TmzsrzsuLVHRCBKDCgM8DqtVk+rvK/ztxSRuEyUYscSYgurePq40y5DwefjTdT e3WLjLnzeHmfD5w8BnOFPDASCwHbYYRx8mwE1Lsf5BCfvjsHhvoH5EMqv8ujXMRezvZR bpCA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706464525; x=1707069325; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Cr4pmuCjEia9gNXh6kKvbdEjk6NyD2Hdi/Hi+29q0wA=; b=xRPSuxnUGId1eoHAiVJWhvy+ECY08feGoaZvn5vD2yeLIhF6yL3fO5/YHhZIn8ojHb m7+l86n6cpRn8wI5yqc7XhrdBXRM5y/aGR3LzBETHNohOavqwlx78JhyIgcvf3pTqD5O au8dlXelEsClSCoGwTsY+fAnUB6UkPgyqj6+YJHMMGyKuSWC2WOFKKAttAskdT2UWQmb IC1DqAbhlPQjEv24PUpeGOsTxtCo1UccOpxFpTlXpl5HEEYffearxI077VaDSsMdpxa6 n/vPk92X+fB5VG63P9oLEfD4PBSBss/9q+nXsZOR/KCpCyUdEsW3mWn9dElvz4dVtsf9 y0Og== X-Gm-Message-State: AOJu0Yx/sNGpSQxTc+JjIz0YyRKnTwUBktzioOKcrgxSFN33FJrKisV0 A5+w0MSHNPsrW9lb04E0bIti711Hq42GX33Tzm9F5kSNNAdpH0/JMR5+uZL9Ohxuo5I4IY5LgoL Jz2GybSbH2S0xFI3qItrg1SoPBol888TlxQvwxw== X-Google-Smtp-Source: AGHT+IGm7wuBQIWAY5b6ziyLgkxEgcP+NjxSVwFS911yOUNp9oiuGKeGVBDkBrmXeFIqFij7GAVd3w/yIsUM2xFJbZ8= X-Received: by 2002:a05:6402:1644:b0:55d:2a15:f66f with SMTP id s4-20020a056402164400b0055d2a15f66fmr2786847edx.10.1706464524468; Sun, 28 Jan 2024 09:55:24 -0800 (PST) List-Id: User questions List-Archive: https://lists.freebsd.org/archives/freebsd-questions List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-questions@freebsd.org X-BeenThere: freebsd-questions@freebsd.org MIME-Version: 1.0 References: In-Reply-To: From: Warner Losh Date: Sun, 28 Jan 2024 10:55:14 -0700 Message-ID: Subject: Re: set : illegal option -o pipefail error while trying to upgrade pkg. To: Mario Marietto Cc: FreeBSD Mailing List , freebsd-hackers Content-Type: multipart/alternative; boundary="000000000000cd95510610053bd3" X-Spamd-Bar: -- X-Spamd-Result: default: False [-3.00 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-0.996]; FORGED_SENDER(0.30)[imp@bsdimp.com,wlosh@bsdimp.com]; R_DKIM_ALLOW(-0.20)[bsdimp-com.20230601.gappssmtp.com:s=20230601]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; RCVD_COUNT_ONE(0.00)[1]; R_SPF_NA(0.00)[no SPF record]; MIME_TRACE(0.00)[0:+,1:+,2:~]; ARC_NA(0.00)[]; MISSING_XM_UA(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[2a00:1450:4864:20::52e:from]; DMARC_NA(0.00)[bsdimp.com]; FREEMAIL_TO(0.00)[gmail.com]; RCVD_TLS_LAST(0.00)[]; FROM_NEQ_ENVFROM(0.00)[imp@bsdimp.com,wlosh@bsdimp.com]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; PREVIOUSLY_DELIVERED(0.00)[freebsd-questions@freebsd.org]; MLMMJ_DEST(0.00)[freebsd-questions@freebsd.org]; DKIM_TRACE(0.00)[bsdimp-com.20230601.gappssmtp.com:+] X-Rspamd-Queue-Id: 4TNJxV08WDz4VVX --000000000000cd95510610053bd3 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Sun, Jan 28, 2024 at 10:53=E2=80=AFAM Warner Losh 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. > > But it turns out that's a bit of a hassle. Well, not a huge hassle, I had > to do the following. > First, set up a FreeBSD 10.4 armv6 chroot and install qemu-user-static. S= ee > https://gist.github.com/bsdimp/0f2f294c7441ebf68a8ffebab935bd2c for > details. > Or you could just run the RPI-B image on a real RPI-B. It would be more o= f > a hassle and only marginally faster. > > Next, I created a worktree and a side branch (using the same paths in the > gist > above, note my origin is freebsd but the default is origin): > % cd git/freebsd-src > % mkdir ~/arm10/imp > % git worktree add -b arm10-14 ~/arm10/imp/stable-14 freebsd/stable/14 > I then had to apply these patches: > https://people.freebsd.org/~imp/14-sh-on-10.diff > which coped with history / libedit overhaul and O_VERIFY being added to > the system. OK, truth be told I iterated a bunch to get the patch... I ha= d > no > reason to think these changes were needed before I started... > > Next, I got into the emulated arm tree: > % sudo chroot ~/arm10 /bin/sh > # cd /imp/stable-14/ > # patch -p1 < 14-sh-on-10.diff > # make SSP_CFLAGS=3D WITHOUT_TESTS=3Dt WITHOUT_MAN=3Dt DEBUG_FILES_CFLAGS= =3D > WARNS=3D0 > ... lots of output, ignore the warnings > # set -o pipefail > set: Illegal option -o pipefail > # /usr/obj/imp/stable-14/arm.armv6/bin/sh/sh > # set -o pipefail > # ^D > # > > So success! But all that's a hassle, so I also uploaded the sh to > https://people.freebsd.org/~imp/sh14-on-10.armv6 > so you can just try it. I don't know if this will fix the problem that pu= t > us down > this rabbit hole in the first place or not. But maybe some of the above i= s > helpful > or useful for other reasons. > > Hope this helps. > > Warner > > On Sun, Jan 28, 2024 at 7:33=E2=80=AFAM Mario Marietto > wrote: > >> Using sh of FreeBSD 12.04 : >> >> /bin/sh : Undefined symbol "stat@FBSD_1.5" >> >> nothing to do. >> >> On Sun, Jan 28, 2024 at 3:17=E2=80=AFPM Mario Marietto >> wrote: >> >>> I've used FreeBSD 13.2 and I've got the same error message : >>> >>> /lib/libc.so.7: version FBSD_1.6 required by /bin/sh not found >>> >>> Let's see with FreeBSD 12.04... >>> >>> On Sun, Jan 28, 2024 at 2:04=E2=80=AFPM Mario Marietto >>> wrote: >>> >>>> Hello Warner, >>>> >>>> Thanks for your help. But unfortunately your solution didn't work. >>>> After having followed your instructions carefully : >>>> >>>> Save a copy of /bin/sh. Check out stable/13 (or 12 if the following >>>>> fails). Cd to src/bin/sh. Type make all. You may need -m >>>>> /path/to/src/share/mk if it makes complaints. Create a test area, I'l= l call >>>>> it /destdir. Also mkdir /destdir/bin too. Then make install >>>>> DESTDIR=3D/destdir. You may need to do this as root. Ignore the failu= res for >>>>> the man pages and maybe tests. You should have a /destdir/bin/sh. See= if it >>>>> runs. If so, copy it to /bin and try the upgrade again. >>>> >>>> >>>> It asked me to copy some new libraries from FreeBSD 14.0 to the >>>> /usr/lib32 and /lib directories of the FreeBSD 10.4 system. I copied a= ll >>>> the libraries requested and at the end,it gave the following error : >>>> >>>> /lib/libc.so.7: version FBSD_1.6 required by /bin/sh not found >>>> >>>> so,I have changed the flag that does not allow me to rename it with th= e >>>> command : >>>> >>>> # chflags noschg libc.so.7 >>>> >>>> and I've copied the libc.so.7 file that's on the directory /lib of the >>>> FreeBSD 14 to the same directory of the FreeBSD 10.4 system and I've >>>> rebooted. Unfortunately it hasn't been accepted. The error is the foll= owing >>>> one : >>>> >>>> /lib/libc.so.7 : unsupported relocation type 37 in non-PLT relocations >>>> >>>> What has been my mistake ? Maybe using FreeBSD 14 is wrong ? >>>> >>>> On Sun, Jan 28, 2024 at 9:47=E2=80=AFAM Mario Marietto >>>> wrote: >>>> >>>>> # set -o pipefail >>>>> set : variable name must begin with a letter. >>>>> >>>>> On Sun, Jan 28, 2024 at 5:43=E2=80=AFAM Warner Losh = wrote: >>>>> >>>>>> >>>>>> >>>>>> On Sat, Jan 27, 2024, 5:54=E2=80=AFPM Warner Losh w= rote: >>>>>> >>>>>>> >>>>>>> >>>>>>> On Sat, Jan 27, 2024, 5:12=E2=80=AFPM Mario Marietto >>>>>>> wrote: >>>>>>> >>>>>>>> Hello. >>>>>>>> >>>>>>>> I'm trying to upgrade as much as I can FreeBSD 10.4 because it is >>>>>>>> the only one version that can compile some of the old arm 32 bit c= ode I >>>>>>>> need to use for one of my projects. As you already know,packages d= on't work >>>>>>>> at all,but ports almost work. I was trying to install xfce4 from p= orts,but >>>>>>>> the compilation stopped when it didn't accept this file : >>>>>>>> >>>>>>>> >>>>>>>> http://distcache.FreeBSD.org/ports-distfiles/trousers-0.3.14.tar.g= z >>>>>>>> >>>>>>>> >>>>>>>> at this point,I decided to upgrade the system with : >>>>>>>> >>>>>>>> >>>>>>>> # freebsd-update fetch >>>>>>>> # freebsd-update install >>>>>>>> >>>>>>>> >>>>>>>> and the ports tree with : >>>>>>>> >>>>>>>> >>>>>>>> # portsnap fetch extract >>>>>>>> # portsnap fetch update >>>>>>>> >>>>>>>> >>>>>>>> At this point it asked me to update pkg,so I did : >>>>>>>> >>>>>>>> >>>>>>>> # cd /usr/ports/ports-mgmt/pkg >>>>>>>> # make >>>>>>>> >>>>>>>> >>>>>>>> but unfortunately I got this error that I'm not able to fix : >>>>>>>> >>>>>>>> >>>>>>>> set : illegal option -o pipefail >>>>>>>> >>>>>>>> >>>>>>>> and I can't do anything anymore. I'm stuck here. Can someone help >>>>>>>> me to fix it ? thanks. >>>>>>>> >>>>>>> >>>>>>> Save a copy of /bin/sh. Check out stable/13 (or 12 if the following >>>>>>> fails). Cd to src/bin/sh. Type make all. You may need -m >>>>>>> /path/to/src/share/mk if make complains. Create a test area, I'll c= all it >>>>>>> /destdir. Also mkdir /destdir/bin too. Then make install DESTDIR= =3D/destdir. >>>>>>> You may need to do this as root. Ignore the failures for the man pa= ges and >>>>>>> maybe tests. You should have a /destdir/bin/sh. See if it runs. If = so copy >>>>>>> it to /bin and try the upgrade again. >>>>>>> >>>>>>> I think 12 has pipefail. I dont think 11 does. 13 definitely has it= . >>>>>>> The error message is from the shell. >>>>>>> >>>>>> >>>>>> >>>>>> The command "set -o pipefail" is how you'll know if it will work.... >>>>>> or stands a good chance of working. >>>>>> >>>>>> >>>>>> Warner >>>>>>> >>>>>>> >>>>> >>>>> -- >>>>> Mario. >>>>> >>>> >>>> >>>> -- >>>> Mario. >>>> >>> >>> >>> -- >>> Mario. >>> >> >> >> -- >> Mario. >> > --000000000000cd95510610053bd3 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


=
On Sun, Jan 28, 2024 at 10:53=E2=80= =AFAM Warner Losh <imp@bsdimp.com&= gt; wrote:
OK. On your 10.x arm system, you need to build /bin/sh usi= ng sources from FreeBSD 13.
Binaries from 12 or 13 won't work= on your 10.x system: libc doesn't have the right symbols.
Bu= t source build against a 10.x system should work. That was my suggestion. T= oo 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.
=C2= =A0

But it turns out that's a bit of a hass= le. Well, not a huge hassle, I had to do the following.
First, se= t up a FreeBSD 10.4 armv6 chroot and install qemu-user-static. See
https://gist.github.com/bsdimp/0f2f294c7441ebf68a8ffeb= ab935bd2c for details.
Or you could just run the RPI-B image = on a real RPI-B. It would be more of
a hassle and only marginally= faster.

Next, I created a worktree and a side= branch (using the same paths in the gist
above, note my origin i= s freebsd but the default is origin):
% cd git/freebsd-src
<= div>% mkdir ~/arm10/imp
% git worktree add -b arm10-14 ~/arm1= 0/imp/stable-14 freebsd/stable/14
I then had to apply these patch= es:
https://people.freebsd.org/~imp/14-sh-on-10.diff
which coped with history / libedit overhaul and O_VERIFY being added = to
the system. OK, truth be told I iterated a bunch to get the pa= tch... I had no
reason to think these changes were needed before = I started...

Next, I got into the emulated ar= m tree:
% sudo chroot ~/arm10 /bin/sh
# cd /imp/stable-= 14/
# patch -p1 < 14-sh-on-10.diff
# make SSP_CFLAGS= =3D WITHOUT_TESTS=3Dt WITHOUT_MAN=3Dt DEBUG_FILES_CFLAGS=3D WARNS=3D0
=
... lots of output, ignore the warnings
# set -o pipefai= l
set: Illegal option -o pipefail
# /usr/obj/imp/stable= -14/arm.armv6/bin/sh/sh
# set -o pipefail
# ^D
#

So success! But all that's a hassle, s= o I also uploaded the sh to
so you can just try it. I don't know if t= his will fix the problem that put us down
this rabbit hole in the= first place or not. But maybe some of the above is helpful
or us= eful for other reasons.

Hope this helps.
=

Warner

On Sun, Jan 28, 2024 at 7:33=E2= =80=AFAM Mario Marietto <marietto2008@gmail.com> wrote:
Using sh of FreeBS= D 12.04 :

/bin/sh : Undefined symbol &q= uot;stat@FBSD_1.5"

nothing to do.

On Sun, Jan 28, 2024 at 3:17=E2=80=AFPM Mario Marietto <marietto2008@gmail.c= om> wrote:
I've used FreeBSD 13.2 and I've got the sam= e error message :

/lib/libc.so.7: version FBS= D_1.6 required by /bin/sh not found

Let's see = with FreeBSD 12.04...

<= div dir=3D"ltr" class=3D"gmail_attr">On Sun, Jan 28, 2024 at 2:04=E2=80=AFP= M Mario Marietto <marietto2008@gmail.com> wrote:
Hello Warner,
<= br>
Thanks for your help. But unfortunately your solution didn= 9;t work. After having followed your instructions carefully :
Save a copy = of /bin/sh. Check out stable/13 (or 12 if=20 the following fails). Cd to src/bin/sh. Type make all. You may need -m=20 /path/to/src/share/mk if it makes complaints. Create a test area, I'll = call=20 it /destdir. Also mkdir /destdir/bin too. Then make install=C2=A0=20 DESTDIR=3D/destdir. You may need to do this as root. Ignore the failures=20 for the man pages and maybe tests. You should have a /destdir/bin/sh.=20 See if it runs. If so, copy it to /bin and try the upgrade again.

It asked me to copy some new libraries from F= reeBSD 14.0 to the /usr/lib32 and /lib directories of the FreeBSD 10.4 syst= em. I copied all the libraries requested and at the end,it gave the followi= ng error :

/lib/libc.so.7: version FBSD_1.6 re= quired by /bin/sh not found

so,I have changed the = flag that does not allow me to rename it with the command :

<= /div>
# chflags noschg libc.so.7

and I'= ;ve copied the libc.so.7 file that's on the directory /lib of the FreeB= SD 14 to the same directory of the FreeBSD 10.4 system and I've reboote= d. Unfortunately it hasn't been accepted. The error is the following on= e :

/lib/libc.so.7 : unsupported relocation type 3= 7 in non-PLT relocations

What has been my mistake = ? Maybe using FreeBSD 14 is wrong ?

On Sun, Jan 28, 2024 at 9:47= =E2=80=AFAM Mario Marietto <marietto2008@gmail.com> wrote:
# set -o pipefa= il
set : variable name must begin with a letter.
<= br>
On Sun,= Jan 28, 2024 at 5:43=E2=80=AFAM Warner Losh <imp@bsdimp.com> wrote:


On Sat, Jan 27= , 2024, 5:54=E2=80=AFPM Warner Losh <imp@bsdimp.com> wrote:


On Sat, Jan 2= 7, 2024, 5:12=E2=80=AFPM Mario Marietto <marietto2008@gma= il.com> wrote:

Hello.

= I'm trying to upgrade as much as I can FreeBSD 10.4 because it is the only one version that can compile some of the old arm 32 bit code I need to use=20 for one of my projects. As you already know,packages don't work at=20 all,but ports almost work. I was trying to install xfce4 from ports,but=20 the compilation stopped when it didn't accept this file :


http://distcache.FreeBSD.org/ports-distfiles/trousers-0.3.14= .tar.gz


at this point,I decided to upgrade the system = with :


# freebsd-update fetch
# freebsd-update install


and the ports tree with :


# portsnap fetch extract
# portsnap fetch update


At this point it asked me to update pkg,so I did= :


# cd /usr/ports/ports-mgmt/pkg
# make


but unfortunately I got this error that I'm = not able to fix :


set : illegal option -o pipefail


and I can't do anything anymore. I'm stu= ck here. Can someone help me to fix it ? thanks.


Save a copy of= /bin/sh. Check out stable/13 (or 12 if the following fails). Cd to src/bin= /sh. Type make all. You may need -m /path/to/src/share/mk if make complains= . Create a test area, I'll call it /destdir. Also mkdir /destdir/bin to= o. Then make install=C2=A0 DESTDIR=3D/destdir. You may need to do this as r= oot. Ignore the failures for the man pages and maybe tests. You should have= a /destdir/bin/sh. See if it runs. If so copy it to /bin and try the upgra= de again.

I think 12 has= pipefail. I dont think 11 does. 13 definitely has it. The error message is= from the shell.

=

The command "set -= o pipefail" is how you'll know if it will work.... or stands a goo= d chance of working.

Warner=C2=A0=

<= blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-l= eft:1px solid rgb(204,204,204);padding-left:1ex">


--
Mario.


--
Mario.


--
Mario.


--
Mario.
--000000000000cd95510610053bd3--