bootstrapper wants to get pkg package for wrong architecture

After upgrading from 11-STABLE to 12.0-RELEASE-p3 via source on my BeagleBone Black (buildworld now taking a full 3 days!) all seems to be well with the base system. Before updating all my installed packages, I deleted them as per the procedure at the end of the portmaster(8) man page. The next step is to reinstall pkg. I know I can build from source via ports-mgmt/pkg, but since the version is still the same, I would rather just use the built-in pkg bootstrap command. Weirdly, it is failing:

Code:
# pkg
The package management tool is not yet installed on your system.
Do you want to fetch and install it now? [y/N]: y
Bootstrapping pkg from pkg+https://pkg.FreeBSD.org/FreeBSD:12:armv7/quarterly, please wait...
Verifying signature with trusted certificate pkg.freebsd.org.2013102301... done
Installing pkg-1.10.5_5...
pkg-static: wrong architecture: FreeBSD:12:armv7 instead of FreeBSD:12:armv6

Failed to install the following 1 package(s): /tmp//pkg.txz.klqA0H

Why is it looking for the armv7 package? The BBB is armv6.

Another user suggested a workaround (updated for 12 by me here):

env ABI=FreeBSD:12:armv6 pkg bootstrap

And indeed, this worked well, but this does not seem like an ideal solution. Isn't it a bug?
 
Code:
# $FreeBSD: releng/12.0/usr.sbin/pkg/FreeBSD.conf 340161 2018-11-05 21:28:32Z gjb $
#
# To disable this repository, instead of modifying or removing this file,
# create a /usr/local/etc/pkg/repos/FreeBSD.conf file:
#
#   mkdir -p /usr/local/etc/pkg/repos
#   echo "FreeBSD: { enabled: no }" > /usr/local/etc/pkg/repos/FreeBSD.conf
#

FreeBSD: {
  url: "pkg+http://pkg.FreeBSD.org/${ABI}/quarterly",
  mirror_type: "srv",
  signature_type: "fingerprints",
  fingerprints: "/usr/share/keys/pkg",
  enabled: yes
}

The BBB is an ARMv7 board, but "armv6" in FreeBSD has always meant something slightly different. As per https://www.freebsd.org/platforms/arm.html "FreeBSD/arm supports ARMv4 and ARMv5 processors. FreeBSD/armv6 supports ARMv6 and ARMv7 processors, including SMP on the latter."

Are you saying this has changed for 12.0?

Regardless, there's conflicting info in there somewhere...

Code:
# pkg -vv | grep ABI
ABI = "FreeBSD:12:armv6";
ALTABI = "freebsd:12:armv6:32:el:eabi:hardfp";

portmaster -P is also affected:

Code:
Installing package from: /usr/ports/packages/portmaster-download/db5-5.3.28_7.txz
Installing db5-5.3.28_7...
pkg-static: wrong architecture: FreeBSD:12:armv7 instead of FreeBSD:12:armv6

Any suggestions?
 
Code:
# sysctl hw.machine_arch
hw.machine_arch: armv7
# readelf -A /bin/ls | grep Tag_CPU_arch
  Tag_CPU_arch: ARM v6

Interesting! Is it because I built 12 from source on 11? I would have thought this would have been a pretty ordinary upgrade path, though. I just followed the Handbook.

Let me know how else I can help figure out what went wrong and how to fix it.
 
Indeed, MACHINE_ARCH=armv6 is all over my buildworld.out.

I finally found where it was documented in /usr/src/UPDATING ... I had overlooked this entry:
Code:
20171005:
    The arm port has split armv6 into armv6 and armv7. armv7 is now
    a valid TARGET_ARCH/MACHINE_ARCH setting. If you have an armv7 system
    and are running a kernel from before r324363, you will need to add
    MACHINE_ARCH=armv7 to 'make buildworld' to do a native build.

I'm guessing I should also run ccache -C just to be safe.
I also use meta mode, but I trust it will be fine since I obliterate /usr/obj before the buildworld.

I will report back in 3 or 4 days. :)
 
It worked; thanks!

I used my armv6 FreeBSD 12 system to build and upgrade to armv7 FreeBSD 12, just following the normal upgrade procedure, but adding MACHINE_ARCH=armv7 to the buildworld, buildkernel, and installkernel commands. I am not sure if it is also needed for installworld, but I used it there, too, just in case.

Everything works as it should now; no warnings about armv6/armv7 mismatches from pkg.
 
Back
Top