From b89eca454fae5106b3c9f9185ec6e4e0920d4c57 Mon Sep 17 00:00:00 2001 From: Aaron Klingaman Date: Fri, 2 Dec 2005 01:40:22 +0000 Subject: [PATCH] patch from Marc F to optionally pull in extra kexec args from /kargs.txt --- source/steps/ChainBootNode.py | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) 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 -- 2.43.0