# origin: debian
my $supported_suites = {
'bullseye' => {
- ostype => "debian-11.0",
+ ostype => "debian-11",
},
'buster' => {
- ostype => "debian-10.0",
+ ostype => "debian-10",
},
'stretch' => {
ostype => "debian-9.0",
'ascii' => {
ostype => "devuan-2.0",
},
+ 'beowulf' => {
+ ostype => "devuan-3.0",
+ },
+ 'chimaera' => {
+ ostype => "devuan-4.0",
+ },
# UBUNTU
'hardy' => {
ostype => "ubuntu-20.04",
origin => 'ubuntu',
},
+ 'groovy' => {
+ ostype => "ubuntu-20.10",
+ origin => 'ubuntu',
+ },
+ 'hirsute' => {
+ ostype => "ubuntu-21.04",
+ origin => 'ubuntu',
+ },
+ 'impish' => {
+ ostype => "ubuntu-21.10",
+ origin => 'ubuntu',
+ },
};
sub get_suite_info {
'http://ftp.debian.org/debian SUITE main contrib',
'http://security.debian.org SUITE/updates main contrib',
);
+ } elsif ($suite eq 'bullseye') {
+ push @{$config->{source}}, (
+ "http://ftp.debian.org/debian SUITE main contrib",
+ "http://ftp.debian.org/debian SUITE-updates main contrib",
+ "http://security.debian.org SUITE-security main contrib",
+ );
} else {
push @{$config->{source}}, (
"http://ftp.debian.org/debian SUITE main contrib",
if ($suite eq 'vivid' || $suite eq 'wily' || $suite eq 'xenial' ||
$suite eq 'yakkety' || $suite eq 'zesty' || $suite eq 'artful' ||
$suite eq 'bionic' || $suite eq 'cosmic' || $suite eq 'disco' ||
- $suite eq 'eoan' || $suite eq 'focal') {
+ $suite eq 'eoan' || $suite eq 'focal' || $suite eq 'groovy'
+ || $suite eq 'hirsute' || $suite eq 'impish'
+ ) {
push @$incl, 'isc-dhcp-client';
push @$excl, qw(libmodule-build-perl);
} elsif ($suite eq 'trusty') {
my $logfd = $self->{logfd} = IO::File->new (">$self->{logfile}") ||
die "unable to open log file";
+ my $COMPRESSORS = [
+ {
+ ext => 'xz',
+ decomp => 'xz -d',
+ },
+ {
+ ext => 'gz',
+ decomp => 'gzip -d',
+ },
+ ];
+
foreach my $ss (@{$self->{sources}}) {
my $src = $ss->{mirror} || $ss->{source};
my $path = "dists/$ss->{suite}/Release";
print $logfd $@;
warn "Release info ignored\n";
};
- foreach my $comp (@{$ss->{comp}}) {
- $path = "dists/$ss->{suite}/$comp/binary-$arch/Packages.gz";
- $target = "$infodir/" . __url_to_filename ("$ss->{source}/$path");
- my $pkgsrc = "$src/$path";
- $self->download ($pkgsrc, $target);
- $self->run_command ("gzip -d '$target'");
+
+ foreach my $compressor (@$COMPRESSORS) {
+ foreach my $comp (@{$ss->{comp}}) {
+ $path = "dists/$ss->{suite}/$comp/binary-$arch/Packages.$compressor->{ext}";
+ $target = "$infodir/" . __url_to_filename ("$ss->{source}/$path");
+ my $pkgsrc = "$src/$path";
+ eval {
+ $self->download ($pkgsrc, $target);
+ $self->run_command ("$compressor->{decomp} '$target'");
+ };
+ if (my $err = $@) {
+ print $logfd "could not download Packages.$compressor->{ext}\n";
+ } else {
+ last;
+ }
+ }
}
}
}
$self->logmsg ("creating final appliance archive\n");
my $target = "$self->{targetname}.tar";
- my $final_archive = "${target}.gz";
+
+ my $compressor = $opts->{compressor} // 'gz';
+ my $compressor2cmd_map = {
+ gz => 'gzip',
+ gzip => 'gzip',
+ zst => 'zstd -9',
+ zstd => 'zstd -9',
+ 'zstd-max' => 'zstd -19 -T0', # maximal level where the decompressor can still run efficiently
+ };
+ my $compressor2ending = {
+ gzip => 'gz',
+ zstd => 'zst',
+ 'zstd-max' => 'zst',
+ };
+ my $compressor_cmd = $compressor2cmd_map->{$compressor};
+ die "unkown compressor '$compressor', use one of: ". join(', ', sort keys %$compressor2cmd_map)
+ if !defined($compressor_cmd);
+
+ my $ending = $compressor2ending->{$compressor} // $compressor;
+ my $final_archive = "${target}.${ending}";
unlink $target;
unlink $final_archive;
$self->run_command ("tar cpf $target --numeric-owner -C '$rootdir' ./etc/appliance.info");
$self->run_command ("tar rpf $target --numeric-owner -C '$rootdir' --exclude ./etc/appliance.info .");
- $self->run_command ("gzip $target");
+ $self->run_command ("$compressor_cmd $target");
$self->logmsg ("detecting final commpressed appliance size: ");
$size = $get_path_size->($final_archive);
} elsif ($suite eq 'xenial' || $suite eq 'wily' || $suite eq 'vivid' ||
$suite eq 'yakkety' || $suite eq 'zesty' || $suite eq 'artful' ||
$suite eq 'bionic' || $suite eq 'cosmic' || $suite eq 'disco' ||
- $suite eq 'eoan' || $suite eq 'focal') {
+ $suite eq 'eoan' || $suite eq 'focal' || $suite eq 'groovy'
+ || $suite eq 'hirsute' || $suite eq 'impish'
+ ) {
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";
# avoid warnings about non-existent resolv.conf
write_file ("", "$rootdir/etc/resolv.conf", 0644);
- if ($suite eq 'focal' || $suite eq 'eoan' || $suite eq 'disco' || $suite eq 'cosmic' ||
+ if (
+ $suite eq 'impish' ||
+ $suite eq 'hirsute' || $suite eq 'groovy' || $suite eq 'focal' ||
+ $suite eq 'eoan' || $suite eq 'disco' || $suite eq 'cosmic' ||
$suite eq 'bionic' || $suite eq 'artful' ||
$suite eq 'zesty' || $suite eq 'yakkety' || $suite eq 'xenial' ||
$suite eq 'wily') {
$self->run_command ($cmd);
}
- if ($suite eq 'intrepid') {
+ if ($suite eq 'intrepid' || $suite eq 'jaunty') {
# remove sysctl setup (avoid warnings at startup)
my $filelist = "$rootdir/etc/sysctl.d/10-console-messages.conf";
- $filelist .= " $rootdir/etc/sysctl.d/10-process-security.conf";
+ $filelist .= " $rootdir/etc/sysctl.d/10-process-security.conf" if $suite eq 'intrepid';
$filelist .= " $rootdir/etc/sysctl.d/10-network-security.conf";
$self->run_command ("rm $filelist");
}
- if ($suite eq 'jaunty') {
- # remove sysctl setup (avoid warnings at startup)
- my $filelist = "$rootdir/etc/sysctl.d/10-console-messages.conf";
- $filelist .= " $rootdir/etc/sysctl.d/10-network-security.conf";
- $self->run_command ("rm $filelist");
+
+ if (-e "$rootdir/lib/systemd/system/sys-kernel-config.mount") {
+ $self->ve_command ("ln -s /dev/null /etc/systemd/system/sys-kernel-debug.mount");
}
}