]> git.siccegge.de Git - forks/vmdebootstrap.git/commitdiff
Add --customize script.
authorLars Wirzenius <liw@liw.fi>
Sun, 15 May 2011 11:00:24 +0000 (12:00 +0100)
committerLars Wirzenius <liw@liw.fi>
Sun, 15 May 2011 11:00:24 +0000 (12:00 +0100)
vmdebootstrap
vmdebootstrap.8

index f270e5a4c24700f209181c7c44b3c74b9d35ba19..5ee3277c96f4fcfc91605d947f4068d0a14f0de4 100755 (executable)
@@ -60,6 +60,9 @@ class VmDebootstrap(cliapp.Application):
         self.settings.add_string_setting(['root-password'],
                                          'set root password',
                                          metavar='PASSWORD')
+        self.settings.add_string_setting(['customize'],
+                                         'run SCRIPT after setting up system',
+                                         metavar='SCRIPT')
 
     def process_args(self, args):
         if not self.settings['image']:
@@ -82,6 +85,7 @@ class VmDebootstrap(cliapp.Application):
             self.remove_udev_persistent_rules(rootdir)
             self.setup_networking(rootdir)
             self.install_extlinux(rootdev, rootdir)
+            self.customize(rootdir)
         except:
             self.cleanup()
             raise
@@ -256,6 +260,12 @@ append initrd=%(initrd)s root=UUID=%(uuid)s ro quiet
         for dirname in self.remove_dirs:
             shutil.rmtree(dirname)
 
+    def customize(self, rootdir):
+        script = self.settings['customize']
+        if script:
+            self.message('Running customize script %s' % script)
+            self.runcmd([script, rootdir])
+
 
 if __name__ == '__main__':
     VmDebootstrap().run()
index ba3108e89bdc81f877bca849e7b587b384a91a1e..fcb2ffbf9254f3c8be8107bad9f0a1b0ca780464 100644 (file)
@@ -127,6 +127,14 @@ Without DHCP, only localhost networking is set up.
 .BR \-\-root\-password =\fIPASSWORD
 Set password for root.
 The default is to disable root's password.
+.TP
+.BR \-\-customize =\fISCRIPT
+Run
+.I SCRIPT
+(typically, but not necessarily, a shell script)
+after setting up the new system image.
+The script will get a single parameters:
+the path to the root directory of the newly installed system.
 .SH EXAMPLE
 To create an image for the stable release of Debian:
 .nf