Subject: Re: bash + chroot
To: Chris <rtschrisp@earthlink.net>
From: None <kpneal@pobox.com>
List: netbsd-help
Date: 12/23/2002 10:11:54
On Mon, Dec 23, 2002 at 08:41:06AM +0000, Chris wrote:
> Julio,
> 
> > pkgsrc/pkgtools/pkg_comp will do what you want. You can even call it from your
> > script, (I currently do that to build all packages I want on my machine).
> 
> Thanks for the reply. This will not work in my situation. :) I need to be
> able to get into a chrooted enviroment from the script, and continue
> compiling packages when the script has entered the chroot env. If worst
> comes to worse, ill have the first script do everything needed, then enter
> the chroot enviroment. Once it has done that, have the user run the second
> script in the chroot env. The second script will do its work, then exit
> the chroot env, and the first script will take over again.

Why do you need the user to step in in the middle?

Why not have two scripts? The first script does setup and then runs
the chroot command, giving as arguments the name of the second script
and any arguments needed by the second script. The second script would
then run in the chrooted environment and do the chrooted build. Once
the second script exits the chroot command (run by the first script)
would finish. The first script would then continue.
-- 
Kevin P. Neal                                http://www.pobox.com/~kpn/
      'Concerns about "rights" and "ownership" of domains are inappropriate.  
 It is appropriate to be concerned about "responsibilities" and "service" 
 to the community.' -- RFC 1591, page 4: March 1994