X-Git-Url: https://code.delx.au/refind/blobdiff_plain/d6bcf1a6b2941929a65134c592ed134a07bc560d..16025084e9b3cf79dc13b84cd96ee850ff34296a:/refind-install diff --git a/refind-install b/refind-install index b399c7f..f0fc2b2 100755 --- a/refind-install +++ b/refind-install @@ -201,8 +201,8 @@ ReadYesNo() { CheckForFiles() { # Note: $ThisDir points to real (not symlinked) script home on Linux, # enabling creating a symlink in /usr/sbin (or wherever); but on OS X, - # "readlink" doesn't do the right thing, so the script must not be a - # symlink under OS X. + # "readlink" doesn't do the same thing as under Linux, so the script + # must not be a symlink under OS X. case "$OSTYPE" in darwin*) ThisDir="$( cd -P "${BASH_SOURCE%/*}" && pwd )" @@ -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....