]> code.delx.au - refind/blobdiff - mkrlconf
Fixed bugs in mkrlconf and refind-install that could cause kernel
[refind] / mkrlconf
index 031c82a6012af41e2e74f759eb64f67ba520814a..9855dec3c48a9d300f6188d57a29bdaeb78761dc 100755 (executable)
--- a/mkrlconf
+++ b/mkrlconf
@@ -45,7 +45,12 @@ if [[ ! -f $RLConfFile || $1 == "--force" ]] ; then
             RootFS=$Uuid
         fi
     fi
-    DefaultOptions=`cat /proc/cmdline | cut -d ' ' -f 2- | sed 's/$/ /' | sed 's/initrd=.* //g' | sed 's/ *$//'`
+    FirstCmdlineOption=`cat /proc/cmdline | cut -d ' ' -f 1`
+    if [[ "$FirstCmdlineOption" =~ (vmlinuz|bzImage|kernel) ]] ; then
+        DefaultOptions=`cat /proc/cmdline | cut -d ' ' -f 2- | sed 's/\S*initrd=\S*//g' | sed 's/ *$//' | sed 's/^ *//'`
+    else
+        DefaultOptions=`cat /proc/cmdline | sed 's/\S*initrd=\S*//g' | sed 's/ *$//' | sed 's/^ *//'`
+    fi
     echo "\"Boot with standard options\"  \"$DefaultOptions\"" > $RLConfFile
     echo "\"Boot to single-user mode\"    \"$DefaultOptions single\"" >> $RLConfFile
     echo "\"Boot with minimal options\"   \"ro root=$RootFS\"" >> $RLConfFile