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

Andres Mejia mcitadel at gmail.com
Fri Aug 20 08:30:46 UTC 2010


On Thursday 19 August 2010 16:59:24 Roger Leigh wrote:
> On Mon, Aug 16, 2010 at 03:23:54AM -0400, Andres Mejia wrote:
> > On Saturday 24 July 2010 19:58:39 Andres Mejia wrote:
> > > Here's an updated patch. This only contains the changes for saving an
> > > sbuild chroot to tarball now.
> > > 
> > > Changes for the update scripts are now in bug #590211.
> > > 
> > > On Saturday 17 October 2009 01:28:18 Andres Mejia wrote:
> > > > Here are all patches again which address your concerns.
> > > > 
> > > > On Thursday 24 September 2009 18:04:05 Roger Leigh wrote:
> > > > > On Sun, Sep 20, 2009 at 01:43:41PM -0400, Andres Mejia wrote:
> > > > > > From: Andres Mejia <andres at andres-desktop.hsd1.va.comcast.net>
> > > > > > Date: Sun, 20 Sep 2009 13:21:02 -0400
> > > > > > Subject: [PATCH 3/5] Allow sbuild-update to support perform
> > > > > > apt-get update, upgrade and distupgrade. This also allows
> > > > > > sbuild-update to perform any two or all three commands at once,
> > > > > > useful when using file type chroots.
> > 
> > Just as I mentioned in my other email to bug #551311, I've setup a git
> > repository at http://github.com/ceros/sbuild. The relavant branch for
> > this bug would be 'sbuild-createchroot'.
> 
> This also looks good.  The only change I'd really like is for the
> code to cope with different types of archive file.  Currently it
> only creates .tar.gz, but I'd like it to also support .tar.bz2
> and .zip.  This can be copied from 05file (it's shell script, but
> the exact equivalent could be done in perl).
> 
> 
> # Check file type
> check_filetype()
> {
>     if echo "$CHROOT_FILE" | grep -q '\.tar$'; then
>         filetype="tar"
>     elif echo "$CHROOT_FILE" | egrep -q '(\.tar\.gz|\.tgz)$'; then
>         filetype="tgz"
>     elif echo "$CHROOT_FILE" | egrep -q '(\.tar\.bz2|\.tbz)$'; then
>         filetype="tbz"
>     elif echo "$CHROOT_FILE" | grep -q '\.zip$'; then
>         filetype="zip"
>     else
>         fatal "Unsupported filetype for $CHROOT_FILE"
>     fi
> }
> 
> and actually packing the chroot:
> 
>     if [ "$filetype" = "tar" ]; then
>         tar $TAR_VERBOSE -cf "$NEWFILE" .
>     elif [ "$filetype" = "tgz" ]; then
>         tar $TAR_VERBOSE -czf "$NEWFILE" .
>     elif [ "$filetype" = "tbz" ]; then
>         tar $TAR_VERBOSE -cjf "$NEWFILE" .
>     elif [ "$filetype" = "zip" ]; then
>         zip $ZIP_VERBOSE -r "$NEWFILE" .
>     else
>         fatal "Unsupported filetype for $CHROOT_FILE"
>     fi
> 
> 
> I'd be very grateful if you could possibly add this to the existing
> patch.
> 
> 
> Regards,
> Roger

I've added support for bzip2, lzma, and xz compressed tarballs in the
sbuild-createchroot branch in github. zip support is not working correctly for 
me. It keeps returning a non-zero exit status when compressing a chroot with 
zip.

Have you tried a zip chroot tarball? I'm sure there is a bug with the above 
code to create zip chroot file. The '-y' option is needed, else zip will 
forever try to dereference symlinks found under /dev.

I think chroots need to always be packed in tar files then compressed so the 
same would need to be done using a combination of tar and zip command.

Could we perhaps defer zip support for a later time? I'm running into several 
issues with trying to properly support creating chroots in zip files.

-- 
Regards,
Andres Mejia





More information about the Buildd-tools-devel mailing list