Closed shepner closed 7 years ago
It took me a while to get past this same problem. The main issue with this message is that pkg cannot resolve the address in a chroot environment. To manually cure this add your /etc/resolv.conf to an overlay. These are inserted into the chroot before PackageInit.
A proper way to deal with this should be in PackageInit script which should do the following: Check for /etc/resolv.conf. (may have been placed by user in overlay) if exists warn user that it must resolve for local network if not exists then create two strategies: The first to copy system /etc/resolve.conf to chroot env to be called before the PackageInit The second to remove the chroot /etc/resolve.conf to be called after Package
This should save a few people some headaches trying to get around this problem
I'm not sure the suggestions made by dicepd are really appropriate. For example, the user may have put an etc/resolv.conf into the overlay, but that will be appropriate for the target environment and may not be the same as used in the host environment.
I suspect that fixing this really requires changes to pkg itself to perform the necessary network lookups before it chroots.
pkg supports an option for that which is pkg -o NAMESERVER=
the problem with pkg -c is that it calls chroot very early. To avoid that problem we have added pkg -r
The only problem with pkg -o NAMESERVER is you miss the search domains and stuff.. Is that a concern?
I've tried out adding a resolv.conf
to my overlay and pkg
works, it appears to want to install and update pkg
from freebsd.org, not my specified repo, though.
Adding a /usr/local/etc/pkg/repos/custom.conf
overlay fixes the above problem.
@yohanesu75 has just sent some pull requests that might fix this.
Please take a look at PR #169, #170, and #171.
So, when I add 'option PackageInit' to my config, I receive the following error:
In futzing around, I found that manually running
sudo pkg-static -c ./work/_.mount.freebsd update
provides the same error but a wget (iesudo wget http://pkg.FreeBSD.org/FreeBSD:11:armv6/latest/meta.txz
) works fine. And of course, manually runningpkg update
from the RPI itsel works just fine. Im doing all of this from a bare bones FreeBSD 10.2 installSo Im going on the assumption that there is something wrong with pkg in regards to chroot but Im not sure how to work around it. Alternatively, could I reasonably just compile ports directly or is that a path I dont want to travel?
thanks! stephen