porting grub2 - how to get arm64 modules available in amd64 PKG_PATH?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

porting grub2 - how to get arm64 modules available in amd64 PKG_PATH?

Jiri B-2
Hi,

I have simple GRUB2 port working but I'm trying to figure out how to change
the port to get some part of it to be a kind of 'noarch' as Linux distros do.

My question is, how to get eg. /usr/local/lib/grub/arm64-efi modules which - IIUC -
would need to build on arm64 box "into" amd64 repo, so they are installable via
pkg_add.

The purpose is to be able to configure netbooting on amd64 box for other
hw platforms.

Example (from Linux), I was preparing network boot for IBM POWER8 on EL7/x86_64:

(grub2-mknetdir is x86_64 binary, but modules are for POWER8)

# grub2-mknetdir -d /usr/lib/grub/powerpc-ieee1275 --net-directory=/tftpboot
Netboot directory for powerpc-ieee1275 created. Configure your DHCP server to point to /data/tftp/boot/grub2/powerpc-ieee1275/core.elf

As I said, Linux distros have 'noarch' repos, IIUC we don't use it.
And I did not understand purpose of NO_ARCH in bsd.port.mk.

One can check how are subpackages of GRUB2 built on Fedora:

https://koji.fedoraproject.org/koji/buildinfo?buildID=1051700

One can also see that on an amd64 box they build "variations" of GRUB2.

$ ftp -MVo - https://kojipkgs.fedoraproject.org//packages/grub2/2.02/26.fc29/data/logs/x86_64/build.log | ggrep -Po '^\+ \.\./configure --build.*\K(--with-platform.*--target=[^ ]*)'
--with-platform=efi --target=x86_64-redhat-linux-gnu
--with-platform=efi --target=i386-redhat-linux-gnu
--with-platform=pc --target=x86_64-redhat-linux-gnu

So, even if I would build on an OpenBSD amd64 these 3 variations (and pc/i386 on
an i386 OpenBSD box), I still don't know how to get 'noarch' packages.

Thank you very much for help.

Jiri

Reply | Threaded
Open this post in threaded view
|

Re: porting grub2 - how to get arm64 modules available in amd64 PKG_PATH?

Stuart Henderson
On 2018/03/01 18:24, Jiri B wrote:
> Hi,
>
> I have simple GRUB2 port working but I'm trying to figure out how to change
> the port to get some part of it to be a kind of 'noarch' as Linux distros do.
>
> My question is, how to get eg. /usr/local/lib/grub/arm64-efi modules which - IIUC -
> would need to build on arm64 box "into" amd64 repo, so they are installable via
> pkg_add.

If they really need building on arm64, you'd have to manually generate
a tarball on arm64 and have the port package those generated files.
Though maybe you can cross-compile with clang or one of the arm64 gcc
cross compilers from ports.

> And I did not understand purpose of NO_ARCH in bsd.port.mk.

NO_ARCH is the location to place "PKG_ARCH=*" packages during build,
the default of /usr/ports/packages/no-arch is not useful for most bulk
builds because different arches will conflict.

The main place PKG_ARCH=* was useful is in *release* builds (where the
tree is consistent, rather than snapshots where all package builders are
on independent builds from different trees), but it was so much effort
to do this (and suffered breakage from ports incorrectly marked as
PKG_ARCH=*) that it's not done any more.

The one remaining place it helps is people manually installing "no arch"
packages from one architecture's package directory on another arch.
e.g. (cross-compiled) sysutils/u-boot is a pig to build but the
produced packages are arch independent, so on arm you are able to
set PKG_PATH to http://.../snapshots/packages/amd64/ and install
from an amd64-built package.