Give-Back a Package

    % xda1
    % ssh leda.debian.net
    % wanna-build -A alpha -d u -U buildd_alpha-debian-alpha1 --give-back <package>_<version>

Signing buildd Build Manually

From Michael Cree:

"I must've signed the changes manually, then copied all the files the changes file mentions into the upload directory and finally placed the signed changes file into the upload directory. Fortunately the buildd upload process finds that and uploads it with everything else."

  1. The changes file to sign is in the build directory of the home directory of the buildd user, i.e. /home/buildd/build.
  2. The signing command:
    gpg --armor --detach-sign --textmode
  3. Append the signature to the end of the .changes file.

  4. Copy the changes file back to the buildd system:

     scp <the changes file> buildd:/tmp/
    
  5. Copy the files referenced in the changes file to the upload directory in the buildd user's home directory.

Signing buildd Build With debsign

    debsign -m "Bill MacAllister <whm@stanford.edu>" -k 99B8EF14 *.changes

Package status and assorted links

  • http://www.debian-ports.org/~iwamatsu/transition/
  • http://buildd.debian-ports.org/status/architecture.php?a=alpha&suite=sid
  • Michael's Kernels: http://www2.phys.waikato.ac.nz/~cree
  • Michael's instructions for building a wheezy system: http://www.alphalinux.org/wiki/index.php/DebianInstall

Creating an Alpha buildd system

These instructions are from Michael Cree and have had only minor edits to them to reflect what the current requirements are.

In addition to the steps described here the buildd also needs to be registered properly with debian-ports before it will work. One needs to provide ssh keys for the buildd user and personal gpg keys for that purpose.

After doing a basic (no desktop) Lenny install then schroot, debootstrap, sbuild and buildd packages were installed from lenny-backports. Eventually the sbuild and buildd packages come from from git.debian.org, but Aurelien said this initial step was necessary and I took his word for it.

Install some packages:

    # aptitude install lvm2 tcsh emacs rsync openssh-server
    # aptitude install schroot buildd

As root do:

    # mkdir -p /srv/chroot/sid
    # debootstrap --variant=buildd sid /srv/chroot/sid http://ports.debian.net/debian

edit /srv/chroot/sid/etc/apt/sources.list to be:

    deb http://ftp.debian-ports.org/debian sid main
    deb http://ftp.debian-ports.org/debian unreleased main
    deb-src http://ftp.us.debian.org/debian sid main

    deb http://incoming.debian-ports.org/buildd sid main
    deb-src http://incoming.debian-ports.org/buildd sid main

Add the file /etc/schroot/chroot.d/sid-alpha-sbuild with:

    [sid-alpha-sbuild]
    type=directory
    description=Debian sid/alpha autobuilder
    directory=/srv/chroot/sid
    users=buildd
    groups=root,sbuild
    root-groups=root,sbuild
    script-config=sbuild/config
    aliases=unstable-alpha-sbuild

Edit the file /etc/schroot/sbuild/fstab to be:

    # fstab: static file system information for chroots.
    # Note that the mount point will be prefixed by the chroot path
    # (CHROOT_PATH)
    #
    # <file system> <mount point>   <type>  <options>   <dump>  <pass>
    /proc       /proc       none    rw,rbind        0       0
    /sys        /sys        none    rw,rbind        0       0
    /dev/pts    /dev/pts    none    rw,rbind    0   0
    /dev/shm    /dev/shm    none    rw,rbind    0   0

Run "schroot -i" to check chroot configuration. Should get something like:

      ????????? Chroot ?????????
      Name                   sid-alpha-sbuild
      Description            Debian sid/alpha autobuilder
      Type                   directory
      Priority               0
      Message Verbosity      normal
      Users                  mjc buildd
      Groups                 root sbuild
      Root Users             
      Root Groups            root sbuild
      Aliases                unstable-alpha-sbuild
      Preserve Environment   false
      Environment Filter     ^(BASH_ENV|CDPATH|ENV|HOSTALIASES|IFS|KRB5_CONFIG|K    RBCONFDIR|KRBTKFILE|KRB_CONF|LD_.*|LOCALDOMAIN|NLSPATH|PATH_LOCALE|RES_OPTIONS|TERMINFO|TERMINFO_DIRS|TERMPATH)$
      Run Setup Scripts      true
      Script Configuration   sbuild/config
      Session Managed        true
      Session Cloned         false
      Session Purged         false
      Directory              /srv/chroot/sid
      Personality            undefined
      Filesystem Union Type  none

For some really strange and unfathomable reason I had to shift the file 25nssdatabases up a directory else I got "25nssdatabases not found" errors when trying to enter the chroot! I.E.

    # mv /etc/schroot/setup.d/25nssdatabases /etc/schroot/

Now enter the chroot:

    # schroot -c sid-alpha-sbuild -u root -d /root

Check that you see the expected files in /proc, /sys and /dev/pts (i.e. that they are correctly mounted).

Install the debian-ports-archive-keyring while in the chroot

    # apt-get install debian-ports-archive-keyring

Then update the chroot:

    # apt-get update
    # apt-get upgrade
    # apt-get install debconf
    # dpkg-reconfigure -plow debconf

Answer the debconf questions as follows:

       interface
              choose 6/Noninteractive

       priority
              choose 1/Critical

    # apt-get install debfoster fakeroot build-essential

To initialise the debfoster database run:

    # debfoster -q

Exit the chroot.

Now start setting up the buildd! The default home directory is /var/lib/buildd which I don't like. I prefer it at /home/buildd so I did the following:

    # cd /home
    # mkdir buildd
    # chmod 2755 buildd
    # chown buildd:buildd buildd
    # cd buildd
    # install --directory --mode=2770 --owner=buildd --group=buildd build logs old-logs upload-security
    # install --directory --mode=2775 --owner=buildd --group=buildd stats stats/graphs upload

Also make sure buildd is a member of group sbuild:

    # adduser buildd sbuild

Then edit /etc/passwd to put buildd's home directory at /home/buildd.

Stop any build daemons starting before getting it configured (as user buildd):

    $ touch ~/NO-DAEMON-PLEASE

I initially put into ~/.sbuildrc the following (for verifying sbuild):

    $arch = 'alpha';
    $mailto = 'alpha@phys.waikato.ac.nz';
    $mailfrom = 'buildd on imago <buildd-imago@phys.waikato.ac.nz>';
    $maintainer_name='alpha Build Daemon (imago) <buildd_alpha-imago@buildd.debian-ports.org>';

    $pgp_options = ['-us', '-uc'];
    $path = "/usr/sbin:/usr/bin:/sbin:/bin:/usr/X11R6/bin:/usr/games";

    $purge_build_directory="always";
    $sbuild_mode = "buildd";

    $build_dir = "$HOME/build";
    $log_dir = "$HOME/logs";
    $stats_dir = "$HOME/stats";

    # don't remove this, Perl needs it:
    1;

Note that in the above the buildd name is imago. An account "buildd-imago" had been set up on the phys.waikato.ac.nz mail server. That account forwards email back to the buildd account on imago.phys.waikato.ac.nz, since a firewall will block any email direct to imago.phys.waikato.ac.nz from offsite.

Now to check whether sbuild is working I did (as user buildd):

    $ mkdir tmp
    $ cd tmp
    $ apt-get --download-only source sharutils
    $ sbuild --arch alpha --dist unstable sharutils_4.6.3-1.dsc

If everything is okay it should build sharutils and send you the log as email (in my case to alpha@phys.waikato.ac.nz). The log file is also put in ~buildd/logs and the .deb file should be in ~buildd/build. You might as well clean those files out to not confuse the buildd!

I now changed the $mailto line in .sbuildrc to be:

    $mailto = 'logs@buildd.debian-ports.org alpha@phys.waikato.ac.nz';

so that logs will be mailed to Debian Ports. (I also had to get the administrator of the mail server for phys.waikato.ac.nz to raise the maximum email size permitted!)

Now install the .builddrc config file (still as user buildd):

    # buildd.conf: global buildd settings that will survive            -*- Perl -*-
    # an upgrade.
    #

    $arch = 'alpha';
    $nice_level = 0;

    $admin_mail = 'alpha@phys.waikato.ac.nz';
    $statistics_mail = 'alpha@phys.waikato.ac.nz';

    @take_from_dists = qw(unstable);

    $build_log_keep = 1;
    $log_queued_messages = 1;
    $daemon_log_send = 0;

    $sshcmd = "/usr/bin/ssh -l buildd_alpha buildd.debian-ports.org";
    $sshsocket = "buildd.debian-ports.org.ssh";
    $wanna_build_user = "buildd_alpha-imago";
    $wanna_build_dbbase = "alpha/build-db";

    $secondary_daemon_threshold = undef;

    # list of distributions that buildd should take packages from
    #@distributions = (
    #       {
    #               dist_name => ["unstable"],
    #               built_architecture => 'alpha',
    #               wanna_build_ssh_host => "buildd.debian-ports.org",
    #               wanna_build_ssh_user => "buildd_alpha",
    #               wanna_build_ssh_socket => 'buildd.debian-ports.org.ssh',
    #               wanna_build_ssh_options => [],
    #               # database used for wanna-build
    #               wanna_build_db_name => "alpha/build-db",
    #               wanna_build_db_user => "buildd_alpha-debian-imago",
    #               dupload_local_queue_dir => "upload",
    #               no_auto_build => [],
    #               weak_no_auto_build => [],
    #                logs_mailed_to => $admin_mail,
    #       }
    #);

    @upload_queues = (
            {
                    dupload_local_queue_dir => "upload",
                    dupload_archive_name => "debian-ports",         
            }
    );

    # don't remove this, Perl needs it
    1;

As can be seen I commented out the @distributions stuff. Those definitions didn't work on my home autobuilder network and I found that I had to add in the definitions as separate assignments. So I did the same for Debian Ports buildd.

And I added the .dupload.conf file:

    package config;

    $default_host = 'debian-ports';

    $cfg{'debian-ports'} = {
            fqdn => "ftp.debian-ports.org",
            incoming => "/incoming/",
            passive => 1,
            # files pass on to dinstall on ftp-master which sends emails itself
            dinstall_runs => 1,
    };

After pretty much setting up all the above Aurelien replied saying to use the buildd code from git.debian.org. So I ran apt-get remove on the sbuild and buildd packages to remove them from the installation, got the code from buildd.debian.org and installed that.

    $ git clone git://git.debian.org/buildd-tools/sbuild.git sbuild.git
    $ cd sbuild.git
    $ git checkout -b v0.60.0 release/sbuild-0.60.0

(That's the most recent version that will work under Lenny.)

    $ ./bootstrap 
    $ ./debian/rules build
    $ fakeroot ./debian/rules binary
    $ cd ..

Then as root install the created .deb files:

    # dpkg -i buildd_0.60.0-1_all.deb sbuild_0.60.0-1_all.deb libsbuild-perl_0.60.0-1_all.deb

(If you had installed and removed, but not purged, sbuild and buildd before, then all the dependencies should still be there.)

To add buildd.debian-ports.org to the known hosts (as user buildd):

    $ ssh -l buildd_alpha buildd.debian-ports.org

If the fingerprint looks good (listed on www.debian-ports.org) accept it. The ssh connection will fail with some error about pty but that's expected.

At this point the buildd process can be started manually by executing /usr/bin/buildd-watcher or by just letting the cronjob start it up. Note, buildd processing can be control by touching the files EXIT-DAEMON-PLEASE and NO-DAEMON-PLEASE in buildd's home directory.