0.9.3 (??/??/2015):
-------------------
+- Added "@/boot" to default also_scan_dirs setting. This makes kernels
+ show up on Btrfs volumes under Ubuntu (and perhaps others), at least when
+ the Btrfs driver is loaded.
+
- Added new System Integrity Protection (SIP) rotation feature for Macs
running OS X 10.11 or later. This feature is disabled by default, except
on CD-R and USB flash drive images, on which it's enabled. To enable it,
-eltorito-alt-boot -efi-boot refind-bin-$Version.img \
-no-emul-boot ./
-# Below is like above, but also creates an El Torito entry for BIOS
-# booting. That's useless, but in case something flakes out without
-# it, I'll preserve this version for a while....
-#mkisofs -A "Bootable rEFInd" -V "rEFInd $Version" -volset "rEFInd $Version" \
-# -J -r -v -x ./lost+found -o ../../refind-cd-$Version.iso \
-# -b refind-bin-$Version.img -c boot.cat -no-emul-boot -boot-load-size 4 \
-# -eltorito-alt-boot -efi-boot refind-bin-$Version.img \
-# -no-emul-boot ./
-
# Create a bootable USB flash drive image, using the FAT filesystem
# created above and a stored partition table image (plus some empty
# sectors)....
#
-# Note: Seems to work on only a few systems, so I'm not distributing
-# the resulting images yet....
-#
rm -f ../../refind-flashdrive-$Version.*
let FatSize=`du -s refind-bin-$Version.img | cut -f 1`
let FatSize=($FatSize)+2048
# Revision history:
#
-# 0.9.3 -- Renamed from mkrlconf.sh to mkrlconf
-# 0.9.0 -- 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
+# 0.10.0 -- Renamed from mkrlconf.sh to mkrlconf; changed to get $DefaultOptions
+# from /proc/cmdline rather than from GRUB
+# 0.9.0 -- 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 version numbers match those of the rEFInd package
# with which they first appeared.
RLConfFile="/boot/refind_linux.conf"
if [[ `uname -s` != "Linux" ]] ; then
- echo "This script is intended to be run from Linux. Aborting!"
- echo ""
- exit 1
+ 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....
- source /etc/default/grub
- fi
- RootFS=`df / | grep dev | cut -f 1 -d " "`
- 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 -s UUID $RootFS 2> /dev/null | grep UUID=`
- if [[ -n $Uuid ]] ; then
- RootFS=$Uuid
- fi
- fi
- 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 with minimal options\" \"ro root=$RootFS\"" >> $RLConfFile
+ RootFS=`df / | grep dev | cut -f 1 -d " "`
+ 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 -s UUID $RootFS 2> /dev/null | grep UUID=`
+ if [[ -n $Uuid ]] ; then
+ RootFS=$Uuid
+ fi
+ fi
+ DefaultOptions=`cat /proc/cmdline | cut -d ' ' -f 2- | sed 's/$/ /' | sed 's/initrd=.* //g' | sed 's/ *$//'`
+ 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
else
- echo "Existing $RLConfFile found! Not overwriting!"
- echo "To force overwriting, pass the --force option."
- echo ""
+ echo "Existing $RLConfFile found! Not overwriting!"
+ echo "To force overwriting, pass the --force option."
+ echo ""
fi
echo "or --preloader! Aborting!"
exit 1
fi
- if [[ "$KeepName" == 1 && "$OSTYPE" != "linux-gnu" ]] ; then
+ if [[ "$KeepName" == 1 && ("$OSTYPE" != "linux" && "$OSTYPE" != "linux-gnu") ]] ; then
echo "The --keepname option is valid only under Linux! Aborting!"
exit 1
fi
- if [[ "$KeepName" == 1 && "$TargetDir" != "/EFI/BOOT" ]] ; then
+ if [[ "$KeepName" == 1 && "$TargetDir" == "/EFI/BOOT" ]] ; then
echo "The --keepname option is incompatible with --usedefault! Aborting!"
exit 1
fi
# Determine (or guess) the filesystem used on the Linux /boot filesystem.
# Store the result in the BootFS global variable.
SetBootFS() {
- local Blkid
-
BootFS=""
case "$OSTYPE" in
- linux-gnu)
- if command -v blkid 2>/dev/null; then
- BootPart=`df /boot | grep dev | cut -f 1 -d " "`
+ linux*)
+ if command -v blkid &>/dev/null; then
+ BootPart=`df $RootDir/boot | grep dev | cut -f 1 -d " "`
BootFS=`blkid -o export $BootPart 2> /dev/null | grep TYPE= | cut -f 2 -d =`
fi
;;
else
mount -t msdos "$TargetPart" "$InstallDir"
fi
- elif [[ $OSTYPE == linux-gnu ]] ; then
+ elif [[ $OSTYPE == linux* ]] ; then
mount -t vfat "$TargetPart" "$InstallDir"
fi
if [[ $? != 0 ]] ; then
echo "Existing $RLConfFile found; not overwriting."
else
echo "Creating $RLConfFile; edit it to adjust kernel options."
- if [[ -f "$RootDir/etc/default/grub" ]] ; then
- # We want the default options used by the distribution, stored here....
- source "$RootDir/etc/default/grub"
- echo "Setting default boot options based on $RootDir/etc/default/grub"
- fi
RootFS=`df "$RootDir" | grep dev | cut -f 1 -d " "`
+ echo "RootFS starts as $RootFS"
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 -s UUID "$RootFS" 2> /dev/null | grep UUID=`
if [[ -n $Uuid ]] ; then
RootFS="$Uuid"
+ echo "Uuid is $Uuid"
+ echo "Adjusting RootFS to $RootFS"
+ fi
+ fi
+ if [[ $RootDir == "/" ]] ; then
+ DefaultOptions=`cat /proc/cmdline | cut -d ' ' -f 2- | sed 's/$/ /' | sed 's/initrd=.* //g' | sed 's/ *$//'`
+ else
+ if [[ -f "$RootDir/etc/default/grub" ]] ; then
+ # We want the default options used by the distribution, stored here....
+ source "$RootDir/etc/default/grub"
+ echo "Setting default boot options based on $RootDir/etc/default/grub"
fi
+ DefaultOptions="ro root=$RootFS $GRUB_CMDLINE_LINUX $GRUB_CMDLINE_LINUX_DEFAULT"
fi
- 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 with minimal options\" \"ro root=$RootFS\"" >> $RLConfFile
+ 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
fi
}
fi
InstallOnOSX $1
;;
- linux-gnu)
+ linux*)
InstallOnLinux
;;
*)
// Get CSR (Apple's System Integrity Protection [SIP], or "rootless") status
// information.
EFI_STATUS GetCsrStatus(UINT32 *CsrStatus) {
- UINT32 *ReturnValue;
+ UINT32 *ReturnValue = NULL;
UINTN CsrLength;
EFI_GUID CsrGuid = CSR_GUID;
EFI_STATUS Status = EFI_INVALID_PARAMETER;
} else {
Status = EFI_BAD_BUFFER_SIZE;
}
- }
- MyFreePool(ReturnValue);
- }
+ MyFreePool(ReturnValue);
+ } // if (Status == EFI_SUCCESS)
+ } // if (CsrStatus)
return Status;
} // INTN GetCsrStatus()
// Note: Below is combined with MOK_NAMES to make default
#define DONT_SCAN_FILES L"shim.efi,shim-fedora.efi,shimx64.efi,PreLoader.efi,TextMode.efi,ebounce.efi,GraphicsConsole.efi,bootmgr.efi"
#define DONT_SCAN_VOLUMES L"LRS_ESP"
-#define ALSO_SCAN_DIRS L"boot"
+#define ALSO_SCAN_DIRS L"boot,@/boot"
EFI_STATUS ReadFile(IN EFI_FILE_HANDLE BaseDir, CHAR16 *FileName, REFIT_FILE *File, UINTN *size);
VOID ReadConfig(CHAR16 *FileName);
if (AboutMenu.EntryCount == 0) {
AboutMenu.TitleImage = BuiltinIcon(BUILTIN_ICON_FUNC_ABOUT);
- AddMenuInfoLine(&AboutMenu, L"rEFInd Version 0.9.2.7");
+ AddMenuInfoLine(&AboutMenu, L"rEFInd Version 0.9.2.8");
AddMenuInfoLine(&AboutMenu, L"");
AddMenuInfoLine(&AboutMenu, L"Copyright (c) 2006-2010 Christoph Pfisterer");
AddMenuInfoLine(&AboutMenu, L"Copyright (c) 2012-2015 Roderick W. Smith");