Package: vmdebootstrap
Version: 0.6-1
Severity: wishlist
Tags: patch

Dear Maintainers,

Attached patch should provide support for taskel execution.
Thanks for your work on vmdebootstrap!

Cheers,
Luca
diff --git a/vmdebootstrap b/vmdebootstrap
old mode 100755
new mode 100644
index a9127ae..4dcedf3
--- a/vmdebootstrap
+++ b/vmdebootstrap
@@ -176,6 +176,9 @@ class VmDebootstrap(cliapp.Application):  # pylint: disable=too-many-public-meth
         self.settings.boolean(
             ['pkglist'],
             'Create a list of package names included in the image.')
+        self.settings.string(
+            ['tasksel'],
+            'install specified tasksel task onto system.')
 
     def process_args(self, args):  # pylint: disable=too-many-branches,too-many-statements
         if not self.settings['image'] and not self.settings['tarball']:
@@ -214,6 +217,8 @@ class VmDebootstrap(cliapp.Application):  # pylint: disable=too-many-public-meth
             else:
                 rootdir = self.mkdtemp()
             self.debootstrap(rootdir)
+            if self.settings['tasksel']:
+                self.tasksel(rootdir)
             self.set_hostname(rootdir)
             self.create_fstab(rootdir, rootdev, roottype, bootdev, boottype)
             self.install_debs(rootdir)
@@ -408,6 +413,14 @@ class VmDebootstrap(cliapp.Application):  # pylint: disable=too-many-public-meth
         self.message('Creating filesystem %s' % fstype)
         self.runcmd(['mkfs', '-t', fstype, device])
 
+    def tasksel(self, rootdir):
+        self.message('Installing task %s' % self.settings['tasksel'])
+
+        args = ['chroot', rootdir, 'tasksel', '--new-install',
+                'install', self.settings['tasksel']]
+        logging.debug(" ".join(args))
+        self.runcmd(args)
+
     def debootstrap(self, rootdir):
         msg = "(%s)" % self.settings['variant'] if self.settings['variant'] else ''
         self.message('Debootstrapping %s %s' % (self.settings['distribution'], msg))
diff --git a/vmdebootstrap.8.in b/vmdebootstrap.8.in
index 80df9bc..5daf10d 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] [\-\-tasksel]
 .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 \-\-tasksel
+Install a specified tasksel task inside the image.
 .SH Configuration files and settings:
 .IP \-\-dump-config
 write out the entire current configuration

Attachment: signature.asc
Description: Digital signature

Reply via email to