DAB for Debian Testing?

Discussion in 'Debian Appliance Builder' started by oeginc, Dec 27, 2013.

  1. oeginc

    oeginc Member

    Joined:
    Mar 21, 2009
    Messages:
    133
    Likes Received:
    0
    Is there some way to have DAB using the testing version of Debian while building? I understand this may come with some inherit bugs...

    Right now I am building Wheezy and copying my own /etc/rc.local startup script that updates the system to testing on first boot and
    then removes itself. For 1 machine, that's not a big deal - but I have 60+ I am getting ready to rebuild...
     
  2. oeginc

    oeginc Member

    Joined:
    Mar 21, 2009
    Messages:
    133
    Likes Received:
    0
    Ok, I think I was able to accomplish what I am looking to do, I had to patch /usr/share/perl5/PVE/DAB.pm as follows:

    *** DAB.pm.orig 2013-07-22 00:43:07.000000000 -0400
    --- DAB.pm 2013-12-27 07:30:41.000000000 -0500
    ***************
    *** 377,383 ****
    if $arch !~ m/^(i386|amd64)$/;

    my $suite = $config->{suite} || die "no 'suite' specified\n";
    ! if ($suite eq 'wheezy') {
    $config->{ostype} = "debian-7.0";
    } elsif ($suite eq 'squeeze') {
    $config->{ostype} = "debian-6.0";
    --- 377,385 ----
    if $arch !~ m/^(i386|amd64)$/;

    my $suite = $config->{suite} || die "no 'suite' specified\n";
    ! if ($suite eq 'testing') {
    ! $config->{ostype} = "debian-x.x";
    ! } elsif ($suite eq 'wheezy') {
    $config->{ostype} = "debian-7.0";
    } elsif ($suite eq 'squeeze') {
    $config->{ostype} = "debian-6.0";
    ***************
    *** 1248,1254 ****
    $self->logmsg ("create basic environment\n");
    foreach my $p (@$required) {
    my $filename = $self->getpkgfile ($p);
    ! $self->run_command ("ar -p '$self->{cachedir}/$filename' data.tar.gz | zcat | tar -C '$rootdir' -xf -");
    }

    # fake dpkg status
    --- 1250,1262 ----
    $self->logmsg ("create basic environment\n");
    foreach my $p (@$required) {
    my $filename = $self->getpkgfile ($p);
    ! my $datatype = $self->run_command ("ar -t '$self->{cachedir}/$filename'|grep data.tar", undef, 1);
    ! $datatype =~ s/\R//g;
    ! if ($datatype eq 'data.tar.gz') {
    ! $self->run_command ("ar -p '$self->{cachedir}/$filename' data.tar.gz | zcat | tar -C '$rootdir' -xf -");
    ! } elsif ($datatype eq 'data.tar.xz') {
    ! $self->run_command ("ar -p '$self->{cachedir}/$filename' data.tar.xz | tar -C '$rootdir' -xJf -");
    ! }
    }

    # fake dpkg status




    And then I just created a dab.conf:

    Suite: testing
    CacheDir: ../cache
    Architecture: i386
    Name: debian-testing
    Version: x.x
    Section: system
    Source: http://ftp.debian.org/debian testing main contrib non-free
    Source: http://security.debian.org testing/updates main contrib non-free
    Maintainer: Me (me@somewhere.com)
    Infopage: http://www.debian.org/
    Description: Debian Testing (minimal)
    A minimal Debian testing system custom tailored for our environment.


    And it seemed to build & install just fine. Not sure if I am going to run into problems down the
    road though, there is a good chance I missed something. The biggest problem seemed to be
    that the new package management system uses 'data.tar.xz' files instead of gzip'd ones, so I
    threw in some code to auto-detect that and run the appropriate commands. It would be nice
    to auto-detect the appropriate sources to use, but that doesn't seem to work. If I take the
    source lines out of the dab.conf, it fails...
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice