]> git.proxmox.com Git - dab.git/blobdiff - dab
bootstrap: mask more systemd units that fail in containers
[dab.git] / dab
diff --git a/dab b/dab
index 63844c7719c8735352e4aac1d1a4b517ff27b31a..777177159287bbb948682f390cac8af6d7b64a41 100755 (executable)
--- a/dab
+++ b/dab
@@ -11,11 +11,12 @@ $ENV{'LC_ALL'} = 'C';
 
 my $commands = {
     'init' => '',
-    'bootstrap' => '[--exim] [--include <a[,b..]]>] --exclude [<a[,b..]]>] [--minimal]',
+    'bootstrap' => '[--exim] [--include <a[,b..]]>] --exclude [<a[,b..]]>] [--minimal] [--device-skelleton]',
     'finalize' => '[--keepmycnf] [--compressor <gz[ip] (default)|zst[d]|zstd-max>]',
     'veid' => '',
     'basedir' => '',
     'packagefile' => '',
+    'targetname' => '',
     'list' => '[--verbose]',
     'task' => '<postgres|mysql|php> [--version] [--password] [--memlimit]',
     'install' => '<package or *.pkglist file> ...',
@@ -64,7 +65,7 @@ if (!$cmd) {
 }
 
 my $dab;
-sub dab() {
+sub dab :prototype() { # make it a directly as `dab->foo()` callable singleton
     $dab = PVE::DAB->new() if !$dab;
     return $dab;
 }
@@ -83,7 +84,7 @@ eval {
 
     } elsif ($cmd eq 'bootstrap') {
        my $opts = {};
-       if (!GetOptions ($opts, 'exim', 'minimal', 'include=s', 'exclude=s')) {
+       if (!GetOptions ($opts, 'exim', 'minimal', 'device-skelleton', 'include=s', 'exclude=s')) {
            fatal_usage();
        }
        die "command 'bootstrap' expects no arguments.\n" if scalar (@ARGV) != 0;
@@ -109,10 +110,13 @@ eval {
        die "command '$cmd' expects no arguments.\n" if scalar (@ARGV) != 0;
 
        print $dab->{rootfs} . "\n";
+    } elsif ($cmd eq 'targetname') {
+       die "command '$cmd' expects no arguments.\n" if scalar (@ARGV) != 0;
+       print $dab->{targetname} . "\n";
 
     } elsif ($cmd eq 'packagefile') {
        die "command '$cmd' expects no arguments.\n" if scalar (@ARGV) != 0;
-
+       # FIXME: either drop this or make it compressor aware, not all end with .gz...
        print "$dab->{targetname}.tar.gz\n";
 
     } elsif ($cmd eq 'list') {