summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'sys-boot')
-rw-r--r--sys-boot/aboot/Manifest3
-rw-r--r--sys-boot/aboot/aboot-1.0_pre20040408-r3.ebuild87
-rw-r--r--sys-boot/aboot/files/aboot-define_stat_only_in_userspace.patch35
-rw-r--r--sys-boot/aboot/files/aboot-gcc-3.4.patch31
-rw-r--r--sys-boot/aboot/files/aboot-pt_note.patch308
-rw-r--r--sys-boot/aboot/files/aboot.conf10
-rw-r--r--sys-boot/aboot/metadata.xml5
-rw-r--r--sys-boot/arcload/Manifest2
-rw-r--r--sys-boot/arcload/arcload-0.50-r1.ebuild84
-rw-r--r--sys-boot/arcload/arcload-0.50-r3.ebuild129
-rw-r--r--sys-boot/arcload/files/arcload.865
-rw-r--r--sys-boot/arcload/metadata.xml9
-rw-r--r--sys-boot/bootcreator/Manifest1
-rw-r--r--sys-boot/bootcreator/bootcreator-1.1.ebuild36
-rw-r--r--sys-boot/bootcreator/bootcreator-1.2.ebuild36
-rw-r--r--sys-boot/bootcreator/metadata.xml5
-rw-r--r--sys-boot/colo/Manifest1
-rw-r--r--sys-boot/colo/colo-1.22.ebuild118
-rw-r--r--sys-boot/colo/files/default.colo25
-rw-r--r--sys-boot/colo/files/menu.colo61
-rw-r--r--sys-boot/colo/files/simple.colo20
-rw-r--r--sys-boot/colo/metadata.xml14
-rw-r--r--sys-boot/cromwell-bin/Manifest2
-rw-r--r--sys-boot/cromwell-bin/cromwell-bin-2.31.ebuild23
-rw-r--r--sys-boot/cromwell-bin/cromwell-bin-2.40.ebuild23
-rw-r--r--sys-boot/cromwell-bin/metadata.xml9
-rw-r--r--sys-boot/cromwell/Manifest2
-rw-r--r--sys-boot/cromwell/cromwell-2.40-r3.ebuild38
-rw-r--r--sys-boot/cromwell/files/cromwell-2.40-gcc-4.6.patch39
-rw-r--r--sys-boot/cromwell/metadata.xml6
-rw-r--r--sys-boot/dvhtool/Manifest1
-rw-r--r--sys-boot/dvhtool/dvhtool-1.0.1-r2.ebuild44
-rw-r--r--sys-boot/dvhtool/files/dvhtool-1.0.1-add-raid-lvm-parttypes.patch24
-rw-r--r--sys-boot/dvhtool/files/dvhtool-1.0.1-debian-warn_type_guess.diff12
-rw-r--r--sys-boot/dvhtool/files/dvhtool-1.0.1-debian-xopen_source.diff11
-rw-r--r--sys-boot/dvhtool/files/dvhtool-1.0.1-debian.diff135
-rw-r--r--sys-boot/dvhtool/metadata.xml5
-rw-r--r--sys-boot/efibootmgr/Manifest4
-rw-r--r--sys-boot/efibootmgr/efibootmgr-0.11.0.ebuild36
-rw-r--r--sys-boot/efibootmgr/efibootmgr-0.12.ebuild36
-rw-r--r--sys-boot/efibootmgr/efibootmgr-0.5.4-r1.ebuild44
-rw-r--r--sys-boot/efibootmgr/efibootmgr-0.5.4.ebuild39
-rw-r--r--sys-boot/efibootmgr/efibootmgr-0.6.0.ebuild41
-rw-r--r--sys-boot/efibootmgr/files/efibootmgr-error-reporting.patch40
-rw-r--r--sys-boot/efibootmgr/metadata.xml19
-rw-r--r--sys-boot/elilo/Manifest6
-rw-r--r--sys-boot/elilo/elilo-3.10.ebuild71
-rw-r--r--sys-boot/elilo/elilo-3.12.ebuild71
-rw-r--r--sys-boot/elilo/elilo-3.6_p20060314.ebuild87
-rw-r--r--sys-boot/elilo/files/elilo.conf.sample9
-rw-r--r--sys-boot/elilo/files/elilo.sh-chkspace.patch15
-rw-r--r--sys-boot/elilo/files/elilo.sh-vmm.patch43
-rw-r--r--sys-boot/elilo/metadata.xml8
-rw-r--r--sys-boot/getdvhoff/Manifest1
-rw-r--r--sys-boot/getdvhoff/getdvhoff-0.12-r1.ebuild37
-rw-r--r--sys-boot/getdvhoff/metadata.xml14
-rw-r--r--sys-boot/gnu-efi/Manifest8
-rw-r--r--sys-boot/gnu-efi/files/gnu-efi-3.0a-lds-redhat.patch42
-rw-r--r--sys-boot/gnu-efi/files/gnu-efi-3.0a-lds.patch55
-rw-r--r--sys-boot/gnu-efi/gnu-efi-3.0.2.ebuild49
-rw-r--r--sys-boot/gnu-efi/gnu-efi-3.0a-r1.ebuild37
-rw-r--r--sys-boot/gnu-efi/gnu-efi-3.0g.ebuild36
-rw-r--r--sys-boot/gnu-efi/gnu-efi-3.0i.ebuild42
-rw-r--r--sys-boot/gnu-efi/gnu-efi-3.0s.ebuild60
-rw-r--r--sys-boot/gnu-efi/gnu-efi-3.0u.ebuild58
-rw-r--r--sys-boot/gnu-efi/metadata.xml8
-rw-r--r--sys-boot/grub-static/Manifest6
-rw-r--r--sys-boot/grub-static/grub-static-0.96-r1.ebuild18
-rw-r--r--sys-boot/grub-static/grub-static-0.97-r10.ebuild176
-rw-r--r--sys-boot/grub-static/grub-static-0.97-r12.ebuild180
-rw-r--r--sys-boot/grub-static/grub-static-0.97-r6.ebuild136
-rw-r--r--sys-boot/grub-static/grub-static-0.97-r9.ebuild172
-rw-r--r--sys-boot/grub-static/grub-static-0.97.ebuild76
-rw-r--r--sys-boot/grub-static/metadata.xml5
-rw-r--r--sys-boot/grub/Manifest12
-rw-r--r--sys-boot/grub/files/grub-2.00-freetype-2.5.1.patch24
-rw-r--r--sys-boot/grub/files/grub-2.02_beta2-libzfs.patch19
-rw-r--r--sys-boot/grub/files/grub.conf.gentoo16
-rw-r--r--sys-boot/grub/files/grub.default-246
-rw-r--r--sys-boot/grub/files/grub.default-374
-rw-r--r--sys-boot/grub/grub-0.97-r14.ebuild289
-rw-r--r--sys-boot/grub/grub-2.00_p5107-r2.ebuild306
-rw-r--r--sys-boot/grub/grub-2.02_beta2-r3.ebuild313
-rw-r--r--sys-boot/grub/grub-2.02_beta2-r6.ebuild319
-rw-r--r--sys-boot/grub/grub-2.02_beta2-r7.ebuild314
-rw-r--r--sys-boot/grub/grub-9999-r1.ebuild309
-rw-r--r--sys-boot/grub/metadata.xml36
-rw-r--r--sys-boot/gummiboot/Manifest1
-rw-r--r--sys-boot/gummiboot/gummiboot-45.ebuild33
-rw-r--r--sys-boot/gummiboot/gummiboot-9999.ebuild33
-rw-r--r--sys-boot/gummiboot/metadata.xml8
-rw-r--r--sys-boot/lilo/Manifest6
-rw-r--r--sys-boot/lilo/files/lilo-22.8-correct-usage-info.patch12
-rw-r--r--sys-boot/lilo/files/lilo-22.8-makefile.patch42
-rw-r--r--sys-boot/lilo/files/lilo-22.8-nodevmapper.patch13
-rw-r--r--sys-boot/lilo/files/lilo-22.8-novga.patch11
-rw-r--r--sys-boot/lilo/files/lilo-23.0-make.patch103
-rw-r--r--sys-boot/lilo/files/lilo-24.0-novga.patch12
-rw-r--r--sys-boot/lilo/files/lilo-24.1-novga.patch12
-rw-r--r--sys-boot/lilo/files/lilo.conf73
-rw-r--r--sys-boot/lilo/lilo-22.8-r2.ebuild180
-rw-r--r--sys-boot/lilo/lilo-23.2-r1.ebuild173
-rw-r--r--sys-boot/lilo/lilo-23.2-r2.ebuild181
-rw-r--r--sys-boot/lilo/lilo-24.0-r1.ebuild176
-rw-r--r--sys-boot/lilo/lilo-24.0.ebuild176
-rw-r--r--sys-boot/lilo/lilo-24.1.ebuild183
-rw-r--r--sys-boot/lilo/metadata.xml14
-rw-r--r--sys-boot/makebootfat/Manifest1
-rw-r--r--sys-boot/makebootfat/makebootfat-1.4.ebuild25
-rw-r--r--sys-boot/makebootfat/metadata.xml10
-rw-r--r--sys-boot/mbr-gpt/Manifest1
-rw-r--r--sys-boot/mbr-gpt/mbr-gpt-0.0.1.ebuild52
-rw-r--r--sys-boot/mbr-gpt/metadata.xml8
-rw-r--r--sys-boot/mbr/Manifest1
-rw-r--r--sys-boot/mbr/mbr-1.1.11.ebuild33
-rw-r--r--sys-boot/mbr/metadata.xml7
-rw-r--r--sys-boot/metadata.xml36
-rw-r--r--sys-boot/milo/Manifest6
-rw-r--r--sys-boot/milo/files/README-gentoo99
-rw-r--r--sys-boot/milo/files/linux-2.2.25-gcc3-milo.diff123
-rw-r--r--sys-boot/milo/files/milo-2.2-18-gcc3-gentoo.diff174
-rw-r--r--sys-boot/milo/files/mkserial_no.c45
-rw-r--r--sys-boot/milo/files/objstrip.c282
-rw-r--r--sys-boot/milo/metadata.xml14
-rw-r--r--sys-boot/milo/milo-2.4.18.ebuild232
-rw-r--r--sys-boot/netboot/Manifest1
-rw-r--r--sys-boot/netboot/files/netboot-0.10.2-ldflags.patch38
-rw-r--r--sys-boot/netboot/metadata.xml10
-rw-r--r--sys-boot/netboot/netboot-0.10.2.ebuild51
-rw-r--r--sys-boot/nettrom/Manifest1
-rw-r--r--sys-boot/nettrom/metadata.xml5
-rw-r--r--sys-boot/nettrom/nettrom-2.3.3.ebuild22
-rw-r--r--sys-boot/os-prober/Manifest4
-rw-r--r--sys-boot/os-prober/metadata.xml14
-rw-r--r--sys-boot/os-prober/os-prober-1.53.ebuild68
-rw-r--r--sys-boot/os-prober/os-prober-1.57-r1.ebuild73
-rw-r--r--sys-boot/os-prober/os-prober-1.62.ebuild77
-rw-r--r--sys-boot/os-prober/os-prober-1.65.ebuild79
-rw-r--r--sys-boot/palo/Manifest2
-rw-r--r--sys-boot/palo/files/99palo3
-rw-r--r--sys-boot/palo/files/palo-1.92-toolchain.patch20
-rw-r--r--sys-boot/palo/files/palo-1.95-toolchain.patch27
-rw-r--r--sys-boot/palo/files/palo.conf8
-rw-r--r--sys-boot/palo/metadata.xml8
-rw-r--r--sys-boot/palo/palo-1.92.ebuild47
-rw-r--r--sys-boot/palo/palo-1.95.ebuild44
-rw-r--r--sys-boot/palo/palo-9999.ebuild44
-rw-r--r--sys-boot/plymouth-openrc-plugin/Manifest1
-rw-r--r--sys-boot/plymouth-openrc-plugin/metadata.xml11
-rw-r--r--sys-boot/plymouth-openrc-plugin/plymouth-openrc-plugin-0.1.2.ebuild42
-rw-r--r--sys-boot/plymouth/Manifest4
-rw-r--r--sys-boot/plymouth/files/0.8.3-drm-reduce-minimum-build-requirements.patch422
-rw-r--r--sys-boot/plymouth/files/0.8.3-gentoo-fb-path.patch25
-rw-r--r--sys-boot/plymouth/files/0.8.3-image-replace-deprecated-libpng-function.patch24
-rw-r--r--sys-boot/plymouth/files/0.8.8-initrd-binaries-paths.patch32
-rw-r--r--sys-boot/plymouth/files/0.9.2-systemdsystemunitdir.patch18
-rw-r--r--sys-boot/plymouth/metadata.xml25
-rw-r--r--sys-boot/plymouth/plymouth-0.8.8-r4.ebuild90
-rw-r--r--sys-boot/plymouth/plymouth-0.8.8-r5.ebuild94
-rw-r--r--sys-boot/plymouth/plymouth-0.9.0.ebuild96
-rw-r--r--sys-boot/plymouth/plymouth-0.9.2.ebuild101
-rw-r--r--sys-boot/plymouth/plymouth-9999.ebuild97
-rw-r--r--sys-boot/psoload/Manifest1
-rw-r--r--sys-boot/psoload/metadata.xml7
-rw-r--r--sys-boot/psoload/psoload-2.0.ebuild26
-rw-r--r--sys-boot/quik/Manifest1
-rw-r--r--sys-boot/quik/files/headers.patch33
-rw-r--r--sys-boot/quik/files/md-fix.diff11
-rw-r--r--sys-boot/quik/metadata.xml5
-rw-r--r--sys-boot/quik/quik-2.1.6.ebuild44
-rw-r--r--sys-boot/raincoat/Manifest2
-rw-r--r--sys-boot/raincoat/files/raincoat-0.11-build.patch13
-rw-r--r--sys-boot/raincoat/metadata.xml6
-rw-r--r--sys-boot/raincoat/raincoat-0.11.ebuild26
-rw-r--r--sys-boot/raincoat/raincoat-0.5.ebuild26
-rw-r--r--sys-boot/raspberrypi-firmware/Manifest28
-rw-r--r--sys-boot/raspberrypi-firmware/files/raspberrypi-firmware-0_p20130711-cmdline.txt1
-rw-r--r--sys-boot/raspberrypi-firmware/files/raspberrypi-firmware-0_p20130711-config.txt81
-rw-r--r--sys-boot/raspberrypi-firmware/files/raspberrypi-firmware-0_p20130711-envd2
-rw-r--r--sys-boot/raspberrypi-firmware/metadata.xml11
-rw-r--r--sys-boot/raspberrypi-firmware/raspberrypi-firmware-0_p20130722.ebuild62
-rw-r--r--sys-boot/raspberrypi-firmware/raspberrypi-firmware-0_p20130815.ebuild62
-rw-r--r--sys-boot/raspberrypi-firmware/raspberrypi-firmware-1_pre20130801.ebuild62
-rw-r--r--sys-boot/raspberrypi-firmware/raspberrypi-firmware-1_pre20130807.ebuild62
-rw-r--r--sys-boot/raspberrypi-mkimage/files/raspberrypi-mkimage-0_p20120201-args-uncompressed.txt12
-rw-r--r--sys-boot/raspberrypi-mkimage/files/raspberrypi-mkimage-0_p20120201-boot-uncompressed.txt17
-rw-r--r--sys-boot/raspberrypi-mkimage/files/raspberrypi-mkimage-0_p20120201-imagetool-uncompressed-python3.patch11
-rw-r--r--sys-boot/raspberrypi-mkimage/files/raspberrypi-mkimage-0_p20120201-imagetool-uncompressed.patch49
-rw-r--r--sys-boot/raspberrypi-mkimage/files/raspberrypi-mkimage-0_p20120201-imagetool-uncompressed.py45
-rw-r--r--sys-boot/raspberrypi-mkimage/metadata.xml11
-rw-r--r--sys-boot/raspberrypi-mkimage/raspberrypi-mkimage-0_p20120201.ebuild55
-rw-r--r--sys-boot/sgibootcd/Manifest1
-rw-r--r--sys-boot/sgibootcd/metadata.xml14
-rw-r--r--sys-boot/sgibootcd/sgibootcd-0.12.ebuild29
-rw-r--r--sys-boot/shlilo-lantank/Manifest1
-rw-r--r--sys-boot/shlilo-lantank/files/lilo.conf16
-rw-r--r--sys-boot/shlilo-lantank/metadata.xml5
-rw-r--r--sys-boot/shlilo-lantank/shlilo-lantank-20040408.ebuild33
-rw-r--r--sys-boot/silo/Manifest6
-rw-r--r--sys-boot/silo/files/silo-e2fsprogs-1.4.14.patch54
-rw-r--r--sys-boot/silo/metadata.xml8
-rw-r--r--sys-boot/silo/silo-1.4.14_p20100228.ebuild70
-rw-r--r--sys-boot/silo/silo-1.4.14_p20120226.ebuild70
-rw-r--r--sys-boot/silo/silo-1.4.14_p20120819.ebuild64
-rw-r--r--sys-boot/syslinux/Manifest5
-rw-r--r--sys-boot/syslinux/files/syslinux-3.86-nopie.patch12
-rw-r--r--sys-boot/syslinux/files/syslinux-4.05-nopie.patch12
-rw-r--r--sys-boot/syslinux/files/syslinux-6.02-add-fno-stack-protector.patch20
-rw-r--r--sys-boot/syslinux/metadata.xml9
-rw-r--r--sys-boot/syslinux/syslinux-3.86.ebuild56
-rw-r--r--sys-boot/syslinux/syslinux-4.07.ebuild69
-rw-r--r--sys-boot/syslinux/syslinux-5.10.ebuild83
-rw-r--r--sys-boot/syslinux/syslinux-6.02.ebuild93
-rw-r--r--sys-boot/syslinux/syslinux-6.03.ebuild100
-rw-r--r--sys-boot/tboot/Manifest1
-rw-r--r--sys-boot/tboot/files/tboot-1.8.2-disable-pcid.patch26
-rw-r--r--sys-boot/tboot/files/tboot-1.8.2-genkernel_arch.patch57
-rw-r--r--sys-boot/tboot/files/tboot-1.8.2-stack-check-no.patch11
-rw-r--r--sys-boot/tboot/metadata.xml14
-rw-r--r--sys-boot/tboot/tboot-1.8.3.ebuild72
-rw-r--r--sys-boot/unetbootin/Manifest2
-rw-r--r--sys-boot/unetbootin/files/unetbootin-581-desktop.patch24
-rw-r--r--sys-boot/unetbootin/metadata.xml11
-rw-r--r--sys-boot/unetbootin/unetbootin-608.ebuild89
-rw-r--r--sys-boot/unetbootin/unetbootin-619.ebuild89
-rw-r--r--sys-boot/vboot-utils/Manifest2
-rw-r--r--sys-boot/vboot-utils/files/vboot-utils-42_p20150219-cgpt-static.patch36
-rw-r--r--sys-boot/vboot-utils/metadata.xml15
-rw-r--r--sys-boot/vboot-utils/vboot-utils-1.0_p20130222.ebuild75
-rw-r--r--sys-boot/vboot-utils/vboot-utils-42_p20150219.ebuild82
-rw-r--r--sys-boot/winusb/Manifest1
-rw-r--r--sys-boot/winusb/metadata.xml10
-rw-r--r--sys-boot/winusb/winusb-1.0.11.ebuild41
-rw-r--r--sys-boot/yaboot-static/Manifest3
-rw-r--r--sys-boot/yaboot-static/files/new-ofpath-devspec.patch30
-rw-r--r--sys-boot/yaboot-static/files/sysfs-ofpath.patch105
-rw-r--r--sys-boot/yaboot-static/metadata.xml5
-rw-r--r--sys-boot/yaboot-static/yaboot-static-1.3.14-r1.ebuild44
-rw-r--r--sys-boot/yaboot-static/yaboot-static-1.3.16-r1.ebuild38
-rw-r--r--sys-boot/yaboot-static/yaboot-static-1.3.17-r1.ebuild42
-rw-r--r--sys-boot/yaboot/Manifest3
-rw-r--r--sys-boot/yaboot/files/chrpfix.patch23
-rwxr-xr-xsys-boot/yaboot/files/new-ofpath143
-rw-r--r--sys-boot/yaboot/files/new-ofpath-devspec.patch28
-rw-r--r--sys-boot/yaboot/files/sysfs-ofpath.patch105
-rw-r--r--sys-boot/yaboot/files/yaboot-1.3.16-memalign.patch41
-rw-r--r--sys-boot/yaboot/files/yaboot-1.3.17-nopiessp-gcc4.patch38
-rw-r--r--sys-boot/yaboot/files/yaboot-nopiessp-gcc4.patch38
-rw-r--r--sys-boot/yaboot/files/yaboot-stubfuncs.patch231
-rw-r--r--sys-boot/yaboot/files/yabootconfig-1.3.13.patch42
-rw-r--r--sys-boot/yaboot/metadata.xml6
-rw-r--r--sys-boot/yaboot/yaboot-1.3.14-r2.ebuild48
-rw-r--r--sys-boot/yaboot/yaboot-1.3.16.ebuild57
-rw-r--r--sys-boot/yaboot/yaboot-1.3.17-r2.ebuild60
254 files changed, 13030 insertions, 0 deletions
diff --git a/sys-boot/aboot/Manifest b/sys-boot/aboot/Manifest
new file mode 100644
index 000000000000..556cf2ca60a0
--- /dev/null
+++ b/sys-boot/aboot/Manifest
@@ -0,0 +1,3 @@
+DIST aboot-1.0_pre20040408.tar.bz2 115062 RMD160 7ba6619e6cee1d570b5df806a1dbd23b2918303b SHA1 7275dd8435ba4c36aa37e77eebea8b561751d4d4 SHA256 a8ae8f2bf549c1cc79ea66a0a11c8db5c0257ce0d94b97418eb1c658723b12d2
+DIST aboot_gentoo.diff.bz2 9527 RMD160 7e70f37a20f2de262ae8136d65c59c384ba700b0 SHA1 534dc10c6d720a06a3f79b0533e3e2624f8a980a SHA256 6b141b7c90560d07ad740cfb8660a26935acfa96376e73439271d1fa9c6d0730
+DIST gentoo-headers-base-2.6.22.tar.bz2 4700338 RMD160 0742adecc4cf093a2df13c61c3d11e7566f08a9d SHA1 15d4b0508dd871032fe46e15074297f956c768e6 SHA256 da57d0d8d12a59b05f0d3851e6d2f67c413baece046f4ec03831aa70df88710a
diff --git a/sys-boot/aboot/aboot-1.0_pre20040408-r3.ebuild b/sys-boot/aboot/aboot-1.0_pre20040408-r3.ebuild
new file mode 100644
index 000000000000..e921eda8361d
--- /dev/null
+++ b/sys-boot/aboot/aboot-1.0_pre20040408-r3.ebuild
@@ -0,0 +1,87 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+inherit eutils
+
+KERN_VER="2.6.22"
+
+DESCRIPTION="Alpha Linux boot loader for SRM"
+HOMEPAGE="http://aboot.sourceforge.net/"
+SRC_URI="http://aboot.sourceforge.net/tarballs/${P}.tar.bz2
+ mirror://gentoo/gentoo-headers-base-${KERN_VER}.tar.bz2
+ mirror://gentoo/${PN}_gentoo.diff.bz2
+ http://dev.gentoo.org/~armin76/dist/${PN}_gentoo.diff.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="-* alpha"
+IUSE=""
+
+DEPEND=""
+RDEPEND=""
+
+src_unpack() {
+ unpack ${A}
+ # setup local copies of kernel headers since we rely so
+ # heavily on linux internals.
+ mv gentoo-headers-base-${KERN_VER}/include/{linux,asm-generic,asm-alpha} "${S}"/include/ || die
+ cd "${S}"/include
+ ln -s asm-alpha asm || die
+ touch linux/config.h || die
+ cd "${S}"
+ epatch "${FILESDIR}/aboot-gcc-3.4.patch"
+ epatch "${FILESDIR}/aboot-pt_note.patch"
+ # Bug 364697
+ epatch "${FILESDIR}/aboot-define_stat_only_in_userspace.patch"
+
+ # Modified patch from Debian to add netboot support
+ epatch "${WORKDIR}"/aboot_gentoo.diff
+}
+
+src_compile() {
+ # too many problems with parallel building
+ emake -j1 || die "emake failed"
+}
+
+src_install() {
+ dodir /boot /sbin /usr/share/man/man{1,5,8}
+ make \
+ root="${D}" \
+ bindir="${D}"/sbin \
+ bootdir="${D}"/boot \
+ mandir="${D}"/usr/share/man \
+ install
+
+ insinto /boot
+ doins net_aboot.nh
+ dobin netabootwrap
+ dodoc ChangeLog INSTALL README TODO aboot.conf
+
+ insinto /etc
+ newins "${FILESDIR}"/aboot.conf aboot.conf.example
+
+}
+
+pkg_postinst() {
+ einfo "To make aboot install a new bootloader on your harddisk follow"
+ einfo "these steps:"
+ einfo ""
+ einfo " - edit the file /etc/aboot.conf"
+ einfo " - cd /boot"
+ einfo " - swriteboot -c2 /dev/sda bootlx"
+ einfo " This will install a new bootsector on /dev/sda and aboot will"
+ einfo " use the second partition on this device to lookup kernel and "
+ einfo " initrd (as described in the aboot.conf file)"
+ einfo ""
+ einfo "IMPORTANT :"
+ einfo ""
+ einfo "The partition table of your boot device has to contain "
+ einfo "a BSD-DISKLABEL and the first 12 megabytes of your boot device"
+ einfo "must not be part of a partition as aboot will write its bootloader"
+ einfo "in there and not as with most x86 bootloaders into the "
+ einfo "master boot sector. If your partition table does not reflect this"
+ einfo "you are going to destroy your installation !"
+ einfo "Also note that aboot currently only supports ext2/3 partitions"
+ einfo "to boot from."
+}
diff --git a/sys-boot/aboot/files/aboot-define_stat_only_in_userspace.patch b/sys-boot/aboot/files/aboot-define_stat_only_in_userspace.patch
new file mode 100644
index 000000000000..5b0b5e0efedf
--- /dev/null
+++ b/sys-boot/aboot/files/aboot-define_stat_only_in_userspace.patch
@@ -0,0 +1,35 @@
+# Patch by Sergei Trofimovich
+# http://bugs.gentoo.org/364697
+
+diff --git a/Makefile b/Makefile
+index bbe3b60..b4245af 100644
+--- a/Makefile
++++ b/Makefile
+@@ -138,10 +138,10 @@ distclean: clean
+ find . -name \*~ | xargs rm -f
+
+ lib/%:
+- make -C lib $* CPPFLAGS="$(CPPFLAGS)" TESTING="$(TESTING)"
++ make -C lib $* CPPFLAGS="$(CPPFLAGS) -D__KERNEL__" TESTING="$(TESTING)"
+
+ tools/%:
+- make -C tools $* CPPFLAGS="$(CPPFLAGS)"
++ make -C tools $* CPPFLAGS="$(CPPFLAGS) -U__KERNEL__"
+
+ sdisklabel/%:
+ make -C sdisklabel $* CPPFLAGS="$(CPPFLAGS)"
+diff --git a/include/isolib.h b/include/isolib.h
+index 392327a..0ef6e2a 100644
+--- a/include/isolib.h
++++ b/include/isolib.h
+@@ -7,7 +7,10 @@
+ # define fd_set kernel_fd_set
+ #endif
+
++#ifdef __KERNEL__
++/* userspace stuff has it's own struct stat */
+ #include <asm/stat.h>
++#endif
+
+ extern int iso_read_super (void * data, int quiet);
+ extern int iso_open (const char * filename);
diff --git a/sys-boot/aboot/files/aboot-gcc-3.4.patch b/sys-boot/aboot/files/aboot-gcc-3.4.patch
new file mode 100644
index 000000000000..24da18ce8190
--- /dev/null
+++ b/sys-boot/aboot/files/aboot-gcc-3.4.patch
@@ -0,0 +1,31 @@
+--- aboot-1.0_pre20040408/cons.c
++++ aboot-1.0_pre20040408/cons.c
+@@ -20,7 +20,6 @@
+ #endif
+
+ long cons_dev; /* console device */
+-extern long int dispatch(); /* Need the full 64 bit return here...*/
+
+ long
+ cons_puts(const char *str, long len)
+--- aboot-1.0_pre20040408/fs/ext2.c
++++ aboot-1.0_pre20040408/fs/ext2.c
+@@ -6,6 +6,7 @@
+ * This file has been ported from the DEC 32-bit Linux version
+ * by David Mosberger (davidm@cs.arizona.edu).
+ */
++#include <string.h>
+ #include <linux/stat.h>
+ #include <linux/types.h>
+ #include <linux/version.h>
+--- aboot-1.0_pre20040408/include/cons.h
++++ aboot-1.0_pre20040408/include/cons.h
+@@ -3,7 +3,7 @@
+
+ extern long cons_dev; /* console device */
+
+-extern long dispatch(long proc, ...);
++extern long int dispatch(long proc, ...);
+
+ #ifdef TESTING
+ #define STRINGIFY(sym) #sym
diff --git a/sys-boot/aboot/files/aboot-pt_note.patch b/sys-boot/aboot/files/aboot-pt_note.patch
new file mode 100644
index 000000000000..d28527ad5b0c
--- /dev/null
+++ b/sys-boot/aboot/files/aboot-pt_note.patch
@@ -0,0 +1,308 @@
+Recent build changes have added a PT_NOTE entry to the kernel's
+ELF header. A perfectly valid change, but Alpha's aboot loader
+is none too bright about examining these headers.
+
+The following patch to aboot-1.0_pre20040408.tar.bz2 makes it
+so that only PT_LOAD entries are considered for loading, as well
+as several other changes required to get the damned thing to
+build again.
+
+--- aboot-1.0_pre20040408/Makefile
++++ aboot-1.0_pre20040408/Makefile
+@@ -32,15 +32,15 @@ export
+ #
+ LOADADDR = 20000000
+
+-ABOOT_LDFLAGS = -static -N -Taboot.lds
++ABOOT_LDFLAGS = -static -N -Taboot.lds --relax
+
+ CC = gcc
+ TOP = $(shell pwd)
+ ifeq ($(TESTING),)
+-CPPFLAGS = $(CFGDEFS) -I$(TOP)/include
+-CFLAGS = $(CPPFLAGS) -D__KERNEL__ -Os -Wall -fno-builtin -mno-fp-regs -ffixed-8
++CPPFLAGS = $(CFGDEFS) -I$(TOP)/include -I$(KSRC)/include
++CFLAGS = $(CPPFLAGS) -D__KERNEL__ -Os -Wall -fno-builtin -mno-fp-regs
+ else
+-CPPFLAGS = -DTESTING $(CFGDEFS) -I$(TOP)/include
++CPPFLAGS = -DTESTING $(CFGDEFS) -I$(TOP)/include -I$(KSRC)/include
+ CFLAGS = $(CPPFLAGS) -O -g3 -Wall -D__KERNEL__ -ffixed-8
+ endif
+ ASFLAGS = $(CPPFLAGS)
+
+--- aboot-1.0_pre20040408/aboot.c
++++ aboot-1.0_pre20040408/aboot.c
+@@ -19,7 +19,6 @@
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+-#include <linux/elf.h>
+ #include <linux/kernel.h>
+ #include <linux/version.h>
+
+@@ -27,6 +26,7 @@
+ #include <asm/hwrpb.h>
+ #include <asm/system.h>
+
++#include <elf.h>
+ #include <alloca.h>
+ #include <errno.h>
+
+@@ -37,16 +37,6 @@
+ #include "utils.h"
+ #include "string.h"
+
+-#ifndef elf_check_arch
+-# define aboot_elf_check_arch(e) 1
+-#else
+-# if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
+-# define aboot_elf_check_arch(e) elf_check_arch(e)
+-# else
+-# define aboot_elf_check_arch(e) elf_check_arch(e->e_machine)
+-# endif
+-#endif
+-
+ struct bootfs * bfs = 0; /* filesystem to boot from */
+ char * dest_addr = 0;
+ jmp_buf jump_buffer;
+@@ -83,77 +73,89 @@ static unsigned long entry_addr = START_ADDR;
+ long
+ first_block (const char *buf, long blocksize)
+ {
+- struct elfhdr *elf;
+- struct elf_phdr *phdrs;
++ Elf64_Ehdr *elf;
++ Elf64_Phdr *phdrs;
++ int i, j;
+
+- elf = (struct elfhdr *) buf;
++ elf = (Elf64_Ehdr *) buf;
+
+- if (elf->e_ident[0] == 0x7f
+- && strncmp(elf->e_ident + 1, "ELF", 3) == 0)
+- {
+- int i;
+- /* looks like an ELF binary: */
+- if (elf->e_type != ET_EXEC) {
+- printf("aboot: not an executable ELF file\n");
+- return -1;
+- }
+- if (!aboot_elf_check_arch(elf)) {
+- printf("aboot: ELF executable not for this machine\n");
+- return -1;
+- }
+- if (elf->e_phoff + elf->e_phnum * sizeof(*phdrs) > (unsigned) blocksize) {
+- printf("aboot: "
+- "ELF program headers not in first block (%ld)\n",
+- (long) elf->e_phoff);
++ if (elf->e_ident[0] != 0x7f
++ || elf->e_ident[1] != 'E'
++ || elf->e_ident[2] != 'L'
++ || elf->e_ident[3] != 'F') {
++ /* Fail silently, it might be a compressed file */
++ return -1;
++ }
++ if (elf->e_ident[EI_CLASS] != ELFCLASS64
++ || elf->e_ident[EI_DATA] != ELFDATA2LSB
++ || elf->e_machine != EM_ALPHA) {
++ printf("aboot: ELF executable not for this machine\n");
++ return -1;
++ }
++
++ /* Looks like an ELF binary. */
++ if (elf->e_type != ET_EXEC) {
++ printf("aboot: not an executable ELF file\n");
++ return -1;
++ }
++
++ if (elf->e_phoff + elf->e_phnum * sizeof(*phdrs)
++ > (unsigned) blocksize) {
++ printf("aboot: ELF program headers not in first block (%ld)\n",
++ (long) elf->e_phoff);
++ return -1;
++ }
++
++ phdrs = (struct elf_phdr *) (buf + elf->e_phoff);
++ chunks = malloc(sizeof(struct segment) * elf->e_phnum);
++ start_addr = phdrs[0].p_vaddr; /* assume they are sorted */
++ entry_addr = elf->e_entry;
++
++ for (i = j = 0; i < elf->e_phnum; ++i) {
++ int status;
++
++ if (phdrs[i].p_type != PT_LOAD)
++ continue;
++
++ chunks[j].addr = phdrs[i].p_vaddr;
++ chunks[j].offset = phdrs[i].p_offset;
++ chunks[j].size = phdrs[i].p_filesz;
++ printf("aboot: PHDR %d vaddr %#lx offset %#lx size %#lx\n",
++ i, chunks[j].addr, chunks[j].offset, chunks[j].size);
++
++ status = check_memory(chunks[j].addr, chunks[j].size);
++ if (status) {
++ printf("aboot: Can't load kernel.\n"
++ " Memory at %lx - %lx (PHDR %i) "
++ "is %s\n",
++ chunks[j].addr,
++ chunks[j].addr + chunks[j].size - 1,
++ i,
++ (status == -ENOMEM) ?
++ "Not Found" :
++ "Busy (Reserved)");
+ return -1;
+ }
+- phdrs = (struct elf_phdr *) (buf + elf->e_phoff);
+- chunks = malloc(sizeof(struct segment) * elf->e_phnum);
+- nchunks = elf->e_phnum;
+- start_addr = phdrs[0].p_vaddr; /* assume they are sorted */
+- entry_addr = elf->e_entry;
+-#ifdef DEBUG
+- printf("aboot: %d program headers, start address %#lx, entry %#lx\n",
+- nchunks, start_addr, entry_addr);
+-#endif
+- for (i = 0; i < elf->e_phnum; ++i) {
+- int status;
+-
+- chunks[i].addr = phdrs[i].p_vaddr;
+- chunks[i].offset = phdrs[i].p_offset;
+- chunks[i].size = phdrs[i].p_filesz;
+-#ifdef DEBUG
+- printf("aboot: segment %d vaddr %#lx offset %#lx size %#lx\n",
+- i, chunks[i].addr, chunks[i].offset, chunks[i].size);
+-#endif
+-
+-#ifndef TESTING
+- status = check_memory(chunks[i].addr, chunks[i].size);
+- if (status) {
++
++ if (phdrs[i].p_memsz > phdrs[i].p_filesz) {
++ if (bss_size > 0) {
+ printf("aboot: Can't load kernel.\n"
+- " Memory at %lx - %lx (chunk %i) "
+- "is %s\n",
+- chunks[i].addr,
+- chunks[i].addr + chunks[i].size - 1,
+- i,
+- (status == -ENOMEM) ?
+- "Not Found" :
+- "Busy (Reserved)");
++ " Multiple BSS segments"
++ " (PHDR %d)\n", i);
+ return -1;
+ }
+-#endif
++
++ bss_start = (char *) (phdrs[i].p_vaddr +
++ phdrs[i].p_filesz);
++ bss_size = phdrs[i].p_memsz - phdrs[i].p_filesz;
++
+ }
+- bss_start = (char *) (phdrs[elf->e_phnum - 1].p_vaddr +
+- phdrs[elf->e_phnum - 1].p_filesz);
+- bss_size = (phdrs[elf->e_phnum - 1].p_memsz -
+- phdrs[elf->e_phnum - 1].p_filesz);
+-#ifdef DEBUG
+- printf("aboot: bss at 0x%p, size %#lx\n", bss_start, bss_size);
+-#endif
+- } else {
+- /* Fail silently, it might be a compressed file */
+- return -1;
++
++ j++;
+ }
++
++ nchunks = j;
++ printf("aboot: bss at 0x%p, size %#lx\n", bss_start, bss_size);
+
+ return 0;
+ }
+
+--- aboot-1.0_pre20040408/aboot.lds
++++ aboot-1.0_pre20040408/aboot.lds
+@@ -1,22 +1,25 @@
+ OUTPUT_FORMAT("elf64-alpha")
+ ENTRY(__start)
++PHDRS { kernel PT_LOAD; }
+ SECTIONS
+ {
+ . = 0x20000000;
+- .text : { *(.text) }
++ .text : { *(.text) } :kernel
+ _etext = .;
+ PROVIDE (etext = .);
+- .rodata : { *(.rodata) }
+- .data : { *(.data) CONSTRUCTORS }
+- .got : { *(.got) }
+- .sdata : { *(.sdata) }
++ .rodata : { *(.rodata*) } :kernel
++ .data : { *(.data*) } :kernel
++ .got : { *(.got) } :kernel
++ .sdata : { *(.sdata) } :kernel
+ _edata = .;
+ PROVIDE (edata = .);
+- .sbss : { *(.sbss) *(.scommon) }
+- .bss : { *(.bss) *(COMMON) }
++ .sbss : { *(.sbss) *(.scommon) } :kernel
++ .bss : { *(.bss) *(COMMON) } :kernel
+ _end = . ;
+ PROVIDE (end = .);
+
++ /DISCARD/ : { *(.eh_frame) }
++
+ .mdebug 0 : { *(.mdebug) }
+ .note 0 : { *(.note) }
+ .comment 0 : { *(.comment) }
+
+--- aboot-1.0_pre20040408/cons.c
++++ aboot-1.0_pre20040408/cons.c
+@@ -82,7 +81,7 @@ cons_getenv(long index, char *envval, long maxlen)
+ * allocated on the stack (which guaranteed to by 8 byte
+ * aligned).
+ */
+- char * tmp = alloca(maxlen);
++ char tmp[maxlen];
+ long len;
+
+ len = dispatch(CCB_GET_ENV, index, tmp, maxlen - 1);
+
+--- aboot-1.0_pre20040408/disk.c
++++ aboot-1.0_pre20040408/disk.c
+@@ -113,7 +113,7 @@ int
+ load_uncompressed (int fd)
+ {
+ long nread, nblocks;
+- unsigned char *buf;
++ char *buf;
+ int i;
+
+ buf = malloc(bfs->blocksize);
+@@ -131,7 +131,7 @@ load_uncompressed (int fd)
+
+ for(i = 0; i < 16; i++) {
+ for (j = 0; j < 16; j++)
+- printf("%02X ", buf[j+16*i]);
++ printf("%02X ", (unsigned char) buf[j+16*i]);
+ for(j = 0; j < 16; j++) {
+ c = buf[j+16*i];
+ printf("%c", (c >= ' ') ? c : ' ');
+
+--- aboot-1.0_pre20040408/head.S
++++ aboot-1.0_pre20040408/head.S
+@@ -19,8 +19,7 @@ __start:
+ .quad 0,0,0,0,0,0,0,0
+ 1: br $27,2f
+ 2: ldgp $29,0($27)
+- lda $27,main_
+- jsr $26,($27),main_
++ bsr $26,main_ !samegp
+ call_pal PAL_halt
+ .end __start
+
+@@ -170,4 +169,4 @@ run_kernel:
+ mov $16,$27
+ mov $17,$30
+ jmp $31,($27)
+- .end run_kernel
+\ No newline at end of file
++ .end run_kernel
diff --git a/sys-boot/aboot/files/aboot.conf b/sys-boot/aboot/files/aboot.conf
new file mode 100644
index 000000000000..02114138e938
--- /dev/null
+++ b/sys-boot/aboot/files/aboot.conf
@@ -0,0 +1,10 @@
+#
+# aboot default configurations
+#
+0:3/vmlinux.gz ro root=/dev/sda2
+1:3/vmlinux.old.gz ro root=/dev/sda2
+2:3/vmlinux.new.gz ro root=/dev/sda2
+3:3/vmlinux ro root=/dev/sda2
+8:- ro root=/dev/sda2 # fs less boot of raw kernel
+9:0/- ro root=/dev/sda2 # fs less boot of (compressed) ECOFF kernel
+-
diff --git a/sys-boot/aboot/metadata.xml b/sys-boot/aboot/metadata.xml
new file mode 100644
index 000000000000..2a4ac3c58808
--- /dev/null
+++ b/sys-boot/aboot/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>alpha</herd>
+</pkgmetadata>
diff --git a/sys-boot/arcload/Manifest b/sys-boot/arcload/Manifest
new file mode 100644
index 000000000000..cf1c249dae85
--- /dev/null
+++ b/sys-boot/arcload/Manifest
@@ -0,0 +1,2 @@
+DIST arcload-0.5.tar.bz2 47690 SHA256 69cc45f7d27b30256875ccda115b6f74dd3bd894033f0f81b6f87ea1d8f7a0ac
+DIST arcload-0.50-patches-v1.tar.xz 10320 SHA256 161ef360576e3af354022e1a7398ba3af2111f81bb6b6575db5e4c3cd93ce631 SHA512 7687b08bc70a96f8db9a620976b466ff4bb70c8ed77b0c241d060feb8dcab6019d753ac3b182a74139331c9d33f27e090897a0c7c41c1663e16575fef6e21bdf WHIRLPOOL 77b2e51035dcdc9c4f5cd621d2ad44023752e57e6fe7bc1589b365de473c3979eef85aa5391f6e6679993c67036b81895845338c35b1e23406a282b354bb1378
diff --git a/sys-boot/arcload/arcload-0.50-r1.ebuild b/sys-boot/arcload/arcload-0.50-r1.ebuild
new file mode 100644
index 000000000000..3da4e0e26d6d
--- /dev/null
+++ b/sys-boot/arcload/arcload-0.50-r1.ebuild
@@ -0,0 +1,84 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+inherit eutils toolchain-funcs versionator
+
+# Hack until upstream renames from 0.5 to 0.50
+MY_PV="${PV/50/5}"
+
+DESCRIPTION="ARCLoad - SGI Multi-bootloader. Able to bootload many different SGI Systems"
+HOMEPAGE="http://www.linux-mips.org/wiki/index.php/ARCLoad"
+SRC_URI="ftp://ftp.linux-mips.org/pub/linux/mips/people/skylark/${PN}-${MY_PV}.tar.bz2"
+LICENSE="GPL-2+"
+SLOT="0"
+KEYWORDS="-* ~mips"
+IUSE=""
+DEPEND="sys-boot/dvhtool"
+RDEPEND=""
+RESTRICT="strip"
+
+S="${WORKDIR}/${PN}-${MY_PV}"
+
+src_prepare() {
+ # For gcc-4.x, quiet down some of the warnings
+ $(version_is_at_least "4.0" "$(gcc-version)") && \
+ epatch "${FILESDIR}"/${P}-shut-gcc4x-up.patch
+
+ # Redefine the targets in the primary Makefile to give us
+ # finer control over building the tools. This is for properly
+ # cross-compiling arcload
+ epatch "${FILESDIR}"/${P}-makefile-targets.patch
+}
+
+src_compile() {
+ # Build the wreckoff tool first. It converts a 32bit MIPS ELF
+ # into a relocatable ECOFF image. We call for BUILD_CC
+ # on the offchance that we're cross-compiling.
+ echo -e ""
+ einfo ">>> Building the 'wreckoff' utility with $(tc-getBUILD_CC) ..."
+ emake CC=$(tc-getBUILD_CC) tools_clean tools
+
+ # 32bit copy (sashARCS for IP22/IP32)
+ echo -e ""
+ einfo ">>> Building 32-bit version (sashARCS) for IP22/IP32 ..."
+ cd "${S}"
+ emake MODE=M32 bootloader_clean
+ emake CC=$(tc-getCC) LD=$(tc-getLD) MODE=M32 bootloader
+ cp "${S}"/arcload.ecoff "${WORKDIR}"/sashARCS
+
+ # 64bit copy (sash64 for IP27/IP28/IP30)
+ echo -e ""
+ einfo ">>> Building 64-bit version (sash64) for IP27/IP28/IP30 ..."
+ emake MODE=M64 bootloader_clean
+ emake CC=$(tc-getCC) LD=$(tc-getLD) MODE=M64 bootloader
+ cp "${S}"/arcload "${WORKDIR}"/sash64
+}
+
+src_install() {
+ dodir /usr/lib/arcload
+ cp "${WORKDIR}"/sashARCS "${D}"/usr/lib/arcload
+ cp "${WORKDIR}"/sash64 "${D}"/usr/lib/arcload
+ cp "${S}"/arc.cf-bootcd "${D}"/usr/lib/arcload/arc-bootcd.cf
+ cp "${S}"/arc.cf-octane "${D}"/usr/lib/arcload/arc-octane.cf
+}
+
+pkg_postinst() {
+ echo -e ""
+ einfo "ARCLoad binaries copied to: /usr/lib/arcload"
+ echo -e ""
+ einfo "Use of ARCLoad is relatively easy:"
+ einfo "\t1) Determine which version you need"
+ einfo "\t\tA) sashARCS for IP22/IP32"
+ einfo "\t\tB) sash64 for IP27/IP28/IP30"
+ einfo "\t2) Copy that to the volume header using 'dvhtool'"
+ einfo "\t3) Edit /usr/lib/arcload/arc-*.cf to fit your specific system"
+ einfo "\t (See ${HOMEPAGE} for"
+ einfo "\t an explanation of the format of the config file)"
+ einfo "\t4) Copy the config file to the volume header with 'dvhtool' as 'arc.cf'"
+ einfo "\t5) Copy any kernels to the volume header that you want to be bootable"
+ einfo "\t6) Reboot, and enjoy!"
+ echo -e ""
+}
diff --git a/sys-boot/arcload/arcload-0.50-r3.ebuild b/sys-boot/arcload/arcload-0.50-r3.ebuild
new file mode 100644
index 000000000000..f6d5a225b92c
--- /dev/null
+++ b/sys-boot/arcload/arcload-0.50-r3.ebuild
@@ -0,0 +1,129 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+inherit eutils toolchain-funcs versionator
+
+# Hack until upstream renames from 0.5 to 0.50
+MY_PV="${PV/50/5}"
+
+PATCHREV="1"
+DESCRIPTION="ARCLoad - SGI Multi-bootloader. Able to bootload many different SGI Systems"
+HOMEPAGE="http://www.linux-mips.org/wiki/index.php/ARCLoad"
+SRC_URI="ftp://ftp.linux-mips.org/pub/linux/mips/people/skylark/${PN}-${MY_PV}.tar.bz2
+ mirror://gentoo/${P}-patches-v${PATCHREV}.tar.xz"
+LICENSE="GPL-2+"
+SLOT="0"
+KEYWORDS="-* ~mips"
+IUSE=""
+DEPEND="sys-boot/dvhtool
+ abi_mips_o32? ( sys-devel/kgcc64 )"
+RDEPEND=""
+RESTRICT="strip"
+
+S="${WORKDIR}/${PN}-${MY_PV}"
+PATCHDIR="${WORKDIR}/${P}-patches"
+
+src_prepare() {
+ # For gcc-4.x, quiet down some of the warnings
+ epatch "${PATCHDIR}"/${P}-shut-gcc4x-up.patch
+
+ # Redefine the targets in the primary Makefile to give us
+ # finer control over building the tools. This is for properly
+ # cross-compiling arcload
+ epatch "${PATCHDIR}"/${P}-makefile-targets.patch
+
+ # Patches borrowed from Debian:
+ # - Load ELF64 images on 32-bit systems - XXX: #543978
+ # - Pass an arcload label name directly on the PROM cmdline.
+ # - Look for arc.cf in /etc and fallback to /.
+# epatch "${PATCHDIR}"/${P}_deb-elf64-on-m32.patch
+ epatch "${PATCHDIR}"/${P}_deb-cmdline-config.patch
+ epatch "${PATCHDIR}"/${P}_deb-config-in-etc.patch
+
+ # Building arcload on different MIPS ABIs can be difficult,
+ # so we include specific bits from standard system headers
+ # to make the compiler happy. These should rarely, if ever,
+ # change...
+ epatch "${PATCHDIR}"/${P}-local-elf_h.patch
+
+ # Patch wreckoff.c to handle the new .MIPS.abiflags section.
+ epatch "${PATCHDIR}"/${P}-wreckoff-abiflags-fix.patch
+
+ # In order to convert from ELF to ECOFF, we need to disable
+ # SSP, as that adds additional program headers that I don't
+ # know how to handle in wreckoff.c.
+ epatch "${PATCHDIR}"/${P}-disable-ssp.patch
+
+ # The code is old and has a lot of issues. But it's just a
+ # simple bootloader, so silence the various warnings until
+ # it can be re-written.
+ epatch "${PATCHDIR}"/${P}-silence-warnings.patch
+}
+
+src_compile() {
+ local myCC myCC64 myLD myLD64
+
+ myCC="$(tc-getCC)"
+ myLD="$(tc-getLD)"
+ if use abi_mips_o32; then
+ myCC64=${myCC/mips/mips64}
+ myLD64=${myLD/mips/mips64}
+ else
+ myCC64=${myCC}
+ myLD64=${myLD}
+ fi
+
+ # Build the wreckoff tool first. It converts a 32bit MIPS ELF
+ # into a relocatable ECOFF image. We call for BUILD_CC
+ # on the offchance that we're cross-compiling.
+ echo -e ""
+ einfo ">>> Building the 'wreckoff' utility with $(tc-getBUILD_CC) ..."
+ emake CC=$(tc-getBUILD_CC) tools_clean tools
+
+ # 32bit copy (sashARCS for IP22/IP32)
+ echo -e ""
+ einfo ">>> Building 32-bit version (sashARCS) for IP22/IP32 with ${myCC} ..."
+ cd "${S}"
+ emake MODE=M32 bootloader_clean
+ emake CC=${myCC} LD=${myLD} MODE=M32 bootloader
+ cp "${S}"/arcload.ecoff "${WORKDIR}"/sashARCS
+
+ # 64bit copy (sash64 for IP27/IP28/IP30)
+ echo -e ""
+ einfo ">>> Building 64-bit version (sash64) for IP27/IP28/IP30 ${myCC/mips/mips64} ..."
+ emake MODE=M64 bootloader_clean
+ emake CC=${myCC64} LD=${myLD64} MODE=M64 bootloader
+ cp "${S}"/arcload "${WORKDIR}"/sash64
+}
+
+src_install() {
+ dodir /usr/lib/arcload
+ cp "${WORKDIR}"/sashARCS "${D}"/usr/lib/arcload
+ cp "${WORKDIR}"/sash64 "${D}"/usr/lib/arcload
+ cp "${S}"/arc.cf-bootcd "${D}"/usr/lib/arcload/arc-bootcd.cf
+ cp "${S}"/arc.cf-octane "${D}"/usr/lib/arcload/arc-octane.cf
+
+ # Add a manpage for arcload(8) from the Debian Project.
+ doman "${FILESDIR}/arcload.8"
+}
+
+pkg_postinst() {
+ echo -e ""
+ einfo "ARCLoad binaries copied to: /usr/lib/arcload"
+ echo -e ""
+ einfo "Use of ARCLoad is relatively easy:"
+ einfo "\t1) Determine which version you need"
+ einfo "\t\tA) sashARCS for IP22/IP32"
+ einfo "\t\tB) sash64 for IP27/IP28/IP30"
+ einfo "\t2) Copy that to the volume header using 'dvhtool'"
+ einfo "\t3) Edit /usr/lib/arcload/arc-*.cf to fit your specific system"
+ einfo "\t (See ${HOMEPAGE} for"
+ einfo "\t an explanation of the format of the config file)"
+ einfo "\t4) Copy the config file to the volume header with 'dvhtool' as 'arc.cf'"
+ einfo "\t5) Copy any kernels to the volume header that you want to be bootable"
+ einfo "\t6) Reboot, and enjoy!"
+ echo -e ""
+}
diff --git a/sys-boot/arcload/files/arcload.8 b/sys-boot/arcload/files/arcload.8
new file mode 100644
index 000000000000..6d72dd5c5d78
--- /dev/null
+++ b/sys-boot/arcload/files/arcload.8
@@ -0,0 +1,65 @@
+.TH "ARCLOAD" "8" "25 November 2007" "" ""
+.SH NAME
+arcload \- bootloader for SGI/ARCS machines
+.SH SYNOPSIS
+
+\fBarcload\fR \fIdevice\fR
+
+.SH "DESCRIPTION"
+.PP
+\fBarcload\fR is a bootloader designed to load any Linux kernel on any
+SGI/ARCS machine. It supports booting the kernel from a variety of
+filesystems; currently, the following filesystems are supported:
+\fBext2\fR (\fBext3\fR), \fBfat\fR, \fBiso9660\fR, \fBjfs\fR,
+\fBminix\fR, \fBufs\fR, \fBxfs\fR and the \fB*arcfs\fR
+pseudo-filesystem.
+
+\fBarcload\fP usually resides in the volume header of a disk with an
+SGI disklabel.
+.SH "USAGE"
+.PP
+\fIdevice\fR is the device name of the disk containing the volume header
+\fBarcload\fR should go into. To use \fBarcload\fR you have to modify
+the following PROM variables:
+.P
+\fIsetenv OSLoader arcload\fR
+.P
+\fIsetenv SystemPartition dksc(c,d,8)\fR
+.P
+\fIsetenv OSLoadPartition dksc(c,d,p)\fR
+.P
+\fIsetenv OSLoadFilename label(option1,option2,...)\fR
+.P
+where \fIc\fR is the ID of the SCSI controller, \fId\fR the SCSI ID
+of the disk \fBarcload\fR resides on and \fIp\fR the partition number
+of the partition \fBarc.cf\fR and the kernels reside on (counting
+from 0). Note that \fBarc.cf\fR and the directory your kernels are in
+(usually / or /boot) have to be on the same partition. On boot,
+\fBarcload\fR looks at the \fIOSLoadFilename\fR PROM variable and
+tries to find a label with the same name in \fBarc.cf\fR.
+
+\fBarc.cf\fP can reside either in /etc or at the root of the partition pointed
+to by the \fIOSLoadFilename\fP variable.
+
+.SH "NOTES"
+\fBarcload\fR only loads ELF kernels.
+
+.SH "FILES"
+.BR /arc.cf
+\fBarcload\fR's configuration file
+.P
+.BR /usr/share/doc/arcload/examples
+configuration file examples
+.P
+.BR /usr/share/doc/arcload/README.Debian
+some notes about arcload for Debian
+.PP
+.SH "SEE ALSO"
+.PP
+dvhtool(1)
+
+.SH "AUTHORS"
+ARCLoad was written by Stanislaw Skowronek
+<skylark@linux-mips.org>. This manual page was written by Julien
+BLACHE <jblache@debian.org> for the Debian Project (but may be used by
+others), based on the arcboot(8) manpage.
diff --git a/sys-boot/arcload/metadata.xml b/sys-boot/arcload/metadata.xml
new file mode 100644
index 000000000000..776ed4fa58a6
--- /dev/null
+++ b/sys-boot/arcload/metadata.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>mips</herd>
+ <longdescription>
+ ARCLoad - SGI Multi-bootloader. Able to bootload many different SGI Systems.
+ </longdescription>
+</pkgmetadata>
+
diff --git a/sys-boot/bootcreator/Manifest b/sys-boot/bootcreator/Manifest
new file mode 100644
index 000000000000..253686685a81
--- /dev/null
+++ b/sys-boot/bootcreator/Manifest
@@ -0,0 +1 @@
+DIST bootcreator-src.tar.gz 18881 RMD160 fe92ab793032dc3b0219ec55933e42bd939d1b07 SHA1 2d21c44af3cd6c037663f0257b33956d15f4e556 SHA256 d1a1b581b65c468415867d005916cb898fc11788660819568434245cc162e3cb
diff --git a/sys-boot/bootcreator/bootcreator-1.1.ebuild b/sys-boot/bootcreator/bootcreator-1.1.ebuild
new file mode 100644
index 000000000000..f6ab266b50a2
--- /dev/null
+++ b/sys-boot/bootcreator/bootcreator-1.1.ebuild
@@ -0,0 +1,36 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+inherit eutils
+
+DESCRIPTION="Simple generator for Forth based BootMenu scripts for Pegasos machines"
+
+HOMEPAGE="http://tbs-software.com/morgoth/projects.html"
+SRC_URI="http://tbs-software.com/morgoth/files/bootcreator-src.tar.gz"
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="ppc -*"
+IUSE=""
+DEPEND=""
+
+S=${WORKDIR}/${PN}
+
+src_unpack() {
+ unpack ${A}
+ cd ${S}
+ mv examples/example.bc examples/bootmenu.example
+}
+
+src_compile() {
+ cd ${S}
+ make all || die "Can't compile bootmenu"
+}
+
+src_install() {
+ cd ${S}
+ dosbin src/bootcreator
+ insinto /etc
+ doins examples/bootmenu.example
+ dodoc doc/README doc/COPYING
+}
diff --git a/sys-boot/bootcreator/bootcreator-1.2.ebuild b/sys-boot/bootcreator/bootcreator-1.2.ebuild
new file mode 100644
index 000000000000..f29c1c08ce35
--- /dev/null
+++ b/sys-boot/bootcreator/bootcreator-1.2.ebuild
@@ -0,0 +1,36 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+inherit eutils
+
+DESCRIPTION="Simple generator for Forth based BootMenu scripts for Pegasos machines"
+
+HOMEPAGE="http://tbs-software.com/morgoth/projects.html"
+SRC_URI="http://tbs-software.com/morgoth/files/bootcreator-src.tar.gz"
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="ppc -*"
+IUSE=""
+DEPEND=""
+
+S=${WORKDIR}
+
+src_unpack() {
+ unpack ${A}
+ cd ${S}
+ mv examples/example.bc examples/bootmenu.example
+}
+
+src_compile() {
+ cd ${S}
+ make all || die "Can't compile bootmenu"
+}
+
+src_install() {
+ cd ${S}
+ dosbin src/bootcreator
+ insinto /etc
+ doins examples/bootmenu.example
+ dodoc doc/README doc/COPYING
+}
diff --git a/sys-boot/bootcreator/metadata.xml b/sys-boot/bootcreator/metadata.xml
new file mode 100644
index 000000000000..e75d5a5857f0
--- /dev/null
+++ b/sys-boot/bootcreator/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>ppc</herd>
+</pkgmetadata>
diff --git a/sys-boot/colo/Manifest b/sys-boot/colo/Manifest
new file mode 100644
index 000000000000..f486c8994f5e
--- /dev/null
+++ b/sys-boot/colo/Manifest
@@ -0,0 +1 @@
+DIST colo-1.22.tar.gz 257968 RMD160 4a07cfe5050f395a8eb7c7d5fe71748877377084 SHA1 079e0409f662be9cac8b645c972f013f3f17af92 SHA256 ec51237286be9581d6be1ff3e43c9a654aaf4e1414d1bb194f02032e57119163
diff --git a/sys-boot/colo/colo-1.22.ebuild b/sys-boot/colo/colo-1.22.ebuild
new file mode 100644
index 000000000000..c57d0f8661ce
--- /dev/null
+++ b/sys-boot/colo/colo-1.22.ebuild
@@ -0,0 +1,118 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+inherit eutils toolchain-funcs
+
+DESCRIPTION="CObalt LOader - Modern bootloader for Cobalt MIPS machines"
+HOMEPAGE="http://www.colonel-panic.org/cobalt-mips/"
+SRC_URI="http://www.colonel-panic.org/cobalt-mips/colo/colo-${PV}.tar.gz"
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="-* ~mips"
+IUSE=""
+DEPEND=""
+RDEPEND=""
+RESTRICT="strip"
+
+src_unpack() {
+ unpack ${A}
+}
+
+src_compile() {
+ echo -e ""
+ einfo ">>> Building the CoLo Bootloader ..."
+
+ # Remove -Werror from CFLAGS
+ # gcc-4.3.x is more strict; We'll go back and fix later
+ cd "${S}"
+ for x in $(grep -rl "Werror" "${S}"/*); do
+ sed -i -e 's/\-Werror//g' "${x}"
+ done
+
+ # Keep elf2rfx from automatically building via the Makefile
+ sed -i -e 's/tools\/elf2rfx //' "${S}"/Makefile
+
+ # Build it first with BUILD_CC in case of cross-compiles
+ cd "${S}"/tools/elf2rfx
+ make CC="$(tc-getBUILD_CC)" || die
+
+ # Build the rest
+ cd "${S}"
+ make clean || die # emake breaks the build
+ make CC="$(tc-getCC)" OBJCOPY="$(tc-getOBJCOPY)" \
+ STRIP="$(tc-getSTRIP)" || die
+
+ # Now rebuild elf2rfx again with CC so it can be installed
+ cd "${S}"/tools/elf2rfx
+ make clean || die
+ make CC="$(tc-getCC)" || die
+}
+
+src_install() {
+ # bins
+ dodir /usr/lib/colo
+ cp binaries/colo-chain.elf "${D}"/usr/lib/colo
+ cp binaries/colo-rom-image.bin "${D}"/usr/lib/colo
+
+ # docs
+ dodoc CHANGES INSTALL README README.{restore,shell,netcon} tools/README.tools TODO
+
+ # all tools except lcdtools (see below)
+ local tool
+ for tool in flash-tool colo-perm copy-rom elf2rfx; do
+
+ einfo "Installing ${tool} binary to ${D}/usr/sbin"
+ dosbin tools/${tool}/${tool}
+ if [ -f tools/${tool}/${tool}.8 ]; then
+ einfo "Installing ${tool} manpage to ${D}/usr/share/man"
+ doman tools/flash-tool/flash-tool.8
+ fi
+
+ done
+
+ # lcdtools
+ for tool in paneld putlcd e2fsck-lcd; do
+ einfo "Installing ${tool} binary and manpage to ${D}/usr/sbin"
+ dosbin tools/lcdtools/${tool}/${tool}
+ doman tools/lcdtools/${tool}/${tool}.8
+ done
+ dolib.a tools/lcdtools/liblcd/liblcd.a
+
+ # bootscripts
+ dodir /usr/lib/colo/scripts
+ cp "${FILESDIR}"/*.colo "${D}"/usr/lib/colo/scripts
+}
+
+pkg_postinst() {
+ echo -e ""
+ einfo "Install locations:"
+ einfo " Binaries:\t/usr/lib/${PN}"
+ einfo " Docs:\t/usr/share/doc/${PF}"
+ einfo " Tools:\t/usr/sbin/{flash-tool,colo-perm,copy-rom,"
+ einfo " \tputlcd,paneld,e2fsck-lcd,elf2rfx}"
+ einfo " Scripts:\t/usr/lib/${PN}/scripts"
+ echo -e ""
+ einfo "Please read the docs to fully understand the behavior of this bootloader, and"
+ einfo "edit the boot scripts to suit your needs."
+ echo -e ""
+ ewarn "Users installing ${PN} for the first time need to be aware that newer"
+ ewarn "versions of ${PN} disable the serial port by default. If the serial port"
+ ewarn "is needed, select it from the boot menu. Users using the example boot"
+ ewarn "scripts provided will have the serial port automatically enabled."
+ echo -e ""
+ ewarn "Note: It is HIGHLY recommended that you use the chain"
+ ewarn "bootloader (colo-chain.elf) first before attempting to"
+ ewarn "write the bootloader to the flash chip to verify that"
+ ewarn "it will work for you. It is also recommended that"
+ ewarn "you read the documentation in /usr/share/doc/${PF}"
+ ewarn "as it explains how to properly use this package."
+ echo -e ""
+ eerror "Warning: Make sure that IF you plan on flashing the"
+ eerror "bootloader into the flash chip that you are using a"
+ eerror "modern 2.4 Linux kernel (i.e., >2.4.18), otherwise"
+ eerror "you run a risk of destroying the contents of the"
+ eerror "flash chip and rendering the machine unusable."
+ echo -e ""
+ echo -e ""
+}
diff --git a/sys-boot/colo/files/default.colo b/sys-boot/colo/files/default.colo
new file mode 100644
index 000000000000..676a038388d1
--- /dev/null
+++ b/sys-boot/colo/files/default.colo
@@ -0,0 +1,25 @@
+#:CoLo:#
+
+# Turn on the serial port
+-serial on
+
+# Generate a menu to select the appropriate kernel image on the LCD Screen
+# Format is:
+# menu "<message>" <time out> <menu text 1> <menu option 1> <menu text 2> <menu option 2> ...
+#
+# Where <menu text> is the item displayed, and <menu option> is the item
+# that the text corresponds to. When a menu item is selected, the env variable
+# {menu-option} gets set to the value of <menu option>.
+#
+# Please note, no sample script has been provided for a backup script (linuxold).
+# You will need to create one yourself if you require this.
+menu "colo-@COLOVER@" 100 Linux linux Linux-OLD linuxold
+
+# Loads the corresponding script depending on the selected value from the menu
+-load /boot/menu-{menu-option}.colo
+-script
+
+# Incase of failure, return to the menu
+load /boot/default.colo
+script
+
diff --git a/sys-boot/colo/files/menu.colo b/sys-boot/colo/files/menu.colo
new file mode 100644
index 000000000000..4bf82ad5f6be
--- /dev/null
+++ b/sys-boot/colo/files/menu.colo
@@ -0,0 +1,61 @@
+#:CoLo:#
+# Example configuration file for CoLo, version 1.16 or above.
+#
+# $Id$
+
+# Turn on the serial port; if possible. - means to ignore the error and keep
+# going. Without this, execution would halt here if this command failed (e.g.
+# on Qube 2700; which lacks serial ports)
+-serial on
+
+# Mount the hard drive
+lcd "Mounting hda1"
+mount hda1
+
+# Ask the user... which kernel?
+# Timeout; 50/10 seconds
+#
+# The format is:
+# select "Message Goes Here" TimeOut label1 [label2 ... [labelN]]
+#
+# This will set the {menu-option} variable to the entry corresponding to the
+# selected value, or 0 if no option is selected.
+select "Which Kernel?" 50 Working New
+
+# Now... jump to the line corresponding to the selection...
+#
+# Explaination of the goto command...
+# goto [-]numMarks -- prefixing with - means jump backwards
+# or
+# goto numMarks{b|f} -- b == jump back, f == jump forward
+#
+# Marks are indicated by a line starting with a @ symbol.
+#
+# We use this jump to set the {image-name} variable to a kernel image.
+#
+# Explaination of the var command:
+# var VariableName Value
+#
+
+goto {menu-option}
+
+# {menu-option} = 0; TimeOut or Cancel
+var image-name vmlinux.gz.working
+
+# Skip to the next two @ lines, start at the third @ line.
+goto 3f
+
+# {menu-option} = 1; "Working" selected.
+@var image-name vmlinux.gz.working
+
+goto 2f
+@var image-name vmlinux.gz.new
+
+# Load the requested image
+@lcd "Loading Linux" {image-name}
+load /{image-name}
+
+# Boot
+lcd "Booting..."
+execute root=/dev/hda5 ro console=ttyS0,115200
+boot
diff --git a/sys-boot/colo/files/simple.colo b/sys-boot/colo/files/simple.colo
new file mode 100644
index 000000000000..84b84170a396
--- /dev/null
+++ b/sys-boot/colo/files/simple.colo
@@ -0,0 +1,20 @@
+#:CoLo:#
+#
+# Simple CoLo boot script.
+# $Id$
+
+# Turn serial on; if possible
+# - means: "ignore any failure", so if the machine has no serial device (such as
+# a Qube 2700), it will simply pretend the command never happened.
+-serial on
+
+# Mount the hard drive
+mount hda1
+
+# Loads the kernel into memory (and unzips if needed)
+# Makes sure this points at the correct kernel image
+load /boot/kernel.gz
+
+# Executes the loaded image with the specified command args
+# Change these args to suit your purposes
+execute root=/dev/hda5 console=ttyS0,115200
diff --git a/sys-boot/colo/metadata.xml b/sys-boot/colo/metadata.xml
new file mode 100644
index 000000000000..ff9c798e1578
--- /dev/null
+++ b/sys-boot/colo/metadata.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>mips</herd>
+ <maintainer>
+ <email>mips@gentoo.org</email>
+ <name>Mips Team</name>
+ </maintainer>
+
+ <longdescription>
+ COLO is CObalt Linux lOader - a Modern Bootloader for Cobalt MIPS machines.
+ </longdescription>
+</pkgmetadata>
+
diff --git a/sys-boot/cromwell-bin/Manifest b/sys-boot/cromwell-bin/Manifest
new file mode 100644
index 000000000000..0d2858c27f0b
--- /dev/null
+++ b/sys-boot/cromwell-bin/Manifest
@@ -0,0 +1,2 @@
+DIST cromwell-2.31.tar.gz 543461 SHA256 0611fa76c3a4311e66f0d80686f27de73e1394f8d92f54a5addb09d55cebb22e
+DIST cromwell-2.40.tar.gz 541204 SHA256 b3f078f1e5069a39d3767aa8f579906d39983478d51c9ad2989c337b9148299a
diff --git a/sys-boot/cromwell-bin/cromwell-bin-2.31.ebuild b/sys-boot/cromwell-bin/cromwell-bin-2.31.ebuild
new file mode 100644
index 000000000000..c40840e2b882
--- /dev/null
+++ b/sys-boot/cromwell-bin/cromwell-bin-2.31.ebuild
@@ -0,0 +1,23 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+inherit mount-boot
+
+IUSE=""
+DESCRIPTION="Xbox boot loader precompiled binaries from xbox-linux.org"
+SRC_URI="mirror://sourceforge/xbox-linux/cromwell-${PV}.tar.gz"
+HOMEPAGE="http://www.xbox-linux.org"
+RESTRICT="${RESTRICT} strip"
+DEPEND=""
+SLOT="0"
+LICENSE="GPL-2"
+KEYWORDS="-* x86"
+
+S=${WORKDIR}/cromwell
+
+src_install () {
+ dodir /boot/${PN}
+ insinto /boot/${PN}
+ doins ${S}/image.bin ${S}/image_1024.bin ${S}/default.xbe || die
+}
diff --git a/sys-boot/cromwell-bin/cromwell-bin-2.40.ebuild b/sys-boot/cromwell-bin/cromwell-bin-2.40.ebuild
new file mode 100644
index 000000000000..55d26c0ef78a
--- /dev/null
+++ b/sys-boot/cromwell-bin/cromwell-bin-2.40.ebuild
@@ -0,0 +1,23 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+inherit mount-boot
+
+IUSE=""
+DESCRIPTION="Xbox boot loader precompiled binaries from xbox-linux.org"
+SRC_URI="mirror://sourceforge/xbox-linux/cromwell-${PV}.tar.gz"
+HOMEPAGE="http://www.xbox-linux.org"
+RESTRICT="${RESTRICT} strip"
+DEPEND=""
+SLOT="0"
+LICENSE="GPL-2"
+KEYWORDS="-* x86"
+
+S=${WORKDIR}/cromwell-${PV}
+
+src_install () {
+ dodir /boot/${PN}
+ insinto /boot/${PN}
+ doins ${S}/cromwell.bin ${S}/cromwell_1024.bin ${S}/xromwell.xbe || die
+}
diff --git a/sys-boot/cromwell-bin/metadata.xml b/sys-boot/cromwell-bin/metadata.xml
new file mode 100644
index 000000000000..d4df99f68ee2
--- /dev/null
+++ b/sys-boot/cromwell-bin/metadata.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>xbox</herd>
+ <longdescription>Xbox boot loader (prebuilt binary)</longdescription>
+ <upstream>
+ <remote-id type="sourceforge">xbox-linux</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-boot/cromwell/Manifest b/sys-boot/cromwell/Manifest
new file mode 100644
index 000000000000..ccdc3f073b89
--- /dev/null
+++ b/sys-boot/cromwell/Manifest
@@ -0,0 +1,2 @@
+DIST cromwell-2.40-r3-cvs-fixes.patch.lzma 7075 RMD160 22e0986c3ee5157f47902095947765be6a1ecfa1 SHA1 1543334d54b31f1667657ed2d7b5107e2ef9d497 SHA256 97d50811000edc399e0323b5faeff169de86846f50439adbc59b6eeaf1bb12fd
+DIST cromwell-2.40.tar.bz2 943015 RMD160 0b1efe4bee94e9d4b130008641fe4d2989439f43 SHA1 ce1b1d5a39f2c319d79ddb162f927ea053e1f354 SHA256 115cf68afad311f6e7490c3091dfb81870416cec3f2cb35d30360a919888cc3c
diff --git a/sys-boot/cromwell/cromwell-2.40-r3.ebuild b/sys-boot/cromwell/cromwell-2.40-r3.ebuild
new file mode 100644
index 000000000000..b7140e1bf5d3
--- /dev/null
+++ b/sys-boot/cromwell/cromwell-2.40-r3.ebuild
@@ -0,0 +1,38 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+inherit eutils mount-boot toolchain-funcs flag-o-matic
+
+DESCRIPTION="Xbox boot loader"
+HOMEPAGE="http://www.xbox-linux.org/wiki/Cromwell"
+SRC_URI="mirror://gentoo/${P}.tar.bz2
+ mirror://gentoo/${PF}-cvs-fixes.patch.lzma"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="-* x86"
+IUSE=""
+RESTRICT="strip"
+
+src_prepare() {
+ epatch "${WORKDIR}"/${PF}-cvs-fixes.patch
+ epatch "${FILESDIR}"/${P}-gcc-4.6.patch #363535
+ sed -i 's:-Werror:-m32:' Makefile Rules.make || die
+ sed -i '/^EXTRA_CFLAGS/s:$: -m32:' Rules.make boot_rom/Makefile || die
+ sed -i \
+ -e '/^bin.imagebld:/,$s:\<gcc\>:${CC}:' \
+ Makefile || die
+ append-flags -m32
+}
+
+src_compile() {
+ emake -j1 CC="$(tc-getCC)" LD="$(tc-getLD)"
+}
+
+src_install() {
+ insinto /boot/${PN}
+ doins image/cromwell{,_1024}.bin xbe/xromwell.xbe
+}
diff --git a/sys-boot/cromwell/files/cromwell-2.40-gcc-4.6.patch b/sys-boot/cromwell/files/cromwell-2.40-gcc-4.6.patch
new file mode 100644
index 000000000000..92de3b014b61
--- /dev/null
+++ b/sys-boot/cromwell/files/cromwell-2.40-gcc-4.6.patch
@@ -0,0 +1,39 @@
+newer gcc versions will output .text.unlikely which this linker script
+doesn't expect
+
+https://bugs.gentoo.org/363535
+
+--- a/scripts/ldscript-crom.ld
++++ b/scripts/ldscript-crom.ld
+@@ -21,7 +21,7 @@ SECTIONS {
+
+ .text LOW_ROM : AT ( 0 ){
+ _start_low_rom = . ;
+- *(.text);
++ *(.text .text.*);
+ _end_low_rom = . ;
+ }
+
+@@ -67,4 +67,5 @@ SECTIONS {
+
+ _end_complete_rom = SIZEOF(.text) + SIZEOF(.rodata) + SIZEOF(.data) + SIZEOF(.bss);
+
++ /DISCARD/ : { *(.eh_frame) }
+ }
+--- a/boot_rom/bootrom.ld
++++ b/boot_rom/bootrom.ld
+@@ -31,7 +31,7 @@ SECTIONS {
+ .text (RAM_CODE) : AT( SIZEOF(.low_rom) ) {
+ _ram_location = .;
+ _start_ramcopy = _end_rom;
+- *(.text);
++ *(.text .text.*);
+ _start_checksum = _start_ramcopy - LOW_ROM;
+ }
+
+@@ -74,4 +74,5 @@ SECTIONS {
+ } = 0x90909090
+ */
+
++ /DISCARD/ : { *(.eh_frame) }
+ }
diff --git a/sys-boot/cromwell/metadata.xml b/sys-boot/cromwell/metadata.xml
new file mode 100644
index 000000000000..f09a62b665f7
--- /dev/null
+++ b/sys-boot/cromwell/metadata.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>xbox</herd>
+ <longdescription>Xbox boot loader</longdescription>
+</pkgmetadata>
diff --git a/sys-boot/dvhtool/Manifest b/sys-boot/dvhtool/Manifest
new file mode 100644
index 000000000000..6222e0ff4bdd
--- /dev/null
+++ b/sys-boot/dvhtool/Manifest
@@ -0,0 +1 @@
+DIST dvhtool_1.0.1.orig.tar.gz 53283 SHA256 3596c74c08ee8f2f19712e8f0ab1f7ff8c483de7bfc2f50d205a186f52896f02
diff --git a/sys-boot/dvhtool/dvhtool-1.0.1-r2.ebuild b/sys-boot/dvhtool/dvhtool-1.0.1-r2.ebuild
new file mode 100644
index 000000000000..73f6db4383b7
--- /dev/null
+++ b/sys-boot/dvhtool/dvhtool-1.0.1-r2.ebuild
@@ -0,0 +1,44 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+inherit autotools eutils toolchain-funcs
+
+DESCRIPTION="Tool to copy kernel(s) into the volume header on SGI MIPS-based workstations"
+HOMEPAGE="http://packages.debian.org/unstable/utils/dvhtool"
+SRC_URI="mirror://debian/pool/main/d/dvhtool/dvhtool_1.0.1.orig.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~mips ~x86"
+IUSE=""
+DEPEND=""
+RDEPEND=""
+
+S="${S}.orig"
+
+src_prepare() {
+ # several applicable hunks from a debian patch
+ epatch "${FILESDIR}"/${P}-debian.diff
+
+ # Newer minor patches from Debian
+ epatch "${FILESDIR}"/${P}-debian-warn_type_guess.diff
+ epatch "${FILESDIR}"/${P}-debian-xopen_source.diff
+
+ # Allow dvhtool to recognize Linux RAID and Linux LVM partitions
+ epatch "${FILESDIR}"/${P}-add-raid-lvm-parttypes.patch
+
+ eautoreconf
+}
+
+src_configure() {
+ CC=$(tc-getCC) LD=$(tc-getLD) \
+ econf
+}
+
+src_compile() {
+ CC=$(tc-getCC) LD=$(tc-getLD) \
+ emake
+}
diff --git a/sys-boot/dvhtool/files/dvhtool-1.0.1-add-raid-lvm-parttypes.patch b/sys-boot/dvhtool/files/dvhtool-1.0.1-add-raid-lvm-parttypes.patch
new file mode 100644
index 000000000000..2a3cd753252b
--- /dev/null
+++ b/sys-boot/dvhtool/files/dvhtool-1.0.1-add-raid-lvm-parttypes.patch
@@ -0,0 +1,24 @@
+diff -Naurp dvhtool-1.0.1.orig-A/dvh.h dvhtool-1.0.1.orig/dvh.h
+--- dvhtool-1.0.1.orig-A/dvh.h 2005-09-28 02:45:56 -0400
++++ dvhtool-1.0.1.orig/dvh.h 2005-09-28 02:41:15 -0400
+@@ -129,6 +129,8 @@ struct partition_table { /* one per log
+ #define PTYPE_XVM 13 /* partition is sgi XVM */
+ #define PTYPE_LSWAP 0x82 /* partition is Linux swap */
+ #define PTYPE_LINUX 0x83 /* partition is Linux native */
++#define PTYPE_LLVM 0x8e /* partition is Linux LVM */
++#define PTYPE_LRAID 0xfd /* partition is Linux RAID */
+ #define NPTYPES 16
+
+ #define VHMAGIC 0xbe5a941 /* randomly chosen value */
+diff -Naurp dvhtool-1.0.1.orig-A/dvhlib.c dvhtool-1.0.1.orig/dvhlib.c
+--- dvhtool-1.0.1.orig-A/dvhlib.c 2005-09-28 02:45:56 -0400
++++ dvhtool-1.0.1.orig/dvhlib.c 2005-09-28 02:41:45 -0400
+@@ -52,6 +52,8 @@ ptype2str(int ptype)
+ case PTYPE_XVM: return "XVM Volume";
+ case PTYPE_LSWAP: return "Linux Swap";
+ case PTYPE_LINUX: return "Linux Native";
++ case PTYPE_LLVM: return "Linux LVM";
++ case PTYPE_LRAID: return "Linux RAID";
+ }
+ return "Unknown Partition Type";
+ }
diff --git a/sys-boot/dvhtool/files/dvhtool-1.0.1-debian-warn_type_guess.diff b/sys-boot/dvhtool/files/dvhtool-1.0.1-debian-warn_type_guess.diff
new file mode 100644
index 000000000000..bab2a305be92
--- /dev/null
+++ b/sys-boot/dvhtool/files/dvhtool-1.0.1-debian-warn_type_guess.diff
@@ -0,0 +1,12 @@
+--- a/dvhlib.h
++++ b/dvhlib.h
+@@ -3,7 +3,8 @@ #include "config.h"
+ #ifdef HAVE_INTTYPES_H
+ #include <inttypes.h>
+ #else
+-typedef unsigned int uint32_t; /* A guess ... */
++ #warning Guessing type of uint32_t
++ typedef unsigned int uint32_t; /* A guess ... */
+ #endif
+
+ #include "dvh.h"
diff --git a/sys-boot/dvhtool/files/dvhtool-1.0.1-debian-xopen_source.diff b/sys-boot/dvhtool/files/dvhtool-1.0.1-debian-xopen_source.diff
new file mode 100644
index 000000000000..333eb2a74064
--- /dev/null
+++ b/sys-boot/dvhtool/files/dvhtool-1.0.1-debian-xopen_source.diff
@@ -0,0 +1,11 @@
+diff --git a/dvhlib.c b/dvhlib.c
+--- a/dvhlib.c
++++ b/dvhlib.c
+@@ -1,6 +1,7 @@
+ /*
+ * Disk Volume Header Library
+ */
++#define _XOPEN_SOURCE 500
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <string.h>
diff --git a/sys-boot/dvhtool/files/dvhtool-1.0.1-debian.diff b/sys-boot/dvhtool/files/dvhtool-1.0.1-debian.diff
new file mode 100644
index 000000000000..43f33ffc2596
--- /dev/null
+++ b/sys-boot/dvhtool/files/dvhtool-1.0.1-debian.diff
@@ -0,0 +1,135 @@
+--- dvhtool-1.0.1.orig/dvh.h
++++ dvhtool-1.0.1/dvh.h
+@@ -127,6 +127,8 @@
+ #define PTYPE_XFSLOG 11 /* partition is sgi XFS log */
+ #define PTYPE_XLV 12 /* partition is part of an XLV vol */
+ #define PTYPE_XVM 13 /* partition is sgi XVM */
++#define PTYPE_LSWAP 0x82 /* partition is Linux swap */
++#define PTYPE_LINUX 0x83 /* partition is Linux native */
+ #define NPTYPES 16
+
+ #define VHMAGIC 0xbe5a941 /* randomly chosen value */
+--- dvhtool-1.0.1.orig/dvhlib.c
++++ dvhtool-1.0.1/dvhlib.c
+@@ -50,6 +50,8 @@
+ case PTYPE_XFSLOG: return "XFS Log";
+ case PTYPE_XLV: return "XLV Volume";
+ case PTYPE_XVM: return "XVM Volume";
++ case PTYPE_LSWAP: return "Linux Swap";
++ case PTYPE_LINUX: return "Linux Native";
+ }
+ return "Unknown Partition Type";
+ }
+@@ -325,8 +327,10 @@
+ if (res == -1)
+ die("Couldn't stat source file");
+
+- /* XXX pad to blocksize? */
+- size = vh->vh_pt[8].pt_nblks * blksize - istat.st_size;
++ /* calculate free blocks in vh */
++ size = vh->vh_pt[8].pt_nblks /* total vh size */
++ - ( vh->vh_pt[8].pt_firstlbn + 4 ) /* reserved area */
++ - (( istat.st_size + blksize - 1 ) / blksize ); /* pad to blocksize */
+ /*
+ * Are we replacing an existing file, check for enough space and free
+ * entry in volume header
+@@ -336,16 +340,15 @@
+ /* It's an existing file, delete it. */
+ memset(vd->vd_name, 0, VDNAMESIZE);
+ vd->vd_nbytes = 0;
+- break;
+ }
+ if ( vd->vd_nbytes ) {
+- size -= vd->vd_nbytes;
++ size -= (vd->vd_nbytes + blksize - 1 ) / blksize; /* pad to blocksize */
+ num++;
+ }
+ vd++;
+ }
+
+- if ( num == NVDIR )
++ if ( num == NVDIR )
+ die("No more free entries in volume header");
+ if ( size <= 0 )
+ die("Not enough space left in volume header");
+@@ -403,7 +406,7 @@
+ die("Short write");
+ }
+ }
+- dest += (vd->vd_nbytes + 511) / 512; /* XXX Blocksize */
++ dest += (vd->vd_nbytes + blksize - 1) / blksize;
+ vd++;
+ }
+
+--- dvhtool-1.0.1.orig/dvhtool.8
++++ dvhtool-1.0.1/dvhtool.8
+@@ -1,4 +1,4 @@
+-.TH DVHTOOL 1 "July 2000"
++.TH DVHTOOL 8 "July 2000"
+ .UC 4
+ .SH NAME
+ dvhtool \- Disk volume header manipulation tool
+@@ -85,4 +85,4 @@
+ .PP
+ .I dvhtool
+ was written by Ralf Baechle <ralf@oss.sgi.com>, Keith M. Wesolowski <wesolows@foobazco.org>,
+-Tor Arntsen <tor@spacetec.no>, Guido Guenther <guido.guenther@gmx.net>.
++Tor Arntsen <tor@spacetec.no>, Guido Guenther <agx@debian.org>.
+--- dvhtool-1.0.1.orig/Makefile.in
++++ dvhtool-1.0.1/Makefile.in
+@@ -1,4 +1,4 @@
+-# Makefile.in generated automatically by automake 1.4a from Makefile.am
++# Makefile.in generated automatically by automake 1.4-p4 from Makefile.am
+
+ # Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
+ # This Makefile.in is free software; the Free Software Foundation
+@@ -46,10 +46,9 @@
+ AUTOHEADER = @AUTOHEADER@
+
+ INSTALL = @INSTALL@
+-INSTALL_PROGRAM = @INSTALL_PROGRAM@
++INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS)
+ INSTALL_DATA = @INSTALL_DATA@
+ INSTALL_SCRIPT = @INSTALL_SCRIPT@
+-INSTALL_STRIP_FLAG =
+ transform = @program_transform_name@
+
+ NORMAL_INSTALL = :
+@@ -104,7 +103,7 @@
+
+ DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
+
+-TAR = gtar
++TAR = tar
+ GZIP_ENV = --best
+ DEP_FILES = .deps/dvhlib.P .deps/dvhtool.P .deps/getopt.P \
+ .deps/getopt1.P .deps/pread.P
+@@ -124,7 +123,7 @@
+ $(ACLOCAL_M4): configure.in acinclude.m4
+ cd $(srcdir) && $(ACLOCAL)
+
+-config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
++config.status: $(srcdir)/configure.in $(CONFIG_STATUS_DEPENDENCIES)
+ $(SHELL) ./config.status --recheck
+ $(srcdir)/configure: $(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES)
+ cd $(srcdir) && $(AUTOCONF)
+@@ -173,8 +172,8 @@
+ $(mkinstalldirs) $(DESTDIR)$(sbindir)
+ @list='$(sbin_PROGRAMS)'; for p in $$list; do \
+ if test -f $$p; then \
+- echo " $(INSTALL_PROGRAM) $(INSTALL_STRIP_FLAG) $$p $(DESTDIR)$(sbindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`"; \
+- $(INSTALL_PROGRAM) $(INSTALL_STRIP_FLAG) $$p $(DESTDIR)$(sbindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \
++ echo " $(INSTALL_PROGRAM) $$p $(DESTDIR)$(sbindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`"; \
++ $(INSTALL_PROGRAM) $$p $(DESTDIR)$(sbindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \
+ else :; fi; \
+ done
+
+@@ -382,7 +381,7 @@
+ all-am: Makefile $(PROGRAMS) $(MANS) $(HEADERS) config.h
+ all-redirect: all-am
+ install-strip:
+- $(MAKE) $(AM_MAKEFLAGS) INSTALL_STRIP_FLAG=-s install
++ $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install
+ installdirs:
+ $(mkinstalldirs) $(DESTDIR)$(sbindir) $(DESTDIR)$(mandir)/man8
+
diff --git a/sys-boot/dvhtool/metadata.xml b/sys-boot/dvhtool/metadata.xml
new file mode 100644
index 000000000000..9b9d8d219fd3
--- /dev/null
+++ b/sys-boot/dvhtool/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>mips</herd>
+</pkgmetadata>
diff --git a/sys-boot/efibootmgr/Manifest b/sys-boot/efibootmgr/Manifest
new file mode 100644
index 000000000000..3264ab01a3f5
--- /dev/null
+++ b/sys-boot/efibootmgr/Manifest
@@ -0,0 +1,4 @@
+DIST efibootmgr-0.11.0.tar.bz2 53636 SHA256 f27ce3d7588512017bceb2d2a29aef110499a662a21550afa1158f9950f976d1 SHA512 65866239ae3e2f0142f48e57b16c2a2f4b736e6c7942e595492d82c628633826cfe1a68dd850b8d3090b1a0bd1bbf1906ea882e377a593d1866d686b984cac19 WHIRLPOOL 411cca8fcc26620d2c2a9d15f39e4bafc430efa2789cfe875b411522c641e6754295a640bf03876fd45c8c7c2880f81779bebd95485459316ed846210d7bb533
+DIST efibootmgr-0.12.tar.bz2 35816 SHA256 a66f5850677e86255d93cb1cead04c3c48a823a2b864c579321f2a07f00256e6 SHA512 ca3d4a582a95465c73ca01faa004f300d92e5fae3251eeda8c50017532ddfb7034721ef161563350dd9af1259d4536b03269b58ffcd2ae2258c90edb72f83ec6 WHIRLPOOL 83b6f5a790638ffc6998e7db3bf9d3f78799ee566a9e4776e962edeab9faa60b154136aaf7e93fa3bb140ddb35ed006303c6cf5c59ebeb3a7d8357c567311e5f
+DIST efibootmgr-0.5.4.tar.gz 59121 SHA256 b562a47a4f5327494992f2ee6ae14a75c5aeb9b4a3a78a06749d5cd2917b8e71 SHA512 1fbc3bc442e848b7f6a7e5d8851d92efe271abd090cfeda253baf7b11b9f7b9e984b9703c02ed57f718d5de5b26ec45f1eaeff55b50e4a7bc9e25cf3a958c4ad WHIRLPOOL e17d2a2ecb666eb6644794b48535d8141ee2b79470cdb8d28c927032724efd59dcfdef278d6895bf3c3ec5af91ea559a2df1c938fb406fb2a8c0256a67da05a6
+DIST efibootmgr-0.6.0.tar.gz 64995 SHA256 1c9b0852df7932c410865e296a38fe66e39a26e10c9c1a7ff34fca87f3e25f53 SHA512 f06d3094e41ef100f5bad746add6cad3f3c700e5d5ebe9481533e6ec1df07b3595132f835ffcbac853e3fb48d0fd03d572c84f54394ba094b6d0aa426ff2a02c WHIRLPOOL 0352318b9350f8ae789fbeda278a55d1b28edd17fcadbaf0f9f484cac7dd9826e55243b799d512aa30e99265e7dff87142f9054908157bd9dba001981c807943
diff --git a/sys-boot/efibootmgr/efibootmgr-0.11.0.ebuild b/sys-boot/efibootmgr/efibootmgr-0.11.0.ebuild
new file mode 100644
index 000000000000..aa82876c7993
--- /dev/null
+++ b/sys-boot/efibootmgr/efibootmgr-0.11.0.ebuild
@@ -0,0 +1,36 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit toolchain-funcs
+
+DESCRIPTION="User-space application to modify the EFI boot manager"
+HOMEPAGE="https://github.com/vathpela/efibootmgr"
+SRC_URI="https://github.com/vathpela/${PN}/releases/download/${P}/${P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 ia64 x86"
+IUSE=""
+
+RDEPEND="sys-apps/pciutils
+ sys-libs/efivar"
+DEPEND="${RDEPEND}"
+
+src_prepare() {
+ sed -i -e s/-Werror// Makefile || die
+}
+
+src_configure() {
+ tc-export CC
+ export EXTRA_CFLAGS=${CFLAGS}
+}
+
+src_install() {
+ # build system uses perl, so just do it ourselves
+ dosbin src/efibootmgr/efibootmgr
+ doman src/man/man8/efibootmgr.8
+ dodoc AUTHORS README doc/ChangeLog doc/TODO
+}
diff --git a/sys-boot/efibootmgr/efibootmgr-0.12.ebuild b/sys-boot/efibootmgr/efibootmgr-0.12.ebuild
new file mode 100644
index 000000000000..aa35a4f57f37
--- /dev/null
+++ b/sys-boot/efibootmgr/efibootmgr-0.12.ebuild
@@ -0,0 +1,36 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit toolchain-funcs
+
+DESCRIPTION="User-space application to modify the EFI boot manager"
+HOMEPAGE="https://github.com/rhinstaller/efibootmgr"
+SRC_URI="https://github.com/rhinstaller/${PN}/releases/download/${P}/${P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~ia64 ~x86"
+IUSE=""
+
+RDEPEND="sys-apps/pciutils
+ >=sys-libs/efivar-0.19"
+DEPEND="${RDEPEND}"
+
+src_prepare() {
+ sed -i -e s/-Werror// Makefile || die
+}
+
+src_configure() {
+ tc-export CC
+ export EXTRA_CFLAGS=${CFLAGS}
+}
+
+src_install() {
+ # build system uses perl, so just do it ourselves
+ dosbin src/efibootmgr/efibootmgr
+ doman src/man/man8/efibootmgr.8
+ dodoc AUTHORS README doc/ChangeLog doc/TODO
+}
diff --git a/sys-boot/efibootmgr/efibootmgr-0.5.4-r1.ebuild b/sys-boot/efibootmgr/efibootmgr-0.5.4-r1.ebuild
new file mode 100644
index 000000000000..97722a55c137
--- /dev/null
+++ b/sys-boot/efibootmgr/efibootmgr-0.5.4-r1.ebuild
@@ -0,0 +1,44 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit flag-o-matic toolchain-funcs eutils
+
+DESCRIPTION="Interact with the EFI Boot Manager"
+HOMEPAGE="http://developer.intel.com/technology/efi"
+SRC_URI="http://linux.dell.com/efibootmgr/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 ia64 x86"
+IUSE=""
+
+RDEPEND="sys-apps/pciutils"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig"
+
+src_prepare() {
+ sed -i \
+ -e "/^LIBS/s:=.*:=$($(tc-getPKG_CONFIG) libpci --libs):" \
+ src/efibootmgr/module.mk || die
+
+ epatch "${FILESDIR}/${PN}-error-reporting.patch"
+}
+
+src_configure() {
+ strip-flags
+ tc-export CC
+}
+
+src_compile() {
+ emake EXTRA_CFLAGS="${CFLAGS}"
+}
+
+src_install() {
+ # build system uses perl, so just do it ourselves
+ dosbin src/efibootmgr/efibootmgr
+ doman src/man/man8/efibootmgr.8
+ dodoc AUTHORS README doc/ChangeLog doc/TODO
+}
diff --git a/sys-boot/efibootmgr/efibootmgr-0.5.4.ebuild b/sys-boot/efibootmgr/efibootmgr-0.5.4.ebuild
new file mode 100644
index 000000000000..7e7ad853c8ce
--- /dev/null
+++ b/sys-boot/efibootmgr/efibootmgr-0.5.4.ebuild
@@ -0,0 +1,39 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+inherit flag-o-matic toolchain-funcs
+
+DESCRIPTION="Interact with the EFI Boot Manager"
+HOMEPAGE="http://developer.intel.com/technology/efi"
+SRC_URI="http://linux.dell.com/efibootmgr/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ia64 ~x86"
+IUSE=""
+
+RDEPEND="sys-apps/pciutils"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig"
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+ sed -i \
+ -e "/^LIBS/s:=.*:=$($(tc-getPKG_CONFIG) libpci --libs):" \
+ src/efibootmgr/module.mk || die
+}
+
+src_compile() {
+ strip-flags
+ tc-export CC
+ emake EXTRA_CFLAGS="${CFLAGS}" || die
+}
+
+src_install() {
+ # build system uses perl, so just do it ourselves
+ dosbin src/efibootmgr/efibootmgr || die
+ doman src/man/man8/efibootmgr.8
+ dodoc AUTHORS README doc/ChangeLog doc/TODO
+}
diff --git a/sys-boot/efibootmgr/efibootmgr-0.6.0.ebuild b/sys-boot/efibootmgr/efibootmgr-0.6.0.ebuild
new file mode 100644
index 000000000000..1e081e56dbcd
--- /dev/null
+++ b/sys-boot/efibootmgr/efibootmgr-0.6.0.ebuild
@@ -0,0 +1,41 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit flag-o-matic toolchain-funcs eutils
+
+DESCRIPTION="Interact with the EFI Boot Manager"
+HOMEPAGE="http://developer.intel.com/technology/efi"
+SRC_URI="http://linux.dell.com/${PN}/${P}/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~ia64 ~x86"
+IUSE=""
+
+RDEPEND="sys-apps/pciutils"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig"
+
+src_prepare() {
+ sed -i \
+ -e "/^LIBS/s:=.*:=$($(tc-getPKG_CONFIG) libpci --libs):" \
+ src/efibootmgr/module.mk || die
+
+ epatch "${FILESDIR}/${PN}-error-reporting.patch"
+}
+
+src_compile() {
+ strip-flags
+ tc-export CC
+ emake EXTRA_CFLAGS="${CFLAGS}"
+}
+
+src_install() {
+ # build system uses perl, so just do it ourselves
+ dosbin src/efibootmgr/efibootmgr
+ doman src/man/man8/efibootmgr.8
+ dodoc AUTHORS README doc/ChangeLog doc/TODO
+}
diff --git a/sys-boot/efibootmgr/files/efibootmgr-error-reporting.patch b/sys-boot/efibootmgr/files/efibootmgr-error-reporting.patch
new file mode 100644
index 000000000000..2c769db23047
--- /dev/null
+++ b/sys-boot/efibootmgr/files/efibootmgr-error-reporting.patch
@@ -0,0 +1,40 @@
+@@ -, +, @@
+---
+ src/lib/efivars_sysfs.c | 16 +++++++++++++---
+ 1 files changed, 13 insertions(+), 3 deletions(-)
+--- a/src/lib/efivars_sysfs.c
++++ a/src/lib/efivars_sysfs.c
+@@ -66,6 +66,7 @@ static efi_status_t
+ sysfs_write_variable(const char *filename, efi_variable_t *var)
+ {
+ int fd;
++ int rc = EFI_SUCCESS;
+ size_t writesize;
+ char buffer[PATH_MAX+40];
+
+@@ -77,12 +78,21 @@ sysfs_write_variable(const char *filename, efi_variable_t *var)
+ return EFI_INVALID_PARAMETER;
+ }
+ writesize = write(fd, var, sizeof(*var));
++ if (writesize == -1) {
++ if (errno == -ENOSPC)
++ rc = EFI_OUT_OF_RESOURCES;
++ else
++ rc = EFI_INVALID_PARAMETER;
++ goto out;
++ }
+ if (writesize != sizeof(*var)) {
+- close(fd);
+- return EFI_INVALID_PARAMETER;
++ rc = EFI_INVALID_PARAMETER;
+ }
++out:
++ if (rc != EFI_SUCCESS)
++ fprintf(stderr, "Failed to write variable: %s\n", strerror(errno));
+ close(fd);
+- return EFI_SUCCESS;
++ return rc;
+ }
+
+
+--
diff --git a/sys-boot/efibootmgr/metadata.xml b/sys-boot/efibootmgr/metadata.xml
new file mode 100644
index 000000000000..421afa8a715b
--- /dev/null
+++ b/sys-boot/efibootmgr/metadata.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>floppym@gentoo.org</email>
+ <name>Mike Gilbert</name>
+ </maintainer>
+ <maintainer>
+ <email>yannick.schaeffer@epfl.ch</email>
+ <name>Yannick Schaeffer</name>
+ </maintainer>
+ <herd>proxy-maintainers</herd>
+ <longdescription>
+ This is efibootmgr, a Linux user-space application to modify the Intel
+ Extensible Firmware Interface (EFI) Boot Manager. This application
+ can create and destroy boot entries, change the boot order, change
+ the next running boot option, and more.
+ </longdescription>
+</pkgmetadata>
diff --git a/sys-boot/elilo/Manifest b/sys-boot/elilo/Manifest
new file mode 100644
index 000000000000..ebf2b3bb6172
--- /dev/null
+++ b/sys-boot/elilo/Manifest
@@ -0,0 +1,6 @@
+DIST elilo-3.10.tar.gz 210896 SHA256 65d0d7cc31bd0ef6824b9394dbf8991eb850aa4ba2dde1f9302e3da3cb2a4399
+DIST elilo-3.12-source.tar.gz 215125 SHA256 5005534ae972603c65caa8debb2bf3c4a22b895588323bc1b0a7a9f114e030ee
+DIST elilo-nightly_2006-03-14.tgz 168991 SHA256 b5174f1d921212b65f708869ea374e7c3e4e1b0771738b03ae6a1830cb4fe65c
+DIST elilo_3.10-1.diff.gz 26456 SHA256 de81eb071d4c7a3f02c629911cfd95f0fdc8705575df7a596e5630788bbb3643
+DIST elilo_3.12-1.diff.gz 28806 SHA256 26532bdf9a8c3455d12f22c59d1d5d9656dcb432dabd1a80cdbcd010e93305b5
+DIST elilo_3.6-1.diff.gz 14944 SHA256 cc9e3d753823ad1bc50f935017e8b5cdc5d76cac2a37c498c862ef021e0e0073
diff --git a/sys-boot/elilo/elilo-3.10.ebuild b/sys-boot/elilo/elilo-3.10.ebuild
new file mode 100644
index 000000000000..06485c29c45b
--- /dev/null
+++ b/sys-boot/elilo/elilo-3.10.ebuild
@@ -0,0 +1,71 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+inherit toolchain-funcs eutils
+
+DESCRIPTION="Linux boot loader for EFI-based systems such as IA-64"
+HOMEPAGE="http://elilo.sourceforge.net/"
+SRC_URI="mirror://sourceforge/elilo/${P}.tar.gz"
+SRC_URI="${SRC_URI} mirror://debian/pool/main/e/elilo/elilo_3.10-1.diff.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ia64 ~x86"
+IUSE=""
+
+# gnu-efi contains only static libs, so there's no run-time dep on it
+DEPEND=">=sys-boot/gnu-efi-3.0g
+ sys-devel/patch
+ dev-util/patchutils"
+RDEPEND="sys-boot/efibootmgr
+ sys-fs/dosfstools"
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+
+ ebegin Applying ../*.diff
+ # Using epatch on this is annoying because it wants to create the elilo-3.6/
+ # directory. Since all the files are new, it doesn't know better.
+ filterdiff -p1 -i debian/\* ../*.diff | patch -s -p1
+ eend $? || return
+
+ # Now Gentooize it
+ sed -i "
+ 1s:/bin/sh:/bin/bash:;
+ s/##VERSION##/$PV/;
+ s/Debian GNU\//Gentoo /g;
+ s/Debian/Gentoo/g;
+ s/debian/gentoo/g;
+ s/dpkg --print-installation-architecture/uname -m/" debian/elilo.sh
+}
+
+src_compile() {
+ local iarch
+ case $(tc-arch) in
+ ia64) iarch=ia64 ;;
+ x86) iarch=ia32 ;;
+ amd64) iarch=x86_64 ;;
+ *) die "unknown architecture: $(tc-arch)" ;;
+ esac
+
+ # "prefix" on the next line specifies where to find gcc, as, ld,
+ # etc. It's not the usual meaning of "prefix". By blanking it we
+ # allow PATH to be searched.
+ emake -j1 prefix= CC="$(tc-getCC)" ARCH=${iarch} || die "emake failed"
+}
+
+src_install() {
+ exeinto /usr/lib/elilo
+ doexe elilo.efi || die "elilo.efi failed"
+
+ newsbin debian/elilo.sh elilo || die "elilo failed"
+ dosbin tools/eliloalt || die "eliloalt failed"
+
+ insinto /etc
+ newins "${FILESDIR}"/elilo.conf.sample elilo.conf
+
+ dodoc docs/* "${FILESDIR}"/elilo.conf.sample
+ doman debian/*.[0-9]
+}
diff --git a/sys-boot/elilo/elilo-3.12.ebuild b/sys-boot/elilo/elilo-3.12.ebuild
new file mode 100644
index 000000000000..d56f2d60422e
--- /dev/null
+++ b/sys-boot/elilo/elilo-3.12.ebuild
@@ -0,0 +1,71 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+inherit toolchain-funcs eutils
+
+DESCRIPTION="Linux boot loader for EFI-based systems such as IA-64"
+HOMEPAGE="http://elilo.sourceforge.net/"
+SRC_URI="mirror://sourceforge/elilo/${P}-source.tar.gz"
+SRC_URI="${SRC_URI} mirror://debian/pool/main/e/elilo/elilo_3.12-1.diff.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ia64 ~x86"
+IUSE=""
+
+# gnu-efi contains only static libs, so there's no run-time dep on it
+DEPEND=">=sys-boot/gnu-efi-3.0g
+ sys-devel/patch
+ dev-util/patchutils"
+RDEPEND="sys-boot/efibootmgr
+ sys-fs/dosfstools"
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+
+ ebegin Applying ../*.diff
+ # Using epatch on this is annoying because it wants to create the elilo-3.6/
+ # directory. Since all the files are new, it doesn't know better.
+ filterdiff -p1 -i debian/\* ../*.diff | patch -s -p1
+ eend $? || return
+
+ # Now Gentooize it
+ sed -i "
+ 1s:/bin/sh:/bin/bash:;
+ s/##VERSION##/$PV/;
+ s/Debian GNU\//Gentoo /g;
+ s/Debian/Gentoo/g;
+ s/debian/gentoo/g;
+ s/dpkg --print-architecture/uname -m/" debian/elilo.sh
+}
+
+src_compile() {
+ local iarch
+ case $(tc-arch) in
+ ia64) iarch=ia64 ;;
+ x86) iarch=ia32 ;;
+ amd64) iarch=x86_64 ;;
+ *) die "unknown architecture: $(tc-arch)" ;;
+ esac
+
+ # "prefix" on the next line specifies where to find gcc, as, ld,
+ # etc. It's not the usual meaning of "prefix". By blanking it we
+ # allow PATH to be searched.
+ emake -j1 prefix= CC="$(tc-getCC)" ARCH=${iarch} || die "emake failed"
+}
+
+src_install() {
+ exeinto /usr/lib/elilo
+ doexe elilo.efi || die "elilo.efi failed"
+
+ newsbin debian/elilo.sh elilo || die "elilo failed"
+ dosbin tools/eliloalt || die "eliloalt failed"
+
+ insinto /etc
+ newins "${FILESDIR}"/elilo.conf.sample elilo.conf
+
+ dodoc docs/* "${FILESDIR}"/elilo.conf.sample
+ doman debian/*.[0-9]
+}
diff --git a/sys-boot/elilo/elilo-3.6_p20060314.ebuild b/sys-boot/elilo/elilo-3.6_p20060314.ebuild
new file mode 100644
index 000000000000..ea7593c0ce03
--- /dev/null
+++ b/sys-boot/elilo/elilo-3.6_p20060314.ebuild
@@ -0,0 +1,87 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+inherit toolchain-funcs eutils
+
+DESCRIPTION="Linux boot loader for EFI-based systems such as IA-64"
+HOMEPAGE="http://elilo.sourceforge.net/"
+if [[ $PV == *_p* ]] ; then
+ MY_P=${PV#*_p}
+ MY_P=${PN}-nightly_${MY_P:0:4}-${MY_P:4:2}-${MY_P:6:2}
+ SRC_URI="http://elilo.sourceforge.net/nightlies/${MY_P}.tgz"
+ S=${WORKDIR}/elilo
+else
+ MY_P=${P}
+ SRC_URI="mirror://sourceforge/elilo/${P}.src.tgz"
+fi
+SRC_URI="${SRC_URI} mirror://debian/pool/main/e/elilo/elilo_3.6-1.diff.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="ia64"
+IUSE=""
+
+# gnu-efi contains only static libs, so there's no run-time dep on it
+DEPEND=">=sys-boot/gnu-efi-3.0
+ sys-devel/patch
+ dev-util/patchutils"
+RDEPEND="sys-boot/efibootmgr
+ sys-fs/dosfstools"
+
+S=${WORKDIR}/${PN}
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+
+ ebegin Applying ../*.diff
+ # Using epatch on this is annoying because it wants to create the elilo-3.6/
+ # directory. Since all the files are new, it doesn't know better.
+ filterdiff -p1 -i debian/\* ../*.diff | patch -s -p1
+ eend $? || return
+
+ # Add patch for vmm support, from
+ # http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=350185
+ epatch "${FILESDIR}"/elilo.sh-vmm.patch
+
+ # Don't count files twice when summing bytesneeded
+ epatch "${FILESDIR}"/elilo.sh-chkspace.patch
+
+ # Now Gentooize it
+ sed -i "
+ 1s/sh/bash/;
+ s/##VERSION##/$PV/;
+ s/Debian GNU\//Gentoo /g;
+ s/Debian/Gentoo/g;
+ s/debian/gentoo/g;
+ s/dpkg --print-installation-architecture/uname -m/" debian/elilo.sh
+}
+
+src_compile() {
+ local iarch
+ case $(tc-arch) in
+ ia64) iarch=ia64 ;;
+ x86) iarch=ia32 ;;
+ *) die "unknown architecture: $(tc-arch)" ;;
+ esac
+
+ # "prefix" on the next line specifies where to find gcc, as, ld,
+ # etc. It's not the usual meaning of "prefix". By blanking it we
+ # allow PATH to be searched.
+ emake -j1 prefix= CC="$(tc-getCC)" ARCH=${iarch} || die "emake failed"
+}
+
+src_install() {
+ exeinto /usr/lib/elilo
+ doexe elilo.efi || die "elilo.efi failed"
+
+ newsbin debian/elilo.sh elilo || die "elilo failed"
+ dosbin tools/eliloalt || die "eliloalt failed"
+
+ insinto /etc
+ newins "${FILESDIR}"/elilo.conf.sample elilo.conf
+
+ dodoc docs/* "${FILESDIR}"/elilo.conf.sample
+ doman debian/*.[0-9]
+}
diff --git a/sys-boot/elilo/files/elilo.conf.sample b/sys-boot/elilo/files/elilo.conf.sample
new file mode 100644
index 000000000000..ed97975c69d7
--- /dev/null
+++ b/sys-boot/elilo/files/elilo.conf.sample
@@ -0,0 +1,9 @@
+boot=/dev/sda1
+install=/usr/lib/elilo/elilo.efi
+delay=20
+default=gentoo
+
+image=/boot/kernel-2.6.12-gentoo-r6
+ label=gentoo
+ root=/dev/sda3
+ read-only
diff --git a/sys-boot/elilo/files/elilo.sh-chkspace.patch b/sys-boot/elilo/files/elilo.sh-chkspace.patch
new file mode 100644
index 000000000000..710780e8da6c
--- /dev/null
+++ b/sys-boot/elilo/files/elilo.sh-chkspace.patch
@@ -0,0 +1,15 @@
+Don't count duplicate files twice when summing bytesneeded
+
+--- elilo/debian/elilo.sh.chkspace 2006-03-16 07:53:00.000000000 -0500
++++ elilo/debian/elilo.sh 2006-03-16 07:53:27.000000000 -0500
+@@ -580,7 +580,9 @@
+ sed 's/.*=[[:space:]]*//' | grep -v ':'`
+ vmmfiles=`grep '^[[:space:]]*vmm[[:space:]]*=' $bootconf | \
+ sed 's/.*=[[:space:]]*//' | grep -v ':'`
+- bytesneeded=`cat $imagefiles $initrdfiles $vmmfiles 2>/dev/null | wc -c`
++ allfiles=`for f in $imagefiles $initrdfiles $install $bootconf; do \
++ echo $f; done | sort -u`
++ bytesneeded=`cat $allfiles 2>/dev/null | wc -c`
+ # convert to KB, allowing 5% overhead
+ kbneeded=$(( bytesneeded / 1024 + bytesneeded / 20480 ))
+ kbavailable=$(df -P -k $TARGET | sed -n "s|^$boot[[:space:]]\+[0-9]\+[[:space:]]\+[0-9]\+[[:space:]]\+\([0-9]\+\).*$|\1|p")
diff --git a/sys-boot/elilo/files/elilo.sh-vmm.patch b/sys-boot/elilo/files/elilo.sh-vmm.patch
new file mode 100644
index 000000000000..294eb03b2226
--- /dev/null
+++ b/sys-boot/elilo/files/elilo.sh-vmm.patch
@@ -0,0 +1,43 @@
+Patch from Alex Williamson in
+http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=350185 support of vmm= in the
+elilo script
+
+--- elilo/debian/elilo.sh.novmm 2006-03-16 07:49:19.000000000 -0500
++++ elilo/debian/elilo.sh 2006-03-16 07:48:47.000000000 -0500
+@@ -364,6 +364,8 @@
+ sed 's/^image[[:space:]]*=[[:space:]]*//' | grep -v ':'`
+ initrdfiles=`grep '^[[:space:]]*initrd[[:space:]]*=' $bootconf | \
+ sed 's/.*=[[:space:]]*//' | grep -v ':'`
++ vmmfiles=`grep '^[[:space:]]*vmm[[:space:]]*=' $bootconf | \
++ sed 's/.*=[[:space:]]*//' | grep -v ':'`
+
+ ## Point of no return, removing the old EFI/debian tree
+ rm -rf $TARGET/$EFIROOT
+@@ -398,6 +400,7 @@
+ -e "s|\t| |g" \
+ -e "s|\(^image[[:space:]]*=[[:space:]]*\)\([^:]*\)$|\1$EFIROOT\2|" \
+ -e "s|\(^[[:space:]]*initrd[[:space:]]*=[[:space:]]*\)\([^:]*\)$|\1$EFIROOT\2|" \
++ -e "s|\(^[[:space:]]*vmm[[:space:]]*=[[:space:]]*\)\([^:]*\)$|\1$EFIROOT\2|" \
+ < "$bootconf" > "$TARGET/$EFIROOT/$CFFILE"
+ if [ $? != 0 ] ; then
+ echo 1>&2 "$PRG: An error occured while writing to $boot"
+@@ -406,7 +409,7 @@
+
+ [ "$DEBUG" = 1 ] && echo "----" && cat "$TARGET/$EFIROOT/$CFFILE" && echo "----"
+
+- for i in $imagefiles $initrdfiles; do
++ for i in $imagefiles $initrdfiles $vmmfiles; do
+ [ "$VERBOSE" = 1 ] && echo "$PRG: Installing $i on $boot..."
+ if [ -f $i ]; then
+ mkdir -p `dirname "$TARGET/$EFIROOT/$i"`
+@@ -575,7 +578,9 @@
+ sed 's/^image[[:space:]]*=[[:space:]]*//' | grep -v ':'`
+ initrdfiles=`grep '^[[:space:]]*initrd[[:space:]]*=' $bootconf | \
+ sed 's/.*=[[:space:]]*//' | grep -v ':'`
+- bytesneeded=`cat $imagefiles $initrdfiles $install $bootconf 2>/dev/null | wc -c`
++ vmmfiles=`grep '^[[:space:]]*vmm[[:space:]]*=' $bootconf | \
++ sed 's/.*=[[:space:]]*//' | grep -v ':'`
++ bytesneeded=`cat $imagefiles $initrdfiles $vmmfiles 2>/dev/null | wc -c`
+ # convert to KB, allowing 5% overhead
+ kbneeded=$(( bytesneeded / 1024 + bytesneeded / 20480 ))
+ kbavailable=$(df -P -k $TARGET | sed -n "s|^$boot[[:space:]]\+[0-9]\+[[:space:]]\+[0-9]\+[[:space:]]\+\([0-9]\+\).*$|\1|p")
diff --git a/sys-boot/elilo/metadata.xml b/sys-boot/elilo/metadata.xml
new file mode 100644
index 000000000000..9b47aaca752f
--- /dev/null
+++ b/sys-boot/elilo/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>ia64</herd>
+ <upstream>
+ <remote-id type="sourceforge">elilo</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-boot/getdvhoff/Manifest b/sys-boot/getdvhoff/Manifest
new file mode 100644
index 000000000000..5e147fc072ad
--- /dev/null
+++ b/sys-boot/getdvhoff/Manifest
@@ -0,0 +1 @@
+DIST sgibootcd-0.12.tar.bz2 3810 SHA256 2b0bfd0ebaa218fec414ff7102b8128dc658110fbeac83a510dc87d6559f299c SHA512 180e4f5a185b14c0b2c8158b368a50a3a55673fa86760e2a424c9533b1bb8ec37824c715ba02fd264621e2e31906ddd310398e9f24cf19147bce3e49fc62da3e WHIRLPOOL a1c98b2b6fc48201f4db47ac3a48cd64bb84becd5d664a8418a02115c47cb462e527aa1ba1dad4c58367441178101fe2661e9e2b08f67f1c8566f73e3c9eb08c
diff --git a/sys-boot/getdvhoff/getdvhoff-0.12-r1.ebuild b/sys-boot/getdvhoff/getdvhoff-0.12-r1.ebuild
new file mode 100644
index 000000000000..d5163e6053cf
--- /dev/null
+++ b/sys-boot/getdvhoff/getdvhoff-0.12-r1.ebuild
@@ -0,0 +1,37 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+inherit eutils toolchain-funcs
+
+DESCRIPTION="Utility for use on LiveCDs to calculate offset of the ext2 partition for losetup"
+HOMEPAGE="ftp://ftp.linux-mips.org/pub/linux/mips/people/skylark/"
+SRC_URI="ftp://ftp.linux-mips.org/pub/linux/mips/people/skylark/sgibootcd-${PV}.tar.bz2"
+LICENSE="all-rights-reserved"
+SLOT="0"
+KEYWORDS="-* ~mips"
+IUSE=""
+DEPEND="dev-libs/klibc"
+RESTRICT=""
+S="${WORKDIR}/sgibootcd-${PV}"
+MY_S="${S}/helpers"
+
+src_compile() {
+ cd ${MY_S}
+ local mycc="$(tc-getCC)"
+ local mysrc="getdvhoff.c"
+ local klloc="/usr/lib/klibc"
+ local klobjs="${klloc}/lib/crt0.o ${klloc}/lib/libc.a"
+ local klcflags="-march=mips3 -Os -fno-pic -mno-abicalls -I${klloc}/include -I${klloc}/include/bits32 -D__KLIBC__ -nostdlib"
+
+ [ -f "${MY_S}/getdvhoff" ] && rm -f ${MY_S}/${PN}
+ einfo "${mycc} ${klcflags} ${mysrc} ${klobjs} -o ${PN} -N"
+ ${mycc} ${klcflags} ${mysrc} ${klobjs} -o ${PN} -N
+}
+
+src_install() {
+ cd ${MY_S}
+ dodir /usr/lib/${PN}
+ cp "${MY_S}"/"${PN}" "${D}"/usr/lib/"${PN}"
+}
diff --git a/sys-boot/getdvhoff/metadata.xml b/sys-boot/getdvhoff/metadata.xml
new file mode 100644
index 000000000000..cf342cc69cfe
--- /dev/null
+++ b/sys-boot/getdvhoff/metadata.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>mips</herd>
+ <maintainer>
+ <email>mips@gentoo.org</email>
+ <name>Mips Team</name>
+ </maintainer>
+
+ <longdescription>
+ getdvhoff - Utility for use on LiveCDs to calculate offset of the ext2 partition for losetup
+ </longdescription>
+</pkgmetadata>
+
diff --git a/sys-boot/gnu-efi/Manifest b/sys-boot/gnu-efi/Manifest
new file mode 100644
index 000000000000..acc5cc927d56
--- /dev/null
+++ b/sys-boot/gnu-efi/Manifest
@@ -0,0 +1,8 @@
+DIST gnu-efi-3.0.2.tar.bz2 136134 SHA256 194b580ecdb1fad0e41914845ba064c279afb687855960b58693459e5537b4d7 SHA512 960dc0374dd63dea5eb25e2bf6670d3f7474ebeca2090514c2895b28ff6e058a852958d028eadbe156df4645bd04d1a93ffaae1153861fce6e7da72f8f9dbeec WHIRLPOOL 3e692058a74f3f42867f84fe6af41cc0911280b2a295c441b2c4e27d116f162e0d166fe713b8eb15a6c6a8184037bae34db6ee1f0fdf7c2f9e53ee8215b2cfdb
+DIST gnu-efi-3.0a.tar.gz 119079 SHA256 661b94996c184216dfd678b8a1ab82bd6afb82c55320841ba9c74db7aebb828a
+DIST gnu-efi_3.0g.orig.tar.gz 272150 SHA256 531971707640faeb994c0b102b9ccf2e1920b97d080e4cb2b6e55ea2318d6af0
+DIST gnu-efi_3.0i-2.diff.gz 4838 SHA256 4488db1978215e06a6e859fb75491d7f5bd5a6821e70be0ba604f0de628a442f SHA512 c4c141f976bc3178b0df44c23b0210eb629007862e7d0333c98ea58d5bc13d9ae523012399097175d916c4159870f50bcd6c282647996bde6619d35b9e9658e0 WHIRLPOOL 2a5f1737dd245332facf7386ff406498ccb417d3ec1ab74dd793e9074b537bee6249620fb92ee76ff54855531fa21ac70ff3d4b06187d89e195bcf03197a24cf
+DIST gnu-efi_3.0i-4.diff.gz 4746 SHA256 3f895d26ea855d617513845d4e15a288646d203500b56d9a4f696a6a65799d2e SHA512 bf64a613597f20d06c09a351bf21cf57eea4cf0a46f9d15c7c2e1ba2fa7fc43e45c7a15e38f822a09e17a61299afa271e4228a264fb7c42a19be1666237d757e WHIRLPOOL 4e5c7b59a2982a04e209146981f4c87b911656ea3bd6a8daa4e6cac83ade50a765e49f45aabecb65004db8f37aad5ca2814cfae93e227da7fdf0665d111ff760
+DIST gnu-efi_3.0i.orig.tar.gz 135068 SHA256 13bea8e387984e04d93e14004a2e24539802fb2bd42cac112c8a816395d95366 SHA512 e3a88e2cf53209c0620e5f7c4f009f7872fad15d239d68aa55a069c399aad26d49d596f225ec9f340af27ec3981386f45d66ffe20138809f2d87432597287a60 WHIRLPOOL dda0e3f9bd55dcaef2494bda7ff4a371a26ff295a008a12bc41069a6f3120eac90e170ef1450513995c8c356d01d581827f1eed2be46dbca938baed012011e12
+DIST gnu-efi_3.0s.orig.tar.gz 147229 SHA256 10d69f24086aa35583c0b4fff7c8a0c07c065ed2c29e1570532d20393fd777a1 SHA512 a7c8e38f12b5083eab5e65d5d78e2035bd4e236e43af19fa35b7aca4021fa9b601bf71f40090826b5fc127acf86d5f980f5eeb99b82f04c6a374545e1da2df69 WHIRLPOOL 5a781722296325158757424d1c3944b0274cbd2a926dc61540ae45153012cb2bcc9b670753e41b1b326c4de0332c3e9401bf869539f6188e1593e5de0fcad037
+DIST gnu-efi_3.0u.orig.tar.gz 159662 SHA256 3c0d450d5829204ca05dcb3b2aae772e52c379b7c7e09146759c6315606f934e SHA512 77224d555befb96b14c20a3a39aacb50ed2db9dfff0c112113c3fb211152106f76cf278b4d37b4251e9f83327c7fd59319e6dee802c97d3bfa7308f7c43b34e3 WHIRLPOOL 1bf63f9f291fd198b97f74542c4344f065cad4ccc1ea0861c421464903bdd23ab1af0a3d3c36d18cfd88fda402184db78ffe9470d0664ff57724380cbd4c4040
diff --git a/sys-boot/gnu-efi/files/gnu-efi-3.0a-lds-redhat.patch b/sys-boot/gnu-efi/files/gnu-efi-3.0a-lds-redhat.patch
new file mode 100644
index 000000000000..d47dc3a0d053
--- /dev/null
+++ b/sys-boot/gnu-efi/files/gnu-efi-3.0a-lds-redhat.patch
@@ -0,0 +1,42 @@
+Updated lds patch from redhat which works with newer binutils.
+
+http://bugs.gentoo.org/show_bug.cgi?id=79091
+
+--- gnuefi/elf_ia64_efi.lds
++++ gnuefi/elf_ia64_efi.lds
+@@ -28,6 +28,5 @@
+ {
+ *(.rodata*)
+ *(.ctors)
+- *(.data)
+- *(.data1)
++ *(.data*)
+ *(.gnu.linkonce.d*)
+@@ -31,8 +31,4 @@ SECTIONS
+ *(.plabel) /* data whose relocs we want to ignore */
+- *(.IA_64.unwind)
+- *(.IA_64.unwind_info)
+- *(.IA64.unwind)
+- *(.IA64.unwind_info)
+ /* the EFI loader doesn't seem to like a .bss section, so we stick
+ it all into .data: */
+ *(.dynbss)
+@@ -48,7 +47,7 @@
+ .rela :
+ {
+ *(.rela.text)
+- *(.rela.data)
++ *(.rela.data*)
+ *(.rela.sdata)
+ *(.rela.got)
+ *(.rela.gnu.linkonce.d*)
+@@ -68,4 +64,9 @@ SECTIONS
+ *(.rela.plabel)
+ *(.rela.reloc)
+ }
++ /DISCARD/ :
++ {
++ *(.IA_64.unwind*)
++ *(.IA64.unwind*)
++ }
+ }
diff --git a/sys-boot/gnu-efi/files/gnu-efi-3.0a-lds.patch b/sys-boot/gnu-efi/files/gnu-efi-3.0a-lds.patch
new file mode 100644
index 000000000000..f16efdbcfcff
--- /dev/null
+++ b/sys-boot/gnu-efi/files/gnu-efi-3.0a-lds.patch
@@ -0,0 +1,55 @@
+--- gnu-efi-3.0a.orig/gnuefi/elf_ia32_efi.lds
++++ gnu-efi-3.0a/gnuefi/elf_ia32_efi.lds
+@@ -17,6 +17,7 @@
+ *(.rodata*)
+ *(.data)
+ *(.data1)
++ *(.data.*)
+ *(.sdata)
+ *(.got.plt)
+ *(.got)
+@@ -34,8 +35,13 @@
+ .rel :
+ {
+ *(.rel.data)
++ *(.rel.data.*)
+ *(.rel.got)
+ *(.rel.stab)
++ *(.data.rel.ro.local)
++ *(.data.rel.local)
++ *(.data.rel.ro)
++ *(.data.rel*)
+ }
+ . = ALIGN(4096);
+ .dynsym : { *(.dynsym) }
+@@ -46,4 +52,9 @@
+ {
+ *(.rel.reloc)
+ }
++ .ignored :
++ {
++ *(.eh_frame)
++ }
+ }
++
+--- gnu-efi-3.0a.orig/gnuefi/elf_ia64_efi.lds
++++ gnu-efi-3.0a/gnuefi/elf_ia64_efi.lds
+@@ -28,8 +28,7 @@
+ {
+ *(.rodata*)
+ *(.ctors)
+- *(.data)
+- *(.data1)
++ *(.data*)
+ *(.gnu.linkonce.d*)
+ *(.plabel) /* data whose relocs we want to ignore */
+ *(.IA_64.unwind)
+@@ -48,7 +47,7 @@
+ .rela :
+ {
+ *(.rela.text)
+- *(.rela.data)
++ *(.rela.data*)
+ *(.rela.sdata)
+ *(.rela.got)
+ *(.rela.gnu.linkonce.d*)
diff --git a/sys-boot/gnu-efi/gnu-efi-3.0.2.ebuild b/sys-boot/gnu-efi/gnu-efi-3.0.2.ebuild
new file mode 100644
index 000000000000..508f0a9b236b
--- /dev/null
+++ b/sys-boot/gnu-efi/gnu-efi-3.0.2.ebuild
@@ -0,0 +1,49 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit multilib
+
+DESCRIPTION="Library for build EFI Applications"
+HOMEPAGE="http://gnu-efi.sourceforge.net/"
+SRC_URI="mirror://sourceforge/gnu-efi/${P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="-* ~amd64 ~arm ~arm64 ~ia64 ~x86"
+IUSE=""
+
+DEPEND="sys-apps/pciutils"
+RDEPEND=""
+
+# These objects get run early boot (i.e. not inside of Linux),
+# so doing these QA checks on them doesn't make sense.
+QA_EXECSTACK="usr/*/lib*efi.a:* usr/*/crt*.o"
+
+_emake() {
+ emake \
+ prefix=${CHOST}- \
+ ARCH=${iarch} \
+ PREFIX="${EPREFIX}/usr" \
+ LIBDIR='$(PREFIX)/'"$(get_libdir)" \
+ "$@"
+}
+
+src_compile() {
+ case ${ARCH} in
+ ia64) iarch=ia64 ;;
+ x86) iarch=ia32 ;;
+ amd64) iarch=x86_64 ;;
+ *) die "unknown architecture: $ARCH" ;;
+ esac
+ # The lib subdir uses unsafe archive targets, and
+ # the apps subdir needs gnuefi subdir
+ _emake -j1
+}
+
+src_install() {
+ _emake install PREFIX=/usr INSTALLROOT="${D}"
+ dodoc README* ChangeLog
+}
diff --git a/sys-boot/gnu-efi/gnu-efi-3.0a-r1.ebuild b/sys-boot/gnu-efi/gnu-efi-3.0a-r1.ebuild
new file mode 100644
index 000000000000..c04d1ceddc82
--- /dev/null
+++ b/sys-boot/gnu-efi/gnu-efi-3.0a-r1.ebuild
@@ -0,0 +1,37 @@
+# Copyright 1999-2007 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+inherit eutils toolchain-funcs
+
+DESCRIPTION="Library for build EFI Applications"
+HOMEPAGE="http://developer.intel.com/technology/efi"
+SRC_URI="ftp://ftp.hpl.hp.com/pub/linux-ia64/gnu-efi-3.0a.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="ia64 x86"
+IUSE=""
+
+DEPEND="sys-apps/pciutils"
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+ epatch "${FILESDIR}"/gnu-efi-3.0a-lds-redhat.patch
+}
+
+src_compile() {
+ local iarch
+ case $ARCH in
+ ia64) iarch=ia64 ;;
+ x86) iarch=ia32 ;;
+ *) die "unknown architecture: $ARCH" ;;
+ esac
+ emake CC="$(tc-getCC)" ARCH=${iarch} -j1 || die "emake failed"
+}
+
+src_install() {
+ make install INSTALLROOT="${D}"/usr || die "install failed"
+ dodoc README* ChangeLog
+}
diff --git a/sys-boot/gnu-efi/gnu-efi-3.0g.ebuild b/sys-boot/gnu-efi/gnu-efi-3.0g.ebuild
new file mode 100644
index 000000000000..25c70228b664
--- /dev/null
+++ b/sys-boot/gnu-efi/gnu-efi-3.0g.ebuild
@@ -0,0 +1,36 @@
+# Copyright 1999-2010 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+inherit eutils toolchain-funcs
+
+MY_P="${PN}_${PV}"
+
+DESCRIPTION="Library for build EFI Applications"
+HOMEPAGE="http://developer.intel.com/technology/efi"
+SRC_URI="mirror://sourceforge/gnu-efi/${MY_P}.orig.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ia64 ~x86"
+IUSE=""
+
+DEPEND="sys-apps/pciutils"
+
+S="${WORKDIR}"/${PN}-3.0
+
+src_compile() {
+ local iarch
+ case $ARCH in
+ ia64) iarch=ia64 ;;
+ x86) iarch=ia32 ;;
+ amd64) iarch=x86_64 ;;
+ *) die "unknown architecture: $ARCH" ;;
+ esac
+ emake CC="$(tc-getCC)" ARCH=${iarch} -j1 || die "emake failed"
+}
+
+src_install() {
+ make install INSTALLROOT="${D}"/usr || die "install failed"
+ dodoc README* ChangeLog
+}
diff --git a/sys-boot/gnu-efi/gnu-efi-3.0i.ebuild b/sys-boot/gnu-efi/gnu-efi-3.0i.ebuild
new file mode 100644
index 000000000000..01e7dadb5a34
--- /dev/null
+++ b/sys-boot/gnu-efi/gnu-efi-3.0i.ebuild
@@ -0,0 +1,42 @@
+# Copyright 1999-2010 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+inherit eutils
+
+MY_P="${PN}_${PV}"
+DESCRIPTION="Library for build EFI Applications"
+HOMEPAGE="http://developer.intel.com/technology/efi"
+SRC_URI="mirror://sourceforge/gnu-efi/${MY_P}.orig.tar.gz
+ mirror://debian/pool/main/g/gnu-efi/gnu-efi_3.0i-2.diff.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ia64 ~x86"
+IUSE=""
+
+DEPEND="sys-apps/pciutils"
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+ EPATCH_OPTS="-p1" epatch "${WORKDIR}"/*.diff
+}
+
+src_compile() {
+ local iarch
+ case $ARCH in
+ ia64) iarch=ia64 ;;
+ x86) iarch=ia32 ;;
+ amd64) iarch=x86_64 ;;
+ *) die "unknown architecture: $ARCH" ;;
+ esac
+ # The lib subdir uses unsafe archive targets, and
+ # the apps subdir needs gnuefi subdir
+ emake prefix=${CHOST}- ARCH=${iarch} -j1 || die
+}
+
+src_install() {
+ emake install INSTALLROOT="${D}"/usr || die
+ dodoc README* ChangeLog
+}
diff --git a/sys-boot/gnu-efi/gnu-efi-3.0s.ebuild b/sys-boot/gnu-efi/gnu-efi-3.0s.ebuild
new file mode 100644
index 000000000000..2adb77ad5e45
--- /dev/null
+++ b/sys-boot/gnu-efi/gnu-efi-3.0s.ebuild
@@ -0,0 +1,60 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+inherit eutils multilib
+
+MY_P="${PN}_${PV}"
+DEB_VER="3.0i-4"
+DESCRIPTION="Library for build EFI Applications"
+HOMEPAGE="http://developer.intel.com/technology/efi"
+SRC_URI="mirror://sourceforge/gnu-efi/${MY_P}.orig.tar.gz
+ mirror://debian/pool/main/g/gnu-efi/${PN}_${DEB_VER}.diff.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 ia64 x86"
+IUSE=""
+
+DEPEND="sys-apps/pciutils"
+RDEPEND=""
+
+S=${WORKDIR}/${P%?}
+
+# These objects get run early boot (i.e. not inside of Linux),
+# so doing these QA checks on them doesn't make sense.
+QA_EXECSTACK="usr/*/lib*efi.a:* usr/*/crt*.o"
+
+src_prepare() {
+ EPATCH_OPTS="-p1" epatch "${WORKDIR}"/*.diff
+ sed -i -e '/^CFLAGS/s:$: -fno-stack-protector:' Make.defaults || die #444246
+ if ! use amd64 && ! use x86 ; then
+ sed -i \
+ -e '/CPPFLAGS/s:-maccumulate-outgoing-args::' \
+ Make.defaults || die #503210
+ fi
+
+}
+
+_emake() {
+ emake prefix=${CHOST}- ARCH=${iarch} LIBDIR=$(get_libdir) "$@"
+}
+
+src_compile() {
+ case ${ARCH} in
+ ia64) iarch=ia64 ;;
+ x86) iarch=ia32 ;;
+ amd64) iarch=x86_64 ;;
+ *) die "unknown architecture: $ARCH" ;;
+ esac
+ # The lib subdir uses unsafe archive targets, and
+ # the apps subdir needs gnuefi subdir
+ _emake -j1
+}
+
+src_install() {
+ _emake install INSTALLROOT="${D}"/usr
+ dodoc README* ChangeLog
+}
diff --git a/sys-boot/gnu-efi/gnu-efi-3.0u.ebuild b/sys-boot/gnu-efi/gnu-efi-3.0u.ebuild
new file mode 100644
index 000000000000..b7d15303b6ec
--- /dev/null
+++ b/sys-boot/gnu-efi/gnu-efi-3.0u.ebuild
@@ -0,0 +1,58 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils multilib
+
+MY_P="${PN}_${PV}"
+DEB_VER="3.0i-4"
+DESCRIPTION="Library for build EFI Applications"
+HOMEPAGE="http://developer.intel.com/technology/efi"
+SRC_URI="mirror://sourceforge/gnu-efi/${MY_P}.orig.tar.gz
+ mirror://debian/pool/main/g/gnu-efi/${PN}_${DEB_VER}.diff.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~ia64 ~x86"
+IUSE=""
+
+DEPEND="sys-apps/pciutils"
+RDEPEND=""
+
+S=${WORKDIR}/${P%?}
+
+# These objects get run early boot (i.e. not inside of Linux),
+# so doing these QA checks on them doesn't make sense.
+QA_EXECSTACK="usr/*/lib*efi.a:* usr/*/crt*.o"
+
+src_prepare() {
+ EPATCH_OPTS="-p1" epatch "${WORKDIR}"/*.diff
+ if ! use amd64 && ! use x86 ; then
+ sed -i \
+ -e '/CPPFLAGS/s:-maccumulate-outgoing-args::' \
+ Make.defaults || die #503210
+ fi
+}
+
+_emake() {
+ emake prefix=${CHOST}- ARCH=${iarch} PREFIX=/usr "$@"
+}
+
+src_compile() {
+ case ${ARCH} in
+ ia64) iarch=ia64 ;;
+ x86) iarch=ia32 ;;
+ amd64) iarch=x86_64 ;;
+ *) die "unknown architecture: $ARCH" ;;
+ esac
+ # The lib subdir uses unsafe archive targets, and
+ # the apps subdir needs gnuefi subdir
+ _emake -j1
+}
+
+src_install() {
+ _emake install PREFIX=/usr INSTALLROOT="${D}"
+ dodoc README* ChangeLog
+}
diff --git a/sys-boot/gnu-efi/metadata.xml b/sys-boot/gnu-efi/metadata.xml
new file mode 100644
index 000000000000..010fc670dacc
--- /dev/null
+++ b/sys-boot/gnu-efi/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>ia64</herd>
+ <upstream>
+ <remote-id type="sourceforge">gnu-efi</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-boot/grub-static/Manifest b/sys-boot/grub-static/Manifest
new file mode 100644
index 000000000000..4e729b6f006e
--- /dev/null
+++ b/sys-boot/grub-static/Manifest
@@ -0,0 +1,6 @@
+DIST grub-static-0.96.tar.bz2 859179 SHA256 3ece8910e7954ca2c2cbebc4d05cfb22e73455f826508661a5b1a60481dcbd76
+DIST grub-static-0.97-r10.tar.bz2 888963 SHA256 812c8113efa13b6bfe254e866204b4763bf889c796835ed0b53cb64920428d82 SHA512 2a18405c9f7b0712dac2246213f723c1a2be6734bff133b7906e7c18e4370faf924f35d3b834d74761cf50b3ab59e969fbff010e13292618187c65a72aa45a87 WHIRLPOOL 418246dacc50d1232b657ed4a81f8ec34149008e4312109ced834cbc8b380bef7ba2cd4339b22dac521d823723e360d6a70f87e8601979e80673510ea597e0b0
+DIST grub-static-0.97-r12.tar.bz2 1171586 SHA256 865eb5b3131d30be7ddbbc6969e924f2d199353c076504a2668a8df5be17c51f SHA512 0a4c0b3b556db366df70c7c51a1a26f614f949be4002d7f9a053b7261b80c2c49410e8fd04c7e3717ea560e7cbc6a692d859d07bdfe2099a78a33bce78ac5395 WHIRLPOOL c6e05b297d8cf8c6d84495a122502740d2102c32f14bd2df8b80c9e43a91c7f58f50297dbd4e2ba70fe7aee44a0f06bfff94e597fbddc65fa5b93efd4c2e9fea
+DIST grub-static-0.97-r6.tar.bz2 1005650 SHA256 1a17a8df6839401f7d1829aebea45c1654c3fcdd6a6f068100126d2fcbe75698
+DIST grub-static-0.97-r9.tar.bz2 937621 SHA256 0d6af53c5380bd37ea67f314236364baebfff52762ea5e52bf2f66941dabe2d1 SHA512 a8b1f7cd416f2c41c88ba5c34889e7afe9615bf985e69b2d1d3ec2a20b7ceb13e53e8b3df91a5077bfa1a217f3274362033d72f9bafe3ad22be378f26728035c WHIRLPOOL 48c3556902369232a3ee5b1a9a0a61ebb951fd8c25590262d1c944170918e9d4e98fcf3ba3ccd47707e52aabca426c328cc7ad38f97baa9052d61d26a90522ab
+DIST grub-static-0.97.tar.bz2 954051 SHA256 468ac48823880bd7cb2dd6bf60673adef1313c44a5e3131a0a4a37d2cc1145bc
diff --git a/sys-boot/grub-static/grub-static-0.96-r1.ebuild b/sys-boot/grub-static/grub-static-0.96-r1.ebuild
new file mode 100644
index 000000000000..837694657ecf
--- /dev/null
+++ b/sys-boot/grub-static/grub-static-0.96-r1.ebuild
@@ -0,0 +1,18 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+DESCRIPTION="Static GNU GRUB boot loader"
+
+HOMEPAGE="http://www.gnu.org/software/grub/"
+SRC_URI="mirror://gentoo/grub-static-${PV}.tar.bz2"
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="-* amd64 ~x86"
+IUSE=""
+DEPEND="!<sys-boot/grub-2"
+RDEPEND="${DEPEND}"
+
+src_install() {
+ cp -a "${WORKDIR}"/* "${D}"/
+}
diff --git a/sys-boot/grub-static/grub-static-0.97-r10.ebuild b/sys-boot/grub-static/grub-static-0.97-r10.ebuild
new file mode 100644
index 000000000000..407ca8c02c89
--- /dev/null
+++ b/sys-boot/grub-static/grub-static-0.97-r10.ebuild
@@ -0,0 +1,176 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+# XXX: we need to review menu.lst vs grub.conf handling. We've been converting
+# all systems to grub.conf (and symlinking menu.lst to grub.conf), but
+# we never updated any of the source code (it still all wants menu.lst),
+# and there is no indication that upstream is making the transition.
+
+inherit eutils mount-boot toolchain-funcs linux-info
+
+PATCHVER="1.9" # Not used, just for tracking with main grub
+
+DESCRIPTION="GNU GRUB Legacy boot loader (static build)"
+
+HOMEPAGE="http://www.gnu.org/software/grub/"
+SRC_URI="mirror://gentoo/${PF}.tar.bz2"
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="-* amd64 ~x86"
+IUSE=""
+DEPEND="!<sys-boot/grub-2"
+RDEPEND="${DEPEND}"
+
+# These are already stripped since we use a binpkg.
+QA_PRESTRIPPED="/sbin/grub /bin/mbchk"
+
+pkg_setup() {
+ local arch="$(tc-arch)"
+ case ${arch} in
+ amd64)
+ CONFIG_CHECK='~IA32_EMULATION'
+ WARNING_IA32_EMULATION="You will NOT be able to run grub unless you have IA32_EMULATION set!"
+ check_extra_config
+ ;;
+ esac
+}
+
+src_install() {
+ cp -a "${WORKDIR}"/* "${D}"/
+ if [[ -z "${I_KNOW_WHAT_I_AM_DOING}" ]]; then
+ run_test_grub "${D}"/sbin/grub && einfo "New grub can run on your system, good!"
+ fi
+}
+
+run_test_grub() {
+ local grub="$1"
+ local version="$(${grub} \
+ --read-only --no-pager --no-floppy --no-curses \
+ --no-config-file --batch --version)"
+ local error="grub test-run failed"
+ use amd64 && error="${error} Is IA32_EMULATION set?"
+ [ "${version/${PV}}" != "${version}" ] || die "${error}"
+ return 0
+}
+
+#
+# Below this point, everything is also used in grub-static!
+# Please keep in sync!
+#
+
+setup_boot_dir() {
+ local boot_dir=$1
+ local dir=${boot_dir}
+
+ if [[ -z "${I_KNOW_WHAT_I_AM_DOING}" ]]; then
+ run_test_grub /sbin/grub
+ fi
+
+ mkdir -p "${dir}"
+ [[ ! -L ${dir}/boot ]] && ln -s . "${dir}/boot"
+ dir="${dir}/grub"
+ if [[ ! -e ${dir} ]] ; then
+ mkdir "${dir}" || die "${dir} does not exist!"
+ fi
+
+ # change menu.lst to grub.conf
+ if [[ ! -e ${dir}/grub.conf ]] && [[ -e ${dir}/menu.lst ]] ; then
+ mv -f "${dir}"/menu.lst "${dir}"/grub.conf
+ ewarn
+ ewarn "*** IMPORTANT NOTE: menu.lst has been renamed to grub.conf"
+ ewarn
+ fi
+
+ if [[ ! -e ${dir}/menu.lst ]]; then
+ einfo "Linking from new grub.conf name to menu.lst"
+ ln -snf grub.conf "${dir}"/menu.lst
+ fi
+
+ if [[ -e ${dir}/stage2 ]] ; then
+ mv "${dir}"/stage2{,.old}
+ ewarn "*** IMPORTANT NOTE: you must run grub and install"
+ ewarn "the new version's stage1 to your MBR. Until you do,"
+ ewarn "stage1 and stage2 will still be the old version, but"
+ ewarn "later stages will be the new version, which could"
+ ewarn "cause problems such as an unbootable system."
+ ewarn "This means you must use either grub-install or perform"
+ ewarn "root/setup manually! For more help, see the handbook:"
+ ewarn "http://www.gentoo.org/doc/en/handbook/handbook-${ARCH}.xml?part=1&chap=10#grub-install-auto"
+ ebeep
+ fi
+
+ einfo "Copying files from /lib/grub, /usr/lib/grub and /usr/share/grub to ${dir}"
+ for x in \
+ "${ROOT}"/lib*/grub/*/* \
+ "${ROOT}"/usr/lib*/grub/*/* \
+ "${ROOT}"/usr/share/grub/* ; do
+ [[ -f ${x} ]] && cp -p "${x}" "${dir}"/
+ done
+
+ if [[ ! -e ${dir}/grub.conf ]] ; then
+ s="${ROOT}/usr/share/doc/${PF}/grub.conf.gentoo"
+ [[ -e "${s}" ]] && cat "${s}" >${dir}/grub.conf
+ [[ -e "${s}.gz" ]] && zcat "${s}.gz" >${dir}/grub.conf
+ [[ -e "${s}.bz2" ]] && bzcat "${s}.bz2" >${dir}/grub.conf
+ fi
+
+ # Per bug 218599, we support grub.conf.install for users that want to run a
+ # specific set of Grub setup commands rather than the default ones.
+ grub_config=${dir}/grub.conf.install
+ [[ -e ${grub_config} ]] || grub_config=${dir}/grub.conf
+ if [[ -e ${grub_config} ]] ; then
+ local tmp="${TMPDIR}/${P}-setup_boot_dir-$$"
+ egrep \
+ -v '^[[:space:]]*(#|$|default|fallback|initrd|password|splashimage|timeout|title)' \
+ "${grub_config}" >"${tmp}"
+ # Do NOT fail here, only warn.
+ /sbin/grub --batch \
+ --device-map="${dir}"/device.map \
+ >/dev/null <"${tmp}"
+ rc=$?
+ [[ $rc -ne 0 ]] && ewarn "Grub failed to run!"
+ fi
+
+ # the grub default commands silently piss themselves if
+ # the default file does not exist ahead of time
+ if [[ ! -e ${dir}/default ]] ; then
+ # This may fail, don't worry about it.
+ grub-set-default --root-directory="${boot_dir}" default
+ :
+ fi
+ einfo "Grub has been installed to ${boot_dir} successfully."
+}
+
+pkg_postinst() {
+ mount-boot_pkg_postinst
+
+ if [[ -n ${DONT_MOUNT_BOOT} ]]; then
+ elog "WARNING: you have DONT_MOUNT_BOOT in effect, so you must apply"
+ elog "the following instructions for your /boot!"
+ elog "Neglecting to do so may cause your system to fail to boot!"
+ elog
+ else
+ setup_boot_dir "${ROOT}"/boot
+ # Trailing output because if this is run from pkg_postinst, it gets mixed into
+ # the other output.
+ einfo ""
+ fi
+ elog "To interactively install grub files to another device such as a USB"
+ elog "stick, just run the following and specify the directory as prompted:"
+ elog " emerge --config =${PF}"
+ elog "Alternately, you can export GRUB_ALT_INSTALLDIR=/path/to/use to tell"
+ elog "grub where to install in a non-interactive way."
+
+}
+
+pkg_config() {
+ local dir
+ if [ ! -d "${GRUB_ALT_INSTALLDIR}" ]; then
+ einfo "Enter the directory where you want to setup grub:"
+ read dir
+ else
+ dir="${GRUB_ALT_INSTALLDIR}"
+ fi
+ setup_boot_dir "${dir}"
+}
diff --git a/sys-boot/grub-static/grub-static-0.97-r12.ebuild b/sys-boot/grub-static/grub-static-0.97-r12.ebuild
new file mode 100644
index 000000000000..f8dcfe748704
--- /dev/null
+++ b/sys-boot/grub-static/grub-static-0.97-r12.ebuild
@@ -0,0 +1,180 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+# XXX: we need to review menu.lst vs grub.conf handling. We've been converting
+# all systems to grub.conf (and symlinking menu.lst to grub.conf), but
+# we never updated any of the source code (it still all wants menu.lst),
+# and there is no indication that upstream is making the transition.
+
+inherit eutils mount-boot toolchain-funcs linux-info
+
+PATCHVER="1.14" # Not used, just for tracking with main grub
+
+DESCRIPTION="GNU GRUB Legacy boot loader (static build)"
+
+HOMEPAGE="http://www.gnu.org/software/grub/"
+SRC_URI="mirror://gentoo/${PF}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="-* amd64 ~x86"
+IUSE=""
+
+DEPEND="!<sys-boot/grub-2"
+RDEPEND="${DEPEND}"
+
+S=${WORKDIR}
+
+pkg_setup() {
+ case $(tc-arch) in
+ amd64)
+ CONFIG_CHECK='~IA32_EMULATION'
+ WARNING_IA32_EMULATION="You will NOT be able to run grub unless you have IA32_EMULATION set!"
+ check_extra_config
+ ;;
+ esac
+}
+
+src_install() {
+ cp -a * "${D}"/
+ # Make sure the docs get compressed
+ dodoc usr/share/doc/${PF}/*
+
+ if [[ -z "${I_KNOW_WHAT_I_AM_DOING}" ]]; then
+ run_test_grub "${D}"/sbin/grub && einfo "New grub can run on your system, good!"
+ fi
+}
+
+run_test_grub() {
+ local grub="$1"
+ local version="$(${grub} \
+ --read-only --no-pager --no-floppy --no-curses \
+ --no-config-file --batch --version)"
+ local error="grub test-run failed"
+ use amd64 && error="${error} Is IA32_EMULATION set?"
+ [ "${version/${PV}}" != "${version}" ] || die "${error}"
+ return 0
+}
+
+#
+# Below this point, everything is also used in grub-static!
+# Please keep in sync!
+#
+
+setup_boot_dir() {
+ local boot_dir=$1
+ local dir=${boot_dir}
+
+ if [[ -z "${I_KNOW_WHAT_I_AM_DOING}" ]]; then
+ run_test_grub /sbin/grub
+ fi
+
+ mkdir -p "${dir}"
+ [[ ! -L ${dir}/boot ]] && ln -s . "${dir}/boot"
+ dir="${dir}/grub"
+ if [[ ! -e ${dir} ]] ; then
+ mkdir "${dir}" || die
+ fi
+
+ # change menu.lst to grub.conf
+ if [[ ! -e ${dir}/grub.conf ]] && [[ -e ${dir}/menu.lst ]] ; then
+ mv -f "${dir}"/menu.lst "${dir}"/grub.conf
+ ewarn
+ ewarn "*** IMPORTANT NOTE: menu.lst has been renamed to grub.conf"
+ ewarn
+ fi
+
+ if [[ ! -e ${dir}/menu.lst ]]; then
+ einfo "Linking from new grub.conf name to menu.lst"
+ ln -snf grub.conf "${dir}"/menu.lst
+ fi
+
+ if [[ -e ${dir}/stage2 ]] ; then
+ mv "${dir}"/stage2{,.old}
+ ewarn "*** IMPORTANT NOTE: you must run grub and install"
+ ewarn "the new version's stage1 to your MBR. Until you do,"
+ ewarn "stage1 and stage2 will still be the old version, but"
+ ewarn "later stages will be the new version, which could"
+ ewarn "cause problems such as an unbootable system."
+ ewarn "This means you must use either grub-install or perform"
+ ewarn "root/setup manually! For more help, see the handbook:"
+ ewarn "http://www.gentoo.org/doc/en/handbook/handbook-${ARCH}.xml?part=1&chap=10#grub-install-auto"
+ ebeep
+ fi
+
+ einfo "Copying files from /lib/grub, /usr/lib/grub and /usr/share/grub to ${dir}"
+ for x in \
+ "${ROOT}"/lib*/grub/*/* \
+ "${ROOT}"/usr/lib*/grub/*/* \
+ "${ROOT}"/usr/share/grub/* ; do
+ [[ -f ${x} ]] && cp -p "${x}" "${dir}"/
+ done
+
+ if [[ ! -e ${dir}/grub.conf ]] ; then
+ s="${ROOT}/usr/share/doc/${PF}/grub.conf.gentoo"
+ [[ -e "${s}" ]] && cat "${s}" >${dir}/grub.conf
+ [[ -e "${s}.gz" ]] && zcat "${s}.gz" >${dir}/grub.conf
+ [[ -e "${s}.bz2" ]] && bzcat "${s}.bz2" >${dir}/grub.conf
+ fi
+
+ # Per bug 218599, we support grub.conf.install for users that want to run a
+ # specific set of Grub setup commands rather than the default ones.
+ grub_config=${dir}/grub.conf.install
+ [[ -e ${grub_config} ]] || grub_config=${dir}/grub.conf
+ if [[ -e ${grub_config} ]] ; then
+ local tmp="${TMPDIR}/${P}-setup_boot_dir-$$"
+ egrep \
+ -v '^[[:space:]]*(#|$|default|fallback|initrd|password|splashimage|timeout|title)' \
+ "${grub_config}" >"${tmp}"
+ # Do NOT fail here, only warn.
+ /sbin/grub --batch \
+ --device-map="${dir}"/device.map \
+ >/dev/null <"${tmp}"
+ rc=$?
+ [[ $rc -ne 0 ]] && ewarn "Grub failed to run!"
+ fi
+
+ # the grub default commands silently piss themselves if
+ # the default file does not exist ahead of time
+ if [[ ! -e ${dir}/default ]] ; then
+ # This may fail, don't worry about it.
+ grub-set-default --root-directory="${boot_dir}" default
+ fi
+ einfo "Grub has been installed to ${boot_dir} successfully."
+}
+
+pkg_postinst() {
+ mount-boot_mount_boot_partition
+
+ if [[ -n ${DONT_MOUNT_BOOT} ]]; then
+ elog "WARNING: you have DONT_MOUNT_BOOT in effect, so you must apply"
+ elog "the following instructions for your /boot!"
+ elog "Neglecting to do so may cause your system to fail to boot!"
+ elog
+ else
+ setup_boot_dir "${ROOT}"/boot
+ # Trailing output because if this is run from pkg_postinst, it gets mixed into
+ # the other output.
+ einfo ""
+ fi
+ elog "To interactively install grub files to another device such as a USB"
+ elog "stick, just run the following and specify the directory as prompted:"
+ elog " emerge --config =${PF}"
+ elog "Alternately, you can export GRUB_ALT_INSTALLDIR=/path/to/use to tell"
+ elog "grub where to install in a non-interactive way."
+
+ # needs to be after we call setup_boot_dir
+ mount-boot_pkg_postinst
+}
+
+pkg_config() {
+ local dir
+ if [ ! -d "${GRUB_ALT_INSTALLDIR}" ]; then
+ einfo "Enter the directory where you want to setup grub:"
+ read dir
+ else
+ dir="${GRUB_ALT_INSTALLDIR}"
+ fi
+ setup_boot_dir "${dir}"
+}
diff --git a/sys-boot/grub-static/grub-static-0.97-r6.ebuild b/sys-boot/grub-static/grub-static-0.97-r6.ebuild
new file mode 100644
index 000000000000..72d86f0906f3
--- /dev/null
+++ b/sys-boot/grub-static/grub-static-0.97-r6.ebuild
@@ -0,0 +1,136 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+# XXX: we need to review menu.lst vs grub.conf handling. We've been converting
+# all systems to grub.conf (and symlinking menu.lst to grub.conf), but
+# we never updated any of the source code (it still all wants menu.lst),
+# and there is no indication that upstream is making the transition.
+
+inherit eutils mount-boot
+
+PATCHVER="1.7" # Not used, just for tracking with main grub
+
+DESCRIPTION="GNU GRUB Legacy boot loader (static build)"
+
+HOMEPAGE="http://www.gnu.org/software/grub/"
+SRC_URI="mirror://gentoo/${PF}.tar.bz2"
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="-* amd64 ~x86"
+IUSE=""
+DEPEND="!<sys-boot/grub-2"
+RDEPEND="${DEPEND}"
+
+src_install() {
+ cp -a "${WORKDIR}"/* "${D}"/
+}
+
+#
+# Below this point, everything is also used in grub-static!
+# Please keep in sync!
+#
+
+setup_boot_dir() {
+ local boot_dir=$1
+ local dir=${boot_dir}
+
+ [[ ! -e ${dir} ]] && die "${dir} does not exist!"
+ [[ ! -L ${dir}/boot ]] && ln -s . "${dir}/boot"
+ dir="${dir}/grub"
+ if [[ ! -e ${dir} ]] ; then
+ mkdir "${dir}" || die "${dir} does not exist!"
+ fi
+
+ # change menu.lst to grub.conf
+ if [[ ! -e ${dir}/grub.conf ]] && [[ -e ${dir}/menu.lst ]] ; then
+ mv -f "${dir}"/menu.lst "${dir}"/grub.conf
+ ewarn
+ ewarn "*** IMPORTANT NOTE: menu.lst has been renamed to grub.conf"
+ ewarn
+ fi
+
+ if [[ ! -e ${dir}/menu.lst ]]; then
+ einfo "Linking from new grub.conf name to menu.lst"
+ ln -snf grub.conf "${dir}"/menu.lst
+ fi
+
+ if [[ -e ${dir}/stage2 ]] ; then
+ mv "${dir}"/stage2{,.old}
+ ewarn "*** IMPORTANT NOTE: you must run grub and install"
+ ewarn "the new version's stage1 to your MBR. Until you do,"
+ ewarn "stage1 and stage2 will still be the old version, but"
+ ewarn "later stages will be the new version, which could"
+ ewarn "cause problems such as an unbootable system."
+ ewarn "This means you must use either grub-install or perform"
+ ewarn "root/setup manually! For more help, see the handbook:"
+ ewarn "http://www.gentoo.org/doc/en/handbook/handbook-${ARCH}.xml?part=1&chap=10#grub-install-auto"
+ ebeep
+ fi
+
+ einfo "Copying files from /lib/grub, /usr/lib/grub and /usr/share/grub to ${dir}"
+ for x in \
+ "${ROOT}"/lib*/grub/*/* \
+ "${ROOT}"/usr/lib*/grub/*/* \
+ "${ROOT}"/usr/share/grub/* ; do
+ [[ -f ${x} ]] && cp -p "${x}" "${dir}"/
+ done
+
+ if [[ ! -e ${dir}/grub.conf ]] ; then
+ s="${ROOT}/usr/share/doc/${PF}/grub.conf.gentoo"
+ [[ -e "${s}" ]] && cat "${s}" >${dir}/grub.conf
+ [[ -e "${s}.gz" ]] && zcat "${s}.gz" >${dir}/grub.conf
+ [[ -e "${s}.bz2" ]] && bzcat "${s}.bz2" >${dir}/grub.conf
+ fi
+
+ # Per bug 218599, we support grub.conf.install for users that want to run a
+ # specific set of Grub setup commands rather than the default ones.
+ grub_config=${dir}/grub.conf.install
+ [[ -e ${grub_config} ]] || grub_config=${dir}/grub.conf
+ if [[ -e ${grub_config} ]] ; then
+ egrep \
+ -v '^[[:space:]]*(#|$|default|fallback|initrd|password|splashimage|timeout|title)' \
+ "${grub_config}" | \
+ /sbin/grub --batch \
+ --device-map="${dir}"/device.map \
+ > /dev/null
+ fi
+
+ # the grub default commands silently piss themselves if
+ # the default file does not exist ahead of time
+ if [[ ! -e ${dir}/default ]] ; then
+ grub-set-default --root-directory="${boot_dir}" default
+ fi
+ einfo "Grub has been installed to ${boot_dir} successfully."
+}
+
+pkg_postinst() {
+ if [[ -n ${DONT_MOUNT_BOOT} ]]; then
+ elog "WARNING: you have DONT_MOUNT_BOOT in effect, so you must apply"
+ elog "the following instructions for your /boot!"
+ elog "Neglecting to do so may cause your system to fail to boot!"
+ elog
+ else
+ setup_boot_dir "${ROOT}"/boot
+ # Trailing output because if this is run from pkg_postinst, it gets mixed into
+ # the other output.
+ einfo ""
+ fi
+ elog "To interactively install grub files to another device such as a USB"
+ elog "stick, just run the following and specify the directory as prompted:"
+ elog " emerge --config =${PF}"
+ elog "Alternately, you can export GRUB_ALT_INSTALLDIR=/path/to/use to tell"
+ elog "grub where to install in a non-interactive way."
+
+}
+
+pkg_config() {
+ local dir
+ if [ ! -d "${GRUB_ALT_INSTALLDIR}" ]; then
+ einfo "Enter the directory where you want to setup grub:"
+ read dir
+ else
+ dir="${GRUB_ALT_INSTALLDIR}"
+ fi
+ setup_boot_dir "${dir}"
+}
diff --git a/sys-boot/grub-static/grub-static-0.97-r9.ebuild b/sys-boot/grub-static/grub-static-0.97-r9.ebuild
new file mode 100644
index 000000000000..4212c0759685
--- /dev/null
+++ b/sys-boot/grub-static/grub-static-0.97-r9.ebuild
@@ -0,0 +1,172 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+# XXX: we need to review menu.lst vs grub.conf handling. We've been converting
+# all systems to grub.conf (and symlinking menu.lst to grub.conf), but
+# we never updated any of the source code (it still all wants menu.lst),
+# and there is no indication that upstream is making the transition.
+
+inherit eutils mount-boot toolchain-funcs linux-info
+
+PATCHVER="1.9" # Not used, just for tracking with main grub
+
+DESCRIPTION="GNU GRUB Legacy boot loader (static build)"
+
+HOMEPAGE="http://www.gnu.org/software/grub/"
+SRC_URI="mirror://gentoo/${PF}.tar.bz2"
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="-* amd64 x86"
+IUSE=""
+DEPEND="!<sys-boot/grub-2"
+RDEPEND="${DEPEND}"
+
+# These are already stripped since we use a binpkg.
+QA_PRESTRIPPED="/sbin/grub /bin/mbchk"
+
+pkg_setup() {
+ local arch="$(tc-arch)"
+ case ${arch} in
+ amd64)
+ CONFIG_CHECK='~IA32_EMULATION'
+ WARNING_IA32_EMULATION="You will NOT be able to run grub unless you have IA32_EMULATION set!"
+ check_extra_config
+ ;;
+ esac
+}
+
+src_install() {
+ cp -a "${WORKDIR}"/* "${D}"/
+ run_test_grub "${D}"/sbin/grub && einfo "New grub can run on your system, good!"
+}
+
+run_test_grub() {
+ local grub="$1"
+ local version="$(${grub} \
+ --read-only --no-pager --no-floppy --no-curses \
+ --no-config-file --batch --version)"
+ local error="grub test-run failed"
+ use amd64 && error="${error} Is IA32_EMULATION set?"
+ [ "${version/${PV}}" != "${version}" ] || die "${error}"
+ return 0
+}
+
+#
+# Below this point, everything is also used in grub-static!
+# Please keep in sync!
+#
+
+setup_boot_dir() {
+ local boot_dir=$1
+ local dir=${boot_dir}
+
+ run_test_grub /sbin/grub
+
+ mkdir -p "${dir}"
+ [[ ! -L ${dir}/boot ]] && ln -s . "${dir}/boot"
+ dir="${dir}/grub"
+ if [[ ! -e ${dir} ]] ; then
+ mkdir "${dir}" || die "${dir} does not exist!"
+ fi
+
+ # change menu.lst to grub.conf
+ if [[ ! -e ${dir}/grub.conf ]] && [[ -e ${dir}/menu.lst ]] ; then
+ mv -f "${dir}"/menu.lst "${dir}"/grub.conf
+ ewarn
+ ewarn "*** IMPORTANT NOTE: menu.lst has been renamed to grub.conf"
+ ewarn
+ fi
+
+ if [[ ! -e ${dir}/menu.lst ]]; then
+ einfo "Linking from new grub.conf name to menu.lst"
+ ln -snf grub.conf "${dir}"/menu.lst
+ fi
+
+ if [[ -e ${dir}/stage2 ]] ; then
+ mv "${dir}"/stage2{,.old}
+ ewarn "*** IMPORTANT NOTE: you must run grub and install"
+ ewarn "the new version's stage1 to your MBR. Until you do,"
+ ewarn "stage1 and stage2 will still be the old version, but"
+ ewarn "later stages will be the new version, which could"
+ ewarn "cause problems such as an unbootable system."
+ ewarn "This means you must use either grub-install or perform"
+ ewarn "root/setup manually! For more help, see the handbook:"
+ ewarn "http://www.gentoo.org/doc/en/handbook/handbook-${ARCH}.xml?part=1&chap=10#grub-install-auto"
+ ebeep
+ fi
+
+ einfo "Copying files from /lib/grub, /usr/lib/grub and /usr/share/grub to ${dir}"
+ for x in \
+ "${ROOT}"/lib*/grub/*/* \
+ "${ROOT}"/usr/lib*/grub/*/* \
+ "${ROOT}"/usr/share/grub/* ; do
+ [[ -f ${x} ]] && cp -p "${x}" "${dir}"/
+ done
+
+ if [[ ! -e ${dir}/grub.conf ]] ; then
+ s="${ROOT}/usr/share/doc/${PF}/grub.conf.gentoo"
+ [[ -e "${s}" ]] && cat "${s}" >${dir}/grub.conf
+ [[ -e "${s}.gz" ]] && zcat "${s}.gz" >${dir}/grub.conf
+ [[ -e "${s}.bz2" ]] && bzcat "${s}.bz2" >${dir}/grub.conf
+ fi
+
+ # Per bug 218599, we support grub.conf.install for users that want to run a
+ # specific set of Grub setup commands rather than the default ones.
+ grub_config=${dir}/grub.conf.install
+ [[ -e ${grub_config} ]] || grub_config=${dir}/grub.conf
+ if [[ -e ${grub_config} ]] ; then
+ local tmp="${TMPDIR}/${P}-setup_boot_dir-$$"
+ egrep \
+ -v '^[[:space:]]*(#|$|default|fallback|initrd|password|splashimage|timeout|title)' \
+ "${grub_config}" >"${tmp}"
+ # Do NOT fail here, only warn.
+ /sbin/grub --batch \
+ --device-map="${dir}"/device.map \
+ >/dev/null <"${tmp}"
+ rc=$?
+ [[ $rc -ne 0 ]] && ewarn "Grub failed to run!"
+ fi
+
+ # the grub default commands silently piss themselves if
+ # the default file does not exist ahead of time
+ if [[ ! -e ${dir}/default ]] ; then
+ # This may fail, don't worry about it.
+ grub-set-default --root-directory="${boot_dir}" default
+ :
+ fi
+ einfo "Grub has been installed to ${boot_dir} successfully."
+}
+
+pkg_postinst() {
+ mount-boot_pkg_postinst
+
+ if [[ -n ${DONT_MOUNT_BOOT} ]]; then
+ elog "WARNING: you have DONT_MOUNT_BOOT in effect, so you must apply"
+ elog "the following instructions for your /boot!"
+ elog "Neglecting to do so may cause your system to fail to boot!"
+ elog
+ else
+ setup_boot_dir "${ROOT}"/boot
+ # Trailing output because if this is run from pkg_postinst, it gets mixed into
+ # the other output.
+ einfo ""
+ fi
+ elog "To interactively install grub files to another device such as a USB"
+ elog "stick, just run the following and specify the directory as prompted:"
+ elog " emerge --config =${PF}"
+ elog "Alternately, you can export GRUB_ALT_INSTALLDIR=/path/to/use to tell"
+ elog "grub where to install in a non-interactive way."
+
+}
+
+pkg_config() {
+ local dir
+ if [ ! -d "${GRUB_ALT_INSTALLDIR}" ]; then
+ einfo "Enter the directory where you want to setup grub:"
+ read dir
+ else
+ dir="${GRUB_ALT_INSTALLDIR}"
+ fi
+ setup_boot_dir "${dir}"
+}
diff --git a/sys-boot/grub-static/grub-static-0.97.ebuild b/sys-boot/grub-static/grub-static-0.97.ebuild
new file mode 100644
index 000000000000..4a40ffa9785b
--- /dev/null
+++ b/sys-boot/grub-static/grub-static-0.97.ebuild
@@ -0,0 +1,76 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+inherit mount-boot
+
+DESCRIPTION="Static GNU GRUB boot loader"
+
+HOMEPAGE="http://www.gnu.org/software/grub/"
+SRC_URI="mirror://gentoo/grub-static-${PV}.tar.bz2"
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="-* amd64 ~x86"
+IUSE=""
+DEPEND="!<sys-boot/grub-2"
+RDEPEND="${DEPEND}"
+
+src_install() {
+ cp -a "${WORKDIR}"/* "${D}"/
+}
+
+#
+# Everything below is directly copied from the grub ebuild
+# please try to keep it in sync
+#
+
+setup_boot_dir() {
+ local dir="${1}"
+
+ [[ ! -e "${dir}" ]] && die "${dir} does not exist!"
+ [[ ! -e "${dir}"/grub ]] && mkdir "${dir}/grub"
+
+ # change menu.lst to grub.conf
+ if [[ ! -e "${dir}"/grub/grub.conf ]] && [[ -e "${dir}"/grub/menu.lst ]] ; then
+ mv -f "${dir}"/grub/menu.lst "${dir}"/grub/grub.conf
+ ewarn
+ ewarn "*** IMPORTANT NOTE: menu.lst has been renamed to grub.conf"
+ ewarn
+ fi
+
+ if [[ ! -e "${dir}"/grub/menu.lst ]]; then
+ einfo "Linking from new grub.conf name to menu.lst"
+ ln -snf grub.conf "${dir}"/grub/menu.lst
+ fi
+
+ [[ -e "${dir}"/grub/stage2 ]] && mv "${dir}"/grub/stage2{,.old}
+
+ einfo "Copying files from /lib/grub and /usr/lib/grub to ${dir}"
+ for x in /lib*/grub/*/* /usr/lib*/grub/*/* ; do
+ [[ -f "${x}" ]] && cp -p "${x}" "${dir}"/grub/
+ done
+
+ if [[ -e "${dir}"/grub/grub.conf ]] ; then
+ egrep \
+ -v '^[[:space:]]*(#|$|default|fallback|initrd|password|splashimage|timeout|title)' \
+ "${dir}"/grub/grub.conf | \
+ /sbin/grub --batch \
+ --device-map="${dir}"/grub/device.map \
+ > /dev/null
+ fi
+}
+
+pkg_postinst() {
+ [[ "${ROOT}" != "/" ]] && return 0
+ [[ -n ${DONT_MOUNT_BOOT} ]] && return 0
+ setup_boot_dir /boot
+ einfo "To install grub files to another device (like a usb stick), just run:"
+ einfo " emerge --config =${PF}"
+}
+
+pkg_config() {
+ local dir
+ einfo "Enter the directory where you want to setup grub:"
+ read dir
+ setup_boot_dir "${dir}"
+}
diff --git a/sys-boot/grub-static/metadata.xml b/sys-boot/grub-static/metadata.xml
new file mode 100644
index 000000000000..96677fad3cfb
--- /dev/null
+++ b/sys-boot/grub-static/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>amd64</herd>
+</pkgmetadata>
diff --git a/sys-boot/grub/Manifest b/sys-boot/grub/Manifest
new file mode 100644
index 000000000000..ae373320f514
--- /dev/null
+++ b/sys-boot/grub/Manifest
@@ -0,0 +1,12 @@
+DIST dejavu-sans-ttf-2.34.zip 406977 SHA256 242e8c1cb2bdc7458bece02cca898f962c2bc919dcf67d97428149228290184d SHA512 dcd802b9c83cfa749b7542d0855eb1facb665a035af8c05f58830fce3ce37ba8d4a6f0353c07ae924c7fc25460d330b7312cbaffd34a2cb314a8e222de385c1b WHIRLPOOL d8b3289997cc39aca1c909ac1cae79727a19932f07b116a4a0bcc83e4a2f136d05d18c8ef2b05504a2f1f65eba85f93d61d52b0c913be7bb3e23f6a403eb6a82
+DIST grub-0.97-patches-1.14.tar.bz2 52916 SHA256 5c7ca31fd9b2123471daf2e46a1936c4044ad0c12e353d9d3d8c3f83a1c7a0e5 SHA512 d9a8d420fd5a36f181ca608f9b70be90f9d82cee66c8484636fda5085290586071b5d9379d917e8141b993ffc4777859cd02971c916d6167dca6f50d83282c26 WHIRLPOOL 60abd5087e85d9969784b9f5a100934606a76da03b665533d9d4d1d13f4e2d15de233a71e67a32d18a5fbfe128c2c8bf04c0d4451de24e6ca4fbd8dd862e23ea
+DIST grub-0.97.tar.gz 971783 SHA256 4e1d15d12dbd3e9208111d6b806ad5a9857ca8850c47877d36575b904559260b SHA512 c2bc9ffc8583aeae71cee9ddcc4418969768d4e3764d47307da54f93981c0109fb07d84b061b3a3628bd00ba4d14a54742bc04848110eb3ae8ca25dbfbaabadb WHIRLPOOL 0ad7f5dc035e2a3ad5fd29b6388f06fd12a8cc694117b4cbd42b5302433aa522db23566222d35219fe17fb95edb5090553156198507f70208eda5d858fd52dd5
+DIST grub-2.00_p5107.tar.xz 5836972 SHA256 92fd8f93621e7083f32ba6ef407f2984e5d3caaafdc35fb3d89ed054ca7c4dac SHA512 a70017dfc837e8fa869af7f71ca6191973f3f44f5a93378100cff5da425aa132b3903a3602ab907ef070872bb7a17f0586c8415845645c596d0621a4929ca83d WHIRLPOOL 5d88806fc849d2ff78ca590312110be4505e2801fee7c68faba39a54a44eedc16eb25dad88f1ff0058dea2e98382944c7e7632ccfa6f4a171ff0ef00cf67fd2d
+DIST grub-2.02_beta2-gentoo-r1.tar.xz 8048 SHA256 9a69edb0d64024b785a7f1bca58269b11e1be40f13ff2a96247249594bdb47d2 SHA512 c2ddaa188e7a2747e2256d0bb1e7c42427d5733cced3ff4b334be0671da8fab8d370861cdfee0319b4a29903a247375cf2e2a56955cc38e94a303bac5a93d974 WHIRLPOOL 0d923ed97921e145857580f7cff1f63278a4a95563d6e346b3680581991f9c7ad6d9b9965d40e407448392ee37b8c7862068281ac8f66b2a71856e1035f28eda
+DIST grub-2.02_beta2-gentoo-r3.tar.xz 14532 SHA256 78d14f27ed60458601021d13c247387dad324d4141ed46721e2e14f4a4fda990 SHA512 b46390c217e9a1f9fccbefbc5aab062c228919b9b7b6f16effd9d292534c516a28747376d85d5db8b7f883cf7e8c2aa0ca6573e8ed2913aadabbc1cd795fc861 WHIRLPOOL acb6d2e39e1670a4342e21e6d35ab390e36557512784a8ee0b5bda051ec5fb633061a28d2a2deab8c3d1961052db6c3870742ff866e292d8e4c0fd3c7a0acf45
+DIST grub-2.02_beta2-gentoo.tar.xz 6916 SHA256 63453b35faa6e02cc6e3067160158a591ed8d1e417fc2d1fce25556b28f76e03 SHA512 edc37adae1a4c9bad4bb29f335379e1e2b0a25ba7ef2768689fe0dfc236ea7057d80699659fd5facda431df957073827eba1cd83dd0204e81f068570de3722a7 WHIRLPOOL b463cb3f4a714b20845d3dbd493a0d3408a47a1fe140ca3a4dffa77052f9bfcf25046de7881e516022aa970c48701a1278cd8b598e8e1ce03a28347fbd68dab0
+DIST grub-2.02~beta2.tar.xz 5798740 SHA256 f6c702b2a8ea58f27a2b02928bb77973cb5a827af08f63db38c471c0a01b418d SHA512 359903928febce1df53b3bd38aab701b4ea010dfad0dee434e853c865af4bbc60d115e61eac100c79f18d89aa78b2216ef20123f4ef04cc948ecbe226ea1a58c WHIRLPOOL f92e94f43888648484a972a0c82b0a2ac4dc7fbdd6e35ca8b11a6ee92168ac8cf7ee68987b84697ec46ad18189e5c5c9aee8105b91bb131cd7f6f499f45cd58f
+DIST splash.xpm.gz 33856 SHA256 b95600f777331b0dd31d51c68f60f0e846e4c8b628857a41165f4e6b30e6acaf SHA512 5ae1f786f7d46a95a7061068d5b2b3ad64607c7b190d6f28379508c5dce67e26308325bfd637542a84855dfcf1ea3d143947326fdb189a6a8972208d3ead23da WHIRLPOOL d95b7b588ea8ac7c2c8c53eb8057aef21c825da6411afe3b7e864c606aeffaaebce8ae41ce3e979f277bd6b48a9e82a1f2ea8afc836213b56523d8a854227d7b
+DIST unifont-5.1.20080820.pcf.gz 1379965 SHA256 122b9c470f29b70223b0e07404a6dfa7f339fcfa6ae74c024f478945af7a9a63 SHA512 8939e2bc82ca97b60e6678f3ff079a2be7ba9b702f2e8ee289e853af5823695f7baafbf14b674fc5e41071f2a6de4f2dadd56bf8b4653849dd756d59622f1649 WHIRLPOOL 0f083d66781cc4c3e554ebeda4e21843fa275ecf3e1908b4873fadfe37b7c88e8346a124656704bb1b29f89afee23d6301b4df0f19e788f454c60d47156fe78d
+DIST unifont-7.0.01.pcf.gz 1358916 SHA256 7618a96ad50703213848af8ecae816828f528bb8ed179a749f7ca2b86eb15805 SHA512 f985e11729d18cb16d3e46fd1004242aa731a9b03ba16035f5954076686e8cdc39df9087daded5e044ead995b03650d8cf1bba9d060d65b5c3af630dbc9e3260 WHIRLPOOL da682398a22abd4282674d9a79b8fdd53e03054863cc166e43e2640dfb7f11c0b71cd3e42431f2086692f3a4202c2ecae9d6d7126249db0127e2da276aae7c9f
+DIST unifont-7.0.06.pcf.gz 1359006 SHA256 acf516b464928244c25dd1afddd02f6f459686b5135685694d875d7eca8bf4f2 SHA512 a62f21366b51a582d2b5a66710c8a6183bc869407867da78e59ecec9dabcff7a2522a8bc454cf511592d336befea812d36622589ef119160fe3014d927fa11b3 WHIRLPOOL 9f431f9b6af23a87e3291e5c66d6f1e56f8c8ce23222821dbf41aa03edac4d80e8e6c5895c024951cf199d41904e6c9f830103427568a9b0386f68adc0a959d7
diff --git a/sys-boot/grub/files/grub-2.00-freetype-2.5.1.patch b/sys-boot/grub/files/grub-2.00-freetype-2.5.1.patch
new file mode 100644
index 000000000000..286830ccf846
--- /dev/null
+++ b/sys-boot/grub/files/grub-2.00-freetype-2.5.1.patch
@@ -0,0 +1,24 @@
+commit fd0df6d098b1e6a4f60275c48a3ec88d15ba1fbb
+Author: Colin Watson <cjwatson@ubuntu.com>
+Date: Fri Nov 29 12:19:36 2013 +0000
+
+ Fix build with FreeType 2.5.1
+
+ * util/grub-gen-asciih.c: Include FT_SYNTHESIS_H rather than
+ <freetype/ftsynth.h>, fixing build with FreeType 2.5.1.
+ * util/grub-gen-widthspec.c: Likewise.
+ * util/grub-mkfont.c: Likewise.
+
+diff --git a/util/grub-mkfont.c b/util/grub-mkfont.c
+index 0d8eb78..242dd01 100644
+--- a/util/grub-mkfont.c
++++ b/util/grub-mkfont.c
+@@ -43,7 +43,7 @@
+ #include FT_FREETYPE_H
+ #include FT_TRUETYPE_TAGS_H
+ #include FT_TRUETYPE_TABLES_H
+-#include <freetype/ftsynth.h>
++#include FT_SYNTHESIS_H
+
+ #undef __FTERRORS_H__
+ #define FT_ERROR_START_LIST const char *ft_errmsgs[] = {
diff --git a/sys-boot/grub/files/grub-2.02_beta2-libzfs.patch b/sys-boot/grub/files/grub-2.02_beta2-libzfs.patch
new file mode 100644
index 000000000000..d76a903c862b
--- /dev/null
+++ b/sys-boot/grub/files/grub-2.02_beta2-libzfs.patch
@@ -0,0 +1,19 @@
+commit 6ba983559dcffa0fa69c7fc861b5a16b4877a92c
+Author: Mike Gilbert <floppym@gentoo.org>
+Date: Sat Jan 18 19:41:15 2014 +0100
+
+ * Makefile.util.def: Link grub-ofpathname with zfs libs.
+
+diff --git a/Makefile.util.def b/Makefile.util.def
+index 83df212..a286a89 100644
+--- a/Makefile.util.def
++++ b/Makefile.util.def
+@@ -384,7 +384,7 @@ program = {
+ ldadd = libgrubgcry.a;
+ ldadd = libgrubkern.a;
+ ldadd = grub-core/gnulib/libgnu.a;
+- ldadd = '$(LIBINTL) $(LIBDEVMAPPER) $(LIBUTIL) $(LIBGEOM)';
++ ldadd = '$(LIBINTL) $(LIBDEVMAPPER) $(LIBUTIL) $(LIBZFS) $(LIBNVPAIR) $(LIBGEOM)';
+ };
+
+ program = {
diff --git a/sys-boot/grub/files/grub.conf.gentoo b/sys-boot/grub/files/grub.conf.gentoo
new file mode 100644
index 000000000000..984470b3860d
--- /dev/null
+++ b/sys-boot/grub/files/grub.conf.gentoo
@@ -0,0 +1,16 @@
+# This is a sample grub.conf for use with Genkernel, per the Gentoo handbook
+# http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=1&chap=10#doc_chap2
+# If you are not using Genkernel and you need help creating this file, you
+# should consult the handbook. Alternatively, consult the grub.conf.sample that
+# is included with the Grub documentation.
+
+default 0
+timeout 30
+#splashimage=(hd0,0)/boot/grub/splash.xpm.gz
+
+#title Gentoo Linux 3.8.13
+#root (hd0,0)
+#kernel /boot/kernel-genkernel-x86-3.8.13-gentoo root=/dev/sda3
+#initrd /boot/initramfs-genkernel-x86-3.8.13
+
+# vim:ft=conf:
diff --git a/sys-boot/grub/files/grub.default-2 b/sys-boot/grub/files/grub.default-2
new file mode 100644
index 000000000000..87594d240835
--- /dev/null
+++ b/sys-boot/grub/files/grub.default-2
@@ -0,0 +1,46 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+#
+# To populate all changes in this file you need to regenerate your
+# grub configuration file afterwards:
+# 'grub2-mkconfig -o /boot/grub/grub.cfg'
+#
+# See the grub info page for documentation on possible variables and
+# their associated values.
+
+GRUB_DISTRIBUTOR="Gentoo"
+
+GRUB_DEFAULT=0
+GRUB_HIDDEN_TIMEOUT=0
+GRUB_HIDDEN_TIMEOUT_QUIET=true
+GRUB_TIMEOUT=10
+
+# Append parameters to the linux kernel command line
+# GRUB_CMDLINE_LINUX=""
+
+# Append parameters to the linux kernel command line for non-recovery entries
+#GRUB_CMDLINE_LINUX_DEFAULT=""
+
+# Uncomment to disable graphical terminal (grub-pc only)
+#GRUB_TERMINAL=console
+
+# The resolution used on graphical terminal.
+# Note that you can use only modes which your graphic card supports via VBE.
+# You can see them in real GRUB with the command `vbeinfo'.
+#GRUB_GFXMODE=640x480
+
+# Path to theme spec txt file.
+# The starfield is by default provided with use truetype.
+# NOTE: when enabling custom theme, ensure you have required font/etc.
+#GRUB_THEME="/boot/grub/themes/starfield/theme.txt"
+
+# Background image used on graphical terminal.
+# Can be in various bitmap formats.
+#GRUB_BACKGROUND="/boot/grub/mybackground.png"
+
+# Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to kernel
+#GRUB_DISABLE_LINUX_UUID=true
+
+# Uncomment to disable generation of recovery mode menu entries
+#GRUB_DISABLE_RECOVERY=true
diff --git a/sys-boot/grub/files/grub.default-3 b/sys-boot/grub/files/grub.default-3
new file mode 100644
index 000000000000..35ab767b1c03
--- /dev/null
+++ b/sys-boot/grub/files/grub.default-3
@@ -0,0 +1,74 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+#
+# To populate all changes in this file you need to regenerate your
+# grub configuration file afterwards:
+# 'grub2-mkconfig -o /boot/grub/grub.cfg'
+#
+# See the grub info page for documentation on possible variables and
+# their associated values.
+
+GRUB_DISTRIBUTOR="Gentoo"
+
+# Default menu entry
+#GRUB_DEFAULT=0
+
+# Boot the default entry this many seconds after the menu is displayed
+#GRUB_TIMEOUT=5
+#GRUB_TIMEOUT_STYLE=menu
+
+# Append parameters to the linux kernel command line
+#GRUB_CMDLINE_LINUX=""
+#
+# Examples:
+#
+# Boot with network interface renaming disabled
+# GRUB_CMDLINE_LINUX="net.ifnames=0"
+#
+# Boot with systemd instead of sysvinit (openrc)
+# GRUB_CMDLINE_LINUX="init=/usr/lib/systemd/systemd"
+
+# Append parameters to the linux kernel command line for non-recovery entries
+#GRUB_CMDLINE_LINUX_DEFAULT=""
+
+# Uncomment to disable graphical terminal (grub-pc only)
+#GRUB_TERMINAL=console
+
+# The resolution used on graphical terminal.
+# Note that you can use only modes which your graphic card supports via VBE.
+# You can see them in real GRUB with the command `vbeinfo'.
+#GRUB_GFXMODE=640x480
+
+# Set to 'text' to force the Linux kernel to boot in normal text
+# mode, 'keep' to preserve the graphics mode set using
+# 'GRUB_GFXMODE', 'WIDTHxHEIGHT'['xDEPTH'] to set a particular
+# graphics mode, or a sequence of these separated by commas or
+# semicolons to try several modes in sequence.
+#GRUB_GFXPAYLOAD_LINUX=
+
+# Path to theme spec txt file.
+# The starfield is by default provided with use truetype.
+# NOTE: when enabling custom theme, ensure you have required font/etc.
+#GRUB_THEME="/boot/grub/themes/starfield/theme.txt"
+
+# Background image used on graphical terminal.
+# Can be in various bitmap formats.
+#GRUB_BACKGROUND="/boot/grub/mybackground.png"
+
+# Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to kernel
+#GRUB_DISABLE_LINUX_UUID=true
+
+# Uncomment to disable generation of recovery mode menu entries
+#GRUB_DISABLE_RECOVERY=true
+
+# Uncomment to disable generation of the submenu and put all choices on
+# the top-level menu.
+# Besides the visual affect of no sub menu, this makes navigation of the
+# menu easier for a user who can't see the screen.
+#GRUB_DISABLE_SUBMENU=y
+
+# Uncomment to play a tone when the main menu is displayed.
+# This is useful, for example, to allow users who can't see the screen
+# to know when they can make a choice on the menu.
+#GRUB_INIT_TUNE="60 800 1"
diff --git a/sys-boot/grub/grub-0.97-r14.ebuild b/sys-boot/grub/grub-0.97-r14.ebuild
new file mode 100644
index 000000000000..a12f7387b19a
--- /dev/null
+++ b/sys-boot/grub/grub-0.97-r14.ebuild
@@ -0,0 +1,289 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+# XXX: we need to review menu.lst vs grub.conf handling. We've been converting
+# all systems to grub.conf (and symlinking menu.lst to grub.conf), but
+# we never updated any of the source code (it still all wants menu.lst),
+# and there is no indication that upstream is making the transition.
+
+# If you need to roll a new grub-static distfile, here is how.
+# - Robin H. Johnson <robbat2@gentoo.org> - 29 Nov 2010
+# FEATURES='-noauto -noinfo -nodoc -noman -splitdebug nostrip' \
+# USE='static -ncurses -netboot -custom-cflags' \
+# PORTAGE_COMPRESS=true GRUB_STATIC_PACKAGE_BUILDING=1 ebuild \
+# grub-${PVR}.ebuild clean package && \
+# qtbz2 -s -j ${PKGDIR}/${CAT}/${PF}.tbz2 && \
+# mv ${PF}.tar.bz2 ${DISTDIR}/grub-static-${PVR}.tar.bz2
+
+EAPI="4"
+
+inherit eutils mount-boot toolchain-funcs linux-info flag-o-matic autotools pax-utils multiprocessing
+
+PATCHVER="1.14" # Should match the revision ideally
+DESCRIPTION="GNU GRUB Legacy boot loader"
+HOMEPAGE="http://www.gnu.org/software/grub/"
+SRC_URI="mirror://gentoo/${P}.tar.gz
+ mirror://gnu-alpha/${PN}/${P}.tar.gz
+ mirror://gentoo/splash.xpm.gz
+ mirror://gentoo/${P}-patches-${PATCHVER}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 x86 ~x86-fbsd"
+IUSE="custom-cflags ncurses netboot static"
+
+LIB_DEPEND="ncurses? (
+ >=sys-libs/ncurses-5.9-r3[static-libs(+)]
+ amd64? ( >=sys-libs/ncurses-5.9-r3[abi_x86_32(-)] )
+ )"
+RDEPEND="!static? ( ${LIB_DEPEND//\[static-libs(+)\]/} )"
+DEPEND="${RDEPEND}
+ static? ( ${LIB_DEPEND} )"
+
+pkg_setup() {
+ case $(tc-arch) in
+ amd64) CONFIG_CHECK='~IA32_EMULATION' check_extra_config ;;
+ esac
+}
+
+src_prepare() {
+ # Grub will not handle a kernel larger than EXTENDED_MEMSIZE Mb as
+ # discovered in bug 160801. We can change this, however, using larger values
+ # for this variable means that Grub needs more memory to run and boot. For a
+ # kernel of size N, Grub needs (N+1)*2. Advanced users should set a custom
+ # value in make.conf, it is possible to make kernels ~16Mb in size, but it
+ # needs the kitchen sink built-in.
+ local t="custom"
+ if [[ -z ${GRUB_MAX_KERNEL_SIZE} ]] ; then
+ case $(tc-arch) in
+ amd64) GRUB_MAX_KERNEL_SIZE=9 ;;
+ x86) GRUB_MAX_KERNEL_SIZE=5 ;;
+ esac
+ t="default"
+ fi
+ einfo "Grub will support the ${t} maximum kernel size of ${GRUB_MAX_KERNEL_SIZE} Mb (GRUB_MAX_KERNEL_SIZE)"
+
+ sed -i \
+ -e "/^#define.*EXTENDED_MEMSIZE/s,3,${GRUB_MAX_KERNEL_SIZE},g" \
+ "${S}"/grub/asmstub.c \
+ || die
+
+ EPATCH_SUFFIX="patch" epatch "${WORKDIR}"/patch
+ rm -f "${S}"/aclocal.m4 # seems to keep bug 418287 away
+ eautoreconf
+}
+
+src_configure() {
+ filter-flags -fPIE #168834
+
+ use amd64 && multilib_toolchain_setup x86
+
+ unset BLOCK_SIZE #73499
+
+ ### i686-specific code in the boot loader is a bad idea; disabling to ensure
+ ### at least some compatibility if the hard drive is moved to an older or
+ ### incompatible system.
+
+ # grub-0.95 added -fno-stack-protector detection, to disable ssp for stage2,
+ # but the objcopy's (faulty) test fails if -fstack-protector is default.
+ # create a cache telling configure that objcopy is ok, and add -C to econf
+ # to make use of the cache.
+ #
+ # CFLAGS has to be undefined running econf, else -fno-stack-protector detection fails.
+ # STAGE2_CFLAGS is not allowed to be used on emake command-line, it overwrites
+ # -fno-stack-protector detected by configure, removed from netboot's emake.
+ use custom-cflags || unset CFLAGS
+
+ tc-ld-disable-gold #439082 #466536 #526348
+
+ export grub_cv_prog_objcopy_absolute=yes #79734
+ use static && append-ldflags -static
+
+ if use amd64 && use static ; then
+ if [[ -n ${GRUB_STATIC_PACKAGE_BUILDING} ]] ; then
+ eerror "You have set GRUB_STATIC_PACKAGE_BUILDING. This"
+ eerror "is specifically intended for building the tarballs for the"
+ eerror "grub-static package via USE='static -ncurses'."
+ eerror "All bets are now off."
+ fi
+ fi
+
+ multijob_init
+
+ # build the net-bootable grub first, but only if "netboot" is set
+ if use netboot ; then
+ (
+ multijob_child_init
+ mkdir -p "${WORKDIR}"/netboot
+ pushd "${WORKDIR}"/netboot >/dev/null
+ ECONF_SOURCE=${S} \
+ econf \
+ --libdir=/lib \
+ --datadir=/usr/lib/grub \
+ --exec-prefix=/ \
+ --disable-auto-linux-mem-opt \
+ --enable-diskless \
+ --enable-{3c{5{03,07,09,29,95},90x},cs89x0,davicom,depca,eepro{,100}} \
+ --enable-{epic100,exos205,ni5210,lance,ne2100,ni{50,65}10,natsemi} \
+ --enable-{ne,ns8390,wd,otulip,rtl8139,sis900,sk-g16,smc9000,tiara} \
+ --enable-{tulip,via-rhine,w89c840}
+ popd >/dev/null
+ ) &
+ multijob_post_fork
+ fi
+
+ # Now build the regular grub
+ # Note that FFS and UFS2 support are broken for now - stage1_5 files too big
+ econf \
+ --libdir=/lib \
+ --datadir=/usr/lib/grub \
+ --exec-prefix=/ \
+ --disable-auto-linux-mem-opt \
+ $(use_with ncurses curses)
+
+ # sanity check due to common failure
+ use ncurses && ! grep -qs "HAVE_LIBCURSES.*1" config.h && die "USE=ncurses but curses not found"
+
+ multijob_finish
+}
+
+src_compile() {
+ use netboot && emake -C "${WORKDIR}"/netboot w89c840_o_CFLAGS="-O"
+ emake
+}
+
+src_test() {
+ # non-default block size also give false pass/fails.
+ unset BLOCK_SIZE
+ emake -j1 check
+}
+
+src_install() {
+ default
+ if use netboot ; then
+ exeinto /usr/lib/grub/${CHOST}
+ doexe "${WORKDIR}"/netboot/stage2/{nbgrub,pxegrub}
+ newexe "${WORKDIR}"/netboot/stage2/stage2 stage2.netboot
+ fi
+
+ pax-mark -m "${D}"/sbin/grub #330745
+
+ newdoc docs/menu.lst grub.conf.sample
+ dodoc "${FILESDIR}"/grub.conf.gentoo
+
+ [[ -n ${GRUB_STATIC_PACKAGE_BUILDING} ]] && \
+ mv "${D}"/usr/share/doc/{${PF},grub-static-${PF/grub-}}
+
+ insinto /usr/share/grub
+ doins "${DISTDIR}"/splash.xpm.gz
+}
+
+setup_boot_dir() {
+ local boot_dir=$1
+ local dir=${boot_dir}
+
+ mkdir -p "${dir}"
+ [[ ! -L ${dir}/boot ]] && ln -s . "${dir}/boot"
+ dir="${dir}/grub"
+ if [[ ! -e ${dir} ]] ; then
+ mkdir "${dir}" || die
+ fi
+
+ # change menu.lst to grub.conf
+ if [[ ! -e ${dir}/grub.conf ]] && [[ -e ${dir}/menu.lst ]] ; then
+ mv -f "${dir}"/menu.lst "${dir}"/grub.conf
+ ewarn "*** IMPORTANT NOTE: menu.lst has been renamed to grub.conf"
+ echo
+ fi
+
+ if [[ ! -e ${dir}/menu.lst ]]; then
+ einfo "Linking from new grub.conf name to menu.lst"
+ ln -snf grub.conf "${dir}"/menu.lst
+ fi
+
+ if [[ -e ${dir}/stage2 ]] ; then
+ mv "${dir}"/stage2{,.old}
+ ewarn "*** IMPORTANT NOTE: you must run grub and install"
+ ewarn "the new version's stage1 to your MBR. Until you do,"
+ ewarn "stage1 and stage2 will still be the old version, but"
+ ewarn "later stages will be the new version, which could"
+ ewarn "cause problems such as an unbootable system."
+ ewarn
+ ewarn "This means you must use either grub-install or perform"
+ ewarn "root/setup manually."
+ ewarn
+ ewarn "For more help, see the handbook:"
+ ewarn "http://www.gentoo.org/doc/en/handbook/handbook-${ARCH}.xml?part=1&chap=10#grub-install-auto"
+ echo
+ fi
+
+ einfo "Copying files from /lib/grub and /usr/share/grub to ${dir}"
+ for x in \
+ "${ROOT}"/lib*/grub/*/* \
+ "${ROOT}"/usr/share/grub/* ; do
+ [[ -f ${x} ]] && cp -p "${x}" "${dir}"/
+ done
+
+ if [[ ! -e ${dir}/grub.conf ]] ; then
+ s="${ROOT}/usr/share/doc/${PF}/grub.conf.gentoo"
+ [[ -e "${s}" ]] && cat "${s}" >${dir}/grub.conf
+ [[ -e "${s}.gz" ]] && zcat "${s}.gz" >${dir}/grub.conf
+ [[ -e "${s}.bz2" ]] && bzcat "${s}.bz2" >${dir}/grub.conf
+ fi
+
+ # Per bug 218599, we support grub.conf.install for users that want to run a
+ # specific set of Grub setup commands rather than the default ones.
+ grub_config=${dir}/grub.conf.install
+ [[ -e ${grub_config} ]] || grub_config=${dir}/grub.conf
+ if [[ -e ${grub_config} ]] ; then
+ egrep \
+ -v '^[[:space:]]*(#|$|default|fallback|initrd|password|splashimage|timeout|title)' \
+ "${grub_config}" | \
+ /sbin/grub --batch \
+ --device-map="${dir}"/device.map \
+ > /dev/null
+ fi
+
+ # the grub default commands silently piss themselves if
+ # the default file does not exist ahead of time
+ if [[ ! -e ${dir}/default ]] ; then
+ grub-set-default --root-directory="${boot_dir}" default
+ fi
+ einfo "Grub has been installed to ${boot_dir} successfully."
+}
+
+pkg_postinst() {
+ mount-boot_mount_boot_partition
+
+ if [[ -n ${DONT_MOUNT_BOOT} ]]; then
+ elog "WARNING: you have DONT_MOUNT_BOOT in effect, so you must apply"
+ elog "the following instructions for your /boot!"
+ elog "Neglecting to do so may cause your system to fail to boot!"
+ elog
+ else
+ setup_boot_dir "${ROOT}"/boot
+ # Trailing output because if this is run from pkg_postinst, it gets mixed into
+ # the other output.
+ einfo ""
+ fi
+ elog "To interactively install grub files to another device such as a USB"
+ elog "stick, just run the following and specify the directory as prompted:"
+ elog " emerge --config =${PF}"
+ elog "Alternately, you can export GRUB_ALT_INSTALLDIR=/path/to/use to tell"
+ elog "grub where to install in a non-interactive way."
+
+ # needs to be after we call setup_boot_dir
+ mount-boot_pkg_postinst
+}
+
+pkg_config() {
+ local dir
+ if [ ! -d "${GRUB_ALT_INSTALLDIR}" ]; then
+ einfo "Enter the directory where you want to setup grub:"
+ read dir
+ else
+ dir="${GRUB_ALT_INSTALLDIR}"
+ fi
+ setup_boot_dir "${dir}"
+}
diff --git a/sys-boot/grub/grub-2.00_p5107-r2.ebuild b/sys-boot/grub/grub-2.00_p5107-r2.ebuild
new file mode 100644
index 000000000000..30cc1b616cbe
--- /dev/null
+++ b/sys-boot/grub/grub-2.00_p5107-r2.ebuild
@@ -0,0 +1,306 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+if [[ ${PV} == 9999 ]]; then
+ AUTOTOOLS_AUTORECONF=1
+ GRUB_AUTOGEN=1
+fi
+
+inherit autotools-utils bash-completion-r1 eutils flag-o-matic mount-boot multibuild pax-utils toolchain-funcs versionator
+
+if [[ ${PV} != 9999 ]]; then
+ if [[ ${PV} == *_alpha* || ${PV} == *_beta* || ${PV} == *_rc* ]]; then
+ # The quote style is to work with <=bash-4.2 and >=bash-4.3 #503860
+ MY_P=${P/_/'~'}
+ SRC_URI="mirror://gnu-alpha/${PN}/${MY_P}.tar.xz"
+ S=${WORKDIR}/${MY_P}
+ else
+ SRC_URI="mirror://gnu/${PN}/${P}.tar.xz
+ mirror://gentoo/${P}.tar.xz
+ http://dev.gentoo.org/~floppym/dist/${P}.tar.xz"
+ S=${WORKDIR}/${P%_*}
+ fi
+ KEYWORDS="amd64 x86"
+ PATCHES=(
+ "${FILESDIR}/grub-2.00-freetype-2.5.1.patch"
+ )
+else
+ inherit git-r3
+ EGIT_REPO_URI="git://git.sv.gnu.org/grub.git
+ http://git.savannah.gnu.org/r/grub.git"
+fi
+
+DEJAVU=dejavu-sans-ttf-2.34
+UNIFONT=unifont-5.1.20080820.pcf
+SRC_URI+=" truetype? (
+ mirror://sourceforge/dejavu/${DEJAVU}.zip
+ http://unifoundry.com/${UNIFONT}.gz
+)"
+
+DESCRIPTION="GNU GRUB boot loader"
+HOMEPAGE="http://www.gnu.org/software/grub/"
+
+# Includes licenses for dejavu and unifont
+LICENSE="GPL-3 truetype? ( BitstreamVera GPL-2-with-font-exception )"
+SLOT="2"
+IUSE="custom-cflags debug device-mapper doc efiemu mount +multislot nls static sdl test truetype libzfs"
+
+GRUB_ALL_PLATFORMS=(
+ # everywhere:
+ emu
+ # mips only:
+ qemu-mips yeeloong
+ # amd64, x86, ppc, ppc64:
+ ieee1275
+ # amd64, x86:
+ coreboot multiboot efi-32 pc qemu
+ # amd64, ia64:
+ efi-64
+)
+IUSE+=" ${GRUB_ALL_PLATFORMS[@]/#/grub_platforms_}"
+
+REQUIRED_USE="grub_platforms_qemu? ( truetype )
+ grub_platforms_yeeloong? ( truetype )"
+
+# os-prober: Used on runtime to detect other OSes
+# xorriso (dev-libs/libisoburn): Used on runtime for mkrescue
+RDEPEND="
+ app-arch/xz-utils
+ >=sys-libs/ncurses-5.2-r5
+ debug? (
+ sdl? ( media-libs/libsdl )
+ )
+ device-mapper? ( >=sys-fs/lvm2-2.02.45 )
+ libzfs? ( sys-fs/zfs )
+ mount? ( sys-fs/fuse )
+ truetype? ( media-libs/freetype )
+ ppc? ( sys-apps/ibm-powerpc-utils sys-apps/powerpc-utils )
+ ppc64? ( sys-apps/ibm-powerpc-utils sys-apps/powerpc-utils )
+"
+DEPEND="${RDEPEND}
+ app-misc/pax-utils
+ >=dev-lang/python-2.5.2
+ sys-devel/flex
+ sys-devel/bison
+ sys-apps/help2man
+ sys-apps/texinfo
+ static? (
+ app-arch/xz-utils[static-libs(+)]
+ truetype? (
+ app-arch/bzip2[static-libs(+)]
+ media-libs/freetype[static-libs(+)]
+ sys-libs/zlib[static-libs(+)]
+ )
+ )
+ test? (
+ dev-libs/libisoburn
+ app-emulation/qemu
+ )
+ truetype? ( app-arch/unzip )
+"
+RDEPEND+="
+ kernel_linux? (
+ grub_platforms_efi-32? ( sys-boot/efibootmgr )
+ grub_platforms_efi-64? ( sys-boot/efibootmgr )
+ )
+ !multislot? ( !sys-boot/grub:0 )
+ nls? ( sys-devel/gettext )
+"
+
+if [[ -n ${GRUB_AUTOGEN} ]]; then
+ DEPEND+=" >=sys-devel/autogen-5.10"
+fi
+
+STRIP_MASK="*/grub/*/*.{mod,img}"
+RESTRICT="test"
+
+QA_EXECSTACK="
+ usr/bin/grub*
+ usr/sbin/grub*
+ usr/lib*/grub/*/*.mod
+ usr/lib*/grub/*/*.module
+ usr/lib*/grub/*/kernel.exec
+ usr/lib*/grub/*/kernel.img
+"
+
+QA_WX_LOAD="
+ usr/lib*/grub/*/kernel.exec
+ usr/lib*/grub/*/kernel.img
+ usr/lib*/grub/*/*.image
+"
+
+QA_PRESTRIPPED="
+ usr/lib.*/grub/.*/kernel.img
+"
+
+src_unpack() {
+ if [[ ${PV} == 9999 ]]; then
+ git-r3_src_unpack
+ fi
+ default_src_unpack
+}
+
+src_prepare() {
+ [[ ${PATCHES} ]] && epatch "${PATCHES[@]}"
+ sed -i -e /autoreconf/d autogen.sh || die
+ if use multislot; then
+ # fix texinfo file name, bug 416035
+ sed -i -e 's/^\* GRUB:/* GRUB2:/' -e 's/(grub)/(grub2)/' docs/grub.texi || die
+ fi
+ epatch_user
+ if [[ -n ${GRUB_AUTOGEN} ]]; then
+ bash autogen.sh || die
+ fi
+ if [[ -n ${AUTOTOOLS_AUTORECONF} ]]; then
+ autopoint() { return 0; }
+ eautoreconf
+ fi
+}
+
+setup_fonts() {
+ ln -s "${WORKDIR}/${DEJAVU}/ttf/DejaVuSans.ttf" DejaVuSans.ttf || die
+ ln -s "${WORKDIR}/${UNIFONT}" unifont.pcf || die
+}
+
+grub_configure() {
+ local platform
+
+ case ${MULTIBUILD_VARIANT} in
+ efi-32)
+ platform=efi
+ if [[ ${CTARGET:-${CHOST}} == x86_64* ]]; then
+ local CTARGET=${CTARGET:-i386}
+ fi ;;
+ efi-64)
+ platform=efi
+ if [[ ${CTARGET:-${CHOST}} == i?86* ]]; then
+ local CTARGET=${CTARGET:-x86_64}
+ local TARGET_CFLAGS="-Os -march=x86-64 ${TARGET_CFLAGS}"
+ local TARGET_CPPFLAGS="-march=x86-64 ${TARGET_CPPFLAGS}"
+ export TARGET_CFLAGS TARGET_CPPFLAGS
+ fi ;;
+ guessed) ;;
+ *) platform=${MULTIBUILD_VARIANT} ;;
+ esac
+
+ local myeconfargs=(
+ --disable-werror
+ --program-prefix=
+ --libdir="${EPREFIX}"/usr/lib
+ --htmldir="${EPREFIX}"/usr/share/doc/${PF}/html
+ $(use_enable debug mm-debug)
+ $(use_enable debug grub-emu-usb)
+ $(use_enable device-mapper)
+ $(use_enable mount grub-mount)
+ $(use_enable nls)
+ $(use_enable truetype grub-mkfont)
+ $(use_enable libzfs)
+ $(use sdl && use_enable debug grub-emu-sdl)
+ ${platform:+--with-platform=}${platform}
+
+ # Let configure detect this where supported
+ $(usex efiemu '' '--disable-efiemu')
+ )
+
+ if use multislot; then
+ myeconfargs+=( --program-transform-name="s,grub,grub2," )
+ fi
+
+ if use truetype; then
+ mkdir -p "${BUILD_DIR}" || die
+ run_in_build_dir setup_fonts
+ fi
+
+ autotools-utils_src_configure
+}
+
+src_configure() {
+ use custom-cflags || unset CCASFLAGS CFLAGS CPPFLAGS LDFLAGS
+ use static && export HOST_LDFLAGS="${HOST_LDFLAGS} -static"
+
+ tc-ld-disable-gold #439082 #466536 #526348
+ export TARGET_LDFLAGS+=" ${LDFLAGS}"
+ unset LDFLAGS
+
+ tc-export CC NM OBJCOPY STRIP
+ export TARGET_CC=${TARGET_CC:-${CC}}
+ tc-export BUILD_CC # Bug 485592
+
+ # Portage will take care of cleaning up GRUB_PLATFORMS
+ MULTIBUILD_VARIANTS=( ${GRUB_PLATFORMS:-guessed} )
+ multibuild_parallel_foreach_variant grub_configure
+}
+
+src_compile() {
+ # Sandbox bug 404013.
+ use libzfs && addpredict /etc/dfs:/dev/zfs
+
+ multibuild_foreach_variant autotools-utils_src_compile
+
+ use doc && multibuild_for_best_variant \
+ autotools-utils_src_compile -C docs html
+}
+
+src_test() {
+ # The qemu dependency is a bit complex.
+ # You will need to adjust QEMU_SOFTMMU_TARGETS to match the cpu/platform.
+ multibuild_foreach_variant autotools-utils_src_test
+}
+
+src_install() {
+ multibuild_foreach_variant autotools-utils_src_install \
+ bashcompletiondir="$(get_bashcompdir)"
+
+ use doc && multibuild_for_best_variant run_in_build_dir \
+ emake -C docs DESTDIR="${D}" install-html
+
+ if use multislot; then
+ mv "${ED%/}"/usr/share/info/grub{,2}.info || die
+ fi
+
+ insinto /etc/default
+ newins "${FILESDIR}"/grub.default-2 grub
+
+ cd "${ED}" || die
+ pax-mark mpes $(scanelf -BF %F usr/{bin,sbin})
+}
+
+pkg_postinst() {
+ mount-boot_mount_boot_partition
+
+ if [[ -e "${ROOT%/}/boot/grub2/grub.cfg" && ! -e "${ROOT%/}/boot/grub/grub.cfg" ]]; then
+ mkdir -p "${ROOT%/}/boot/grub"
+ ln -s ../grub2/grub.cfg "${ROOT%/}/boot/grub/grub.cfg"
+ fi
+
+ mount-boot_pkg_postinst
+
+ elog "For information on how to configure GRUB2 please refer to the guide:"
+ elog " http://wiki.gentoo.org/wiki/GRUB2_Quick_Start"
+
+ if has_version 'sys-boot/grub:0'; then
+ elog "A migration guide for GRUB Legacy users is available:"
+ elog " https://wiki.gentoo.org/wiki/GRUB2_Migration"
+ fi
+
+ if [[ -z ${REPLACING_VERSIONS} ]]; then
+ if ! has_version sys-boot/os-prober; then
+ elog "Install sys-boot/os-prober to enable detection of other operating systems using grub2-mkconfig."
+ fi
+ if ! has_version dev-libs/libisoburn; then
+ elog "Install dev-libs/libisoburn to enable creation of rescue media using grub2-mkrescue."
+ fi
+ else
+ local v
+ for v in ${REPLACING_VERSIONS}; do
+ if use multislot && ! version_is_at_least 2.00_p5107-r1 ${v}; then
+ ewarn "The grub directory has changed from /boot/grub2 to /boot/grub."
+ ewarn "Please run grub2-install and grub2-mkconfig -o /boot/grub/grub.cfg."
+ break
+ fi
+ done
+ fi
+}
diff --git a/sys-boot/grub/grub-2.02_beta2-r3.ebuild b/sys-boot/grub/grub-2.02_beta2-r3.ebuild
new file mode 100644
index 000000000000..4a4a1da66fb2
--- /dev/null
+++ b/sys-boot/grub/grub-2.02_beta2-r3.ebuild
@@ -0,0 +1,313 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+AUTOTOOLS_AUTORECONF=1
+GRUB_AUTOGEN=1
+
+if [[ -n ${GRUB_AUTOGEN} ]]; then
+ PYTHON_COMPAT=( python{2_7,3_3,3_4} )
+ inherit python-any-r1
+fi
+
+inherit autotools-utils bash-completion-r1 eutils flag-o-matic mount-boot multibuild pax-utils toolchain-funcs versionator
+
+if [[ ${PV} != 9999 ]]; then
+ if [[ ${PV} == *_alpha* || ${PV} == *_beta* || ${PV} == *_rc* ]]; then
+ # The quote style is to work with <=bash-4.2 and >=bash-4.3 #503860
+ MY_P=${P/_/'~'}
+ SRC_URI="mirror://gnu-alpha/${PN}/${MY_P}.tar.xz
+ http://dev.gentoo.org/~floppym/dist/${P}-gentoo.tar.xz"
+ S=${WORKDIR}/${MY_P}
+ else
+ SRC_URI="mirror://gnu/${PN}/${P}.tar.xz
+ http://dev.gentoo.org/~floppym/dist/${P}.tar.xz"
+ S=${WORKDIR}/${P%_*}
+ fi
+ KEYWORDS="amd64 x86"
+ PATCHES=()
+else
+ inherit git-r3
+ EGIT_REPO_URI="git://git.sv.gnu.org/grub.git
+ http://git.savannah.gnu.org/r/grub.git"
+fi
+
+DEJAVU=dejavu-sans-ttf-2.34
+UNIFONT=unifont-7.0.01
+SRC_URI+=" mirror://gnu/unifont/${UNIFONT}/${UNIFONT}.pcf.gz
+ truetype? ( mirror://sourceforge/dejavu/${DEJAVU}.zip )"
+
+DESCRIPTION="GNU GRUB boot loader"
+HOMEPAGE="http://www.gnu.org/software/grub/"
+
+# Includes licenses for dejavu and unifont
+LICENSE="GPL-3 truetype? ( BitstreamVera GPL-2-with-font-exception )"
+SLOT="2"
+IUSE="debug device-mapper doc efiemu mount +multislot nls static sdl test truetype libzfs"
+
+GRUB_ALL_PLATFORMS=(
+ # everywhere:
+ emu
+ # mips only:
+ qemu-mips loongson
+ # amd64, x86, ppc, ppc64:
+ ieee1275
+ # amd64, x86:
+ coreboot multiboot efi-32 pc qemu xen
+ # amd64, ia64:
+ efi-64
+)
+IUSE+=" ${GRUB_ALL_PLATFORMS[@]/#/grub_platforms_}"
+
+# os-prober: Used on runtime to detect other OSes
+# xorriso (dev-libs/libisoburn): Used on runtime for mkrescue
+RDEPEND="
+ app-arch/xz-utils
+ >=sys-libs/ncurses-5.2-r5
+ debug? (
+ sdl? ( media-libs/libsdl )
+ )
+ device-mapper? ( >=sys-fs/lvm2-2.02.45 )
+ libzfs? ( sys-fs/zfs )
+ mount? ( sys-fs/fuse )
+ truetype? ( media-libs/freetype:2= )
+ ppc? ( sys-apps/ibm-powerpc-utils sys-apps/powerpc-utils )
+ ppc64? ( sys-apps/ibm-powerpc-utils sys-apps/powerpc-utils )
+"
+DEPEND="${RDEPEND}
+ ${PYTHON_DEPS}
+ app-misc/pax-utils
+ sys-devel/flex
+ sys-devel/bison
+ sys-apps/help2man
+ sys-apps/texinfo
+ grub_platforms_coreboot? ( media-libs/freetype:2 )
+ grub_platforms_qemu? ( media-libs/freetype:2 )
+ grub_platforms_ieee1275? ( media-libs/freetype:2 )
+ grub_platforms_loongson? ( media-libs/freetype:2 )
+ grub_platforms_xen? ( app-emulation/xen-tools )
+ static? (
+ app-arch/xz-utils[static-libs(+)]
+ truetype? (
+ app-arch/bzip2[static-libs(+)]
+ media-libs/freetype[static-libs(+)]
+ sys-libs/zlib[static-libs(+)]
+ )
+ )
+ test? (
+ dev-libs/libisoburn
+ app-emulation/qemu
+ )
+ truetype? ( app-arch/unzip )
+"
+RDEPEND+="
+ kernel_linux? (
+ grub_platforms_efi-32? ( sys-boot/efibootmgr )
+ grub_platforms_efi-64? ( sys-boot/efibootmgr )
+ )
+ !multislot? ( !sys-boot/grub:0 )
+ nls? ( sys-devel/gettext )
+"
+
+DEPEND+=" !!=media-libs/freetype-2.5.4"
+
+STRIP_MASK="*/grub/*/*.{mod,img}"
+RESTRICT="test"
+
+QA_EXECSTACK="
+ usr/bin/grub*-emu*
+ usr/lib*/grub/*/*.mod
+ usr/lib*/grub/*/*.module
+ usr/lib*/grub/*/kernel.exec
+ usr/lib*/grub/*/kernel.img
+"
+
+QA_WX_LOAD="
+ usr/lib*/grub/*/kernel.exec
+ usr/lib*/grub/*/kernel.img
+ usr/lib*/grub/*/*.image
+"
+
+QA_PRESTRIPPED="
+ usr/lib.*/grub/.*/kernel.img
+"
+
+src_unpack() {
+ if [[ ${PV} == 9999 ]]; then
+ git-r3_src_unpack
+ fi
+ default_src_unpack
+}
+
+src_prepare() {
+ EPATCH_SUFFIX="patch" EPATCH_FORCE="yes" epatch
+
+ [[ ${PATCHES} ]] && epatch "${PATCHES[@]}"
+
+ sed -i -e /autoreconf/d autogen.sh || die
+
+ if use multislot; then
+ # fix texinfo file name, bug 416035
+ sed -i -e 's/^\* GRUB:/* GRUB2:/' -e 's/(grub)/(grub2)/' docs/grub.texi || die
+ fi
+
+ epatch_user
+
+ if [[ -n ${GRUB_AUTOGEN} ]]; then
+ python_setup
+ bash autogen.sh || die
+ fi
+
+ if [[ -n ${AUTOTOOLS_AUTORECONF} ]]; then
+ autopoint() { return 0; }
+ eautoreconf
+ fi
+}
+
+setup_fonts() {
+ ln -s "${WORKDIR}/${UNIFONT}.pcf" unifont.pcf || die
+ if use truetype; then
+ ln -s "${WORKDIR}/${DEJAVU}/ttf/DejaVuSans.ttf" DejaVuSans.ttf || die
+ fi
+}
+
+grub_configure() {
+ local platform
+
+ case ${MULTIBUILD_VARIANT} in
+ efi-32)
+ platform=efi
+ if [[ ${CTARGET:-${CHOST}} == x86_64* ]]; then
+ local CTARGET=${CTARGET:-i386}
+ fi ;;
+ efi-64)
+ platform=efi
+ if [[ ${CTARGET:-${CHOST}} == i?86* ]]; then
+ local CTARGET=${CTARGET:-x86_64}
+ local TARGET_CFLAGS="-Os -march=x86-64 ${TARGET_CFLAGS}"
+ local TARGET_CPPFLAGS="-march=x86-64 ${TARGET_CPPFLAGS}"
+ export TARGET_CFLAGS TARGET_CPPFLAGS
+ fi ;;
+ guessed) ;;
+ *) platform=${MULTIBUILD_VARIANT} ;;
+ esac
+
+ local myeconfargs=(
+ --disable-werror
+ --program-prefix=
+ --libdir="${EPREFIX}"/usr/lib
+ --htmldir="${EPREFIX}"/usr/share/doc/${PF}/html
+ $(use_enable debug mm-debug)
+ $(use_enable debug grub-emu-usb)
+ $(use_enable device-mapper)
+ $(use_enable mount grub-mount)
+ $(use_enable nls)
+ $(use_enable truetype grub-mkfont)
+ $(use_enable libzfs)
+ $(use sdl && use_enable debug grub-emu-sdl)
+ ${platform:+--with-platform=}${platform}
+
+ # Let configure detect this where supported
+ $(usex efiemu '' '--disable-efiemu')
+ )
+
+ if use multislot; then
+ myeconfargs+=( --program-transform-name="s,grub,grub2," )
+ fi
+
+ mkdir -p "${BUILD_DIR}" || die
+ run_in_build_dir setup_fonts
+
+ autotools-utils_src_configure
+}
+
+src_configure() {
+ # Bug 508758.
+ replace-flags -O3 -O2
+
+ # We don't want to leak flags onto boot code.
+ export HOST_CCASFLAGS=${CCASFLAGS}
+ export HOST_CFLAGS=${CFLAGS}
+ export HOST_CPPFLAGS=${CPPFLAGS}
+ export HOST_LDFLAGS=${LDFLAGS}
+ unset CCASFLAGS CFLAGS CPPFLAGS LDFLAGS
+
+ use static && HOST_LDFLAGS+=" -static"
+
+ tc-ld-disable-gold #439082 #466536 #526348
+ export TARGET_LDFLAGS+=" ${LDFLAGS}"
+ unset LDFLAGS
+
+ tc-export CC NM OBJCOPY STRIP
+ export TARGET_CC=${TARGET_CC:-${CC}}
+ tc-export BUILD_CC # Bug 485592
+
+ # Portage will take care of cleaning up GRUB_PLATFORMS
+ MULTIBUILD_VARIANTS=( ${GRUB_PLATFORMS:-guessed} )
+ multibuild_parallel_foreach_variant grub_configure
+}
+
+src_compile() {
+ # Sandbox bug 404013.
+ use libzfs && addpredict /etc/dfs:/dev/zfs
+
+ multibuild_foreach_variant autotools-utils_src_compile
+
+ use doc && multibuild_for_best_variant \
+ autotools-utils_src_compile -C docs html
+}
+
+src_test() {
+ # The qemu dependency is a bit complex.
+ # You will need to adjust QEMU_SOFTMMU_TARGETS to match the cpu/platform.
+ multibuild_foreach_variant autotools-utils_src_test
+}
+
+src_install() {
+ multibuild_foreach_variant autotools-utils_src_install \
+ bashcompletiondir="$(get_bashcompdir)"
+
+ use doc && multibuild_for_best_variant run_in_build_dir \
+ emake -C docs DESTDIR="${D}" install-html
+
+ if use multislot; then
+ mv "${ED%/}"/usr/share/info/grub{,2}.info || die
+ fi
+
+ insinto /etc/default
+ newins "${FILESDIR}"/grub.default-3 grub
+}
+
+pkg_postinst() {
+ mount-boot_mount_boot_partition
+
+ if [[ -e "${ROOT%/}/boot/grub2/grub.cfg" ]]; then
+ ewarn "The grub directory has changed from /boot/grub2 to /boot/grub."
+ ewarn "Please run grub2-install and grub2-mkconfig -o /boot/grub/grub.cfg."
+
+ if [[ ! -e "${ROOT%/}/boot/grub/grub.cfg" ]]; then
+ mkdir -p "${ROOT%/}/boot/grub"
+ ln -s ../grub2/grub.cfg "${ROOT%/}/boot/grub/grub.cfg"
+ fi
+ fi
+
+ mount-boot_pkg_postinst
+
+ elog "For information on how to configure GRUB2 please refer to the guide:"
+ elog " http://wiki.gentoo.org/wiki/GRUB2_Quick_Start"
+
+ if has_version 'sys-boot/grub:0'; then
+ elog "A migration guide for GRUB Legacy users is available:"
+ elog " https://wiki.gentoo.org/wiki/GRUB2_Migration"
+ fi
+
+ if [[ -z ${REPLACING_VERSIONS} ]]; then
+ elog
+ elog "You may consider installing the following optional packages:"
+ optfeature "Detect other operating systems (grub-mkconfig)" sys-boot/os-prober
+ optfeature "Create rescue media (grub-mkrescue)" dev-libs/libisoburn
+ optfeature "Enable RAID device detection" sys-fs/mdadm
+ fi
+}
diff --git a/sys-boot/grub/grub-2.02_beta2-r6.ebuild b/sys-boot/grub/grub-2.02_beta2-r6.ebuild
new file mode 100644
index 000000000000..06ecaaa3bc8a
--- /dev/null
+++ b/sys-boot/grub/grub-2.02_beta2-r6.ebuild
@@ -0,0 +1,319 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+AUTOTOOLS_AUTORECONF=1
+GRUB_AUTOGEN=1
+
+if [[ -n ${GRUB_AUTOGEN} ]]; then
+ PYTHON_COMPAT=( python{2_7,3_3,3_4} )
+ inherit python-any-r1
+fi
+
+inherit autotools-utils bash-completion-r1 eutils flag-o-matic mount-boot multibuild pax-utils toolchain-funcs versionator
+
+if [[ ${PV} != 9999 ]]; then
+ if [[ ${PV} == *_alpha* || ${PV} == *_beta* || ${PV} == *_rc* ]]; then
+ # The quote style is to work with <=bash-4.2 and >=bash-4.3 #503860
+ MY_P=${P/_/'~'}
+ SRC_URI="mirror://gnu-alpha/${PN}/${MY_P}.tar.xz
+ http://dev.gentoo.org/~floppym/dist/${P}-gentoo-r1.tar.xz"
+ S=${WORKDIR}/${MY_P}
+ else
+ SRC_URI="mirror://gnu/${PN}/${P}.tar.xz
+ http://dev.gentoo.org/~floppym/dist/${P}.tar.xz"
+ S=${WORKDIR}/${P%_*}
+ fi
+ KEYWORDS="~amd64 ~x86"
+ PATCHES=()
+else
+ inherit git-r3
+ EGIT_REPO_URI="git://git.sv.gnu.org/grub.git
+ http://git.savannah.gnu.org/r/grub.git"
+fi
+
+DEJAVU=dejavu-sans-ttf-2.34
+UNIFONT=unifont-7.0.01
+SRC_URI+=" mirror://gnu/unifont/${UNIFONT}/${UNIFONT}.pcf.gz
+ truetype? ( mirror://sourceforge/dejavu/${DEJAVU}.zip )"
+
+DESCRIPTION="GNU GRUB boot loader"
+HOMEPAGE="http://www.gnu.org/software/grub/"
+
+# Includes licenses for dejavu and unifont
+LICENSE="GPL-3 truetype? ( BitstreamVera GPL-2-with-font-exception )"
+SLOT="2"
+IUSE="debug device-mapper doc efiemu mount +multislot nls static sdl test truetype libzfs"
+
+GRUB_ALL_PLATFORMS=(
+ # everywhere:
+ emu
+ # mips only:
+ qemu-mips loongson
+ # amd64, x86, ppc, ppc64:
+ ieee1275
+ # amd64, x86:
+ coreboot multiboot efi-32 pc qemu xen
+ # amd64, ia64:
+ efi-64
+)
+IUSE+=" ${GRUB_ALL_PLATFORMS[@]/#/grub_platforms_}"
+
+# os-prober: Used on runtime to detect other OSes
+# xorriso (dev-libs/libisoburn): Used on runtime for mkrescue
+RDEPEND="
+ app-arch/xz-utils
+ >=sys-libs/ncurses-5.2-r5
+ debug? (
+ sdl? ( media-libs/libsdl )
+ )
+ device-mapper? ( >=sys-fs/lvm2-2.02.45 )
+ libzfs? ( sys-fs/zfs )
+ mount? ( sys-fs/fuse )
+ truetype? ( media-libs/freetype:2= )
+ ppc? ( sys-apps/ibm-powerpc-utils sys-apps/powerpc-utils )
+ ppc64? ( sys-apps/ibm-powerpc-utils sys-apps/powerpc-utils )
+"
+DEPEND="${RDEPEND}
+ ${PYTHON_DEPS}
+ app-misc/pax-utils
+ sys-devel/flex
+ sys-devel/bison
+ sys-apps/help2man
+ sys-apps/texinfo
+ grub_platforms_coreboot? ( media-libs/freetype:2 )
+ grub_platforms_qemu? ( media-libs/freetype:2 )
+ grub_platforms_ieee1275? ( media-libs/freetype:2 )
+ grub_platforms_loongson? ( media-libs/freetype:2 )
+ grub_platforms_xen? ( app-emulation/xen-tools )
+ static? (
+ app-arch/xz-utils[static-libs(+)]
+ truetype? (
+ app-arch/bzip2[static-libs(+)]
+ media-libs/freetype[static-libs(+)]
+ sys-libs/zlib[static-libs(+)]
+ )
+ )
+ test? (
+ dev-libs/libisoburn
+ app-emulation/qemu
+ )
+ truetype? ( app-arch/unzip )
+"
+RDEPEND+="
+ kernel_linux? (
+ grub_platforms_efi-32? ( sys-boot/efibootmgr )
+ grub_platforms_efi-64? ( sys-boot/efibootmgr )
+ )
+ !multislot? ( !sys-boot/grub:0 )
+ nls? ( sys-devel/gettext )
+"
+
+DEPEND+=" !!=media-libs/freetype-2.5.4"
+
+STRIP_MASK="*/grub/*/*.{mod,img}"
+RESTRICT="test"
+
+QA_EXECSTACK="
+ usr/bin/grub*-emu*
+ usr/lib*/grub/*/*.mod
+ usr/lib*/grub/*/*.module
+ usr/lib*/grub/*/kernel.exec
+ usr/lib*/grub/*/kernel.img
+"
+
+QA_WX_LOAD="
+ usr/lib*/grub/*/kernel.exec
+ usr/lib*/grub/*/kernel.img
+ usr/lib*/grub/*/*.image
+"
+
+QA_PRESTRIPPED="
+ usr/lib.*/grub/.*/kernel.img
+"
+
+src_unpack() {
+ if [[ ${PV} == 9999 ]]; then
+ git-r3_src_unpack
+ fi
+ default_src_unpack
+}
+
+src_prepare() {
+ EPATCH_SUFFIX="patch" EPATCH_FORCE="yes" epatch
+
+ [[ ${PATCHES} ]] && epatch "${PATCHES[@]}"
+
+ sed -i -e /autoreconf/d autogen.sh || die
+
+ if use multislot; then
+ # fix texinfo file name, bug 416035
+ sed -i -e 's/^\* GRUB:/* GRUB2:/' -e 's/(grub)/(grub2)/' docs/grub.texi || die
+ fi
+
+ epatch_user
+
+ if [[ -n ${GRUB_AUTOGEN} ]]; then
+ python_setup
+ bash autogen.sh || die
+ fi
+
+ if [[ -n ${AUTOTOOLS_AUTORECONF} ]]; then
+ autopoint() { return 0; }
+ eautoreconf
+ fi
+}
+
+setup_fonts() {
+ ln -s "${WORKDIR}/${UNIFONT}.pcf" unifont.pcf || die
+ if use truetype; then
+ ln -s "${WORKDIR}/${DEJAVU}/ttf/DejaVuSans.ttf" DejaVuSans.ttf || die
+ fi
+}
+
+grub_configure() {
+ local platform
+
+ case ${MULTIBUILD_VARIANT} in
+ efi-32)
+ platform=efi
+ if [[ ${CTARGET:-${CHOST}} == x86_64* ]]; then
+ local CTARGET=${CTARGET:-i386}
+ fi ;;
+ efi-64)
+ platform=efi
+ if [[ ${CTARGET:-${CHOST}} == i?86* ]]; then
+ local CTARGET=${CTARGET:-x86_64}
+ local TARGET_CFLAGS="-Os -march=x86-64 ${TARGET_CFLAGS}"
+ local TARGET_CPPFLAGS="-march=x86-64 ${TARGET_CPPFLAGS}"
+ export TARGET_CFLAGS TARGET_CPPFLAGS
+ fi ;;
+ guessed) ;;
+ *) platform=${MULTIBUILD_VARIANT} ;;
+ esac
+
+ local myeconfargs=(
+ --disable-werror
+ --program-prefix=
+ --libdir="${EPREFIX}"/usr/lib
+ --htmldir="${EPREFIX}"/usr/share/doc/${PF}/html
+ $(use_enable debug mm-debug)
+ $(use_enable debug grub-emu-usb)
+ $(use_enable device-mapper)
+ $(use_enable mount grub-mount)
+ $(use_enable nls)
+ $(use_enable truetype grub-mkfont)
+ $(use_enable libzfs)
+ $(use sdl && use_enable debug grub-emu-sdl)
+ ${platform:+--with-platform=}${platform}
+
+ # Let configure detect this where supported
+ $(usex efiemu '' '--disable-efiemu')
+ )
+
+ if use multislot; then
+ myeconfargs+=( --program-transform-name="s,grub,grub2," )
+ fi
+
+ mkdir -p "${BUILD_DIR}" || die
+ run_in_build_dir setup_fonts
+
+ autotools-utils_src_configure
+}
+
+src_configure() {
+ # Bug 508758.
+ replace-flags -O3 -O2
+
+ # We don't want to leak flags onto boot code.
+ export HOST_CCASFLAGS=${CCASFLAGS}
+ export HOST_CFLAGS=${CFLAGS}
+ export HOST_CPPFLAGS=${CPPFLAGS}
+ export HOST_LDFLAGS=${LDFLAGS}
+ unset CCASFLAGS CFLAGS CPPFLAGS LDFLAGS
+
+ use static && HOST_LDFLAGS+=" -static"
+
+ tc-ld-disable-gold #439082 #466536 #526348
+ export TARGET_LDFLAGS+=" ${LDFLAGS}"
+ unset LDFLAGS
+
+ tc-export CC NM OBJCOPY STRIP
+ export TARGET_CC=${TARGET_CC:-${CC}}
+ tc-export BUILD_CC # Bug 485592
+
+ # Portage will take care of cleaning up GRUB_PLATFORMS
+ MULTIBUILD_VARIANTS=( ${GRUB_PLATFORMS:-guessed} )
+ multibuild_parallel_foreach_variant grub_configure
+}
+
+src_compile() {
+ # Sandbox bug 404013.
+ use libzfs && addpredict /etc/dfs:/dev/zfs
+
+ multibuild_foreach_variant autotools-utils_src_compile
+
+ use doc && multibuild_for_best_variant \
+ autotools-utils_src_compile -C docs html
+}
+
+src_test() {
+ # The qemu dependency is a bit complex.
+ # You will need to adjust QEMU_SOFTMMU_TARGETS to match the cpu/platform.
+ multibuild_foreach_variant autotools-utils_src_test
+}
+
+src_install() {
+ multibuild_foreach_variant autotools-utils_src_install \
+ bashcompletiondir="$(get_bashcompdir)"
+
+ local grub=grub
+ if use multislot; then
+ grub=grub2
+ mv "${ED%/}"/usr/share/info/grub{,2}.info || die
+ mv "${ED%/}"/$(get_bashcompdir)/grub{,2} || die
+ fi
+
+ bashcomp_alias ${grub} ${grub}-{install,set-default,mkrescue,reboot,script-check,editenv,sparc64-setup,mkfont,mkpasswd-pbkdf2,mkimage,bios-setup,mkconfig,probe}
+
+ use doc && multibuild_for_best_variant run_in_build_dir \
+ emake -C docs DESTDIR="${D}" install-html
+
+ insinto /etc/default
+ newins "${FILESDIR}"/grub.default-3 grub
+}
+
+pkg_postinst() {
+ mount-boot_mount_boot_partition
+
+ if [[ -e "${ROOT%/}/boot/grub2/grub.cfg" ]]; then
+ ewarn "The grub directory has changed from /boot/grub2 to /boot/grub."
+ ewarn "Please run grub2-install and grub2-mkconfig -o /boot/grub/grub.cfg."
+
+ if [[ ! -e "${ROOT%/}/boot/grub/grub.cfg" ]]; then
+ mkdir -p "${ROOT%/}/boot/grub"
+ ln -s ../grub2/grub.cfg "${ROOT%/}/boot/grub/grub.cfg"
+ fi
+ fi
+
+ mount-boot_pkg_postinst
+
+ elog "For information on how to configure GRUB2 please refer to the guide:"
+ elog " http://wiki.gentoo.org/wiki/GRUB2_Quick_Start"
+
+ if has_version 'sys-boot/grub:0'; then
+ elog "A migration guide for GRUB Legacy users is available:"
+ elog " https://wiki.gentoo.org/wiki/GRUB2_Migration"
+ fi
+
+ if [[ -z ${REPLACING_VERSIONS} ]]; then
+ if ! has_version sys-boot/os-prober; then
+ elog "Install sys-boot/os-prober to enable detection of other operating systems using grub2-mkconfig."
+ fi
+ if ! has_version dev-libs/libisoburn; then
+ elog "Install dev-libs/libisoburn to enable creation of rescue media using grub2-mkrescue."
+ fi
+ fi
+}
diff --git a/sys-boot/grub/grub-2.02_beta2-r7.ebuild b/sys-boot/grub/grub-2.02_beta2-r7.ebuild
new file mode 100644
index 000000000000..0f6718aa04bd
--- /dev/null
+++ b/sys-boot/grub/grub-2.02_beta2-r7.ebuild
@@ -0,0 +1,314 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+AUTOTOOLS_AUTORECONF=1
+GRUB_AUTOGEN=1
+
+if [[ -n ${GRUB_AUTOGEN} ]]; then
+ PYTHON_COMPAT=( python{2_7,3_3,3_4} )
+ inherit python-any-r1
+fi
+
+inherit autotools-utils bash-completion-r1 eutils flag-o-matic mount-boot multibuild pax-utils toolchain-funcs versionator
+
+if [[ ${PV} != 9999 ]]; then
+ if [[ ${PV} == *_alpha* || ${PV} == *_beta* || ${PV} == *_rc* ]]; then
+ # The quote style is to work with <=bash-4.2 and >=bash-4.3 #503860
+ MY_P=${P/_/'~'}
+ SRC_URI="mirror://gnu-alpha/${PN}/${MY_P}.tar.xz
+ http://dev.gentoo.org/~floppym/dist/${P}-gentoo-r3.tar.xz"
+ S=${WORKDIR}/${MY_P}
+ else
+ SRC_URI="mirror://gnu/${PN}/${P}.tar.xz
+ http://dev.gentoo.org/~floppym/dist/${P}.tar.xz"
+ S=${WORKDIR}/${P%_*}
+ fi
+ KEYWORDS="amd64 x86"
+ PATCHES=()
+else
+ inherit git-r3
+ EGIT_REPO_URI="git://git.sv.gnu.org/grub.git
+ http://git.savannah.gnu.org/r/grub.git"
+fi
+
+DEJAVU=dejavu-sans-ttf-2.34
+UNIFONT=unifont-7.0.06
+SRC_URI+=" fonts? ( mirror://gnu/unifont/${UNIFONT}/${UNIFONT}.pcf.gz )
+ themes? ( mirror://sourceforge/dejavu/${DEJAVU}.zip )"
+
+DESCRIPTION="GNU GRUB boot loader"
+HOMEPAGE="http://www.gnu.org/software/grub/"
+
+# Includes licenses for dejavu and unifont
+LICENSE="GPL-3 fonts? ( GPL-2-with-font-exception ) themes? ( BitstreamVera )"
+SLOT="2"
+IUSE="debug device-mapper doc efiemu +fonts mount +multislot nls static sdl test +themes truetype libzfs"
+
+GRUB_ALL_PLATFORMS=( coreboot efi-32 efi-64 emu ieee1275 loongson multiboot qemu qemu-mips pc uboot xen )
+IUSE+=" ${GRUB_ALL_PLATFORMS[@]/#/grub_platforms_}"
+
+REQUIRED_USE="
+ grub_platforms_coreboot? ( fonts )
+ grub_platforms_qemu? ( fonts )
+ grub_platforms_ieee1275? ( fonts )
+ grub_platforms_loongson? ( fonts )
+"
+
+# os-prober: Used on runtime to detect other OSes
+# xorriso (dev-libs/libisoburn): Used on runtime for mkrescue
+RDEPEND="
+ app-arch/xz-utils
+ >=sys-libs/ncurses-5.2-r5
+ debug? (
+ sdl? ( media-libs/libsdl )
+ )
+ device-mapper? ( >=sys-fs/lvm2-2.02.45 )
+ libzfs? ( sys-fs/zfs )
+ mount? ( sys-fs/fuse )
+ truetype? ( media-libs/freetype:2= )
+ ppc? ( sys-apps/ibm-powerpc-utils sys-apps/powerpc-utils )
+ ppc64? ( sys-apps/ibm-powerpc-utils sys-apps/powerpc-utils )
+"
+DEPEND="${RDEPEND}
+ ${PYTHON_DEPS}
+ app-misc/pax-utils
+ sys-devel/flex
+ sys-devel/bison
+ sys-apps/help2man
+ sys-apps/texinfo
+ fonts? ( media-libs/freetype:2 )
+ grub_platforms_xen? ( app-emulation/xen-tools )
+ static? (
+ app-arch/xz-utils[static-libs(+)]
+ truetype? (
+ app-arch/bzip2[static-libs(+)]
+ media-libs/freetype[static-libs(+)]
+ sys-libs/zlib[static-libs(+)]
+ )
+ )
+ test? (
+ dev-libs/libisoburn
+ app-emulation/qemu
+ )
+ themes? (
+ app-arch/unzip
+ media-libs/freetype:2
+ )
+"
+RDEPEND+="
+ kernel_linux? (
+ grub_platforms_efi-32? ( sys-boot/efibootmgr )
+ grub_platforms_efi-64? ( sys-boot/efibootmgr )
+ )
+ !multislot? ( !sys-boot/grub:0 )
+ nls? ( sys-devel/gettext )
+"
+
+DEPEND+=" !!=media-libs/freetype-2.5.4"
+
+STRIP_MASK="*/grub/*/*.{mod,img}"
+RESTRICT="test"
+
+QA_EXECSTACK="
+ usr/bin/grub*-emu*
+ usr/lib*/grub/*/*.mod
+ usr/lib*/grub/*/*.module
+ usr/lib*/grub/*/kernel.exec
+ usr/lib*/grub/*/kernel.img
+"
+
+QA_WX_LOAD="
+ usr/lib*/grub/*/kernel.exec
+ usr/lib*/grub/*/kernel.img
+ usr/lib*/grub/*/*.image
+"
+
+QA_PRESTRIPPED="
+ usr/lib.*/grub/.*/kernel.img
+"
+
+src_unpack() {
+ if [[ ${PV} == 9999 ]]; then
+ git-r3_src_unpack
+ fi
+ default_src_unpack
+}
+
+src_prepare() {
+ EPATCH_SUFFIX="patch" EPATCH_FORCE="yes" epatch
+
+ [[ ${PATCHES} ]] && epatch "${PATCHES[@]}"
+
+ sed -i -e /autoreconf/d autogen.sh || die
+
+ if use multislot; then
+ # fix texinfo file name, bug 416035
+ sed -i -e 's/^\* GRUB:/* GRUB2:/' -e 's/(grub)/(grub2)/' docs/grub.texi || die
+ fi
+
+ epatch_user
+
+ if [[ -n ${GRUB_AUTOGEN} ]]; then
+ python_setup
+ bash autogen.sh || die
+ fi
+
+ if [[ -n ${AUTOTOOLS_AUTORECONF} ]]; then
+ autopoint() { return 0; }
+ eautoreconf
+ fi
+}
+
+setup_fonts() {
+ ln -s "${WORKDIR}/${UNIFONT}.pcf" unifont.pcf || die
+ if use themes; then
+ ln -s "${WORKDIR}/${DEJAVU}/ttf/DejaVuSans.ttf" DejaVuSans.ttf || die
+ fi
+}
+
+grub_configure() {
+ local platform
+
+ case ${MULTIBUILD_VARIANT} in
+ efi-32)
+ platform=efi
+ if [[ ${CTARGET:-${CHOST}} == x86_64* ]]; then
+ local CTARGET=${CTARGET:-i386}
+ fi ;;
+ efi-64)
+ platform=efi
+ if [[ ${CTARGET:-${CHOST}} == i?86* ]]; then
+ local CTARGET=${CTARGET:-x86_64}
+ local TARGET_CFLAGS="-Os -march=x86-64 ${TARGET_CFLAGS}"
+ local TARGET_CPPFLAGS="-march=x86-64 ${TARGET_CPPFLAGS}"
+ export TARGET_CFLAGS TARGET_CPPFLAGS
+ fi ;;
+ guessed) ;;
+ *) platform=${MULTIBUILD_VARIANT} ;;
+ esac
+
+ local myeconfargs=(
+ --disable-werror
+ --program-prefix=
+ --libdir="${EPREFIX}"/usr/lib
+ --htmldir="${EPREFIX}"/usr/share/doc/${PF}/html
+ $(use_enable debug mm-debug)
+ $(use_enable debug grub-emu-usb)
+ $(use_enable device-mapper)
+ $(use_enable mount grub-mount)
+ $(use_enable nls)
+ $(use_enable themes grub-themes)
+ $(use_enable truetype grub-mkfont)
+ $(use_enable libzfs)
+ $(use sdl && use_enable debug grub-emu-sdl)
+ ${platform:+--with-platform=}${platform}
+
+ # Let configure detect this where supported
+ $(usex efiemu '' '--disable-efiemu')
+ )
+
+ if use multislot; then
+ myeconfargs+=( --program-transform-name="s,grub,grub2," )
+ fi
+
+ mkdir -p "${BUILD_DIR}" || die
+ run_in_build_dir setup_fonts
+
+ autotools-utils_src_configure
+}
+
+src_configure() {
+ # Bug 508758.
+ replace-flags -O3 -O2
+
+ # We don't want to leak flags onto boot code.
+ export HOST_CCASFLAGS=${CCASFLAGS}
+ export HOST_CFLAGS=${CFLAGS}
+ export HOST_CPPFLAGS=${CPPFLAGS}
+ export HOST_LDFLAGS=${LDFLAGS}
+ unset CCASFLAGS CFLAGS CPPFLAGS LDFLAGS
+
+ use static && HOST_LDFLAGS+=" -static"
+
+ tc-ld-disable-gold #439082 #466536 #526348
+ export TARGET_LDFLAGS="${TARGET_LDFLAGS} ${LDFLAGS}"
+ unset LDFLAGS
+
+ tc-export CC NM OBJCOPY RANLIB STRIP
+ tc-export BUILD_CC # Bug 485592
+
+ # Portage will take care of cleaning up GRUB_PLATFORMS
+ MULTIBUILD_VARIANTS=( ${GRUB_PLATFORMS:-guessed} )
+ multibuild_parallel_foreach_variant grub_configure
+}
+
+src_compile() {
+ # Sandbox bug 404013.
+ use libzfs && addpredict /etc/dfs:/dev/zfs
+
+ multibuild_foreach_variant autotools-utils_src_compile
+
+ use doc && multibuild_for_best_variant \
+ autotools-utils_src_compile -C docs html
+}
+
+src_test() {
+ # The qemu dependency is a bit complex.
+ # You will need to adjust QEMU_SOFTMMU_TARGETS to match the cpu/platform.
+ multibuild_foreach_variant autotools-utils_src_test
+}
+
+src_install() {
+ multibuild_foreach_variant autotools-utils_src_install \
+ bashcompletiondir="$(get_bashcompdir)"
+
+ local grub=grub
+ if use multislot; then
+ grub=grub2
+ mv "${ED%/}"/usr/share/info/grub{,2}.info || die
+ mv "${ED%/}"/$(get_bashcompdir)/grub{,2} || die
+ fi
+
+ bashcomp_alias ${grub} ${grub}-{install,set-default,mkrescue,reboot,script-check,editenv,sparc64-setup,mkfont,mkpasswd-pbkdf2,mkimage,bios-setup,mkconfig,probe}
+
+ use doc && multibuild_for_best_variant run_in_build_dir \
+ emake -C docs DESTDIR="${D}" install-html
+
+ insinto /etc/default
+ newins "${FILESDIR}"/grub.default-3 grub
+}
+
+pkg_postinst() {
+ mount-boot_mount_boot_partition
+
+ if [[ -e "${ROOT%/}/boot/grub2/grub.cfg" ]]; then
+ ewarn "The grub directory has changed from /boot/grub2 to /boot/grub."
+ ewarn "Please run grub2-install and grub2-mkconfig -o /boot/grub/grub.cfg."
+
+ if [[ ! -e "${ROOT%/}/boot/grub/grub.cfg" ]]; then
+ mkdir -p "${ROOT%/}/boot/grub"
+ ln -s ../grub2/grub.cfg "${ROOT%/}/boot/grub/grub.cfg"
+ fi
+ fi
+
+ mount-boot_pkg_postinst
+
+ elog "For information on how to configure GRUB2 please refer to the guide:"
+ elog " http://wiki.gentoo.org/wiki/GRUB2_Quick_Start"
+
+ if has_version 'sys-boot/grub:0'; then
+ elog "A migration guide for GRUB Legacy users is available:"
+ elog " https://wiki.gentoo.org/wiki/GRUB2_Migration"
+ fi
+
+ if [[ -z ${REPLACING_VERSIONS} ]]; then
+ elog
+ elog "You may consider installing the following optional packages:"
+ optfeature "Detect other operating systems (grub-mkconfig)" sys-boot/os-prober
+ optfeature "Create rescue media (grub-mkrescue)" dev-libs/libisoburn
+ optfeature "Enable RAID device detection" sys-fs/mdadm
+ fi
+}
diff --git a/sys-boot/grub/grub-9999-r1.ebuild b/sys-boot/grub/grub-9999-r1.ebuild
new file mode 100644
index 000000000000..837685eb0552
--- /dev/null
+++ b/sys-boot/grub/grub-9999-r1.ebuild
@@ -0,0 +1,309 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+if [[ ${PV} == 9999 ]]; then
+ AUTOTOOLS_AUTORECONF=1
+ GRUB_AUTOGEN=1
+fi
+
+if [[ -n ${GRUB_AUTOGEN} ]]; then
+ PYTHON_COMPAT=( python{2_7,3_3,3_4} )
+ inherit python-any-r1
+fi
+
+inherit autotools-utils bash-completion-r1 eutils flag-o-matic mount-boot multibuild pax-utils toolchain-funcs versionator
+
+if [[ ${PV} != 9999 ]]; then
+ if [[ ${PV} == *_alpha* || ${PV} == *_beta* || ${PV} == *_rc* ]]; then
+ # The quote style is to work with <=bash-4.2 and >=bash-4.3 #503860
+ MY_P=${P/_/'~'}
+ SRC_URI="mirror://gnu-alpha/${PN}/${MY_P}.tar.xz"
+ S=${WORKDIR}/${MY_P}
+ else
+ SRC_URI="mirror://gnu/${PN}/${P}.tar.xz
+ mirror://gentoo/${P}.tar.xz
+ http://dev.gentoo.org/~floppym/dist/${P}.tar.xz"
+ S=${WORKDIR}/${P%_*}
+ fi
+ KEYWORDS="~amd64 ~x86"
+ PATCHES=()
+else
+ inherit git-r3
+ EGIT_REPO_URI="git://git.sv.gnu.org/grub.git
+ http://git.savannah.gnu.org/r/grub.git"
+fi
+
+DEJAVU=dejavu-sans-ttf-2.34
+UNIFONT=unifont-7.0.06
+SRC_URI+=" fonts? ( mirror://gnu/unifont/${UNIFONT}/${UNIFONT}.pcf.gz )
+ themes? ( mirror://sourceforge/dejavu/${DEJAVU}.zip )"
+
+DESCRIPTION="GNU GRUB boot loader"
+HOMEPAGE="http://www.gnu.org/software/grub/"
+
+# Includes licenses for dejavu and unifont
+LICENSE="GPL-3 fonts? ( GPL-2-with-font-exception ) themes? ( BitstreamVera )"
+SLOT="2"
+IUSE="debug device-mapper doc efiemu +fonts mount +multislot nls static sdl test +themes truetype libzfs"
+
+GRUB_ALL_PLATFORMS=( coreboot efi-32 efi-64 emu ieee1275 loongson multiboot qemu qemu-mips pc uboot xen )
+IUSE+=" ${GRUB_ALL_PLATFORMS[@]/#/grub_platforms_}"
+
+REQUIRED_USE="
+ grub_platforms_coreboot? ( fonts )
+ grub_platforms_qemu? ( fonts )
+ grub_platforms_ieee1275? ( fonts )
+ grub_platforms_loongson? ( fonts )
+"
+
+# os-prober: Used on runtime to detect other OSes
+# xorriso (dev-libs/libisoburn): Used on runtime for mkrescue
+RDEPEND="
+ app-arch/xz-utils
+ >=sys-libs/ncurses-5.2-r5
+ debug? (
+ sdl? ( media-libs/libsdl )
+ )
+ device-mapper? ( >=sys-fs/lvm2-2.02.45 )
+ libzfs? ( sys-fs/zfs )
+ mount? ( sys-fs/fuse )
+ truetype? ( media-libs/freetype:2= )
+ ppc? ( sys-apps/ibm-powerpc-utils sys-apps/powerpc-utils )
+ ppc64? ( sys-apps/ibm-powerpc-utils sys-apps/powerpc-utils )
+"
+DEPEND="${RDEPEND}
+ ${PYTHON_DEPS}
+ app-misc/pax-utils
+ sys-devel/flex
+ sys-devel/bison
+ sys-apps/help2man
+ sys-apps/texinfo
+ fonts? ( media-libs/freetype:2 )
+ grub_platforms_xen? ( app-emulation/xen-tools )
+ static? (
+ app-arch/xz-utils[static-libs(+)]
+ truetype? (
+ app-arch/bzip2[static-libs(+)]
+ media-libs/freetype[static-libs(+)]
+ sys-libs/zlib[static-libs(+)]
+ )
+ )
+ test? (
+ dev-libs/libisoburn
+ app-emulation/qemu
+ )
+ themes? (
+ app-arch/unzip
+ media-libs/freetype:2
+ )
+"
+RDEPEND+="
+ kernel_linux? (
+ grub_platforms_efi-32? ( sys-boot/efibootmgr )
+ grub_platforms_efi-64? ( sys-boot/efibootmgr )
+ )
+ !multislot? ( !sys-boot/grub:0 )
+ nls? ( sys-devel/gettext )
+"
+
+DEPEND+=" !!=media-libs/freetype-2.5.4"
+
+STRIP_MASK="*/grub/*/*.{mod,img}"
+RESTRICT="test"
+
+QA_EXECSTACK="
+ usr/bin/grub*-emu*
+ usr/lib*/grub/*/*.mod
+ usr/lib*/grub/*/*.module
+ usr/lib*/grub/*/kernel.exec
+ usr/lib*/grub/*/kernel.img
+"
+
+QA_WX_LOAD="
+ usr/lib*/grub/*/kernel.exec
+ usr/lib*/grub/*/kernel.img
+ usr/lib*/grub/*/*.image
+"
+
+QA_PRESTRIPPED="
+ usr/lib.*/grub/.*/kernel.img
+"
+
+src_unpack() {
+ if [[ ${PV} == 9999 ]]; then
+ git-r3_src_unpack
+ fi
+ default_src_unpack
+}
+
+src_prepare() {
+ [[ ${PATCHES} ]] && epatch "${PATCHES[@]}"
+
+ sed -i -e /autoreconf/d autogen.sh || die
+
+ if use multislot; then
+ # fix texinfo file name, bug 416035
+ sed -i -e 's/^\* GRUB:/* GRUB2:/' -e 's/(grub)/(grub2)/' docs/grub.texi || die
+ fi
+
+ epatch_user
+
+ if [[ -n ${GRUB_AUTOGEN} ]]; then
+ python_setup
+ bash autogen.sh || die
+ fi
+
+ if [[ -n ${AUTOTOOLS_AUTORECONF} ]]; then
+ autopoint() { return 0; }
+ eautoreconf
+ fi
+}
+
+setup_fonts() {
+ ln -s "${WORKDIR}/${UNIFONT}.pcf" unifont.pcf || die
+ if use themes; then
+ ln -s "${WORKDIR}/${DEJAVU}/ttf/DejaVuSans.ttf" DejaVuSans.ttf || die
+ fi
+}
+
+grub_configure() {
+ local platform
+
+ case ${MULTIBUILD_VARIANT} in
+ efi-32)
+ platform=efi
+ if [[ ${CTARGET:-${CHOST}} == x86_64* ]]; then
+ local CTARGET=${CTARGET:-i386}
+ fi ;;
+ efi-64)
+ platform=efi
+ if [[ ${CTARGET:-${CHOST}} == i?86* ]]; then
+ local CTARGET=${CTARGET:-x86_64}
+ local TARGET_CFLAGS="-Os -march=x86-64 ${TARGET_CFLAGS}"
+ local TARGET_CPPFLAGS="-march=x86-64 ${TARGET_CPPFLAGS}"
+ export TARGET_CFLAGS TARGET_CPPFLAGS
+ fi ;;
+ guessed) ;;
+ *) platform=${MULTIBUILD_VARIANT} ;;
+ esac
+
+ local myeconfargs=(
+ --disable-werror
+ --program-prefix=
+ --libdir="${EPREFIX}"/usr/lib
+ --htmldir="${EPREFIX}"/usr/share/doc/${PF}/html
+ $(use_enable debug mm-debug)
+ $(use_enable debug grub-emu-usb)
+ $(use_enable device-mapper)
+ $(use_enable mount grub-mount)
+ $(use_enable nls)
+ $(use_enable themes grub-themes)
+ $(use_enable truetype grub-mkfont)
+ $(use_enable libzfs)
+ $(use sdl && use_enable debug grub-emu-sdl)
+ ${platform:+--with-platform=}${platform}
+
+ # Let configure detect this where supported
+ $(usex efiemu '' '--disable-efiemu')
+ )
+
+ if use multislot; then
+ myeconfargs+=( --program-transform-name="s,grub,grub2," )
+ fi
+
+ mkdir -p "${BUILD_DIR}" || die
+ run_in_build_dir setup_fonts
+
+ autotools-utils_src_configure
+}
+
+src_configure() {
+ # Bug 508758.
+ replace-flags -O3 -O2
+
+ # We don't want to leak flags onto boot code.
+ export HOST_CCASFLAGS=${CCASFLAGS}
+ export HOST_CFLAGS=${CFLAGS}
+ export HOST_CPPFLAGS=${CPPFLAGS}
+ export HOST_LDFLAGS=${LDFLAGS}
+ unset CCASFLAGS CFLAGS CPPFLAGS LDFLAGS
+
+ use static && HOST_LDFLAGS+=" -static"
+
+ tc-ld-disable-gold #439082 #466536 #526348
+ export TARGET_LDFLAGS="${TARGET_LDFLAGS} ${LDFLAGS}"
+ unset LDFLAGS
+
+ tc-export CC NM OBJCOPY RANLIB STRIP
+ tc-export BUILD_CC # Bug 485592
+
+ # Portage will take care of cleaning up GRUB_PLATFORMS
+ MULTIBUILD_VARIANTS=( ${GRUB_PLATFORMS:-guessed} )
+ multibuild_parallel_foreach_variant grub_configure
+}
+
+src_compile() {
+ # Sandbox bug 404013.
+ use libzfs && addpredict /etc/dfs:/dev/zfs
+
+ multibuild_foreach_variant autotools-utils_src_compile
+
+ use doc && multibuild_for_best_variant \
+ autotools-utils_src_compile -C docs html
+}
+
+src_test() {
+ # The qemu dependency is a bit complex.
+ # You will need to adjust QEMU_SOFTMMU_TARGETS to match the cpu/platform.
+ multibuild_foreach_variant autotools-utils_src_test
+}
+
+src_install() {
+ multibuild_foreach_variant autotools-utils_src_install \
+ bashcompletiondir="$(get_bashcompdir)"
+
+ use doc && multibuild_for_best_variant run_in_build_dir \
+ emake -C docs DESTDIR="${D}" install-html
+
+ if use multislot; then
+ mv "${ED%/}"/usr/share/info/grub{,2}.info || die
+ fi
+
+ insinto /etc/default
+ newins "${FILESDIR}"/grub.default-3 grub
+}
+
+pkg_postinst() {
+ mount-boot_mount_boot_partition
+
+ if [[ -e "${ROOT%/}/boot/grub2/grub.cfg" ]]; then
+ ewarn "The grub directory has changed from /boot/grub2 to /boot/grub."
+ ewarn "Please run grub2-install and grub2-mkconfig -o /boot/grub/grub.cfg."
+
+ if [[ ! -e "${ROOT%/}/boot/grub/grub.cfg" ]]; then
+ mkdir -p "${ROOT%/}/boot/grub"
+ ln -s ../grub2/grub.cfg "${ROOT%/}/boot/grub/grub.cfg"
+ fi
+ fi
+
+ mount-boot_pkg_postinst
+
+ elog "For information on how to configure GRUB2 please refer to the guide:"
+ elog " http://wiki.gentoo.org/wiki/GRUB2_Quick_Start"
+
+ if has_version 'sys-boot/grub:0'; then
+ elog "A migration guide for GRUB Legacy users is available:"
+ elog " https://wiki.gentoo.org/wiki/GRUB2_Migration"
+ fi
+
+ if [[ -z ${REPLACING_VERSIONS} ]]; then
+ elog
+ elog "You may consider installing the following optional packages:"
+ optfeature "Detect other operating systems (grub-mkconfig)" sys-boot/os-prober
+ optfeature "Create rescue media (grub-mkrescue)" dev-libs/libisoburn
+ optfeature "Enable RAID device detection" sys-fs/mdadm
+ fi
+}
diff --git a/sys-boot/grub/metadata.xml b/sys-boot/grub/metadata.xml
new file mode 100644
index 000000000000..1df6b4037847
--- /dev/null
+++ b/sys-boot/grub/metadata.xml
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>base-system</herd>
+ <maintainer>
+ <email>base-system@gentoo.org</email>
+ </maintainer>
+ <maintainer restrict="&gt;=sys-boot/grub-2">
+ <email>floppym@gentoo.org</email>
+ <name>Mike Gilbert</name>
+ </maintainer>
+ <use>
+ <flag name="device-mapper">
+ Enable support for device-mapper from <pkg>sys-fs/lvm2</pkg>
+ </flag>
+ <flag name="efiemu">
+ Build and install the efiemu runtimes
+ </flag>
+ <flag name="fonts">Build and install fonts for the gfxterm module</flag>
+ <flag name="mount">
+ Build and install the grub-mount utility
+ </flag>
+ <flag name="libzfs">
+ Enable support for <pkg>sys-fs/zfs</pkg>
+ </flag>
+ <flag name="multislot">
+ Allow concurrent installation of <pkg>sys-boot/grub:0</pkg> and
+ <pkg>sys-boot/grub:2</pkg> by renaming all programs.
+ </flag>
+ <flag name="themes">Build and install GRUB themes (starfield)</flag>
+ <flag name="truetype">Build and install grub-mkfont conversion utility</flag>
+ </use>
+ <upstream>
+ <remote-id type="sourceforge">dejavu</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-boot/gummiboot/Manifest b/sys-boot/gummiboot/Manifest
new file mode 100644
index 000000000000..eab13032a2d0
--- /dev/null
+++ b/sys-boot/gummiboot/Manifest
@@ -0,0 +1 @@
+DIST gummiboot-45.tar.xz 126376 SHA256 e3a6734c4c5acd3b42ec72dfc1214147c9f0ca74f08eeb44f969eb0d9b6d1e50 SHA512 09472a34ef8697a605c65462dde41ef09b1528a63b3a006f73a179ebeb16ac236adf9aaf8c8d7d3c411f3e3e029eb47ad916dc13f69ad9558c4277b1fa3d0619 WHIRLPOOL 04418cb9fd20df1a2bf77264bb766dc8542df8c1b05038ae780fbaa5dfb83e84f02cfd1adb20e22a032e9b0ad6e4654f40e25a67e5edf6b09e918c257930b9e1
diff --git a/sys-boot/gummiboot/gummiboot-45.ebuild b/sys-boot/gummiboot/gummiboot-45.ebuild
new file mode 100644
index 000000000000..571881a2437c
--- /dev/null
+++ b/sys-boot/gummiboot/gummiboot-45.ebuild
@@ -0,0 +1,33 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils linux-info
+
+DESCRIPTION="Minimalistic UEFI bootloader"
+HOMEPAGE="http://freedesktop.org/wiki/Software/gummiboot/"
+SRC_URI="http://dev.gentoo.org/~mgorny/dist/${P}.tar.xz"
+
+LICENSE="LGPL-2.1+"
+SLOT="0"
+KEYWORDS="~amd64"
+IUSE=""
+
+RDEPEND="sys-apps/util-linux"
+DEPEND="${RDEPEND}
+ app-arch/xz-utils
+ app-text/docbook-xsl-stylesheets
+ dev-libs/libxslt
+ >=sys-boot/gnu-efi-3.0.2"
+
+pkg_pretend() {
+ # CONFIG_EFI_STUB is required to boot a kernel with gummiboot
+ local CONFIG_CHECK="~EFI_STUB"
+ check_extra_config
+}
+
+src_prepare() {
+ epatch_user
+}
diff --git a/sys-boot/gummiboot/gummiboot-9999.ebuild b/sys-boot/gummiboot/gummiboot-9999.ebuild
new file mode 100644
index 000000000000..712a32aa1b65
--- /dev/null
+++ b/sys-boot/gummiboot/gummiboot-9999.ebuild
@@ -0,0 +1,33 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit autotools eutils linux-info git-r3
+
+DESCRIPTION="Minimalistic UEFI bootloader"
+HOMEPAGE="http://freedesktop.org/wiki/Software/gummiboot/"
+EGIT_REPO_URI="git://anongit.freedesktop.org/${PN}"
+
+LICENSE="LGPL-2.1+"
+SLOT="0"
+KEYWORDS=""
+IUSE=""
+
+RDEPEND="sys-apps/util-linux"
+DEPEND="${RDEPEND}
+ app-text/docbook-xsl-stylesheets
+ dev-libs/libxslt
+ >=sys-boot/gnu-efi-3.0.2"
+
+pkg_pretend() {
+ # CONFIG_EFI_STUB is required to boot a kernel with gummiboot
+ local CONFIG_CHECK="~EFI_STUB"
+ check_extra_config
+}
+
+src_prepare() {
+ epatch_user
+ eautoreconf
+}
diff --git a/sys-boot/gummiboot/metadata.xml b/sys-boot/gummiboot/metadata.xml
new file mode 100644
index 000000000000..5cb9324943ab
--- /dev/null
+++ b/sys-boot/gummiboot/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>mgorny@gentoo.org</email>
+ <name>Michał Górny</name>
+ </maintainer>
+</pkgmetadata>
diff --git a/sys-boot/lilo/Manifest b/sys-boot/lilo/Manifest
new file mode 100644
index 000000000000..33437615cdb6
--- /dev/null
+++ b/sys-boot/lilo/Manifest
@@ -0,0 +1,6 @@
+DIST dolilo-0.5.tar.bz2 3777 SHA256 9b6994ec6416cdfb0205665a58dc2e6a1d6e36272a3cab94315daea1c55605f1 SHA512 6bfd0181d922f01903c8c0cdc67fc087c74091d7ffec0ddfb263c18b3a2247fcfbd201995f1724f26f4eb21b91147f209fd7ed485a05c6b9e9f583ea2456baa9 WHIRLPOOL 4cae4563097b646aa4d689861793712dc44d6a32db850842c88556f32e59765ad5d6c7594c7a157d063503c9e70473774448f6692ba72b7c53c057c038ed3960
+DIST dolilo-0.6.tar.bz2 3817 SHA256 01293874aea4cfa935d3f22fd52c8f4956e4a85b39a878df1255098825f2840e SHA512 1b59ea5f2e2ac52d62635c9f7d5fb5b2aff6757e6ea6c0950480d8a11832b872115907abe6d8fb3fa5436e2e8971d9a1dda103dc6a15db6fc310c8f4730ab936 WHIRLPOOL 7a24cf7bf4b476967a5d4ba2234ce3256ff9311744be020ef25e6227f8e86098aac89706d23df30d3f0212aa3fe313c0460d1709990b21029d93517b77f61e4e
+DIST lilo-22.8.src.tar.gz 437555 SHA256 bad5907c212c0b2b15de5e852787a1ad2129a702f113b26345eec1c917c4edcb SHA512 b8a22c73b5f6a0c7ddde7c7af6511f9e85d43bae98603bfa0656dfa0685018b3ed713cfd9932bfac33017b83f807c66a3e25d78a16ea9a15bbfddd0e806714cc WHIRLPOOL 712fdf98b28e0ac717c0667fb5d4d7e734d963f0c4b3997d690c543d8d505ad3e6449933a854a8c1ce008d5c7f1b40a013398d36455fa433498f2583677f2d7c
+DIST lilo-23.2.tar.gz 580758 SHA256 0245e300494c0700411d518ffd81a15a00450face7922fb3b08cec7d16984030 SHA512 fe6789d3643751128afcb2c9761623329e84ab05ec84d75d6b13eff991d10a6671617b65f4ab5ef414a6ca4bc530bcf33b96ddeee3f5dce78bb69b8db740f9c5 WHIRLPOOL f12c44fc48ba74a57ed83174b44966a4330ad3a96714bf52afea6e4d1c4a01c2881d447e563c0b363f602fa0e15d6012633734fb962cf2adba4ec62c7481519a
+DIST lilo-24.0.tar.gz 768631 SHA256 3d40c0af1d60a0adbe3696cd6cb8d7e892694351ff225371d871b6b479d82152 SHA512 4158a0f7ab085da063938df2bc77356f9536aa78208a902561f9e61ec478fb17f204f68407f6809638aea9d2e0c88ffc701548291c1635ab40f5b18a7be6bae7 WHIRLPOOL 598e915ddb08b3b8383fb08a1b3dbb75f9340fbb052c4ceed88309274c33b8a5965502a95b99997aba7af2d3ec9da737c13b85784afd8f371ad96b69942069a2
+DIST lilo-24.1.tar.gz 773223 SHA256 a15280edacb8bca31b9163d65e61270b8c06cb9ffea74374a3a42164a13d4532 SHA512 d1375cac9654fcb3934e7e5e0533e126ff8700a48154eb5019cf62e4b89f14d2ce7a17b6324795d9b60b37ab7656bfb2c9467f6e9d3540095f5c294579e83883 WHIRLPOOL 6534b9494cce30c56f0ec700eb8288ebfdfb9e07ed631958e3f34d03d4fb42de372237dab5d07a8b8ef1c3da49b427d3777be14de9abca339dcd184fce550ab0
diff --git a/sys-boot/lilo/files/lilo-22.8-correct-usage-info.patch b/sys-boot/lilo/files/lilo-22.8-correct-usage-info.patch
new file mode 100644
index 000000000000..87ea4b20ce9e
--- /dev/null
+++ b/sys-boot/lilo/files/lilo-22.8-correct-usage-info.patch
@@ -0,0 +1,12 @@
+--- a/lilo.c
++++ b/lilo.c
+@@ -548,7 +548,8 @@
+ fprintf(errstd,"%7s%s -T help \t\t\tlist additional options\n", "", name);
+ fprintf(errstd,"%7s%s -X\t\t\t\tinternal compile-time options\n", "", name);
+ #endif /* !__MSDOS__ */
+- fprintf(errstd,"%7s%s -V [ -v ]\t\t\tversion information\n\n","",name);
++ fprintf(errstd,"%7s%s -V\t\t\t\tversion information\n","",name);
++ fprintf(errstd,"%7s%s -v\t\t\t\tverbose mode\n\n","",name);
+ exit(1);
+ }
+
diff --git a/sys-boot/lilo/files/lilo-22.8-makefile.patch b/sys-boot/lilo/files/lilo-22.8-makefile.patch
new file mode 100644
index 000000000000..d2a34bbded1d
--- /dev/null
+++ b/sys-boot/lilo/files/lilo-22.8-makefile.patch
@@ -0,0 +1,42 @@
+--- a/Makefile
++++ b/Makefile
+@@ -69,18 +69,7 @@
+ -DMDPRAID -DDEVMAPPER
+
+
+-# set the following if you wish LILO.COM to be installed
+-DOS_DIR=/dosC/boot
+-#
+-# select one of the following to place the man pages in the right place
+-#MAN_DIR=`if [ -z "$(whereis lilo | grep 'lilo.8')" ]; then \
+-# whereis lilo | sed -e "sX.* /usrX/usrX" -e "sX/man8/lilo.8.*XX" ; \
+-# elif [ -f /usr/bin/manpath ]; then \
+-# manpath | sed "s/:.*//"; else echo /usr/man; fi`
+-#
+-MAN_DIR=`if [ -f /usr/bin/manpath ]; then \
+- manpath | sed "s/:.*//"; else echo /usr/share/man; fi`
+-#MAN_DIR=/usr/share/man
++MAN_DIR=/usr/share/man
+
+ # set the compiler optimization level
+
+@@ -165,10 +154,7 @@
+ #
+ # everything needed to run, just short of installation
+ #
+-all: lilo bootsect.b diag1.img # OBSOLETE: $(BOOTS) edit dparam.com activate
+- if [ -x /usr/bin/bcc -o -x /usr/local/bin/bcc ]; then \
+- make diagnostic; \
+- make dosexe; fi
++all: lilo
+
+ #
+ # everything above plus the statically linked version
+@@ -452,7 +438,6 @@
+ rm -f $$ROOT$(BOOT_DIR)/boot.b; fi
+ cp mkrescue $$ROOT$(SBIN_DIR)
+ cp lilo $$ROOT$(SBIN_DIR)
+- strip $$ROOT$(SBIN_DIR)/lilo
+ cp keytab-lilo.pl $$ROOT$(USRSBIN_DIR)
+ cp manPages/lilo.8 $$ROOT$(MAN_DIR)/man8
+ cp manPages/mkrescue.8 $$ROOT$(MAN_DIR)/man8
diff --git a/sys-boot/lilo/files/lilo-22.8-nodevmapper.patch b/sys-boot/lilo/files/lilo-22.8-nodevmapper.patch
new file mode 100644
index 000000000000..f81cbfe92ef5
--- /dev/null
+++ b/sys-boot/lilo/files/lilo-22.8-nodevmapper.patch
@@ -0,0 +1,13 @@
+--- Makefile~ 2007-04-28 22:04:23.000000000 +0200
++++ Makefile 2007-04-28 22:21:46.000000000 +0200
+@@ -91,8 +91,8 @@
+ sed 's/-D/-DLCF_/g'`
+ LILO=-DLILO=0xbb920890
+ KVER=`if [ -f /usr/include/linux/version.h ]; then echo -DHAS_VERSION_H; fi`
+-HDM=`if [ -f /usr/include/libdevmapper.h ]; then echo -DHAS_LIBDEVMAPPER_H; fi`
+-DEVMAPPER=`if [ -f /usr/include/libdevmapper.h ]; then echo "-ldevmapper"; fi`
++HDM=
++DEVMAPPER=
+
+ TMP=_TmP_
+
diff --git a/sys-boot/lilo/files/lilo-22.8-novga.patch b/sys-boot/lilo/files/lilo-22.8-novga.patch
new file mode 100644
index 000000000000..939998fe9d4e
--- /dev/null
+++ b/sys-boot/lilo/files/lilo-22.8-novga.patch
@@ -0,0 +1,11 @@
+--- a/Makefile
++++ b/Makefile
+@@ -66,7 +66,7 @@
+
+ CONFIG=-DBDATA -DDSECS=3 -DEVMS -DIGNORECASE -DLVM -DNOKEYBOARD -DONE_SHOT \
+ -DPASS160 -DREISERFS -DREWRITE_TABLE -DSOLO_CHAIN -DVERSION -DVIRTUAL \
+- -DMDPRAID -DDEVMAPPER
++ -DMDPRAID -DDEVMAPPER -DNOVGA
+
+
+ MAN_DIR=/usr/share/man
diff --git a/sys-boot/lilo/files/lilo-23.0-make.patch b/sys-boot/lilo/files/lilo-23.0-make.patch
new file mode 100644
index 000000000000..00b15c52ca07
--- /dev/null
+++ b/sys-boot/lilo/files/lilo-23.0-make.patch
@@ -0,0 +1,103 @@
+--- a/Makefile 2010-06-18 19:17:48.000000000 +0200
++++ b/Makefile 2010-07-20 02:00:18.000000000 +0200
+@@ -26,19 +26,19 @@
+ # everything needed to run, just short of installation
+ #
+ all: test
+- make -C src all
++ $(MAKE) -C src all
+
+ #
+ # everything above plus the statically linked version
+ #
+ alles: test
+- make -C src alles
++ $(MAKE) -C src alles
+
+ #
+ # documentation files
+ #
+ docs:
+- make -C doc all
++ $(MAKE) -C doc all
+
+ #
+ # if you have the 'bcc' compiler, then you can make the diagnostics, too
+@@ -55,23 +55,23 @@
+ @echo before you proceed from this point.
+ @echo "Press <Enter> to continue, <^C> to abort ..."
+ @read
+- @make -C src floppy1
++ @$(MAKE) -C src floppy1
+ @echo Done.
+ @echo
+ @echo Remove the floppy from the drive. Label it "\"1.6\""
+ @echo "Press <Enter> to continue, <^C> to abort ..."
+ @read
+- @make -C src floppy2
++ @$(MAKE) -C src floppy2
+ @echo Done.
+ @echo
+ @echo Remove the floppy from the drive. Label it "\"2.4\""
+ @echo
+
+ diagnostic: test
+- make -C src diagnostic
++ $(MAKE) -C src diagnostic
+
+ dosexe: test
+- make -C dos lilo
++ $(MAKE) -C dos lilo
+
+ #
+ # test for compilers & utilities
+@@ -85,33 +85,33 @@
+ # shorthand install, if one knows that one has the 'bcc' compiler
+ #
+ ins:
+- make -C src ins
++ $(MAKE) -C src ins
+
+ #
+ # normal install, but doesn't make the diagnostic binaries
+ #
+ install: all
+- make -C src install
+- make -C man install
+- make -C dos install
+- make -C src insobs
++ $(MAKE) -C src install
++ $(MAKE) -C man install
++ $(MAKE) -C dos install
++ $(MAKE) -C src insobs
+
+ tidy:
+- make -C src tidy
+- make -C diagnose tidy
+- make -C dos tidy
+- make -C doc tidy
++ $(MAKE) -C src tidy
++ $(MAKE) -C diagnose tidy
++ $(MAKE) -C dos tidy
++ $(MAKE) -C doc tidy
+
+ clean: tidy
+ rm -f test.img
+- make -C src clean
+- make -C diagnose clean
+- make -C dos clean
++ $(MAKE) -C src clean
++ $(MAKE) -C diagnose clean
++ $(MAKE) -C dos clean
+
+ spotless: distclean
+ distclean: clean
+- make -C src distclean
+- make -C diagnose distclean
+- make -C dos distclean
+- make -C doc clean
++ $(MAKE) -C src distclean
++ $(MAKE) -C diagnose distclean
++ $(MAKE) -C dos distclean
++ $(MAKE) -C doc clean
+
diff --git a/sys-boot/lilo/files/lilo-24.0-novga.patch b/sys-boot/lilo/files/lilo-24.0-novga.patch
new file mode 100644
index 000000000000..ebb06b486818
--- /dev/null
+++ b/sys-boot/lilo/files/lilo-24.0-novga.patch
@@ -0,0 +1,12 @@
+diff -ur lilo-23.2/make.vars lilo-23.2.new/make.vars
+--- lilo-23.2/make.vars 2013-01-18 11:33:02.438628138 -0600
++++ lilo-23.2.new/make.vars 2013-01-18 11:34:03.960697091 -0600
+@@ -71,7 +71,7 @@
+
+ CONFIG=-DBDATA -DDSECS=3 -DEVMS -DIGNORECASE -DLVM -DNOKEYBOARD -DONE_SHOT \
+ -DPASS160 -DREISERFS -DREWRITE_TABLE -DSOLO_CHAIN -DVERSION -DVIRTUAL \
+- -DMDPRAID -DDEVMAPPER
++ -DMDPRAID -DDEVMAPPER -DNOVGA
+
+ # set the following if you wish LILO.COM to be installed
+ DOS_DIR=/dosC/boot
diff --git a/sys-boot/lilo/files/lilo-24.1-novga.patch b/sys-boot/lilo/files/lilo-24.1-novga.patch
new file mode 100644
index 000000000000..512fac694fdb
--- /dev/null
+++ b/sys-boot/lilo/files/lilo-24.1-novga.patch
@@ -0,0 +1,12 @@
+diff -uNr lilo-24.1.ORIG/make.vars lilo-24.1/make.vars
+--- lilo-24.1.ORIG/make.vars 2015-01-22 10:36:54.656904227 +0000
++++ lilo-24.1/make.vars 2015-01-22 10:37:16.516903935 +0000
+@@ -71,7 +71,7 @@
+
+ CONFIG=-DBDATA -DDSECS=3 -DEVMS -DIGNORECASE -DLVM -DNOKEYBOARD -DONE_SHOT \
+ -DPASS160 -DREISERFS -DREWRITE_TABLE -DSOLO_CHAIN -DVERSION -DVIRTUAL \
+- -DMDPRAID -DDEVMAPPER
++ -DMDPRAID -DDEVMAPPER -DNOVGA
+
+ # set the following if you wish LILO.COM to be installed
+ DOS_DIR=/dosC/boot
diff --git a/sys-boot/lilo/files/lilo.conf b/sys-boot/lilo/files/lilo.conf
new file mode 100644
index 000000000000..1c0c48acc19a
--- /dev/null
+++ b/sys-boot/lilo/files/lilo.conf
@@ -0,0 +1,73 @@
+# $Id$
+# Author: Ultanium
+
+#
+# Start LILO global section
+#
+
+# Faster, but won't work on all systems:
+#compact
+# Should work for most systems, and do not have the sector limit:
+lba32
+# If lba32 do not work, use linear:
+#linear
+
+# MBR to install LILO to:
+boot = /dev/hda
+map = /boot/.map
+
+# If you are having problems booting from a hardware raid-array
+# or have a unusual setup, try this:
+#disk=/dev/ataraid/disc0/disc bios=0x80 # see this as the first BIOS disk
+#disk=/dev/sda bios=0x81 # see this as the second BIOS disk
+#disk=/dev/hda bios=0x82 # see this as the third BIOS disk
+
+# Here you can select the secondary loader to install. A few
+# examples is:
+#
+# boot-text.b
+# boot-menu.b
+# boot-bmp.b
+#
+install = /boot/boot-menu.b # Note that for lilo-22.5.5 or later you
+ # do not need boot-{text,menu,bmp}.b in
+ # /boot, as they are linked into the lilo
+ # binary.
+
+menu-scheme=Wb
+prompt
+# If you always want to see the prompt with a 15 second timeout:
+#timeout=150
+delay = 50
+# Normal VGA console
+vga = normal
+# VESA console with size 1024x768x16:
+#vga = 791
+
+#
+# End LILO global section
+#
+
+#
+# Linux bootable partition config begins
+#
+image = /boot/bzImage
+ root = /dev/hda3
+ #root = /devices/discs/disc0/part3
+ label = Gentoo
+ read-only # read-only for checking
+#
+# Linux bootable partition config ends
+#
+
+#
+# DOS bootable partition config begins
+#
+other = /dev/hda1
+ #other = /devices/discs/disc0/part1
+ label = Windows
+ table = /dev/hda
+#
+# DOS bootable partition config ends
+#
+
diff --git a/sys-boot/lilo/lilo-22.8-r2.ebuild b/sys-boot/lilo/lilo-22.8-r2.ebuild
new file mode 100644
index 000000000000..6c835c13771a
--- /dev/null
+++ b/sys-boot/lilo/lilo-22.8-r2.ebuild
@@ -0,0 +1,180 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+inherit eutils flag-o-matic toolchain-funcs
+
+DOLILO_V="0.5"
+IUSE="static minimal pxeserial device-mapper"
+
+DESCRIPTION="Standard Linux boot loader"
+HOMEPAGE="http://lilo.go.dyndns.org/pub/linux/lilo/"
+DOLILO_TAR="dolilo-${DOLILO_V}.tar.bz2"
+MY_P=${P}.src
+
+SRC_URI="http://home.san.rr.com/johninsd/pub/linux/lilo/${MY_P}.tar.gz
+ ftp://metalab.unc.edu/pub/Linux/system/boot/lilo/${MY_P}.tar.gz
+ ftp://metalab.unc.edu/pub/Linux/system/boot/lilo/obsolete/${MY_P}.tar.gz
+ mirror://gentoo/${DOLILO_TAR}"
+
+SLOT="0"
+LICENSE="BSD GPL-2"
+KEYWORDS="-* amd64 x86"
+
+DEPEND=">=sys-devel/bin86-0.15.5"
+RDEPEND="device-mapper? ( >=sys-fs/lvm2-2.02.45 )"
+
+src_unpack() {
+ unpack ${MY_P}.tar.gz
+
+ cd "${S}"
+
+ # Correctly document commandline options -v and -V, bug #43554
+ epatch "${FILESDIR}/${P}-correct-usage-info.patch"
+ # Install manpages to correct location, do not rely on incorrect manpath output, bug #117135
+ # Do not strip the main binary, it upsets portage, bug #140210
+ # Do not install diag1.img, bug #149887
+ epatch "${FILESDIR}/${P}-makefile.patch"
+
+ # this patch is needed when booting PXE and the device you're using
+ # emulates vga console via serial console.
+ # IE.. B.B.o.o.o.o.t.t.i.i.n.n.g.g....l.l.i.i.n.n.u.u.x.x and stair stepping.
+ use pxeserial && epatch "${FILESDIR}/${P}-novga.patch"
+ use device-mapper || epatch "${FILESDIR}/${P}-nodevmapper.patch"
+
+ unpack ${DOLILO_TAR}
+}
+
+src_compile() {
+ # lilo needs this. bug #140209
+ export LC_ALL=C
+
+ # hardened automatic PIC plus PIE building should be suppressed
+ # because of assembler instructions that cannot be compiled PIC
+ HARDENED_CFLAGS="`test-flags-CC -fno-pic -nopie`"
+
+ # we explicitly prevent the custom CFLAGS for stability reasons
+ if use static; then
+ emake CC="$(tc-getCC) ${HARDENED_CFLAGS}" lilo.static || die
+ mv lilo.static lilo || die
+ else
+ emake CC="$(tc-getCC) ${HARDENED_CFLAGS}" lilo || die
+ fi
+}
+
+src_install() {
+ keepdir /boot
+ make ROOT="${D}" install || die
+
+ if use !minimal; then
+ into /
+ dosbin "${S}"/dolilo/dolilo
+
+ into /usr
+ dosbin keytab-lilo.pl
+
+ insinto /etc
+ newins "${FILESDIR}"/lilo.conf lilo.conf.example
+
+ newconfd "${S}"/dolilo/dolilo.conf.d dolilo.example
+
+ doman manPages/*.[5-8]
+ dodoc CHANGES INCOMPAT README*
+ docinto samples ; dodoc sample/*
+ fi
+}
+
+# Check whether LILO is installed
+# This function is from /usr/sbin/mkboot from debianutils, with copyright:
+#
+# Debian GNU/Linux
+# Copyright 1996-1997 Guy Maor <maor@debian.org>
+#
+# Modified for Gentoo for use with the lilo ebuild by:
+# Martin Schlemmer <azarah@gentoo.org> (16 Mar 2003)
+#
+lilocheck () {
+ local bootpart=
+ local rootpart="$(mount | grep -v "tmpfs" | grep -v "rootfs" | grep "on / " | cut -f1 -d " ")"
+
+ echo
+ einfon "Checking for LILO ..."
+
+ if [ "$(whoami)" != "root" ]
+ then
+ echo; echo
+ eerror "Only root can check for LILO!"
+ return 1
+ fi
+
+ if [ -z "${rootpart}" ]
+ then
+ echo; echo
+ eerror "Could not determine root partition!"
+ return 1
+ fi
+
+ if [ ! -f /etc/lilo.conf -o ! -x /sbin/lilo ]
+ then
+ echo " No"
+ return 1
+ fi
+
+ bootpart="$(sed -n "s:^boot[ ]*=[ ]*\(.*\)[ ]*:\1:p" /etc/lilo.conf)"
+
+ if [ -z "${bootpart}" ]
+ then
+ # lilo defaults to current root when 'boot=' is not present
+ bootpart="${rootpart}"
+ fi
+
+ if ! dd if=${bootpart} ibs=16 count=1 2>&- | grep -q 'LILO'
+ then
+ echo; echo
+ ewarn "Yes, but I couldn't find a LILO signature on ${bootpart}"
+ ewarn "Check your /etc/lilo.conf, or run /sbin/lilo by hand."
+ return 1
+ fi
+
+ echo " Yes, on ${bootpart}"
+
+ return 0
+}
+
+pkg_postinst() {
+ if [ ! -e "${ROOT}/boot/boot.b" -a ! -L "${ROOT}/boot/boot.b" ]
+ then
+ [ -f "${ROOT}/boot/boot-menu.b" ] && \
+ ln -snf boot-menu.b "${ROOT}/boot/boot.b"
+ fi
+
+ if [ "${ROOT}" = "/" ] && use !minimal;
+ then
+ if lilocheck
+ then
+ einfo "Running DOLILO to complete the install ..."
+ # do not redirect to /dev/null because it may display some input
+ # prompt
+ /sbin/dolilo
+ if [ "$?" -ne 0 ]
+ then
+ echo
+ ewarn "Running /sbin/dolilo failed! Please check what the problem is"
+ ewarn "before your next reboot."
+
+ ebeep 5
+ epause 5
+ fi
+ fi
+ echo
+ fi
+ if use !minimal; then
+ echo
+ einfo "Issue 'dolilo' instead of 'lilo' to have a friendly wrapper that"
+ einfo "handles mounting and unmounting /boot for you. It can do more then"
+ einfo "that when asked, edit /etc/conf.d/dolilo to harness it's full potential."
+ ebeep 5
+ epause 3
+ echo
+ fi
+}
diff --git a/sys-boot/lilo/lilo-23.2-r1.ebuild b/sys-boot/lilo/lilo-23.2-r1.ebuild
new file mode 100644
index 000000000000..84e2073d093e
--- /dev/null
+++ b/sys-boot/lilo/lilo-23.2-r1.ebuild
@@ -0,0 +1,173 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="2"
+
+inherit eutils flag-o-matic toolchain-funcs
+
+DOLILO_V="0.5"
+IUSE="static minimal pxeserial device-mapper"
+
+DESCRIPTION="Standard Linux boot loader"
+HOMEPAGE="https://alioth.debian.org/projects/lilo/"
+
+DOLILO_TAR="dolilo-${DOLILO_V}.tar.bz2"
+SRC_URI="
+ http://lilo.alioth.debian.org/ftp/sources/${P}.tar.gz
+ mirror://gentoo/${DOLILO_TAR}
+"
+
+SLOT="0"
+LICENSE="BSD GPL-2"
+KEYWORDS="-* ~amd64 ~x86"
+
+DEPEND=">=sys-devel/bin86-0.15.5"
+RDEPEND="device-mapper? ( >=sys-fs/lvm2-2.02.45 )"
+
+src_prepare() {
+ # this patch is needed when booting PXE and the device you're using
+ # emulates vga console via serial console.
+ # IE.. B.B.o.o.o.o.t.t.i.i.n.n.g.g....l.l.i.i.n.n.u.u.x.x and stair stepping.
+ use pxeserial && epatch "${FILESDIR}/${PN}-22.8-novga.patch"
+
+ # Do not strip and have parallel make
+ # FIXME: images/Makefile does weird stuff
+ sed -i Makefile src/Makefile \
+ -e '/strip/d;s|^ make| $(MAKE)|g' \
+ -e '/images install/d' \
+ -e '/images all/d' \
+ || die "sed strip failed"
+}
+
+src_compile() {
+ # lilo needs this. bug #140209
+ export LC_ALL=C
+
+ # hardened automatic PIC plus PIE building should be suppressed
+ # because of assembler instructions that cannot be compiled PIC
+ HARDENED_CFLAGS="`test-flags-CC -fno-pic -nopie`"
+
+ # we explicitly prevent the custom CFLAGS for stability reasons
+ if use static; then
+ emake CC="$(tc-getCC) ${LDFLAGS} ${HARDENED_CFLAGS}" alles || die
+ else
+ emake CC="$(tc-getCC) ${LDFLAGS} ${HARDENED_CFLAGS}" all || die
+ fi
+}
+
+src_install() {
+ keepdir /boot
+ emake DESTDIR="${D}" install || die
+
+ if use !minimal; then
+ into /
+ dosbin "${WORKDIR}"/dolilo/dolilo || die
+
+ into /usr
+ dosbin keytab-lilo.pl || die
+
+ insinto /etc
+ newins "${FILESDIR}"/lilo.conf lilo.conf.example || die
+
+ newconfd "${WORKDIR}"/dolilo/dolilo.conf.d dolilo.example || die
+
+ dodoc CHANGELOG* readme/README.* readme/INCOMPAT README
+ docinto samples ; dodoc sample/*
+ fi
+}
+
+# Check whether LILO is installed
+# This function is from /usr/sbin/mkboot from debianutils, with copyright:
+#
+# Debian GNU/Linux
+# Copyright 1996-1997 Guy Maor <maor@debian.org>
+#
+# Modified for Gentoo for use with the lilo ebuild by:
+# Martin Schlemmer <azarah@gentoo.org> (16 Mar 2003)
+#
+lilocheck() {
+ local bootpart=
+ local rootpart="$(mount | grep -v "tmpfs" | grep -v "rootfs" | grep "on / " | cut -f1 -d " ")"
+
+ echo
+ einfon "Checking for LILO ..."
+
+ if [ "$(whoami)" != "root" ]
+ then
+ echo; echo
+ eerror "Only root can check for LILO!"
+ return 1
+ fi
+
+ if [ -z "${rootpart}" ]
+ then
+ echo; echo
+ eerror "Could not determine root partition!"
+ return 1
+ fi
+
+ if [ ! -f /etc/lilo.conf -o ! -x /sbin/lilo ]
+ then
+ echo " No"
+ return 1
+ fi
+
+ bootpart="$(sed -n "s:^boot[ ]*=[ ]*\(.*\)[ ]*:\1:p" /etc/lilo.conf)"
+
+ if [ -z "${bootpart}" ]
+ then
+ # lilo defaults to current root when 'boot=' is not present
+ bootpart="${rootpart}"
+ fi
+
+ if ! dd if=${bootpart} ibs=16 count=1 2>&- | grep -q 'LILO'
+ then
+ echo; echo
+ ewarn "Yes, but I couldn't find a LILO signature on ${bootpart}"
+ ewarn "Check your /etc/lilo.conf, or run /sbin/lilo by hand."
+ return 1
+ fi
+
+ echo " Yes, on ${bootpart}"
+
+ return 0
+}
+
+pkg_postinst() {
+ if [ ! -e "${ROOT}/boot/boot.b" -a ! -L "${ROOT}/boot/boot.b" ]
+ then
+ [ -f "${ROOT}/boot/boot-menu.b" ] && \
+ ln -snf boot-menu.b "${ROOT}/boot/boot.b"
+ fi
+
+ if [ "${ROOT}" = "/" ] && use !minimal;
+ then
+ if lilocheck
+ then
+ einfo "Running DOLILO to complete the install ..."
+ # do not redirect to /dev/null because it may display some input
+ # prompt
+ /sbin/dolilo
+ if [ "$?" -ne 0 ]
+ then
+ echo
+ ewarn "Running /sbin/dolilo failed! Please check what the problem is"
+ ewarn "before your next reboot."
+
+ ebeep 5
+ epause 5
+ fi
+ fi
+ echo
+ fi
+ if use !minimal; then
+ echo
+ einfo "Issue 'dolilo' instead of 'lilo' to have a friendly wrapper that"
+ einfo "handles mounting and unmounting /boot for you. It can do more then"
+ einfo "that when asked, edit /etc/conf.d/dolilo to harness it's full potential."
+ ebeep 5
+ epause 3
+ echo
+ fi
+}
diff --git a/sys-boot/lilo/lilo-23.2-r2.ebuild b/sys-boot/lilo/lilo-23.2-r2.ebuild
new file mode 100644
index 000000000000..469ccdc086c5
--- /dev/null
+++ b/sys-boot/lilo/lilo-23.2-r2.ebuild
@@ -0,0 +1,181 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="2"
+
+inherit eutils flag-o-matic toolchain-funcs
+
+DOLILO_V="0.5"
+IUSE="static minimal pxeserial device-mapper"
+
+DESCRIPTION="Standard Linux boot loader"
+HOMEPAGE="https://alioth.debian.org/projects/lilo/"
+
+DOLILO_TAR="dolilo-${DOLILO_V}.tar.bz2"
+SRC_URI="
+ http://lilo.alioth.debian.org/ftp/sources/${P}.tar.gz
+ mirror://gentoo/${DOLILO_TAR}
+"
+
+SLOT="0"
+LICENSE="BSD GPL-2"
+KEYWORDS="-* amd64 x86"
+
+DEPEND=">=sys-devel/bin86-0.15.5"
+RDEPEND="device-mapper? ( >=sys-fs/lvm2-2.02.45 )"
+
+src_prepare() {
+ # this patch is needed when booting PXE and the device you're using
+ # emulates vga console via serial console.
+ # IE.. B.B.o.o.o.o.t.t.i.i.n.n.g.g....l.l.i.i.n.n.u.u.x.x and stair stepping.
+ use pxeserial && epatch "${FILESDIR}/${PN}-22.8-novga.patch"
+
+ # Do not strip and have parallel make
+ # FIXME: images/Makefile does weird stuff
+ sed -i Makefile src/Makefile \
+ -e '/strip/d;s|^ make| $(MAKE)|g' \
+ -e '/images install/d' \
+ -e '/images all/d' \
+ || die "sed strip failed"
+}
+
+src_configure() {
+ if ! use device-mapper; then
+ sed -i make.vars -e 's|-DDEVMAPPER||g' || die
+ fi
+}
+
+src_compile() {
+ # lilo needs this. bug #140209
+ export LC_ALL=C
+
+ # hardened automatic PIC plus PIE building should be suppressed
+ # because of assembler instructions that cannot be compiled PIC
+ HARDENED_CFLAGS=$(test-flags-CC -fno-pic -nopie)
+
+ # we explicitly prevent the custom CFLAGS for stability reasons
+ if use static; then
+ local target=alles
+ else
+ local target=all
+ fi
+
+ emake CC="$(tc-getCC) ${LDFLAGS} ${HARDENED_CFLAGS}" ${target} || die
+}
+
+src_install() {
+ keepdir /boot
+ emake DESTDIR="${D}" install || die
+
+ if use !minimal; then
+ into /
+ dosbin "${WORKDIR}"/dolilo/dolilo || die
+
+ into /usr
+ dosbin keytab-lilo.pl || die
+
+ insinto /etc
+ newins "${FILESDIR}"/lilo.conf lilo.conf.example || die
+
+ newconfd "${WORKDIR}"/dolilo/dolilo.conf.d dolilo.example || die
+
+ dodoc CHANGELOG* readme/README.* readme/INCOMPAT README
+ docinto samples ; dodoc sample/*
+ fi
+}
+
+# Check whether LILO is installed
+# This function is from /usr/sbin/mkboot from debianutils, with copyright:
+#
+# Debian GNU/Linux
+# Copyright 1996-1997 Guy Maor <maor@debian.org>
+#
+# Modified for Gentoo for use with the lilo ebuild by:
+# Martin Schlemmer <azarah@gentoo.org> (16 Mar 2003)
+#
+lilocheck() {
+ local bootpart=
+ local rootpart="$(mount | grep -v "tmpfs" | grep -v "rootfs" | grep "on / " | cut -f1 -d " ")"
+
+ echo
+ einfon "Checking for LILO ..."
+
+ if [ "$(whoami)" != "root" ]
+ then
+ echo; echo
+ eerror "Only root can check for LILO!"
+ return 1
+ fi
+
+ if [ -z "${rootpart}" ]
+ then
+ echo; echo
+ eerror "Could not determine root partition!"
+ return 1
+ fi
+
+ if [ ! -f /etc/lilo.conf -o ! -x /sbin/lilo ]
+ then
+ echo " No"
+ return 1
+ fi
+
+ bootpart="$(sed -n "s:^boot[ ]*=[ ]*\(.*\)[ ]*:\1:p" /etc/lilo.conf)"
+
+ if [ -z "${bootpart}" ]
+ then
+ # lilo defaults to current root when 'boot=' is not present
+ bootpart="${rootpart}"
+ fi
+
+ if ! dd if=${bootpart} ibs=16 count=1 2>&- | grep -q 'LILO'
+ then
+ echo; echo
+ ewarn "Yes, but I couldn't find a LILO signature on ${bootpart}"
+ ewarn "Check your /etc/lilo.conf, or run /sbin/lilo by hand."
+ return 1
+ fi
+
+ echo " Yes, on ${bootpart}"
+
+ return 0
+}
+
+pkg_postinst() {
+ if [ ! -e "${ROOT}/boot/boot.b" -a ! -L "${ROOT}/boot/boot.b" ]
+ then
+ [ -f "${ROOT}/boot/boot-menu.b" ] && \
+ ln -snf boot-menu.b "${ROOT}/boot/boot.b"
+ fi
+
+ if [ "${ROOT}" = "/" ] && use !minimal;
+ then
+ if lilocheck
+ then
+ einfo "Running DOLILO to complete the install ..."
+ # do not redirect to /dev/null because it may display some input
+ # prompt
+ /sbin/dolilo
+ if [ "$?" -ne 0 ]
+ then
+ echo
+ ewarn "Running /sbin/dolilo failed! Please check what the problem is"
+ ewarn "before your next reboot."
+
+ ebeep 5
+ epause 5
+ fi
+ fi
+ echo
+ fi
+ if use !minimal; then
+ echo
+ einfo "Issue 'dolilo' instead of 'lilo' to have a friendly wrapper that"
+ einfo "handles mounting and unmounting /boot for you. It can do more then"
+ einfo "that when asked, edit /etc/conf.d/dolilo to harness it's full potential."
+ ebeep 5
+ epause 3
+ echo
+ fi
+}
diff --git a/sys-boot/lilo/lilo-24.0-r1.ebuild b/sys-boot/lilo/lilo-24.0-r1.ebuild
new file mode 100644
index 000000000000..352e913e3097
--- /dev/null
+++ b/sys-boot/lilo/lilo-24.0-r1.ebuild
@@ -0,0 +1,176 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+inherit eutils flag-o-matic toolchain-funcs
+
+DOLILO_V="0.6"
+IUSE="static minimal pxeserial device-mapper"
+
+DESCRIPTION="Standard Linux boot loader"
+HOMEPAGE="https://alioth.debian.org/projects/lilo/"
+
+DOLILO_TAR="dolilo-${DOLILO_V}.tar.bz2"
+SRC_URI="
+ http://lilo.alioth.debian.org/ftp/sources/${P}.tar.gz
+ mirror://gentoo/${DOLILO_TAR}
+"
+
+SLOT="0"
+LICENSE="BSD GPL-2"
+KEYWORDS="-* amd64 x86"
+
+DEPEND=">=sys-devel/bin86-0.15.5"
+RDEPEND="device-mapper? ( >=sys-fs/lvm2-2.02.45 )"
+
+src_prepare() {
+ # this patch is needed when booting PXE and the device you're using
+ # emulates vga console via serial console.
+ # IE.. B.B.o.o.o.o.t.t.i.i.n.n.g.g....l.l.i.i.n.n.u.u.x.x and stair stepping.
+ use pxeserial && epatch "${FILESDIR}/${P}-novga.patch"
+
+ # Do not strip and have parallel make
+ # FIXME: images/Makefile does weird stuff
+ sed -i Makefile src/Makefile \
+ -e '/strip/d;s|^ make| $(MAKE)|g' \
+ -e '/images install/d' \
+ -e '/images all/d' \
+ || die "sed strip failed"
+}
+
+src_configure() {
+ if ! use device-mapper; then
+ sed -i make.vars -e 's|-DDEVMAPPER||g' || die
+ fi
+}
+
+src_compile() {
+ # lilo needs this. bug #140209
+ export LC_ALL=C
+
+ # hardened automatic PIC plus PIE building should be suppressed
+ # because of assembler instructions that cannot be compiled PIC
+ HARDENED_CFLAGS=$(test-flags-CC -fno-pic -nopie)
+
+ # we explicitly prevent the custom CFLAGS for stability reasons
+ if use static; then
+ local target=alles
+ else
+ local target=all
+ fi
+
+ emake CC="$(tc-getCC) ${LDFLAGS} ${HARDENED_CFLAGS}" ${target} || die
+}
+
+src_install() {
+ keepdir /boot
+ emake DESTDIR="${D}" install || die
+
+ if use !minimal; then
+ into /
+ dosbin "${WORKDIR}"/dolilo/dolilo || die
+
+ into /usr
+ dosbin keytab-lilo.pl || die
+
+ insinto /etc
+ newins "${FILESDIR}"/lilo.conf lilo.conf.example || die
+
+ newconfd "${WORKDIR}"/dolilo/dolilo.conf.d dolilo.example || die
+
+ dodoc CHANGELOG* readme/README.* readme/INCOMPAT README
+ docinto samples ; dodoc sample/*
+ fi
+}
+
+# Check whether LILO is installed
+# This function is from /usr/sbin/mkboot from debianutils, with copyright:
+#
+# Debian GNU/Linux
+# Copyright 1996-1997 Guy Maor <maor@debian.org>
+#
+# Modified for Gentoo for use with the lilo ebuild by:
+# Martin Schlemmer <azarah@gentoo.org> (16 Mar 2003)
+#
+lilocheck() {
+ local bootpart=
+ local rootpart="$(mount | grep -v "tmpfs" | grep -v "rootfs" | grep "on / " | cut -f1 -d " ")"
+
+ echo
+ einfon "Checking for LILO ..."
+
+ if [ "$(whoami)" != "root" ]
+ then
+ echo; echo
+ eerror "Only root can check for LILO!"
+ return 1
+ fi
+
+ if [ -z "${rootpart}" ]
+ then
+ echo; echo
+ eerror "Could not determine root partition!"
+ return 1
+ fi
+
+ if [ ! -f /etc/lilo.conf -o ! -x /sbin/lilo ]
+ then
+ echo " No"
+ return 1
+ fi
+
+ bootpart="$(sed -n "s:^boot[ ]*=[ ]*\(.*\)[ ]*:\1:p" /etc/lilo.conf)"
+
+ if [ -z "${bootpart}" ]
+ then
+ # lilo defaults to current root when 'boot=' is not present
+ bootpart="${rootpart}"
+ fi
+
+ if ! dd if=${bootpart} ibs=16 count=1 2>&- | grep -q 'LILO'
+ then
+ echo; echo
+ ewarn "Yes, but I couldn't find a LILO signature on ${bootpart}"
+ ewarn "Check your /etc/lilo.conf, or run /sbin/lilo by hand."
+ return 1
+ fi
+
+ echo " Yes, on ${bootpart}"
+
+ return 0
+}
+
+pkg_postinst() {
+ if [ ! -e "${ROOT}/boot/boot.b" -a ! -L "${ROOT}/boot/boot.b" ]
+ then
+ [ -f "${ROOT}/boot/boot-menu.b" ] && \
+ ln -snf boot-menu.b "${ROOT}/boot/boot.b"
+ fi
+
+ if [ "${ROOT}" = "/" ] && use !minimal;
+ then
+ if lilocheck
+ then
+ einfo "Running DOLILO to complete the install ..."
+ # do not redirect to /dev/null because it may display some input
+ # prompt
+ /sbin/dolilo
+ if [ "$?" -ne 0 ]
+ then
+ echo
+ eerror "Running /sbin/dolilo failed! Please check what the problem is"
+ eerror "before your next reboot."
+ fi
+ fi
+ echo
+ fi
+ if use !minimal; then
+ echo
+ einfo "Issue 'dolilo' instead of 'lilo' to have a friendly wrapper that"
+ einfo "handles mounting and unmounting /boot for you. It can do more then"
+ einfo "that when asked, edit /etc/conf.d/dolilo to harness it's full potential."
+ echo
+ fi
+}
diff --git a/sys-boot/lilo/lilo-24.0.ebuild b/sys-boot/lilo/lilo-24.0.ebuild
new file mode 100644
index 000000000000..013415a6f5f5
--- /dev/null
+++ b/sys-boot/lilo/lilo-24.0.ebuild
@@ -0,0 +1,176 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+inherit eutils flag-o-matic toolchain-funcs
+
+DOLILO_V="0.5"
+IUSE="static minimal pxeserial device-mapper"
+
+DESCRIPTION="Standard Linux boot loader"
+HOMEPAGE="https://alioth.debian.org/projects/lilo/"
+
+DOLILO_TAR="dolilo-${DOLILO_V}.tar.bz2"
+SRC_URI="
+ http://lilo.alioth.debian.org/ftp/sources/${P}.tar.gz
+ mirror://gentoo/${DOLILO_TAR}
+"
+
+SLOT="0"
+LICENSE="BSD GPL-2"
+KEYWORDS="-* amd64 x86"
+
+DEPEND=">=sys-devel/bin86-0.15.5"
+RDEPEND="device-mapper? ( >=sys-fs/lvm2-2.02.45 )"
+
+src_prepare() {
+ # this patch is needed when booting PXE and the device you're using
+ # emulates vga console via serial console.
+ # IE.. B.B.o.o.o.o.t.t.i.i.n.n.g.g....l.l.i.i.n.n.u.u.x.x and stair stepping.
+ use pxeserial && epatch "${FILESDIR}/${P}-novga.patch"
+
+ # Do not strip and have parallel make
+ # FIXME: images/Makefile does weird stuff
+ sed -i Makefile src/Makefile \
+ -e '/strip/d;s|^ make| $(MAKE)|g' \
+ -e '/images install/d' \
+ -e '/images all/d' \
+ || die "sed strip failed"
+}
+
+src_configure() {
+ if ! use device-mapper; then
+ sed -i make.vars -e 's|-DDEVMAPPER||g' || die
+ fi
+}
+
+src_compile() {
+ # lilo needs this. bug #140209
+ export LC_ALL=C
+
+ # hardened automatic PIC plus PIE building should be suppressed
+ # because of assembler instructions that cannot be compiled PIC
+ HARDENED_CFLAGS=$(test-flags-CC -fno-pic -nopie)
+
+ # we explicitly prevent the custom CFLAGS for stability reasons
+ if use static; then
+ local target=alles
+ else
+ local target=all
+ fi
+
+ emake CC="$(tc-getCC) ${LDFLAGS} ${HARDENED_CFLAGS}" ${target} || die
+}
+
+src_install() {
+ keepdir /boot
+ emake DESTDIR="${D}" install || die
+
+ if use !minimal; then
+ into /
+ dosbin "${WORKDIR}"/dolilo/dolilo || die
+
+ into /usr
+ dosbin keytab-lilo.pl || die
+
+ insinto /etc
+ newins "${FILESDIR}"/lilo.conf lilo.conf.example || die
+
+ newconfd "${WORKDIR}"/dolilo/dolilo.conf.d dolilo.example || die
+
+ dodoc CHANGELOG* readme/README.* readme/INCOMPAT README
+ docinto samples ; dodoc sample/*
+ fi
+}
+
+# Check whether LILO is installed
+# This function is from /usr/sbin/mkboot from debianutils, with copyright:
+#
+# Debian GNU/Linux
+# Copyright 1996-1997 Guy Maor <maor@debian.org>
+#
+# Modified for Gentoo for use with the lilo ebuild by:
+# Martin Schlemmer <azarah@gentoo.org> (16 Mar 2003)
+#
+lilocheck() {
+ local bootpart=
+ local rootpart="$(mount | grep -v "tmpfs" | grep -v "rootfs" | grep "on / " | cut -f1 -d " ")"
+
+ echo
+ einfon "Checking for LILO ..."
+
+ if [ "$(whoami)" != "root" ]
+ then
+ echo; echo
+ eerror "Only root can check for LILO!"
+ return 1
+ fi
+
+ if [ -z "${rootpart}" ]
+ then
+ echo; echo
+ eerror "Could not determine root partition!"
+ return 1
+ fi
+
+ if [ ! -f /etc/lilo.conf -o ! -x /sbin/lilo ]
+ then
+ echo " No"
+ return 1
+ fi
+
+ bootpart="$(sed -n "s:^boot[ ]*=[ ]*\(.*\)[ ]*:\1:p" /etc/lilo.conf)"
+
+ if [ -z "${bootpart}" ]
+ then
+ # lilo defaults to current root when 'boot=' is not present
+ bootpart="${rootpart}"
+ fi
+
+ if ! dd if=${bootpart} ibs=16 count=1 2>&- | grep -q 'LILO'
+ then
+ echo; echo
+ ewarn "Yes, but I couldn't find a LILO signature on ${bootpart}"
+ ewarn "Check your /etc/lilo.conf, or run /sbin/lilo by hand."
+ return 1
+ fi
+
+ echo " Yes, on ${bootpart}"
+
+ return 0
+}
+
+pkg_postinst() {
+ if [ ! -e "${ROOT}/boot/boot.b" -a ! -L "${ROOT}/boot/boot.b" ]
+ then
+ [ -f "${ROOT}/boot/boot-menu.b" ] && \
+ ln -snf boot-menu.b "${ROOT}/boot/boot.b"
+ fi
+
+ if [ "${ROOT}" = "/" ] && use !minimal;
+ then
+ if lilocheck
+ then
+ einfo "Running DOLILO to complete the install ..."
+ # do not redirect to /dev/null because it may display some input
+ # prompt
+ /sbin/dolilo
+ if [ "$?" -ne 0 ]
+ then
+ echo
+ eerror "Running /sbin/dolilo failed! Please check what the problem is"
+ eerror "before your next reboot."
+ fi
+ fi
+ echo
+ fi
+ if use !minimal; then
+ echo
+ einfo "Issue 'dolilo' instead of 'lilo' to have a friendly wrapper that"
+ einfo "handles mounting and unmounting /boot for you. It can do more then"
+ einfo "that when asked, edit /etc/conf.d/dolilo to harness it's full potential."
+ echo
+ fi
+}
diff --git a/sys-boot/lilo/lilo-24.1.ebuild b/sys-boot/lilo/lilo-24.1.ebuild
new file mode 100644
index 000000000000..844ce391706b
--- /dev/null
+++ b/sys-boot/lilo/lilo-24.1.ebuild
@@ -0,0 +1,183 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+inherit eutils flag-o-matic toolchain-funcs
+
+DOLILO_V="0.6"
+IUSE="static minimal pxeserial device-mapper"
+
+DESCRIPTION="Standard Linux boot loader"
+HOMEPAGE="https://alioth.debian.org/projects/lilo/"
+
+DOLILO_TAR="dolilo-${DOLILO_V}.tar.bz2"
+SRC_URI="
+ http://lilo.alioth.debian.org/ftp/sources/${P}.tar.gz
+ mirror://gentoo/${DOLILO_TAR}
+"
+
+SLOT="0"
+LICENSE="BSD GPL-2"
+KEYWORDS="-* ~amd64 ~x86"
+
+DEPEND=">=sys-devel/bin86-0.15.5"
+RDEPEND="device-mapper? ( >=sys-fs/lvm2-2.02.45 )"
+
+src_prepare() {
+ # this patch is needed when booting PXE and the device you're using
+ # emulates vga console via serial console.
+ # IE.. B.B.o.o.o.o.t.t.i.i.n.n.g.g....l.l.i.i.n.n.u.u.x.x and stair stepping.
+ use pxeserial && epatch "${FILESDIR}/${P}-novga.patch"
+
+ # Do not strip and have parallel make
+ # FIXME: images/Makefile does weird stuff
+ sed -i Makefile src/Makefile \
+ -e '/strip/d;s|^ make| $(MAKE)|g' \
+ -e '/images install/d' \
+ -e '/images all/d' \
+ || die "sed strip failed"
+}
+
+src_configure() {
+ if ! use device-mapper; then
+ sed -i make.vars -e 's|-DDEVMAPPER||g' || die
+ fi
+}
+
+src_compile() {
+ # lilo needs this. bug #140209
+ export LC_ALL=C
+
+ # hardened automatic PIC plus PIE building should be suppressed
+ # because of assembler instructions that cannot be compiled PIC
+ HARDENED_CFLAGS=$(test-flags-CC -fno-pic -nopie)
+
+ # we explicitly prevent the custom CFLAGS for stability reasons
+ if use static; then
+ local target=alles
+ else
+ local target=all
+ fi
+
+ emake CC="$(tc-getCC) ${LDFLAGS} ${HARDENED_CFLAGS}" ${target} || die
+}
+
+src_install() {
+ keepdir /boot
+ emake DESTDIR="${D}" install || die
+
+ if use !minimal; then
+ into /
+ dosbin "${WORKDIR}"/dolilo/dolilo || die
+
+ into /usr
+ dosbin keytab-lilo.pl || die
+
+ insinto /etc
+ newins "${FILESDIR}"/lilo.conf lilo.conf.example || die
+
+ newconfd "${WORKDIR}"/dolilo/dolilo.conf.d dolilo.example || die
+
+ dodoc CHANGELOG* readme/README.* readme/INCOMPAT README
+ docinto samples ; dodoc sample/*
+ fi
+}
+
+# Check whether LILO is installed
+# This function is from /usr/sbin/mkboot from debianutils, with copyright:
+#
+# Debian GNU/Linux
+# Copyright 1996-1997 Guy Maor <maor@debian.org>
+#
+# Modified for Gentoo for use with the lilo ebuild by:
+# Martin Schlemmer <azarah@gentoo.org> (16 Mar 2003)
+#
+lilocheck() {
+ local bootpart=
+ local rootpart="$(mount | grep -v "tmpfs" | grep -v "rootfs" | grep "on / " | cut -f1 -d " ")"
+
+ echo
+ ebegin "Checking whether LILO can be safely updated"
+
+ if [ "$(whoami)" != "root" ]
+ then
+ eend 1
+ eerror "Only root can check for LILO"
+ return 1
+ fi
+
+ if [ -z "${rootpart}" ]
+ then
+ eend 1
+ eerror "Could not determine root partition"
+ return 1
+ fi
+
+ if [ ! -f /etc/lilo.conf -o ! -x /sbin/lilo ]
+ then
+ eend 1
+ eerror "No LILO configuration in place"
+ return 1
+ fi
+
+ bootpart="$(sed -n "s:^boot[ ]*=[ ]*\(.*\)[ ]*:\1:p" /etc/lilo.conf)"
+
+ if [ -z "${bootpart}" ]
+ then
+ # lilo defaults to current root when 'boot=' is not present
+ bootpart="${rootpart}"
+ fi
+
+ if ! dd if=${bootpart} ibs=16 count=1 2>&- | grep -q 'LILO'
+ then
+ eend 1
+ eerror "No LILO signature on ${bootpart}"
+ ewarn "Check your /etc/lilo.conf, or run /sbin/lilo by hand."
+ return 1
+ fi
+
+ if grep -q "^[[:space:]]*password[[:space:]]*=[[:space:]]*\"\"" /etc/lilo.conf
+ then
+ eend 1
+ eerror "Interactive password entry configured"
+ ewarn "Run /sbin/lilo -p by hand."
+ return 1
+ fi
+
+ einfo "LILO on ${bootpart} is safe to update"
+ eend 0
+ return 0
+}
+
+pkg_postinst() {
+ if [ ! -e "${ROOT}/boot/boot.b" -a ! -L "${ROOT}/boot/boot.b" ]
+ then
+ [ -f "${ROOT}/boot/boot-menu.b" ] && \
+ ln -snf boot-menu.b "${ROOT}/boot/boot.b"
+ fi
+
+ if [ "${ROOT}" = "/" ] && use !minimal;
+ then
+ if lilocheck
+ then
+ einfo "Running DOLILO to complete the install"
+ # do not redirect to /dev/null because it may display some input
+ # prompt
+ /sbin/dolilo
+ if [ "$?" -ne 0 ]
+ then
+ eerror "You must manually configure and run LILO"
+ fi
+ fi
+ echo
+ fi
+ if use !minimal; then
+ echo
+ einfo "Issue 'dolilo' instead of 'lilo' to have a friendly wrapper that"
+ einfo "handles mounting and unmounting /boot for you. It can do more, "
+ einfo "edit /etc/conf.d/dolilo to harness its full potential."
+ echo
+ fi
+}
diff --git a/sys-boot/lilo/metadata.xml b/sys-boot/lilo/metadata.xml
new file mode 100644
index 000000000000..256d2496217f
--- /dev/null
+++ b/sys-boot/lilo/metadata.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>base-system</herd>
+<maintainer>
+ <email>chainsaw@gentoo.org</email>
+ <name>Tony Vroon</name>
+</maintainer>
+<use>
+ <flag name='device-mapper'>Enable support for device-mapper from <pkg>sys-fs/lvm2</pkg></flag>
+ <flag name='minimal'>Do not install the dolilo helper script</flag>
+ <flag name='pxeserial'>Avoid character echo on PXE serial console</flag>
+</use>
+</pkgmetadata>
diff --git a/sys-boot/makebootfat/Manifest b/sys-boot/makebootfat/Manifest
new file mode 100644
index 000000000000..5221fd43b5c7
--- /dev/null
+++ b/sys-boot/makebootfat/Manifest
@@ -0,0 +1 @@
+DIST makebootfat-1.4.tar.gz 146722 SHA256 0287daafc04da2ae70676f0cf6b6c7fbd8742183ce82d005afd078d0550f0f6c SHA512 638356c951670187960d0050d963116391d4b494bc9b082b3d4673188450e47f22fda5733aa09b15cfbb1640807676f5f8743dd094b9931f150b445eb8d335dd WHIRLPOOL 0139d08b06aef6b39333bee40224b1374d87bf1389ca97529763c93339f14c51c8f6493bcd2436aee957ce56590f2e8f52dc95fd633b4d4fdc8fc3282971c3bd
diff --git a/sys-boot/makebootfat/makebootfat-1.4.ebuild b/sys-boot/makebootfat/makebootfat-1.4.ebuild
new file mode 100644
index 000000000000..cc6e64288d2f
--- /dev/null
+++ b/sys-boot/makebootfat/makebootfat-1.4.ebuild
@@ -0,0 +1,25 @@
+# Copyright 1999-2009 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+DESCRIPTION="Command line utility able to create bootable USB disks"
+HOMEPAGE="http://advancemame.sourceforge.net/boot-readme.html"
+SRC_URI="mirror://sourceforge/advancemame/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+RDEPEND="sys-boot/syslinux"
+DEPEND="${RDEPEND}"
+
+src_install() {
+ emake DESTDIR="${D}" install || die
+
+ insinto /usr/share/makebootfat
+ doins mbrfat.bin || die
+
+ dodoc doc/*.txt
+ dohtml doc/*.html
+}
diff --git a/sys-boot/makebootfat/metadata.xml b/sys-boot/makebootfat/metadata.xml
new file mode 100644
index 000000000000..5999bf34e9f8
--- /dev/null
+++ b/sys-boot/makebootfat/metadata.xml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>jlec@gentoo.org</email>
+ </maintainer>
+ <upstream>
+ <remote-id type="sourceforge">advancemame</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-boot/mbr-gpt/Manifest b/sys-boot/mbr-gpt/Manifest
new file mode 100644
index 000000000000..08b71b63cc75
--- /dev/null
+++ b/sys-boot/mbr-gpt/Manifest
@@ -0,0 +1 @@
+DIST mbr-gpt_0.0.1.tar.gz 15861 SHA256 c66cc48c6034f1db72ddba187a52f590001a946f87478171b3d362b601b26bc2
diff --git a/sys-boot/mbr-gpt/mbr-gpt-0.0.1.ebuild b/sys-boot/mbr-gpt/mbr-gpt-0.0.1.ebuild
new file mode 100644
index 000000000000..77d6817e24ed
--- /dev/null
+++ b/sys-boot/mbr-gpt/mbr-gpt-0.0.1.ebuild
@@ -0,0 +1,52 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+inherit eutils flag-o-matic
+
+DESCRIPTION="An MBR that can handle BIOS-based boot on GPT"
+MY_P="${PN}_${PV}"
+HOMEPAGE="http://aybabtu.com/mbr-gpt/"
+SRC_URI="http://aybabtu.com/mbr-gpt/${MY_P}.tar.gz"
+LICENSE="GPL-2"
+SLOT="0"
+# This should probably NEVER go to stable. It's crazy advanced dangerous magic.
+# It's also pure ASM, so not suitable for elsewhere anyway.
+KEYWORDS="~x86 ~amd64"
+IUSE=""
+# It only depends on binutils/gcc/make, and doesn't link against libc even.
+DEPEND=""
+RDEPEND=""
+
+# It's a mostly an MBR block and it does use the executable stack.
+QA_WX_LOAD="usr/sbin/boot.elf"
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+ emake clean
+
+ # Need to build it 32-bit for the MBR
+ # Btw, no CFLAGS are respected, it's ASM!
+ use amd64 && sed -i -e 's/-Wall/-Wall -m32/g' "${S}"/Makefile
+}
+
+src_compile() {
+ emake CC="$(tc-getCC)"
+}
+
+src_install() {
+ # get_libdir is not correct here. We want this to go into a 32-bit library
+ # location.
+ insinto /usr/lib/mbr-gpt/
+ doins mbr
+ dosbin boot.elf
+ dodoc AUTHORS
+}
+
+pkg_postinst() {
+ einfo "See the instructions on the homepage, and make sure you know what"
+ einfo "you are doing before touching this. The mbr file does into your"
+ einfo "MBR, or alternatively you can do a creative reboot utilizing the"
+ einfo "boot.elf binary."
+}
diff --git a/sys-boot/mbr-gpt/metadata.xml b/sys-boot/mbr-gpt/metadata.xml
new file mode 100644
index 000000000000..035bc6b0e2cd
--- /dev/null
+++ b/sys-boot/mbr-gpt/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>base-system</herd>
+<maintainer>
+ <email>robbat2@gentoo.org</email>
+</maintainer>
+</pkgmetadata>
diff --git a/sys-boot/mbr/Manifest b/sys-boot/mbr/Manifest
new file mode 100644
index 000000000000..b7791ebf5ef3
--- /dev/null
+++ b/sys-boot/mbr/Manifest
@@ -0,0 +1 @@
+DIST mbr-1.1.11.tar.gz 132060 RMD160 4f6890bce4540c60d219fcc25b0764589e929705 SHA1 50a21cb3b659efd98385670bfda037acb7e80850 SHA256 c188692955763602e211be585b94c4e4d0fbe7b49fb12a6cd80ae06ccd421f55
diff --git a/sys-boot/mbr/mbr-1.1.11.ebuild b/sys-boot/mbr/mbr-1.1.11.ebuild
new file mode 100644
index 000000000000..e0926d4773d5
--- /dev/null
+++ b/sys-boot/mbr/mbr-1.1.11.ebuild
@@ -0,0 +1,33 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+DESCRIPTION="A replacement master boot record for IBM-PC compatible computers"
+HOMEPAGE="http://www.chiark.greenend.org.uk/~neilt/mbr/"
+SRC_URI="http://www.chiark.greenend.org.uk/~neilt/mbr/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="-alpha amd64 -ppc -sparc x86"
+IUSE="test"
+
+DEPEND="sys-devel/bin86
+ test? ( dev-vcs/rcs )"
+RDEPEND=""
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+ # do not treat warnings as errors
+ sed -i -e "s: -Werror::" {,harness/}Makefile.{in,am}
+}
+
+src_install() {
+ dosbin install-mbr
+ doman install-mbr.8
+ dodoc AUTHORS ChangeLog install-mbr.8 NEWS README TODO
+}
+
+pkg_postinst() {
+ elog "To install the MBR, run /sbin/install-mbr"
+}
diff --git a/sys-boot/mbr/metadata.xml b/sys-boot/mbr/metadata.xml
new file mode 100644
index 000000000000..ff62877c67ae
--- /dev/null
+++ b/sys-boot/mbr/metadata.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<maintainer>
+ <email>maintainer-needed@gentoo.org</email>
+</maintainer>
+</pkgmetadata>
diff --git a/sys-boot/metadata.xml b/sys-boot/metadata.xml
new file mode 100644
index 000000000000..2d91fb22ab0d
--- /dev/null
+++ b/sys-boot/metadata.xml
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE catmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<catmetadata>
+ <longdescription lang="en">
+ The sys-boot category contains bootloaders and related tools.
+ </longdescription>
+ <longdescription lang="es">
+ La categoría sys-boot contiene algunos cargadores de arranque y
+ herramientas relacionadas.
+ </longdescription>
+ <longdescription lang="ja">
+ sys-bootカテゴリにはブートとブート関連ツールが含まれます。
+ </longdescription>
+ <longdescription lang="de">
+ Die Kategorie sys-boot enthält Bootloader sowie damit in
+ Zusammenhang stehende Programme.
+ </longdescription>
+ <longdescription lang="nl">
+ De sys-boot categorie bevat bootloaders en bijbehorende gereedschappen.
+ </longdescription>
+ <longdescription lang="vi">
+ Nhóm sys-boot chứa các bootloader và công cụ liên quan.
+ </longdescription>
+ <longdescription lang="it">
+ La categoria sys-boot contiene bootloaders e strumenti correlati al boot del sistema.
+ </longdescription>
+ <longdescription lang="pt">
+ A categoria sys-boot contém gerenciadores de inicialização e
+ ferramentas relacionadas.
+ </longdescription>
+ <longdescription lang="pl">
+ Kategoria sys-boot zawiera programy ładujące (bootloadery) i związane z
+ nimi pakiety.
+ </longdescription>
+</catmetadata>
+
diff --git a/sys-boot/milo/Manifest b/sys-boot/milo/Manifest
new file mode 100644
index 000000000000..be4aa366b4ea
--- /dev/null
+++ b/sys-boot/milo/Manifest
@@ -0,0 +1,6 @@
+DIST MILO-HOWTO 52455 RMD160 a5b9ef06d3b5ef4c90258a372ddc85f82983957a SHA1 877ceb8ab8e3ed311702913d3538454f83296053 SHA256 d94f5d75d647f47f11fb691df3da450dc794dd9287464df71168d03d8bbcd4e3
+DIST ldmilo-patched-20010430 18944 RMD160 d6d6e07942e614f9d0c108c5e774e3feabe15f75 SHA1 883bb55b0b32ba1cddefd8ae7759bd2f712db335 SHA256 282745f24bc472871b5a4eda7a634847a874d04802056ffca360bf67883d753f
+DIST linload.exe 7168 RMD160 30b5b5d15773c773336cedb49847c509da986dc6 SHA1 8dcff195ed5b34e08cddbf3e5404c9564d0a9814 SHA256 15d1d8dcbefde7c94a1bbe4a243b13f9197c27cb19388f8de0d92d45a4be42e4
+DIST linux-2.2.20-reiserfs-3.5.35.diff.bz2 154943 RMD160 b540887bb50b57dd77eb51bf95cbd7570aec3ebb SHA1 d310daab67bbea3adbac4dac274297b7c6429a00 SHA256 a6aee45cf9814e45d9a3be05b35bda289c5f6d8672eaacc32fcec60527550e94
+DIST linux-2.2.25.tar.bz2 15791211 RMD160 5223cbb5fc2dba55546cef773580563a56e78aa2 SHA1 85921519156215b2b1e08b3d79b468004f11273f SHA256 cd15777cdb90af5136d40d13190def143ccf7a730722c7435e0daff48d0405d9
+DIST milo-2.2-18.tar.bz2 1074725 RMD160 65c28f3c4fcabb83872f9ba598076cf7117df5ee SHA1 59e61f3912805f1f3b0becf961d6309440e6c1c5 SHA256 b63e113d74eb40845ecdd111784d524c223694f236891279ae002b441a50258b
diff --git a/sys-boot/milo/files/README-gentoo b/sys-boot/milo/files/README-gentoo
new file mode 100644
index 000000000000..0d184804c706
--- /dev/null
+++ b/sys-boot/milo/files/README-gentoo
@@ -0,0 +1,99 @@
+# Copyright 1999-2004 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+#
+##############################################
+# Gentoo Linux MILO images.
+####################################################
+#
+# What is MILO?
+#
+###
+
+MILO is an AlphaLinux bootloader, which is usually used to load the Linux
+Operating System on Alpha machines that dont have SRM.
+
+There are two families of firmware on Alpha, ARC and SRM. ARC was developed
+for use with Windows NT, and cannot support Linux. Some Alpha's were
+distributed with only ARC firmware, for use specifically with Windows NT,
+these machines would not be able to run any OS except for Windows NT without
+MILO.
+
+If you do have SRM, or the option of using SRM, you should be using the aboot
+bootloader, unless you really know what you are doing.
+
+NOTE: if you have srm, but would like to dual boot with Windows NT, or use ARC
+ firmware, you might find MILO more useful than aboot. There are other
+ reasons also, booting a kernel from a reiserfs partition, for example.
+
+NOTE: The Gentoo MILO images are slightly different to the standard
+ MILO images, they have been patched to compile with gcc3 and
+ work with the latest linux-2.2 kernel and drivers. You can
+ also optimise your MILO image, to maximise the performance of the
+ MILO pager! woooo!
+
+FIXME: will there be a boot speed improvement from optimising MILO?
+FIXME: what about performance of the call_pal routines (or at least the
+ overhead of calling them, as they are hand coded asm), will
+ that improve system performance?
+
+#####################################################
+#
+# How do i use these images to boot?
+#
+####
+
+NOTE: Read the MILO-HOWTO in this directory now!
+ There is an explanation and description of all the ways you can
+ start MILO, including SRM, Floppy, Flash and Debug Monitor.
+
+In this directory you will find the MILO images, you can use these to
+make MILO boot floppies, or install them to a FAT partition.
+
+There are instructions below for making a MILO boot floppy.
+
+
+1. insert the disk you would like to make a MILO floppy.
+
+2. fdformat /dev/fd0
+
+ Obviously, if the disk is already formatted you can skip
+ this step.
+
+3. mformat a:
+
+ this will create a MSDOS file system (FAT) on the floppy.
+
+4. mcopy milo-2.4.18-gentoo-<your alpha> a:\milo
+
+ install the milo image for your machine onto the new floppy.
+
+5. mcopy linload.exe a:\linload.exe
+ _OR_ if you have a Ruffian machine:
+ mcopy ldmilo.exe a:\ldmilo.exe
+
+ install the milo loader, note that ruffians dont use ldlinux.exe
+ by default, if your system expects ldlinux.exe, just copy that file
+ instead. the ldmilo included in this ebuild contains the fixes by Jay
+ Eastabrook, sometimes called "Jay's Hacked Version".
+
+6. echo -ne '\125\252' | dd of=/dev/fd0 bs=1 seek=510 count=2 conv=notrunc
+
+ this might not be nescessary on all machines, but some ARCs expect the
+ floppy to be marked bootable, this fakes the magic.
+
+7. reboot, and set ARCs to boot your shiny new MILO floppy!
+
+#####################################################
+#
+# BUGS
+#
+####
+
+These MILO images are not extensively tested, if you use one
+PLEASE, PLEASE, PLEASE tell me! i need to know which systems
+it works on and which ones it doesnt.
+
+if you dont want to enter a bug in http://bugs.gentoo.org/
+
+you can just email me a quick note to taviso@gentoo.org
diff --git a/sys-boot/milo/files/linux-2.2.25-gcc3-milo.diff b/sys-boot/milo/files/linux-2.2.25-gcc3-milo.diff
new file mode 100644
index 000000000000..d99769f91c9f
--- /dev/null
+++ b/sys-boot/milo/files/linux-2.2.25-gcc3-milo.diff
@@ -0,0 +1,123 @@
+diff -ru --minimal linux/arch/alpha/kernel/process.c linux/arch/alpha/kernel/process.c
+--- linux/arch/alpha/kernel/process.c 2001-03-25 17:37:29.000000000 +0100
++++ linux/arch/alpha/kernel/process.c 2003-06-02 20:20:19.000000000 +0100
+@@ -57,7 +57,7 @@
+ static struct fs_struct init_fs = INIT_FS;
+ static struct files_struct init_files = INIT_FILES;
+ static struct signal_struct init_signals = INIT_SIGNALS;
+-struct mm_struct init_mm = INIT_MM;
++struct mm_struct init_mm;
+
+ union task_union init_task_union __attribute__((section("init_task")))
+ = { task: INIT_TASK };
+diff -ru --minimal linux/drivers/char/tty_io.c linux/drivers/char/tty_io.c
+--- linux/drivers/char/tty_io.c 2002-05-21 00:32:34.000000000 +0100
++++ linux/drivers/char/tty_io.c 2003-06-02 20:05:08.000000000 +0100
+@@ -756,15 +756,17 @@
+ }
+
+ /* Semaphore to protect creating and releasing a tty */
+-static struct semaphore tty_sem = MUTEX;
++static struct semaphore tty_sem;
+
+ static void down_tty_sem(int index)
+ {
++ tty_sem = MUTEX;
+ down(&tty_sem);
+ }
+
+ static void up_tty_sem(int index)
+ {
++ tty_sem = MUTEX;
+ up(&tty_sem);
+ }
+
+@@ -785,6 +787,7 @@
+ int retval=0;
+ int idx;
+
++ tty_sem = MUTEX;
+ driver = get_tty_driver(device);
+ if (!driver)
+ return -ENODEV;
+diff -ru --minimal linux/fs/super.c linux/fs/super.c
+--- linux/fs/super.c 2001-11-02 16:39:08.000000000 +0000
++++ linux/fs/super.c 2003-06-02 20:13:53.000000000 +0100
+@@ -42,7 +42,7 @@
+ * unmounting a filesystem and re-mounting it (or something
+ * else).
+ */
+-static struct semaphore mount_sem = MUTEX;
++static struct semaphore mount_sem;
+
+ extern void wait_for_keypress(void);
+ extern struct file_operations * get_blkfops(unsigned int major);
+@@ -730,6 +730,7 @@
+ int retval;
+ struct inode * inode = get_empty_inode();
+
++ mount_sem = MUTEX;
+ retval = -ENOMEM;
+ if (!inode)
+ goto out;
+@@ -859,6 +860,7 @@
+ struct vfsmount *vfsmnt;
+ int error;
+
++ mount_sem = MUTEX;
+ error = -EACCES;
+ if (!(flags & MS_RDONLY) && dev && is_read_only(dev))
+ goto out;
+diff -ru --minimal linux/kernel/sys.c linux/kernel/sys.c
+--- linux/kernel/sys.c 2002-09-16 17:26:33.000000000 +0100
++++ linux/kernel/sys.c 2003-06-02 20:00:20.000000000 +0100
+@@ -866,12 +866,13 @@
+ * rather than a semaphore. Anybody want to implement
+ * one?
+ */
+-struct semaphore uts_sem = MUTEX;
++struct semaphore uts_sem;
+
+ asmlinkage int sys_newuname(struct new_utsname * name)
+ {
+ int errno = 0;
+
++ uts_sem = MUTEX;
+ down(&uts_sem);
+ if (copy_to_user(name,&system_utsname,sizeof *name))
+ errno = -EFAULT;
+@@ -883,6 +884,7 @@
+ {
+ int errno;
+
++ uts_sem = MUTEX;
+ if (!capable(CAP_SYS_ADMIN))
+ return -EPERM;
+ if (len < 0 || len > __NEW_UTS_LEN)
+@@ -901,6 +903,7 @@
+ {
+ int i, errno;
+
++ uts_sem = MUTEX;
+ if (len < 0)
+ return -EINVAL;
+ down(&uts_sem);
+@@ -922,6 +925,7 @@
+ {
+ int errno;
+
++ uts_sem = MUTEX;
+ if (!capable(CAP_SYS_ADMIN))
+ return -EPERM;
+ if (len < 0 || len > __NEW_UTS_LEN)
+diff -ru --minimal linux/include/asm-alpha/errno.h linux/include/asm-alpha/errno.h
+--- linux/include/asm-alpha/errno.h 2001-03-25 17:31:06.000000000 +0100
++++ linux/include/asm-alpha/errno.h 2003-06-02 23:48:45.000000000 +0100
+@@ -134,6 +134,7 @@
+ #define ELIBMAX 125 /* Attempting to link in too many shared libraries */
+ #define ELIBEXEC 126 /* Cannot exec a shared library directly */
+ #define ERESTART 127 /* Interrupted system call should be restarted */
++#define EHASHCOLLISION 127 /* reiserfs hash collision */
+ #define ESTRPIPE 128 /* Streams pipe error */
+
+ #define ENOMEDIUM 129 /* No medium found */
diff --git a/sys-boot/milo/files/milo-2.2-18-gcc3-gentoo.diff b/sys-boot/milo/files/milo-2.2-18-gcc3-gentoo.diff
new file mode 100644
index 000000000000..2fa897df6e90
--- /dev/null
+++ b/sys-boot/milo/files/milo-2.2-18-gcc3-gentoo.diff
@@ -0,0 +1,174 @@
+diff -u -r --minimal milo-2.2-18.orig/config.in milo-2.2-18/config.in
+--- milo-2.2-18.orig/config.in 2001-07-18 15:58:30.000000000 +0100
++++ milo-2.2-18/config.in 2003-06-05 18:52:06.000000000 +0100
+@@ -5,7 +5,7 @@
+
+ comment 'Alpha Linux Miniloader setup'
+ #
+-string 'Path to kernel sources' KSRC /usr/src/linux
++string 'Path to kernel sources' KSRC ${WORKDIR}/linux
+ choice 'Alpha system type' \
+ "Alpha-XLT MINI_ALPHA_XLT \
+ Alpha-XL MINI_ALPHA_XL \
+diff -u -r --minimal milo-2.2-18.orig/devices.c milo-2.2-18/devices.c
+--- milo-2.2-18.orig/devices.c 2001-07-18 16:59:38.000000000 +0100
++++ milo-2.2-18/devices.c 2003-06-05 18:52:06.000000000 +0100
+@@ -98,7 +98,7 @@
+ struct fs_struct init_fs = INIT_FS;
+ struct files_struct init_files = INIT_FILES;
+ struct signal_struct init_signals = INIT_SIGNALS;
+-struct mm_struct init_mm = INIT_MM;
++struct mm_struct init_mm;
+
+ unsigned securebits = SECUREBITS_DEFAULT; /* systemwide security settings */
+
+@@ -1213,7 +1213,7 @@
+ }
+
+
+-void __wake_up(struct wait_queue **p, unsigned int mode, unsigned int wq_mode)
++void __wake_up(struct wait_queue **p, unsigned int mode)
+ {
+ wake_up(p);
+ }
+diff -u -r --minimal milo-2.2-18.orig/Documentation/defconfig.milo milo-2.2-18/Documentation/defconfig.milo
+--- milo-2.2-18.orig/Documentation/defconfig.milo 2001-07-19 10:59:45.000000000 +0100
++++ milo-2.2-18/Documentation/defconfig.milo 2003-06-05 18:52:06.000000000 +0100
+@@ -5,7 +5,7 @@
+ #
+ # Alpha Linux Miniloader setup
+ #
+-KSRC=/usr/src/linux
++KSRC=${WORKDIR}/linux
+ # MINI_ALPHA_XLT is not set
+ # MINI_ALPHA_XL is not set
+ # MINI_ALPHA_BOOK1 is not set
+@@ -36,7 +36,7 @@
+ # MINI_VGA_RAW2 is not set
+ MINI_TGA_CONSOLE=y
+ MINI_EXTERNAL_FONT=y
+-MINI_FONT_FILE=/usr/lib/kbd/consolefonts/default8x16.gz
++MINI_FONT_FILE=/usr/share/consolefonts/default8x16.psfu.gz
+ MILO_CONFIG_EXT2FS=y
+ MILO_CONFIG_MSDOSFS=y
+ MILO_CONFIG_REISERFS=y
+diff -u -r --minimal milo-2.2-18.orig/hwrpb.c milo-2.2-18/hwrpb.c
+--- milo-2.2-18.orig/hwrpb.c 2001-07-18 14:38:38.000000000 +0100
++++ milo-2.2-18/hwrpb.c 2003-06-05 18:52:06.000000000 +0100
+@@ -368,9 +368,17 @@
+ percpu =
+ (struct percpu_struct *) (((char *) hwrpb) +
+ hwrpb->processor_offset);
+- percpu->serial_no[0] = 0x73695f78756e694c;
++#ifndef MILO_SERIAL_NUMBER0
++#define MILO_SERIAL_NUMBER0 0x73695f78756e694c
++#endif /* MILO_SERIAL_NUMBER0 */
++
++#ifndef MILO_SERIAL_NUMBER1
++#define MILO_SERIAL_NUMBER1 0x002174616572475f;
++#endif /* MILO_SERIAL_NUMBER1 */
++
++ percpu->serial_no[0] = MILO_SERIAL_NUMBER0;
+ /* :-) */
+- percpu->serial_no[1] = 0x002174616572475f;
++ percpu->serial_no[1] = MILO_SERIAL_NUMBER1;
+ percpu->type = cpuid();
+
+ /*
+diff -u -r --minimal milo-2.2-18.orig/Makefile milo-2.2-18/Makefile
+--- milo-2.2-18.orig/Makefile 2001-07-18 17:15:31.000000000 +0100
++++ milo-2.2-18/Makefile 2003-06-05 18:52:06.000000000 +0100
+@@ -54,8 +54,8 @@
+ #
+
+ LINKFLAGS = -non_shared -N -T milo.lds
+-CFLAGS = -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer \
+- -fno-strict-aliasing -mcpu=ev5 -pipe -mno-fp-regs \
++CFLAGS += -Wall -Wstrict-prototypes -fomit-frame-pointer \
++ -fno-strict-aliasing -pipe -mno-fp-regs \
+ -ffixed-8 -Wa,-mev6 -D__KERNEL__ -D__linux__ \
+ -I$(KSRC)/include
+
+diff -u -r --minimal milo-2.2-18.orig/milo.c milo-2.2-18/milo.c
+--- milo-2.2-18.orig/milo.c 2001-07-18 14:38:38.000000000 +0100
++++ milo-2.2-18/milo.c 2003-06-05 19:16:16.000000000 +0100
+@@ -1436,9 +1436,10 @@
+ {
+ extern U64 milo_memory_size;
+
+- printk("MILO (%s):\n", alpha_mv.vector_name);
+- printk(" Built against Linux " UTS_RELEASE "\n");
++ printk("Gentoo MILO (%s):\n", alpha_mv.vector_name);
++ printk(" Built against Gentoo Linux Kernel " UTS_RELEASE "\n");
+ printk(" Using compiler " LINUX_COMPILER "\n");
++ printk("\nWelcome to the Gentoo Linux MIniLOader\n");
+
+ #if 0
+ /* what sort of video do we have? */
+@@ -1792,7 +1793,7 @@
+ /* parse commands forever */
+ while (1) {
+
+- printk("MILO> ");
++ printk("MILO > ");
+
+ kbd_gets(command_string, 256);
+ printk_rows = 0;
+diff -u -r --minimal milo-2.2-18.orig/tools/scripts/allfiles milo-2.2-18/tools/scripts/allfiles
+--- milo-2.2-18.orig/tools/scripts/allfiles 2001-07-11 18:27:02.000000000 +0100
++++ milo-2.2-18/tools/scripts/allfiles 2003-06-05 18:52:06.000000000 +0100
+@@ -1,7 +1,7 @@
+ #!/bin/bash
+
+ LOC=kernel/objs
+-KSRC=/usr/src/linux/
++KSRC=${WORKDIR}/linux
+
+ rm -rf $LOC
+
+diff -u -r --minimal milo-2.2-18.orig/tools/scripts/build milo-2.2-18/tools/scripts/build
+--- milo-2.2-18.orig/tools/scripts/build 2001-07-18 16:58:29.000000000 +0100
++++ milo-2.2-18/tools/scripts/build 2003-06-05 19:14:25.000000000 +0100
+@@ -1,29 +1,9 @@
+ #!/bin/bash
+ set -e
+
+-RELEASE=2.2-17
++RELEASE=2.2-18-Gentoo
+
+-for i in \
+- "Alpha-XLT XLT" \
+- "Alpha-XL XL" \
+- "AlphaBook1 BOOK1" \
+- "Avanti AVANTI" \
+- "Cabriolet CABRIOLET" \
+- "EB66 EB66" \
+- "EB66+ EB66P" \
+- "EB64+ EB64P" \
+- "EB164 EB164" \
+- "PC164 PC164" \
+- "LX164 LX164" \
+- "SX164 SX164" \
+- "Noname NONAME" \
+- "Takara TAKARA" \
+- "Mikasa MIKASA" \
+- "Alcor ALCOR" \
+- "Miata MIATA" \
+- "Ruffian RUFFIAN" \
+- "Platform2000 P2K" \
+- "UDB UDB"
++for i in __MILO_ARCHES__
+ do
+ short=`echo $i | awk '{print $1}'`
+ long=`echo $i | awk '{print $2}'`
+diff -u -r --minimal milo-2.2-18.orig/tools/scripts/buildkernels milo-2.2-18/tools/scripts/buildkernels
+--- milo-2.2-18.orig/tools/scripts/buildkernels 1999-08-19 14:08:55.000000000 +0100
++++ milo-2.2-18/tools/scripts/buildkernels 2003-06-05 18:52:06.000000000 +0100
+@@ -1,6 +1,6 @@
+ #!/bin/bash
+
+-LINUX=/usr/src/linux
++LINUX=${WORKDIR}/linux
+ KOUT=$(dirname `pwd`)/linux
+
+ set -e
diff --git a/sys-boot/milo/files/mkserial_no.c b/sys-boot/milo/files/mkserial_no.c
new file mode 100644
index 000000000000..b4650447584f
--- /dev/null
+++ b/sys-boot/milo/files/mkserial_no.c
@@ -0,0 +1,45 @@
+#include <stdio.h>
+
+/* some example serial numbers for the MILO bootloader */
+/* gcc -o mkserial_no mkserial_no.c */
+/* taviso@gentoo.org 2003 */
+
+/* NOTE: remember you need a 0x00 (NULL terminator) at the end */
+
+int main()
+{
+ long long serial_no[2];
+
+ /* 1) Linux_is_Great! */
+ /* s i _ x u n i L */
+ serial_no[0] = 0x73695f78756e694c;
+ /* ! t a e r G _ */
+ serial_no[1] = 0x002174616572475f;
+
+ /* 2) Gentoo Linux. */
+ /* L o o t n e G */
+ serial_no[0] = 0x4c206f6f746e6547;
+ /* . x u n i */
+ serial_no[1] = 0x0000002e78756e69;
+
+ /* 3) Gentoo/Alpha. */
+ /* A / o o t n e G */
+ serial_no[0] = 0x412f6f6f746e6547;
+ /* .a h p l */
+ serial_no[1] = 0x0000002e6168706c;
+
+ /* 4) Gentoo MILO. */
+ /* M o o t n e G */
+ serial_no[0] = 0x4d206f6f746e6547;
+ /* . O L I */
+ serial_no[1] = 0x000000002e4f4c49;
+
+ /* 5) |d|i|g|i|t|a|l| */
+ /* i | g | i | d | */
+ serial_no[0] = 0x697c677c697c647c;
+ /* | l | a | t | */
+ serial_no[1] = 0x007c6c7c617c747c;
+
+ printf ("serial number:\t%s\n", (char*) serial_no);
+ return (0);
+}
diff --git a/sys-boot/milo/files/objstrip.c b/sys-boot/milo/files/objstrip.c
new file mode 100644
index 000000000000..bbda40330708
--- /dev/null
+++ b/sys-boot/milo/files/objstrip.c
@@ -0,0 +1,282 @@
+/*
+ * arch/alpha/boot/tools/objstrip.c
+ *
+ * Strip the object file headers/trailers from an executable (ELF or ECOFF).
+ *
+ * Copyright (C) 1996 David Mosberger-Tang.
+ */
+/*
+ * Converts an ECOFF or ELF object file into a bootable file. The
+ * object file must be a OMAGIC file (i.e., data and bss follow immediatly
+ * behind the text). See DEC "Assembly Language Programmer's Guide"
+ * documentation for details. The SRM boot process is documented in
+ * the Alpha AXP Architecture Reference Manual, Second Edition by
+ * Richard L. Sites and Richard T. Witek.
+ */
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <unistd.h>
+
+#include <sys/fcntl.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+
+#include <linux/a.out.h>
+#include <linux/coff.h>
+#include <linux/param.h>
+#include <linux/string.h>
+#ifdef __ELF__
+# include <asm/elf.h>
+# include <linux/elf.h>
+#endif
+
+/* bootfile size must be multiple of BLOCK_SIZE: */
+#define BLOCK_SIZE 512
+
+const char * prog_name;
+
+
+void
+usage (void)
+{
+ fprintf(stderr,
+ "usage: %s [-v] -p file primary\n"
+ " %s [-vb] file [secondary]\n", prog_name, prog_name);
+ exit(1);
+}
+
+
+int
+main (int argc, char *argv[])
+{
+ size_t nwritten, tocopy, n, mem_size, fil_size, pad = 0;
+ int fd, ofd, i, j, verbose = 0, primary = 0;
+ char buf[8192], *inname;
+ struct exec * aout; /* includes file & aout header */
+ long offset;
+#ifdef __ELF__
+ struct elfhdr *elf;
+ struct elf_phdr *elf_phdr; /* program header */
+ unsigned long long e_entry;
+#endif
+
+ prog_name = argv[0];
+
+ for (i = 1; i < argc && argv[i][0] == '-'; ++i) {
+ for (j = 1; argv[i][j]; ++j) {
+ switch (argv[i][j]) {
+ case 'v':
+ verbose = ~verbose;
+ break;
+
+ case 'b':
+ pad = BLOCK_SIZE;
+ break;
+
+ case 'p':
+ primary = 1; /* make primary bootblock */
+ break;
+ }
+ }
+ }
+
+ if (i >= argc) {
+ usage();
+ }
+ inname = argv[i++];
+
+ fd = open(inname, O_RDONLY);
+ if (fd == -1) {
+ perror("open");
+ exit(1);
+ }
+
+ ofd = 1;
+ if (i < argc) {
+ ofd = open(argv[i++], O_WRONLY | O_CREAT | O_TRUNC, 0666);
+ if (fd == -1) {
+ perror("open");
+ exit(1);
+ }
+ }
+
+ if (primary) {
+ /* generate bootblock for primary loader */
+
+ unsigned long bb[64], sum = 0;
+ struct stat st;
+ off_t size;
+ int i;
+
+ if (ofd == 1) {
+ usage();
+ }
+
+ if (fstat(fd, &st) == -1) {
+ perror("fstat");
+ exit(1);
+ }
+
+ size = (st.st_size + BLOCK_SIZE - 1) & ~(BLOCK_SIZE - 1);
+ memset(bb, 0, sizeof(bb));
+ strcpy((char *) bb, "Linux SRM bootblock");
+ bb[60] = size / BLOCK_SIZE; /* count */
+ bb[61] = 1; /* starting sector # */
+ bb[62] = 0; /* flags---must be 0 */
+ for (i = 0; i < 63; ++i) {
+ sum += bb[i];
+ }
+ bb[63] = sum;
+ if (write(ofd, bb, sizeof(bb)) != sizeof(bb)) {
+ perror("boot-block write");
+ exit(1);
+ }
+ printf("%lu\n", size);
+ return 0;
+ }
+
+ /* read and inspect exec header: */
+
+ if (read(fd, buf, sizeof(buf)) < 0) {
+ perror("read");
+ exit(1);
+ }
+
+#ifdef __ELF__
+ elf = (struct elfhdr *) buf;
+
+ if (elf->e_ident[0] == 0x7f && strncmp(elf->e_ident + 1, "ELF", 3) == 0) {
+ if (elf->e_type != ET_EXEC) {
+ fprintf(stderr, "%s: %s is not an ELF executable\n",
+ prog_name, inname);
+ exit(1);
+ }
+ if (!elf_check_arch(elf)) {
+ fprintf(stderr, "%s: is not for this processor (e_machine=%d)\n",
+ prog_name, elf->e_machine);
+ exit(1);
+ }
+ if (elf->e_phnum != 1) {
+ fprintf(stderr,
+ "%s: %d program headers (forgot to link with -N?)\n",
+ prog_name, elf->e_phnum);
+ }
+
+ e_entry = elf->e_entry;
+
+ lseek(fd, elf->e_phoff, SEEK_SET);
+ if (read(fd, buf, sizeof(*elf_phdr)) != sizeof(*elf_phdr)) {
+ perror("read");
+ exit(1);
+ }
+
+ elf_phdr = (struct elf_phdr *) buf;
+ offset = elf_phdr->p_offset;
+ mem_size = elf_phdr->p_memsz;
+ fil_size = elf_phdr->p_filesz;
+
+ /* work around ELF bug: */
+ if (elf_phdr->p_vaddr < e_entry) {
+ unsigned long delta = e_entry - elf_phdr->p_vaddr;
+ offset += delta;
+ mem_size -= delta;
+ fil_size -= delta;
+ elf_phdr->p_vaddr += delta;
+ }
+
+ if (verbose) {
+ fprintf(stderr, "%s: extracting %#016lx-%#016lx (at %lx)\n",
+ prog_name, (long) elf_phdr->p_vaddr,
+ elf_phdr->p_vaddr + fil_size, offset);
+ }
+ } else
+#endif
+ {
+ aout = (struct exec *) buf;
+
+ if (!(aout->fh.f_flags & COFF_F_EXEC)) {
+ fprintf(stderr, "%s: %s is not in executable format\n",
+ prog_name, inname);
+ exit(1);
+ }
+
+ if (aout->fh.f_opthdr != sizeof(aout->ah)) {
+ fprintf(stderr, "%s: %s has unexpected optional header size\n",
+ prog_name, inname);
+ exit(1);
+ }
+
+ if (N_MAGIC(*aout) != OMAGIC) {
+ fprintf(stderr, "%s: %s is not an OMAGIC file\n",
+ prog_name, inname);
+ exit(1);
+ }
+ offset = N_TXTOFF(*aout);
+ fil_size = aout->ah.tsize + aout->ah.dsize;
+ mem_size = fil_size + aout->ah.bsize;
+
+ if (verbose) {
+ fprintf(stderr, "%s: extracting %#016lx-%#016lx (at %lx)\n",
+ prog_name, aout->ah.text_start,
+ aout->ah.text_start + fil_size, offset);
+ }
+ }
+
+ if (lseek(fd, offset, SEEK_SET) != offset) {
+ perror("lseek");
+ exit(1);
+ }
+
+ if (verbose) {
+ fprintf(stderr, "%s: copying %lu byte from %s\n",
+ prog_name, (unsigned long) fil_size, inname);
+ }
+
+ tocopy = fil_size;
+ while (tocopy > 0) {
+ n = tocopy;
+ if (n > sizeof(buf)) {
+ n = sizeof(buf);
+ }
+ tocopy -= n;
+ if ((size_t) read(fd, buf, n) != n) {
+ perror("read");
+ exit(1);
+ }
+ do {
+ nwritten = write(ofd, buf, n);
+ if ((ssize_t) nwritten == -1) {
+ perror("write");
+ exit(1);
+ }
+ n -= nwritten;
+ } while (n > 0);
+ }
+
+ if (pad) {
+ mem_size = ((mem_size + pad - 1) / pad) * pad;
+ }
+
+ tocopy = mem_size - fil_size;
+ if (tocopy > 0) {
+ fprintf(stderr,
+ "%s: zero-filling bss and aligning to %lu with %lu bytes\n",
+ prog_name, pad, (unsigned long) tocopy);
+
+ memset(buf, 0x00, sizeof(buf));
+ do {
+ n = tocopy;
+ if (n > sizeof(buf)) {
+ n = sizeof(buf);
+ }
+ nwritten = write(ofd, buf, n);
+ if ((ssize_t) nwritten == -1) {
+ perror("write");
+ exit(1);
+ }
+ tocopy -= nwritten;
+ } while (tocopy > 0);
+ }
+ return 0;
+}
diff --git a/sys-boot/milo/metadata.xml b/sys-boot/milo/metadata.xml
new file mode 100644
index 000000000000..1b9d222defaf
--- /dev/null
+++ b/sys-boot/milo/metadata.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>alpha</herd>
+ <longdescription lang="en">
+ On Intel based PC systems, the BIOS firmware sets up the system and
+ then loads the image to be run from the boot block of a DOS file
+ system. This is more or less what MILO does on an Alpha based system,
+ however there are several interesting differences between BIOS firmware
+ and MILO, not least of which is that MILO includes and uses standard
+ Linux device drivers unmodified. MILO is firmware, unlike LILO, which
+ relies on the BIOS firmware to get itself loaded.
+ </longdescription>
+</pkgmetadata>
diff --git a/sys-boot/milo/milo-2.4.18.ebuild b/sys-boot/milo/milo-2.4.18.ebuild
new file mode 100644
index 000000000000..5c4d40688f6d
--- /dev/null
+++ b/sys-boot/milo/milo-2.4.18.ebuild
@@ -0,0 +1,232 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+inherit flag-o-matic eutils
+
+# Currently tested Systems:
+#
+# Ruffian: UX164, BX164
+#
+
+DESCRIPTION="The Alpha MIniLOader, for Alpha Machines without SRM"
+HOMEPAGE="http://milo.core-systems.de/"
+
+# ive tested this, and it seems to make little difference
+# which kernel version you use, so it makes sense to use the
+# latest available 2.2 kernel with the latest bugfixes/drivers/etc.
+
+kernel_version="2.2.25"
+milo_version="2.2-18"
+ldmilo_patch="20010430"
+
+# milo-2.2-18.tar.bz2 :- latest milo sources
+# linux-2.2.25.tar.bz2 :- latest linux 2.2 kernel sources
+# ldmilo-patched-20010430 :- Ruffian ldmilo utility, with bugfixes by Jay Eastabrook
+# linload.exe :- linload utility (ldmilo equivalent for non-ruffians).
+
+SRC_URI="http://www.suse.de/~stepan/source/milo-${milo_version}.tar.bz2
+ mirror://kernel/linux/kernel/v2.2/linux-${kernel_version}.tar.bz2
+ http://dev.gentoo.org/~taviso/milo/ldmilo-patched-${ldmilo_patch}
+ http://ftp.namesys.com/pub/reiserfs-for-2.2/linux-2.2.20-reiserfs-3.5.35.diff.bz2
+ http://dev.gentoo.org/~taviso/milo/linload.exe
+ http://www.ibiblio.org/pub/Linux/docs/HOWTO/MILO-HOWTO"
+
+#
+# milo license is dec palcode license, dec bios emulation license, and gpl-2 rolled
+# into one big ugly package.
+#
+# the dec licenses say you can basically do anything you like, including modify
+# and redistribute for profit or non-profit, as long as its for use with Alpha
+# architecture.
+#
+
+LICENSE="MILO"
+SLOT="0"
+
+KEYWORDS="-* ~alpha"
+IUSE=""
+
+DEPEND="sys-apps/kbd
+ >=sys-apps/sed-4"
+RDEPEND="sys-fs/mtools"
+
+S=${WORKDIR}/milo-${milo_version}
+
+# You can change the default MILO serial
+# number here, the MILO default is "Linux_is_Great!".
+# There are some below that i have made you can
+# use if you want, just uncomment the one you like.
+#
+# if you want to see how this works, to make your own
+# look at mkserial_no.c in the filesdir.
+#
+##### Linux_is_Great! ###################
+#milo_serial_number0=0x73695f78756e694c
+#milo_serial_number1=0x002174616572475f
+#
+##### Gentoo Linux. #####################
+milo_serial_number0=0x4c206f6f746e6547
+milo_serial_number1=0x0000002e78756e69
+#
+##### Gentoo/Alpha. #####################
+#milo_serial_number0=0x412f6f6f746e6547
+#milo_serial_number1=0x0000002e6168706c
+#
+##### Gentoo MILO. ######################
+#milo_serial_number0=0x4d206f6f746e6547
+#milo_serial_number1=0x000000002e4f4c49
+#
+##### |d|i|g|i|t|a|l| ###################
+#milo_serial_number0=0x697c677c697c647c
+#milo_serial_number1=0x007c6c7c617c747c;
+#
+
+src_unpack() {
+ # unpack everything the kernel and milo sources
+ unpack linux-${kernel_version}.tar.bz2
+ unpack milo-${milo_version}.tar.bz2
+
+ # gcc3 fixes, and some tweaks to get a build, also
+ # reiserfs support for the kernel (and milo).
+ cd ${WORKDIR}/linux; epatch ${FILESDIR}/linux-${kernel_version}-gcc3-milo.diff || die
+ cd ${WORKDIR}/linux; epatch ${DISTDIR}/linux-2.2.20-reiserfs-3.5.35.diff.bz2 || die
+ cd ${S}; epatch ${FILESDIR}/milo-${milo_version}-gcc3-gentoo.diff || die
+}
+
+src_compile() {
+ unset MILO_ARCH
+ for arches in "Alpha-XLT XLT" \
+ "Alpha-XL XL" \
+ "AlphaBook1 BOOK1" \
+ "Avanti AVANTI" \
+ "Cabriolet CABRIOLET" \
+ "EB66 EB66" \
+ "EB66+ EB66P" \
+ "EB64+ EB64P" \
+ "EB164 EB164" \
+ "PC164 PC164" \
+ "LX164 LX164" \
+ "SX164 SX164" \
+ "Noname NONAME" \
+ "Takara TAKARA" \
+ "Mikasa MIKASA" \
+ "Alcor ALCOR" \
+ "Miata MIATA" \
+ "Ruffian RUFFIAN" \
+ "Platform2000 P2K" \
+ "UDB UDB"
+ do
+ if [ -z "${MILO_IMAGE}" ]; then
+ MILO_ARCH="${MILO_ARCH} \"${arches}\""
+ else
+ if echo ${arches} | grep -i ${MILO_IMAGE}; then
+ MILO_ARCH="\"${arches}\""
+ fi
+ fi
+ done
+
+ if [ -z "${MILO_ARCH}" ]; then
+ eerror "Sorry, but ${MILO_IMAGE} doesnt look valid to me"
+ eerror "Consult the Alpha installation guide, or the ebuild"
+ eerror "for a list of available Alphas."
+ die "${MILO_IMAGE} not supported, or not recognised."
+ fi
+
+ sed -i "s!__MILO_ARCHES__!${MILO_ARCH}!g" ${S}/tools/scripts/build
+
+ ewarn
+ ewarn "seriously, this is going to take a while, go get some coffee..."
+ ewarn
+ einfo "this ebuild will build the standard MILO images, similar to those"
+ einfo "distributed with some distributions, and the images provided with"
+ einfo "the official MILO sources."
+ einfo
+ einfo "of course, the beauty of MILO is it can support any device supported"
+ einfo "by the linux kernel, so if you need support for non-standard hardware"
+ einfo "set the path to the .config you want in \$custom_milo_kernel_config and"
+ einfo "i will use it instead of the default."
+ ewarn
+
+ einfon "continuing in 10 seconds ..."
+ epause 10
+
+ # get kernel configured
+ cp ${custom_milo_kernel_config:-${S}/Documentation/config/linux-2.2.19-SuSE.config} \
+ ${WORKDIR}/linux/.config
+ cd ${WORKDIR}/linux; yes n | make oldconfig || die "unable to configure kernel."
+
+ # we're building a generic kernel that defaults to ev5, but theres no
+ # reason why we cant tweak the instruction set.
+ # im not sure if you can actually pull a system performance gain/faster
+ # boot from optimising milo, but at least you'll get a faster milo pager ;)
+ mcpu_flag="`get-flag mcpu`"
+ if [ ! -z "${mcpu_flag}" ]; then
+ sed -i "s/\(CFLAGS := \$(CFLAGS) \)-mcpu=ev5$/\1-mcpu=${mcpu_flag:-ev5}/g" \
+ ${WORKDIR}/linux/arch/alpha/Makefile
+ fi
+
+ # build the generic linux kernel, of course if you have
+ # hardware not supported by this generic kernel, you are free
+ # to hack it (or the .config used here).
+ einfo "building a generic kernel for use with milo..."
+ unset CC DISTCC_HOSTS; make dep vmlinux || die "unable to build generic kernel for milo."
+ cat ${FILESDIR}/objstrip.c > ${WORKDIR}/linux/arch/alpha/boot/tools/objstrip.c
+
+ # make the objstrip utility.
+ gcc ${WORKDIR}/linux/arch/alpha/boot/tools/objstrip.c -o \
+ ${WORKDIR}/linux/arch/alpha/boot/tools/objstrip || die "couldnt build objstrip."
+ einfo "kernel build complete."
+ einfo "building milo images..."
+
+ # we have a choice here, milo can set the serial number to just about
+ # anything we like, the milo author has chosen "Linux_is_Great!", which
+ # is a bit cheesy, but we will leave it as default if user hasnt chosen
+ # something else.
+ # see above for options.
+
+ append-flags -DMILO_SERIAL_NUMBER0="${milo_serial_number0:-0x73695f78756e694c}"
+ append-flags -DMILO_SERIAL_NUMBER1="${milo_serial_number1:-0x002174616572475f}"
+
+ # the Makefile missed this :-/
+ cd ${S}/tools/common; make || die "couldnt make commonlib."
+
+ # build all the milo images.
+ cd ${S}; tools/scripts/build || die "failed to build milo images."
+
+ # put the ldmilo utility there.
+ cp ${DISTDIR}/ldmilo-patched-${ldmilo_patch} ${S}/binaries/ldmilo.exe
+ cp ${DISTDIR}/linload.exe ${S}/binaries/linload.exe
+
+}
+
+src_install() {
+
+ cd ${S}; dodir /opt/milo
+ insinto /opt/milo
+
+ einfo "Installing MILO images..."
+ for i in binaries/*
+ do
+ einfo " ${i}"
+ doins ${i}
+ done
+
+ cd ${S}/Documentation
+
+ dodoc ChangeLog filesystem Nikita.Todo README.milo Todo LICENSE README.BSD Stuff WhatIsMilo \
+ ${FILESDIR}/README-gentoo ${FILESDIR}/mkserial_no.c ${DISTDIR}/MILO-HOWTO
+
+}
+
+pkg_postinst() {
+ einfo "The MILO images have been installed into /opt/milo."
+ einfo "There are instructions in /usr/share/doc/${P} for making MILO boot floppies."
+ einfo "Alternative methods, (flash, srm, debug monitor, etc) are described in the MILO-HOWTO."
+ einfo
+ einfo "The important docs to read are the README-gentoo and the MILO-HOWTO."
+ einfo
+ ewarn "PLEASE, PLEASE, PLEASE, let me know if this works or not, i need to know which systems"
+ ewarn "need tweaking, and which ones are good to go. You can email me at taviso@gentoo.org"
+ einfo
+}
diff --git a/sys-boot/netboot/Manifest b/sys-boot/netboot/Manifest
new file mode 100644
index 000000000000..ecd4e0d17234
--- /dev/null
+++ b/sys-boot/netboot/Manifest
@@ -0,0 +1 @@
+DIST netboot-0.10.2.tar.gz 1457791 SHA256 e07148b0c396fa8c2c542399b79a6adaafa84684b97c0991fd1dacc7f74a8027 SHA512 422e78833c36e9975a77226523e14ebf8b5af5c02e98628ee030459ebf9f26d020551265899e84ea27bf6ab43c4d9bf8edc6722f942f49103bac897c7cc4fa3e WHIRLPOOL db28598558f9e4f9d949d049624318d9105c128e3743aecd9666b1c9d02cb3f61ebb0b1fd3a220bf577cbca6e61ee5716aec3d1b868d5b1c0fc0eb97a4c600b2
diff --git a/sys-boot/netboot/files/netboot-0.10.2-ldflags.patch b/sys-boot/netboot/files/netboot-0.10.2-ldflags.patch
new file mode 100644
index 000000000000..2cb245076d90
--- /dev/null
+++ b/sys-boot/netboot/files/netboot-0.10.2-ldflags.patch
@@ -0,0 +1,38 @@
+--- netboot-0.10.2/make.config.in.org 2007-02-01 13:09:18.000000000 +0100
++++ netboot-0.10.2/make.config.in 2010-02-09 00:34:15.000000000 +0100
+@@ -105,7 +105,7 @@
+ INCLUDE = $(patsubst %,-I%,$(subst :, ,$(VPATH)))
+ CDEFS = @DEFS@ -DNETBOOT
+ CFLAGS = @CFLAGS@ $(CDEBUG) $(CDEFS) $(INCLUDE)
+-LDFLAGS = -s
++LDFLAGS = @LDFLAGS@
+ SYSLIBS = @LIBS@
+ BDBLIB = @BDBLIB@
+ ODBCLIB = @ODBCLIB@
+--- netboot-0.10.2/misc/Makefile.org 2007-02-01 19:42:10.000000000 +0100
++++ netboot-0.10.2/misc/Makefile 2010-02-09 00:39:21.000000000 +0100
+@@ -76,7 +76,7 @@
+
+ gccrules: $(LIBTOOL) gccrules.o $(LIBNBA)
+ @$(LIBTOOL) --mode=link \
+- $(CC) $(CFLAGS) -o gccrules gccrules.o $(LIBS) \
++ $(CC) $(CFLAGS) $(LDFLAGS) -o gccrules gccrules.o $(LIBS) \
+ -no-install
+
+
+@@ -89,13 +89,13 @@
+
+ gccopt: $(LIBTOOL) gccopt.o $(LIBNBA)
+ @$(LIBTOOL) --mode=link \
+- $(CC) $(CFLAGS) -o gccopt gccopt.o $(LIBS) \
++ $(CC) $(CFLAGS) $(LDFLAGS) -o gccopt gccopt.o $(LIBS) \
+ -no-install
+
+
+ nbmd5: $(LIBTOOL) nbmd5.o $(LIBNBA)
+ @$(LIBTOOL) --mode=link \
+- $(CC) $(CFLAGS) -o nbmd5 nbmd5.o $(LIBS)
++ $(CC) $(CFLAGS) $(LDFLAGS) -o nbmd5 nbmd5.o $(LIBS)
+
+
+ instdrv: instdrv.in
diff --git a/sys-boot/netboot/metadata.xml b/sys-boot/netboot/metadata.xml
new file mode 100644
index 000000000000..bf29e8fa8edd
--- /dev/null
+++ b/sys-boot/netboot/metadata.xml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>maintainer-needed@gentoo.org</email>
+ </maintainer>
+ <upstream>
+ <remote-id type="sourceforge">netboot</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-boot/netboot/netboot-0.10.2.ebuild b/sys-boot/netboot/netboot-0.10.2.ebuild
new file mode 100644
index 000000000000..f4c97dadf708
--- /dev/null
+++ b/sys-boot/netboot/netboot-0.10.2.ebuild
@@ -0,0 +1,51 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="2"
+
+inherit eutils toolchain-funcs
+
+DESCRIPTION="netbooting utility"
+HOMEPAGE="http://netboot.sourceforge.net/"
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="x86"
+IUSE=""
+
+DEPEND=">=dev-libs/lzo-2
+ >=sys-libs/db-4"
+RDEPEND="${DEPEND}
+ !net-misc/mknbi"
+
+src_prepare() {
+ cp -av make.config.in{,.org}
+ epatch "${FILESDIR}"/${P}-ldflags.patch
+ find "${S}" -name \*.lo -exec rm {} \;
+}
+
+src_configure() {
+ econf --enable-bootrom --with-gnu-cc86="$(tc-getCC)" \
+ --with-gnu-as86="$(tc-getAS)" --with-gnu-ld86="$(tc-getCC)"|| die 'cannot configure'
+ # --enable-config-file
+}
+
+src_compile() {
+ emake -j1 || die "emake failed"
+}
+
+src_install() {
+ emake DESTDIR="${D}" install || die
+ dodoc README doc/*
+ docinto FlashCard
+ dodoc FlashCard/README FlashCard/*.ps
+ mv "${D}"/usr/share/misc "${D}"/usr/share/${PN}
+ rm -rf "${D}"/usr/lib/netboot/utils
+
+ dodoc "${S}"/mknbi-dos/utils/mntnbi.pl
+
+ insinto /usr/share/vim/vimfiles/syntax
+ doins "${S}"/mknbi-mgl/misc/mgl.vim
+}
diff --git a/sys-boot/nettrom/Manifest b/sys-boot/nettrom/Manifest
new file mode 100644
index 000000000000..a241ecacf1ca
--- /dev/null
+++ b/sys-boot/nettrom/Manifest
@@ -0,0 +1 @@
+DIST nettrom-2.3.3.tar.gz 801683 SHA256 6a9e06a0741c21e23c37e9449f833c0871af7cca3e7265ba4801214102641cdd SHA512 7b8b85d7a0cda8c5860663e19ce75223d667eeb1997b28eaa2ce67d3c14e609cf98706d54f86b0e91e3dac0570d0ffee7f1737f21bac774a1150e58d783bc925 WHIRLPOOL d1e288c2fcd851c47d9bba6d22f9f40f581b69041b4bffee87f95ef7b03438aa6ec17149c19f035baae0795d8a8476d538b9e22234f14dff3ac0891e68327714
diff --git a/sys-boot/nettrom/metadata.xml b/sys-boot/nettrom/metadata.xml
new file mode 100644
index 000000000000..5c40e771595f
--- /dev/null
+++ b/sys-boot/nettrom/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>embedded</herd>
+</pkgmetadata>
diff --git a/sys-boot/nettrom/nettrom-2.3.3.ebuild b/sys-boot/nettrom/nettrom-2.3.3.ebuild
new file mode 100644
index 000000000000..0e93e3bba667
--- /dev/null
+++ b/sys-boot/nettrom/nettrom-2.3.3.ebuild
@@ -0,0 +1,22 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+DESCRIPTION="NetWinder ARM bootloader and utilities"
+HOMEPAGE="http://www.netwinder.org/"
+SRC_URI="http://wh0rd.org/gentoo/${P}.tar.gz"
+
+LICENSE="all-rights-reserved"
+SLOT="0"
+KEYWORDS="-* arm"
+IUSE=""
+RESTRICT="mirror bindist"
+
+S=${WORKDIR}
+
+src_install() {
+ cp -r "${S}"/* "${D}"/ || die "install failed"
+ cd "${D}"/usr
+ mkdir share
+ mv man share
+}
diff --git a/sys-boot/os-prober/Manifest b/sys-boot/os-prober/Manifest
new file mode 100644
index 000000000000..a4a0a46ade37
--- /dev/null
+++ b/sys-boot/os-prober/Manifest
@@ -0,0 +1,4 @@
+DIST os-prober_1.53.tar.gz 26132 SHA256 58c47274b8e531fdc8b525fa5903885b92dbc3ee39bf13dd87e40336703a58c2 SHA512 4e983d6774cb85df9bec1e8e7ca53d9eec6605bf7308b141d1ee1f118b11534e440a19c0aae17c38f717f433c1ef853ad5879feac1ba4ee10774b3f85bb544ad WHIRLPOOL b555c053fd0d2b934c3e894971744f0a11298695730d8f5b4b344ad175938c8f4e877da20031d6c89ae6a286894f52d18b64b6a8f63136814019b73754298def
+DIST os-prober_1.57.tar.gz 26717 SHA256 d63c6cbb825a7e411aac5e4805edc6db2fbf77a59282b71c10bd29723b8d860c SHA512 b5c2af89e3a69688d3585ea52fd57e48fe85844a9ad5372735f57b9a780027e2f96cc86b1307be7e24b9e141ecea3d4c26316c0cc043eb7a97d24ee46bb07665 WHIRLPOOL 918015a67a3b6530788c093e866cfaa0ae0cd717f869677270b6c6f401d3c891378312f58c9e5f3ec9c22b566f09c33eeb3b0e71839b8a0ca47f530f900c974c
+DIST os-prober_1.62.tar.gz 28592 SHA256 5f25decfef22318c4c705594c9c2049e8d1e662fc8817a4a8e5b114cd26ee1c1 SHA512 6d888de867b5420767491ba66e3ebc0796320bfea5c7efc9a1eabf9bb8290b25e5292fc9b22ffc24101a9faf0e846c85fb1ba73fa1ec44a2c0c0c198c89ea49a WHIRLPOOL e98b54c769fa9a199b1f64b37ccca801499ed3e6e0dbe1189a63220cbbfdca1b1e8411a8d4b4cb6a15b48a83cde39c887288d2f40c3b69d276ddfdaf4e178b96
+DIST os-prober_1.65.tar.xz 24712 SHA256 c4a7661a52edae722f7e6bacb3f107cf7086cbe768275fadf5398d04360bfc84 SHA512 64dd9042a26dc859d9186bb48545d85b1a369d00a93b5045c420eac0c4b672ab32cb6028eada5f1cc21c8ab9386c35b8eedb79bc7975faf7b0a7b2841b284f53 WHIRLPOOL 397a92312b018fa08b2e838bc6b85fa4d55502dfb8e8725c79f4a0ae397e3bd258a7bb302f74b2293cd85f4ddabf4cba75ff2b4b57fa9904094c3a50e1ace36e
diff --git a/sys-boot/os-prober/metadata.xml b/sys-boot/os-prober/metadata.xml
new file mode 100644
index 000000000000..b61c946ee6fa
--- /dev/null
+++ b/sys-boot/os-prober/metadata.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>proxy-maintainers</herd>
+<maintainer>
+ <email>wizzleby@gmail.com</email>
+ <name>Locke Shinseiko</name>
+</maintainer>
+<maintainer>
+ <email>jcallen@gentoo.org</email>
+ <name>Jonathan Callen</name>
+ <description>Proxy maintainer (CC bugs)</description>
+</maintainer>
+</pkgmetadata>
diff --git a/sys-boot/os-prober/os-prober-1.53.ebuild b/sys-boot/os-prober/os-prober-1.53.ebuild
new file mode 100644
index 000000000000..fd9e50aed7bb
--- /dev/null
+++ b/sys-boot/os-prober/os-prober-1.53.ebuild
@@ -0,0 +1,68 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+inherit eutils multilib toolchain-funcs
+
+DESCRIPTION="Utility to detect other OSs on a set of drives"
+HOMEPAGE="http://packages.debian.org/source/sid/os-prober"
+SRC_URI="mirror://debian/pool/main/${PN::1}/${PN}/${PN}_${PV}.tar.gz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="amd64 x86"
+IUSE=""
+
+src_prepare() {
+ find "${S}" -type f -exec sed -i -e "s:/usr/lib/:/usr/libexec/:g" {} + || die
+
+ # use default GNU rules
+ rm Makefile
+}
+
+src_compile() {
+ tc-export CC
+ emake newns
+}
+
+src_install() {
+ dobin os-prober linux-boot-prober
+
+ exeinto /usr/libexec/os-prober
+ doexe newns
+
+ insinto /usr/share/os-prober
+ doins common.sh
+
+ keepdir /var/lib/os-prober
+
+ local debarch=${ARCH%-*} dir
+
+ case ${debarch} in
+ amd64) debarch=x86 ;;
+ ppc|ppc64) debarch=powerpc ;;
+ esac
+
+ for dir in os-probes{,/mounted,/init} linux-boot-probes{,/mounted}; do
+ exeinto /usr/libexec/$dir
+ doexe $dir/common/*
+ if [[ -d $dir/$debarch ]]; then
+ doexe $dir/$debarch/*
+ fi
+ done
+
+ if use amd64 || use x86; then
+ exeinto /usr/libexec/os-probes/mounted
+ doexe os-probes/mounted/powerpc/20macosx
+ fi
+
+ dodoc README TODO debian/changelog
+}
+
+pkg_postinst() {
+ elog "If you intend for os-prober to detect versions of Windows installed on"
+ elog "NTFS-formatted partitions, your system must be capable of reading the"
+ elog "NTFS filesystem. One way to do this is by installing sys-fs/ntfs3g"
+}
diff --git a/sys-boot/os-prober/os-prober-1.57-r1.ebuild b/sys-boot/os-prober/os-prober-1.57-r1.ebuild
new file mode 100644
index 000000000000..4a0b4a7b70ae
--- /dev/null
+++ b/sys-boot/os-prober/os-prober-1.57-r1.ebuild
@@ -0,0 +1,73 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+#inherit eutils multilib toolchain-funcs
+inherit toolchain-funcs
+
+DESCRIPTION="Utility to detect other OSs on a set of drives"
+HOMEPAGE="http://packages.debian.org/source/sid/os-prober"
+SRC_URI="mirror://debian/pool/main/${PN::1}/${PN}/${PN}_${PV}.tar.gz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+src_prepare() {
+ # use default GNU rules
+ rm Makefile || die 'rm Makefile failed'
+ # Fix references to grub-mount
+ sed -i -e 's:grub-mount:grub2-mount:g' \
+ common.sh \
+ linux-boot-probes/common/50mounted-tests \
+ os-probes/common/50mounted-tests
+}
+
+src_compile() {
+ tc-export CC
+ emake newns
+}
+
+src_install() {
+ dobin os-prober linux-boot-prober
+
+ # Note: as no shared libraries are installed, /usr/lib is correct
+ exeinto /usr/lib/os-prober
+ doexe newns
+
+ insinto /usr/share/os-prober
+ doins common.sh
+
+ keepdir /var/lib/os-prober
+
+ local debarch=${ARCH%-*} dir
+
+ case ${debarch} in
+ amd64) debarch=x86 ;;
+ ppc|ppc64) debarch=powerpc ;;
+ esac
+
+ for dir in os-probes{,/mounted,/init} linux-boot-probes{,/mounted}; do
+ exeinto /usr/lib/$dir
+ doexe $dir/common/*
+ if [[ -d $dir/$debarch ]]; then
+ doexe $dir/$debarch/*
+ fi
+ done
+
+ if use amd64 || use x86; then
+ exeinto /usr/lib/os-probes/mounted
+ doexe os-probes/mounted/powerpc/20macosx
+ fi
+
+ dodoc README TODO debian/changelog
+}
+
+pkg_postinst() {
+ elog "If you intend for os-prober to detect versions of Windows installed on"
+ elog "NTFS-formatted partitions, your system must be capable of reading the"
+ elog "NTFS filesystem. One way to do this is by installing sys-fs/ntfs3g"
+}
diff --git a/sys-boot/os-prober/os-prober-1.62.ebuild b/sys-boot/os-prober/os-prober-1.62.ebuild
new file mode 100644
index 000000000000..11860f4b5971
--- /dev/null
+++ b/sys-boot/os-prober/os-prober-1.62.ebuild
@@ -0,0 +1,77 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+#inherit eutils multilib toolchain-funcs
+inherit toolchain-funcs
+
+DESCRIPTION="Utility to detect other OSs on a set of drives"
+HOMEPAGE="http://packages.debian.org/source/sid/os-prober"
+SRC_URI="mirror://debian/pool/main/${PN::1}/${PN}/${PN}_${PV}.tar.gz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+src_prepare() {
+ # use default GNU rules
+ rm Makefile || die 'rm Makefile failed'
+ # Fix references to grub-mount
+ sed -i -e 's:grub-mount:grub2-mount:g' \
+ common.sh \
+ linux-boot-probes/common/50mounted-tests \
+ os-probes/common/50mounted-tests
+}
+
+src_compile() {
+ tc-export CC
+ emake newns
+}
+
+src_install() {
+ dobin os-prober linux-boot-prober
+
+ # Note: as no shared libraries are installed, /usr/lib is correct
+ exeinto /usr/lib/os-prober
+ doexe newns
+
+ insinto /usr/share/os-prober
+ doins common.sh
+
+ keepdir /var/lib/os-prober
+
+ local debarch=${ARCH%-*} dir
+
+ case ${debarch} in
+ amd64) debarch=x86 ;;
+ ppc|ppc64) debarch=powerpc ;;
+ esac
+
+ for dir in os-probes{,/mounted,/init} linux-boot-probes{,/mounted}; do
+ exeinto /usr/lib/$dir
+ doexe $dir/common/*
+ if [[ -d $dir/$debarch ]]; then
+ doexe $dir/$debarch/*
+ fi
+ if [[ -d $dir/$debarch/efi ]]; then
+ exeinto /usr/lib/$dir/efi
+ doexe $dir/$debarch/efi/*
+ fi
+ done
+
+ if use amd64 || use x86; then
+ exeinto /usr/lib/os-probes/mounted
+ doexe os-probes/mounted/powerpc/20macosx
+ fi
+
+ dodoc README TODO debian/changelog
+}
+
+pkg_postinst() {
+ elog "If you intend for os-prober to detect versions of Windows installed on"
+ elog "NTFS-formatted partitions, your system must be capable of reading the"
+ elog "NTFS filesystem. One way to do this is by installing sys-fs/ntfs3g"
+}
diff --git a/sys-boot/os-prober/os-prober-1.65.ebuild b/sys-boot/os-prober/os-prober-1.65.ebuild
new file mode 100644
index 000000000000..adebd5660e31
--- /dev/null
+++ b/sys-boot/os-prober/os-prober-1.65.ebuild
@@ -0,0 +1,79 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+#inherit eutils multilib toolchain-funcs
+inherit toolchain-funcs
+
+DESCRIPTION="Utility to detect other OSs on a set of drives"
+HOMEPAGE="http://packages.debian.org/source/sid/os-prober"
+SRC_URI="mirror://debian/pool/main/${PN::1}/${PN}/${PN}_${PV}.tar.xz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="amd64 x86"
+IUSE=""
+
+S=${WORKDIR}/${PN}
+
+src_prepare() {
+ # use default GNU rules
+ rm Makefile || die 'rm Makefile failed'
+ # Fix references to grub-mount
+ sed -i -e 's:grub-mount:grub2-mount:g' \
+ common.sh \
+ linux-boot-probes/common/50mounted-tests \
+ os-probes/common/50mounted-tests
+}
+
+src_compile() {
+ tc-export CC
+ emake newns
+}
+
+src_install() {
+ dobin os-prober linux-boot-prober
+
+ # Note: as no shared libraries are installed, /usr/lib is correct
+ exeinto /usr/lib/os-prober
+ doexe newns
+
+ insinto /usr/share/os-prober
+ doins common.sh
+
+ keepdir /var/lib/os-prober
+
+ local debarch=${ARCH%-*} dir
+
+ case ${debarch} in
+ amd64) debarch=x86 ;;
+ ppc|ppc64) debarch=powerpc ;;
+ esac
+
+ for dir in os-probes{,/mounted,/init} linux-boot-probes{,/mounted}; do
+ exeinto /usr/lib/$dir
+ doexe $dir/common/*
+ if [[ -d $dir/$debarch ]]; then
+ doexe $dir/$debarch/*
+ fi
+ if [[ -d $dir/$debarch/efi ]]; then
+ exeinto /usr/lib/$dir/efi
+ doexe $dir/$debarch/efi/*
+ fi
+ done
+
+ if use amd64 || use x86; then
+ exeinto /usr/lib/os-probes/mounted
+ doexe os-probes/mounted/powerpc/20macosx
+ fi
+
+ dodoc README TODO debian/changelog
+}
+
+pkg_postinst() {
+ elog "If you intend for os-prober to detect versions of Windows installed on"
+ elog "NTFS-formatted partitions, your system must be capable of reading the"
+ elog "NTFS filesystem. One way to do this is by installing sys-fs/ntfs3g"
+}
diff --git a/sys-boot/palo/Manifest b/sys-boot/palo/Manifest
new file mode 100644
index 000000000000..0e4ce3f8a6be
--- /dev/null
+++ b/sys-boot/palo/Manifest
@@ -0,0 +1,2 @@
+DIST palo_1.92.tar.gz 122554 SHA256 9782578cae5a990c5037e8a9feb43d3d6802412918b97c27a04c1b9113de3c4f SHA512 a0b01b12bf80c6727a9a5eff1189e7515d3f21e8fe68712d0cb944e06f6d0f91272e5457b97ed596f06fd51505c7f62f654d1d3081c79443023cbbd0cb98e58c WHIRLPOOL 46b498b48a35ff2557bf91182b2daa30211f0de37f3c986794de83c58b3b633ebca21c19542c16f8b9d229a5f81d1419189b72adde8d7b783fa053c605e73c14
+DIST palo_1.95.tar.xz 102884 SHA256 c168df0255e83f06cf5ae4fd5266f9ee51ba3e9412a9c1bf3131ecff52cec9e8 SHA512 91960a7bbf5a4985809a082d4e75ee25670f6030e701bc106807de4f89c3617e47cf39ef857684b62dcaf906571f6f095b3caa371793754495567f4a14cc8a9d WHIRLPOOL cdf119aa0892fecce4c4dae73053dd9f3c9745a17276012b1d6fb649e3e55eea561dec8f40feb52fb6477f5b289a61844d39c0d8d0ab2ba2a2501c1323b28305
diff --git a/sys-boot/palo/files/99palo b/sys-boot/palo/files/99palo
new file mode 100644
index 000000000000..8caea49f51ad
--- /dev/null
+++ b/sys-boot/palo/files/99palo
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+palo -v
diff --git a/sys-boot/palo/files/palo-1.92-toolchain.patch b/sys-boot/palo/files/palo-1.92-toolchain.patch
new file mode 100644
index 000000000000..b72947b63699
--- /dev/null
+++ b/sys-boot/palo/files/palo-1.92-toolchain.patch
@@ -0,0 +1,20 @@
+--- a/palo/Makefile
++++ b/palo/Makefile
+@@ -14,7 +14,7 @@
+ ifeq ($(strip ${OS}),HP-UX)
+ CFLAGS=-g -O -I../include -I../lib -I$(PA)/include
+ else
+-CFLAGS=-g -O -I../include -I../lib
++CFLAGS+= -O -I../include -I../lib
+ endif
+
+ # LDFLAGS=-Wl,-Bstatic
+@@ -34,7 +34,7 @@
+ $(CC) $(CFLAGS) $(LDFLAGS) -o palo palo.a build.o
+
+ palo.a: $(OFILES)
+- ar rv palo.a $?
++ $(AR) rv palo.a $?
+
+ mkbootable: $(OFILES2)
+ $(CC) $(CFLAGS) $(LDFLAGS) -o mkbootable $(OFILES2)
diff --git a/sys-boot/palo/files/palo-1.95-toolchain.patch b/sys-boot/palo/files/palo-1.95-toolchain.patch
new file mode 100644
index 000000000000..1e70f2d5ebf0
--- /dev/null
+++ b/sys-boot/palo/files/palo-1.95-toolchain.patch
@@ -0,0 +1,27 @@
+--- a/palo/Makefile
++++ b/palo/Makefile
+@@ -12,13 +12,12 @@
+ OS := $(shell uname -s)
+ CC?=cc
+ ifeq ($(strip ${OS}),HP-UX)
+-CFLAGS=-g -O -I../include -I../lib -I$(PA)/include
++CFLAGS=-O -I../include -I../lib -I$(PA)/include
+ else
+-CFLAGS=-g -O -I../include -I../lib -D_FILE_OFFSET_BITS=64
++CFLAGS=-O -I../include -I../lib -D_FILE_OFFSET_BITS=64
+ endif
+
+ # LDFLAGS=-Wl,-Bstatic
+-LDFLAGS=
+
+ OFILES2=mkbootable.o elf64.o load.o paloio.o elf32.o error.o gzip.o
+
+@@ -34,7 +33,7 @@
+ $(CC) $(CFLAGS) $(LDFLAGS) -o palo palo.a build.o
+
+ palo.a: $(OFILES)
+- ar rv palo.a $?
++ $(AR) rv palo.a $?
+
+ mkbootable: $(OFILES2)
+ $(CC) $(CFLAGS) $(LDFLAGS) -o mkbootable $(OFILES2)
diff --git a/sys-boot/palo/files/palo.conf b/sys-boot/palo/files/palo.conf
new file mode 100644
index 000000000000..8880b50b5f1f
--- /dev/null
+++ b/sys-boot/palo/files/palo.conf
@@ -0,0 +1,8 @@
+# Please read the palo --help output for more info
+# Non-commented lines are treated as command line arguments
+
+--commandline=2/vmlinux root=/dev/sda4
+--init-partitioned=/dev/sda
+
+#Uncomment this if you want a rescue kernel
+#--recoverykernel=/boot/vmlinux.old
diff --git a/sys-boot/palo/metadata.xml b/sys-boot/palo/metadata.xml
new file mode 100644
index 000000000000..ed2a9d8b7fb8
--- /dev/null
+++ b/sys-boot/palo/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>hppa</herd>
+<longdescription>
+The PArisc Linux Loader
+</longdescription>
+</pkgmetadata>
diff --git a/sys-boot/palo/palo-1.92.ebuild b/sys-boot/palo/palo-1.92.ebuild
new file mode 100644
index 000000000000..d9cfe96fc2b2
--- /dev/null
+++ b/sys-boot/palo/palo-1.92.ebuild
@@ -0,0 +1,47 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils flag-o-matic toolchain-funcs
+
+DESCRIPTION="PALO : PArisc Linux Loader"
+HOMEPAGE="http://parisc-linux.org/ https://parisc.wiki.kernel.org/"
+SRC_URI="http://dev.gentoo.org/~jer/${P/-/_}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="-* hppa"
+IUSE=""
+
+src_prepare() {
+ epatch \
+ "${FILESDIR}"/${PN}-1.92-toolchain.patch
+ sed -i palo/Makefile -e '/^LDFLAGS=/d' || die
+}
+
+src_compile() {
+ local target
+ for target in '-C palo' '-C ipl' 'iplboot'; do
+ emake AR=$(tc-getAR) CC=$(tc-getCC) LD=$(tc-getLD) ${target}
+ done
+}
+
+src_install() {
+ into /
+ dosbin palo/palo
+
+ doman palo.8
+ dohtml README.html
+ dodoc Changes TODO debian/changelog
+
+ insinto /etc
+ doins "${FILESDIR}"/palo.conf
+
+ insinto /usr/share/palo
+ doins iplboot
+
+ insinto /etc/kernel/postinst.d/
+ INSOPTIONS="-m 0744" doins "${FILESDIR}"/99palo
+}
diff --git a/sys-boot/palo/palo-1.95.ebuild b/sys-boot/palo/palo-1.95.ebuild
new file mode 100644
index 000000000000..8c537acc0efb
--- /dev/null
+++ b/sys-boot/palo/palo-1.95.ebuild
@@ -0,0 +1,44 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils flag-o-matic toolchain-funcs
+
+DESCRIPTION="PALO : PArisc Linux Loader"
+HOMEPAGE="http://parisc-linux.org/ https://parisc.wiki.kernel.org/"
+SRC_URI="mirror://debian/pool/main/p/${PN}/${P/-/_}.tar.xz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="-* hppa"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-1.95-toolchain.patch
+}
+
+src_compile() {
+ local target
+ for target in '-C palo' '-C ipl' 'iplboot'; do
+ emake AR=$(tc-getAR) CC=$(tc-getCC) LD=$(tc-getLD) ${target}
+ done
+}
+
+src_install() {
+ into /
+ dosbin palo/palo
+
+ doman palo.8
+ dohtml README.html
+ dodoc Changes TODO debian/changelog
+
+ insinto /etc
+ doins "${FILESDIR}"/palo.conf
+
+ insinto /usr/share/palo
+ doins iplboot
+
+ insinto /etc/kernel/postinst.d/
+ INSOPTIONS="-m 0744" doins "${FILESDIR}"/99palo
+}
diff --git a/sys-boot/palo/palo-9999.ebuild b/sys-boot/palo/palo-9999.ebuild
new file mode 100644
index 000000000000..e1bb604bc95e
--- /dev/null
+++ b/sys-boot/palo/palo-9999.ebuild
@@ -0,0 +1,44 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils flag-o-matic git-r3 toolchain-funcs
+
+DESCRIPTION="PALO : PArisc Linux Loader"
+HOMEPAGE="http://parisc-linux.org/ https://parisc.wiki.kernel.org/"
+EGIT_REPO_URI="git://git.kernel.org/pub/scm/linux/kernel/git/deller/palo.git"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS=""
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-1.95-toolchain.patch
+ sed -i lib/common.h -e '/^#define PALOVERSION/{s|".*"|"'${PV}'"|g}' || die
+}
+
+src_compile() {
+ emake AR=$(tc-getAR) CC=$(tc-getCC) LD=$(tc-getLD) \
+ makepalo makeipl || die
+ emake CC=$(tc-getCC) iplboot || die
+}
+
+src_install() {
+ into /
+ dosbin palo/palo
+
+ doman palo.8
+ dodoc palo.conf
+ dohtml README.html
+
+ insinto /etc
+ doins "${FILESDIR}"/palo.conf
+
+ insinto /usr/share/palo
+ doins iplboot
+
+ insinto /etc/kernel/postinst.d/
+ INSOPTIONS="-m 0744" doins "${FILESDIR}"/99palo
+}
diff --git a/sys-boot/plymouth-openrc-plugin/Manifest b/sys-boot/plymouth-openrc-plugin/Manifest
new file mode 100644
index 000000000000..1cc31d0228ab
--- /dev/null
+++ b/sys-boot/plymouth-openrc-plugin/Manifest
@@ -0,0 +1 @@
+DIST plymouth-openrc-plugin-0.1.2.tar.bz2 8909 SHA256 029f469440ff95b0f8d256eb172fbfccf064101b0f24e8d38cf8721980124dfe
diff --git a/sys-boot/plymouth-openrc-plugin/metadata.xml b/sys-boot/plymouth-openrc-plugin/metadata.xml
new file mode 100644
index 000000000000..546f269ca40d
--- /dev/null
+++ b/sys-boot/plymouth-openrc-plugin/metadata.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>maintainer-needed@gentoo.org</email>
+ <name>Default maintainer for orphaned packages</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="github">aidecoe/plymouth-openrc-plugin</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-boot/plymouth-openrc-plugin/plymouth-openrc-plugin-0.1.2.ebuild b/sys-boot/plymouth-openrc-plugin/plymouth-openrc-plugin-0.1.2.ebuild
new file mode 100644
index 000000000000..5d22119e23f1
--- /dev/null
+++ b/sys-boot/plymouth-openrc-plugin/plymouth-openrc-plugin-0.1.2.ebuild
@@ -0,0 +1,42 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+inherit multilib
+
+DESCRIPTION="Plymouth plugin for OpenRC"
+HOMEPAGE="https://github.com/aidecoe/plymouth-openrc-plugin"
+SRC_URI="
+http://dev.gentoo.org/~aidecoe/distfiles/${CATEGORY}/${PN}/${P}.tar.bz2"
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~ia64 ~ppc ~ppc64 ~sparc ~x86"
+IUSE=""
+DEPEND=">=sys-apps/openrc-0.8.2-r1"
+RDEPEND="${DEPEND}
+ >=sys-boot/plymouth-0.8.3-r5
+ "
+
+src_install() {
+ insinto /$(get_libdir)/rc/plugins
+ doins plymouth.so
+}
+
+pkg_postinst() {
+ ewarn "You need to disable 'interactive' feature in /etc/rc.conf to make"
+ ewarn "Plymouth work properly with OpenRC init system."
+
+ if [[ ! -d /run ]]; then
+ eerror "/run doesn't exist! You need to create this directory."
+ echo
+ einfo "If you'd like to know more about purpose of /run, please read:"
+ einfo " https://lwn.net/Articles/436012/"
+ fi
+
+ if has_version sys-apps/systemd; then
+ eerror "sys-apps/systemd is installed, please uninstall this package if you"
+ eerror "are booting with systemd"
+ fi
+}
diff --git a/sys-boot/plymouth/Manifest b/sys-boot/plymouth/Manifest
new file mode 100644
index 000000000000..8967184efea4
--- /dev/null
+++ b/sys-boot/plymouth/Manifest
@@ -0,0 +1,4 @@
+DIST gentoo-logo.png 14501 SHA256 79ebc1d66693371a90e218ad421cfed05066b51a6645bd967bb7da356a0881fa SHA512 059a555931b6d2a910bcd887f5ea0cc17c6edf2d2d45c03a1fec1bdda0138ba6bca6bdf90a65c6520a3f8f1b51ecf6f7956098f45ed6c1276f29c835e729163c WHIRLPOOL 65496223badb9a96cc72ba6a2432860af0756eea57f67946d2466ff1c3c1171c84568c502aa576613b77767c41cf251856728b509c72003567d4cebd1943375e
+DIST plymouth-0.8.8.tar.bz2 1143549 SHA256 1bada4e1d3a31a5a99adc2db83f5452d9818839cda51a6e430f044f6281d759b SHA512 97a20a8622c7ea51000e9b6d88a25fd84d7001fb2727527a72344b555f389c74954bd0be0bffd9cc9175b5c5a0d28e95af058fce79ec7531f736619ee74d8d94 WHIRLPOOL badb44a6c1eb004772e67cfe3cda601d22590d813ebd4bce5f0fcb325c445246916ba30e083c6aa98b73b460ddf4f2caf9bf2727d22bbbc5414f11a5cf0e5ddf
+DIST plymouth-0.9.0.tar.bz2 1159218 SHA256 d3e22e750a8a83de7377e9fa88975f146f875bbd030055411a2faf74c2e6cd4d SHA512 046e7fb20d3a65cc2b8b378026fae6619417557502426d944e4f06078eacfa37cb5fcf886d8bdb598921bbef87ce3ec92daa16a57075a180d5f427443100c232 WHIRLPOOL 3b2e327a02c18cd436f895aa38719acd07ed06f3cbd846181190144784325e8561c1ebd97516beaa396733e9981e76f3029dc29b27f3ae32f646c087529ada0d
+DIST plymouth-0.9.2.tar.bz2 1231336 SHA256 2f0ce82042cf9c7eadd2517a1f74c8a85fa8699781d9f294a06eade29fbed57f SHA512 89356eb8326504fbf3155de262ce15de0847f0a0e6d157d873cf1dea9af464a6cb9e11d7143ee9a595b217a2487060b5835eba5ac142c3cd6d66689deb272e60 WHIRLPOOL 5f9e662dec633bb606cf4246611b442a0eb9eaa92942b37c53d1c48b6ca8ef96c5f4330d574b82de6a026ca175a770c1a45f52c7809c80d026126d805e707eba
diff --git a/sys-boot/plymouth/files/0.8.3-drm-reduce-minimum-build-requirements.patch b/sys-boot/plymouth/files/0.8.3-drm-reduce-minimum-build-requirements.patch
new file mode 100644
index 000000000000..8c9bb5ab3f32
--- /dev/null
+++ b/sys-boot/plymouth/files/0.8.3-drm-reduce-minimum-build-requirements.patch
@@ -0,0 +1,422 @@
+drm: reduce minimum build requirements
+
+This patch adds the respective configure options to make it possible to disable
+libdrm_intel, libdrm_radeon, libdrm_nouveau independently from each other.
+
+NOTE:
+
+The patch is based on work of Lucian Muresan <lucianm@users.sourceforge.net>
+that fixes bug report:
+
+ https://bugs.freedesktop.org/show_bug.cgi?id=29804
+
+This one is adjusted to version 0.8.3 which doesn't support libkms yet.
+
+---
+diff -Naur plymouth-0.8.3/configure.ac plymouth-0.8.3.new/configure.ac
+--- plymouth-0.8.3/configure.ac 2010-05-06 19:32:20.000000000 +0200
++++ plymouth-0.8.3.new/configure.ac 2011-02-03 18:45:11.749557708 +0100
+@@ -56,49 +56,150 @@
+ AC_SUBST(GTK_CFLAGS)
+ AC_SUBST(GTK_LIBS)
+
+-PKG_CHECK_MODULES(DRM, [libdrm libdrm_intel libdrm_radeon libdrm_nouveau])
++AC_ARG_ENABLE(libdrm_intel, AS_HELP_STRING([--enable-libdrm_intel],[enable building with libdrm_intel support]),enable_libdrm_intel=$enableval,enable_libdrm_intel=yes)
++AM_CONDITIONAL(ENABLE_LIBDRM_INTEL, [test "$enable_libdrm_intel" = yes])
+
+-OLD_CFLAGS="$CFLAGS"
+-CFLAGS="$CFLAGS $DRM_CFLAGS"
+-AC_MSG_CHECKING([if i915_drm.h, radeon_drm.h and nouveau_drm.h are in include path])
+-AC_COMPILE_IFELSE(AC_LANG_PROGRAM(
+-[[
+- #include <stdint.h>
+- #include <stdlib.h>
+- #include "i915_drm.h"
+- #include "radeon_drm.h"
+- #include "nouveau_drm.h"
+-]],[[]]),[found_drm_kernel_headers=yes],[found_drm_kernel_headers=no])
+-
+-if test "$found_drm_kernel_headers" = "yes"; then
+- AC_MSG_RESULT([yes])
+-else
+- AC_MSG_RESULT([no])
+- AC_MSG_CHECKING([if we can find them anyway])
++if test x$enable_libdrm_intel = xyes; then
++ PKG_CHECK_MODULES(DRM_INTEL, [libdrm libdrm_intel])
++ OLD_CFLAGS="$CFLAGS"
++ CFLAGS="$CFLAGS $DRM_INTEL_CFLAGS"
++ AC_MSG_CHECKING([if i915_drm.h is in include path])
++ AC_COMPILE_IFELSE(AC_LANG_PROGRAM(
++ [[
++ #include <stdint.h>
++ #include <stdlib.h>
++ #include "i915_drm.h"
++ ]],[[]]),[found_drm_intel_kernel_headers=yes],[found_drm_intel_kernel_headers=no])
++
++ if test "$found_drm_intel_kernel_headers" = "yes"; then
++ AC_MSG_RESULT([yes])
++ else
++ AC_MSG_RESULT([no])
++ AC_MSG_CHECKING([if we can find them anyway])
++
++ MORE_DRM_CFLAGS="-I`$PKG_CONFIG --variable includedir libdrm`/drm"
++ CFLAGS="$CFLAGS $MORE_DRM_CFLAGS"
++ AC_COMPILE_IFELSE(AC_LANG_PROGRAM(
++ [[
++ #include <stdint.h>
++ #include <stdlib.h>
++ #include "i915_drm.h"
++ ]],[[]]),[found_drm_intel_kernel_headers=yes],[found_drm_intel_kernel_headers=no])
++
++ if test "$found_drm_intel_kernel_headers" = "yes"; then
++ AC_MSG_RESULT([yes])
++ DRM_INTEL_CFLAGS="$DRM_INTEL_CFLAGS $MORE_DRM_CFLAGS"
++ else
++ AC_MSG_RESULT([no])
++ AC_MSG_ERROR([Could not find i915_drm.h])
++ fi
++ fi
++
++ AC_SUBST(DRM_INTEL_CFLAGS)
++ AC_SUBST(DRM_INTEL_LIBS)
++ AC_DEFINE(PLY_ENABLE_LIBDRM_INTEL, 1, [Enable support for libdrm_intel driver])
++fi
++
++AC_ARG_ENABLE(libdrm_radeon, AS_HELP_STRING([--enable-libdrm_radeon],[enable building with libdrm_radeon support]),enable_libdrm_radeon=$enableval,enable_libdrm_radeon=yes)
++AM_CONDITIONAL(ENABLE_LIBDRM_RADEON, [test "$enable_libdrm_radeon" = yes])
+
+- MORE_DRM_CFLAGS="-I`$PKG_CONFIG --variable includedir libdrm`/drm"
+- CFLAGS="$CFLAGS $MORE_DRM_CFLAGS"
++if test x$enable_libdrm_radeon = xyes; then
++ PKG_CHECK_MODULES(DRM_RADEON, [libdrm libdrm_radeon])
++ OLD_CFLAGS="$CFLAGS"
++ CFLAGS="$CFLAGS $DRM_RADEON_CFLAGS"
++ AC_MSG_CHECKING([if radeon_drm.h is in include path])
+ AC_COMPILE_IFELSE(AC_LANG_PROGRAM(
+ [[
+ #include <stdint.h>
+ #include <stdlib.h>
+ #include "i915_drm.h"
+ #include "radeon_drm.h"
++ ]],[[]]),[found_drm_radeon_kernel_headers=yes],[found_drm_radeon_kernel_headers=no])
++
++ if test "$found_drm_radeon_kernel_headers" = "yes"; then
++ AC_MSG_RESULT([yes])
++ else
++ AC_MSG_RESULT([no])
++ AC_MSG_CHECKING([if we can find them anyway])
++
++ MORE_DRM_CFLAGS="-I`$PKG_CONFIG --variable includedir libdrm`/drm"
++ CFLAGS="$CFLAGS $MORE_DRM_RADEON_CFLAGS"
++ AC_COMPILE_IFELSE(AC_LANG_PROGRAM(
++ [[
++ #include <stdint.h>
++ #include <stdlib.h>
++ #include "radeon_drm.h"
++ ]],[[]]),[found_drm_radeon_kernel_headers=yes],[found_drm_radeon_kernel_headers=no])
++
++ if test "$found_drm_radeon_kernel_headers" = "yes"; then
++ AC_MSG_RESULT([yes])
++ DRM_RADEON_CFLAGS="$DRM_RADEON_CFLAGS $MORE_DRM_CFLAGS"
++ else
++ AC_MSG_RESULT([no])
++ AC_MSG_ERROR([Could not find radeon_drm.h])
++ fi
++ fi
++
++ AC_SUBST(DRM_RADEON_CFLAGS)
++ AC_SUBST(DRM_RADEON_LIBS)
++ AC_DEFINE(PLY_ENABLE_LIBDRM_RADEON, 1, [Enable support for libdrm_radeon driver])
++fi
++
++AC_ARG_ENABLE(libdrm_nouveau, AS_HELP_STRING([--enable-libdrm_nouveau],[enable building with libdrm_nouveau support]),enable_libdrm_nouveau=$enableval,enable_libdrm_nouveau=yes)
++AM_CONDITIONAL(ENABLE_LIBDRM_NOUVEAU, [test "$enable_libdrm_nouveau" = yes])
++
++if test x$enable_libdrm_nouveau = xyes; then
++ PKG_CHECK_MODULES(DRM_NOUVEAU, [libdrm libdrm_nouveau])
++ OLD_CFLAGS="$CFLAGS"
++ CFLAGS="$CFLAGS $DRM_NOUVEAU_CFLAGS"
++ AC_MSG_CHECKING([if nouveau_drm.h is in include path])
++ AC_COMPILE_IFELSE(AC_LANG_PROGRAM(
++ [[
++ #include <stdint.h>
++ #include <stdlib.h>
+ #include "nouveau_drm.h"
+- ]],[[]]),[found_drm_kernel_headers=yes],[found_drm_kernel_headers=no])
++ ]],[[]]),[found_drm_nouveau_kernel_headers=yes],[found_drm_nouveau_kernel_headers=no])
+
+- if test "$found_drm_kernel_headers" = "yes"; then
++ if test "$found_drm_nouveau_kernel_headers" = "yes"; then
+ AC_MSG_RESULT([yes])
+ DRM_CFLAGS="$DRM_CFLAGS $MORE_DRM_CFLAGS"
+ else
+ AC_MSG_RESULT([no])
+- AC_MSG_ERROR([Could not find i915_drm.h, radeon_drm.h and/or nouveau_drm.h])
++ AC_MSG_CHECKING([if we can find them anyway])
++
++ MORE_DRM_CFLAGS="-I`$PKG_CONFIG --variable includedir libdrm`/drm"
++ CFLAGS="$CFLAGS $MORE_DRM_CFLAGS"
++ AC_COMPILE_IFELSE(AC_LANG_PROGRAM(
++ [[
++ #include <stdint.h>
++ #include <stdlib.h>
++ #include "nouveau_drm.h"
++ ]],[[]]),[found_drm_nouveau_kernel_headers=yes],[found_drm_nouveau_kernel_headers=no])
++
++ if test "$found_drm_nouveau_kernel_headers" = "yes"; then
++ AC_MSG_RESULT([yes])
++ DRM_NOUVEAU_CFLAGS="$DRM_NOUVEAU_CFLAGS $MORE_DRM_CFLAGS"
++ else
++ AC_MSG_RESULT([no])
++ AC_MSG_ERROR([Could not find nouveau_drm.h])
++ fi
+ fi
++
++ AC_SUBST(DRM_NOUVEAU_CFLAGS)
++ AC_SUBST(DRM_NOUVEAU_LIBS)
++ AC_DEFINE(PLY_ENABLE_LIBDRM_NOUVEAU, 1, [Enable support for libdrm_nouveau driver])
+ fi
+-CFLAGS="$OLD_CFLAGS"
++
++DRM_CFLAGS="$DRM_INTEL_CFLAGS $DRM_RADEON_CFLAGS $DRM_NOUVEAU_CFLAGS"
++DRM_LIBS="$DRM_INTEL_LIBS $DRM_RADEON_LIBS $DRM_NOUVEAU_LIBS"
+ AC_SUBST(DRM_CFLAGS)
+ AC_SUBST(DRM_LIBS)
+
++AM_CONDITIONAL(ENABLE_DRM_RENDERER,
++ [test x$enable_libdrm_intel = xyes \
++ -o x$enable_libdrm_radeon = xyes \
++ -o x$enable_libdrm_nouveau = xyes])
++
+ AC_ARG_ENABLE(tracing, AS_HELP_STRING([--enable-tracing],[enable verbose tracing code]),enable_tracing=$enableval,enable_tracing=yes)
+
+ if test x$enable_tracing = xyes; then
+diff -Naur plymouth-0.8.3/scripts/plymouth-populate-initrd.in plymouth-0.8.3.new/scripts/plymouth-populate-initrd.in
+--- plymouth-0.8.3/scripts/plymouth-populate-initrd.in 2010-05-06 19:32:20.000000000 +0200
++++ plymouth-0.8.3.new/scripts/plymouth-populate-initrd.in 2011-02-03 19:14:06.316946754 +0100
+@@ -97,7 +97,7 @@
+
+ inst ${PLYMOUTH_PLUGIN_PATH}/${PLYMOUTH_MODULE_NAME}.so $INITRDDIR
+
+-inst ${PLYMOUTH_PLUGIN_PATH}/renderers/drm.so $INITRDDIR
++[ -f "${PLYMOUTH_PLUGIN_PATH}/renderers/drm.so" ] && inst ${PLYMOUTH_PLUGIN_PATH}/renderers/drm.so $INITRDDIR
+ inst ${PLYMOUTH_PLUGIN_PATH}/renderers/frame-buffer.so $INITRDDIR
+
+ if [ -d ${PLYMOUTH_DATADIR}/plymouth/themes/${PLYMOUTH_THEME_NAME} ]; then
+diff -Naur plymouth-0.8.3/scripts/plymouth-populate-initrd.in.orig plymouth-0.8.3.new/scripts/plymouth-populate-initrd.in.orig
+--- plymouth-0.8.3/scripts/plymouth-populate-initrd.in.orig 1970-01-01 01:00:00.000000000 +0100
++++ plymouth-0.8.3.new/scripts/plymouth-populate-initrd.in.orig 2010-05-06 19:32:20.000000000 +0200
+@@ -0,0 +1,114 @@
++#!/bin/bash
++
++[ -z "$DESTDIR" ] || exit 0
++
++[ -z "$PLYMOUTH_LIBEXECDIR" ] && PLYMOUTH_LIBEXECDIR="@PLYMOUTH_LIBEXECDIR@"
++[ -z "$PLYMOUTH_DATADIR" ] && PLYMOUTH_DATADIR="@PLYMOUTH_DATADIR@"
++[ -z "$PLYMOUTH_PLUGIN_PATH" ] && PLYMOUTH_PLUGIN_PATH="$(plymouth --get-splash-plugin-path)"
++[ -z "$PLYMOUTH_LOGO_FILE" ] && PLYMOUTH_LOGO_FILE="@logofile@"
++[ -z "$PLYMOUTH_THEME_NAME" ] && PLYMOUTH_THEME_NAME=$(plymouth-set-default-theme)
++[ -z "$PLYMOUTH_CONFDIR" ] && PLYMOUTH_CONFDIR="@PLYMOUTH_CONF_DIR@"
++[ -z "$PLYMOUTH_POLICYDIR" ] && PLYMOUTH_POLICYDIR="@PLYMOUTH_POLICY_DIR@"
++
++if [ -z "$PLYMOUTH_POPULATE_SOURCE_FUNCTIONS" ]; then
++
++ if [ -f "${PLYMOUTH_LIBEXECDIR}/initrd-functions" ]; then
++ PLYMOUTH_POPULATE_SOURCE_FUNCTIONS="${PLYMOUTH_LIBEXECDIR}/initrd-functions"
++ fi
++
++ if [ -f "${PLYMOUTH_DATADIR}/dracut/dracut-functions" ]; then
++ PLYMOUTH_POPULATE_SOURCE_FUNCTIONS="${PLYMOUTH_DATADIR}/dracut/dracut-functions"
++ fi
++fi
++
++if [ -n "$PLYMOUTH_POPULATE_SOURCE_FUNCTIONS" ]; then
++ source $PLYMOUTH_POPULATE_SOURCE_FUNCTIONS
++fi
++
++if [ " $(type -t inst) " != " function " ]; then
++ echo "Need 'inst' function, try setting PLYMOUTH_POPULATE_SOURCE_FUNCTIONS to a file that defines it" 1>&2
++ exit 1
++fi
++
++if [ " $(type -t set_verbose) " != " function " ]; then
++ function set_verbose { true; }
++fi
++
++function usage() {
++ local output="/dev/stdout"
++ local rc=0
++ if [ "$1" == "error" ]; then
++ output="/dev/stderr"
++ rc=1
++ fi
++
++ echo "usage: plymouth [ --verbose | -v ] { --targetdir | -t } <initrd_directory>" > $output
++ exit $rc
++}
++
++verbose=false
++INITRDDIR=""
++while [ $# -gt 0 ]; do
++ case $1 in
++ --verbose|-v)
++ verbose=true
++ ;;
++ --targetdir|-t)
++ shift
++ INITRDDIR="$1"
++ ;;
++ --help|-h)
++ usage normal
++ ;;
++ *)
++ usage error
++ break
++ ;;
++ esac
++ shift
++done
++set_verbose $verbose || :
++
++[ -z "$INITRDDIR" ] && usage error
++
++mkdir -p ${INITRDDIR}${PLYMOUTH_DATADIR}/plymouth/themes
++inst /sbin/plymouthd $INITRDDIR /bin/plymouthd
++inst /bin/plymouth $INITRDDIR
++inst ${PLYMOUTH_DATADIR}/plymouth/themes/text/text.plymouth $INITRDDIR
++inst ${PLYMOUTH_PLUGIN_PATH}/text.so $INITRDDIR
++inst ${PLYMOUTH_DATADIR}/plymouth/themes/details/details.plymouth $INITRDDIR
++inst ${PLYMOUTH_PLUGIN_PATH}/details.so $INITRDDIR
++inst ${PLYMOUTH_LOGO_FILE} $INITRDDIR
++inst @RELEASE_FILE@ $INITRDDIR
++inst ${PLYMOUTH_POLICYDIR}/plymouthd.defaults $INITRDDIR
++inst ${PLYMOUTH_CONFDIR}/plymouthd.conf $INITRDDIR
++
++if [ -z "$PLYMOUTH_THEME_NAME" ]; then
++ echo "No default plymouth plugin is set" > /dev/stderr
++ exit 1
++fi
++
++PLYMOUTH_MODULE_NAME=$(grep "ModuleName *= *" ${PLYMOUTH_DATADIR}/plymouth/themes/${PLYMOUTH_THEME_NAME}/${PLYMOUTH_THEME_NAME}.plymouth | sed 's/ModuleName *= *//')
++
++if [ ! -f ${PLYMOUTH_PLUGIN_PATH}/${PLYMOUTH_MODULE_NAME}.so ]; then
++ echo "The default plymouth plugin (${PLYMOUTH_MODULE_NAME}) doesn't exist" > /dev/stderr
++ exit 1
++fi
++
++inst ${PLYMOUTH_PLUGIN_PATH}/${PLYMOUTH_MODULE_NAME}.so $INITRDDIR
++
++inst ${PLYMOUTH_PLUGIN_PATH}/renderers/drm.so $INITRDDIR
++inst ${PLYMOUTH_PLUGIN_PATH}/renderers/frame-buffer.so $INITRDDIR
++
++if [ -d ${PLYMOUTH_DATADIR}/plymouth/themes/${PLYMOUTH_THEME_NAME} ]; then
++ for x in ${PLYMOUTH_DATADIR}/plymouth/themes/${PLYMOUTH_THEME_NAME}/* ; do
++ [ ! -f "$x" ] && break
++ inst $x $INITRDDIR
++ done
++fi
++
++if [ -L ${PLYMOUTH_DATADIR}/plymouth/themes/default.plymouth ]; then
++ cp -a ${PLYMOUTH_DATADIR}/plymouth/themes/default.plymouth $INITRDDIR${PLYMOUTH_DATADIR}/plymouth/themes
++fi
++
++# vim:ts=8:sw=4:sts=4:et
+diff -Naur plymouth-0.8.3/src/plugins/renderers/drm/Makefile.am plymouth-0.8.3.new/src/plugins/renderers/drm/Makefile.am
+--- plymouth-0.8.3/src/plugins/renderers/drm/Makefile.am 2010-05-06 19:32:20.000000000 +0200
++++ plymouth-0.8.3.new/src/plugins/renderers/drm/Makefile.am 2011-02-03 19:07:04.811686193 +0100
+@@ -1,3 +1,4 @@
++if ENABLE_DRM_RENDERER
+ INCLUDES = -I$(top_srcdir) \
+ -I$(srcdir)/../../../libply \
+ -I$(srcdir)/../../../libply-splash-core \
+@@ -16,12 +17,22 @@
+ ../../../libply/libply.la \
+ ../../../libply-splash-core/libply-splash-core.la
+ drm_la_SOURCES = $(srcdir)/plugin.c \
+- $(srcdir)/ply-renderer-driver.h \
+- $(srcdir)/ply-renderer-i915-driver.h \
+- $(srcdir)/ply-renderer-i915-driver.c \
+- $(srcdir)/ply-renderer-radeon-driver.h \
+- $(srcdir)/ply-renderer-radeon-driver.c \
+- $(srcdir)/ply-renderer-nouveau-driver.h \
+- $(srcdir)/ply-renderer-nouveau-driver.c
++ $(srcdir)/ply-renderer-driver.h
++if ENABLE_LIBDRM_INTEL
++drm_la_SOURCES += $(srcdir)/ply-renderer-i915-driver.h \
++ $(srcdir)/ply-renderer-i915-driver.c
++endif
++
++if ENABLE_LIBDRM_RADEON
++drm_la_SOURCES += $(srcdir)/ply-renderer-radeon-driver.h \
++ $(srcdir)/ply-renderer-radeon-driver.c
++endif
++
++if ENABLE_LIBDRM_NOUVEAU
++drm_la_SOURCES += $(srcdir)/ply-renderer-nouveau-driver.h \
++ $(srcdir)/ply-renderer-nouveau-driver.c
++endif
++
++endif
+
+ MAINTAINERCLEANFILES = Makefile.in
+diff -Naur plymouth-0.8.3/src/plugins/renderers/drm/plugin.c plymouth-0.8.3.new/src/plugins/renderers/drm/plugin.c
+--- plymouth-0.8.3/src/plugins/renderers/drm/plugin.c 2010-05-06 19:32:20.000000000 +0200
++++ plymouth-0.8.3.new/src/plugins/renderers/drm/plugin.c 2011-02-03 19:13:35.083078444 +0100
+@@ -57,9 +57,15 @@
+ #include "ply-renderer.h"
+ #include "ply-renderer-plugin.h"
+ #include "ply-renderer-driver.h"
++#ifdef PLY_ENABLE_LIBDRM_INTEL
+ #include "ply-renderer-i915-driver.h"
++#endif
++#ifdef PLY_ENABLE_LIBDRM_RADEON
+ #include "ply-renderer-radeon-driver.h"
++#endif
++#ifdef PLY_ENABLE_LIBDRM_NOUVEAU
+ #include "ply-renderer-nouveau-driver.h"
++#endif
+
+ #define BYTES_PER_PIXEL (4)
+
+@@ -443,22 +449,29 @@
+ free (driver_name);
+ return false;
+ }
+-
+- if (strcmp (driver_name, "i915") == 0)
++ backend->driver_interface = NULL;
++#ifdef PLY_ENABLE_LIBDRM_INTEL
++ if (backend->driver_interface == NULL && strcmp (driver_name, "i915") == 0)
+ {
+ backend->driver_interface = ply_renderer_i915_driver_get_interface ();
+ backend->driver_supports_mapping_console = true;
+ }
+- else if (strcmp (driver_name, "radeon") == 0)
++#endif
++#ifdef PLY_ENABLE_LIBDRM_RADEON
++ if (backend->driver_interface == NULL && strcmp (driver_name, "radeon") == 0)
+ {
+ backend->driver_interface = ply_renderer_radeon_driver_get_interface ();
+ backend->driver_supports_mapping_console = false;
+ }
+- else if (strcmp (driver_name, "nouveau") == 0)
++#endif
++#ifdef PLY_ENABLE_LIBDRM_NOUVEAU
++ if (backend->driver_interface == NULL && strcmp (driver_name, "nouveau") == 0)
+ {
+ backend->driver_interface = ply_renderer_nouveau_driver_get_interface ();
+ backend->driver_supports_mapping_console = false;
+ }
++#endif
++
+ free (driver_name);
+
+ if (backend->driver_interface == NULL)
+diff -Naur plymouth-0.8.3/src/plugins/renderers/Makefile.am plymouth-0.8.3.new/src/plugins/renderers/Makefile.am
+--- plymouth-0.8.3/src/plugins/renderers/Makefile.am 2010-05-06 19:32:20.000000000 +0200
++++ plymouth-0.8.3.new/src/plugins/renderers/Makefile.am 2011-02-03 19:14:06.316946754 +0100
+@@ -1,2 +1,3 @@
+-SUBDIRS = frame-buffer drm x11
++SUBDIRS = frame-buffer x11 drm
++
+ MAINTAINERCLEANFILES = Makefile.in
diff --git a/sys-boot/plymouth/files/0.8.3-gentoo-fb-path.patch b/sys-boot/plymouth/files/0.8.3-gentoo-fb-path.patch
new file mode 100644
index 000000000000..cb0f0d5af3bb
--- /dev/null
+++ b/sys-boot/plymouth/files/0.8.3-gentoo-fb-path.patch
@@ -0,0 +1,25 @@
+From 5fd3ed5a1f661eb1d99e1d4df5edad8410cc54e3 Mon Sep 17 00:00:00 2001
+From: root <root@christoph.egore.lan>
+Date: Sun, 25 Oct 2009 03:55:54 +0100
+Subject: [PATCH] Gentoo does not have /dev/fb, but /dev/fb0 (at least on i915 KMS)
+
+---
+ src/plugins/renderers/frame-buffer/plugin.c | 2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/src/libply/ply-frame-buffer.c b/src/libply/ply-frame-buffer.c
+index a1e4fcd..19aab4b 100644
+--- a/src/plugins/renderers/frame-buffer/plugin.c
++++ b/src/plugins/renderers/frame-buffer/plugin.c
+@@ -46,7 +46,7 @@
+ #include <linux/fb.h>
+
+ #ifndef PLY_FRAME_BUFFER_DEFAULT_FB_DEVICE_NAME
+-#define PLY_FRAME_BUFFER_DEFAULT_FB_DEVICE_NAME "/dev/fb"
++#define PLY_FRAME_BUFFER_DEFAULT_FB_DEVICE_NAME "/dev/fb0"
+ #endif
+
+ struct _ply_frame_buffer
+--
+1.6.5
+
diff --git a/sys-boot/plymouth/files/0.8.3-image-replace-deprecated-libpng-function.patch b/sys-boot/plymouth/files/0.8.3-image-replace-deprecated-libpng-function.patch
new file mode 100644
index 000000000000..42985c5b04ca
--- /dev/null
+++ b/sys-boot/plymouth/files/0.8.3-image-replace-deprecated-libpng-function.patch
@@ -0,0 +1,24 @@
+From 07329b72687ccc7a9015de4a48fae297d6d5ff96 Mon Sep 17 00:00:00 2001
+From: Brett Witherspoon <spoonb@cdspooner.com>
+Date: Tue, 12 Oct 2010 03:23:47 +0000
+Subject: image: replace deprecated libpng function
+
+The png_set_gray_1_2_4_to_8 function is deprecated and has been removed
+from libpng14. Now png_set_expand_gray_1_2_4_to_8 is used instead which
+is compatible with libpng-1.2.9 and greater.
+---
+diff --git a/src/libply-splash-graphics/ply-image.c b/src/libply-splash-graphics/ply-image.c
+index 9369242..4b16783 100644
+--- a/src/libply-splash-graphics/ply-image.c
++++ b/src/libply-splash-graphics/ply-image.c
+@@ -151,7 +151,7 @@ ply_image_load (ply_image_t *image)
+ png_set_palette_to_rgb (png);
+
+ if ((color_type == PNG_COLOR_TYPE_GRAY) && (bits_per_pixel < 8))
+- png_set_gray_1_2_4_to_8 (png);
++ png_set_expand_gray_1_2_4_to_8 (png);
+
+ if (png_get_valid (png, info, PNG_INFO_tRNS))
+ png_set_tRNS_to_alpha (png);
+--
+cgit v0.8.3-6-g21f6
diff --git a/sys-boot/plymouth/files/0.8.8-initrd-binaries-paths.patch b/sys-boot/plymouth/files/0.8.8-initrd-binaries-paths.patch
new file mode 100644
index 000000000000..7416527b0f31
--- /dev/null
+++ b/sys-boot/plymouth/files/0.8.8-initrd-binaries-paths.patch
@@ -0,0 +1,32 @@
+From 2d85c8d0a3ad81268718344e0e72ebeeea851422 Mon Sep 17 00:00:00 2001
+From: Enrico Tagliavini <enrico.tagliavini@gmail.com>
+Date: Wed, 29 Jan 2014 14:18:22 +0000
+Subject: populate-initrd: install binaries to their configured location
+
+If plymouth is configured --with-system-root-install=no then the
+systemd unitd files will write the paths of plymouth and plymouthd
+relative to /usr . The script currently hardcodes installing them
+to the initrd's /
+
+This commit makes sure they get placed on the same part of the of
+the initrd filesystem as systemd expects to find them.
+
+https://bugs.freedesktop.org/show_bug.cgi?id=74174
+---
+diff --git a/scripts/plymouth-populate-initrd.in b/scripts/plymouth-populate-initrd.in
+index d25ab07..43c7f22 100755
+--- a/scripts/plymouth-populate-initrd.in
++++ b/scripts/plymouth-populate-initrd.in
+@@ -373,8 +373,8 @@ done
+ [ -z "$INITRDDIR" ] && usage error
+
+ mkdir -p ${INITRDDIR}${PLYMOUTH_DATADIR}/plymouth/themes
+-inst ${PLYMOUTH_DAEMON_PATH} $INITRDDIR /sbin/plymouthd
+-inst ${PLYMOUTH_CLIENT_PATH} $INITRDDIR /bin/plymouth
++inst ${PLYMOUTH_DAEMON_PATH} $INITRDDIR
++inst ${PLYMOUTH_CLIENT_PATH} $INITRDDIR
+ inst ${PLYMOUTH_DATADIR}/plymouth/themes/text/text.plymouth $INITRDDIR
+ inst ${PLYMOUTH_PLUGIN_PATH}/text.so $INITRDDIR
+ inst ${PLYMOUTH_DATADIR}/plymouth/themes/details/details.plymouth $INITRDDIR
+--
+cgit v0.9.0.2-2-gbebe
diff --git a/sys-boot/plymouth/files/0.9.2-systemdsystemunitdir.patch b/sys-boot/plymouth/files/0.9.2-systemdsystemunitdir.patch
new file mode 100644
index 000000000000..b5289244232a
--- /dev/null
+++ b/sys-boot/plymouth/files/0.9.2-systemdsystemunitdir.patch
@@ -0,0 +1,18 @@
+diff --git a/configure.ac b/configure.ac
+index aad673e..592be5f 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -122,7 +122,12 @@ AM_CONDITIONAL(ENABLE_SYSTEMD_INTEGRATION, [test "$enable_systemd_integration" =
+
+ if test x$enable_systemd_integration = xyes; then
+ AC_DEFINE(PLY_ENABLE_SYSTEMD_INTEGRATION, 1, [Coordinate boot up with systemd])
+- SYSTEMD_UNIT_DIR=$($PKG_CONFIG --variable=systemdsystemunitdir systemd)
++ AC_ARG_WITH([systemdsystemunitdir], AC_HELP_STRING([--with-systemdsystemunitdir=DIR],
++ [path to systemd service directory]), [path_systemdunit=${withval}],
++ [path_systemdunit="`$PKG_CONFIG --variable=systemdsystemunitdir systemd`"])
++ if (test -n "${path_systemdunit}"); then
++ SYSTEMD_UNIT_DIR="${path_systemdunit}"
++ fi
+ AC_SUBST(SYSTEMD_UNIT_DIR)
+ fi
+
diff --git a/sys-boot/plymouth/metadata.xml b/sys-boot/plymouth/metadata.xml
new file mode 100644
index 000000000000..094f65df04d1
--- /dev/null
+++ b/sys-boot/plymouth/metadata.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>proxy-maintainers</herd>
+<maintainer>
+ <email>enrico.tagliavini@gmail.com</email>
+ <name>Enrico Tagliavini</name>
+</maintainer>
+ <use>
+ <flag name="gdm">Enables smooth transition to GDM</flag>
+ <flag name="libkms">Provides abstraction to the DRM drivers (intel,
+ nouveau and vmwgfx at this moment)</flag>
+ <flag name="pango">Adds support for printing text on splash screen and
+ text prompts, e.g. for password</flag>
+ </use>
+ <longdescription lang="en">
+ Plymouth is an application that runs very early in the boot process
+ (even before the root filesystem is mounted!) that provides a graphical
+ boot animation while the boot process happens in the background.
+
+ It is designed to work on systems with DRM modesetting drivers. Ideally,
+ the goal is to get rid of all flicker during startup. For systems that
+ don't have DRM mode settings drivers, plymouth falls back to text mode.
+ </longdescription>
+</pkgmetadata>
diff --git a/sys-boot/plymouth/plymouth-0.8.8-r4.ebuild b/sys-boot/plymouth/plymouth-0.8.8-r4.ebuild
new file mode 100644
index 000000000000..9f3c6e8cfb1e
--- /dev/null
+++ b/sys-boot/plymouth/plymouth-0.8.8-r4.ebuild
@@ -0,0 +1,90 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit autotools-utils readme.gentoo systemd toolchain-funcs
+
+DESCRIPTION="Graphical boot animation (splash) and logger"
+HOMEPAGE="http://cgit.freedesktop.org/plymouth/"
+SRC_URI="
+ http://www.freedesktop.org/software/plymouth/releases/${P}.tar.bz2
+ http://dev.gentoo.org/~aidecoe/distfiles/${CATEGORY}/${PN}/gentoo-logo.png"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="alpha amd64 arm ia64 ppc ppc64 sparc x86"
+IUSE_VIDEO_CARDS="video_cards_intel video_cards_radeon"
+IUSE="${IUSE_VIDEO_CARDS} debug gdm +gtk +libkms +pango static-libs"
+
+CDEPEND="
+ >=media-libs/libpng-1.2.16
+ gtk? (
+ dev-libs/glib:2
+ >=x11-libs/gtk+-2.12:2 )
+ libkms? ( x11-libs/libdrm[libkms] )
+ pango? ( >=x11-libs/pango-1.21 )
+ video_cards_intel? ( x11-libs/libdrm[video_cards_intel] )
+ video_cards_radeon? ( x11-libs/libdrm[video_cards_radeon] )
+"
+DEPEND="${CDEPEND}
+ virtual/pkgconfig
+"
+# Block due bug #383067
+RDEPEND="${CDEPEND}
+ virtual/udev
+"
+
+DOC_CONTENTS="
+ Follow the following instructions to set up Plymouth:\n
+ http://dev.gentoo.org/~aidecoe/doc/en/plymouth.xml
+"
+
+src_prepare() {
+ sed -i 's:/bin/systemd-tty-ask-password-agent:/usr/bin/systemd-tty-ask-password-agent:g' \
+ systemd-units/systemd-ask-password-plymouth.service.in || die \
+ 'ask-password sed failed'
+ sed -i 's:/bin/udevadm:/usr/bin/udevadm:g' \
+ systemd-units/plymouth-start.service.in || die 'udevadm sed failed'
+ autotools-utils_src_prepare
+}
+
+src_configure() {
+ local myeconfargs=(
+ --with-system-root-install=no
+ --localstatedir=/var
+ --without-rhgb-compat-link
+ --enable-systemd-integration
+ $(use_enable debug tracing)
+ $(use_enable gtk gtk)
+ $(use_enable libkms)
+ $(use_enable pango)
+ $(use_enable gdm gdm-transition)
+ $(use_enable video_cards_intel libdrm_intel)
+ $(use_enable video_cards_radeon libdrm_radeon)
+ )
+ autotools-utils_src_configure
+}
+
+src_install() {
+ autotools-utils_src_install
+
+ insinto /usr/share/plymouth
+ newins "${DISTDIR}"/gentoo-logo.png bizcom.png
+
+ # Install compatibility symlinks as some rdeps hardcode the paths
+ dosym /usr/bin/plymouth /bin/plymouth
+ dosym /usr/sbin/plymouth-set-default-theme /sbin/plymouth-set-default-theme
+ dosym /usr/sbin/plymouthd /sbin/plymouthd
+
+ readme.gentoo_create_doc
+}
+
+pkg_postinst() {
+ readme.gentoo_print_elog
+ if ! has_version "sys-kernel/dracut[dracut_modules_plymouth]" && ! has_version "sys-kernel/genkernel-next[plymouth]"; then
+ ewarn "If you want initramfs builder with plymouth support, please emerge"
+ ewarn "sys-kernel/dracut[dracut_modules_plymouth] or sys-kernel/genkernel-next[plymouth]."
+ fi
+}
diff --git a/sys-boot/plymouth/plymouth-0.8.8-r5.ebuild b/sys-boot/plymouth/plymouth-0.8.8-r5.ebuild
new file mode 100644
index 000000000000..d2c0bb15ed72
--- /dev/null
+++ b/sys-boot/plymouth/plymouth-0.8.8-r5.ebuild
@@ -0,0 +1,94 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit autotools-utils readme.gentoo systemd toolchain-funcs
+
+DESCRIPTION="Graphical boot animation (splash) and logger"
+HOMEPAGE="http://cgit.freedesktop.org/plymouth/"
+SRC_URI="
+ http://www.freedesktop.org/software/plymouth/releases/${P}.tar.bz2
+ http://dev.gentoo.org/~aidecoe/distfiles/${CATEGORY}/${PN}/gentoo-logo.png"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~ia64 ~ppc ~ppc64 ~sparc ~x86"
+IUSE_VIDEO_CARDS="video_cards_intel video_cards_radeon"
+IUSE="${IUSE_VIDEO_CARDS} debug gdm +gtk +libkms +pango static-libs"
+
+CDEPEND="
+ >=media-libs/libpng-1.2.16
+ gtk? (
+ dev-libs/glib:2
+ >=x11-libs/gtk+-2.12:2 )
+ libkms? ( x11-libs/libdrm[libkms] )
+ pango? ( >=x11-libs/pango-1.21 )
+ video_cards_intel? ( x11-libs/libdrm[video_cards_intel] )
+ video_cards_radeon? ( x11-libs/libdrm[video_cards_radeon] )
+"
+DEPEND="${CDEPEND}
+ virtual/pkgconfig
+"
+# Block due bug #383067
+RDEPEND="${CDEPEND}
+ virtual/udev
+"
+
+DOC_CONTENTS="
+ Follow the following instructions to set up Plymouth:\n
+ http://dev.gentoo.org/~aidecoe/doc/en/plymouth.xml
+"
+
+PATCHES=(
+ "${FILESDIR}/0.8.8-initrd-binaries-paths.patch"
+)
+
+src_prepare() {
+ sed -i 's:/bin/systemd-tty-ask-password-agent:/usr/bin/systemd-tty-ask-password-agent:g' \
+ systemd-units/systemd-ask-password-plymouth.service.in || die \
+ 'ask-password sed failed'
+ sed -i 's:/bin/udevadm:/usr/bin/udevadm:g' \
+ systemd-units/plymouth-start.service.in || die 'udevadm sed failed'
+ autotools-utils_src_prepare
+}
+
+src_configure() {
+ local myeconfargs=(
+ --with-system-root-install=no
+ --localstatedir=/var
+ --without-rhgb-compat-link
+ --enable-systemd-integration
+ $(use_enable debug tracing)
+ $(use_enable gtk gtk)
+ $(use_enable libkms)
+ $(use_enable pango)
+ $(use_enable gdm gdm-transition)
+ $(use_enable video_cards_intel libdrm_intel)
+ $(use_enable video_cards_radeon libdrm_radeon)
+ )
+ autotools-utils_src_configure
+}
+
+src_install() {
+ autotools-utils_src_install
+
+ insinto /usr/share/plymouth
+ newins "${DISTDIR}"/gentoo-logo.png bizcom.png
+
+ # Install compatibility symlinks as some rdeps hardcode the paths
+ dosym /usr/bin/plymouth /bin/plymouth
+ dosym /usr/sbin/plymouth-set-default-theme /sbin/plymouth-set-default-theme
+ dosym /usr/sbin/plymouthd /sbin/plymouthd
+
+ readme.gentoo_create_doc
+}
+
+pkg_postinst() {
+ readme.gentoo_print_elog
+ if ! has_version "sys-kernel/dracut[dracut_modules_plymouth]" && ! has_version "sys-kernel/genkernel-next[plymouth]"; then
+ ewarn "If you want initramfs builder with plymouth support, please emerge"
+ ewarn "sys-kernel/dracut[dracut_modules_plymouth] or sys-kernel/genkernel-next[plymouth]."
+ fi
+}
diff --git a/sys-boot/plymouth/plymouth-0.9.0.ebuild b/sys-boot/plymouth/plymouth-0.9.0.ebuild
new file mode 100644
index 000000000000..15e9c4c75e39
--- /dev/null
+++ b/sys-boot/plymouth/plymouth-0.9.0.ebuild
@@ -0,0 +1,96 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+SRC_URI="
+ http://dev.gentoo.org/~aidecoe/distfiles/${CATEGORY}/${PN}/gentoo-logo.png"
+
+if [[ ${PV} == 9999 ]]; then
+ EGIT_REPO_URI="git://anongit.freedesktop.org/plymouth"
+ AUTOTOOLS_AUTORECONF="1"
+ inherit git-r3
+else
+ SRC_URI="${SRC_URI} http://www.freedesktop.org/software/plymouth/releases/${P}.tar.bz2"
+fi
+
+inherit autotools-utils readme.gentoo systemd toolchain-funcs
+
+DESCRIPTION="Graphical boot animation (splash) and logger"
+HOMEPAGE="http://cgit.freedesktop.org/plymouth/"
+
+LICENSE="GPL-2"
+SLOT="0"
+[[ ${PV} == 9999 ]] || \
+KEYWORDS="~alpha ~amd64 ~arm ~ia64 ~ppc ~ppc64 ~sparc ~x86"
+IUSE="debug gdm +gtk +libkms +pango static-libs"
+
+CDEPEND="
+ >=media-libs/libpng-1.2.16
+ gtk? (
+ dev-libs/glib:2
+ >=x11-libs/gtk+-2.12:2
+ x11-libs/cairo )
+ libkms? ( x11-libs/libdrm[libkms] )
+ pango? ( >=x11-libs/pango-1.21 )
+"
+DEPEND="${CDEPEND}
+ virtual/pkgconfig
+"
+# Block due bug #383067
+RDEPEND="${CDEPEND}
+ virtual/udev
+ !<sys-kernel/dracut-0.37-r3
+"
+
+DOC_CONTENTS="
+ Follow the following instructions to set up Plymouth:\n
+ http://dev.gentoo.org/~aidecoe/doc/en/plymouth.xml
+"
+
+src_prepare() {
+ autotools-utils_src_prepare
+}
+
+src_configure() {
+ local myeconfargs=(
+ --with-system-root-install=no
+ --localstatedir=/var
+ --without-rhgb-compat-link
+ --enable-systemd-integration
+ $(use_enable debug tracing)
+ $(use_enable gtk gtk)
+ $(use_enable libkms drm)
+ $(use_enable pango)
+ $(use_enable gdm gdm-transition)
+ )
+ autotools-utils_src_configure
+}
+
+src_install() {
+ autotools-utils_src_install
+
+ insinto /usr/share/plymouth
+ newins "${DISTDIR}"/gentoo-logo.png bizcom.png
+
+ # Install compatibility symlinks as some rdeps hardcode the paths
+ dosym /usr/bin/plymouth /bin/plymouth
+ dosym /usr/sbin/plymouth-set-default-theme /sbin/plymouth-set-default-theme
+ dosym /usr/sbin/plymouthd /sbin/plymouthd
+
+ readme.gentoo_create_doc
+
+ # looks like make install create /var/run/plymouth
+ # this is not needed for systemd, same should hold for openrc
+ # so remove
+ rm -rf "${D}"/var/run
+}
+
+pkg_postinst() {
+ readme.gentoo_print_elog
+ if ! has_version "sys-kernel/dracut" && ! has_version "sys-kernel/genkernel-next[plymouth]"; then
+ ewarn "If you want initramfs builder with plymouth support, please emerge"
+ ewarn "sys-kernel/dracut or sys-kernel/genkernel-next[plymouth]."
+ fi
+}
diff --git a/sys-boot/plymouth/plymouth-0.9.2.ebuild b/sys-boot/plymouth/plymouth-0.9.2.ebuild
new file mode 100644
index 000000000000..13c752eb3868
--- /dev/null
+++ b/sys-boot/plymouth/plymouth-0.9.2.ebuild
@@ -0,0 +1,101 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+SRC_URI="
+ http://dev.gentoo.org/~aidecoe/distfiles/${CATEGORY}/${PN}/gentoo-logo.png"
+
+AUTOTOOLS_AUTORECONF="1"
+if [[ ${PV} == 9999 ]]; then
+ EGIT_REPO_URI="git://anongit.freedesktop.org/plymouth"
+ inherit git-r3
+else
+ SRC_URI="${SRC_URI} http://www.freedesktop.org/software/plymouth/releases/${P}.tar.bz2"
+fi
+
+inherit autotools-utils readme.gentoo systemd toolchain-funcs
+
+DESCRIPTION="Graphical boot animation (splash) and logger"
+HOMEPAGE="http://cgit.freedesktop.org/plymouth/"
+
+LICENSE="GPL-2"
+SLOT="0"
+[[ ${PV} == 9999 ]] || \
+KEYWORDS="~alpha ~amd64 ~arm ~ia64 ~ppc ~ppc64 ~sparc ~x86"
+IUSE="debug gdm +gtk +libkms +pango static-libs"
+
+CDEPEND="
+ >=media-libs/libpng-1.2.16:=
+ gtk? (
+ dev-libs/glib:2
+ >=x11-libs/gtk+-3.14:3
+ x11-libs/cairo )
+ libkms? ( x11-libs/libdrm[libkms] )
+ pango? ( >=x11-libs/pango-1.21 )
+"
+DEPEND="${CDEPEND}
+ virtual/pkgconfig
+"
+# Block due bug #383067
+RDEPEND="${CDEPEND}
+ virtual/udev
+ !<sys-kernel/dracut-0.37-r3
+"
+
+DOC_CONTENTS="
+ Follow the following instructions to set up Plymouth:\n
+ http://dev.gentoo.org/~aidecoe/doc/en/plymouth.xml
+"
+
+PATCHES=(
+ "${FILESDIR}/0.9.2-systemdsystemunitdir.patch"
+)
+
+src_prepare() {
+ autotools-utils_src_prepare
+}
+
+src_configure() {
+ local myeconfargs=(
+ --with-system-root-install=no
+ --localstatedir=/var
+ --without-rhgb-compat-link
+ --enable-systemd-integration
+ "$(systemd_with_unitdir)"
+ $(use_enable debug tracing)
+ $(use_enable gtk gtk)
+ $(use_enable libkms drm)
+ $(use_enable pango)
+ $(use_enable gdm gdm-transition)
+ )
+ autotools-utils_src_configure
+}
+
+src_install() {
+ autotools-utils_src_install
+
+ insinto /usr/share/plymouth
+ newins "${DISTDIR}"/gentoo-logo.png bizcom.png
+
+ # Install compatibility symlinks as some rdeps hardcode the paths
+ dosym /usr/bin/plymouth /bin/plymouth
+ dosym /usr/sbin/plymouth-set-default-theme /sbin/plymouth-set-default-theme
+ dosym /usr/sbin/plymouthd /sbin/plymouthd
+
+ readme.gentoo_create_doc
+
+ # looks like make install create /var/run/plymouth
+ # this is not needed for systemd, same should hold for openrc
+ # so remove
+ rm -rf "${D}"/var/run
+}
+
+pkg_postinst() {
+ readme.gentoo_print_elog
+ if ! has_version "sys-kernel/dracut" && ! has_version "sys-kernel/genkernel-next[plymouth]"; then
+ ewarn "If you want initramfs builder with plymouth support, please emerge"
+ ewarn "sys-kernel/dracut or sys-kernel/genkernel-next[plymouth]."
+ fi
+}
diff --git a/sys-boot/plymouth/plymouth-9999.ebuild b/sys-boot/plymouth/plymouth-9999.ebuild
new file mode 100644
index 000000000000..a463065cb01f
--- /dev/null
+++ b/sys-boot/plymouth/plymouth-9999.ebuild
@@ -0,0 +1,97 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+SRC_URI="
+ http://dev.gentoo.org/~aidecoe/distfiles/${CATEGORY}/${PN}/gentoo-logo.png"
+
+if [[ ${PV} == 9999 ]]; then
+ EGIT_REPO_URI="git://anongit.freedesktop.org/plymouth"
+ AUTOTOOLS_AUTORECONF="1"
+ inherit git-r3
+else
+ SRC_URI="${SRC_URI} http://www.freedesktop.org/software/plymouth/releases/${P}.tar.bz2"
+fi
+
+inherit autotools-utils readme.gentoo systemd toolchain-funcs
+
+DESCRIPTION="Graphical boot animation (splash) and logger"
+HOMEPAGE="http://cgit.freedesktop.org/plymouth/"
+
+LICENSE="GPL-2"
+SLOT="0"
+[[ ${PV} == 9999 ]] || \
+KEYWORDS="~alpha ~amd64 ~arm ~ia64 ~ppc ~ppc64 ~sparc ~x86"
+IUSE="debug gdm +gtk +libkms +pango static-libs"
+
+CDEPEND="
+ >=media-libs/libpng-1.2.16:=
+ gtk? (
+ dev-libs/glib:2
+ >=x11-libs/gtk+-3.14:3
+ x11-libs/cairo )
+ libkms? ( x11-libs/libdrm[libkms] )
+ pango? ( >=x11-libs/pango-1.21 )
+"
+DEPEND="${CDEPEND}
+ virtual/pkgconfig
+"
+# Block due bug #383067
+RDEPEND="${CDEPEND}
+ virtual/udev
+ !<sys-kernel/dracut-0.37-r3
+"
+
+DOC_CONTENTS="
+ Follow the following instructions to set up Plymouth:\n
+ http://dev.gentoo.org/~aidecoe/doc/en/plymouth.xml
+"
+
+src_prepare() {
+ autotools-utils_src_prepare
+}
+
+src_configure() {
+ local myeconfargs=(
+ --with-system-root-install=no
+ --localstatedir=/var
+ --without-rhgb-compat-link
+ --enable-systemd-integration
+ "$(systemd_with_unitdir)"
+ $(use_enable debug tracing)
+ $(use_enable gtk gtk)
+ $(use_enable libkms drm)
+ $(use_enable pango)
+ $(use_enable gdm gdm-transition)
+ )
+ autotools-utils_src_configure
+}
+
+src_install() {
+ autotools-utils_src_install
+
+ insinto /usr/share/plymouth
+ newins "${DISTDIR}"/gentoo-logo.png bizcom.png
+
+ # Install compatibility symlinks as some rdeps hardcode the paths
+ dosym /usr/bin/plymouth /bin/plymouth
+ dosym /usr/sbin/plymouth-set-default-theme /sbin/plymouth-set-default-theme
+ dosym /usr/sbin/plymouthd /sbin/plymouthd
+
+ readme.gentoo_create_doc
+
+ # looks like make install create /var/run/plymouth
+ # this is not needed for systemd, same should hold for openrc
+ # so remove
+ rm -rf "${D}"/var/run
+}
+
+pkg_postinst() {
+ readme.gentoo_print_elog
+ if ! has_version "sys-kernel/dracut" && ! has_version "sys-kernel/genkernel-next[plymouth]"; then
+ ewarn "If you want initramfs builder with plymouth support, please emerge"
+ ewarn "sys-kernel/dracut or sys-kernel/genkernel-next[plymouth]."
+ fi
+}
diff --git a/sys-boot/psoload/Manifest b/sys-boot/psoload/Manifest
new file mode 100644
index 000000000000..5bc9f5a47d22
--- /dev/null
+++ b/sys-boot/psoload/Manifest
@@ -0,0 +1 @@
+DIST PSOloadV2.0_Linux.zip 384266 RMD160 79184b586d8bd287c5f5ed0fe5b653931457e171 SHA1 cd72821c8fcf824fb908c1ead7ececd7d2970d3d SHA256 11037f249df41bb5548500cb0d2fae7fc5163b0f5065064fcd71709d8b5602bb
diff --git a/sys-boot/psoload/metadata.xml b/sys-boot/psoload/metadata.xml
new file mode 100644
index 000000000000..a40624fba8f0
--- /dev/null
+++ b/sys-boot/psoload/metadata.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<maintainer>
+ <email>maintainer-needed@gentoo.org</email>
+</maintainer>
+</pkgmetadata>
diff --git a/sys-boot/psoload/psoload-2.0.ebuild b/sys-boot/psoload/psoload-2.0.ebuild
new file mode 100644
index 000000000000..6c294dd6eec9
--- /dev/null
+++ b/sys-boot/psoload/psoload-2.0.ebuild
@@ -0,0 +1,26 @@
+# Copyright 1999-2009 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+QA_PRESTRIPPED="/opt/bin/psoload2
+ /opt/bin/psoload2_static"
+
+DESCRIPTION="Load home brewed code onto the GameCube with Phantasy Star Online"
+HOMEPAGE="http://www.gc-linux.org/"
+SRC_URI="http://www.gcdev.com/download/PSOloadV${PV}_Linux.zip"
+
+LICENSE="freedist"
+SLOT="0"
+KEYWORDS="-* x86"
+IUSE=""
+
+DEPEND="app-arch/unzip"
+RDEPEND=""
+
+S=${WORKDIR}
+
+src_install() {
+ into /opt
+ dobin psoload2 psoload2_static || die "dobin"
+ dodoc *.txt testdemo4.dol crt0.s
+}
diff --git a/sys-boot/quik/Manifest b/sys-boot/quik/Manifest
new file mode 100644
index 000000000000..aa65d11d1186
--- /dev/null
+++ b/sys-boot/quik/Manifest
@@ -0,0 +1 @@
+DIST quik-2.1-6.ydl4.src.rpm 91961 RMD160 9f9c44fb7afc806de9700d75797bd19bb59a050f SHA1 0b6088469b93fb2a67a238b2c38f61ee5d166e87 SHA256 a4c8c95fa97ef0e01e7ca981442c8dc8761f79c9bc4c683bfde03378a8ee9db2
diff --git a/sys-boot/quik/files/headers.patch b/sys-boot/quik/files/headers.patch
new file mode 100644
index 000000000000..eccfba698e17
--- /dev/null
+++ b/sys-boot/quik/files/headers.patch
@@ -0,0 +1,33 @@
+--- util/elfextract.c.bak 2006-12-04 23:08:33.000000000 -0500
++++ util/elfextract.c 2006-12-04 23:08:45.000000000 -0500
+@@ -6,7 +6,7 @@
+ #include <stdio.h>
+ #include <stdlib.h>
+ #define __KERNEL__
+-#include <linux/elf.h>
++#include <elf.h>
+
+ FILE *fi, *fo;
+ char *ni, *no;
+--- second/quik.h.bak 2006-12-04 23:10:08.000000000 -0500
++++ second/quik.h 2006-12-04 23:10:12.000000000 -0500
+@@ -26,7 +26,7 @@
+ int tolower(int c);
+ int stricmp(const char *s1, const char *s2);
+ int strncmp(const char * cs,const char * ct,size_t count);
+-int strlen(const char *s1);
++// int strlen(const char *s1);
+ char *strcpy(char * dest,const char *src);
+ char *strncpy(char * dest,const char *src,size_t count);
+ char *strchr(const char * s, int c);
+--- second/misc.c.bak 2010-02-09 22:18:47.000000000 -0500
++++ second/misc.c 2010-02-09 22:18:52.000000000 -0500
+@@ -11,7 +11,7 @@
+ */
+ #include <linux/kernel.h>
+
+-#include <asm/page.h>
++// #include <asm/page.h>
+
+ #include <sys/types.h>
+ #include "setjmp.h"
diff --git a/sys-boot/quik/files/md-fix.diff b/sys-boot/quik/files/md-fix.diff
new file mode 100644
index 000000000000..2319397d93f1
--- /dev/null
+++ b/sys-boot/quik/files/md-fix.diff
@@ -0,0 +1,11 @@
+--- include/quik_md.h.bak 2005-05-27 00:42:36.000000000 +1000
++++ include/quik_md.h 2005-05-27 00:42:43.000000000 +1000
+@@ -88,8 +88,6 @@
+ #define BOOTDEV(dev,i) ((dev)->devs[(i)]->bootdev)
+ #define SPART(dev,i) ((dev)->devs[(i)]->spart)
+
+-dev_info_t * new_dev_info (unsigned char);
+-void free_dev_info (dev_info_t *);
+ int md_get_version (int);
+ mdev_info_t * md_get_info (const char *);
+
diff --git a/sys-boot/quik/metadata.xml b/sys-boot/quik/metadata.xml
new file mode 100644
index 000000000000..034c09eb248a
--- /dev/null
+++ b/sys-boot/quik/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>ppc</herd>
+</pkgmetadata>
diff --git a/sys-boot/quik/quik-2.1.6.ebuild b/sys-boot/quik/quik-2.1.6.ebuild
new file mode 100644
index 000000000000..41566ab12651
--- /dev/null
+++ b/sys-boot/quik/quik-2.1.6.ebuild
@@ -0,0 +1,44 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+inherit toolchain-funcs mount-boot eutils
+
+MY_PV=${PV%.*}-${PV#*.*.}
+
+HOMEPAGE="http://penguinppc.org/bootloaders/quik/"
+DESCRIPTION="OldWorld PowerMac Bootloader"
+SRC_URI="http://www.shiner.info/files/Yellow%20Dog%20Linux%204/quik/quik-${MY_PV}.ydl4.src.rpm"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="-* ppc"
+IUSE=""
+
+DEPEND="app-arch/rpm2targz"
+RDEPEND=""
+
+S=${WORKDIR}
+
+src_unpack() {
+ cd "${WORKDIR}"
+ rpm2targz "${DISTDIR}/quik-${MY_PV}.ydl4.src.rpm"
+ tar -xzf "${WORKDIR}/quik-${MY_PV}.ydl4.src.tar.gz" || die
+ tar -xzf "${WORKDIR}/quik_2.1.orig.tar.gz" || die
+
+ cd "${WORKDIR}/quik-2.1"
+ epatch "${WORKDIR}/quik_2.1-6.diff.gz"
+ epatch "${FILESDIR}/md-fix.diff"
+ epatch "${FILESDIR}/headers.patch"
+}
+
+src_compile() {
+ cd "${WORKDIR}/quik-2.1"
+ emake || die
+}
+
+src_install() {
+ cd "${WORKDIR}/quik-2.1"
+ DESTDIR=${D} make install
+ prepman /usr
+}
diff --git a/sys-boot/raincoat/Manifest b/sys-boot/raincoat/Manifest
new file mode 100644
index 000000000000..cf114ac4cc3d
--- /dev/null
+++ b/sys-boot/raincoat/Manifest
@@ -0,0 +1,2 @@
+DIST raincoat-0.11.tbz2 240759 SHA256 3d0b2ae95880ea7053b58a9852381ef81b7d0839153e9a164e78531b22cc24bc
+DIST raincoat-0.5+.tar.gz 220761 SHA256 b7a357204b482021282f7ea05a9413162491ae240d4bb932ff249a8604ec57bc
diff --git a/sys-boot/raincoat/files/raincoat-0.11-build.patch b/sys-boot/raincoat/files/raincoat-0.11-build.patch
new file mode 100644
index 000000000000..a83e73dd523f
--- /dev/null
+++ b/sys-boot/raincoat/files/raincoat-0.11-build.patch
@@ -0,0 +1,13 @@
+diff --git a/Makefile b/Makefile
+index 96f8662..db2b78c 100755
+--- a/Makefile
++++ b/Makefile
+@@ -2,7 +2,7 @@ all: raincoat
+
+ raincoat: src/raincoat.c src/BootFlash.c src/boot.h src/BootFlash.h
+ mkdir -p bin
+- gcc -static -O2 -Wall -Werror -o ./bin/raincoat src/raincoat.c src/BootFlash.c
++ $(CC) -static $(CFLAGS) $(CPPFLAGS) -Wall -o ./bin/raincoat src/raincoat.c src/BootFlash.c $(LDFLAGS)
+
+ clean:
+ rm -f src/*.o
diff --git a/sys-boot/raincoat/metadata.xml b/sys-boot/raincoat/metadata.xml
new file mode 100644
index 000000000000..c2b9aa28ca4f
--- /dev/null
+++ b/sys-boot/raincoat/metadata.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>xbox</herd>
+ <longdescription>Flash the Xbox boot chip</longdescription>
+</pkgmetadata>
diff --git a/sys-boot/raincoat/raincoat-0.11.ebuild b/sys-boot/raincoat/raincoat-0.11.ebuild
new file mode 100644
index 000000000000..d5128782f353
--- /dev/null
+++ b/sys-boot/raincoat/raincoat-0.11.ebuild
@@ -0,0 +1,26 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+inherit eutils
+
+DESCRIPTION="Flash the Xbox boot chip"
+HOMEPAGE="http://www.xbox-linux.org/"
+SRC_URI="mirror://sourceforge/xbox-linux/${P}.tbz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="x86"
+IUSE=""
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+ epatch "${FILESDIR}"/${P}-build.patch
+}
+
+src_install() {
+ dodir /etc /usr/bin
+ emake install DESTDIR="${D}" || die
+ dodoc docs/README
+}
diff --git a/sys-boot/raincoat/raincoat-0.5.ebuild b/sys-boot/raincoat/raincoat-0.5.ebuild
new file mode 100644
index 000000000000..e3ee3b764519
--- /dev/null
+++ b/sys-boot/raincoat/raincoat-0.5.ebuild
@@ -0,0 +1,26 @@
+# Copyright 1999-2004 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+DESCRIPTION="Flash the Xbox boot chip"
+HOMEPAGE="http://www.xbox-linux.org/"
+SRC_URI="http://xbox-linux.org/down/raincoat-0.5+.tar.gz"
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="x86"
+IUSE=""
+DEPEND=""
+
+S=${WORKDIR}/${PN}
+
+src_compile() {
+ emake || die
+}
+
+src_install() {
+ dodir /etc
+ insinto /etc
+ doins raincoat.conf
+ dobin raincoat || die
+ dodoc README
+}
diff --git a/sys-boot/raspberrypi-firmware/Manifest b/sys-boot/raspberrypi-firmware/Manifest
new file mode 100644
index 000000000000..5bf58c4f92a4
--- /dev/null
+++ b/sys-boot/raspberrypi-firmware/Manifest
@@ -0,0 +1,28 @@
+DIST raspberrypi-firmware-128fa52bbc-bootcode.bin 17816 SHA256 f89d19c5287e566320ecd7e1d70d649f308a1b9d05a29d88a0768c3ba7a2bd14 SHA512 5332b2554cbdd3abb32f52506b851f7b3dc2c76a6f9040ec8ad946f6d9faf479e502dda11070aba7706d83e1c3839ff92ca8fbf8e79b972f91814dedbe19ea48 WHIRLPOOL 24e179152e392fc303e92cdfb8b4ef64e323736854bc826ddd0132a5652c9aa441027791781ff7f16fa7fb761485629977bd0882561b008fb66d4503be171e05
+DIST raspberrypi-firmware-128fa52bbc-fixup.dat 5890 SHA256 f49cf9395c034f9e53049dc47fb109dc8e4bba2ec70d754335fc12cd31618a93 SHA512 9037ac2a5becf1d51ee6e35899c0a3687cf0cd0e29818a129cf38d0ef4d488405dab6f99e0929fe2c1a6949aad7d42531df0dff7e2ce3a175ea241b74b9454b7 WHIRLPOOL be3eb0291644dabdc35393e4b5b5977eae8eb94caae966d0c345e663468872bf865fde5c25e4a88a9ce0e91c3b226c50e461ee20eecde61996029065719cc69f
+DIST raspberrypi-firmware-128fa52bbc-fixup_cd.dat 2032 SHA256 dfc0a24dcf746b8b328184245fc50fc819d2933694a10723597881c6dc29e239 SHA512 dfb9d77ac7bdc1868cfc2dbabdf138c6f24ee671d7d147a66b1f2192fac7abd7c5589a7b051c92c47513ee01f6452eee0c862336cfbaf6c441801fc223d233ca WHIRLPOOL 327561b3b852afbc956e5a963773951b23b5dce147cd775b5662f68a358a869b23e1c0edeafe5c5dfb912144625885d774fc8953adc71350aa909acb86327c5d
+DIST raspberrypi-firmware-128fa52bbc-fixup_x.dat 8840 SHA256 6d6bd941afbbe749868ee20eb6603289d7636dd7425a267a075ec053582e5c5b SHA512 5e1d983a90a31c93c7e6ebda733ac18ebf0a6368599f510b71025e7de0bb88aa1b1b90c4ab989011abfccaaad433ab9c032bd1126c7ee1c4b8c8644c3a69014c WHIRLPOOL bf200500f8eba4ae0ad990c8b624e46b19f7dc2f0e93045e2cf463d8cfd8c3ffbc7735f152f5e17186c5be6f508efc9bc4e7ee74f5a21a06eab88ddf2bae7d35
+DIST raspberrypi-firmware-128fa52bbc-start.elf 2690772 SHA256 baa329d7bf465050c3ba59a69b854954e673fb644508870343183a9a22460a13 SHA512 e19ccc57481653a54481b0064bc7a9e52e85ccbedd55e3a5249210af9b9bcd418fe5143c1a95c5431a1c443794a92ae22c7e5d4de68e13578528e94bfb6e8f09 WHIRLPOOL fdce4af4af8f1312cf298d62181a2b0cd2ee4ffe86f0f5c12eb5e1c207e8018ccb60c7a1be2a196fe26c9a358cc46186fbfb631984a52b9c950963b80e83fa41
+DIST raspberrypi-firmware-128fa52bbc-start_cd.elf 469240 SHA256 fcb6783d4b3b39f5ffd1b103e5273db43d86d09220d2c266476db62bf8283824 SHA512 f5222c8fa05fd7e72cb751f45170b1a92297180f3239c0d3ef20b1d5d1688152dbd80ade6e410a3234d8c680cb822eb439f78bc52066bbaf03e1dba4c8fbf0cd WHIRLPOOL bcb0a76d880ca46059658d3d1313a1bd5c86a80f7c4d613f6d376efbde0f1260c880a5c13786a13565a320a8275cf3414df7e7260b69fa091568f9e40c98b9ce
+DIST raspberrypi-firmware-128fa52bbc-start_x.elf 3658180 SHA256 0b07a170ff2b7618c1bb1e7edcc2b5ecd160d8a41dcbb43e052148fbea5cff1c SHA512 a82ac10583fcdf6f43a300ee5f05b6b614f96493949820b8b89c428cb02ed91bd35ae3fd5e6e360ef97b5dd6d248dd3c76de433c746ef3dd378d84eb725cfa0e WHIRLPOOL 1d84c05cbbb3306b2f32b0c67235b2a91038139f81c22238d6eea4b40ae89acaa3c41ef3001d54a673406a4568a6455f68d44982d8e903d17132a2b75d6ec135
+DIST raspberrypi-firmware-89ac8f4661-bootcode.bin 17816 SHA256 f89d19c5287e566320ecd7e1d70d649f308a1b9d05a29d88a0768c3ba7a2bd14 SHA512 5332b2554cbdd3abb32f52506b851f7b3dc2c76a6f9040ec8ad946f6d9faf479e502dda11070aba7706d83e1c3839ff92ca8fbf8e79b972f91814dedbe19ea48 WHIRLPOOL 24e179152e392fc303e92cdfb8b4ef64e323736854bc826ddd0132a5652c9aa441027791781ff7f16fa7fb761485629977bd0882561b008fb66d4503be171e05
+DIST raspberrypi-firmware-89ac8f4661-fixup.dat 5886 SHA256 fbdfaa3ecd4c40ea2fe7b5d2c615bcd877bfbec44348231546c819c3c812382d SHA512 530581b4408897bb8766ea1dbd6b9dd84449b65c59eca1e3335b820a0ecc2e0fa483f0c8c005bdf07da23f593ec9e54c879747ad46159abd73f0a5dc3ba2fee3 WHIRLPOOL 2963854b08b745102e89bee86a1ddd6f8323f4c09945d8124751b740f4ec7db57bbdfae492b5eaf2f161b8794a2448d27a97a6d83eb7e493d58ffe7ce9bde157
+DIST raspberrypi-firmware-89ac8f4661-fixup_cd.dat 2032 SHA256 dfc0a24dcf746b8b328184245fc50fc819d2933694a10723597881c6dc29e239 SHA512 dfb9d77ac7bdc1868cfc2dbabdf138c6f24ee671d7d147a66b1f2192fac7abd7c5589a7b051c92c47513ee01f6452eee0c862336cfbaf6c441801fc223d233ca WHIRLPOOL 327561b3b852afbc956e5a963773951b23b5dce147cd775b5662f68a358a869b23e1c0edeafe5c5dfb912144625885d774fc8953adc71350aa909acb86327c5d
+DIST raspberrypi-firmware-89ac8f4661-fixup_x.dat 8840 SHA256 08b925a7736b078e0c85601a0dbba7519de8f1b158c8c35383048bcbb97be233 SHA512 9056da89cdb9c1ebe1a4ad075345a336353eb0de12c93f21b141888332cbaa2e3ee17bf0ada7d0d83fa5152391f39c422704a347edc48635260ce7de4933ad71 WHIRLPOOL e50a1a2015e7bc34cbf4400dea8cf2ec0869b874857d07e5d24396f800b76b02146f6cac62d6a0ada4fe8c726e9f2f08c9964aa460570d0e7ae38773f31ea532
+DIST raspberrypi-firmware-89ac8f4661-start.elf 2690740 SHA256 c7720243212c2ac3196c3ab3b3e93de85c5e18fcafd486b08cf88d96e100e2a7 SHA512 49f6753cc4f5fa7817698e22a2074424a762cd1b5660490547e80269f700fdf8c27dc5e05dab4975c5af7d683ccebaf531443303666384903c73c7bbe2f27672 WHIRLPOOL fe2640000a2f013d9b54d3e95e03bb534f40c546207dbd3b712e07d4988998d253a8262ccaccceaf3de4f425a31759c811f71f06e2a8ae02b164d05ca534bf63
+DIST raspberrypi-firmware-89ac8f4661-start_cd.elf 469240 SHA256 0f39571eb6b8b3062c50b26b03a040a0bd712421cfd2ed099cf979c2bb5dd749 SHA512 39957c205ed1f59a806f32888baf9e17d3db4d7b55fd0cae88280df111a4aee39e2d8688e689942d5cc273f25973e4109ef7314832abfd030b5d67481f0492e6 WHIRLPOOL b2ceb05277a23a6931ebf66d5787b717c2ab8be6bfa7cd1d6ba96008b4ca59a7481f13bbc6db39c2e0f6b141ade27ba71a11d9c6589445f391b8c9555c933220
+DIST raspberrypi-firmware-89ac8f4661-start_x.elf 3658180 SHA256 450ff0b13a8c232a8ddfccccfef9ddbf0093dbea0c0248a21d807e6640b88c47 SHA512 2499fa76249b2c7ffc8746479563be460d5f6dc3d484e3de8c7c4c7eeee5cd6aef1ab06d3eb726b1121ae39ca2e4ef0a99777064d5e9b9c4d10a914c41cfedc6 WHIRLPOOL 3f7e9c1c056440172092cb83d95e6ada19a39b4dcbf37dbe3fd2caade758f080411da559bba8412ce74547b787b936a28aea21a782f49eeebdb489e25bc67bdd
+DIST raspberrypi-firmware-b2dbc04508-bootcode.bin 17816 SHA256 f89d19c5287e566320ecd7e1d70d649f308a1b9d05a29d88a0768c3ba7a2bd14 SHA512 5332b2554cbdd3abb32f52506b851f7b3dc2c76a6f9040ec8ad946f6d9faf479e502dda11070aba7706d83e1c3839ff92ca8fbf8e79b972f91814dedbe19ea48 WHIRLPOOL 24e179152e392fc303e92cdfb8b4ef64e323736854bc826ddd0132a5652c9aa441027791781ff7f16fa7fb761485629977bd0882561b008fb66d4503be171e05
+DIST raspberrypi-firmware-b2dbc04508-fixup.dat 5742 SHA256 98b57d8c03426e31d60a3cfb2e2f7c3388978ab1d5591e97f9b8c05c42d44634 SHA512 f701fce3db35bfcd204ca7130aa0db1a77a5c83815409ac0b85f1a57e495aea6cbdf81db985436b33b8862545a271743ea2edefd3b7c9ac0a5e5e30bafd206f3 WHIRLPOOL 7ec85f32fa966ba70fc4c2973588b94c4b48baf9bf0916f71b71171445c2defeebd19cd79f35369fc87c69c58e10fd927de553dc02c8fcf0baf8cc0a2fd9125c
+DIST raspberrypi-firmware-b2dbc04508-fixup_cd.dat 2032 SHA256 98af02d14bc617af5d44be8c3e4d059e150b6de968dbff86a79cfa25eeaa2b57 SHA512 c6b8b6fb7bc99f77c3aee5d51e1e07a5f9c4119d2ec64ade335315c0c28a2f6d310463a48b0becb424198d3771dc079fda1c15bb03b18c125bfb1b32f5c9867f WHIRLPOOL 11b35f02cf50bc33b3a7d77066c7194ca0fa51b4d912e489ecc3097f300ab2604f404e7e18f29045236cb5df8d0e81fe466f991116c6df5bd58a77610a964cf5
+DIST raspberrypi-firmware-b2dbc04508-fixup_x.dat 8693 SHA256 ace173aa32d389e49ff3f7b8bb94712ed175b390b6bc2b083adff2fabc119457 SHA512 ea407fd4b6422a7c932e118260cebd4c578a15bbbbea07e76bf1175b9bf9776e006172997d085e50a2a2a28965afd036a66450b1f0b17fcda741f9f02673c20f WHIRLPOOL 6fc13c0b98455d3601463dcfd8635ce63b5845e86847d8c42d19a9453ff34fcae1e0b5a1144d6152687b01910989c7f1528099924eceef6cfa2a55e48e7a2b34
+DIST raspberrypi-firmware-b2dbc04508-start.elf 2494932 SHA256 a83ac7c267fa9dc057bed1c04f7da973ee37c1471b669fd37e5a2edc4bafa9a3 SHA512 bc1f5590de691b10bd375bc20acfe18a8658e4109736af4280ef7a3331024b61162330d8d687aca7da78bdb160beefd8bc38c90791e3e320282b8e98e091f670 WHIRLPOOL 0e825e21491cfdb2099c2c9ba6e4858083a9d749a49b3a91fe0a31cf6ec9877958899f8c41f74f2d745b7264ffd2506f13ea894d45515d968b6bc0f3e118a339
+DIST raspberrypi-firmware-b2dbc04508-start_cd.elf 469560 SHA256 1f05ae4ab2446cee6aae264b55a37e9e9ca0ed116fbb88214680397d1d50885e SHA512 bbd4b519ef6f830db7efdbb62f7f308a6092b9e99279fea96307771da08bf12898c664165d6dbd556799162728a479c1d0e1f8fd67ef2c2a7c731354dbea9d99 WHIRLPOOL 9bf67424f34db9bf35c08a7a550ce0a554180210cdfdda53d30260a27b342f828a1e67a00b501af8a86cfedf5533b263122fbe0277d0bcbab22f9ce7389038e0
+DIST raspberrypi-firmware-b2dbc04508-start_x.elf 3462244 SHA256 f4d1636e6ccd4274256b496ad30e95681e0ad7ee790cd83fd90ac3dcfb569b23 SHA512 4efb07958838d339b5635465e890cc433d734a47a5ec2d3e8b512755decc4fbffdd6b68f14c09b63284215f6b9d7716c222d77f18de0c783daa895e208796d2d WHIRLPOOL 5e4db8cdd288ed56a0d9eb4afc1c311f745f1db9d9b71cbd3b85da803953f5847d041e6287a9c2c34cfd45efc7a765182beb1234040132b1add29037355a8bde
+DIST raspberrypi-firmware-e0590d6dda-bootcode.bin 17816 SHA256 f89d19c5287e566320ecd7e1d70d649f308a1b9d05a29d88a0768c3ba7a2bd14 SHA512 5332b2554cbdd3abb32f52506b851f7b3dc2c76a6f9040ec8ad946f6d9faf479e502dda11070aba7706d83e1c3839ff92ca8fbf8e79b972f91814dedbe19ea48 WHIRLPOOL 24e179152e392fc303e92cdfb8b4ef64e323736854bc826ddd0132a5652c9aa441027791781ff7f16fa7fb761485629977bd0882561b008fb66d4503be171e05
+DIST raspberrypi-firmware-e0590d6dda-fixup.dat 5742 SHA256 98b57d8c03426e31d60a3cfb2e2f7c3388978ab1d5591e97f9b8c05c42d44634 SHA512 f701fce3db35bfcd204ca7130aa0db1a77a5c83815409ac0b85f1a57e495aea6cbdf81db985436b33b8862545a271743ea2edefd3b7c9ac0a5e5e30bafd206f3 WHIRLPOOL 7ec85f32fa966ba70fc4c2973588b94c4b48baf9bf0916f71b71171445c2defeebd19cd79f35369fc87c69c58e10fd927de553dc02c8fcf0baf8cc0a2fd9125c
+DIST raspberrypi-firmware-e0590d6dda-fixup_cd.dat 2032 SHA256 98af02d14bc617af5d44be8c3e4d059e150b6de968dbff86a79cfa25eeaa2b57 SHA512 c6b8b6fb7bc99f77c3aee5d51e1e07a5f9c4119d2ec64ade335315c0c28a2f6d310463a48b0becb424198d3771dc079fda1c15bb03b18c125bfb1b32f5c9867f WHIRLPOOL 11b35f02cf50bc33b3a7d77066c7194ca0fa51b4d912e489ecc3097f300ab2604f404e7e18f29045236cb5df8d0e81fe466f991116c6df5bd58a77610a964cf5
+DIST raspberrypi-firmware-e0590d6dda-fixup_x.dat 8693 SHA256 ace173aa32d389e49ff3f7b8bb94712ed175b390b6bc2b083adff2fabc119457 SHA512 ea407fd4b6422a7c932e118260cebd4c578a15bbbbea07e76bf1175b9bf9776e006172997d085e50a2a2a28965afd036a66450b1f0b17fcda741f9f02673c20f WHIRLPOOL 6fc13c0b98455d3601463dcfd8635ce63b5845e86847d8c42d19a9453ff34fcae1e0b5a1144d6152687b01910989c7f1528099924eceef6cfa2a55e48e7a2b34
+DIST raspberrypi-firmware-e0590d6dda-start.elf 2494932 SHA256 775e71dc2cbaeda0ec4c2808aa067a8a9399d981c402658626a9652035c12907 SHA512 94770089103cf19f20633e1a6fe821c416ade90f7522731855506f64e70ecf65b94a1a4c6777bdbe0ec78825ecb5163c54bc170b6b5ffd8aa89add43eef67929 WHIRLPOOL d18d5fa00a1a7c69245a11e5232c9e4d9bb058055f9b3098b1e0dc72046a26509c6870b5bf78447f506e7e305480fa89d5cccedb9c3f655fe3ffca34cc6ee938
+DIST raspberrypi-firmware-e0590d6dda-start_cd.elf 469560 SHA256 8cde5095b5ecfb0d9c82841dfc86fa07721ac3d0942f6fc6a3fe76273ea5b035 SHA512 d273c281415910cb279bebdbaeb88ecfb48d5601fa397a9dbe52176a0693cb264f48e4a17407f92c39bfedace184db11f6cdacf98f615aeec90373b2a39e53b1 WHIRLPOOL 96238b527d32d838e362ab6c6e6926bbaa3c263089d6e2e87be1958c2df441bb7001e77567c4d5517d2b7730b5ca960bab0bac9652f5da60db99c3b3a9745306
+DIST raspberrypi-firmware-e0590d6dda-start_x.elf 3462244 SHA256 280a9a87a674ec689585decc7ae73166cd798cdf85bf95d0c06f42b8616d5452 SHA512 4c24b7dcc7b7c6d7a17d00c4b56676493c6cf8d814b8ef716a91c8e73c69f0132f927771e8e17ef259b99b2f32a33e0387a6fd26e2e6f20bfaa699d167c8961b WHIRLPOOL f26bb41d888e3aa20a557a4e8612a0375ae4b8d683fa9280e3ff02b94ed6a76ca4acd0956c6ee89352cb54e997158335b32738f9e30925343677b127fb02bb64
diff --git a/sys-boot/raspberrypi-firmware/files/raspberrypi-firmware-0_p20130711-cmdline.txt b/sys-boot/raspberrypi-firmware/files/raspberrypi-firmware-0_p20130711-cmdline.txt
new file mode 100644
index 000000000000..39112a2dba61
--- /dev/null
+++ b/sys-boot/raspberrypi-firmware/files/raspberrypi-firmware-0_p20130711-cmdline.txt
@@ -0,0 +1 @@
+ipv6.disable=0 selinux=0 plymouth.enable=0 smsc95xx.turbo_mode=N dwc_otg.lpm_enable=0 console=ttyAMA0,115200 kgdboc=ttyAMA0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=noop rootwait
diff --git a/sys-boot/raspberrypi-firmware/files/raspberrypi-firmware-0_p20130711-config.txt b/sys-boot/raspberrypi-firmware/files/raspberrypi-firmware-0_p20130711-config.txt
new file mode 100644
index 000000000000..9401530925de
--- /dev/null
+++ b/sys-boot/raspberrypi-firmware/files/raspberrypi-firmware-0_p20130711-config.txt
@@ -0,0 +1,81 @@
+#from archlinux arm sdcard image
+# uncomment if you get no picture on HDMI for a default "safe" mode
+#hdmi_safe=1
+
+# uncomment this if your display has a black border of unused pixels visible
+# and your display can output without overscan
+#disable_overscan=1
+
+# uncomment the following to adjust overscan. Use positive numbers if console
+# goes off screen, and negative if there is too much border
+#overscan_left=16
+#overscan_right=16
+#overscan_top=16
+#overscan_bottom=16
+
+# uncomment to force a console size. By default it will be display's size minus
+# overscan.
+#framebuffer_width=1280
+#framebuffer_height=720
+
+# uncomment if hdmi display is not detected and composite is being output
+#hdmi_force_hotplug=1
+
+# uncomment to force a specific HDMI mode (this will force VGA)
+#hdmi_group=1
+#hdmi_mode=1
+
+# uncomment to force a HDMI mode rather than DVI. This can make audio work in
+# DMT (computer monitor) modes
+#hdmi_drive=2
+
+# uncomment to increase signal to HDMI, if you have interference, blanking, or
+# no display
+#config_hdmi_boost=4
+
+# uncomment for composite PAL
+#sdtv_mode=2
+
+#uncomment to overclock the arm. 700 MHz is the default.
+#arm_freq=800
+
+# for more options see http://elinux.org/RPi_config.txt
+
+## Some over clocking settings, govenor already set to ondemand
+
+##None
+#arm_freq=700
+#core_freq=250
+#sdram_freq=400
+#over_voltage=0
+
+##Modest
+#arm_freq=800
+#core_freq=300
+#sdram_freq=400
+#over_voltage=0
+
+##Medium
+#arm_freq=900
+#core_freq=333
+#sdram_freq=450
+#over_voltage=2
+
+##High
+#arm_freq=950
+#core_freq=450
+#sdram_freq=450
+#over_voltage=6
+
+##Turbo
+#arm_freq=1000
+#core_freq=500
+#sdram_freq=500
+#over_voltage=6
+
+gpu_mem_512=316
+gpu_mem_256=128
+cma_lwm=16
+cma_hwm=32
+cma_offline_start=16
+
diff --git a/sys-boot/raspberrypi-firmware/files/raspberrypi-firmware-0_p20130711-envd b/sys-boot/raspberrypi-firmware/files/raspberrypi-firmware-0_p20130711-envd
new file mode 100644
index 000000000000..22ed09320464
--- /dev/null
+++ b/sys-boot/raspberrypi-firmware/files/raspberrypi-firmware-0_p20130711-envd
@@ -0,0 +1,2 @@
+CONFIG_PROTECT="/boot/config.txt /boot/cmdline.txt"
+
diff --git a/sys-boot/raspberrypi-firmware/metadata.xml b/sys-boot/raspberrypi-firmware/metadata.xml
new file mode 100644
index 000000000000..30709ceda2f0
--- /dev/null
+++ b/sys-boot/raspberrypi-firmware/metadata.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>xmw@gentoo.org</email>
+ <name>Michael Weber</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="github">raspberrypi/firmware</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-boot/raspberrypi-firmware/raspberrypi-firmware-0_p20130722.ebuild b/sys-boot/raspberrypi-firmware/raspberrypi-firmware-0_p20130722.ebuild
new file mode 100644
index 000000000000..3ae177742881
--- /dev/null
+++ b/sys-boot/raspberrypi-firmware/raspberrypi-firmware-0_p20130722.ebuild
@@ -0,0 +1,62 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit readme.gentoo
+
+DESCRIPTION="Raspberry PI boot loader and firmware"
+HOMEPAGE="https://github.com/raspberrypi/firmware"
+MY_COMMIT="89ac8f4661"
+SRC_URI=""
+for my_src_uri in bootcode.bin fixup{,_cd,_x}.dat start{,_cd,_x}.elf ; do
+ SRC_URI="${SRC_URI} https://github.com/raspberrypi/firmware/raw/${MY_COMMIT}/boot/${my_src_uri} -> ${PN}-${MY_COMMIT}-${my_src_uri}"
+done
+
+LICENSE="GPL-2 raspberrypi-videocore-bin"
+SLOT="0"
+KEYWORDS="~arm -*"
+IUSE=""
+
+DEPEND=""
+RDEPEND=""
+
+S=${WORKDIR}
+
+RESTRICT="binchecks strip"
+
+src_unpack() { :; }
+
+pkg_preinst() {
+ if [ -z "${REPLACING_VERSIONS}" ] ; then
+ local msg=""
+ if [ -e "${D}"/boot/cmdline.txt -a -e /boot/cmdline.txt ] ; then
+ msg+="/boot/cmdline.txt "
+ fi
+ if [ -e "${D}"/boot/config.txt -a -e /boot/config.txt ] ; then
+ msg+="/boot/config.txt "
+ fi
+ if [ -n "${msg}" ] ; then
+ msg="This package installs following files: ${msg}."
+ msg="${msg} Please remove(backup) your copies durning install"
+ msg="${msg} and merge settings afterwards."
+ msg="${msg} Further updates will be CONFIG_PROTECTed."
+ die "${msg}"
+ fi
+ fi
+}
+
+src_install() {
+ insinto /boot
+ local a
+ for a in ${A} ; do
+ newins "${DISTDIR}"/${a} ${a#${PN}-${MY_COMMIT}-}
+ done
+ newins "${FILESDIR}"/${PN}-0_p20130711-config.txt config.txt
+ newins "${FILESDIR}"/${PN}-0_p20130711-cmdline.txt cmdline.txt
+ newenvd "${FILESDIR}"/${PN}-0_p20130711-envd 90${PN}
+ readme.gentoo_create_doc
+}
+
+DOC_CONTENTS="Please configure your ram setup by editing /boot/config.txt"
diff --git a/sys-boot/raspberrypi-firmware/raspberrypi-firmware-0_p20130815.ebuild b/sys-boot/raspberrypi-firmware/raspberrypi-firmware-0_p20130815.ebuild
new file mode 100644
index 000000000000..cbd74834c127
--- /dev/null
+++ b/sys-boot/raspberrypi-firmware/raspberrypi-firmware-0_p20130815.ebuild
@@ -0,0 +1,62 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit readme.gentoo
+
+DESCRIPTION="Raspberry PI boot loader and firmware"
+HOMEPAGE="https://github.com/raspberrypi/firmware"
+MY_COMMIT="e0590d6dda"
+SRC_URI=""
+for my_src_uri in bootcode.bin fixup{,_cd,_x}.dat start{,_cd,_x}.elf ; do
+ SRC_URI="${SRC_URI} https://github.com/raspberrypi/firmware/raw/${MY_COMMIT}/boot/${my_src_uri} -> ${PN}-${MY_COMMIT}-${my_src_uri}"
+done
+
+LICENSE="GPL-2 raspberrypi-videocore-bin"
+SLOT="0"
+KEYWORDS="~arm -*"
+IUSE=""
+
+DEPEND=""
+RDEPEND=""
+
+S=${WORKDIR}
+
+RESTRICT="binchecks strip"
+
+src_unpack() { :; }
+
+pkg_preinst() {
+ if [ -z "${REPLACING_VERSIONS}" ] ; then
+ local msg=""
+ if [ -e "${D}"/boot/cmdline.txt -a -e /boot/cmdline.txt ] ; then
+ msg+="/boot/cmdline.txt "
+ fi
+ if [ -e "${D}"/boot/config.txt -a -e /boot/config.txt ] ; then
+ msg+="/boot/config.txt "
+ fi
+ if [ -n "${msg}" ] ; then
+ msg="This package installs following files: ${msg}."
+ msg="${msg} Please remove(backup) your copies durning install"
+ msg="${msg} and merge settings afterwards."
+ msg="${msg} Further updates will be CONFIG_PROTECTed."
+ die "${msg}"
+ fi
+ fi
+}
+
+src_install() {
+ insinto /boot
+ local a
+ for a in ${A} ; do
+ newins "${DISTDIR}"/${a} ${a#${PN}-${MY_COMMIT}-}
+ done
+ newins "${FILESDIR}"/${PN}-0_p20130711-config.txt config.txt
+ newins "${FILESDIR}"/${PN}-0_p20130711-cmdline.txt cmdline.txt
+ newenvd "${FILESDIR}"/${PN}-0_p20130711-envd 90${PN}
+ readme.gentoo_create_doc
+}
+
+DOC_CONTENTS="Please configure your ram setup by editing /boot/config.txt"
diff --git a/sys-boot/raspberrypi-firmware/raspberrypi-firmware-1_pre20130801.ebuild b/sys-boot/raspberrypi-firmware/raspberrypi-firmware-1_pre20130801.ebuild
new file mode 100644
index 000000000000..89c4f48183b8
--- /dev/null
+++ b/sys-boot/raspberrypi-firmware/raspberrypi-firmware-1_pre20130801.ebuild
@@ -0,0 +1,62 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit readme.gentoo
+
+DESCRIPTION="Raspberry PI boot loader and firmware"
+HOMEPAGE="https://github.com/raspberrypi/firmware"
+MY_COMMIT="128fa52bbc"
+SRC_URI=""
+for my_src_uri in bootcode.bin fixup{,_cd,_x}.dat start{,_cd,_x}.elf ; do
+ SRC_URI="${SRC_URI} https://github.com/raspberrypi/firmware/raw/${MY_COMMIT}/boot/${my_src_uri} -> ${PN}-${MY_COMMIT}-${my_src_uri}"
+done
+
+LICENSE="GPL-2 raspberrypi-videocore-bin"
+SLOT="0"
+KEYWORDS="~arm -*"
+IUSE=""
+
+DEPEND=""
+RDEPEND="!sys-boot/raspberrypi-loader"
+
+S=${WORKDIR}
+
+RESTRICT="binchecks strip"
+
+src_unpack() { :; }
+
+pkg_preinst() {
+ if [ -z "${REPLACING_VERSIONS}" ] ; then
+ local msg=""
+ if [ -e "${D}"/boot/cmdline.txt -a -e /boot/cmdline.txt ] ; then
+ msg+="/boot/cmdline.txt "
+ fi
+ if [ -e "${D}"/boot/config.txt -a -e /boot/config.txt ] ; then
+ msg+="/boot/config.txt "
+ fi
+ if [ -n "${msg}" ] ; then
+ msg="This package installs following files: ${msg}."
+ msg="${msg} Please remove(backup) your copies durning install"
+ msg="${msg} and merge settings afterwards."
+ msg="${msg} Further updates will be CONFIG_PROTECTed."
+ die "${msg}"
+ fi
+ fi
+}
+
+src_install() {
+ insinto /boot
+ local a
+ for a in ${A} ; do
+ newins "${DISTDIR}"/${a} ${a#${PN}-${MY_COMMIT}-}
+ done
+ newins "${FILESDIR}"/${PN}-0_p20130711-config.txt config.txt
+ newins "${FILESDIR}"/${PN}-0_p20130711-cmdline.txt cmdline.txt
+ newenvd "${FILESDIR}"/${PN}-0_p20130711-envd 90${PN}
+ readme.gentoo_create_doc
+}
+
+DOC_CONTENTS="Please configure your ram setup by editing /boot/config.txt"
diff --git a/sys-boot/raspberrypi-firmware/raspberrypi-firmware-1_pre20130807.ebuild b/sys-boot/raspberrypi-firmware/raspberrypi-firmware-1_pre20130807.ebuild
new file mode 100644
index 000000000000..d04f1f3e01c9
--- /dev/null
+++ b/sys-boot/raspberrypi-firmware/raspberrypi-firmware-1_pre20130807.ebuild
@@ -0,0 +1,62 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit readme.gentoo
+
+DESCRIPTION="Raspberry PI boot loader and firmware"
+HOMEPAGE="https://github.com/raspberrypi/firmware"
+MY_COMMIT="b2dbc04508"
+SRC_URI=""
+for my_src_uri in bootcode.bin fixup{,_cd,_x}.dat start{,_cd,_x}.elf ; do
+ SRC_URI="${SRC_URI} https://github.com/raspberrypi/firmware/raw/${MY_COMMIT}/boot/${my_src_uri} -> ${PN}-${MY_COMMIT}-${my_src_uri}"
+done
+
+LICENSE="GPL-2 raspberrypi-videocore-bin"
+SLOT="0"
+KEYWORDS="~arm -*"
+IUSE=""
+
+DEPEND=""
+RDEPEND="!sys-boot/raspberrypi-loader"
+
+S=${WORKDIR}
+
+RESTRICT="binchecks strip"
+
+src_unpack() { :; }
+
+pkg_preinst() {
+ if [ -z "${REPLACING_VERSIONS}" ] ; then
+ local msg=""
+ if [ -e "${D}"/boot/cmdline.txt -a -e /boot/cmdline.txt ] ; then
+ msg+="/boot/cmdline.txt "
+ fi
+ if [ -e "${D}"/boot/config.txt -a -e /boot/config.txt ] ; then
+ msg+="/boot/config.txt "
+ fi
+ if [ -n "${msg}" ] ; then
+ msg="This package installs following files: ${msg}."
+ msg="${msg} Please remove(backup) your copies durning install"
+ msg="${msg} and merge settings afterwards."
+ msg="${msg} Further updates will be CONFIG_PROTECTed."
+ die "${msg}"
+ fi
+ fi
+}
+
+src_install() {
+ insinto /boot
+ local a
+ for a in ${A} ; do
+ newins "${DISTDIR}"/${a} ${a#${PN}-${MY_COMMIT}-}
+ done
+ newins "${FILESDIR}"/${PN}-0_p20130711-config.txt config.txt
+ newins "${FILESDIR}"/${PN}-0_p20130711-cmdline.txt cmdline.txt
+ newenvd "${FILESDIR}"/${PN}-0_p20130711-envd 90${PN}
+ readme.gentoo_create_doc
+}
+
+DOC_CONTENTS="Please configure your ram setup by editing /boot/config.txt"
diff --git a/sys-boot/raspberrypi-mkimage/files/raspberrypi-mkimage-0_p20120201-args-uncompressed.txt b/sys-boot/raspberrypi-mkimage/files/raspberrypi-mkimage-0_p20120201-args-uncompressed.txt
new file mode 100644
index 000000000000..09398b47eee8
--- /dev/null
+++ b/sys-boot/raspberrypi-mkimage/files/raspberrypi-mkimage-0_p20120201-args-uncompressed.txt
@@ -0,0 +1,12 @@
+; kernel args (place at 0x00000100)
+0x00000005
+0x54410001
+0x00000001
+0x00001000
+0x00000000
+0x00000004
+0x54410002
+0x08000000
+0x00000000
+0x00000000
+0x00000000
diff --git a/sys-boot/raspberrypi-mkimage/files/raspberrypi-mkimage-0_p20120201-boot-uncompressed.txt b/sys-boot/raspberrypi-mkimage/files/raspberrypi-mkimage-0_p20120201-boot-uncompressed.txt
new file mode 100644
index 000000000000..1cf5888278af
--- /dev/null
+++ b/sys-boot/raspberrypi-mkimage/files/raspberrypi-mkimage-0_p20120201-boot-uncompressed.txt
@@ -0,0 +1,17 @@
+; bootloader (place at 0x00000000)
+0xea000006
+0xe1a00000
+0xe1a00000
+0xe1a00000
+0xe1a00000
+0xe1a00000
+0xe1a00000
+0xe1a00000
+
+0xe3a00000
+0xe3a01042
+0xe3811c0c
+0xe59f2000
+0xe59ff000
+0x00000100
+0x00008000
diff --git a/sys-boot/raspberrypi-mkimage/files/raspberrypi-mkimage-0_p20120201-imagetool-uncompressed-python3.patch b/sys-boot/raspberrypi-mkimage/files/raspberrypi-mkimage-0_p20120201-imagetool-uncompressed-python3.patch
new file mode 100644
index 000000000000..f9d0c00602c8
--- /dev/null
+++ b/sys-boot/raspberrypi-mkimage/files/raspberrypi-mkimage-0_p20120201-imagetool-uncompressed-python3.patch
@@ -0,0 +1,11 @@
+--- mkimage/imagetool-uncompressed.py
++++ mkimage/imagetool-uncompressed.py
+@@ -46,7 +47,7 @@
+ f = open(args.bootimage, "wb")
+
+ for m in mem:
+- f.write(chr(m))
++ f.write(chr(m).encode('latin1'))
+
+ f.write(kernel_image)
+ f.close()
diff --git a/sys-boot/raspberrypi-mkimage/files/raspberrypi-mkimage-0_p20120201-imagetool-uncompressed.patch b/sys-boot/raspberrypi-mkimage/files/raspberrypi-mkimage-0_p20120201-imagetool-uncompressed.patch
new file mode 100644
index 000000000000..6b12c95c0fbe
--- /dev/null
+++ b/sys-boot/raspberrypi-mkimage/files/raspberrypi-mkimage-0_p20120201-imagetool-uncompressed.patch
@@ -0,0 +1,49 @@
+diff -ru raspberrypi-mkimage-0_p20120201.orig/imagetool-uncompressed.py raspberrypi-mkimage-0_p20120201/imagetool-uncompressed.py
+--- raspberrypi-mkimage-0_p20120201.orig/imagetool-uncompressed.py 2013-07-19 15:11:23.373837900 +0200
++++ raspberrypi-mkimage-0_p20120201/imagetool-uncompressed.py 2013-07-19 15:31:56.495421758 +0200
+@@ -3,15 +3,23 @@
+ import os
+ import re
+ import sys
++import argparse
+
+-try:
+- kernel_image = sys.argv[1]
+-except:
+- kernel_image = ""
+-
+-if kernel_image == "":
+- print("usage : imagetool-uncompressed.py <kernel image>");
+- sys.exit(0)
++parser = argparse.ArgumentParser(description='Prepare kernel files for Raspberry Pi bootloader')
++parser.add_argument('--force', '-f', action='store_true', default=False,
++ help='overwrite target file')
++parser.add_argument('kernel',
++ help='kernel file from /usr/src/linux*/arch/arm/boot/Image')
++parser.add_argument('bootimage',
++ help='file to be placed in /boot/kernel.img')
++args = parser.parse_args()
++if os.path.exists(args.bootimage) and not args.force:
++ print('Target file exists, use --force to override')
++ sys.exit(1)
++
++f = open(args.kernel, 'rb')
++kernel_image = f.read()
++f.close()
+
+ re_line = re.compile(r"0x(?P<value>[0-9a-f]{8})")
+
+@@ -35,11 +43,10 @@
+ load_to_mem("boot-uncompressed.txt", 0x00000000)
+ load_to_mem("args-uncompressed.txt", 0x00000100)
+
+-f = open("first32k.bin", "wb")
++f = open(args.bootimage, "wb")
+
+ for m in mem:
+ f.write(chr(m))
+
++f.write(kernel_image)
+ f.close()
+-
+-os.system("cat first32k.bin " + kernel_image + " > kernel.img")
diff --git a/sys-boot/raspberrypi-mkimage/files/raspberrypi-mkimage-0_p20120201-imagetool-uncompressed.py b/sys-boot/raspberrypi-mkimage/files/raspberrypi-mkimage-0_p20120201-imagetool-uncompressed.py
new file mode 100644
index 000000000000..46ff4fc8ea6b
--- /dev/null
+++ b/sys-boot/raspberrypi-mkimage/files/raspberrypi-mkimage-0_p20120201-imagetool-uncompressed.py
@@ -0,0 +1,45 @@
+#!/usr/bin/env python2
+
+import os
+import re
+import sys
+
+try:
+ kernel_image = sys.argv[1]
+except:
+ kernel_image = ""
+
+if kernel_image == "":
+ print("usage : imagetool-uncompressed.py <kernel image>");
+ sys.exit(0)
+
+re_line = re.compile(r"0x(?P<value>[0-9a-f]{8})")
+
+mem = [0 for i in range(32768)]
+
+def load_to_mem(name, addr):
+ f = open(name)
+
+ for l in f.readlines():
+ m = re_line.match(l)
+
+ if m:
+ value = int(m.group("value"), 16)
+
+ for i in range(4):
+ mem[addr] = int(value >> i * 8 & 0xff)
+ addr += 1
+
+ f.close()
+
+load_to_mem("boot-uncompressed.txt", 0x00000000)
+load_to_mem("args-uncompressed.txt", 0x00000100)
+
+f = open("first32k.bin", "wb")
+
+for m in mem:
+ f.write(chr(m))
+
+f.close()
+
+os.system("cat first32k.bin " + kernel_image + " > kernel.img")
diff --git a/sys-boot/raspberrypi-mkimage/metadata.xml b/sys-boot/raspberrypi-mkimage/metadata.xml
new file mode 100644
index 000000000000..d81c7c3526cc
--- /dev/null
+++ b/sys-boot/raspberrypi-mkimage/metadata.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>xmw@gentoo.org</email>
+ <name>Michael Weber</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="github">raspberrypi/tools</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-boot/raspberrypi-mkimage/raspberrypi-mkimage-0_p20120201.ebuild b/sys-boot/raspberrypi-mkimage/raspberrypi-mkimage-0_p20120201.ebuild
new file mode 100644
index 000000000000..7602a0a3e954
--- /dev/null
+++ b/sys-boot/raspberrypi-mkimage/raspberrypi-mkimage-0_p20120201.ebuild
@@ -0,0 +1,55 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+PYTHON_COMPAT=( python{2_7,3_3,3_4} )
+
+inherit eutils distutils-r1
+
+DESCRIPTION="Raspberry Pi kernel mangling tool mkimage/imagetool-uncompressed.py"
+HOMEPAGE="https://github.com/raspberrypi/tools/"
+SRC_URI=""
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~x86"
+IUSE=""
+
+DEPEND=""
+RDEPEND="${PYTHON_DEPS}"
+
+src_unpack() {
+ mkdir "${S}" || die
+ cp {"${FILESDIR}"/${P}-,"${S}"/}imagetool-uncompressed.py || die
+}
+
+python_prepare_all() {
+ epatch "${FILESDIR}"/${P}-imagetool-uncompressed.patch
+ sed -e '/^load_to_mem("/s:(":("'${EPREFIX}'/usr/share/'${PN}'/:' \
+ -e '1s:python2:python:' \
+ -i imagetool-uncompressed.py || die
+ python_copy_sources
+}
+
+python_prepare() {
+ cd "${BUILD_DIR}" || die
+ case ${EPYTHON} in
+ python3.1|python3.2|python3.3)
+ epatch "${FILESDIR}"/${P}-imagetool-uncompressed-python3.patch
+ ;;
+ esac
+}
+
+python_compile() { :; }
+
+python_install() {
+ cd "${BUILD_DIR}" || die
+ python_doscript imagetool-uncompressed.py
+}
+
+python_install_all() {
+ insinto /usr/share/${PN}
+ newins {"${FILESDIR}"/${P}-,}args-uncompressed.txt
+ newins {"${FILESDIR}"/${P}-,}boot-uncompressed.txt
+}
diff --git a/sys-boot/sgibootcd/Manifest b/sys-boot/sgibootcd/Manifest
new file mode 100644
index 000000000000..5e147fc072ad
--- /dev/null
+++ b/sys-boot/sgibootcd/Manifest
@@ -0,0 +1 @@
+DIST sgibootcd-0.12.tar.bz2 3810 SHA256 2b0bfd0ebaa218fec414ff7102b8128dc658110fbeac83a510dc87d6559f299c SHA512 180e4f5a185b14c0b2c8158b368a50a3a55673fa86760e2a424c9533b1bb8ec37824c715ba02fd264621e2e31906ddd310398e9f24cf19147bce3e49fc62da3e WHIRLPOOL a1c98b2b6fc48201f4db47ac3a48cd64bb84becd5d664a8418a02115c47cb462e527aa1ba1dad4c58367441178101fe2661e9e2b08f67f1c8566f73e3c9eb08c
diff --git a/sys-boot/sgibootcd/metadata.xml b/sys-boot/sgibootcd/metadata.xml
new file mode 100644
index 000000000000..cd70548b1fc1
--- /dev/null
+++ b/sys-boot/sgibootcd/metadata.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>mips</herd>
+ <maintainer>
+ <email>mips@gentoo.org</email>
+ <name>Mips Team</name>
+ </maintainer>
+
+ <longdescription>
+ sgibootcd - Creates a burnable CD image for SGI LiveCDs
+ </longdescription>
+</pkgmetadata>
+
diff --git a/sys-boot/sgibootcd/sgibootcd-0.12.ebuild b/sys-boot/sgibootcd/sgibootcd-0.12.ebuild
new file mode 100644
index 000000000000..a88fa38e0926
--- /dev/null
+++ b/sys-boot/sgibootcd/sgibootcd-0.12.ebuild
@@ -0,0 +1,29 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+inherit eutils toolchain-funcs
+
+DESCRIPTION="Creates burnable CD images for SGI LiveCDs"
+HOMEPAGE="ftp://ftp.linux-mips.org/pub/linux/mips/people/skylark/"
+SRC_URI="ftp://ftp.linux-mips.org/pub/linux/mips/people/skylark/${P}.tar.bz2"
+LICENSE="all-rights-reserved"
+SLOT="0"
+KEYWORDS="-* ~mips"
+IUSE=""
+RDEPEND=""
+DEPEND=""
+RESTRICT=""
+
+src_compile() {
+ local mycc="$(tc-getCC) ${CFLAGS}"
+
+ [ -f "${S}/sgibootcd" ] && rm -f "${S}"/sgibootcd
+ einfo "${mycc} sgibootcd.c -o sgibootcd"
+ ${mycc} sgibootcd.c -o sgibootcd
+}
+
+src_install() {
+ dobin "${S}"/sgibootcd
+}
diff --git a/sys-boot/shlilo-lantank/Manifest b/sys-boot/shlilo-lantank/Manifest
new file mode 100644
index 000000000000..d7710f863072
--- /dev/null
+++ b/sys-boot/shlilo-lantank/Manifest
@@ -0,0 +1 @@
+DIST sh-lilo-sel-20040408.tar.gz 85932 SHA256 60b653c63baa160bb4652b56acafd17e462b1bd1dc713620f1e150239ae2877d
diff --git a/sys-boot/shlilo-lantank/files/lilo.conf b/sys-boot/shlilo-lantank/files/lilo.conf
new file mode 100644
index 000000000000..cd5bc81d3835
--- /dev/null
+++ b/sys-boot/shlilo-lantank/files/lilo.conf
@@ -0,0 +1,16 @@
+# Example lilo.conf
+linear
+boot=/dev/hda
+install=/boot/boot.b
+
+# timeout is in 10's of milliseconds; so 100 is 1 second
+prompt
+timeout=800
+default=default
+
+# default kernel settings
+read-only
+append="mem=64M root=/dev/hda1 console=ttySC1,9600"
+
+image=/boot/zImage
+ label=default
diff --git a/sys-boot/shlilo-lantank/metadata.xml b/sys-boot/shlilo-lantank/metadata.xml
new file mode 100644
index 000000000000..b9b9fd717504
--- /dev/null
+++ b/sys-boot/shlilo-lantank/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>sh</herd>
+</pkgmetadata>
diff --git a/sys-boot/shlilo-lantank/shlilo-lantank-20040408.ebuild b/sys-boot/shlilo-lantank/shlilo-lantank-20040408.ebuild
new file mode 100644
index 000000000000..116297914a36
--- /dev/null
+++ b/sys-boot/shlilo-lantank/shlilo-lantank-20040408.ebuild
@@ -0,0 +1,33 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+inherit mount-boot
+
+MY_P="sh-lilo-sel-${PV}"
+DESCRIPTION="bootloader for the SuperH Lantank"
+HOMEPAGE="http://www.linux-sh.org/"
+SRC_URI="mirror://gentoo/${MY_P}.tar.gz"
+
+LICENSE="GPL-2+ BSD"
+SLOT="0"
+KEYWORDS="-* sh"
+IUSE=""
+RESTRICT="strip"
+
+S=${WORKDIR}/${MY_P}
+
+QA_TEXTRELS_sh="sbin/lilo"
+
+src_compile() { :; }
+
+src_install() {
+ into /
+ dosbin precompiled/lilo || die
+ insinto /boot
+ doins precompiled/boot.b || die
+ dosym . /boot/boot
+ insinto /etc
+ doins "${FILESDIR}"/lilo.conf || die
+ dodoc ChangeLog README TODO
+}
diff --git a/sys-boot/silo/Manifest b/sys-boot/silo/Manifest
new file mode 100644
index 000000000000..804d86003ce5
--- /dev/null
+++ b/sys-boot/silo/Manifest
@@ -0,0 +1,6 @@
+DIST silo_1.4.14+git20100228-1.diff.gz 10143 SHA256 e62e5be033f72f0bf948aa6538742b0647b9716302de7b553f45be234604ecb9 SHA512 7209fd4fe65d7d72866ce41d25498e8369f59b51833550ecf9ae84badce33e82eccf97835558d560ca9937ebf37d0de99da7876ee4de1bafbe96e931c6d72cf0 WHIRLPOOL ba8f351c9ae61dcec1f2fb6fc0dd4caa76bb4bf9e84d66362acd8a388cd289a8621caeb3b38aa2563372f593726540c3bee5889d00275765aeebd328ae9caa12
+DIST silo_1.4.14+git20100228.orig.tar.gz 738325 SHA256 3ed377c7ec122736655e49cdfdff193e9eed122807e4705a423d036223c9caa4 SHA512 aa119893695fe0ce5eb30c7a461aa77b0f8935b1e2bcff9f83b232aad8b44cce72662c7c6716c61ea914dd5217edaf8d0e01b363010a2f7d9be9ac80a666bb77 WHIRLPOOL 506f6b78f5f0bce5920a8ba81154d3df25951cc33bddde26f6caa886d94683bb3e4905227b8cf27de85e4b62576806aa3727fd317ec60f97fc6b8ce1c24690d4
+DIST silo_1.4.14+git20120226-1.diff.gz 10389 SHA256 ea94c4a2f0fdbc84c666c0d7c4fd80b0f7eacfed4c55f2526b6ca425fb1a6231 SHA512 0dd39461357f862bc0eb7d0b4db8e3e9acadb30f70c8c638b1adef6f6c306d0c475bf59e29c72a91594fcbf544c80e05e5293b857265d4cd579696f10993483b WHIRLPOOL 0928aa877c96062e8035e2f52b1bfcd2e801baf3360c9da3c53004ab13655ef6893773606c7b63376928805613abc4adf385c8b8b50872975b536c50179d9506
+DIST silo_1.4.14+git20120226.orig.tar.gz 747622 SHA256 8a54ef3729790ff754f8ddcbc53af7432a0dabd2ddea2b912b46755e1afe1107 SHA512 14d7ad363232e7520f2c1d6ea5ca26e5b0a2059be6b161799cc6cc155ecbe0590c890433a5442f48c2d2a47b784053063e08e4140895807fc595e291f42ab9e8 WHIRLPOOL f573eb38d717f80146b72893a300cb339d49208f3fbbf4aada9304c604485d9cde340b1eabb0ca2bc55064dfac046cbc12c930c5c49c256207e1c6a4fbae1000
+DIST silo_1.4.14+git20120819-1.diff.gz 10711 SHA256 ed5a7a4cf4c69fe1a163def8c4452bd73018d040950e371ea5ec036fa3f17703 SHA512 60719b672a0f1dd2a005e763efd232bbf7aeb00198e0b46827208b78f1b32acc3a730d43944382dec4b95fddfbb373b1eb69dc911ad28ec9d1d1e6c45d84db20 WHIRLPOOL 7ca7d1ee7c41a45b0fbbc9d5ddb24282ec932e78900f4b2a49f3860159f153ce098f814e546fd5ec7544f57a1a11fbe0255c92476bf1615c3c1b49ff741a0ef9
+DIST silo_1.4.14+git20120819.orig.tar.gz 755510 SHA256 637854cba63088e0b5df96bf3d18dc1a3b446e12a7877969fef01fb7e93aa4ca SHA512 2d1dd8f805fb0a272877b5e8e19e5a645aa9fe02cf2b5ef43b5d2894c0c6a5a82483a0e41556af50f01dc795dc5e43350ae92139485c19d64cda75c2aca01a38 WHIRLPOOL fc9e6dd6571cecb5449533fb577a8a52b866e8390aad5a818ad787a4ea4b3cbdc158bcb68302f7699c8994d5c5739b1d4911a51344bebb638b29debce0a4a826
diff --git a/sys-boot/silo/files/silo-e2fsprogs-1.4.14.patch b/sys-boot/silo/files/silo-e2fsprogs-1.4.14.patch
new file mode 100644
index 000000000000..afcfc462ea87
--- /dev/null
+++ b/sys-boot/silo/files/silo-e2fsprogs-1.4.14.patch
@@ -0,0 +1,54 @@
+# Patch to make silo compile and work with >=e2fsprogs-1.4.14
+# http://bugs.gentoo.org/show_bug.cgi?id=350677
+# http://marc.info/?l=linux-sparc&m=129468771631829&w=2
+--- silo.orig/common/malloc.c 2010-02-28 12:11:51.000000000 +0100
++++ silo/common/malloc.c 2011-01-22 12:06:42.849946213 +0100
+@@ -27,6 +27,12 @@
+
+ static char *last_alloc = 0;
+
++static char *align_ptr_to(char *ptr, unsigned long align)
++{
++ return (char *) ((((unsigned long) ptr) + (align - 1UL)) &
++ ~(align - 1UL));
++}
++
+ void *malloc (int size)
+ {
+ char *caddr;
+@@ -34,10 +40,34 @@
+ caddr = malloc_ptr;
+ malloc_ptr += size;
+ last_alloc = caddr;
+- malloc_ptr = (char *) ((((unsigned long) malloc_ptr) + 7) & (~7));
++ malloc_ptr = align_ptr_to(malloc_ptr, 8UL);
+ return caddr;
+ }
+
++int posix_memalign(void **memptr, unsigned long alignment, unsigned long size)
++{
++ char *caddr;
++
++ if (alignment & (alignment - 1UL))
++ return -1;
++ if (alignment & (sizeof(void *) - 1UL))
++ return -1;
++
++ if (size == 0) {
++ *memptr = (void *) 0;
++ return 0;
++ }
++
++ caddr = align_ptr_to(malloc_ptr, alignment);
++ malloc_ptr = (caddr + size);
++ last_alloc = caddr;
++ malloc_ptr = align_ptr_to(malloc_ptr, 8UL);
++
++ *memptr = caddr;
++
++ return 0;
++}
++
+ void free (void *m)
+ {
+ if (m == last_alloc)
diff --git a/sys-boot/silo/metadata.xml b/sys-boot/silo/metadata.xml
new file mode 100644
index 000000000000..b9bd3256ea89
--- /dev/null
+++ b/sys-boot/silo/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>sparc</herd>
+<longdescription>
+SILO is the SPARC/UltraSPARC Improved Loader, a boot loader for sparc similar to LILO.
+</longdescription>
+</pkgmetadata>
diff --git a/sys-boot/silo/silo-1.4.14_p20100228.ebuild b/sys-boot/silo/silo-1.4.14_p20100228.ebuild
new file mode 100644
index 000000000000..58db74063ee4
--- /dev/null
+++ b/sys-boot/silo/silo-1.4.14_p20100228.ebuild
@@ -0,0 +1,70 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+inherit mount-boot flag-o-matic toolchain-funcs eutils
+
+DEB_PL="1"
+MY_PV="${PV##*_p}"
+MY_GIT="git${MY_PV%%_*}"
+MY_PV="${PV%%_*}"
+MY_P="${PN}_${MY_PV}+${MY_GIT}"
+
+DESCRIPTION="SPARC/UltraSPARC Improved Loader, a boot loader for sparc"
+SRC_URI="mirror://debian/pool/main/s/${PN}/${MY_P}.orig.tar.gz
+ mirror://debian/pool/main/s/${PN}/${MY_P}-${DEB_PL}.diff.gz"
+HOMEPAGE="http://git.kernel.org/?p=linux/kernel/git/davem/silo.git;a=summary"
+
+SLOT="0"
+LICENSE="GPL-2"
+KEYWORDS="-* sparc"
+IUSE="hardened"
+
+DEPEND="sys-fs/e2fsprogs
+ sys-apps/sparc-utils"
+
+ABI_ALLOW="sparc32"
+
+S="${WORKDIR}/${PN}"
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+
+ #Set the correct version
+ sed -i -e "s/1.4.14/1.4.14_git2010228_p1/g" Rules.make
+
+ # Fix build failure
+ sed -i -e "s/-fno-strict-aliasing/-fno-strict-aliasing -U_FORTIFY_SOURCE/g" Rules.make
+
+ # Fix bug #350677
+ epatch "${FILESDIR}"/silo-e2fsprogs-1.4.14.patch
+}
+
+src_compile() {
+ filter-flags "-fstack-protector"
+
+ if use hardened
+ then
+ make ${MAKEOPTS} CC="$(tc-getCC) -fno-stack-protector -fno-pic"
+ else
+ make ${MAKEOPTS} CC="$(tc-getCC)" || die
+ fi
+}
+
+src_install() {
+ make DESTDIR="${D}" install || die
+ dodoc first-isofs/README.SILO_ISOFS docs/README*
+
+ # Fix maketilo manpage
+ rm "${D}"/usr/share/man/man1/maketilo.1
+ dosym /usr/share/man/man1/tilo.1 /usr/share/man/man1/maketilo.1
+}
+
+pkg_postinst() {
+ mount-boot_pkg_postinst
+ ewarn "NOTE: If this is an upgrade to an existing SILO install,"
+ ewarn " you will need to re-run silo as the /boot/second.b"
+ ewarn " file has changed, else the system will fail to load"
+ ewarn " SILO at the next boot."
+}
diff --git a/sys-boot/silo/silo-1.4.14_p20120226.ebuild b/sys-boot/silo/silo-1.4.14_p20120226.ebuild
new file mode 100644
index 000000000000..3690d95af4c4
--- /dev/null
+++ b/sys-boot/silo/silo-1.4.14_p20120226.ebuild
@@ -0,0 +1,70 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+inherit mount-boot flag-o-matic toolchain-funcs eutils
+
+DEB_PL="1"
+MY_PV="${PV##*_p}"
+MY_GIT="git${MY_PV%%_*}"
+MY_PV="${PV%%_*}"
+MY_P="${PN}_${MY_PV}+${MY_GIT}"
+
+DESCRIPTION="SPARC/UltraSPARC Improved Loader, a boot loader for sparc"
+SRC_URI="mirror://debian/pool/main/s/${PN}/${MY_P}.orig.tar.gz
+ mirror://debian/pool/main/s/${PN}/${MY_P}-${DEB_PL}.diff.gz"
+HOMEPAGE="http://git.kernel.org/?p=linux/kernel/git/davem/silo.git;a=summary"
+
+SLOT="0"
+LICENSE="GPL-2"
+KEYWORDS="-* sparc"
+IUSE="hardened"
+
+DEPEND="sys-fs/e2fsprogs
+ sys-apps/sparc-utils"
+RDEPEND=""
+
+ABI_ALLOW="sparc32"
+
+S="${WORKDIR}/${PN}"
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+
+ #Set the correct version
+ sed -i -e "s/1.4.14/1.4.14_git20120226_p1/g" Rules.make
+
+ # Fix build failure
+ sed -i -e "s/-fno-strict-aliasing/-fno-strict-aliasing -U_FORTIFY_SOURCE -mcpu=v9/g" Rules.make
+}
+
+src_compile() {
+ filter-flags "-fstack-protector"
+
+ if use hardened
+ then
+ make ${MAKEOPTS} CC="$(tc-getCC) -fno-stack-protector -fno-pic"
+ else
+ make ${MAKEOPTS} CC="$(tc-getCC)" || die
+ fi
+}
+
+src_install() {
+ make DESTDIR="${D}" install || die
+ dodoc first-isofs/README.SILO_ISOFS docs/README*
+
+ # Fix maketilo manpage
+ rm "${D}"/usr/share/man/man1/maketilo.1
+ dosym /usr/share/man/man1/tilo.1 /usr/share/man/man1/maketilo.1
+}
+
+pkg_postinst() {
+ mount-boot_pkg_postinst
+ ewarn "NOTE: If this is an upgrade to an existing SILO install,"
+ ewarn " you will need to re-run silo as the /boot/second.b"
+ ewarn " file has changed, else the system will fail to load"
+ ewarn " SILO at the next boot."
+ ewarn
+ ewarn "Support for EXT4 is broken, you've been warned!!"
+}
diff --git a/sys-boot/silo/silo-1.4.14_p20120819.ebuild b/sys-boot/silo/silo-1.4.14_p20120819.ebuild
new file mode 100644
index 000000000000..788e94019659
--- /dev/null
+++ b/sys-boot/silo/silo-1.4.14_p20120819.ebuild
@@ -0,0 +1,64 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+inherit mount-boot flag-o-matic toolchain-funcs eutils
+
+DEB_PL="1"
+MY_PV="${PV##*_p}"
+MY_GIT="git${MY_PV%%_*}"
+MY_PV="${PV%%_*}"
+MY_P="${PN}_${MY_PV}+${MY_GIT}"
+
+DESCRIPTION="SPARC/UltraSPARC Improved Loader, a boot loader for sparc"
+SRC_URI="mirror://debian/pool/main/s/${PN}/${MY_P}.orig.tar.gz
+ mirror://debian/pool/main/s/${PN}/${MY_P}-${DEB_PL}.diff.gz"
+HOMEPAGE="http://git.kernel.org/?p=linux/kernel/git/davem/silo.git;a=summary"
+
+SLOT="0"
+LICENSE="GPL-2"
+KEYWORDS="-* sparc"
+IUSE=""
+
+DEPEND="sys-fs/e2fsprogs
+ sys-apps/sparc-utils"
+RDEPEND=""
+
+ABI_ALLOW="sparc32"
+
+S="${WORKDIR}/${PN}"
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+
+ #Set the correct version
+ sed -i -e "s/1.4.14/1.4.14_git20120819_p1/g" Rules.make
+
+ # Fix build failure
+ sed -i -e "s/-fno-strict-aliasing/-fno-strict-aliasing -U_FORTIFY_SOURCE -mcpu=v9/g" Rules.make
+}
+
+src_compile() {
+ filter-flags "-fstack-protector"
+
+ make ${MAKEOPTS} CC="$(tc-getCC)" || die
+}
+
+src_install() {
+ make DESTDIR="${D}" install || die
+ dodoc first-isofs/README.SILO_ISOFS docs/README*
+
+ # Fix maketilo manpage
+ rm "${D}"/usr/share/man/man1/maketilo.1
+ dosym /usr/share/man/man1/tilo.1 /usr/share/man/man1/maketilo.1
+}
+
+pkg_postinst() {
+ mount-boot_pkg_postinst
+ ewarn "NOTE: If this is an upgrade to an existing SILO install,"
+ ewarn " you will need to re-run silo as the /boot/second.b"
+ ewarn " file has changed, else the system will fail to load"
+ ewarn " SILO at the next boot."
+ ewarn
+}
diff --git a/sys-boot/syslinux/Manifest b/sys-boot/syslinux/Manifest
new file mode 100644
index 000000000000..23780b32adf9
--- /dev/null
+++ b/sys-boot/syslinux/Manifest
@@ -0,0 +1,5 @@
+DIST syslinux-3.86.tar.bz2 3735823 SHA256 82a8d2a242f869cb4c34b3a074871f472762343e1879a4dca23d7ce5c4dcd06d SHA512 6231f233e5f5ac26aa7e4bfd2704e2a4081350a3f3f21b5ec88a13cf992528c2796dbdfdf6cc2cc7a9543828650ae46de3685e5e55fac3a6ad520430220d1073 WHIRLPOOL 985efd16587ac3f00dc1b75563dc12e5abfeb14b42b64accdadda087f6c9a61c8f5cc149a2b9ce8dd1368d1083720340c20240a4b7d7ea3bf51ff65512d1bd3e
+DIST syslinux-4.07.tar.bz2 5761877 SHA256 1240a4e4219b518bdaef78931b6e901befeff35e6894ac6db785115848a7a05a SHA512 8efbd14803ec74c5ee699a754b4727e4b975c08afd4dbb39f4b7ccdb90743e4459cd4609c6f1065c7b7efaa26c9d465806254891795d363758f35a2fe5704ae5 WHIRLPOOL b68966ed87055a157812f36f2881b4a86797eacef1894b70c1a063327547264daa4b4ca1ea52ccb286ab86332c2163e57004d3503215497278e073b48583a9dc
+DIST syslinux-5.10.tar.xz 5315660 SHA256 4b52d7647d5584c69764c06a836e0d524e5246bf2e94f68cf86342c415508422 SHA512 56422e14b4aa53ca1a5811da0582dbbb349aa52b9e78868bbedc24c67ef2420c4d0ac63fd68c7f0adc2c22606196276265d503b5b6f9d3d796d9ce42845bbdb5 WHIRLPOOL 77d73bdc1cd75a3ad9f58de8a9fa31a1c4247d579ac8c849e8d0dacc7cd1b9e02b2cf0737f1be1c2bc2e974f4ded3955857588a8a07d6cf35997c57f47d9b583
+DIST syslinux-6.02.tar.xz 6471080 SHA256 afa31b7cbf72e1c0c1752a0636ba724ce01c0e374366e46e61db6862b4685478 SHA512 919d165e9cba2b964cec8b015f0a4281a5f90e908f247441d6edefe289170e697b933554d12fa90e698b6d2e8b5b40fdb3b7a95d746a41c580e3a44f8859818f WHIRLPOOL 98d7552f8c66be7689166e7d7a7b5499af0a974711e7ca1f01e1538250c533ceed6d80cec0ac189ff66ea243e22ff1add62c2e3392945d4b7e1586f38c1b6a1d
+DIST syslinux-6.03.tar.xz 6855224 SHA256 26d3986d2bea109d5dc0e4f8c4822a459276cf021125e8c9f23c3cca5d8c850e SHA512 dd2b2916962b9e93bc1e714182e3ca2a727a229b8afabe913050bcfdd43ee2af51ee3acf79121d8c20caf434583efaa7f3196871e0e07c04d82191323a50fe31 WHIRLPOOL c3abf6dd84610f2265ce94ce0991e200e3f7fcf2cf2926d46c389c7235544e959ee52aef4a510258b861da2233fd38696d3164a7d0e75f0060a18cc13f23b546
diff --git a/sys-boot/syslinux/files/syslinux-3.86-nopie.patch b/sys-boot/syslinux/files/syslinux-3.86-nopie.patch
new file mode 100644
index 000000000000..efe939e43d34
--- /dev/null
+++ b/sys-boot/syslinux/files/syslinux-3.86-nopie.patch
@@ -0,0 +1,12 @@
+diff -ur a/com32/MCONFIG b/com32/MCONFIG
+--- a/com32/MCONFIG 2010-03-31 18:24:25.000000000 +0200
++++ b/com32/MCONFIG 2010-04-05 00:03:55.612973516 +0200
+@@ -20,6 +20,8 @@
+ GCCOPT := $(call gcc_ok,-std=gnu99,) \
+ $(call gcc_ok,-m32,) \
+ $(call gcc_ok,-fno-stack-protector,) \
++ $(call gcc_ok,-nopie,) \
++ $(call gcc_ok,-fno-pie,) \
+ $(call gcc_ok,-falign-functions=0,-malign-functions=0) \
+ $(call gcc_ok,-falign-jumps=0,-malign-jumps=0) \
+ $(call gcc_ok,-falign-loops=0,-malign-loops=0) \
diff --git a/sys-boot/syslinux/files/syslinux-4.05-nopie.patch b/sys-boot/syslinux/files/syslinux-4.05-nopie.patch
new file mode 100644
index 000000000000..b50b6b476895
--- /dev/null
+++ b/sys-boot/syslinux/files/syslinux-4.05-nopie.patch
@@ -0,0 +1,12 @@
+diff -ur a/mk/com32.mk b/mk/com32.mk
+--- a/mk/com32.mk 2011-12-09 19:28:17.000000000 +0100
++++ b/mk/com32.mk 2011-12-18 18:22:11.032342645 +0100
+@@ -24,6 +24,8 @@
+ GCCOPT += $(call gcc_ok,-freg-struct-return,)
+ GCCOPT += -mregparm=3 -DREGPARM=3 -march=i386 -Os
+ GCCOPT += $(call gcc_ok,-fPIE,-fPIC)
++GCCOPT += $(call gcc_ok,-nopie,)
++GCCOPT += $(call gcc_ok,-fno-pie,)
+ GCCOPT += $(call gcc_ok,-fno-exceptions,)
+ GCCOPT += $(call gcc_ok,-fno-asynchronous-unwind-tables,)
+ GCCOPT += $(call gcc_ok,-fno-strict-aliasing,)
diff --git a/sys-boot/syslinux/files/syslinux-6.02-add-fno-stack-protector.patch b/sys-boot/syslinux/files/syslinux-6.02-add-fno-stack-protector.patch
new file mode 100644
index 000000000000..b3537678c5d7
--- /dev/null
+++ b/sys-boot/syslinux/files/syslinux-6.02-add-fno-stack-protector.patch
@@ -0,0 +1,20 @@
+diff -Naur syslinux-6.02/mk/efi.mk syslinux-6.02-hardened/mk/efi.mk
+--- syslinux-6.02/mk/efi.mk 2013-10-13 13:59:03.000000000 -0400
++++ syslinux-6.02-hardened/mk/efi.mk 2014-02-09 12:56:47.036409135 -0500
+@@ -23,6 +23,7 @@
+ EFI_SUBARCH = $(ARCH)
+ endif
+
++GCCOPT := $(call gcc_ok,-fno-stack-protector,)
+ EFIINC = $(shell $(topdir)/efi//find-gnu-efi.sh include $(EFI_SUBARCH))
+ $(if $(EFIINC),, \
+ $(error Missing $(EFI_SUBARCH) gnu-efi header files))
+@@ -42,7 +43,7 @@
+ -DELF_DEBUG -DSYSLINUX_EFI -I$(objdir) \
+ $(GCCWARN) -D__COM32__ -mno-red-zone \
+ -DLDLINUX=\"$(LDLINUX)\" -fvisibility=hidden \
+- -Wno-unused-parameter
++ -Wno-unused-parameter $(GCCOPT)
+
+ # gnuefi sometimes installs these under a gnuefi/ directory, and sometimes not
+ CRT0 := $(shell find $(LIBDIR) -name crt0-efi-$(EFI_SUBARCH).o 2>/dev/null | tail -n1)
diff --git a/sys-boot/syslinux/metadata.xml b/sys-boot/syslinux/metadata.xml
new file mode 100644
index 000000000000..e73f4a697523
--- /dev/null
+++ b/sys-boot/syslinux/metadata.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<maintainer>
+ <email>chithanh@gentoo.org</email>
+ <name>Chí-Thanh Christopher Nguyễn</name>
+</maintainer>
+<herd>base-system</herd>
+</pkgmetadata>
diff --git a/sys-boot/syslinux/syslinux-3.86.ebuild b/sys-boot/syslinux/syslinux-3.86.ebuild
new file mode 100644
index 000000000000..79187cc0a5af
--- /dev/null
+++ b/sys-boot/syslinux/syslinux-3.86.ebuild
@@ -0,0 +1,56 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+inherit eutils toolchain-funcs
+
+DESCRIPTION="SysLinux, IsoLinux and PXELinux bootloader"
+HOMEPAGE="http://syslinux.zytor.com/"
+SRC_URI="mirror://kernel/linux/utils/boot/syslinux/${PV:0:1}.xx/${P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="-* amd64 x86"
+IUSE="custom-cflags"
+
+RDEPEND="sys-fs/mtools
+ dev-perl/Crypt-PasswdMD5
+ dev-perl/Digest-SHA1"
+DEPEND="${RDEPEND}
+ dev-lang/nasm"
+
+# This ebuild is a departure from the old way of rebuilding everything in syslinux
+# This departure is necessary since hpa doesn't support the rebuilding of anything other
+# than the installers.
+
+# removed all the unpack/patching stuff since we aren't rebuilding the core stuff anymore
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+ epatch "${FILESDIR}"/${PN}-3.86-nopie.patch
+
+ rm -f gethostip #bug 137081
+
+ local SYSLINUX_MAKEFILES="extlinux/Makefile linux/Makefile mtools/Makefile \
+ sample/Makefile utils/Makefile"
+ sed -i ${SYSLINUX_MAKEFILES} -e '/^LDFLAGS/d' || die "sed failed"
+
+ if use custom-cflags; then
+ sed -i ${SYSLINUX_MAKEFILES} \
+ -e 's|-g -Os||g' \
+ -e 's|-Os||g' \
+ -e 's|CFLAGS[[:space:]]\+=|CFLAGS +=|g' \
+ || die "sed custom-cflags failed"
+ fi
+
+}
+
+src_compile() {
+ emake CC=$(tc-getCC) installer || die
+}
+
+src_install() {
+ emake INSTALLSUBDIRS=utils INSTALLROOT="${D}" MANDIR=/usr/share/man install || die
+ dodoc README NEWS TODO doc/*
+}
diff --git a/sys-boot/syslinux/syslinux-4.07.ebuild b/sys-boot/syslinux/syslinux-4.07.ebuild
new file mode 100644
index 000000000000..05495b34a98a
--- /dev/null
+++ b/sys-boot/syslinux/syslinux-4.07.ebuild
@@ -0,0 +1,69 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+inherit eutils toolchain-funcs
+
+DESCRIPTION="SYSLINUX, PXELINUX, ISOLINUX, EXTLINUX and MEMDISK bootloaders"
+HOMEPAGE="http://syslinux.zytor.com/"
+SRC_URI="mirror://kernel/linux/utils/boot/syslinux/${PV:0:1}.xx/${P/_/-}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="-* amd64 x86"
+IUSE="custom-cflags"
+
+RDEPEND="sys-fs/mtools
+ dev-perl/Crypt-PasswdMD5
+ dev-perl/Digest-SHA1"
+DEPEND="${RDEPEND}
+ dev-lang/nasm
+ virtual/os-headers"
+
+S=${WORKDIR}/${P/_/-}
+
+# This ebuild is a departure from the old way of rebuilding everything in syslinux
+# This departure is necessary since hpa doesn't support the rebuilding of anything other
+# than the installers.
+
+# removed all the unpack/patching stuff since we aren't rebuilding the core stuff anymore
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+ # Fix building on hardened
+ epatch "${FILESDIR}"/${PN}-4.05-nopie.patch
+
+ rm -f gethostip #bug 137081
+
+ # Don't prestrip or override user LDFLAGS, bug #305783
+ local SYSLINUX_MAKEFILES="extlinux/Makefile linux/Makefile mtools/Makefile \
+ sample/Makefile utils/Makefile"
+ sed -i ${SYSLINUX_MAKEFILES} -e '/^LDFLAGS/d' || die "sed failed"
+
+ if use custom-cflags; then
+ sed -i ${SYSLINUX_MAKEFILES} \
+ -e 's|-g -Os||g' \
+ -e 's|-Os||g' \
+ -e 's|CFLAGS[[:space:]]\+=|CFLAGS +=|g' \
+ || die "sed custom-cflags failed"
+ else
+ QA_FLAGS_IGNORED="
+ /sbin/extlinux
+ /usr/bin/memdiskfind
+ /usr/bin/gethostip
+ /usr/bin/isohybrid
+ /usr/bin/syslinux
+ "
+ fi
+
+}
+
+src_compile() {
+ emake CC=$(tc-getCC) installer || die
+}
+
+src_install() {
+ emake INSTALLSUBDIRS=utils INSTALLROOT="${D}" MANDIR=/usr/share/man install || die
+ dodoc README NEWS doc/*.txt || die
+}
diff --git a/sys-boot/syslinux/syslinux-5.10.ebuild b/sys-boot/syslinux/syslinux-5.10.ebuild
new file mode 100644
index 000000000000..90f43652cfbf
--- /dev/null
+++ b/sys-boot/syslinux/syslinux-5.10.ebuild
@@ -0,0 +1,83 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+inherit eutils toolchain-funcs
+
+DESCRIPTION="SYSLINUX, PXELINUX, ISOLINUX, EXTLINUX and MEMDISK bootloaders"
+HOMEPAGE="http://www.syslinux.org/"
+SRC_URI="mirror://kernel/linux/utils/boot/syslinux/${PV:0:1}.xx/${P/_/-}.tar.xz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="-* amd64 x86"
+IUSE="custom-cflags"
+
+RDEPEND="sys-fs/mtools
+ dev-perl/Crypt-PasswdMD5
+ dev-perl/Digest-SHA1"
+DEPEND="${RDEPEND}
+ dev-lang/nasm
+ virtual/os-headers"
+
+S=${WORKDIR}/${P/_/-}
+
+# This ebuild is a departure from the old way of rebuilding everything in syslinux
+# This departure is necessary since hpa doesn't support the rebuilding of anything other
+# than the installers.
+
+# These are executables which come precompiled and are run by the boot loader
+QA_PREBUILT="usr/share/${PN}/*.c32"
+
+# removed all the unpack/patching stuff since we aren't rebuilding the core stuff anymore
+
+src_prepare() {
+ # Fix building on hardened
+ epatch "${FILESDIR}"/${PN}-4.05-nopie.patch
+
+ rm -f gethostip #bug 137081
+
+ # Don't prestrip or override user LDFLAGS, bug #305783
+ local SYSLINUX_MAKEFILES="extlinux/Makefile linux/Makefile mtools/Makefile \
+ sample/Makefile utils/Makefile"
+ sed -i ${SYSLINUX_MAKEFILES} -e '/^LDFLAGS/d' || die "sed failed"
+
+ if use custom-cflags; then
+ sed -i ${SYSLINUX_MAKEFILES} \
+ -e 's|-g -Os||g' \
+ -e 's|-Os||g' \
+ -e 's|CFLAGS[[:space:]]\+=|CFLAGS +=|g' \
+ || die "sed custom-cflags failed"
+ else
+ QA_FLAGS_IGNORED="
+ /sbin/extlinux
+ /usr/bin/memdiskfind
+ /usr/bin/gethostip
+ /usr/bin/isohybrid
+ /usr/bin/syslinux
+ "
+ fi
+
+}
+
+src_compile() {
+ emake CC=$(tc-getCC) installer
+}
+
+src_install() {
+ emake INSTALLSUBDIRS=utils INSTALLROOT="${D}" MANDIR=/usr/share/man install
+ dodoc README NEWS doc/*.txt
+}
+
+pkg_postinst() {
+ # print warning for users upgrading from the previous stable version
+ if has 4.07 ${REPLACING_VERSIONS}; then
+ ewarn "syslinux now uses dynamically linked ELF executables. Before you reboot,"
+ ewarn "ensure that needed dependencies are fulfilled. For example, run from your"
+ ewarn "syslinux directory:"
+ ewarn
+ ewarn "LD_LIBRARY_PATH=\".\" ldd menu.c32"
+ fi
+}
diff --git a/sys-boot/syslinux/syslinux-6.02.ebuild b/sys-boot/syslinux/syslinux-6.02.ebuild
new file mode 100644
index 000000000000..2be6a6be858e
--- /dev/null
+++ b/sys-boot/syslinux/syslinux-6.02.ebuild
@@ -0,0 +1,93 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils toolchain-funcs
+
+DESCRIPTION="SYSLINUX, PXELINUX, ISOLINUX, EXTLINUX and MEMDISK bootloaders"
+HOMEPAGE="http://www.syslinux.org/"
+SRC_URI="mirror://kernel/linux/utils/boot/syslinux/${P/_/-}.tar.xz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="-* ~amd64 ~x86"
+IUSE="custom-cflags"
+
+RDEPEND="sys-fs/mtools
+ dev-perl/Crypt-PasswdMD5
+ dev-perl/Digest-SHA1"
+DEPEND="${RDEPEND}
+ dev-lang/nasm
+ >=sys-boot/gnu-efi-3.0u
+ virtual/os-headers"
+
+S=${WORKDIR}/${P/_/-}
+
+# This ebuild is a departure from the old way of rebuilding everything in syslinux
+# This departure is necessary since hpa doesn't support the rebuilding of anything other
+# than the installers.
+
+# These are executables which come precompiled and are run by the boot loader
+QA_PREBUILT="usr/share/${PN}/*.c32"
+
+# removed all the unpack/patching stuff since we aren't rebuilding the core stuff anymore
+
+src_prepare() {
+ epatch "${FILESDIR}"/${P}-add-fno-stack-protector.patch
+ rm -f gethostip #bug 137081
+
+ # Don't prestrip or override user LDFLAGS, bug #305783
+ local SYSLINUX_MAKEFILES="extlinux/Makefile linux/Makefile mtools/Makefile \
+ sample/Makefile utils/Makefile"
+ sed -i ${SYSLINUX_MAKEFILES} -e '/^LDFLAGS/d' || die "sed failed"
+
+ if use custom-cflags; then
+ sed -i ${SYSLINUX_MAKEFILES} \
+ -e 's|-g -Os||g' \
+ -e 's|-Os||g' \
+ -e 's|CFLAGS[[:space:]]\+=|CFLAGS +=|g' \
+ || die "sed custom-cflags failed"
+ else
+ QA_FLAGS_IGNORED="
+ /sbin/extlinux
+ /usr/bin/memdiskfind
+ /usr/bin/gethostip
+ /usr/bin/isohybrid
+ /usr/bin/syslinux
+ "
+ fi
+ case ${ARCH} in
+ amd64) loaderarch="efi64" ;;
+ x86) loaderarch="efi32" ;;
+ *) ewarn "Unsupported architecture, building installers only." ;;
+ esac
+}
+
+src_compile() {
+ # build system abuses the LDFLAGS variable to pass arguments to ld
+ unset LDFLAGS
+ if [[ ! -z ${loaderarch} ]]; then
+ emake CC=$(tc-getCC) LD=$(tc-getLD) ${loaderarch}
+ fi
+ emake CC=$(tc-getCC) LD=$(tc-getLD) ${loaderarch} installer
+}
+
+src_install() {
+ # parallel install fails sometimes
+ einfo "loaderarch=${loaderarch}"
+ emake -j1 LD=$(tc-getLD) INSTALLROOT="${D}" MANDIR=/usr/share/man bios ${loaderarch} install
+ dodoc README NEWS doc/*.txt
+}
+
+pkg_postinst() {
+ # print warning for users upgrading from the previous stable version
+ if has 4.06 ${REPLACING_VERSIONS}; then
+ ewarn "syslinux now uses dynamically linked ELF executables. Before you reboot,"
+ ewarn "ensure that needed dependencies are fulfilled. For example, run from your"
+ ewarn "syslinux directory:"
+ ewarn
+ ewarn "LD_LIBRARY_PATH=\".\" ldd menu.c32"
+ fi
+}
diff --git a/sys-boot/syslinux/syslinux-6.03.ebuild b/sys-boot/syslinux/syslinux-6.03.ebuild
new file mode 100644
index 000000000000..503baaeec619
--- /dev/null
+++ b/sys-boot/syslinux/syslinux-6.03.ebuild
@@ -0,0 +1,100 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils toolchain-funcs
+
+DESCRIPTION="SYSLINUX, PXELINUX, ISOLINUX, EXTLINUX and MEMDISK bootloaders"
+HOMEPAGE="http://www.syslinux.org/"
+# Final releases in 6.xx/$PV.tar.* (literal "xx")
+# Testing releases in Testing/$PV/$PV.tar.*
+SRC_URI_DIR=${PV:0:1}.xx
+SRC_URI_TESTING=Testing/${PV:0:4}
+[[ ${PV/_alpha} != $PV ]] && SRC_URI_DIR=$SRC_URI_TESTING
+[[ ${PV/_beta} != $PV ]] && SRC_URI_DIR=$SRC_URI_TESTING
+[[ ${PV/_pre} != $PV ]] && SRC_URI_DIR=$SRC_URI_TESTING
+[[ ${PV/_rc} != $PV ]] && SRC_URI_DIR=$SRC_URI_TESTING
+SRC_URI="mirror://kernel/linux/utils/boot/syslinux/${SRC_URI_DIR}/${P/_/-}.tar.xz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="-* ~amd64 ~x86"
+IUSE="custom-cflags"
+
+RDEPEND="sys-fs/mtools
+ dev-perl/Crypt-PasswdMD5
+ dev-perl/Digest-SHA1"
+DEPEND="${RDEPEND}
+ dev-lang/nasm
+ >=sys-boot/gnu-efi-3.0u
+ virtual/os-headers"
+
+S=${WORKDIR}/${P/_/-}
+
+# This ebuild is a departure from the old way of rebuilding everything in syslinux
+# This departure is necessary since hpa doesn't support the rebuilding of anything other
+# than the installers.
+
+# These are executables which come precompiled and are run by the boot loader
+QA_PREBUILT="usr/share/${PN}/*.c32"
+
+# removed all the unpack/patching stuff since we aren't rebuilding the core stuff anymore
+
+src_prepare() {
+ rm -f gethostip #bug 137081
+
+ # Don't prestrip or override user LDFLAGS, bug #305783
+ local SYSLINUX_MAKEFILES="extlinux/Makefile linux/Makefile mtools/Makefile \
+ sample/Makefile utils/Makefile"
+ sed -i ${SYSLINUX_MAKEFILES} -e '/^LDFLAGS/d' || die "sed failed"
+
+ if use custom-cflags; then
+ sed -i ${SYSLINUX_MAKEFILES} \
+ -e 's|-g -Os||g' \
+ -e 's|-Os||g' \
+ -e 's|CFLAGS[[:space:]]\+=|CFLAGS +=|g' \
+ || die "sed custom-cflags failed"
+ else
+ QA_FLAGS_IGNORED="
+ /sbin/extlinux
+ /usr/bin/memdiskfind
+ /usr/bin/gethostip
+ /usr/bin/isohybrid
+ /usr/bin/syslinux
+ "
+ fi
+ case ${ARCH} in
+ amd64) loaderarch="efi64" ;;
+ x86) loaderarch="efi32" ;;
+ *) ewarn "Unsupported architecture, building installers only." ;;
+ esac
+}
+
+src_compile() {
+ # build system abuses the LDFLAGS variable to pass arguments to ld
+ unset LDFLAGS
+ if [[ ! -z ${loaderarch} ]]; then
+ emake CC=$(tc-getCC) LD=$(tc-getLD) ${loaderarch}
+ fi
+ emake CC=$(tc-getCC) LD=$(tc-getLD) ${loaderarch} installer
+}
+
+src_install() {
+ # parallel install fails sometimes
+ einfo "loaderarch=${loaderarch}"
+ emake -j1 LD=$(tc-getLD) INSTALLROOT="${D}" MANDIR=/usr/share/man bios ${loaderarch} install
+ dodoc README NEWS doc/*.txt
+}
+
+pkg_postinst() {
+ # print warning for users upgrading from the previous stable version
+ if has 4.07 ${REPLACING_VERSIONS}; then
+ ewarn "syslinux now uses dynamically linked ELF executables. Before you reboot,"
+ ewarn "ensure that needed dependencies are fulfilled. For example, run from your"
+ ewarn "syslinux directory:"
+ ewarn
+ ewarn "LD_LIBRARY_PATH=\".\" ldd menu.c32"
+ fi
+}
diff --git a/sys-boot/tboot/Manifest b/sys-boot/tboot/Manifest
new file mode 100644
index 000000000000..9fcc0fa59801
--- /dev/null
+++ b/sys-boot/tboot/Manifest
@@ -0,0 +1 @@
+DIST tboot-1.8.3.tar.gz 554084 SHA256 2f2e0c3865b45691f76b31730c5aaea2f076e7949ee6309e78ed7f80d8c53d39 SHA512 cde961af07c64a7d8b77f64d48e6d9230048135420e78efc6277f32e4df78012b5bbd73e4f2ce1cd6194091ec306cc84c65356865815a7311e140fd2b94f6443 WHIRLPOOL 030ab29ee710c6201e894abfd693944490c157b2607425dd6d476f836a635ee7f82c29180ad13fc80508596dc62148aa1c108bd7aba1c9ca7329f99197d97db6
diff --git a/sys-boot/tboot/files/tboot-1.8.2-disable-pcid.patch b/sys-boot/tboot/files/tboot-1.8.2-disable-pcid.patch
new file mode 100644
index 000000000000..383338e69933
--- /dev/null
+++ b/sys-boot/tboot/files/tboot-1.8.2-disable-pcid.patch
@@ -0,0 +1,26 @@
+diff -ur tboot-1.8.2.orig/tboot/common/shutdown.S tboot-1.8.2/tboot/common/shutdown.S
+--- tboot-1.8.2.orig/tboot/common/shutdown.S 2014-07-28 12:24:22.000000000 +0400
++++ tboot-1.8.2/tboot/common/shutdown.S 2015-05-07 03:05:47.300985413 +0400
+@@ -34,6 +34,11 @@
+ */
+
+ compat_mode_entry:
++ /* Disable PCID */
++ movl %cr4, %eax
++ andl $~CR4_PCIDE, %eax
++ movl %eax, %cr4
++
+ /* Disable paging and therefore leave 64 bit mode. */
+ movl %cr0, %eax
+ andl $~CR0_PG, %eax
+diff -ur tboot-1.8.2.orig/tboot/include/processor.h tboot-1.8.2/tboot/include/processor.h
+--- tboot-1.8.2.orig/tboot/include/processor.h 2014-07-28 12:24:22.000000000 +0400
++++ tboot-1.8.2/tboot/include/processor.h 2015-05-07 03:04:58.721244858 +0400
+@@ -92,6 +92,7 @@
+ #define CR4_XMM 0x00000400 /* enable SIMD/MMX2 to use except 16 */
+ #define CR4_VMXE 0x00002000/* enable VMX */
+ #define CR4_SMXE 0x00004000/* enable SMX */
++#define CR4_PCIDE 0x00020000/* enable PCID */
+
+ #ifndef __ASSEMBLY__
+
diff --git a/sys-boot/tboot/files/tboot-1.8.2-genkernel_arch.patch b/sys-boot/tboot/files/tboot-1.8.2-genkernel_arch.patch
new file mode 100644
index 000000000000..7fdcad652e03
--- /dev/null
+++ b/sys-boot/tboot/files/tboot-1.8.2-genkernel_arch.patch
@@ -0,0 +1,57 @@
+diff -ru tboot-1.8.2.orig/tboot/20_linux_tboot tboot-1.8.2/tboot/20_linux_tboot
+--- tboot-1.8.2.orig/tboot/20_linux_tboot 2014-08-02 00:18:58.397147454 +0400
++++ tboot-1.8.2/tboot/20_linux_tboot 2014-08-02 00:20:09.766700748 +0400
+@@ -121,6 +121,15 @@
+ EOF
+ }
+
++machine=`uname -m`
++case "$machine" in
++ i?86) GENKERNEL_ARCH="x86" ;;
++ mips|mips64) GENKERNEL_ARCH="mips" ;;
++ mipsel|mips64el) GENKERNEL_ARCH="mipsel" ;;
++ arm*) GENKERNEL_ARCH="arm" ;;
++ *) GENKERNEL_ARCH="$machine" ;;
++esac
++
+ linux_list=`for i in /boot/vmlinu[xz]-* /vmlinu[xz]-* ; do
+ basename=$(basename $i)
+ version=$(echo $basename | sed -e "s,^[^0-9]*-,,g")
+@@ -159,6 +168,8 @@
+ "initrd-${version}" "initramfs-${version}.img" \
+ "initrd.img-${alt_version}" "initrd-${alt_version}.img" \
+ "initrd-${alt_version}" "initramfs-${alt_version}.img" \
++ "initramfs-genkernel-${GENKERNEL_ARCH}-${version}" \
++ "initramfs-genkernel-${GENKERNEL_ARCH}-${alt_version}" \
+ "initramfs-genkernel-${version}" \
+ "initramfs-genkernel-${alt_version}"; do
+ if test -e "${dirname}/${i}" ; then
+diff -ru tboot-1.8.2.orig/tboot/20_linux_xen_tboot tboot-1.8.2/tboot/20_linux_xen_tboot
+--- tboot-1.8.2.orig/tboot/20_linux_xen_tboot 2014-08-02 00:18:58.397147454 +0400
++++ tboot-1.8.2/tboot/20_linux_xen_tboot 2014-08-02 00:21:12.840438230 +0400
+@@ -147,6 +147,16 @@
+ if [ "x${linux_list}" = "x" ] ; then
+ exit 0
+ fi
++
++machine=`uname -m`
++case "$machine" in
++ i?86) GENKERNEL_ARCH="x86" ;;
++ mips|mips64) GENKERNEL_ARCH="mips" ;;
++ mipsel|mips64el) GENKERNEL_ARCH="mipsel" ;;
++ arm*) GENKERNEL_ARCH="arm" ;;
++ *) GENKERNEL_ARCH="$machine" ;;
++esac
++
+ xen_list=`for i in /boot/xen*; do
+ if grub_file_is_not_garbage "$i" ; then echo -n "$i " ; fi
+ done`
+@@ -188,6 +198,8 @@
+ for i in "initrd.img-${version}" "initrd-${version}.img" \
+ "initrd-${version}" "initrd.img-${alt_version}" \
+ "initrd-${alt_version}.img" "initrd-${alt_version}" \
++ "initramfs-genkernel-${GENKERNEL_ARCH}-${version}" \
++ "initramfs-genkernel-${GENKERNEL_ARCH}-${alt_version}" \
+ "initramfs-genkernel-${version}" \
+ "initramfs-genkernel-${alt_version}" ; do
+ if test -e "${dirname}/${i}" ; then
diff --git a/sys-boot/tboot/files/tboot-1.8.2-stack-check-no.patch b/sys-boot/tboot/files/tboot-1.8.2-stack-check-no.patch
new file mode 100644
index 000000000000..5d2ea6296343
--- /dev/null
+++ b/sys-boot/tboot/files/tboot-1.8.2-stack-check-no.patch
@@ -0,0 +1,11 @@
+diff -ur tboot-1.8.2.orig/tboot/Config.mk tboot-1.8.2/tboot/Config.mk
+--- tboot-1.8.2.orig/tboot/Config.mk 2014-07-28 12:24:21.000000000 +0400
++++ tboot-1.8.2/tboot/Config.mk 2015-05-05 02:14:26.333222301 +0400
+@@ -30,6 +30,7 @@
+ CFLAGS += $(call cc-option,$(CC),-nopie,)
+ CFLAGS += $(call cc-option,$(CC),-fno-stack-protector,)
+ CFLAGS += $(call cc-option,$(CC),-fno-stack-protector-all,)
++CFLAGS += $(call cc-option,$(CC),-fstack-check=no,)
+
+ # changeset variable for banner
+ CFLAGS += -DTBOOT_CHANGESET=\""$(shell ((hg parents --template "{isodate|isodate} {rev}:{node|short}" >/dev/null && hg parents --template "{isodate|isodate} {rev}:{node|short}") || echo "2014-07-28 12:00 +0800 1.8.2") 2>/dev/null)"\"
diff --git a/sys-boot/tboot/metadata.xml b/sys-boot/tboot/metadata.xml
new file mode 100644
index 000000000000..3fd684423609
--- /dev/null
+++ b/sys-boot/tboot/metadata.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>perfinion@gentoo.org</email>
+ <name>Jason Zaman</name>
+ </maintainer>
+ <longdescription lang="en">
+ A pre-kernel/VMM module that uses Intel(R) Trusted Execution Technology to perform a measured and verified launch of an OS kernel/VMM.
+ </longdescription>
+ <upstream>
+ <remote-id type="sourceforge">tboot</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-boot/tboot/tboot-1.8.3.ebuild b/sys-boot/tboot/tboot-1.8.3.ebuild
new file mode 100644
index 000000000000..91e8c70e809d
--- /dev/null
+++ b/sys-boot/tboot/tboot-1.8.3.ebuild
@@ -0,0 +1,72 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit flag-o-matic mount-boot
+
+DESCRIPTION="A module that uses Intel(R) Trusted Execution Technology to perform a measured and verified boot"
+HOMEPAGE="http://sourceforge.net/projects/tboot/"
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~amd64 ~x86 -*"
+IUSE="custom-cflags"
+
+RESTRICT="test" # test is restricted because it requires patching the kernel src
+
+DEPEND="app-crypt/trousers
+app-crypt/tpm-tools"
+
+RDEPEND="${DEPEND}
+sys-boot/grub:2"
+
+DOCS=(README COPYING CHANGELOG)
+
+src_prepare() {
+ epatch "${FILESDIR}/tboot-1.8.2-genkernel_arch.patch"
+ epatch "${FILESDIR}/tboot-1.8.2-stack-check-no.patch" # breaks with ssp
+ epatch "${FILESDIR}/tboot-1.8.2-disable-pcid.patch" # PaX enables pcid
+
+ sed -i 's/ -Werror//g' Config.mk || die
+ sed -i 's/^INSTALL_STRIP = -s$//' Config.mk || die # QA Errors
+
+ epatch_user
+}
+
+src_compile() {
+ use custom-cflags && export TBOOT_CFLAGS=${CFLAGS} || unset CCASFLAGS CFLAGS CPPFLAGS LDFLAGS
+
+ if use amd64; then
+ MAKEARGS="TARGET_ARCH=x86_64"
+ else
+ MAKEARGS="TARGET_ARCH=i686"
+ fi
+
+ emake debug=y ${MAKEARGS} build
+}
+
+src_install() {
+ emake DISTDIR="${D}" install
+
+ dodoc "${DOCS[@]}"
+ dodoc docs/*.txt lcptools/*.{txt,pdf} || die "docs failed"
+
+ cd "${D}"
+ mkdir -p usr/lib/tboot/ || die
+ mv boot usr/lib/tboot/ || die
+}
+
+pkg_postinst() {
+ mount-boot_mount_boot_partition
+
+ cp ${ROOT%/}/usr/lib/tboot/boot/* ${ROOT%/}/boot/
+
+ mount-boot_pkg_postinst
+
+ ewarn "Please remember to download the SINIT AC Module relevant"
+ ewarn "for your platform from:"
+ ewarn "http://software.intel.com/en-us/articles/intel-trusted-execution-technology/"
+}
diff --git a/sys-boot/unetbootin/Manifest b/sys-boot/unetbootin/Manifest
new file mode 100644
index 000000000000..a8af19bd9bcf
--- /dev/null
+++ b/sys-boot/unetbootin/Manifest
@@ -0,0 +1,2 @@
+DIST 619.tar.gz 22669784 SHA256 84bd5b29a46f61156868acf0d069c2c6b3ec13435dc11cc82f93e8c30523966f SHA512 81a02c0b7866f878139133562db745538f1f22fb90231a228792dccd3c5ff0c1c7cefc435b34cc14302b0d2b20e97342295fb65c7f28c220a637b1d52fa77e3c WHIRLPOOL 66a46933ea16b73f94d95080241103bac985694bc7b28e4213341aa9e6cb03f0fdf85bc19f9491b1ac97cba2ac83edfdba31965b9d138ef46bbf337bf03ded05
+DIST unetbootin-source-608.tar.gz 752043 SHA256 ce99c5f60b1f66da0ceb41859ce9198d96b3061b949b167fc952d3951b632080 SHA512 d164537c96845eb90ac5aae1fa0c553c9392d778696e4818760cb11f78341e6a3ea6a05f702678583c5d680dc8fb1348cdc2b2dfba9bebfdf793779c23611d16 WHIRLPOOL 56cc31e047c283b4f6ef639283c7e9a3e59332fb4f3b70baa279e973c19adc42a276074087b530a49cad41076cf29990c65323d805e0a7b4fccd37bdf1132649
diff --git a/sys-boot/unetbootin/files/unetbootin-581-desktop.patch b/sys-boot/unetbootin/files/unetbootin-581-desktop.patch
new file mode 100644
index 000000000000..ab1912b2e8a0
--- /dev/null
+++ b/sys-boot/unetbootin/files/unetbootin-581-desktop.patch
@@ -0,0 +1,24 @@
+ * unetbootin.desktop: error: key "GenericName[en_US]" in group "Desktop Entry"
+ is a localized key, but there is no non-localized key "GenericName"
+ * unetbootin.desktop: warning: value "Application;System;" for key
+ "Categories" in group "Desktop Entry" contains a deprecated value
+ * "Application"
+
+
+
+--- a/unetbootin.desktop
++++ b/unetbootin.desktop
+@@ -2,11 +2,11 @@
+ Version=1.0
+ Name=UNetbootin
+ Comment=Tool for creating Live USB drives
+-Categories=Application;System;
++Categories=System;
+ Exec=/usr/bin/unetbootin
+ Terminal=false
+ Type=Application
+ Name[en_US]=UNetbootin
+-GenericName[en_US]=UNetbootin
++GenericName=UNetbootin
+ Comment[en_US]=Tool for creating Live USB drives
+ Icon=unetbootin
diff --git a/sys-boot/unetbootin/metadata.xml b/sys-boot/unetbootin/metadata.xml
new file mode 100644
index 000000000000..d15162d662b7
--- /dev/null
+++ b/sys-boot/unetbootin/metadata.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>jer@gentoo.org</email>
+ <name>Jeroen Roovers</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="sourceforge">unetbootin</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-boot/unetbootin/unetbootin-608.ebuild b/sys-boot/unetbootin/unetbootin-608.ebuild
new file mode 100644
index 000000000000..695548c0e419
--- /dev/null
+++ b/sys-boot/unetbootin/unetbootin-608.ebuild
@@ -0,0 +1,89 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils qt4-r2
+
+DESCRIPTION="Universal Netboot Installer creates Live USB systems for various OS distributions"
+HOMEPAGE="http://unetbootin.sourceforge.net/"
+SRC_URI="mirror://sourceforge/${PN}/${PN}-source-${PV}.tar.gz"
+
+SLOT="0"
+LICENSE="GPL-2"
+KEYWORDS="amd64 x86"
+IUSE=""
+
+UNBI_LINGUAS="
+ am ar ast be bg bn ca cs da de el eo es et eu fa fi fo fr gl he hr hu id it
+ ja lt lv ml ms nan nb nl nn pl pt_BR pt ro ru si sk sl sr sv sw tr uk ur vi
+ zh_CN zh_TW
+"
+
+for lingua in ${UNBI_LINGUAS}; do
+ IUSE="${IUSE} linguas_${lingua}"
+done
+
+S="${WORKDIR}"
+
+DEPEND="dev-qt/qtgui:4"
+RDEPEND="
+ ${DEPEND}
+ app-arch/p7zip
+ sys-boot/syslinux
+ sys-fs/mtools
+"
+
+src_prepare() {
+ epatch "${FILESDIR}/${PN}-581-desktop.patch"
+
+ # QA check in case linguas are added or removed
+ enum() {
+ echo ${#}
+ }
+ [[ $(enum ${UNBI_LINGUAS}) -eq $(( $(enum $(echo ${PN}_*.ts) ) -1 )) ]] \
+ || die "Numbers of recorded and actual linguas do not match"
+ unset enum
+
+ # Make room between the last line of TRANSLATIONS and the next definition
+ sed -i \
+ -e '/^DEFINES/s|.*|\n&|g' \
+ ${PN}.pro || die
+
+ # Remove localisations
+ local lingua
+ for lingua in ${UNBI_LINGUAS}; do
+ if ! use linguas_${lingua}; then
+ sed -i ${PN}.pro -e "/\.*${PN}_${lingua}\.ts.*/d" || die
+ rm ${PN}_${lingua}.ts || die
+ fi
+ done
+}
+
+src_configure() {
+ lupdate ${PN}.pro || die
+ lrelease ${PN}.pro || die
+ eqmake4 ${PN}.pro || die
+}
+
+src_install() {
+ dobin ${PN}
+
+ domenu ${PN}.desktop
+
+ for file in ${PN}*.png; do
+ size="${file/${PN}_}"
+ size="${size/.png}x${size/.png}"
+ insinto /usr/share/icons/hicolor/${size}/apps
+ newins ${file} ${PN}.png
+ done
+
+ local lingua
+ for lingua in ${UNBI_LINGUAS}; do
+ if use linguas_${lingua}; then
+ insinto /usr/share/${PN}
+ doins ${PN}_${lingua}.qm
+ fi
+ done
+}
diff --git a/sys-boot/unetbootin/unetbootin-619.ebuild b/sys-boot/unetbootin/unetbootin-619.ebuild
new file mode 100644
index 000000000000..9fb9454c24ca
--- /dev/null
+++ b/sys-boot/unetbootin/unetbootin-619.ebuild
@@ -0,0 +1,89 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils qt4-r2
+
+DESCRIPTION="UNetbootin installs Linux/BSD distributions to a partition or USB drive"
+HOMEPAGE="https://github.com/unetbootin/unetbootin"
+SRC_URI="${HOMEPAGE}/archive/619.tar.gz -> ${PV}.tar.gz"
+
+SLOT="0"
+LICENSE="GPL-2"
+KEYWORDS="~amd64 ~x86"
+
+UNBI_LINGUAS="
+ am ar ast be bg bn ca cs da de el eo es et eu fa fi fo fr gl he hr hu id it
+ ja lt lv ml ms nan nb nl nn pl pt_BR pt ro ru si sk sl sr sv sw tr uk ur vi
+ zh_CN zh_TW
+"
+
+for lingua in ${UNBI_LINGUAS}; do
+ IUSE="${IUSE} linguas_${lingua}"
+done
+
+S=${WORKDIR}/${P}/src/${PN}
+
+DEPEND="dev-qt/qtgui:4"
+RDEPEND="
+ ${DEPEND}
+ app-arch/p7zip
+ sys-boot/syslinux
+ sys-fs/mtools
+"
+
+src_prepare() {
+ epatch "${FILESDIR}/${PN}-581-desktop.patch"
+
+ # QA check in case linguas are added or removed
+ enum() {
+ echo ${#}
+ }
+ [[ $(enum ${UNBI_LINGUAS}) -eq $(( $(enum $(echo ${PN}_*.ts) ) -1 )) ]] \
+ || die "Numbers of recorded and actual linguas do not match"
+ unset enum
+
+ # Make room between the last line of TRANSLATIONS and the next definition
+ sed -i \
+ -e '/^DEFINES/s|.*|\n&|g' \
+ ${PN}.pro || die
+
+ # Remove localisations
+ local lingua
+ for lingua in ${UNBI_LINGUAS}; do
+ if ! use linguas_${lingua}; then
+ sed -i ${PN}.pro -e "/\.*${PN}_${lingua}\.ts.*/d" || die
+ rm ${PN}_${lingua}.ts || die
+ fi
+ done
+}
+
+src_configure() {
+ sed -i -e '/^RESOURCES/d' unetbootin.pro || die
+ lupdate ${PN}.pro || die
+ lrelease ${PN}.pro || die
+ eqmake4 ${PN}.pro || die
+}
+
+src_install() {
+ dobin ${PN}
+
+ domenu ${PN}.desktop
+
+ for file in ${PN}*.png; do
+ size="${file/${PN}_}"
+ size="${size/.png}x${size/.png}"
+ insinto /usr/share/icons/hicolor/${size}/apps
+ newins ${file} ${PN}.png
+ done
+
+ local lingua
+ for lingua in ${UNBI_LINGUAS}; do
+ if use linguas_${lingua}; then
+ insinto /usr/share/${PN}
+ doins ${PN}_${lingua}.qm
+ fi
+ done
+}
diff --git a/sys-boot/vboot-utils/Manifest b/sys-boot/vboot-utils/Manifest
new file mode 100644
index 000000000000..56f89ed4a649
--- /dev/null
+++ b/sys-boot/vboot-utils/Manifest
@@ -0,0 +1,2 @@
+DIST vboot-utils-20130222gite6cf2c2-3.fc19.src.rpm 2170079 SHA256 f20235e5f708bcbe3b30cb684a5aa9fa3f60d1fdea454375db0e62bebabd0c41 SHA512 ccb5320f01d270ff30465e6ffc234d245220afdb9628f9b5f9e8abc7c91c5e58085b5e8eefe217e85faa18166576d945cad9f757d99927389473cb0a4337a05f WHIRLPOOL 9da1a4f503619c9754e4c0b1c2d52deb4c687e693ba521213e2406cba417f5b8ce5645285ed2e106c0d05f56bd325dc7f929692c5de2ff1be2bb7fe191f74c68
+DIST vboot-utils-42_p20150219.tar.xz 18578108 SHA256 058053fd48afeeb30b48c51eb932ee3f477b1e7fc429b56ed776262010f30226 SHA512 bf1b5579f80bfd3804d74f5fed5ca0f85ff3d66cc4efd1c5e744ab0de50309c7e5168fe9a751579e9fcc0cb7dda72fc98497b2e13437b357b0ad9bb063edd33a WHIRLPOOL 01e5ca949ef417930669783d02b03d103005c6daa395f46bb3eab96a8d7de06875e3017697ed42d6200ca8e649b6b21737c5fc773a25da6da7a61c268dceba90
diff --git a/sys-boot/vboot-utils/files/vboot-utils-42_p20150219-cgpt-static.patch b/sys-boot/vboot-utils/files/vboot-utils-42_p20150219-cgpt-static.patch
new file mode 100644
index 000000000000..3f53fc7be769
--- /dev/null
+++ b/sys-boot/vboot-utils/files/vboot-utils-42_p20150219-cgpt-static.patch
@@ -0,0 +1,36 @@
+From 9d437e9122019568df7fa2d602f911e6a873d78b Mon Sep 17 00:00:00 2001
+From: Anatol Pomazau <anatol@google.com>
+Date: Thu, 19 Feb 2015 05:11:51 -0800
+Subject: [PATCH] Remove duplicated linker flag
+
+We already set '-static' to LDFLAGS above no need to do it again here.
+
+TEST=build with 'make' and 'make STATIC=1'. Check that 'STATIC=1' adds '-static' linker flag.
+BUG=None
+
+Change-Id: I83e23984753094af203432eb4570930085788398
+Reviewed-on: https://chromium-review.googlesource.com/251151
+Reviewed-by: Mike Frysinger <vapier@chromium.org>
+Reviewed-by: Hung-Te Lin <hungte@chromium.org>
+Reviewed-by: Anatol Pomazau <anatol@google.com>
+Commit-Queue: Anatol Pomazau <anatol@google.com>
+Tested-by: Anatol Pomazau <anatol@google.com>
+---
+ Makefile | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/Makefile b/Makefile
+index dfa971c..c0c5f50 100644
+--- a/Makefile
++++ b/Makefile
+@@ -960,7 +960,6 @@ ${CGPT_WRAPPER}: ${CGPT_WRAPPER_OBJS} ${UTILLIB}
+ .PHONY: cgpt
+ cgpt: ${CGPT} ${CGPT_WRAPPER}
+
+-${CGPT}: LDFLAGS += -static
+ ${CGPT}: LDLIBS += -luuid
+
+ ${CGPT}: ${CGPT_OBJS} ${UTILLIB}
+--
+2.3.1
+
diff --git a/sys-boot/vboot-utils/metadata.xml b/sys-boot/vboot-utils/metadata.xml
new file mode 100644
index 000000000000..29458b570571
--- /dev/null
+++ b/sys-boot/vboot-utils/metadata.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <upstream>
+ <bugs-to>http://crbug.com</bugs-to>
+ <changelog>https://chromium.googlesource.com/chromiumos/platform/vboot_reference/+log/master</changelog>
+ <doc>https://chromium.googlesource.com/chromiumos/platform/vboot_reference/+/master/README</doc>
+ </upstream>
+ <maintainer>
+ <email>zmedico@gentoo.org</email>
+ </maintainer>
+ <maintainer>
+ <email>vapier@gentoo.org</email>
+ </maintainer>
+</pkgmetadata>
diff --git a/sys-boot/vboot-utils/vboot-utils-1.0_p20130222.ebuild b/sys-boot/vboot-utils/vboot-utils-1.0_p20130222.ebuild
new file mode 100644
index 000000000000..1b05595346e9
--- /dev/null
+++ b/sys-boot/vboot-utils/vboot-utils-1.0_p20130222.ebuild
@@ -0,0 +1,75 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+inherit eutils rpm toolchain-funcs
+
+KEYWORDS="~amd64 ~arm ~x86"
+DESCRIPTION="Chrome OS verified boot tools"
+HOMEPAGE="http://git.chromium.org/gitweb/?p=chromiumos/platform/vboot_reference.git"
+EGIT_COMMIT="e6cf2c21a1cd6fc46b6adcaadc865e2f8bd4874e"
+MY_VERSION="${PV##*_p}git${EGIT_COMMIT:0:7}"
+MY_PV="${PN}-${MY_VERSION}"
+SRC_URI="http://kojipkgs.fedoraproject.org/packages/${PN}/${MY_VERSION}/3.fc19/src/${MY_PV}-3.fc19.src.rpm"
+LICENSE="BSD"
+SLOT="0"
+IUSE=""
+
+RDEPEND="app-arch/xz-utils:=
+ dev-libs/libyaml:=
+ dev-libs/openssl:0=
+ sys-apps/util-linux:="
+
+DEPEND="app-crypt/trousers
+ ${RDEPEND}"
+
+S=${WORKDIR}
+
+src_unpack() {
+ rpm_unpack ${A}
+ unpack ./${MY_PV}.tar.xz
+ mv ./${MY_PV}/* ./ || die
+}
+
+src_prepare() {
+ epatch *.patch
+ sed -e 's:-Werror ::g' -e 's:-nostdinc ::g' \
+ -i Makefile || die
+}
+
+src_compile() {
+ mkdir "${S}"/build-main || die
+ tc-export CC AR CXX PKG_CONFIG
+ emake \
+ -j1 \
+ V=1 \
+ BUILD="${S}"/build-main \
+ ARCH=$(tc-arch) \
+ all
+ unset CC AR CXX PKG_CONFIG
+}
+
+src_test() {
+ # ARCH and HOST_ARCH must be identical in order
+ # to avoid calling qemu.
+ local arch=$(tc-arch)
+ [[ ${arch} == amd64 ]] && arch=x86_64
+ emake \
+ V=1 \
+ BUILD="${S}"/build-main \
+ ARCH=${arch} \
+ HOST_ARCH=${arch} \
+ runtests
+}
+
+src_install() {
+ emake \
+ V=1 \
+ BUILD="${S}"/build-main \
+ DESTDIR="${ED}/usr/bin" \
+ install
+ insinto /usr/share/vboot/devkeys
+ doins tests/devkeys/*
+ dodoc README
+}
diff --git a/sys-boot/vboot-utils/vboot-utils-42_p20150219.ebuild b/sys-boot/vboot-utils/vboot-utils-42_p20150219.ebuild
new file mode 100644
index 000000000000..4f6f3f5c5b74
--- /dev/null
+++ b/sys-boot/vboot-utils/vboot-utils-42_p20150219.ebuild
@@ -0,0 +1,82 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils toolchain-funcs
+
+# This is the latest commit in the latest branch.
+GIT_SHA1="f44ebbe36b2c1603437edc57b534244e89bfcd9c"
+
+DESCRIPTION="Chrome OS verified boot tools"
+HOMEPAGE="https://chromium.googlesource.com/chromiumos/platform/vboot_reference/ http://dev.chromium.org/chromium-os/chromiumos-design-docs/verified-boot"
+# Can't use gitiles directly until b/19710536 is fixed.
+#SRC_URI="https://chromium.googlesource.com/chromiumos/platform/vboot_reference/+archive/${GIT_SHA1}.tar.gz -> ${P}.tar.gz"
+SRC_URI="mirror://gentoo/${P}.tar.xz"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~arm64 ~mips ~x86"
+IUSE="minimal static"
+
+RDEPEND="dev-libs/openssl:0=
+ sys-apps/util-linux:=
+ !minimal? (
+ app-arch/xz-utils:=
+ dev-libs/libyaml:=
+ )"
+DEPEND="${RDEPEND}
+ app-crypt/trousers"
+
+S=${WORKDIR}
+
+src_prepare() {
+ epatch "${FILESDIR}"/${P}-cgpt-static.patch
+ sed -i \
+ -e 's: -Werror : :g' \
+ Makefile || die
+}
+
+_emake() {
+ local arch=$(tc-arch)
+ emake \
+ V=1 \
+ QEMU_ARCH= \
+ ARCH=${arch} \
+ HOST_ARCH=${arch} \
+ LIBDIR="$(get_libdir)" \
+ DEBUG_FLAGS= \
+ MINIMAL=$(usev minimal) \
+ STATIC=$(usev static) \
+ "$@"
+}
+
+src_compile() {
+ tc-export CC AR CXX PKG_CONFIG
+ _emake TEST_BINS= all
+}
+
+src_test() {
+ _emake runtests
+}
+
+src_install() {
+ _emake DESTDIR="${ED}/usr" install
+ if ! use minimal ; then
+ rm -r "${ED}"/usr/default || die
+ fi
+
+ insinto /usr/share/vboot/devkeys
+ doins tests/devkeys/*
+
+ insinto /usr/include/vboot
+ doins host/include/* \
+ firmware/include/gpt.h \
+ firmware/include/tlcl.h \
+ firmware/include/tss_constants.h
+
+ dolib.a build/libvboot_host.a
+
+ dodoc README
+}
diff --git a/sys-boot/winusb/Manifest b/sys-boot/winusb/Manifest
new file mode 100644
index 000000000000..bac25e05f93a
--- /dev/null
+++ b/sys-boot/winusb/Manifest
@@ -0,0 +1 @@
+DIST winusb-1.0.11.tar.gz 566128 SHA256 7bd8d2e63651134bd4173dcf358708fb9e6de1677c088e67d45995a1d5066bc9 SHA512 4d60aa440b811d6fb0a5bb71155f689f767e976572736c324040651b77bfc58d883a98e95afdef63c3cd97b3a49027a059e8e70ebb1d23ba830d7251ac72ae42 WHIRLPOOL 751af916c4eac9b9ca6b60b605466ffd68926a6640a4dbc80013a16122b98b37afb74d1b4ac5832618e060d9d1cd6afbf9724b0aab2a73d9f8b51693956166d4
diff --git a/sys-boot/winusb/metadata.xml b/sys-boot/winusb/metadata.xml
new file mode 100644
index 000000000000..57aaaa1668f3
--- /dev/null
+++ b/sys-boot/winusb/metadata.xml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<maintainer>
+<email>yac@gentoo.org</email>
+<name>Jan Matejka</name>
+</maintainer>
+<longdescription lang="en">
+</longdescription>
+</pkgmetadata>
diff --git a/sys-boot/winusb/winusb-1.0.11.ebuild b/sys-boot/winusb/winusb-1.0.11.ebuild
new file mode 100644
index 000000000000..6b5318fe7610
--- /dev/null
+++ b/sys-boot/winusb/winusb-1.0.11.ebuild
@@ -0,0 +1,41 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+DESCRIPTION="Creates windows installer on usb media from an iso image"
+HOMEPAGE="http://en.congelli.eu/prog_info_winusb.html"
+SRC_URI="http://en.congelli.eu/directdl/${PN}/${P}.tar.gz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="amd64 x86"
+IUSE=""
+
+DEPEND="sys-apps/sed"
+RDEPEND="${DEPEND}
+ sys-apps/coreutils
+ sys-apps/grep
+ sys-apps/util-linux
+ sys-block/parted
+ sys-boot/grub:2
+ sys-fs/ntfs3g
+"
+
+src_prepare() {
+ sed -i "s#grub-install#grub2-install#" src/winusb ||
+ die "sed failed"
+}
+
+src_compile() {
+ return; # noop
+}
+
+src_configure() {
+ return; # noop
+}
+
+src_install() {
+ dosbin src/winusb
+}
diff --git a/sys-boot/yaboot-static/Manifest b/sys-boot/yaboot-static/Manifest
new file mode 100644
index 000000000000..50f0e749e944
--- /dev/null
+++ b/sys-boot/yaboot-static/Manifest
@@ -0,0 +1,3 @@
+DIST yaboot-static-1.3.14.tbz2 154587 SHA256 e9632c87b4982cfbc614c6cc58e64740d8af5bd3c52ae78c0a9e0b1d062825f0 SHA512 e175fd3b31c8e26dd7177ab3c995015ebeb34f2877e1e64eabb3cbb21d0cb0e41e9c60c423e07ebb48f43ccd60ff1ff95a2001d0af220531be1bd25e04cf9bdc WHIRLPOOL 12841791df9e2a0a981d1f43ef7653629b5b3bddfa38426b398d662f0957739b50ac0ef7314f4a45eb354e95a85e99c89ba329bd8024fb54d1363f8d3fec4c6f
+DIST yaboot-static-1.3.16.tbz2 159798 SHA256 17ef850e3cdf614d45fff7d837960227d40f09071c418d3b69dd6b82d06f3135 SHA512 9aaf4432764631db923638d11d87868e9774ea6bec875110af1cd21a818c59781b7beebac4848a6a32aa592816fded214f5c6b159ecbd1654a0c6051c42dd580 WHIRLPOOL 7c80cb8d0f7238d0b21a34cae938cca30fa5f911dcf862d06a3af5bf591b3d997222fc4dfa9ee3727a51c43f8ecd630f8d392fe926aeecf789aaab594919ddf1
+DIST yaboot-static-1.3.17.tbz2 162142 SHA256 88f5f080bf99624c969bbf7e04cee86a1699142bd58396f1c2ac027b3385ae3f SHA512 23caf8d7308aba7402f13fc558e2182f63317fa7cf502899503247d2d2b8741b8327b447a50edce775eed0ea02fed5b675f4b40c8bafd956cbd25662c9f2ad72 WHIRLPOOL 9a38838c746c058c036f9ce755f2d573aca548a2a2c6a036ffd7f059e911f7e482779bc0bc0ad2f27039358564762705f09278f367e5fbc05828959d7e1b963f
diff --git a/sys-boot/yaboot-static/files/new-ofpath-devspec.patch b/sys-boot/yaboot-static/files/new-ofpath-devspec.patch
new file mode 100644
index 000000000000..f225e8e1bb4b
--- /dev/null
+++ b/sys-boot/yaboot-static/files/new-ofpath-devspec.patch
@@ -0,0 +1,30 @@
+Fix the devspec path on newer kernels
+
+--- usr/sbin/ofpath
++++ usr/sbin/ofpath
+@@ -85,11 +85,20 @@
+ [ "$DEBUG" = 1 ] && echo "Devpath is: $DEVPATH"
+
+ ### Get the OF Path of the controller
+-case ${DISK_NAME} in
+- sd*|sg*|sr*) CONTROLLER_PATH=$(cat ${DEVPATH}/../../../devspec) ;;
+- hd*) CONTROLLER_PATH=$(cat ${DEVPATH}/../../devspec) ;;
+- *) CONTROLLER_PATH="" ;;
+-esac
++if [ -e "${DEVPATH}/../../devspec" ]; then
++ ### /dev/hd*
++ CONTROLLER_PATH=$(cat ${DEVPATH}/../../devspec);
++elif [ -e "${DEVPATH}/../../../devspec" ]; then
++ ### /dev/sd* on kernel <3.3
++ CONTROLLER_PATH=$(cat ${DEVPATH}/../../../devspec);
++elif [ -e "${DEVPATH}/../../../../devspec" ]; then
++ ### /dev/sd* on kernel 3.3+
++ CONTROLLER_PATH=$(cat ${DEVPATH}/../../../../devspec);
++else
++ ### None of the above...
++ CONTROLLER_PATH="";
++fi
++
+ if [ -z "$CONTROLLER_PATH" ]; then
+ echo "Unable to determine controller path!"
+ exit 1
diff --git a/sys-boot/yaboot-static/files/sysfs-ofpath.patch b/sys-boot/yaboot-static/files/sysfs-ofpath.patch
new file mode 100644
index 000000000000..7a3659100495
--- /dev/null
+++ b/sys-boot/yaboot-static/files/sysfs-ofpath.patch
@@ -0,0 +1,105 @@
+--- usr/sbin/ofpath 2008-08-03 04:00:35.000000000 -0400
++++ usr/sbin/ofpath 2009-01-09 13:46:12.000000000 -0500
+@@ -337,15 +337,18 @@
+
+ ide_ofpath()
+ {
+- if [ ! -L "/proc/ide/$DEVNODE" ] ; then
++ if [ ! -L "/proc/ide/$DEVNODE" ] && [ ! -e "/sys/block/$DEVNODE" ] ; then
+ echo 1>&2 "$PRG: /dev/$DEVNODE: Device not configured"
+ return 1
+ fi
+
+- local IDEBUS="$(v=`readlink /proc/ide/$DEVNODE` ; echo ${v%%/*} )"
+- if [ -z "$IDEBUS" ] ; then
+- echo 1>&2 "$PRG: BUG: IDEBUS == NULL"
+- return 1
++ if [ -L "/proc/ide/$DEVNODE" ] ; then
++ local USE_OLD_PROC=1
++ local IDEBUS="$(v=`readlink /proc/ide/$DEVNODE` ; echo ${v%%/*} )"
++ if [ -z "$IDEBUS" ] ; then
++ echo 1>&2 "$PRG: BUG: IDEBUS == NULL"
++ return 1
++ fi
+ fi
+
+ case "$(uname -r)" in
+@@ -363,7 +366,8 @@
+ echo 1>&2 "$PRG: Unable to determine sysfs mountpoint"
+ return 1
+ fi
+- local OF1275IDE="${SYS}/block/${DEVNODE}/device/../../devspec"
++ local OF1275IDE=$(cd -P "${SYS}/block/${DEVNODE}/device" && pwd)
++ OF1275IDE="${OF1275IDE}/../../devspec"
+ ;;
+ *)
+ local OF1275IDE="/proc/ide/$IDEBUS/devspec"
+@@ -402,34 +406,41 @@
+ return 1
+ fi
+
+- if [ ! -f "/proc/ide/${IDEBUS}/channel" ] ; then
+- echo 1>&2 "$PRG: KERNEL BUG: /proc/ide/${IDEBUS}/channel does not exist"
+- return 1
+- fi
+-
+- case "$(cat /proc/device-tree${DEVSPEC}/device_type 2> /dev/null)" in
+- ide|ata)
+- local MASTER="/disk@0"
+- local SLAVE="/disk@1"
+- ;;
+- pci-ide|pci-ata)
+- local MASTER="/@$(cat /proc/ide/${IDEBUS}/channel)/disk@0"
+- local SLAVE="/@$(cat /proc/ide/${IDEBUS}/channel)/disk@1"
+- ;;
+- scsi) ## some lame controllers pretend they are scsi, hopefully all kludges are created equal.
+- local MASTER="/@$(($(cat /proc/ide/${IDEBUS}/channel) * 2 + 0))"
+- local SLAVE="/@$(($(cat /proc/ide/${IDEBUS}/channel) * 2 + 1))"
+- ;;
+- spi)
+- local MASTER="/disk@$(cat /proc/ide/${IDEBUS}/channel),0"
+- local SLAVE="/disk@$(cat /proc/ide/${IDEBUS}/channel),1"
+- ;;
+- *)
+- echo 1>&2 "$PRG: Unsupported IDE device type: \"$(cat /proc/device-tree${DEVSPEC}/device_type 2> /dev/null)\""
+- return 1
+- ;;
+- esac
++
++ if [ "${USE_OLD_PROC}" = "1" ] ; then
++ if [ ! -f "/proc/ide/${IDEBUS}/channel" ] ; then
++ echo 1>&2 "$PRG: KERNEL BUG: /proc/ide/${IDEBUS}/channel does not exist"
++ return 1
++ fi
+
++ case "$(cat /proc/device-tree${DEVSPEC}/device_type 2> /dev/null)" in
++ ide|ata)
++ local MASTER="/disk@0"
++ local SLAVE="/disk@1"
++ ;;
++ pci-ide|pci-ata)
++ local MASTER="/@$(cat /proc/ide/${IDEBUS}/channel)/disk@0"
++ local SLAVE="/@$(cat /proc/ide/${IDEBUS}/channel)/disk@1"
++ ;;
++ scsi) ## some lame controllers pretend they are scsi, hopefully all kludges are created equal.
++ local MASTER="/@$(($(cat /proc/ide/${IDEBUS}/channel) * 2 + 0))"
++ local SLAVE="/@$(($(cat /proc/ide/${IDEBUS}/channel) * 2 + 1))"
++ ;;
++ spi)
++ local MASTER="/disk@$(cat /proc/ide/${IDEBUS}/channel),0"
++ local SLAVE="/disk@$(cat /proc/ide/${IDEBUS}/channel),1"
++ ;;
++ *)
++ echo 1>&2 "$PRG: Unsupported IDE device type: \"$(cat /proc/device-tree${DEVSPEC}/device_type 2> /dev/null)\""
++ return 1
++ ;;
++ esac
++ else
++ ### I don't know what other disks would look like... FIXME
++ local MASTER="/disk@0"
++ local SLAVE="/disk@1"
++ fi
++
+ case "$DEVNODE" in
+ hda|hdc|hde|hdg|hdi|hdk|hdm|hdo)
+ echo "${DEVSPEC}${MASTER}:$PARTITION"
diff --git a/sys-boot/yaboot-static/metadata.xml b/sys-boot/yaboot-static/metadata.xml
new file mode 100644
index 000000000000..f9a5b22fcbec
--- /dev/null
+++ b/sys-boot/yaboot-static/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>ppc64</herd>
+</pkgmetadata>
diff --git a/sys-boot/yaboot-static/yaboot-static-1.3.14-r1.ebuild b/sys-boot/yaboot-static/yaboot-static-1.3.14-r1.ebuild
new file mode 100644
index 000000000000..cd1f9b21c2c5
--- /dev/null
+++ b/sys-boot/yaboot-static/yaboot-static-1.3.14-r1.ebuild
@@ -0,0 +1,44 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+# Generated by using quickpkg on a ppc32 machine, compiled with -O2 -pipe.
+
+EAPI="5"
+
+inherit eutils
+
+DESCRIPTION="Static yaboot ppc boot loader for machines with open firmware"
+HOMEPAGE="http://yaboot.ozlabs.org/"
+SRC_URI="mirror://gentoo/yaboot-static-${PV}.tbz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="-* ppc ppc64"
+IUSE="ibm"
+
+DEPEND="sys-apps/powerpc-utils"
+RDEPEND="!sys-boot/yaboot
+ !ibm? (
+ sys-fs/hfsutils
+ sys-fs/hfsplusutils
+ sys-fs/mac-fdisk
+ )"
+
+S=${WORKDIR}
+
+QA_PRESTRIPPED="
+ /usr/lib/yaboot/yaboot
+ /usr/lib/yaboot/yaboot.chrp
+ /usr/lib/yaboot/addnote
+"
+
+src_prepare() {
+ epatch "${FILESDIR}"/sysfs-ofpath.patch
+}
+
+src_install() {
+ # don't blow away the user's old conf file
+ mv "${WORKDIR}"/etc/yaboot.conf{,.sample} || die
+ cp -pPR "${WORKDIR}"/* "${D}" || die
+}
diff --git a/sys-boot/yaboot-static/yaboot-static-1.3.16-r1.ebuild b/sys-boot/yaboot-static/yaboot-static-1.3.16-r1.ebuild
new file mode 100644
index 000000000000..690d6694b4d6
--- /dev/null
+++ b/sys-boot/yaboot-static/yaboot-static-1.3.16-r1.ebuild
@@ -0,0 +1,38 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+# Generated by using quickpkg on a ppc32 machine, compiled with -O2 -pipe.
+
+EAPI="5"
+
+inherit eutils
+
+DESCRIPTION="Static yaboot ppc boot loader for machines with open firmware"
+HOMEPAGE="http://yaboot.ozlabs.org/"
+SRC_URI="mirror://gentoo/yaboot-static-${PV}.tbz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="-* ppc ppc64"
+IUSE="ibm"
+
+DEPEND="sys-apps/powerpc-utils"
+RDEPEND="!sys-boot/yaboot
+ !ibm? (
+ sys-fs/hfsutils
+ sys-fs/hfsplusutils
+ sys-fs/mac-fdisk
+ )"
+
+S=${WORKDIR}
+
+QA_PRESTRIPPED="
+ /usr/lib/yaboot/yaboot
+ /usr/lib/yaboot/yaboot.chrp
+ /usr/lib/yaboot/addnote
+"
+
+src_install() {
+ cp -pPR "${WORKDIR}"/* "${D}" || die
+}
diff --git a/sys-boot/yaboot-static/yaboot-static-1.3.17-r1.ebuild b/sys-boot/yaboot-static/yaboot-static-1.3.17-r1.ebuild
new file mode 100644
index 000000000000..3cfea9b97220
--- /dev/null
+++ b/sys-boot/yaboot-static/yaboot-static-1.3.17-r1.ebuild
@@ -0,0 +1,42 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+# Generated by using quickpkg on a ppc32 machine, compiled with -O2 -pipe.
+
+EAPI="5"
+
+inherit eutils
+
+DESCRIPTION="Static yaboot ppc boot loader for machines with open firmware"
+HOMEPAGE="http://yaboot.ozlabs.org/"
+SRC_URI="mirror://gentoo/yaboot-static-${PV}.tbz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="-* ppc ppc64"
+IUSE="ibm"
+
+DEPEND="sys-apps/powerpc-utils"
+RDEPEND="!sys-boot/yaboot
+ !ibm? (
+ sys-fs/hfsutils
+ sys-fs/hfsplusutils
+ sys-fs/mac-fdisk
+ )"
+
+S=${WORKDIR}
+
+QA_PRESTRIPPED="
+ /usr/lib/yaboot/yaboot
+ /usr/lib/yaboot/yaboot.chrp
+ /usr/lib/yaboot/addnote
+"
+
+src_prepare() {
+ epatch "${FILESDIR}/new-ofpath-devspec.patch"
+}
+
+src_install() {
+ cp -pPR "${WORKDIR}"/* "${D}" || die
+}
diff --git a/sys-boot/yaboot/Manifest b/sys-boot/yaboot/Manifest
new file mode 100644
index 000000000000..c96383e2e642
--- /dev/null
+++ b/sys-boot/yaboot/Manifest
@@ -0,0 +1,3 @@
+DIST yaboot-1.3.14.tar.gz 219089 SHA256 b1b0ddc798e332dc03065bac871b05f700b6f8383951a05dee68a7438f644933 SHA512 7542073159a15787e27fd8246fe4c84c48cec5cc6fe76be06f4591bb9ca459ad0c81f0085f08d944745a186da005a5ace0d3d0b2598711ca3309fad1c5a00e74 WHIRLPOOL 5eb364684b5628ea241719f2ac8c18ef2ee3daa7355da91fc69992187c01b1decce95144eb0d7cbd3a481124a3ff81880261b8e5e5aedf6f87499c3c3c95940c
+DIST yaboot-1.3.16.tar.gz 220360 SHA256 16635d5ed0298d46e26e1da8f7a793e185ddb796e3e567554869676650a44650 SHA512 9cd98335c8b32787567253e628549fe88af5ebe4b81fb6b99741fbbcc0ae3b44dc4fdad527ed27da00103bc0482d9a33d3f128f542884387f5aa754546624e14 WHIRLPOOL 5cd42ff0c041135c53cdd852ca227aba75e154cd557fdc6a740218982f5033da6f4428bda5934b6227dd726f31d2d97e2c37d3706076ecad77969678fe7c8eb4
+DIST yaboot-1.3.17.tar.gz 224325 SHA256 2fb738d8fd48b94ab2534a4fdf63738ad02c1a30f4b2add91f837baff8fa2aa1 SHA512 da910c4c6ca2de817342bf4dbcefe2857606043e614782581a86bae206cf6cfe5597ad47aea15369feb60e02d8a4f9f4aa3b12863d715c757584c1f4d7ffb9de WHIRLPOOL 8440faadd955aae0484a2d05c4b712d40b9f438224bbf26b2cf9e178944a007aeac779ae7a9ef2431f2404b24440930d34a63b36f46d8c58d4b7ce98af5c92bc
diff --git a/sys-boot/yaboot/files/chrpfix.patch b/sys-boot/yaboot/files/chrpfix.patch
new file mode 100644
index 000000000000..e64369ba899a
--- /dev/null
+++ b/sys-boot/yaboot/files/chrpfix.patch
@@ -0,0 +1,23 @@
+--- Makefile.orig 2004-03-22 12:04:32.056149336 -0600
++++ Makefile 2004-03-22 12:05:51.824138328 -0600
+@@ -103,9 +103,11 @@
+
+ all: yaboot addnote mkofboot
+
+-yaboot: $(OBJS)
++yaboot: $(OBJS) addnote
+ $(LD) $(LFLAGS) $(OBJS) $(LLIBS) $(lgcc) -o second/$@
+ chmod -x second/yaboot
++ cp second/yaboot second/yaboot.chrp
++ util/addnote second/yaboot.chrp
+
+ addnote:
+ $(CC) $(UCFLAGS) -o util/addnote util/addnote.c
+@@ -185,6 +187,7 @@
+ install -d -o root -g root -m 0755 ${ROOT}/${PREFIX}/${MANDIR}/man5/
+ install -d -o root -g root -m 0755 ${ROOT}/${PREFIX}/${MANDIR}/man8/
+ install -o root -g root -m 0644 second/yaboot ${ROOT}/$(PREFIX)/lib/yaboot
++ install -o root -g root -m 0644 second/yaboot.chrp ${ROOT}/$(PREFIX)/lib/yaboot
+ install -o root -g root -m 0755 util/addnote ${ROOT}/${PREFIX}/lib/yaboot/addnote
+ install -o root -g root -m 0644 first/ofboot ${ROOT}/${PREFIX}/lib/yaboot/ofboot
+ install -o root -g root -m 0755 ybin/ofpath ${ROOT}/${PREFIX}/sbin/ofpath
diff --git a/sys-boot/yaboot/files/new-ofpath b/sys-boot/yaboot/files/new-ofpath
new file mode 100755
index 000000000000..5e395b251a8e
--- /dev/null
+++ b/sys-boot/yaboot/files/new-ofpath
@@ -0,0 +1,143 @@
+#!/bin/sh
+###############################################################################
+# Determines the Open Firmware path based on the linux device name
+#
+# Joseph Jezak <josejx@gentoo.org> Copyright (C) 2010
+# Rewrite of OFPath for newer kernels/scsi configurations
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+###############################################################################
+
+### Set this to 1 to turn on debugging messages
+DEBUG=0
+
+### Find the device tree
+if [ ! -e /proc/device-tree ]; then
+ echo 1>&2 "ofpath: Cannot find the device tree!"
+ exit 1
+fi
+DEV_TREE="/proc/device-tree"
+
+### Check if sys is mounted
+if ! (grep -q '.* .* sysfs ' /proc/mounts 2> /dev/null) ; then
+ echo 1>&2 "ofpath: sysfs must be mounted for ofpath to support this system"
+ exit 1
+fi
+
+### Get the sysfs mount point
+SYS="$(m=`grep '.* .* sysfs ' /proc/mounts | head -n 1` ; echo `d=${m#* };echo ${d%% *}`)"
+if [ -z "$SYS" -o ! -d "$SYS" ] ; then
+ echo 1>&2 "ofpath: Unable to determine sysfs mountpoint"
+ exit 1
+fi
+
+
+### Get the device from the user
+### We dereference links to support devices like /dev/cdrom1
+DEVICE=$1
+if [ -z "$DEVICE" ]; then
+ echo 1>&2 "ofpath: No device specified!"
+ exit 1
+fi
+DEVICE=$(readlink -f "$DEVICE")
+DEVICE=$(basename $DEVICE)
+if [ -z "$DEVICE" ] || [ ! -e "/dev/$DEVICE" ]; then
+ echo 1>&2 "ofpath: Invalid device: /dev/$DEVICE"
+ exit 1
+fi
+[ "$DEBUG" = 1 ] && echo "Device is: $DEVICE"
+
+### Get the partition if we have it
+case ${DEVICE} in
+ sd*) PARTITION="${DEVICE#sd?}" ;;
+ ### No partition for sr/sg devices
+ sr*|sg*) PARTITION="${DEVICE#sr?}" ;;
+ hd*) PARTITION="${DEVICE#hd?}" ;;
+ *) echo "Unknown device string."; exit 1;;
+esac
+if [ ! -z "$PARTITION" ] && [ "$DEBUG" = 1 ]; then
+ echo "Partition: $PARTITION"
+fi
+
+### Get the disk device name
+DISK_NAME="${DEVICE%%${PARTITION}}"
+[ "$DEBUG" = 1 ] && echo "Disk Name: $DISK_NAME"
+
+### Find the devspec for the controller
+DEVPATH=$(cd -P "$SYS/block/${DISK_NAME}/device" && pwd)
+if [ -z "$DEVPATH" ]; then
+ echo "Unable to determine device path!"
+ exit 1
+fi
+[ "$DEBUG" = 1 ] && echo "Devpath is: $DEVPATH"
+
+### Get the OF Path of the controller
+case ${DISK_NAME} in
+ sd*|sg*|sr*) CONTROLLER_PATH=$(cat ${DEVPATH}/../../../devspec) ;;
+ hd*) CONTROLLER_PATH=$(cat ${DEVPATH}/../../devspec) ;;
+ *) CONTROLLER_PATH="" ;;
+esac
+if [ -z "$CONTROLLER_PATH" ]; then
+ echo "Unable to determine controller path!"
+ exit 1
+fi
+[ "$DEBUG" = 1 ] && echo "Controller Path is: $CONTROLLER_PATH"
+
+### Generate the disk number and partition info
+case ${DISK_NAME} in
+ sd*|sg*|sr*)
+ DISK_NO="$(cd ${DEVPATH}/../; pwd)";
+ DISK_NO="${DISK_NO##*:}";
+ ;;
+ hd*)
+ DISK_NO="$(cd ${DEVPATH}/../; pwd)";
+ DISK_NO="${DISK_NO##*ide}";
+ ;;
+ *) echo "Unsupported disk type!"; exit 1 ;;
+esac
+DISK_NO="disk@${DISK_NO}:"
+[ "$DEBUG" = 1 ] && echo "Disk Number: ${DISK_NO}"
+
+### We need to get the controller port path (if it has one)
+if [ ! -d "$DEV_TREE/$CONTROLLER_PATH/disk" ] && [ ! -d "$DEV_TREE/$CONTROLLER_PATH/$DISK_NO" ]; then
+ ### FIXME I don't know if every scsi device uses the host nomenclature
+ case ${DISK_NAME} in
+ sd*|sg*|sr*)
+ PORT="$(cd ${DEVPATH}/../../; pwd)";
+ PORT="${PORT##*host}";
+ CTL_PORT="${CONTROLLER_PATH##*/}";
+ CTL_PORT="${CTL_PORT%%-root*}";
+ PORT="$CTL_PORT@$PORT"
+ [ "$DEBUG" = 1 ] && echo "Port: $PORT"
+ ;;
+ *) echo "Unsupported disk type!"; exit 1 ;;
+ esac
+fi
+
+### Add the partition information if required
+if [ ! -z $PARTITION ]; then
+ DISK_NO="$DISK_NO$PARTITION"
+fi
+
+### Build the OF Path
+if [ -z "$PORT" ]; then
+ OFPATH="$CONTROLLER_PATH/$DISK_NO"
+else
+ OFPATH="$CONTROLLER_PATH/${PORT}/$DISK_NO"
+fi
+
+### Print out the ofpath
+echo $OFPATH
diff --git a/sys-boot/yaboot/files/new-ofpath-devspec.patch b/sys-boot/yaboot/files/new-ofpath-devspec.patch
new file mode 100644
index 000000000000..ac03c15d8dd7
--- /dev/null
+++ b/sys-boot/yaboot/files/new-ofpath-devspec.patch
@@ -0,0 +1,28 @@
+--- ybin/ofpath.bak 2012-05-09 12:24:51.709911981 -0400
++++ ybin/ofpath 2012-05-09 12:32:19.661560544 -0400
+@@ -85,11 +85,20 @@
+ [ "$DEBUG" = 1 ] && echo "Devpath is: $DEVPATH"
+
+ ### Get the OF Path of the controller
+-case ${DISK_NAME} in
+- sd*|sg*|sr*) CONTROLLER_PATH=$(cat ${DEVPATH}/../../../devspec) ;;
+- hd*) CONTROLLER_PATH=$(cat ${DEVPATH}/../../devspec) ;;
+- *) CONTROLLER_PATH="" ;;
+-esac
++if [ -e "${DEVPATH}/../../devspec" ]; then
++ ### /dev/hd*
++ CONTROLLER_PATH=$(cat ${DEVPATH}/../../devspec);
++elif [ -e "${DEVPATH}/../../../devspec" ]; then
++ ### /dev/sd* on kernel <3.3
++ CONTROLLER_PATH=$(cat ${DEVPATH}/../../../devspec);
++elif [ -e "${DEVPATH}/../../../../devspec" ]; then
++ ### /dev/sd* on kernel 3.3+
++ CONTROLLER_PATH=$(cat ${DEVPATH}/../../../../devspec);
++else
++ ### None of the above...
++ CONTROLLER_PATH="";
++fi
++
+ if [ -z "$CONTROLLER_PATH" ]; then
+ echo "Unable to determine controller path!"
+ exit 1
diff --git a/sys-boot/yaboot/files/sysfs-ofpath.patch b/sys-boot/yaboot/files/sysfs-ofpath.patch
new file mode 100644
index 000000000000..7ebc0bfac86f
--- /dev/null
+++ b/sys-boot/yaboot/files/sysfs-ofpath.patch
@@ -0,0 +1,105 @@
+--- ybin/ofpath 2008-08-03 04:00:35.000000000 -0400
++++ ybin/ofpath 2009-01-09 13:46:12.000000000 -0500
+@@ -337,15 +337,18 @@
+
+ ide_ofpath()
+ {
+- if [ ! -L "/proc/ide/$DEVNODE" ] ; then
++ if [ ! -L "/proc/ide/$DEVNODE" ] && [ ! -e "/sys/block/$DEVNODE" ] ; then
+ echo 1>&2 "$PRG: /dev/$DEVNODE: Device not configured"
+ return 1
+ fi
+
+- local IDEBUS="$(v=`readlink /proc/ide/$DEVNODE` ; echo ${v%%/*} )"
+- if [ -z "$IDEBUS" ] ; then
+- echo 1>&2 "$PRG: BUG: IDEBUS == NULL"
+- return 1
++ if [ -L "/proc/ide/$DEVNODE" ] ; then
++ local USE_OLD_PROC=1
++ local IDEBUS="$(v=`readlink /proc/ide/$DEVNODE` ; echo ${v%%/*} )"
++ if [ -z "$IDEBUS" ] ; then
++ echo 1>&2 "$PRG: BUG: IDEBUS == NULL"
++ return 1
++ fi
+ fi
+
+ case "$(uname -r)" in
+@@ -363,7 +366,8 @@
+ echo 1>&2 "$PRG: Unable to determine sysfs mountpoint"
+ return 1
+ fi
+- local OF1275IDE="${SYS}/block/${DEVNODE}/device/../../devspec"
++ local OF1275IDE=$(cd -P "${SYS}/block/${DEVNODE}/device" && pwd)
++ OF1275IDE="${OF1275IDE}/../../devspec"
+ ;;
+ *)
+ local OF1275IDE="/proc/ide/$IDEBUS/devspec"
+@@ -402,34 +406,41 @@
+ return 1
+ fi
+
+- if [ ! -f "/proc/ide/${IDEBUS}/channel" ] ; then
+- echo 1>&2 "$PRG: KERNEL BUG: /proc/ide/${IDEBUS}/channel does not exist"
+- return 1
+- fi
+-
+- case "$(cat /proc/device-tree${DEVSPEC}/device_type 2> /dev/null)" in
+- ide|ata)
+- local MASTER="/disk@0"
+- local SLAVE="/disk@1"
+- ;;
+- pci-ide|pci-ata)
+- local MASTER="/@$(cat /proc/ide/${IDEBUS}/channel)/disk@0"
+- local SLAVE="/@$(cat /proc/ide/${IDEBUS}/channel)/disk@1"
+- ;;
+- scsi) ## some lame controllers pretend they are scsi, hopefully all kludges are created equal.
+- local MASTER="/@$(($(cat /proc/ide/${IDEBUS}/channel) * 2 + 0))"
+- local SLAVE="/@$(($(cat /proc/ide/${IDEBUS}/channel) * 2 + 1))"
+- ;;
+- spi)
+- local MASTER="/disk@$(cat /proc/ide/${IDEBUS}/channel),0"
+- local SLAVE="/disk@$(cat /proc/ide/${IDEBUS}/channel),1"
+- ;;
+- *)
+- echo 1>&2 "$PRG: Unsupported IDE device type: \"$(cat /proc/device-tree${DEVSPEC}/device_type 2> /dev/null)\""
+- return 1
+- ;;
+- esac
++
++ if [ "${USE_OLD_PROC}" = "1" ] ; then
++ if [ ! -f "/proc/ide/${IDEBUS}/channel" ] ; then
++ echo 1>&2 "$PRG: KERNEL BUG: /proc/ide/${IDEBUS}/channel does not exist"
++ return 1
++ fi
+
++ case "$(cat /proc/device-tree${DEVSPEC}/device_type 2> /dev/null)" in
++ ide|ata)
++ local MASTER="/disk@0"
++ local SLAVE="/disk@1"
++ ;;
++ pci-ide|pci-ata)
++ local MASTER="/@$(cat /proc/ide/${IDEBUS}/channel)/disk@0"
++ local SLAVE="/@$(cat /proc/ide/${IDEBUS}/channel)/disk@1"
++ ;;
++ scsi) ## some lame controllers pretend they are scsi, hopefully all kludges are created equal.
++ local MASTER="/@$(($(cat /proc/ide/${IDEBUS}/channel) * 2 + 0))"
++ local SLAVE="/@$(($(cat /proc/ide/${IDEBUS}/channel) * 2 + 1))"
++ ;;
++ spi)
++ local MASTER="/disk@$(cat /proc/ide/${IDEBUS}/channel),0"
++ local SLAVE="/disk@$(cat /proc/ide/${IDEBUS}/channel),1"
++ ;;
++ *)
++ echo 1>&2 "$PRG: Unsupported IDE device type: \"$(cat /proc/device-tree${DEVSPEC}/device_type 2> /dev/null)\""
++ return 1
++ ;;
++ esac
++ else
++ ### I don't know what other disks would look like... FIXME
++ local MASTER="/disk@0"
++ local SLAVE="/disk@1"
++ fi
++
+ case "$DEVNODE" in
+ hda|hdc|hde|hdg|hdi|hdk|hdm|hdo)
+ echo "${DEVSPEC}${MASTER}:$PARTITION"
diff --git a/sys-boot/yaboot/files/yaboot-1.3.16-memalign.patch b/sys-boot/yaboot/files/yaboot-1.3.16-memalign.patch
new file mode 100644
index 000000000000..0fe4e250f292
--- /dev/null
+++ b/sys-boot/yaboot/files/yaboot-1.3.16-memalign.patch
@@ -0,0 +1,41 @@
+diff -uNr yaboot/lib/malloc.c yaboot-1.3.16//lib/malloc.c
+--- yaboot/lib/malloc.c 2010-07-09 03:18:17.000000000 +0100
++++ yaboot-1.3.16//lib/malloc.c 2011-01-23 16:57:13.000000000 +0000
+@@ -42,6 +42,37 @@
+ last_alloc = 0;
+ }
+
++static char *align_ptr_to(char *ptr, unsigned long align)
++{
++ return (char *)((((unsigned long)ptr) + (align - 1UL)) &
++ ~(align - 1UL));
++}
++
++int posix_memalign(void **memptr, unsigned long alignment, unsigned long size)
++{
++ char *caddr;
++
++ if (alignment & (alignment - 1UL))
++ return -1;
++
++ if (alignment & (sizeof(void *) - 1UL))
++ return -1;
++
++ if (size == 0)
++ {
++ *memptr = (void *)0;
++ return 0;
++ }
++
++ caddr = align_ptr_to(malloc_ptr, alignment);
++ malloc_ptr = (caddr + size);
++ last_alloc = caddr;
++ malloc_ptr = align_ptr_to(malloc_ptr, 8UL);
++
++ *memptr = caddr;
++ return 0;
++}
++
+ void *malloc (unsigned int size)
+ {
+ char *caddr;
diff --git a/sys-boot/yaboot/files/yaboot-1.3.17-nopiessp-gcc4.patch b/sys-boot/yaboot/files/yaboot-1.3.17-nopiessp-gcc4.patch
new file mode 100644
index 000000000000..1ab2a3eecc3e
--- /dev/null
+++ b/sys-boot/yaboot/files/yaboot-1.3.17-nopiessp-gcc4.patch
@@ -0,0 +1,38 @@
+disable ssp usage in yaboot itself
+
+unfortunately, since we link against external libs that themselves were built
+with ssp turned on, we have to provide stubs to keep the linking from failing
+
+--- yaboot-1.3.13/Config.gentoo
++++ yaboot-1.3.13/Config.gentoo
+@@ -0,0 +1,6 @@
++check_gcc=$(shell if $(CC) $(1) -S -o /dev/null -xc /dev/null > /dev/null 2>&1; \
++ then echo "$(1)"; else echo "$(2)"; fi)
++
++CFLAGS += $(call check_gcc, -fno-stack-protector)
++CFLAGS += $(call check_gcc, --nopie)
++
+--- yaboot-1.3.13/Makefile
++++ yaboot-1.3.13/Makefile
+@@ -1,6 +1,7 @@
+ ## Setup
+
+ include Config
++include Config.gentoo
+
+ VERSION = 1.3.13
+ # Debug mode (spam/verbose)
+@@ -79,7 +80,7 @@ HOSTCFLAGS = -O2 $(CFLAGS) -Wall -I/usr/
+ second/fs_of.o second/fs_ext2.o second/fs_iso.o second/fs_swap.o \
+ second/iso_util.o \
+ lib/nonstd.o \
+- lib/nosys.o lib/string.o lib/strtol.o lib/vsprintf.o lib/ctype.o lib/malloc.o lib/strstr.o
++ lib/nosys.o lib/string.o lib/strtol.o lib/vsprintf.o lib/ctype.o lib/malloc.o lib/strstr.o lib/ssp.o
+
+ ifeq ($(USE_MD5_PASSWORDS),y)
+ OBJS += second/md5.o
+--- yaboot-1.3.14/lib/ssp.c
++++ yaboot-1.3.14/lib/ssp.c
+@@ -0,0 +1,2 @@
++void __stack_chk_fail(void) {}
++void __stack_chk_fail_local(void) {}
diff --git a/sys-boot/yaboot/files/yaboot-nopiessp-gcc4.patch b/sys-boot/yaboot/files/yaboot-nopiessp-gcc4.patch
new file mode 100644
index 000000000000..ed1755b72b33
--- /dev/null
+++ b/sys-boot/yaboot/files/yaboot-nopiessp-gcc4.patch
@@ -0,0 +1,38 @@
+disable ssp usage in yaboot itself
+
+unfortunately, since we link against external libs that themselves were built
+with ssp turned on, we have to provide stubs to keep the linking from failing
+
+--- yaboot-1.3.13/Config.gentoo
++++ yaboot-1.3.13/Config.gentoo
+@@ -0,0 +1,6 @@
++check_gcc=$(shell if $(CC) $(1) -S -o /dev/null -xc /dev/null > /dev/null 2>&1; \
++ then echo "$(1)"; else echo "$(2)"; fi)
++
++CFLAGS += $(call check_gcc, -fno-stack-protector)
++CFLAGS += $(call check_gcc, --nopie)
++
+--- yaboot-1.3.13/Makefile
++++ yaboot-1.3.13/Makefile
+@@ -1,6 +1,7 @@
+ ## Setup
+
+ include Config
++include Config.gentoo
+
+ VERSION = 1.3.13
+ # Debug mode (spam/verbose)
+@@ -79,7 +80,7 @@ HOSTCFLAGS = -O2 $(CFLAGS) -Wall -I/usr/
+ OBJS = second/crt0.o second/yaboot.o second/cache.o second/prom.o second/file.o \
+ second/partition.o second/fs.o second/cfg.o second/setjmp.o second/cmdline.o \
+ second/fs_of.o second/fs_ext2.o second/fs_iso.o second/iso_util.o \
+- lib/nosys.o lib/string.o lib/strtol.o lib/vsprintf.o lib/ctype.o lib/malloc.o lib/strstr.o
++ lib/nosys.o lib/string.o lib/strtol.o lib/vsprintf.o lib/ctype.o lib/malloc.o lib/strstr.o lib/ssp.o
+
+ ifeq ($(USE_MD5_PASSWORDS),y)
+ OBJS += second/md5.o
+--- yaboot-1.3.14/lib/ssp.c
++++ yaboot-1.3.14/lib/ssp.c
+@@ -0,0 +1,2 @@
++void __stack_chk_fail(void) {}
++void __stack_chk_fail_local(void) {}
diff --git a/sys-boot/yaboot/files/yaboot-stubfuncs.patch b/sys-boot/yaboot/files/yaboot-stubfuncs.patch
new file mode 100644
index 000000000000..8ae522b7d4eb
--- /dev/null
+++ b/sys-boot/yaboot/files/yaboot-stubfuncs.patch
@@ -0,0 +1,231 @@
+Stub out some functions that are not provided (and unneeded)
+
+--- lib/malloc.c
++++ lib/malloc.c
+@@ -64,6 +64,15 @@ void *malloc (unsigned int size)
+ return caddr;
+ }
+
++/* Calloc wrapper for malloc */
++void *memset(void *s, int c, size_t n);
++void *calloc(size_t nmemb, size_t size) {
++ void *caddr;
++ caddr = malloc(nmemb * size);
++ memset(caddr, 0, nmemb * size);
++ return caddr;
++}
++
+ /* Do not fall back to the malloc above as posix_memalign is needed by
+ * external libraries not yaboot */
+ int posix_memalign(void **memptr, size_t alignment, size_t size)
+--- lib/nonstd.c
++++ lib/nonstd.c
+@@ -65,3 +65,208 @@
+ {
+ return NULL;
+ }
++
++int lseek(int fd, int offset, int whence) {
++ // XXX: This whence addition seems wrong ..
++ return prom_lseek((void *)fd, whence + offset);
++}
++
++int lseek64(int fd, int64_t offset, int whence) {
++ return lseek(fd, offset, whence);
++}
++
++int open(const char *pathname, int flags) {
++ return (int) prom_open((char *)pathname);
++}
++
++int open64(const char *pathname, int flags) {
++ return open(pathname, flags);
++}
++
++// Internal glibc fortify calls.
++int __open64_2(const char *path, int flags) {
++ return open64(path, flags);
++}
++
++int read(int fd, void *buf, size_t count) {
++ return prom_read((void *)fd, buf, count);
++}
++
++int write(int fd, const void *buf, size_t count) {
++ return prom_write((void *)fd, (void *)buf, count);
++}
++
++int close(int fd) {
++ prom_close((void *)fd);
++ return 0;
++}
++
++int pread(int fd, void *buf, size_t count, int32_t offset) {
++ int curr = lseek(fd, 0, 0 /*SEEK_CUR*/);
++ lseek(fd, offset, 0 /*SEEK_SET*/);
++ int ret = read(fd, buf, count);
++ lseek(fd, curr, 0 /*SEEK_SET*/);
++ return ret;
++}
++
++int pread64(int fd, void *buf, int64_t count, int64_t offset) {
++ return pread(fd, buf, count, offset);
++}
++
++int pwrite(int fd, const void *buf, size_t count, int32_t offset) {
++ int curr = lseek(fd, 0, 0 /*SEEK_CUR*/);
++ lseek(fd, offset, 0 /*SEEK_SET*/);
++ int ret = write(fd, buf, count);
++ lseek(fd, curr, 0 /*SEEK_SET*/);
++ return ret;
++}
++
++int pwrite64(int fd, const void *buf, int64_t count, int64_t offset) {
++ return pwrite(fd, buf, count, offset);
++}
++
++// No fsync, just assume we've sync'd
++int fsync(int fd) {
++ return 0;
++}
++
++// ext2 libs only use this to turn off caches currently
++int fcntl(int fd, int cmd, ...) {
++ return 0;
++}
++
++void exit(int status) {
++ prom_exit();
++}
++
++int __printf_chk(int flag, const char *format, ...) {
++ va_list ap;
++ va_start (ap, format);
++ prom_vfprintf (prom_stdout, format, ap);
++ va_end (ap);
++
++ return 0;
++}
++
++int __sprintf_chk(char * str, int flag, size_t strlen, const char * format, ...) {
++ va_list ap;
++ va_start(ap, format);
++ // No sprintf? :(
++ va_end(ap);
++ return 0;
++
++}
++
++int __fprintf_chk(FILE *stream, int flag, const char *format, ...) {
++ va_list ap;
++ va_start (ap, format);
++ prom_vfprintf (prom_stdout, format, ap);
++ va_end (ap);
++
++ return 0;
++}
++
++void *memcpy(void *dest, const void *src, size_t n);
++void *__memcpy_chk(void *dest, const void *src, size_t n, size_t destlen) {
++ return memcpy(dest, src, n);
++}
++
++// But these are all dummy functions
++int __xstat64 (int __ver, const char *__filename, void *__stat_buf) {
++ return 0;
++}
++
++int stat64(const char *path, void *stat_buf) {
++ return 0;
++}
++
++int fstat64(int fildes, void *stat_buf) {
++ return 0;
++}
++
++int __fxstat64 (int __ver, int __filedesc, void *__stat_buf) {
++ return 0;
++}
++
++signed int random(void) {
++ return 0;
++}
++
++void srandom(unsigned int seed) {
++ return;
++}
++
++int rand(void) {
++ return 0;
++}
++
++void srand(unsigned int seed) {
++ return;
++}
++
++unsigned int sleep(unsigned int seconds) {
++ return 0;
++}
++
++int gettimeofday(void *tv, void *tz) {
++ return 0;
++}
++
++long sysconf(int name) {
++ return 0;
++}
++
++int getpagesize(void) {
++ return 0;
++}
++
++int gethostname(char *name, size_t len) {
++ return 0;
++}
++
++int getpid(void) {
++ return 0;
++}
++
++int getuid(void) {
++ return 0;
++}
++
++void qsort(void *base, size_t nmemb, size_t size, int(*compar)(const void *, const void *)) {
++ return;
++}
++
++int * __errno_location(void) {
++ return 0;
++}
++
++size_t fwrite(const void *ptr, size_t size, size_t nmemb, void *stream) {
++ return 0;
++}
++
++int ioctl(int d, int request, ...) {
++ return 0;
++}
++
++int fallocate(int fd, int mode, unsigned int offset, unsigned int len) {
++ return 0;
++}
++
++int uname(void *buf) {
++ return 0;
++}
++
++int setrlimit(int resource, void *rlim) {
++ return 0;
++}
++
++unsigned long long int strtoull(const char *nptr, char **endptr, int base) {
++ return 0;
++}
++
++int getrlimit(int resource, void *rlim) {
++ return 0;
++}
++
++int stderr = 0;
++int perror = 0;
diff --git a/sys-boot/yaboot/files/yabootconfig-1.3.13.patch b/sys-boot/yaboot/files/yabootconfig-1.3.13.patch
new file mode 100644
index 000000000000..4bc13eef8b18
--- /dev/null
+++ b/sys-boot/yaboot/files/yabootconfig-1.3.13.patch
@@ -0,0 +1,42 @@
+--- yaboot-1.3.13.orig/ybin/yabootconfig 2004-11-04 21:57:17.000000000 -0500
++++ yaboot-1.3.13/ybin/yabootconfig 2004-11-04 22:40:45.503060512 -0500
+@@ -5,6 +5,8 @@
+ ## yabootconfig generates a simple /etc/yaboot.conf
+ ## Copyright (C) 2001, 2002, 2003 Ethan Benson
+ ##
++## Patched for Gentoo and dual boot - Mark Guertin <gerk@gentoo.org>
++##
+ ## This program is free software; you can redistribute it and/or
+ ## modify it under the terms of the GNU General Public License
+ ## as published by the Free Software Foundation; either version 2
+@@ -264,6 +266,30 @@
+ return 0
+ }
+
++dualboot()
++{
++ DRIVELIST=`ls -d /dev/?d?* | grep "[sh]d[abcdefghijkl]" | cut -b 6-8 | sort -u`
++
++ for i in $DRIVELIST
++ do
++ HFS=`mac-fdisk -l "/dev/$i" | grep '\<Apple_HFS\>' | grep -v "CDROM" | cut -d" " -f1`
++ for h in $HFS
++ do
++ if [ !-x `hpmount -r $h` > /dev/null 2>&1 ] ; then
++ if [ `hpls mach_kernel 2>/dev/null` ] ; then
++ [ "$QUIET" = 0 ] && echo "Found possible OS X/Darwin partition at $h"
++ OSX=$h
++ fi
++ if [ "`hpls "System Folder" 2>/dev/null`" ] ; then
++ [ "$QUIET" = 0 ] && echo "Found possible Mac OS partition at $h"
++ MACOS=$h
++ fi
++ hpumount $h > /dev/null 2>&1
++ fi
++ done
++ done
++}
++
+ ##########
+ ## Main ##
+ ##########
diff --git a/sys-boot/yaboot/metadata.xml b/sys-boot/yaboot/metadata.xml
new file mode 100644
index 000000000000..271567a4cc7d
--- /dev/null
+++ b/sys-boot/yaboot/metadata.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>ppc</herd>
+<herd>ppc64</herd>
+</pkgmetadata>
diff --git a/sys-boot/yaboot/yaboot-1.3.14-r2.ebuild b/sys-boot/yaboot/yaboot-1.3.14-r2.ebuild
new file mode 100644
index 000000000000..cb8a3016c9be
--- /dev/null
+++ b/sys-boot/yaboot/yaboot-1.3.14-r2.ebuild
@@ -0,0 +1,48 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+inherit eutils toolchain-funcs
+
+DESCRIPTION="PPC Bootloader"
+HOMEPAGE="http://yaboot.ozlabs.org"
+SRC_URI="http://yaboot.ozlabs.org/releases/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="-* ppc -ppc64"
+IUSE="ibm"
+
+DEPEND="sys-apps/powerpc-utils
+ sys-fs/e2fsprogs[static-libs]"
+RDEPEND="!sys-boot/yaboot-static
+ !ibm? (
+ sys-fs/hfsutils
+ sys-fs/hfsplusutils
+ sys-fs/mac-fdisk
+ )"
+
+src_prepare() {
+ # No need to hardcode this path -- the compiler already knows to use it.
+ sed -i \
+ -e 's:-I/usr/include::' \
+ Makefile || die
+
+ # dual boot patch
+ epatch "${FILESDIR}/yabootconfig-1.3.13.patch"
+ epatch "${FILESDIR}/chrpfix.patch"
+ epatch "${FILESDIR}/yaboot-nopiessp-gcc4.patch"
+ epatch "${FILESDIR}/sysfs-ofpath.patch"
+}
+
+src_compile() {
+ unset CFLAGS CXXFLAGS CPPFLAGS LDFLAGS
+ emake PREFIX=/usr MANDIR=share/man CC="$(tc-getCC)" LD="$(tc-getLD)"
+}
+
+src_install() {
+ sed -i -e 's/\/local//' etc/yaboot.conf
+ emake ROOT="${D}" PREFIX=/usr MANDIR=share/man install
+}
diff --git a/sys-boot/yaboot/yaboot-1.3.16.ebuild b/sys-boot/yaboot/yaboot-1.3.16.ebuild
new file mode 100644
index 000000000000..9ec8e8704c31
--- /dev/null
+++ b/sys-boot/yaboot/yaboot-1.3.16.ebuild
@@ -0,0 +1,57 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+inherit eutils toolchain-funcs
+
+DESCRIPTION="PPC Bootloader"
+HOMEPAGE="http://yaboot.ozlabs.org"
+SRC_URI="http://yaboot.ozlabs.org/releases/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="-* ppc -ppc64"
+IUSE="ibm"
+
+DEPEND="sys-apps/powerpc-utils
+ sys-fs/e2fsprogs[static-libs]"
+RDEPEND="!sys-boot/yaboot-static
+ !ibm? (
+ sys-fs/hfsutils
+ sys-fs/hfsplusutils
+ sys-fs/mac-fdisk
+ )"
+
+src_unpack() {
+ default
+ cd "${S}"
+ cp "${FILESDIR}/new-ofpath" "${S}/ybin/ofpath"
+}
+
+src_prepare() {
+ # No need to hardcode this path -- the compiler already knows to use it.
+ sed -i \
+ -e 's:-I/usr/include::' \
+ Makefile || die
+
+ # dual boot patch
+ epatch "${FILESDIR}/yabootconfig-1.3.13.patch"
+ epatch "${FILESDIR}/chrpfix.patch"
+ epatch "${FILESDIR}/yaboot-nopiessp-gcc4.patch"
+
+ # e2fsprogs memalign patch
+ epatch "${FILESDIR}/${P}-memalign.patch"
+}
+
+src_compile() {
+ unset CFLAGS CXXFLAGS CPPFLAGS LDFLAGS
+ emake PREFIX=/usr MANDIR=share/man CC="$(tc-getCC)" LD="$(tc-getLD)"
+}
+
+src_install() {
+ sed -i -e 's/\/local//' etc/yaboot.conf || die
+ emake ROOT="${D}" PREFIX=/usr MANDIR=share/man install
+ mv "${ED}"/etc/yaboot.conf{,.sample} || die
+}
diff --git a/sys-boot/yaboot/yaboot-1.3.17-r2.ebuild b/sys-boot/yaboot/yaboot-1.3.17-r2.ebuild
new file mode 100644
index 000000000000..6031dbd30844
--- /dev/null
+++ b/sys-boot/yaboot/yaboot-1.3.17-r2.ebuild
@@ -0,0 +1,60 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+inherit eutils toolchain-funcs
+
+DESCRIPTION="PPC Bootloader"
+HOMEPAGE="http://yaboot.ozlabs.org"
+SRC_URI="http://yaboot.ozlabs.org/releases/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="-* ppc -ppc64"
+IUSE="ibm"
+
+DEPEND="sys-apps/powerpc-utils
+ sys-fs/e2fsprogs[static-libs]"
+RDEPEND="!sys-boot/yaboot-static
+ !ibm? (
+ sys-fs/hfsutils
+ sys-fs/hfsplusutils
+ sys-fs/mac-fdisk
+ )"
+
+src_unpack() {
+ default
+ cd "${S}"
+ cp "${FILESDIR}/new-ofpath" "${S}/ybin/ofpath"
+}
+
+src_prepare() {
+ # No need to hardcode this path -- the compiler already knows to use it.
+ # Error only on real errors, for prom printing format compile failure.
+ sed -i \
+ -e 's:-I/usr/include::' \
+ -e 's:-Werror:-Wno-error:g' \
+ Makefile || die
+
+ # dual boot patch
+ epatch "${FILESDIR}/yabootconfig-1.3.13.patch"
+ epatch "${FILESDIR}/chrpfix.patch"
+ epatch "${FILESDIR}/${P}-nopiessp-gcc4.patch"
+ epatch "${FILESDIR}/${PN}-stubfuncs.patch"
+
+ # Fix the devspec path on newer kernels
+ epatch "${FILESDIR}/new-ofpath-devspec.patch"
+}
+
+src_compile() {
+ unset CFLAGS CXXFLAGS CPPFLAGS LDFLAGS
+ emake PREFIX=/usr MANDIR=share/man CC="$(tc-getCC)" LD="$(tc-getLD)"
+}
+
+src_install() {
+ sed -i -e 's/\/local//' etc/yaboot.conf || die
+ emake ROOT="${D}" PREFIX=/usr MANDIR=share/man install
+ mv "${ED}"/etc/yaboot.conf{,.sample} || die
+}