X-Git-Url: https://code.delx.au/refind/blobdiff_plain/e1ec473588a10ba284d916f49622fdbcb5d4f1b1..e623f368c6089696dc99c507834a668fee159fed:/install.sh diff --git a/install.sh b/install.sh index 91e66a4..1e66871 100755 --- a/install.sh +++ b/install.sh @@ -29,6 +29,9 @@ # # Revision history: # +# 0.6.6 -- Bug fix: Upgrade drivers when installed to EFI/BOOT. Also enable +# copying shim.efi and MokManager.efi over themselves. +# 0.6.4 -- Copies ext2 driver rather than ext4 driver for ext2/3fs # 0.6.3 -- Support for detecting rEFInd in EFI/BOOT and EFI/Microsoft/Boot # directories & for installing to EFI/BOOT in BIOS mode # 0.6.2-1 -- Added --yes option & tweaked key-copying for use with RPM install script @@ -182,12 +185,12 @@ CheckForFiles() { # Helper for CopyRefindFiles; copies shim files (including MokManager, if it's # available) to target. CopyShimFiles() { - cp $ShimSource $InstallDir/$TargetDir/$TargetShim + cp -fb $ShimSource $InstallDir/$TargetDir/$TargetShim if [[ $? != 0 ]] ; then Problems=1 fi if [[ -f $MokManagerSource ]] ; then - cp $MokManagerSource $InstallDir/$TargetDir/ + cp -fb $MokManagerSource $InstallDir/$TargetDir/ fi if [[ $? != 0 ]] ; then Problems=1 @@ -219,7 +222,11 @@ CopyDrivers() { BootFS=`blkid -o export $BootPart 2> /dev/null | grep TYPE= | cut -f 2 -d =` DriverType="" case $BootFS in - ext2 | ext3 | ext4) DriverType="ext4" + ext2 | ext3) DriverType="ext2" + # Could use ext4, but that can create unwanted entries from symbolic + # links in / to /boot/vmlinuz if a separate /boot partition is used. + ;; + ext4) DriverType="ext4" ;; reiserfs) DriverType="reiserfs" ;; @@ -256,6 +263,12 @@ CopyRefindFiles() { if [[ $InstallDrivers == "all" ]] ; then cp -r $RefindDir/drivers_* $InstallDir/$TargetDir/ 2> /dev/null cp -r $ThisDir/drivers_* $InstallDir/$TargetDir/ 2> /dev/null + elif [[ $Upgrade == 1 ]] ; then + if [[ $Platform == 'EFI64' ]] ; then + CopyDrivers x64 + else + CopyDrivers ia32 + fi fi Refind="" CopyKeys @@ -589,7 +602,7 @@ FindLinuxESP() { exit 1 fi echo "ESP was found at $InstallDir using $EspFilesystem" -} # MountLinuxESP +} # FindLinuxESP # Uses efibootmgr to add an entry for rEFInd to the EFI's NVRAM. # If this fails, sets Problems=1 @@ -602,7 +615,7 @@ AddBootEntry() { EntryFilename=$TargetDir/$Refind EfiEntryFilename=`echo ${EntryFilename//\//\\\}` EfiEntryFilename2=`echo ${EfiEntryFilename} | sed s/\\\\\\\\/\\\\\\\\\\\\\\\\/g` - ExistingEntry=`$Efibootmgr -v | grep $EfiEntryFilename2` + ExistingEntry=`$Efibootmgr -v | grep -i $EfiEntryFilename2` if [[ $ExistingEntry ]] ; then ExistingEntryBootNum=`echo $ExistingEntry | cut -c 5-8` @@ -628,7 +641,7 @@ AddBootEntry() { fi fi - else + else # efibootmgr not found EfibootmgrProblems=1 Problems=1 fi