diff options
author | Pedro Alvarez <pedro.alvarez@codethink.co.uk> | 2014-04-04 11:40:38 +0000 |
---|---|---|
committer | Pedro Alvarez <pedro.alvarez@codethink.co.uk> | 2014-04-04 13:46:24 +0000 |
commit | c1197bd420c9a9b97b7263def4215d93cfc2ddbd (patch) | |
tree | 7dda35e342e054610269251bb83fe2b3938b3ab8 | |
parent | ccaed5352ce9413cee3d7ab4b60514d0bc4fdbaa (diff) | |
download | definitions-c1197bd420c9a9b97b7263def4215d93cfc2ddbd.tar.gz |
Adding support to add extra kernel args in extlinux.conf
-rw-r--r-- | writeexts.py | 6 |
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]) |