]> code.delx.au - refind/blobdiff - mkrlconf.sh
Added OS check to mkrlconf.sh. Bypass checks for BIOS-mode boot
[refind] / mkrlconf.sh
index ae9eff6b1f100c9dbdb1364f23ac7c06a1345891..9028ef048a6f88bfb9af669cc176c2be9fe31d76 100755 (executable)
@@ -18,6 +18,8 @@
 
 # Revision history:
 #
+#  0.8.8 -- Added check for OS type, to keep from running pointlessly on OS X
+#  0.7.7 -- Fixed bug that caused stray PARTUUID= and line breaks in generated file
 #  0.5.1 -- Initial release
 #
 # Note: mkrlconf.sh version numbers match those of the rEFInd package
 
 RLConfFile="/boot/refind_linux.conf"
 
+if [[ `uname -s` != "Linux" ]] ; then
+   echo "This script is intended to be run from Linux. Aborting!"
+   echo ""
+   exit 1
+fi
+
 if [[ ! -f $RLConfFile || $1 == "--force" ]] ; then
    if [[ -f /etc/default/grub ]] ; then
       # We want the default options used by the distribution, stored here....
@@ -34,7 +42,7 @@ if [[ ! -f $RLConfFile || $1 == "--force" ]] ; then
    StartOfDevname=`echo $RootFS | cut -b 1-7`
    if [[ $StartOfDevname == "/dev/sd" || $StartOfDevName == "/dev/hd" ]] ; then
       # Identify root filesystem by UUID rather than by device node, if possible
-      Uuid=`blkid -o export $RootFS 2> /dev/null | grep UUID=`
+      Uuid=`blkid -o export -s UUID $RootFS 2> /dev/null | grep UUID=`
       if [[ -n $Uuid ]] ; then
          RootFS=$Uuid
       fi
@@ -42,7 +50,6 @@ if [[ ! -f $RLConfFile || $1 == "--force" ]] ; then
    DefaultOptions="$GRUB_CMDLINE_LINUX $GRUB_CMDLINE_LINUX_DEFAULT"
    echo "\"Boot with standard options\"        \"ro root=$RootFS $DefaultOptions \"" > $RLConfFile
    echo "\"Boot to single-user mode\"          \"ro root=$RootFS $DefaultOptions single\"" >> $RLConfFile
-   echo "\"Boot without EFI storage paranoia\" \"ro root=$RootFS $DefaultOptions efi_no_storage_paranoia\"" >> $RLConfFile
    echo "\"Boot with minimal options\"         \"ro root=$RootFS\"" >> $RLConfFile
 else
    echo "Existing $RLConfFile found! Not overwriting!"