>From 74bfbd3ab63a20e6f15f5f430db40d94a30d69a8 Mon Sep 17 00:00:00 2001
From: Jan Gerber <[email protected]>
Date: Sun, 3 May 2015 14:48:34 +0200
Subject: add --debootstrap-opts to pass additional options to debootstrap


diff --git a/vmdebootstrap b/vmdebootstrap
index 49c21c8..9809ec2 100755
--- a/vmdebootstrap
+++ b/vmdebootstrap
@@ -21,6 +21,7 @@ import crypt
 import logging
 import os
 import re
+import shlex
 import shutil
 import subprocess
 import tempfile
@@ -83,6 +84,9 @@ class VmDebootstrap(cliapp.Application):  # pylint: disable=too-many-public-meth
         self.settings.string(
             ['variant'],
             'select debootstrap variant it not using the default')
+        self.settings.string(
+            ['debootstrap-opts'],
+            'pass additional options to debootstrap (check debootstrap --help for valid options)')
         self.settings.boolean(
             ['extlinux'],
             'install extlinux?',
@@ -445,6 +449,9 @@ class VmDebootstrap(cliapp.Application):  # pylint: disable=too-many-public-meth
         if self.settings['variant']:
             args.append('--variant')
             args.append(self.settings['variant'])
+        if self.settings['debootstrap-opts']:
+            for opt in shlex.split(self.settings['debootstrap-opts']):
+                args.append(opt)
         args += [self.settings['distribution'],
                  rootdir, self.settings['mirror']]
         logging.debug(" ".join(args))
diff --git a/vmdebootstrap.8.in b/vmdebootstrap.8.in
index 80df9bc..483d4ff 100644
--- a/vmdebootstrap.8.in
+++ b/vmdebootstrap.8.in
@@ -29,7 +29,7 @@ vmdebootstrap \- install basic Debian system into virtual disk image
 [\-\-serial-console | \-\-no-serial-console] [\-\-sudo |\-\-no-sudo] [\-\-owner=OWNER]
 [\-\-bootsize=BOOTSIZE] [\-\-boottype=FSTYPE] [\-\-roottype=FSTYPE] [\-\-foreign=PATH]
 [\-\-variant=VARIANT] [\-\-no-extlinux] [\-\-squash] [\-\-configure-apt]
-[\-\-grub] [\-\-apt-mirror] [\-\-pkglist]
+[\-\-grub] [\-\-apt-mirror] [\-\-pkglist] [\-\-debootstrap\-opts]
 .SH DESCRIPTION
 .B vmdebootstrap
 installs a basic Debian system into a virtual disk image,
@@ -231,6 +231,8 @@ complete and grub-install will be called in the image.
 Output a list of package names installed inside the image. Useful if you
 need to track the relevant source packages used inside the image for
 licence compliance.
+.IP \-\-debootstrap\-opts
+Pass additional options to debootstrap, check debootstrap \-\-help for valid options
 .SH Configuration files and settings:
 .IP \-\-dump-config
 write out the entire current configuration
-- 
2.2.1.209.g41e5f3a

Reply via email to