my $commands = {
'init' => '',
- 'bootstrap' => '[--exim] [--minimal]',
- 'finalize' => '[--keepmycnf]',
+ 'bootstrap' => '[--exim] [--include <a[,b..]]>] --exclude [<a[,b..]]>] [--minimal]',
+ 'finalize' => '[--keepmycnf] [--compressor <gz[ip] (default)|zst[d]|zstd-max>]',
'veid' => '',
'basedir' => '',
'packagefile' => '',
};
sub print_usage {
- my ($msg) = @_;
-
- if ($msg) {
- print STDERR "\nERROR: $msg\n\n";
- }
print STDERR "USAGE: dab <command> [parameters]\n\n";
for my $cmd (sort keys %$commands) {
}
}
-if (scalar (@ARGV) == 0) {
- print_usage("no command specified");
+sub fatal_usage {
+ my ($msg) = @_;
+
+ print STDERR "\nERROR: $msg\n\n" if $msg;
+ print_usage();
+
exit (-1);
}
+if (scalar (@ARGV) == 0) {
+ fatal_usage("no command specified");
+}
+
my $cmdline = join (' ', @ARGV);
my $cmd = shift @ARGV;
if (!$cmd) {
- print_usage("no command specified");
- exit (-1);
+ fatal_usage("no command specified");
} elsif (!exists $commands->{$cmd}) {
- print_usage("unknown command '$cmd'");
- exit (-1);
+ fatal_usage("unknown command '$cmd'");
} elsif ($cmd eq 'help') {
print_usage();
exit (0);
} elsif ($cmd eq 'bootstrap') {
my $opts = {};
- if (!GetOptions ($opts, 'exim', 'minimal')) {
- print_usage();
- exit (-1);
+ if (!GetOptions ($opts, 'exim', 'minimal', 'include=s', 'exclude=s')) {
+ fatal_usage();
}
die "command 'bootstrap' expects no arguments.\n" if scalar (@ARGV) != 0;
} elsif ($cmd eq 'finalize') {
my $opts = {};
- if (!GetOptions ($opts, 'keepmycnf')) {
- print_usage();
- exit (-1);
+ if (!GetOptions ($opts, 'keepmycnf', 'compressor=s')) {
+ fatal_usage();
}
die "command '$cmd' expects no arguments.\n" if scalar (@ARGV) != 0;
} elsif ($cmd eq 'list') {
my $verbose;
if (!GetOptions ('verbose' =>\$verbose)) {
- print_usage();
- exit (-1);
+ fatal_usage();
}
die "command '$cmd' expects no arguments.\n" if scalar (@ARGV) != 0;
} elsif ($cmd eq 'task') {
my $task = shift @ARGV;
if (!$task) {
- print_usage("no task specified");
- exit (-1);
+ fatal_usage("no task specified");
}
my $opts = {};
if ($task eq 'mysql') {
if (!GetOptions ($opts, 'password=s', 'start')) {
- print_usage();
- exit (-1);
+ fatal_usage();
}
die "task '$task' expects no arguments.\n" if scalar (@ARGV) != 0;
} elsif ($task eq 'postgres') {
if (!GetOptions ($opts, 'version=s', 'start')) {
- print_usage();
- exit (-1);
+ fatal_usage();
}
die "task '$task' expects no arguments.\n" if scalar (@ARGV) != 0;
} elsif ($task eq 'php') {
if (!GetOptions ($opts, 'memlimit=i')) {
- print_usage();
- exit (-1);
+ fatal_usage();
}
die "task '$task' expects no arguments.\n" if scalar (@ARGV) != 0;
$dab->task_php ($opts);
} else {
- print_usage("unknown task '$task'");
- exit (-1);
-
+ fatal_usage("unknown task '$task'");
}
} elsif ($cmd eq 'install' || $cmd eq 'unpack') {
$dab->cleanup(1);
} else {
- print_usage("invalid command '$cmd'");
- exit (-1);
+ fatal_usage("invalid command '$cmd'");
}
};
and above).
=over
-
+
=item I<--exim>
-Use exim as MTA (we use postfix by default)
+Use exim as MTA (dab selects postfix by default)
=item I<--minimal>
-Do not install standard packages.
+Do not auto-select packages with standard priority for installation.
+
+=item I<--include <a[,b..]]>
+
+A comma-separated list of packages to always include in bootstrap. Note that no
+transitive dependency resolution is done, you may need to specify those
+yourself.
+
+=item I<--exclude <a[,b..]]>
+
+A comma-separated list of packages to exlcude in bootstrap. Note that no
+transitive dependency resolution is done for others to get excluded, you may
+need to specify those yourself.
=back
=item I<--version=XXX>
-Select Postgres version. Posible values are C<7.4>, C<8.1> and C<8.3> (depends
-on the selected suite).
+Select Postgres version. Posible values are for example C<9.6>, C<11> or C<13>,
+they depend on the selected distribution suite. Defaults to none, which selects
+the unversioned metapackage that pulls in the suites default version, normally
+a good choice to make.
=item I<--start>
-Start the postgres server (if you want to execute sql commands during appliance
-generation).
+Start the postgres server immediately. Useful, for example, if you want to
+execute sql commands during appliance generation.
=back
Do not delete file C</root/.my.cfg> (mysql).
+=item I<--compressor <gz[ip] (default)|zst[d]|zstd-max>]>
+
+Select the compressor to process the rootfs archive with. C<gzip> is a good
+choice to make the archive also available on older systems, but using C<zstd>
+or even C<zstd-max> results in a higher compression ration while keeping
+decompression very fast and highly efficient. Note that C<zstd-max> uses the
+highest compression ratio without any decompression performance hit possible,
+it will use as many threads as there are onlince CPU threads and may thus
+increase the system load significantly for tens of seconds up to minutes.
+
=back
=item B<dab list>
=head1 AUTHOR
Dietmar Maurer <dietmar@proxmox.com>
+Thomas Lamprecht <t.lamprecht@proxmox.com>
Many thanks to Proxmox Server Solutions (www.proxmox.com) for sponsoring this
work.
=head1 COPYRIGHT AND DISCLAIMER
-Copyright (C) 2007-2020 Proxmox Server Solutions GmbH
+Copyright (C) 2007-2021 Proxmox Server Solutions GmbH
Copyright: dab is under GNU GPL, the GNU General Public License.