From: Aaron Klingaman Date: Fri, 2 Dec 2005 01:40:22 +0000 (+0000) Subject: patch from Marc F to optionally pull in extra kexec args from /kargs.txt X-Git-Tag: planetlab-3_3-branch-point~21 X-Git-Url: http://git.onelab.eu/?p=bootmanager.git;a=commitdiff_plain;h=b89eca454fae5106b3c9f9185ec6e4e0920d4c57 patch from Marc F to optionally pull in extra kexec args from /kargs.txt --- diff --git a/source/steps/ChainBootNode.py b/source/steps/ChainBootNode.py index 170437f..a83474a 100644 --- a/source/steps/ChainBootNode.py +++ b/source/steps/ChainBootNode.py @@ -180,9 +180,23 @@ def Run( vars, log ): except IOError: log.write( "Couldn't read /proc/modules, continuing.\n" ) + + kargs = "ramdisk_size=8192" + try: + kargsfb = open("/kargs.txt","r") + moreargs = kargsfb.readline() + kargsfb.close() + moreargs = moreargs.strip() + log.write( 'Parsed in "%s" kexec args from /kargs.txt\n' % moreargs ) + kargs = kargs + " " + moreargs + except IOError: + # /kargs.txt does not exist, which is fine. Just kexec with default + # kargs, which is ramdisk_size=8192 + pass + try: - utils.sysexec( "kexec --force --initrd=/tmp/initrd " \ - "--append=ramdisk_size=8192 /tmp/kernel" ) + utils.sysexec( 'kexec --force --initrd=/tmp/initrd ' \ + '--append="%s" /tmp/kernel' % kargs) except BootManagerException, e: # if kexec fails, we've shut the machine down to a point where nothing # can run usefully anymore (network down, all modules unloaded, file