kernel: allow specification of additional initrd arguments

When building the initrd allow the job configuration to offer
up additional initrd arguments.  Use this in the ABAT harness to
specify modules for RedHat installs.

Signed-off-by: Andy Whitcroft <apw@shadowen.org>


git-svn-id: http://test.kernel.org/svn/autotest/trunk@685 592f7852-d20e-0410-864c-8624ca9c26a4
diff --git a/client/bin/kernel.py b/client/bin/kernel.py
index 8066493..3f3d979 100755
--- a/client/bin/kernel.py
+++ b/client/bin/kernel.py
@@ -299,10 +299,12 @@
 			print "Existing %s file, will remove it." % initrd
 			os.remove(initrd)
 
+		args = self.job.config_get('kernel.mkinitrd_extra_args')
+
 		if vendor in ['Red Hat', 'Fedora Core']:
-			system('mkinitrd %s %s' % (initrd, version))
+			system('mkinitrd %s %s %s' % (args, initrd, version))
 		elif vendor in ['SUSE']:
-			system('mkinitrd -k %s -i %s -M %s' % (image, initrd, system_map))
+			system('mkinitrd %s -k %s -i %s -M %s' % (args, image, initrd, system_map))
 		elif vendor in ['Debian', 'Ubuntu']:
 			if os.path.isfile('/usr/sbin/mkinitrd'):
 				cmd = '/usr/sbin/mkinitrd'
@@ -310,7 +312,7 @@
 				cmd = '/usr/sbin/mkinitramfs'
 			else:
 				raise TestError('No Debian initrd builder')
-			system('%s -o %s %s' % (cmd, initrd, version))
+			system('%s %s -o %s %s' % (cmd, args, initrd, version))
 		else:
 			raise TestError('Unsupported vendor %s' % vendor)