summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'sys-boot/refind-bin/refind-bin-0.8.5.ebuild')
-rw-r--r--sys-boot/refind-bin/refind-bin-0.8.5.ebuild72
1 files changed, 72 insertions, 0 deletions
diff --git a/sys-boot/refind-bin/refind-bin-0.8.5.ebuild b/sys-boot/refind-bin/refind-bin-0.8.5.ebuild
new file mode 100644
index 0000000..7767d6a
--- /dev/null
+++ b/sys-boot/refind-bin/refind-bin-0.8.5.ebuild
@@ -0,0 +1,72 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+EAPI=4
+
+inherit eutils
+
+DESCRIPTION="rEFInd Extensible Firmware Interface boot manager binary install"
+HOMEPAGE="http://www.rodsbooks.com/refind/index.html"
+SRC_URI="mirror://sourceforge/refind/${PV}/${P}.zip"
+#MERGE_TYPE="binary"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~amd64 ~ia64 ~x86"
+IUSE=""
+
+RDEPEND="sys-boot/efibootmgr"
+DEPEND=""
+
+PROVIDE="virtual/bootloader"
+
+src_install() {
+ einfo "Installing rEFInd on Linux"
+ # FindLinuxESP
+ EspLine=$(df /boot/efi | grep boot)
+ InstallPart=$(echo $EspLine | cut -d " " -f 6)
+ EspFilesystem=$(grep $InstallPart /etc/mtab | cut -d " " -f 3)
+ if [[ $EspFilesystem != 'vfat' ]] ; then
+ eerror "/boot/efi doesn't seem to be on a VFAT filesystem. The ESP must be mounted"
+ eerror "at /boot or /boot/efi and it must be VFAT! Aborting!"
+ die "Unable to find a VFAT file system at /boot or /boot/efi."
+ fi
+ einfo "ESP was found at $InstallPart using $EspFilesystem"
+
+ # InstallOnLinux
+ CpuType=$(uname -m)
+ if [[ $CpuType == 'x86_64' ]] ; then
+ Platform="EFI64"
+ elif [[ $CpuType == 'i386' || $CpuType == 'i486' || $CpuType == 'i586' || $CpuType == 'i686' ]] ; then
+ Platform="EFI32"
+ ewarn "CAUTION: This Linux installation uses a 32-bit kernel. 32-bit EFI-based"
+ ewarn "computers are VERY RARE. If you've installed a 32-bit version of Linux"
+ ewarn "on a 64-bit computer, you should manually install the 64-bit version of"
+ ewarn "rEFInd. Installation will now proceed presuming a 32-bit EFI."
+ else
+ die "Unknown CPU type '$CpuType'; aborting!"
+ fi
+
+ # CopyRefindFiles
+ RefindDir="${S}/refind"
+ TargetDir="/EFI/refind"
+ exeinto ${InstallPart}/${TargetDir}
+ if [[ $Platform == 'EFI32' ]] ; then
+ doexe $RefindDir/refind_ia32.efi
+ Refind="refind_ia32.efi"
+ elif [[ $Platform == 'EFI64' ]] ; then
+ doexe $RefindDir/refind_x64.efi
+ Refind="refind_x64.efi"
+ else
+ die "Unknown platform! Aborting!"
+ fi
+ einfo "Copied rEFInd binary file $Refind"
+
+ insinto ${InstallPart}/${TargetDir}
+ doins -r $RefindDir/icons
+ einfo "Copied rEFInd icons directory"
+
+ doins $RefindDir/refind.conf-sample
+ einfo "Copied sample rEFInd configuration file"
+}