]> code.delx.au - refind/blobdiff - refind-install
Fixed bugs in mkrlconf and refind-install that could cause kernel
[refind] / refind-install
index 2562d1ea0c52b74a7de91ebb121bae3a66214bd6..f0fc2b22ace0c795927101e13adc905a3971d8d5 100755 (executable)
@@ -1099,7 +1099,12 @@ GenerateRefindLinuxConf() {
          fi
       fi
       if [[ $RootDir == "/" ]] ; then
-         DefaultOptions=`cat /proc/cmdline | cut -d ' ' -f 2- | sed 's/$/ /' | sed 's/initrd=.* //g' | sed 's/ *$//'`
+         local 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
       else
          if [[ -f "$RootDir/etc/default/grub" ]] ; then
             # We want the default options used by the distribution, stored here....