diff options
author | Will Woods <wwoods@redhat.com> | 2012-08-16 16:44:54 -0400 |
---|---|---|
committer | Will Woods <wwoods@redhat.com> | 2012-08-16 17:01:19 -0400 |
commit | 6d4f8595ac0f0accba4c2132140fd0ef60359640 (patch) | |
tree | 89fd65346232a7054e05d4874a23b8c104be4d54 /dracut | |
parent | 5044d79ed68b71fe5fd3fc355594b1c81819f638 (diff) | |
download | anaconda-6d4f8595ac0f0accba4c2132140fd0ef60359640.tar.gz anaconda-6d4f8595ac0f0accba4c2132140fd0ef60359640.tar.xz anaconda-6d4f8595ac0f0accba4c2132140fd0ef60359640.zip |
parse-kickstart: add proc_cmdline (fix init_logger())
commit c1da5cd was originally part of an attempt to fix something else,
but the other patch (which introduced proc_cmdline) was rejected on
review.
This adds proc_cmdline so init_logger() won't traceback.
Diffstat (limited to 'dracut')
-rwxr-xr-x | dracut/parse-kickstart | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/dracut/parse-kickstart b/dracut/parse-kickstart index e5c9770b0..3c3a1ffdf 100755 --- a/dracut/parse-kickstart +++ b/dracut/parse-kickstart @@ -32,6 +32,22 @@ def readsysfile(f): val = "" return val +def read_cmdline(f): + '''Returns an OrderedDict containing key-value pairs from a file with + boot arguments (e.g. /proc/cmdline).''' + args = OrderedDict() + try: + lines = open(f).readlines() + except IOError: + lines = [] + for line in lines: + for arg in line.split(): + k,e,v = arg.partition("=") + args[k] = v + return args + +proc_cmdline = read_cmdline("/proc/cmdline") + # Here are the kickstart commands we care about: class Method(commands.method.F14_Method): |