Other Non-interactive PKGNG bootstrap

Hello,

I'm trying to automate FreeBSD installation process up to some point - haven't decided if I would use a script or pc-sysinstall configuration. What would be the proper way of non interactive pkgng bootstrap? When you run pkg on a fresh system for the first time it pops up with a question that needs confirmation … it would be more than great if there was a way to just pass "yes" and make it going in an easy way but unfortunately I can't think of any other ways besides the one with the pkg-static binary extracted from a pre-built pkg package.

Thanks for any help!
 
Here's what I use. My home router is a NanoBSD image and I use this in my NanoBSD config file to kick off installing packages. You wouldn't need the -c flag to chroot(8) but passing the ASSUME_ALWAYS_YES will do the trick.
Code:
env ASSUME_ALWAYS_YES=YES pkg -c ${NANO_WORLDDIR} bootstrap
env ASSUME_ALWAYS_YES=YES pkg -c ${NANO_WORLDDIR} install ports-mgmt/pkg
...
 
Thank you very much - setting the variable does it's job good - I get past the question about bootstraping however pkgng doesn't really bootstrap. Have you ever has a problem similar to:

Code:
pkg: Error fetching http://pkg.FreeBSD.org/freebsd:10:x86:64/latest/Latest/pkg.txz:
A pre-built version of pkg could not be found for your system.
Consider changing PACKAGESITE or installing it from ports: 'ports-mgmt/pkg' .

I decided to go pc-sysinstall route of scripting the FreeBSD installation and besides pkg everything works just fine. It might be pc-sysinstall related issue but it looks more like a problem with pkg in a chroot environment.
 
You may need a cp /etc/resolv.conf ${CHROOT_DIR}/etc/resolv.conf before attempting to install anything that requires network access.
 
Back
Top