pkg chroot issues?

Baptiste Daroussin bapt at FreeBSD.org
Sun May 22 21:24:46 UTC 2016


On Sun, May 22, 2016 at 02:18:07PM -0700, Matthew Macy wrote:
> 
> 
> 
>  ---- On Sun, 22 May 2016 13:43:13 -0700 Tim Kientzle <tim at kientzle.com> wrote ---- 
>  >  
>  > > On May 22, 2016, at 1:28 PM, K. Macy <kmacy at freebsd.org> wrote: 
>  > >  
>  > >  
>  > >  
>  > > On Sunday, May 22, 2016, Tim Kientzle <tim at kientzle.com> wrote: 
>  > > Crochet has some experimental hooks to install packages onto the system being built, but this seems to be hitting problems due to limitations in 'pkg -c'.  In particular, it seems that pkg performs the chroot before it does any network lookups.  This is a problem if the chroot is not a complete system environment (which it cannot be when you're building an image for another system). 
>  > >  
>  > > There's some further discussion on github: 
>  > >  
>  > >   https://github.com/freebsd/crochet/issues/141 
>  > >  
>  > > Any suggestions? 
>  > >  
>  > > Cheers, 
>  > >  
>  > > Tim 
>  > >  
>  > >  
>  > > Just like you need to mount devfs you should have a resolv.conf in your chroot first. Just copy it over before running pkg. This works for me in my image creation script. 
>  >  
>  > Sometimes the image does already have a resolv.conf, but if it does, it's for the target environment (where the image will ultimately be running) and may not be appropriate for the environment where the image is being built. 
>  
> Setting NAMESERVER to "10.0.1.1" crashed pkg for me. Maybe it's been fixed in the meantime. If a resolv.conf already exists I would just rename it before and then rename it back after the call to pkg -c.
> 
Setting nameserver will inject this name server directly via the libc resolv api
so it won't touch the resolv.conf at all no need to back it up

Best regards,
Bapt
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/freebsd-current/attachments/20160522/ed82cbf5/attachment.sig>


More information about the freebsd-current mailing list