From 29af4ff1b664f64ae4307ccb460e7faabcc39963 Mon Sep 17 00:00:00 2001 From: Gerardo Exequiel Pozzi Date: Fri, 12 Feb 2010 20:02:55 -0300 Subject: [PATCH] Allow kernel parameters arguments with spaces Currently kernel parameter like acpi_osi="!Windows 2006" is not parsed corretly, making "incomplete" env vars like: The idea is simple, detect the start quote, save the value in a temp var, detect the end quote, save the value, then finally join both values and export. acpi_osi='"!Windows' Signed-off-by: Gerardo Exequiel Pozzi --- init | 9 +++++++++ 1 files changed, 9 insertions(+), 0 deletions(-) diff --git a/init b/init index 7d4b226..9e98f73 100644 --- a/init +++ b/init @@ -25,6 +25,15 @@ fi for cmd in ${CMDLINE}; do case "${cmd}" in + *=\"*) + rhs="$(echo "${cmd}" | cut -d= -f2-)" + cmd="$(echo "${cmd}" | cut -d= -f1 | sed 's|\.|_|g')" + cmd="$(echo "${cmd}" | sed 's|-|_|g')=${rhs}" + cmdtmp=${cmd} + ;; + *\") cmd="${cmdtmp} ${cmd}" + (echo "${cmd}" | grep -qe '^[0-9]') || export "${cmd}" + ;; \#*) break ;; # ignore everything after a # in the commandline # The kernel passes those to the kernel on its own [0123456Ss]) ;; -- 1.6.6.1