my $ostype = $self->{config}->{ostype};
- if ($ostype =~ m/^debian-/) {
+ if ($ostype =~ m/^de(bi|vu)an-/) {
$data .= "lxc.include = /usr/share/lxc/config/debian.common.conf\n";
} elsif ($ostype =~ m/^ubuntu-/) {
$data .= "lxc.include = /usr/share/lxc/config/ubuntu.common.conf\n";
$config->{ostype} = "debian-5.0";
} elsif ($suite eq 'etch') {
$config->{ostype} = "debian-4.0";
+ } elsif ($suite eq 'devuan-jessie') {
+ $suite = 'jessie';
+ $config->{ostype} = "devuan-1.0";
+ } elsif ($suite eq 'devuan-ascii' || 'ascii') {
+ $suite = 'ascii';
+ $config->{ostype} = "devuan-2.0";
} elsif ($suite eq 'hardy') {
$config->{ostype} = "ubuntu-8.04";
} elsif ($suite eq 'intrepid') {
$config->{ostype} = "ubuntu-16.10";
} elsif ($suite eq 'zesty') {
$config->{ostype} = "ubuntu-17.04";
+ } elsif ($suite eq 'artful') {
+ $config->{ostype} = "ubuntu-17.10";
} else {
die "unsupported debian suite '$suite'\n";
}
} elsif ($suite eq 'hardy' || $suite eq 'intrepid' || $suite eq 'jaunty' ||
$suite eq 'xenial' || $suite eq 'wily' || $suite eq 'vivid' ||
$suite eq 'trusty' || $suite eq 'precise' || $suite eq 'yakkety' ||
- $suite eq 'zesty') {
+ $suite eq 'zesty' || $suite eq 'artful' ) {
my $comp = "main restricted universe multiverse";
push @{$config->{source}}, "http://archive.ubuntu.com/ubuntu SUITE $comp";
push @{$config->{source}}, "http://archive.ubuntu.com/ubuntu SUITE-updates $comp";
# we cannot exclude it (instead we disable udevd)
if ($suite eq 'vivid' || $suite eq 'wily' || $suite eq 'xenial' ||
- $suite eq 'yakkety' || $suite eq 'zesty') {
+ $suite eq 'yakkety' || $suite eq 'zesty' || $suite eq 'artful') {
push @$incl, 'isc-dhcp-client';
push @$excl, qw(libmodule-build-perl);
} elsif ($suite eq 'trusty') {
# first, record provided packages
__record_provides ($pkginfo, $closure, $list, 1);
- my $pkgs = {};
+ my $pkghash = {};
+ my $pkglist = [];
# then resolve dependencies
foreach my $pname (@$list) {
- __closure_single ($pkginfo, $closure, $pkgs, $pname, $self->{excl});
+ __closure_single ($pkginfo, $closure, $pkghash, $pkglist, $pname, $self->{excl});
}
- return [ keys %$pkgs ];
+ return $pkglist;
}
sub __closure_single {
- my ($pkginfo, $closure, $pkgs, $pname, $excl) = @_;
+ my ($pkginfo, $closure, $pkghash, $pkglist, $pname, $excl) = @_;
$pname =~ s/^\s+//;
$pname =~ s/\s+$//;
my $url = $info->{url};
$url || die "$pname: no url for package '$pname'";
-
- $pkgs->{$pname} = 1;
+
+ if (!$pkghash->{$pname}) {
+ unshift @$pkglist, $pname;
+ $pkghash->{$pname} = 1;
+ }
__record_provides ($pkginfo, $closure, [$pname]) if $info->{provides};
#printf (STDERR "$pname: $p --> $found\n");
- __closure_single ($pkginfo, $closure, $pkgs, $found, $excl);
+ __closure_single ($pkginfo, $closure, $pkghash, $pkglist, $found, $excl);
}
}
if ($suite eq 'etch' || $suite eq 'lenny') {
$self->ve_command ("update-rc.d $base start $prio $runlevel .");
} elsif ($suite eq 'xenial' || $suite eq 'wily' || $suite eq 'vivid' ||
- $suite eq 'yakkety' || $suite eq 'zesty') {
+ $suite eq 'yakkety' || $suite eq 'zesty' || $suite eq 'artful') {
die "unable to install init script (system uses systemd)\n";
} elsif ($suite eq 'trusty' || $suite eq 'precise') {
die "unable to install init script (system uses upstart)\n";
push @$important, "postfix";
}
- foreach my $p (keys %$pkginfo) {
+ foreach my $p (sort keys %$pkginfo) {
next if grep { $p eq $_ } @{$self->{excl}};
my $pri = $pkginfo->{$p}->{priority};
next if !$pri;
# avoid warnings about non-existent resolv.conf
write_file ("", "$rootdir/etc/resolv.conf", 0644);
- if ($suite eq 'zesty' || $suite eq 'yakkety' ||
+ if ($suite eq 'artful' || $suite eq 'zesty' || $suite eq 'yakkety' ||
$suite eq 'xenial' || $suite eq 'wily') {
# no need to configure loopback device
} else {
$self->ve_dpkg ('install', 'mawk');
$self->ve_dpkg ('install', 'debconf');
-
+
# unpack required packages
foreach my $p (@$required) {
$self->ve_dpkg ('unpack', $p);