using pkg_add for specific rootfs in a different mount point

hello

iam tryting to build own freebsd dist...

my problem is about installing packages after formating and installing base system

for example in archlinux there is a tool name is pacstrap... packstrap can install packages to a mount point.
# packstrap /mnt bash

is there a way to use pkg_add like packstrap?

iam mounting /dev/ad0s1 to /media/disk... /dev/ad0s1 is rootfs of installed freebsd.
i want to install bash.tgz package to /dev/ad0s1 without booting from /dev/ad0s1

is there a way to do that?
maybe i can use chroot for this

anyfeedback make me happy,

best regards
 
I can't tell for sure as I've never tried it myself, but this seems appropriate (see pkg_add(1)):
Code:
     -C, --chroot chrootdir
	     Before doing any operations, chroot(2) to the chrootdir directory
	     so that all package files, and the package database, are
	     installed to chrootdir.  Note that chrootdir needs to be a fairly
	     complete file system, including everything normally needed by
	     pkg_add to run.
             [...]
 
Back
Top