[buildd-tools-devel] Bug#545215: Bug#545215: Bug#545215: [PATCH] Please support saving chroot to tarball in sbuild-createchroot

Andres Mejia mcitadel at gmail.com
Thu Sep 24 22:02:09 UTC 2009


On Thursday 24 September 2009 17:17:36 Roger Leigh wrote:
> On Sun, Sep 20, 2009 at 01:43:41PM -0400, Andres Mejia wrote:
> > diff --git a/bin/sbuild-createchroot b/bin/sbuild-createchroot
> > index a255149..8c0ba3f 100755
> > --- a/bin/sbuild-createchroot
> > +++ b/bin/sbuild-createchroot
> > @@ -72,7 +72,13 @@ sub init_allowed_keys {
> >  	},
> >  	'SETUP_ONLY'				=> {
> >  	    DEFAULT => 0
> > -	}
> > +	},
> > +	'MAKE_TARBALL'				=> {
> > +	    DEFAULT => ''
> > +	},
> > +	'KEEP_SBUILDCHROOT_DIR'			=> {
> > +	    DEFAULT => 0
> > +	},
> >      );
> >
> >      $self->set_allowed_keys(\%createchroot_keys);
> > @@ -125,6 +131,12 @@ sub set_options {
> >  	},
> >  	"setup-only" => sub {
> >  	    $self->set_conf('SETUP_ONLY', 1);
> > +	},
> > +	"make-tarball=s" => sub {
> > +	    $self->set_conf('MAKE_TARBALL', $_[1]);
> > +	},
> > +	"keep-sbuildchroot-dir" => sub {
> > +	    $self->set_conf('KEEP_SBUILDCHROOT_DIR', 1);
> >  	});
> 
> I agree with the intent of this patch.  However, I do have a
> concern that the "--make-tarball" option doesn't match the
> option by the same name in debootstrap.
> 
> The option by the same name in debootstap, according to the
> documentation, stores the downloaded packages in the tarball,
> *not* the bootstrapped install.  I've just tested this and this
> is in fact the case: it just contains the contents of
> /var/lib/apt and /var/cache/apt/archives.
> 
> As a result, I would prefer to add support for this option to
> sbuild-createchroot, but pass the option through to debootstrap
> unchanged.  Additionally, the option for sbuild-createchroot to
> store the bootstrapped install into a tarball must therefore be
> named differently.  This shouldn't require many changes to the
> patch (the existing option needs duplicating and renaming for
> use by sbuild-createchroot, and the old option needs passing to
> debootstrap).
> 
> 
> Regards,
> Roger
> 

I'm expecting that people who would use sbuild-createchroot would expect a 
chroot ready for them to use with sbuild. Using the --make-tarball option from 
debootstrap would leave out the modifications to /etc/hosts, /usr/sbin/policy-
rc.d, and /etc/apt/sources.list, unless we open the tarball again, do the 
modifications, then repack the tarball. Afterwards, we would have to worry 
about completing the bootstrap process at some point. Worst case would be to 
perform the bootstrapping during builds, which I'm sure would slow down build 
times.

I'm more in favor of just renaming the option to something like "--make-
sbuild-tarball" if it's just the concern that "--make-tarball" won't do the 
same thing as in debootstrap. We could support a --make-tarball option that is 
passed to debootstrap for sbuild-createchroot at some point, but I expect the 
more useful feature in the case of sbuild is to have a file type chroot ready 
for use for building packages.

-- 
Regards,
Andres





More information about the Buildd-tools-devel mailing list