[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Sbuild & lxc problems



I mainly use pbuilder/cowbuilder to build my packages, but I would
really like to try using the tool from pkg-ruby-extras, because I am
told it is very good for test building reverse dependencies and also
runs debci to test any autopkgtest testsuites. It uses sbuild.

However, sbuild does not seem to agree with me, and I have had several
attempts over the years to get it going but I gave up each time. One
time I thing I ran out of room on the root partition halfway through
setting it up (my fault). Once I had fixed the space problem, I had all
sorts of problems working out how to clear out the failed sbuild schroot
(and I can't remember how I did it now). Then the next time I think it
failed with some gpg archive key problem. I got around this by upgrading
to sbuild from jessie-backports. But then it failed for some reason I
can't remember. It is difficult to search for help when everything seems
to be a wrapper for something else, and you can't workout where in the
chain the problem is. I have been around in circles several times :-)

Anyway, that is the background. I am hoping that with some help from
mentors, I will get up and running this time. Here goes:

-------------------------------------

ross@DebianJessieLaptop:~/debian/pkg-ruby-extras$ git remote -v
origin   
https://anonscm.debian.org/cgit/pkg-ruby-extras/pkg-ruby-extras.git (fetch)
origin   
https://anonscm.debian.org/cgit/pkg-ruby-extras/pkg-ruby-extras.git (push)

ross@DebianJessieLaptop:~/debian/pkg-ruby-extras$ setup
+ sudo apt-get install -qy autopkgtest build-essential gem2deb git
git-buildpackage myrepos quilt sbuild lxc debci
<snip lots of apt action>
+ sudo mkdir -p /root/.gnupg
+ sudo sbuild-update --keygen
Generating archive key.

Not enough random bytes available.  Please do some other work to give
the OS a chance to collect more entropy! (Need 188 more bytes)
.+++++
.+++++
gpg: /root/.gnupg/trustdb.gpg: trustdb created
gpg: key 5F4C78AD marked as ultimately trusted
+ sudo sbuild-adduser ross
The user `ross' is already a member of `sbuild'.

# Setup tasks for sudo users:

# BUILD
# HOME directory in chroot, user:sbuild, 0770 perms, from
# passwd/group copying to chroot, filtered
# Maybe source 50sbuild, or move into common location.

Next, copy the example sbuildrc file to the home directory of each user and
set the variables for your system:

  cp /usr/share/doc/sbuild/examples/example.sbuildrc /home/ross/.sbuildrc

Now try a build:

  cd /path/to/source
  sbuild-update -ud <distribution>
  (or "sbuild-apt <distribution> apt-get -f install"
       first if the chroot is broken)
  sbuild -d <distribution> <package>_<version>
+ dpkg --print-architecture
+ chrootname=unstable-amd64-sbuild
+ chroot=/srv/chroots/unstable-amd64-sbuild
+ grep unstable-amd64-sbuild
+ schroot --list --all-source-chroots
+ sudo sbuild-createchroot unstable /srv/chroots/unstable-amd64-sbuild
http://httpredir.debian.org/debian
I: SUITE: unstable
I: TARGET: /srv/chroots/unstable-amd64-sbuild
I: MIRROR: http://httpredir.debian.org/debian
I: Running debootstrap --arch=amd64 --variant=buildd --verbose
--include=fakeroot,build-essential --components=main --resolve-deps
unstable /srv/chroots/unstable-amd64-sbuild
http://httpredir.debian.org/debian
I: Retrieving Release
I: Retrieving Release.gpg
I: Checking Release signature
I: Valid Release signature (key id 126C0D24BD8A2942CC7DF8AC7638D0442B90D010)
I: Retrieving Packages
I: Validating Packages
<snip more apt action in the chroot>

I: Base system installed successfully.
I: Configured /usr/sbin/policy-rc.d:
   +------------------------------------------------------------------------
   |#!/bin/sh
   |echo "All runlevel operations denied by policy" >&2
   |exit 101
   +------------------------------------------------------------------------
I: Configured APT /etc/apt/sources.list:
   +------------------------------------------------------------------------
   |deb http://httpredir.debian.org/debian unstable main
   |deb-src http://httpredir.debian.org/debian unstable main
   +------------------------------------------------------------------------
I: Please add any additional APT sources to
/srv/chroots/unstable-amd64-sbuild/etc/apt/sources.list
modprobe: FATAL: Module overlay not found.
I: schroot chroot configuration written to
/etc/schroot/chroot.d/unstable-amd64-sbuild-GlcVID.
   +------------------------------------------------------------------------
   |[unstable-amd64-sbuild]
   |description=Debian unstable/amd64 autobuilder
   |groups=root,sbuild
   |root-groups=root,sbuild
   |profile=sbuild
   |type=directory
   |directory=/srv/chroots/unstable-amd64-sbuild
   |union-type=none
   +------------------------------------------------------------------------
I: Please rename and modify this file as required.
W: Not creating symlink /srv/chroots/unstable-amd64-sbuild to
/etc/sbuild/chroot/unstable-amd64-sbuild: file already exists
I: Setting reference package list.
I: Updating chroot.
Err:1 http://httpredir.debian.org/debian unstable InRelease
  Temporary failure resolving 'httpredir.debian.org'
Reading package lists... Done         
W: Failed to fetch
http://httpredir.debian.org/debian/dists/unstable/InRelease  Temporary
failure resolving 'httpredir.debian.org'
W: Some index files failed to download. They have been ignored, or old
ones used instead.
Reading package lists... Done
Building dependency tree      
Reading state information... Done
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
I: Successfully set up unstable chroot.
I: Run "sbuild-adduser" to add new sbuild users.
+ grep -l ^union-type=
/etc/schroot/chroot.d/unstable-amd64-sbuild-GlcVID
/etc/schroot/chroot.d/unstable-amd64-sbuild-Y02TR7
+ grep -q ^union-overlay-directory=
/etc/schroot/chroot.d/unstable-amd64-sbuild-GlcVID
+ echo union-overlay-directory=/dev/shm
+ sudo tee --append /etc/schroot/chroot.d/unstable-amd64-sbuild-GlcVID
[sudo] password for ross:
union-overlay-directory=/dev/shm
+ grep -q /var/cache/apt/archives /etc/schroot/sbuild/fstab
+ grep -q ^lxc.network.type\s*=\s*empty /etc/lxc/default.conf
+ sudo debci setup
E: /etc/schroot/chroot.d/unstable-amd64-sbuild-Y02TR7: line 1
[unstable-amd64-sbuild]: A chroot or alias
‘chroot:unstable-amd64-sbuild’ already exists with this name
I: Duplicate names are not allowed
E: /etc/schroot/chroot.d/unstable-amd64-sbuild-Y02TR7: line 1
[unstable-amd64-sbuild]: A chroot or alias
‘chroot:unstable-amd64-sbuild’ already exists with this name
I: Duplicate names are not allowed
E: chroot debci-unstable-amd64 does not exit in custom location . Please
create it first.

---------------------------------

I think the sbuild setup completes, although I can't update the chroot.
If I run "# chroot /srv/chroots/unstable-amd64-sbuild apt-get update"
then I always get "Temporary failure resolving 'httpredir.debian.org".
Httpredir resolves fine when I "apt update" the host Jessie laptop.

But then "debci setup" chokes due to an existing chroot with the same
name. But I don't understand why it is creating a sbuild chroot when it
should be using lxc. Maybe the lxc container was only half set up
before? Most of the options from the setup script seem to be there.

If I run "sudo lxc-start -n adt-sid-amd64" I get:

lxc-start: Executing '/sbin/init' with no configuration file may crash
the host

If I run "sudo lxc-attach -n adt-sid-amd64 apt-get update" I get:

lxc-attach: failed to get the init pid

Maybe I have to recreate the lxc container for debci. Any clues on how I
can do that?

Sorry about the long email.

Regards,

Ross


Attachment: signature.asc
Description: OpenPGP digital signature


Reply to: