- Point --rootdir at the installed destdir in the dvd tree. This causes pkg to determine the ABI from the installed destdir instead of the host's binaries. Previously the result was that packages for the host's ABI were always downloaded breaking cross-releases (e.g. arm64 releases built on an amd64 host included amd64 packages on the DVD ISO image rather than arm64 packages). This also handles version mismatches, and I tested this by cross-building a 15.x arm64 release on a 14.x amd64 host.
- As a result, pkg now does a chdir(3) to the rootdir before running, so the -o argument to fetch needs to be updated to be relative to rootdir instead of the CWD as make runs.
- Add a new ROOTDIR variable to limit references to "dvd" to one place. Ideally ROOTDIR would be an argument to this script so that it didn't really know about the dvd layout at all.
- While here, simplify creation of symlinks by just using a longer path to the link name instead of using 'cd' in the shell before invoking ln(1). Also use ln -sf to create the pkg.pkg symlink rather than rm + ln.
PR: 278273
Reported by: gatekeeper <tiago.gasiba@gmail.com>