summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPedro Alvarez <pedro.alvarez@codethink.co.uk>2014-04-04 11:40:38 +0000
committerPedro Alvarez <pedro.alvarez@codethink.co.uk>2014-04-04 13:46:24 +0000
commitc1197bd420c9a9b97b7263def4215d93cfc2ddbd (patch)
tree7dda35e342e054610269251bb83fe2b3938b3ab8
parentccaed5352ce9413cee3d7ab4b60514d0bc4fdbaa (diff)
downloaddefinitions-c1197bd420c9a9b97b7263def4215d93cfc2ddbd.tar.gz
Adding support to add extra kernel args in extlinux.conf
-rw-r--r--writeexts.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/writeexts.py b/writeexts.py
index 1849f406..bff21e8d 100644
--- a/writeexts.py
+++ b/writeexts.py
@@ -333,11 +333,15 @@ class WriteExtension(cliapp.Application):
cliapp.runcmd(['cp', '-a', try_path, kernel_dest])
break
+ def get_extra_kernel_args(self):
+ return os.environ.get('KERNEL_ARGS', '')
+
def install_extlinux(self, real_root):
'''Install extlinux on the newly created disk image.'''
self.status(msg='Creating extlinux.conf')
config = os.path.join(real_root, 'extlinux.conf')
+ kernel_args = self.get_extra_kernel_args()
with open(config, 'w') as f:
f.write('default linux\n')
f.write('timeout 1\n')
@@ -345,7 +349,7 @@ class WriteExtension(cliapp.Application):
f.write('kernel /systems/default/kernel\n')
f.write('append root=/dev/sda '
'rootflags=subvol=systems/default/run '
- 'init=/sbin/init rw\n')
+ '%s init=/sbin/init rw\n' % (kernel_args))
self.status(msg='Installing extlinux')
cliapp.runcmd(['extlinux', '--install', real_root])