summaryrefslogtreecommitdiff
path: root/sys-boot
diff options
context:
space:
mode:
Diffstat (limited to 'sys-boot')
-rw-r--r--sys-boot/aboot/Manifest11
-rw-r--r--sys-boot/aboot/aboot-1.0_pre20040408-r3.ebuild86
-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.xml11
-rw-r--r--sys-boot/arcload/Manifest8
-rw-r--r--sys-boot/arcload/arcload-0.50-r1.ebuild83
-rw-r--r--sys-boot/arcload/arcload-0.50-r3.ebuild128
-rw-r--r--sys-boot/arcload/files/arcload.865
-rw-r--r--sys-boot/arcload/metadata.xml11
-rw-r--r--sys-boot/bootcreator/Manifest6
-rw-r--r--sys-boot/bootcreator/bootcreator-1.1.ebuild29
-rw-r--r--sys-boot/bootcreator/bootcreator-1.2.ebuild29
-rw-r--r--sys-boot/bootcreator/metadata.xml8
-rw-r--r--sys-boot/colo/Manifest8
-rw-r--r--sys-boot/colo/colo-1.22.ebuild117
-rw-r--r--sys-boot/colo/files/default.colo25
-rw-r--r--sys-boot/colo/files/menu.colo60
-rw-r--r--sys-boot/colo/files/simple.colo19
-rw-r--r--sys-boot/colo/metadata.xml12
-rw-r--r--sys-boot/cromwell-bin/Manifest7
-rw-r--r--sys-boot/cromwell-bin/cromwell-bin-2.31-r1.ebuild27
-rw-r--r--sys-boot/cromwell-bin/cromwell-bin-2.40-r1.ebuild27
-rw-r--r--sys-boot/cromwell-bin/metadata.xml11
-rw-r--r--sys-boot/cromwell/Manifest7
-rw-r--r--sys-boot/cromwell/cromwell-2.40-r3.ebuild37
-rw-r--r--sys-boot/cromwell/files/cromwell-2.40-gcc-4.6.patch39
-rw-r--r--sys-boot/cromwell/metadata.xml8
-rw-r--r--sys-boot/dvhtool/Manifest9
-rw-r--r--sys-boot/dvhtool/dvhtool-1.0.1-r2.ebuild43
-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.xml8
-rw-r--r--sys-boot/efibootmgr/Manifest7
-rw-r--r--sys-boot/efibootmgr/efibootmgr-14.ebuild28
-rw-r--r--sys-boot/efibootmgr/efibootmgr-15.ebuild29
-rw-r--r--sys-boot/efibootmgr/metadata.xml17
-rw-r--r--sys-boot/elilo/Manifest19
-rw-r--r--sys-boot/elilo/elilo-3.10.ebuild70
-rw-r--r--sys-boot/elilo/elilo-3.12.ebuild70
-rw-r--r--sys-boot/elilo/elilo-3.16.ebuild85
-rw-r--r--sys-boot/elilo/elilo-3.6_p20060314.ebuild86
-rw-r--r--sys-boot/elilo/files/elilo-3.16-elilo-loop.patch15
-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.xml11
-rw-r--r--sys-boot/getdvhoff/Manifest5
-rw-r--r--sys-boot/getdvhoff/getdvhoff-0.12-r1.ebuild36
-rw-r--r--sys-boot/getdvhoff/metadata.xml12
-rw-r--r--sys-boot/gnu-efi/Manifest9
-rw-r--r--sys-boot/gnu-efi/gnu-efi-3.0.2.ebuild53
-rw-r--r--sys-boot/gnu-efi/gnu-efi-3.0.3.ebuild78
-rw-r--r--sys-boot/gnu-efi/gnu-efi-3.0.6-r1.ebuild90
-rw-r--r--sys-boot/gnu-efi/metadata.xml15
-rw-r--r--sys-boot/grub-static/Manifest15
-rw-r--r--sys-boot/grub-static/grub-static-0.96-r1.ebuild17
-rw-r--r--sys-boot/grub-static/grub-static-0.97-r10.ebuild175
-rw-r--r--sys-boot/grub-static/grub-static-0.97-r12.ebuild179
-rw-r--r--sys-boot/grub-static/grub-static-0.97-r6.ebuild135
-rw-r--r--sys-boot/grub-static/grub-static-0.97-r9.ebuild171
-rw-r--r--sys-boot/grub-static/grub-static-0.97.ebuild75
-rw-r--r--sys-boot/grub-static/metadata.xml8
-rw-r--r--sys-boot/grub/Manifest19
-rw-r--r--sys-boot/grub/files/gfxpayload.patch29
-rw-r--r--sys-boot/grub/files/grub-0.97-Add-esp-to-list-of-clobbered-registers.patch53
-rw-r--r--sys-boot/grub/files/grub-0.97-ncurses-pkgconfig.patch18
-rw-r--r--sys-boot/grub/files/grub-2.02_beta2-KERNEL_GLOBS.patch67
-rw-r--r--sys-boot/grub/files/grub.conf.gentoo16
-rw-r--r--sys-boot/grub/files/grub.default-373
-rw-r--r--sys-boot/grub/grub-0.97-r16.ebuild301
-rw-r--r--sys-boot/grub/grub-0.97-r17.ebuild293
-rw-r--r--sys-boot/grub/grub-2.02.ebuild298
-rw-r--r--sys-boot/grub/grub-9999.ebuild298
-rw-r--r--sys-boot/grub/metadata.xml42
-rw-r--r--sys-boot/lilo/Manifest22
-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-24.0-novga.patch12
-rw-r--r--sys-boot/lilo/files/lilo-24.1-novga.patch12
-rw-r--r--sys-boot/lilo/files/lilo.conf72
-rw-r--r--sys-boot/lilo/lilo-22.8-r2.ebuild179
-rw-r--r--sys-boot/lilo/lilo-23.2-r2.ebuild180
-rw-r--r--sys-boot/lilo/lilo-24.0-r1.ebuild175
-rw-r--r--sys-boot/lilo/lilo-24.1.ebuild182
-rw-r--r--sys-boot/lilo/lilo-24.2.ebuild182
-rw-r--r--sys-boot/lilo/metadata.xml16
-rw-r--r--sys-boot/makebootfat/Manifest5
-rw-r--r--sys-boot/makebootfat/makebootfat-1.4.ebuild24
-rw-r--r--sys-boot/makebootfat/metadata.xml10
-rw-r--r--sys-boot/mbr-gpt/Manifest5
-rw-r--r--sys-boot/mbr-gpt/mbr-gpt-0.0.1.ebuild51
-rw-r--r--sys-boot/mbr-gpt/metadata.xml11
-rw-r--r--sys-boot/mbr/Manifest5
-rw-r--r--sys-boot/mbr/mbr-1.1.11.ebuild32
-rw-r--r--sys-boot/mbr/metadata.xml5
-rw-r--r--sys-boot/metadata.xml36
-rw-r--r--sys-boot/milo/Manifest15
-rw-r--r--sys-boot/milo/files/README-gentoo98
-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.xml17
-rw-r--r--sys-boot/milo/milo-2.4.18.ebuild231
-rw-r--r--sys-boot/netboot/Manifest6
-rw-r--r--sys-boot/netboot/files/netboot-0.10.2-ldflags.patch38
-rw-r--r--sys-boot/netboot/metadata.xml8
-rw-r--r--sys-boot/netboot/netboot-0.10.2.ebuild50
-rw-r--r--sys-boot/nettrom/Manifest5
-rw-r--r--sys-boot/nettrom/metadata.xml8
-rw-r--r--sys-boot/nettrom/nettrom-2.3.3.ebuild21
-rw-r--r--sys-boot/os-prober/Manifest9
-rw-r--r--sys-boot/os-prober/metadata.xml12
-rw-r--r--sys-boot/os-prober/os-prober-1.71.ebuild74
-rw-r--r--sys-boot/os-prober/os-prober-1.73.ebuild74
-rw-r--r--sys-boot/os-prober/os-prober-1.74.ebuild76
-rw-r--r--sys-boot/palo/Manifest10
-rw-r--r--sys-boot/palo/files/99palo3
-rw-r--r--sys-boot/palo/files/palo-1.96-toolchain.patch31
-rw-r--r--sys-boot/palo/files/palo-9999-toolchain.patch23
-rw-r--r--sys-boot/palo/files/palo.conf8
-rw-r--r--sys-boot/palo/metadata.xml11
-rw-r--r--sys-boot/palo/palo-1.99.ebuild42
-rw-r--r--sys-boot/palo/palo-9999.ebuild47
-rw-r--r--sys-boot/plymouth-openrc-plugin/Manifest5
-rw-r--r--sys-boot/plymouth-openrc-plugin/metadata.xml8
-rw-r--r--sys-boot/plymouth-openrc-plugin/plymouth-openrc-plugin-0.1.2.ebuild41
-rw-r--r--sys-boot/plymouth/Manifest12
-rw-r--r--sys-boot/plymouth/files/0.9.2-systemdsystemunitdir.patch18
-rw-r--r--sys-boot/plymouth/files/0.9.3-glibc-sysmacros.patch45
-rw-r--r--sys-boot/plymouth/metadata.xml28
-rw-r--r--sys-boot/plymouth/plymouth-0.9.2-r1.ebuild100
-rw-r--r--sys-boot/plymouth/plymouth-0.9.3-r1.ebuild99
-rw-r--r--sys-boot/plymouth/plymouth-0.9.3.ebuild95
-rw-r--r--sys-boot/plymouth/plymouth-9999.ebuild96
-rw-r--r--sys-boot/psoload/Manifest5
-rw-r--r--sys-boot/psoload/metadata.xml5
-rw-r--r--sys-boot/psoload/psoload-2.0.ebuild25
-rw-r--r--sys-boot/quik/Manifest7
-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.xml8
-rw-r--r--sys-boot/quik/quik-2.1.6.ebuild43
-rw-r--r--sys-boot/raincoat/Manifest8
-rw-r--r--sys-boot/raincoat/files/raincoat-0.11-build.patch13
-rw-r--r--sys-boot/raincoat/metadata.xml11
-rw-r--r--sys-boot/raincoat/raincoat-0.11.ebuild25
-rw-r--r--sys-boot/raincoat/raincoat-0.5.ebuild25
-rw-r--r--sys-boot/raspberrypi-firmware/Manifest19
-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-1.20160209.ebuild47
-rw-r--r--sys-boot/raspberrypi-firmware/raspberrypi-firmware-1.20160309.ebuild47
-rw-r--r--sys-boot/raspberrypi-firmware/raspberrypi-firmware-1_pre20130807.ebuild61
-rw-r--r--sys-boot/raspberrypi-firmware/raspberrypi-firmware-9999.ebuild53
-rw-r--r--sys-boot/raspberrypi-mkimage/Manifest9
-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.patch48
-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.ebuild56
-rw-r--r--sys-boot/refind/Manifest6
-rw-r--r--sys-boot/refind/metadata.xml69
-rw-r--r--sys-boot/refind/refind-0.10.4-r2.ebuild197
-rw-r--r--sys-boot/refind/refind-0.10.8.ebuild197
-rw-r--r--sys-boot/sgibootcd/Manifest5
-rw-r--r--sys-boot/sgibootcd/metadata.xml12
-rw-r--r--sys-boot/sgibootcd/sgibootcd-0.12.ebuild28
-rw-r--r--sys-boot/shlilo-lantank/Manifest6
-rw-r--r--sys-boot/shlilo-lantank/files/lilo.conf16
-rw-r--r--sys-boot/shlilo-lantank/metadata.xml8
-rw-r--r--sys-boot/shlilo-lantank/shlilo-lantank-20040408.ebuild32
-rw-r--r--sys-boot/silo/Manifest13
-rw-r--r--sys-boot/silo/files/silo-e2fsprogs-1.4.14.patch54
-rw-r--r--sys-boot/silo/metadata.xml11
-rw-r--r--sys-boot/silo/silo-1.4.14_p20100228.ebuild69
-rw-r--r--sys-boot/silo/silo-1.4.14_p20120226.ebuild69
-rw-r--r--sys-boot/silo/silo-1.4.14_p20120819.ebuild63
-rw-r--r--sys-boot/syslinux/Manifest16
-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.03-sysmacros.patch34
-rw-r--r--sys-boot/syslinux/metadata.xml11
-rw-r--r--sys-boot/syslinux/syslinux-3.86.ebuild55
-rw-r--r--sys-boot/syslinux/syslinux-4.07.ebuild68
-rw-r--r--sys-boot/syslinux/syslinux-5.10.ebuild82
-rw-r--r--sys-boot/syslinux/syslinux-6.03.ebuild112
-rw-r--r--sys-boot/syslinux/syslinux-6.04_pre1.ebuild112
-rw-r--r--sys-boot/systemd-boot/Manifest5
-rw-r--r--sys-boot/systemd-boot/files/233-Force-libsystemd-shared-to-be-static.patch25
-rw-r--r--sys-boot/systemd-boot/metadata.xml11
-rw-r--r--sys-boot/systemd-boot/systemd-boot-233.ebuild111
-rw-r--r--sys-boot/systemrescuecd-x86-grub/Manifest5
-rw-r--r--sys-boot/systemrescuecd-x86-grub/files/systemrescuecd.default21
-rw-r--r--sys-boot/systemrescuecd-x86-grub/files/systemrescuecd.grub64
-rw-r--r--sys-boot/systemrescuecd-x86-grub/metadata.xml17
-rw-r--r--sys-boot/systemrescuecd-x86-grub/systemrescuecd-x86-grub-0.1.ebuild32
-rw-r--r--sys-boot/tboot/Manifest8
-rw-r--r--sys-boot/tboot/files/tboot-1.9.5-genkernel-path.patch60
-rw-r--r--sys-boot/tboot/metadata.xml14
-rw-r--r--sys-boot/tboot/tboot-1.9.5-r1.ebuild71
-rw-r--r--sys-boot/tboot/tboot-1.9.6.ebuild71
-rw-r--r--sys-boot/udk/Manifest6
-rw-r--r--sys-boot/udk/files/2015-makefile.template54
-rw-r--r--sys-boot/udk/files/2015-tools_def.template42
-rw-r--r--sys-boot/udk/metadata.xml23
-rw-r--r--sys-boot/udk/udk-2015.ebuild247
-rw-r--r--sys-boot/unetbootin/Manifest11
-rw-r--r--sys-boot/unetbootin/files/unetbootin-581-desktop.patch24
-rw-r--r--sys-boot/unetbootin/files/unetbootin-647-frebootbutton.patch10
-rw-r--r--sys-boot/unetbootin/metadata.xml12
-rw-r--r--sys-boot/unetbootin/unetbootin-625.ebuild90
-rw-r--r--sys-boot/unetbootin/unetbootin-647.ebuild89
-rw-r--r--sys-boot/unetbootin/unetbootin-655.ebuild88
-rw-r--r--sys-boot/vboot-utils/Manifest13
-rw-r--r--sys-boot/vboot-utils/files/vboot-utils-42_p20150219-cgpt-static.patch36
-rw-r--r--sys-boot/vboot-utils/files/vboot-utils-42_p20150219-sysmacros.patch43
-rw-r--r--sys-boot/vboot-utils/metadata.xml15
-rw-r--r--sys-boot/vboot-utils/vboot-utils-1.0_p20130222.ebuild74
-rw-r--r--sys-boot/vboot-utils/vboot-utils-42_p20150219.ebuild85
-rw-r--r--sys-boot/vboot-utils/vboot-utils-51_p20160427.ebuild84
-rw-r--r--sys-boot/vboot-utils/vboot-utils-59_p20170413.ebuild85
-rw-r--r--sys-boot/winusb/Manifest5
-rw-r--r--sys-boot/winusb/metadata.xml4
-rw-r--r--sys-boot/winusb/winusb-1.0.11.ebuild40
-rw-r--r--sys-boot/yaboot-static/Manifest11
-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.xml8
-rw-r--r--sys-boot/yaboot-static/yaboot-static-1.3.14-r1.ebuild43
-rw-r--r--sys-boot/yaboot-static/yaboot-static-1.3.16-r1.ebuild37
-rw-r--r--sys-boot/yaboot-static/yaboot-static-1.3.17-r1.ebuild41
-rw-r--r--sys-boot/yaboot/Manifest18
-rw-r--r--sys-boot/yaboot/files/chrpfix.patch23
-rw-r--r--sys-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.xml8
-rw-r--r--sys-boot/yaboot/yaboot-1.3.14-r2.ebuild47
-rw-r--r--sys-boot/yaboot/yaboot-1.3.16.ebuild56
-rw-r--r--sys-boot/yaboot/yaboot-1.3.17-r2.ebuild59
257 files changed, 12937 insertions, 0 deletions
diff --git a/sys-boot/aboot/Manifest b/sys-boot/aboot/Manifest
new file mode 100644
index 000000000000..6c8296a7fb85
--- /dev/null
+++ b/sys-boot/aboot/Manifest
@@ -0,0 +1,11 @@
+AUX aboot-define_stat_only_in_userspace.patch 930 SHA256 ba7b34d1361ff4635e0f4aa7118295d4b93fc8716333a23bbc8a4dbe4ddea5de SHA512 b219d941943e0780030e402773a5ca3d9d2b3779b0162ad464d636c06268d37fa99f80ab9f7585013ffdfb8e13c1661f533ff6dad08451b5fe778d0a3fa9bd4e WHIRLPOOL e1184bba6b69b340e1c6989175c873d5fc9cd2d33b0ee5f2a83b40924856d7f07883614b1f607f1507d094bab36746997e69fe5f7e81305005e0fe6a441d0705
+AUX aboot-gcc-3.4.patch 830 SHA256 9757c85226ec5355a849a24a71415604569a7de06036bcfb3e4814fa448b5d18 SHA512 9e5f95a18b7d2eac6ab589f86f0e7a7ba189642b5cf0b302324ea0e2de243bf0379f119c79d44a9aa6b59096a582878438d0a1b42c0b626650ba908777bf0760 WHIRLPOOL b2ed3e55f3be60c698396cc638036234811bff399f1322506b10fe5fac18f232d10539dabba8a575180436081255adcb0481fe6dbe3729d5c4cc4a443671cef6
+AUX aboot-pt_note.patch 8966 SHA256 ef8a8e20bf482d0aa2cd4da09c867f021018fde486f6c631d7c236d790d81a2b SHA512 0df0be83d4f487ab899a37be494e90c926311dd39b49c953ab9fa97ac70a6430d697b62d8c12315fd6dcb0c7790d27eb6391754acecf440cbe0c363b050b5479 WHIRLPOOL bab6f78b9f6379f9ffd92478d9225b1ac8c4eda7f183de32a7407c9aa505554b21bfde38b0f73a6724e8aa9989f360d34fb0e369a225160e9a8d7111e7e24e6b
+AUX aboot.conf 295 SHA256 41372b883807cbd871a5c8f17c4787273f2107ba10be127f73ca9e445ce72ebd SHA512 2dc56371223f6dfa19d13feaa9e33655997f571309ba9158e265051b5b9fe3e2f79ccf66385bde8433cf8b5cd0cb95b3036de43f93392c31a95638039f658e30 WHIRLPOOL f1f9d7ca909c7adaa8a1a7a98219763cde16f619abb5f117a837f8aab389a683e33fdd9e308df4bfc4ff78813156ba089349697668104f4161461b8af015dc53
+DIST aboot-1.0_pre20040408.tar.bz2 115062 SHA256 a8ae8f2bf549c1cc79ea66a0a11c8db5c0257ce0d94b97418eb1c658723b12d2 SHA512 b1fff7ce806336f89efe8239108a8547053f22727cba93cea742995432c4f35133f8dc619588390ba6e0d114e2fd62b80b730443e6c18900aa2a8832ddd4ebfc WHIRLPOOL 74d6d72c0d6802682b10fb9a6505b95365ce5b784c0a2377d922604467129a6812f6ab00d579d511d93e3c40ba40627ad7f2f49eb6e08a0de10f7549aa09997e
+DIST aboot_gentoo.diff.bz2 9527 SHA256 6b141b7c90560d07ad740cfb8660a26935acfa96376e73439271d1fa9c6d0730 SHA512 868a73fee56e9bf6d986175a6a4dc321ed12fb78d74dfb8f1a3e35274577ddc9ea0820768b44836403587b3976ad8dacdcf6562a9ce5c45981c752670901155f WHIRLPOOL b621387b6a6d04db8e2d1c3554c6615c782d783c9f42f854160e40ec1a2969ba1e5cff4be72e631379f485d5d0780f5dee87e81c67a1c313480bcf0b0d261937
+DIST gentoo-headers-base-2.6.22.tar.bz2 4700338 SHA256 da57d0d8d12a59b05f0d3851e6d2f67c413baece046f4ec03831aa70df88710a SHA512 99849928eede0c4b101ddc9179c0974cac6b4f18803dc98b72dcbe80cea88d3062f709beaa1b890edbed9c147be0dd516065d4cee945164b5d9f19f7a3cf249d WHIRLPOOL cf35281fc5558c14a134bd4018e70a8cca589972c90980786669892a23aff4b1236f0c69586dfad4836bcdac7b75c5a902e15b88cc835adbcff16bbb5ded7181
+EBUILD aboot-1.0_pre20040408-r3.ebuild 2498 SHA256 9e623b875cfb0ea00710d6740c9b780c5f071e333eda169ee5a4c4b3d94d9e64 SHA512 9e129427a16ff0260e86887bfba3b7b8858572bc978acb0a1e588fe9039771e23d1724ef294134c9836f5be11d63b924c75d285e80f27d8775812e1bf4cf1446 WHIRLPOOL 606bbf85a01148cb32a438d973c1768a113f08462288ca7a0bc7539071524ca0182f222338ff16325fadcc13f388c369fbf2a9fc08e7ac033409d03a714a9ac1
+MISC ChangeLog 3159 SHA256 e70a31951e7d67c38528b57bfea930c6e23e92cf5dc93a8431e75e050d82df1a SHA512 fda7ddba86eaf9d19c776583c7a8ef8dca19b7247bde7ccdb7d18f7a24f8cd55108df9ddbc9ca619b62bb810af31ba2fe9a206af25473bbb123cf856f53c8402 WHIRLPOOL 66d0f207a6e3468ebec8f737583dea5429c93fdc1179ffba006e9758f46713fad3e021f5eb3c5cc0acb4d69c253c9c8ec0c20d073a58d4b1cb8908fc0f365bdd
+MISC ChangeLog-2015 3427 SHA256 fa51abbcb5b7563a23e2c2701e0aebded0d48fb33317c07590c7c52ae7b185df SHA512 d49bb6daabf4ba3fd3059b8ca6e034068169e7bb57ad56abf7867431ecac73b57e081ab1fb43ed943d23b9e8dfc1ee2835133b7f5636ddbde66f152f400f4bb0 WHIRLPOOL bc084937f3825018590ffdfca87fc72f7c8237f1ce7daa3474e7dc2e1fb7f543ffcc95e3f826ca1545645c389202b1af71b92331ab8bacab93d29a5b514cebd3
+MISC metadata.xml 338 SHA256 d2ffec8c65393ef6c8498f6c5ef174726de59289d3a02da2604bf95795e97e6b SHA512 2c9c87a850f9900d030fd37a4f59308136f478db254fbfd8e37d4f3c16ab33c74d1ef4119b74f4e0b34310ef066ffb53f89e2a4013cfca4a7b56f690e2aa7faf WHIRLPOOL 9be9da3ec0b475e9660be666228fb88b29e80b45d95c0c58d146ac382bdb98d65498a27518bb9bc7e67e54d9d25858810025554d35dee47e5f3c1941280d50a9
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..9fcd14b1d0ff
--- /dev/null
+++ b/sys-boot/aboot/aboot-1.0_pre20040408-r3.ebuild
@@ -0,0 +1,86 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+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
+ https://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..297c7b4b4d3d
--- /dev/null
+++ b/sys-boot/aboot/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 type="project">
+ <email>alpha@gentoo.org</email>
+ <name>Gentoo Linux Alpha Development</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="sourceforge">aboot</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-boot/arcload/Manifest b/sys-boot/arcload/Manifest
new file mode 100644
index 000000000000..549ea47fa641
--- /dev/null
+++ b/sys-boot/arcload/Manifest
@@ -0,0 +1,8 @@
+AUX arcload.8 2068 SHA256 8aff3d9e0f2f476ada1e9564558ed7a032d98f4687f3f9ed95e99aa970b3696e SHA512 1b62e8116174d6909e947d88ef1a0ad0214b988c48f579eb9310984ad4e73b7c686e644be2b09dbab7dc2053fc36b1d80d272765c168dd8a662a6420e5ffcd75 WHIRLPOOL a86f92e6c5bc6d34785f60b60d3746f94aa1ac7a3f092df3f8e0f7ddf6db3635d66bb7a69178c4ccd19829e1fc8a16ab17d0d4fe7526ce24f24fae043c9ea5af
+DIST arcload-0.5.tar.bz2 47690 SHA256 69cc45f7d27b30256875ccda115b6f74dd3bd894033f0f81b6f87ea1d8f7a0ac SHA512 b4f7186a6e75baa0cde06451a8011769f200d4cc353495dbfeb9c9ffe3ac09b8bbba357e83441e1fe2344c651068fafda7881864d8bf09f221ddae8170cc7b2e WHIRLPOOL 2320614f813518ca324d705c885e3ead247d40ffc05bea2fca401fb23020a0c10e1a4779dcf16cc9bd0b1ce2af4e92ee98e6508098c3e8a918b3a228e66bc6cf
+DIST arcload-0.50-patches-v1.tar.xz 10320 SHA256 161ef360576e3af354022e1a7398ba3af2111f81bb6b6575db5e4c3cd93ce631 SHA512 7687b08bc70a96f8db9a620976b466ff4bb70c8ed77b0c241d060feb8dcab6019d753ac3b182a74139331c9d33f27e090897a0c7c41c1663e16575fef6e21bdf WHIRLPOOL 77b2e51035dcdc9c4f5cd621d2ad44023752e57e6fe7bc1589b365de473c3979eef85aa5391f6e6679993c67036b81895845338c35b1e23406a282b354bb1378
+EBUILD arcload-0.50-r1.ebuild 2779 SHA256 fffae6f42cbc0a61756f1f1d9946d8780c1d52a54435ef13b465e2437f567aca SHA512 986f50a541899947bebf62870086ba54d7599279b18caeaabbb170eb0672908244e63fe44f7f5e45d5b902f55b5b213ea9a67742c01ea443f7027b3216e6bad2 WHIRLPOOL 6e4ffbfcdecba2d7d55910797b83ca1ac8dd49a579346a7879aad6859807d8746544da6e420f8a638844ea3396ea87abb7761d4be4cc248a2027c432eaad21ec
+EBUILD arcload-0.50-r3.ebuild 4300 SHA256 c6cb7dd0188d37509bd8f4a4534016b70cada65f3cde613f616cc1565633e4ad SHA512 e7df8a5eeac49354e73c513aba5a1797df65b9f6f385a14d962f80d367c86f11ffa833eb079c0e8e089b00117b9f1836be8a78196b1bf012c71af2665be42651 WHIRLPOOL 088acd245c7838ba7d8b623128883484745a6de187e3f24866deaea9aa624fda1a4df45d92fba1dff4af0c30ae377ba80cdd9dc31c0388a6e8f04dd3f3c2c59e
+MISC ChangeLog 3005 SHA256 ec548fe7671234935693001923979129f37af844727ae9c97f71bbbe75054191 SHA512 330c6826774ff1c15ded73b275ca36f278d13d40457960224869bf64ee6416beef4061c0858f4df1c3a688a447c5bead9976d697b214f6018f39bdc04faf1f76 WHIRLPOOL b2d49a83427f6b3c23be66a523528c7388f06b28a3e37b3b1b8ea4a08a4434ab52c1e1d46d6cb33c1217db946b71bb7a5417cd0814d93ca8b85d16f758769753
+MISC ChangeLog-2015 4077 SHA256 55db2282abd07bdc29a3576607339da940d251da3b76c7e1957facf6c805c86e SHA512 6eb5f9ccbd76cc34affb807de94784e9cdadb88c61879dc143d944612ab5fedfe83ca5c7645b4ec8216e2b32039cbbfa13885c68cb31bff25e013ae4a510c3cf WHIRLPOOL 49df6f44f23f69961bd465637a4d7c5f1af93011180f7006156c3b562ed561e88dc66bc8896ea1dc60b5861d9218ffa0ae2d7b9c16093c356dda9fd23fba8c3f
+MISC metadata.xml 367 SHA256 ec04970f9193dd9a6fc1583708bb313469cd411b4d18fa606f968ca1dc559485 SHA512 018ab20b1b8015dc4dfec36ef67701ad0c02f7487b8c57db09eb98c5d4d38bcd3ab74434959f051c396e5b995c3a109e9b53ccc7db5c8680333de4cf2b2b82a7 WHIRLPOOL 5b244aa8998b2176394bb47e008fedab768b87e45be9062851ca90609c04c024682710c9c1605c961b109dee95d93c16e05fb843d98da588b40f66651e7edd92
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..75fa0d8b009b
--- /dev/null
+++ b/sys-boot/arcload/arcload-0.50-r1.ebuild
@@ -0,0 +1,83 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+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="https://www.linux-mips.org/wiki/ARCLoad"
+SRC_URI="https//www.linux-mips.org/pub/linux/mips/people/skylark/arcload-${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..b35a574efcf1
--- /dev/null
+++ b/sys-boot/arcload/arcload-0.50-r3.ebuild
@@ -0,0 +1,128 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+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="https://www.linux-mips.org/wiki/ARCLoad"
+SRC_URI="https://www.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="abi_mips_o32"
+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..210fdb4244e4
--- /dev/null
+++ b/sys-boot/arcload/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 type="project">
+ <email>mips@gentoo.org</email>
+ <name>Gentoo/MIPS Port</name>
+ </maintainer>
+ <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..89aa735c7718
--- /dev/null
+++ b/sys-boot/bootcreator/Manifest
@@ -0,0 +1,6 @@
+DIST bootcreator-src.tar.gz 18881 SHA256 d1a1b581b65c468415867d005916cb898fc11788660819568434245cc162e3cb SHA512 53a17cc6b6ec9eea06b4162f32068d5f6c86ff066cc152e30c346010b197a88f3266315295c90b7123a68e81fb4ee95e4b0b341ef666df2eaa230ac762892d0e WHIRLPOOL 070f84fd33e5dcaad21d922a69a5b632f3882b6cd3fe90b046aa11f608536b662bb6869a30c9c8e5ceeb04db67aaf6e041f29912fcbaac4b4156aad6bbdad2e9
+EBUILD bootcreator-1.1.ebuild 557 SHA256 efcf4febeabb24c5d9e79852f183ad4cc9462d48ba8da8f1fba4e087e84c16dd SHA512 1417c14f8245ce28a96e04ef4c18a1d84edb661fc45ebc3820da75fc579f12825702058ce8fe3dce2c6af18982693f6d3eec0a81043b2cb5fae26af29e9f76b6 WHIRLPOOL 712ea5259d33b3d44019ad8e870d88035bb4e16c04c66dc7b86ca3845cf41936cfc6f4e694fe6baa606d1c4b200227260414925554192a898ab892878b452a3d
+EBUILD bootcreator-1.2.ebuild 557 SHA256 efcf4febeabb24c5d9e79852f183ad4cc9462d48ba8da8f1fba4e087e84c16dd SHA512 1417c14f8245ce28a96e04ef4c18a1d84edb661fc45ebc3820da75fc579f12825702058ce8fe3dce2c6af18982693f6d3eec0a81043b2cb5fae26af29e9f76b6 WHIRLPOOL 712ea5259d33b3d44019ad8e870d88035bb4e16c04c66dc7b86ca3845cf41936cfc6f4e694fe6baa606d1c4b200227260414925554192a898ab892878b452a3d
+MISC ChangeLog 2491 SHA256 0ab75f7bd47a25bf630e357c47e7f45cf54b892ca71b975b698ae8f7546371f4 SHA512 8a1c1dc7841432177a46c458417a6afdeb5017f08520c4b6f20d5fffd3fa2a4c8f24b5dd3947ad8c975be8b5b9f1b66f8453fe871c38968e5430619be2eaec40 WHIRLPOOL 7a6d3fb5f8cd7a9f5595aae32c469c67b8f33314d425f571f7c2d25bc8afa635087eca3fc92af1f8b1dfe7af47d231b53b09956339e3846da35f0ba0fe7f94d2
+MISC ChangeLog-2015 1160 SHA256 f235cfb05cf4757defcbbc4661b6a50a2bcbf80da6e74615b662e0837ad907c7 SHA512 e5590cf371eea1a64db2c4d62a01a7b1925095e4c2c8b6c4311d2cb13eafcba911ee703c09edbc649b318608b7ba3be4ac9f2cfd5921d2f44e8f6c6c5059fff0 WHIRLPOOL 3906e3f0a6a750fc47ca2b1a0ebc1f14af94a710ed1a8d23d70079559dadc00a909d106421b0f042584466ca8822a3407aa9b131c386972e35da2f762545ce98
+MISC metadata.xml 263 SHA256 bc3ed66da9a359018966a0a199721a238e033433a289439c60668e6f3802f874 SHA512 f72954ee8887da0e1b3e59effb6eb40294102e91b1060c2d736fa47a3a12513d959b44e77fc62f881408e38d30a47f1c5b1c4a0d9c3646b5fb75118e5295ea5d WHIRLPOOL f8c00193f85a48eb02651a6baeff8bab0acd7878475cd28ff9e29858bd10979f95d441318e34f5917687f45e2aa0533d5ab2083b5d2bb2b87df414de5567ad11
diff --git a/sys-boot/bootcreator/bootcreator-1.1.ebuild b/sys-boot/bootcreator/bootcreator-1.1.ebuild
new file mode 100644
index 000000000000..6c39fd7daa63
--- /dev/null
+++ b/sys-boot/bootcreator/bootcreator-1.1.ebuild
@@ -0,0 +1,29 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+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_compile() {
+ emake all
+}
+
+src_install() {
+ dosbin src/bootcreator
+ dodoc doc/README
+
+ insinto /etc
+ newins examples/example.bc bootmenu.example
+}
diff --git a/sys-boot/bootcreator/bootcreator-1.2.ebuild b/sys-boot/bootcreator/bootcreator-1.2.ebuild
new file mode 100644
index 000000000000..6c39fd7daa63
--- /dev/null
+++ b/sys-boot/bootcreator/bootcreator-1.2.ebuild
@@ -0,0 +1,29 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+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_compile() {
+ emake all
+}
+
+src_install() {
+ dosbin src/bootcreator
+ dodoc doc/README
+
+ insinto /etc
+ newins examples/example.bc bootmenu.example
+}
diff --git a/sys-boot/bootcreator/metadata.xml b/sys-boot/bootcreator/metadata.xml
new file mode 100644
index 000000000000..0d70baf208e1
--- /dev/null
+++ b/sys-boot/bootcreator/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 type="project">
+ <email>ppc@gentoo.org</email>
+ <name>Gentoo Linux PowerPC Development</name>
+ </maintainer>
+</pkgmetadata>
diff --git a/sys-boot/colo/Manifest b/sys-boot/colo/Manifest
new file mode 100644
index 000000000000..98e91a01f787
--- /dev/null
+++ b/sys-boot/colo/Manifest
@@ -0,0 +1,8 @@
+AUX default.colo 840 SHA256 00e33293a9bef9f3b1503c3f17a0de149efa38a89be8785bec35ff0090533c33 SHA512 fdf82c9a6adaa5711d8d2c0efc6dc051158ed815f6b870b516eec497d8ce17608fd01dc795e35aaa22cc33c97bc9458803976f5265a196adbb5a89457e88e2b0 WHIRLPOOL 30178e5658c9fdd8dcce63470e12a01552e7a8c4b54d1c369b2043f22d664548202130f987fb787a207da7f00a24d20a071d6066bb70b94a30b4099d84239611
+AUX menu.colo 1517 SHA256 a113b65fe188f1e24dfe0c3892101ed8dcee8d66910de236e71558661d7f326f SHA512 a7357e176f45d5d352ea450349986ae5493900d60b363f688371348b727859d7be9b2a732e5210beba5216bfa8b8e6c861f2433573a009aabb71569eefcc5eaa WHIRLPOOL f61a29132cd3c4092afbcf611699249fd1b27f6d63443c17a2a2906b97ca4142ad09cd2c7269f7ccdc6c34be59b55664b24fa52d4d84bc3f4ccc7537f4bb4966
+AUX simple.colo 539 SHA256 8d97a3efcb96c3f807f1e18d794a78e4a4a3d1195a8c6fc20eb9f640d9096cd8 SHA512 38b3481adbad50c344f87cfd9a5346a78158cfd298194f715b40ad582d5fad9ad6e16f773004a8732e673bc8b3791dde39da10ac85c72a8e236837ca82a91d1a WHIRLPOOL 6c08194cc5e2aba013a441a6af5562a186a7c70f8c8313db198a80912faf8f15e0a698bf58c04502f07ee420e8d4bb95415ee4ef6e3dffc72879902c8c960139
+DIST colo-1.22.tar.gz 257968 SHA256 ec51237286be9581d6be1ff3e43c9a654aaf4e1414d1bb194f02032e57119163 SHA512 c983f36991a6275d4864cbd12e00f4e73d3b722746b3d3c8442afc8fe00d5432772c93007999858afb0993e1a4917f94bc9803f017ace3e65535cad7e8fb9b1e WHIRLPOOL 5145a72c8a08f032cbd57ce8bb283dcda4d9d7902644b0dadeeaafd533b9de69ad75a467f647d995fde37b0f70c07dcc6879616952044186e59260d2b7dc3303
+EBUILD colo-1.22.ebuild 3678 SHA256 a9248ef875ba39ed0169b29a813af3ea29516129b034f9377bb8297fe3664ec5 SHA512 71e8b182907f377fd5b83aed7726af614a6640768ed2b8cef0083f08cf3820033564c53b25c15a370809ba41e409bd5f80e8b530c1f8908b7566440ef7912b72 WHIRLPOOL cf2d38fffebcfc66dc9d20520cf97ccef66cec2972901fd72cac9e2790cae87437f341becc55c887bdf6aee2af8d20d02ce8bdaa76fd5e0fb428468ddf65f687
+MISC ChangeLog 2868 SHA256 2bd56df4c64e48a856a87152d4929634515f86df1b8e31bb0538e5c2ca591b84 SHA512 9772eb1a03dad3ba88aa171331622d94da2d030df35e7a0e5f0afdbc89eefc9c279b55b6317ccb253135af3af686e4759c33e6dc4422f97b86a99c218c2c949d WHIRLPOOL 4c16a38c107b7ba49453f729bf2e6711b91aed022ee2d6c2beee2b2e23989b57f53baa93b7e15d60ec906bb5182b14878a762777ad868ec995ed4eb9d6330686
+MISC ChangeLog-2015 3884 SHA256 bc3cece21fdfde45734607e79c394987c8bc1c995c8c1e3dcd7f71cbe37a2de1 SHA512 19c8493bab3fd52a01e94ed224a6116418c97e0b3bc67e37c0b14375ff953c7a0d6b4f2807fa5ff4c5b6c9c571f1ffcbaccbfd8e29297ad372598f22db519227 WHIRLPOOL ed75405887d81fc1c7c3d10385237678fe05492b41f41e54b783e3321aace9c0c02cd3734bcea25a20b9e04731fa50e12ca9bf8831441c7325314ae54734655b
+MISC metadata.xml 359 SHA256 4f3a96f14c1b5cccefa551616ce25f7e0557e3c8ad6191f9f0abf62096df1970 SHA512 5471afe51705e3499f4820e3a9e6af18166075fec78eee0f60866ce844b06f73148663630f9aedbb4f300f26608d8135385135a142533553939ed2924e97826f WHIRLPOOL 8568e33d0619a50fbd96021ea1d0188c16c00aa13adbf35a88c0e1952487ea91a632c4d8ced39975b8decb15ec81e5f086e7c43233fffa655ec3d2db589e27c9
diff --git a/sys-boot/colo/colo-1.22.ebuild b/sys-boot/colo/colo-1.22.ebuild
new file mode 100644
index 000000000000..94a56a3c4d50
--- /dev/null
+++ b/sys-boot/colo/colo-1.22.ebuild
@@ -0,0 +1,117 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+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..ddc76135d450
--- /dev/null
+++ b/sys-boot/colo/files/menu.colo
@@ -0,0 +1,60 @@
+#:CoLo:#
+# Example configuration file for CoLo, version 1.16 or above.
+#
+
+# 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..05574454e811
--- /dev/null
+++ b/sys-boot/colo/files/simple.colo
@@ -0,0 +1,19 @@
+#:CoLo:#
+#
+# Simple CoLo boot script.
+
+# 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..5304fcc4e451
--- /dev/null
+++ b/sys-boot/colo/metadata.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <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..a97991c2cad5
--- /dev/null
+++ b/sys-boot/cromwell-bin/Manifest
@@ -0,0 +1,7 @@
+DIST cromwell-2.31.tar.gz 543461 SHA256 0611fa76c3a4311e66f0d80686f27de73e1394f8d92f54a5addb09d55cebb22e SHA512 ec39a3584957b0e1e4e7df976b9ddda45e710afb6f1bc34388d2dcbfa08ed133234b7bc46c1cf2d9663def939823b524d4a56cb1eceefdb8135d566abc4ee375 WHIRLPOOL b6cb3013e9a12c12ea999c0166df72d263f5db6cd3f21ecb1b90ceb33ba0cf06671c0a18ccfc7af6ba94803a10395474e0a5899ee6b69e2efba861bc42079a33
+DIST cromwell-2.40.tar.gz 541204 SHA256 b3f078f1e5069a39d3767aa8f579906d39983478d51c9ad2989c337b9148299a SHA512 492441ea24f8b17b3de2c896b03d823d7a97eac85c07768ea4490c0351c71e80f697caf8b469852213763b8a38a058475f8b78f51523197d10a006deaf461f24 WHIRLPOOL c3418d24d8aa43d0784716d4d49fca3e7a9dde84b84c6367b018977be1a4350f4f2b4cdeba11112ede0fc6efc040c6aa9097998d3329d7c06f104f25a2a2d4a2
+EBUILD cromwell-bin-2.31-r1.ebuild 551 SHA256 07c8c5eb941917514a9f8d6d9f4340722f0c73e87325bef04b827a5534aec9da SHA512 307b6b094edaae2ae76dd14f3f51264304925ee3f76df0036195d890aa0c4c360cc01b1aeb542bedc3a2ed7ce0b229f5b77c24cd97da884e4586d96993760b37 WHIRLPOOL 754e02eeb150fe25da33f94d7b9b9ee3112a86cc0cd81127169d29219996c02e31f5eb248410519a91367bb73067edf5f5b961fe727cf1213b68c3b139c542fe
+EBUILD cromwell-bin-2.40-r1.ebuild 561 SHA256 4b50ec7e26652bf20f22c3b4cdcdc523a725b69ee583c9ad78d1bd23b771a1d7 SHA512 f7200d768f6a9feff13d1283fc4d80660c05ea85642a6c16879636c47c58963d3f0530be0a01282ef180de70cc796d307075ab8e44035d951fa38dbb74911b32 WHIRLPOOL 021c1b29cab17870459e66153f26d28a17c94181ddfc49e81b540e626e40492d26ab5e8ef5c0ad3e8e9e20307cb88101ed9541c5bd130f690fde7935d0da3797
+MISC ChangeLog 2500 SHA256 510768939a923cba5a7ee1bf080d986618ea64a89902c5555e13d7e3dbae9658 SHA512 7ae225efdd49741feac02d380444cf3ba6f6739d192b3daf051c2b1d40e628491e70c295bb61a83ab354cb0ff2f215367afd9f6a4a35786dee86ed8aaa67cdad WHIRLPOOL cff3e5d1b9fbf38a969ff376ad419e771b7830f16838811b389d93c837494b2ecc341d7812e02d99fae6ad3984a3e8ce07c78a141693337a857d0f31c0b04420
+MISC ChangeLog-2015 1140 SHA256 3f016237ae0dd927d06909427cfdd727443e9edfa8280f4a99ca090d44913fbe SHA512 81f55bfd408db1d9fa9a01788d878b16240b74a915f9d490f3336a2c7447f59808a24643a0ff96dac52cf00b3f2180f57192d5b140373053fc651fd7f8344858 WHIRLPOOL 9d9cb7da5510ff02c04d70e4be9a7ca2044a025b7a5ed6119ddc45548894f9b318d2dc3f0c94b6ad1089350c40223431798f8cd0250d727d515a8642241e5e64
+MISC metadata.xml 377 SHA256 dbfd0a7af70b1de579dd70c301c38229c30968cef921ccb7bff910fedb0a0004 SHA512 84ad434f10fc54b86c03efa5c495d16aee8f45bfb7a15b55273a02bbc0e94a9be97e29988a1db60bc891e7906168fb8086a271704842de2c8a008177274a8fc4 WHIRLPOOL 070c5150dab3cef92960f1b8acc59053bd59fc542343ba0d345467ec05a512eef0d56c89d95d9f213494edf903cd4f25fca731f1a480b0342195f83a9b36efe0
diff --git a/sys-boot/cromwell-bin/cromwell-bin-2.31-r1.ebuild b/sys-boot/cromwell-bin/cromwell-bin-2.31-r1.ebuild
new file mode 100644
index 000000000000..98553790ab1a
--- /dev/null
+++ b/sys-boot/cromwell-bin/cromwell-bin-2.31-r1.ebuild
@@ -0,0 +1,27 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit mount-boot
+
+DESCRIPTION="Xbox boot loader precompiled binaries from xbox-linux.org"
+HOMEPAGE="https://sourceforge.net/projects/xbox-linux/"
+SRC_URI="mirror://sourceforge/xbox-linux/cromwell-${PV}.tar.gz"
+LICENSE="GPL-2"
+
+SLOT="0"
+KEYWORDS="-* x86"
+IUSE=""
+RESTRICT="${RESTRICT} strip"
+
+DEPEND=""
+RDEPEND=""
+
+S=${WORKDIR}/cromwell
+
+src_install () {
+ dodir /boot/${PN}
+ insinto /boot/${PN}
+ doins image{,_1024}.bin default.xbe
+}
diff --git a/sys-boot/cromwell-bin/cromwell-bin-2.40-r1.ebuild b/sys-boot/cromwell-bin/cromwell-bin-2.40-r1.ebuild
new file mode 100644
index 000000000000..8b7bb0fcd14d
--- /dev/null
+++ b/sys-boot/cromwell-bin/cromwell-bin-2.40-r1.ebuild
@@ -0,0 +1,27 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit mount-boot
+
+DESCRIPTION="Xbox boot loader precompiled binaries from xbox-linux.org"
+HOMEPAGE="https://sourceforge.net/projects/xbox-linux/"
+SRC_URI="mirror://sourceforge/xbox-linux/cromwell-${PV}.tar.gz"
+LICENSE="GPL-2"
+
+SLOT="0"
+KEYWORDS="-* x86"
+IUSE=""
+RESTRICT="${RESTRICT} strip"
+
+DEPEND=""
+RDEPEND=""
+
+S=${WORKDIR}/cromwell-${PV}
+
+src_install () {
+ dodir /boot/${PN}
+ insinto /boot/${PN}
+ doins cromwell{,_1024}.bin xromwell.xbe
+}
diff --git a/sys-boot/cromwell-bin/metadata.xml b/sys-boot/cromwell-bin/metadata.xml
new file mode 100644
index 000000000000..43ce42ffba11
--- /dev/null
+++ b/sys-boot/cromwell-bin/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 type="person">
+ <email>vapier@gentoo.org</email>
+ </maintainer>
+ <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..cd8300f53e19
--- /dev/null
+++ b/sys-boot/cromwell/Manifest
@@ -0,0 +1,7 @@
+AUX cromwell-2.40-gcc-4.6.patch 838 SHA256 dbacf5761adad60d744c905ab2d44d22b2f22bcee4e09bb70d826d22182491c7 SHA512 a32e4b4a5d0a6cd30106abc6ba5eb04d6e8520082fa673c739e2a7746b22ad0152d5bfdebc67515252eeccfc116e60516eadd67f34b1643a53b2041bcd16fc76 WHIRLPOOL 53ff82edf025dff515d966aa0d7683ae93efc5e4d321e3acdf9bb89c8156cf61317c55b56edf2e532c13f04d584a4c0719838f268f8ca2f57675407e599b7bd7
+DIST cromwell-2.40-r3-cvs-fixes.patch.lzma 7075 SHA256 97d50811000edc399e0323b5faeff169de86846f50439adbc59b6eeaf1bb12fd SHA512 b5d7c37024562a8a5ee8b1bf560f852ac43e0a0fbae0d3a8aa55aceab9f56cee5e80bcedad12bb64160ceb33a79fbb86f10cd6d5efeede6a5433d825aa853114 WHIRLPOOL 4d75f8b0e351d65492e8f1df681f0195e68fd8caa538b3a781860c3603db0b8400990633fe09bea5386199d5f9e01b46624bc89600f91bfe317891f662a6ad69
+DIST cromwell-2.40.tar.bz2 943015 SHA256 115cf68afad311f6e7490c3091dfb81870416cec3f2cb35d30360a919888cc3c SHA512 ed5833281fbe82dfad0a195f57f127cfcfb1d3fb7ff7179dccf59dea3c3a945d874d0d87c21fc2af641de5a39b9cc8a8703fa17edd43973ef526d368e21ddb37 WHIRLPOOL b591d3cc8f1ec408e34f607826f1fecbbb66f359c4298683ddbfb5ca659a2c420ca70fe2f03323e59a1af602b4a2aa49e3a1fea06c1d90beca4fed17ce8563c6
+EBUILD cromwell-2.40-r3.ebuild 890 SHA256 a66aaeb6f2467b7bad76efd46c9e27b8f233bdb11ef094d0ca6a4dd7db8afd58 SHA512 19f35dce21d0b1032adf0162ee1ef8fdc6d9860e08d75c33c17e981324458ce091e4f9389da7cadf82fc76f13dd8cd9f721a11e263fa679c4899c7f49ff7c6d1 WHIRLPOOL 366d9d52a66f5766d133ba1953bafbdad9edb377fe81219eede67cd61ec2404a502a800cb7775df3e221a1e2ec21945f986f6d700ec911e9ddb7ded766785f36
+MISC ChangeLog 2470 SHA256 ebe67afb8e99d75ba83316d0ae2bb25507cc66510ecadcfb20a169e1301362c4 SHA512 aba36020c1b5f0b30bea7366fcf897954521c8371b97c7187492cc64de6c7428a662cd7f0eaabc3c629936c29b8414be835c13f02b23e55a051e1c3e4a2c9ae5 WHIRLPOOL 313ebc9de0c7afe7e342bfa644ad6aadb6b6abfad5632ef5db494dd6ea08bd264cedb70108ac597ce044faace19751b6fb7dc3b58500e6b5f1b3e7ad2c8fdeca
+MISC ChangeLog-2015 2473 SHA256 5859b003783f87189db0e850a59b243e16c04d138d5d098a1e013a176bd7bf7c SHA512 63e04b19467dbb123edccd5e1750571e1c0a165d739fc908eaa00ce9dbe05917bcf09041da32f7d5a32842d6a1ffb51cd18b44f1983581ed2944d433cfe67e82 WHIRLPOOL 159ae88276b309d8e77a95025da5738b1de39d16334ad60c5c9b12a07c136f01156ff242a9100fd7a46d88879e600e0037447c88e93ff87a3fbab7ae84e3d17e
+MISC metadata.xml 275 SHA256 7f563a6fdcf435672363baf0c0cf388aed761abf498f64f43c5804c4b09dbd5d SHA512 a2177d6164e50c2500a9aba6d5aaa8dbc50b03135220e504b32d32b726870b18c4f80ba47f1aa25ed7a9729edb3e26ae9087e13a5606c0807c33291f0de83ee9 WHIRLPOOL f60122fc6aa3de981066d2eea7b629436e2a086f6c5783ea577656244c2f46fed286ceb190bd2c0a45c6bd80a042a4cd9ddbf3bf6f9e84840be4d2dcef2354fa
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..7ce7e1fd24b1
--- /dev/null
+++ b/sys-boot/cromwell/cromwell-2.40-r3.ebuild
@@ -0,0 +1,37 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+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..2a1eff7d20ef
--- /dev/null
+++ b/sys-boot/cromwell/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 type="person">
+ <email>vapier@gentoo.org</email>
+ </maintainer>
+ <longdescription>Xbox boot loader</longdescription>
+</pkgmetadata>
diff --git a/sys-boot/dvhtool/Manifest b/sys-boot/dvhtool/Manifest
new file mode 100644
index 000000000000..9c2863d7ff5a
--- /dev/null
+++ b/sys-boot/dvhtool/Manifest
@@ -0,0 +1,9 @@
+AUX dvhtool-1.0.1-add-raid-lvm-parttypes.patch 1067 SHA256 09b0358113c7a83b3c94f0f55849654e47a85a686daf53d55ed8dacecb89206a SHA512 d5ac48abaca65937831a71cc24a7da28211a30fc700d2a955b8c1aed04667e9f34ca058ecc7a1da5b3d73377895dfa3327bf3d723247377a26da7805b2adf036 WHIRLPOOL bc0498019313b91977271fe8a6be0e5c6ecac025cda7e83e2f102391220bb67fabbde7a0d9e597bd18464f0932f0a7b24faa070640270203b00a4d2d27173bfe
+AUX dvhtool-1.0.1-debian-warn_type_guess.diff 296 SHA256 b5601df82ad723651ac72116f8fbaddc61c744be2988a4a10f41b523aa2dbd2a SHA512 0eed46bc6e49854bb4396d516c6e1879043a987e96066c33e519d295e09601b0f95e5b7667b5ea40d05ff8861f64f3446ef84b6bca225288f46f3f93c8dbec65 WHIRLPOOL aecf705051ed95994542c033d08087c7e6a87c86801eab305206631eddddaf8558f031d772eb1a3a533856fabb23fcdb1e14dc3b8bf96c7a2d73a65eb2331bd5
+AUX dvhtool-1.0.1-debian-xopen_source.diff 208 SHA256 2b147a4564a206d98c466857207bac4a43985c1fd4651b2a423be908b5ce48ae SHA512 500a25a70f94af2911387729cc7fc4320904049f15c437b85030b3bb8694d798dd55a839df141823947b53758888a8e47eb02d24643209401406e50d68196ab1 WHIRLPOOL 2d9aba604dc3a01eba0ffc7670001e3fb1b997288ca6829b5f6c5f3bcd5ab7dc81c4a55337d4a5be509044354801fc0e59852886dd11703c3459934acb1bef2c
+AUX dvhtool-1.0.1-debian.diff 4724 SHA256 e5f385d7ae53b2c150f2a042ddf2bae249ddf7a7baf186b3b0665c1129afafb8 SHA512 e495f03249b9b026cee2caa68653630216e7884bd7cb441d7d3939f9cf1d9a48892bad15416cdd205c5e28e6d0a31442aba888cf1cc4900b2c098decdce5ac14 WHIRLPOOL c2744ff78eebf7d8d01f75ba184e31e41dc12077e16fd3d67d11bb32553fbca1f80aeb5ee99e0f371a779395a36c3188fe0e53e5d0e107ea2f7dda4e2ba8ac2f
+DIST dvhtool_1.0.1.orig.tar.gz 53283 SHA256 3596c74c08ee8f2f19712e8f0ab1f7ff8c483de7bfc2f50d205a186f52896f02 SHA512 e81c4427f98a7aa79b9e8cee6fad35822d5fa48fda17f656407d1d6de50658ff2c8b6c3a890ae07afafebf126b5388c98ebf63af4a93bf1091161a27ea09d140 WHIRLPOOL b70cb0170252bc9709aa7ced89ca8efd30721670688940f9e1cedb5deef18018da50762d79e7ea7c63ee1a2dcd63ed8d84708d4a80a3bb5105a9dd5fc7ffc140
+EBUILD dvhtool-1.0.1-r2.ebuild 989 SHA256 a211145152736ee1136680d335e5e2704fe7a26db3904b31aa12eae13708562d SHA512 be38e8ac66f39ba8700d7c4783cec12fa6bfcbde7fd3ee922386b9daa3b760f5119a2688c38eaa75a8993e927460962398cbb261b40fa100b2e962d043666652 WHIRLPOOL afb3dd91fb2825034dccde765a54f4a84b4ed5d1995c198767b4dfa4ac03fb2614b7af880f79a295af5a628bd030955bea5660cea6721166563f570e47cb5157
+MISC ChangeLog 2621 SHA256 b3ca08b489334960ec54be65fbfb661572f37342281a3ef3255014e4e5491016 SHA512 ffa2ee5647472fd6632252924eab98004986216dbe845076f382be53c7ebc31b55ef8834056db79a47573751d00e14c8a96b02efb829eb68a4af0c5f25c31655 WHIRLPOOL 00cfe5d3e2a6f0ea93689a4661bc89417ccfad0e33f327f07830b3a0cacfefaa80e6c3c41c1d42b1b61445a6538a4c1d6fd2dd753394d211494727c652d39dc5
+MISC ChangeLog-2015 2627 SHA256 d8c8eec3271f8de01596e12ef860adc9ee0a2fbf77d6ee89322749f5b2c7bf86 SHA512 525a5e43d6fcad4b5ccf7b944444ef5cd82083dfc8a5979a1cf5f430e1744664ccb4313b05084792183b533ac87b5230c968e26f980566c8f9fc495834596ab3 WHIRLPOOL 811b6f35a0a3993810e6cc9d460c0fea9ec229383256ba8d658795ea62edb59ee27f8654459eff4b39b680e2acf62cd4d06288f3125168d9d4d8276199cc9a6a
+MISC metadata.xml 244 SHA256 45137d4c0d67babcbe5e68d0ae2bd162db10bcbdbb7a3c0c4c2a63e6952a5330 SHA512 c95e0438b39ea88f5522fa5cb8c9b37168e9d6da9c4b9ce2b5e4952117e5dbc74efbf6e21e055a3b9c8c483870386d84a2950611dac33d4239ba559c2aa57362 WHIRLPOOL b650bc145a04c907ca29d22d41b0dc217cca1e4ae85cab8bb4471179703a7affa83b921008acf3745b2e4c678e30592b59db332db16686afb79db37070bf71f5
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..784aecf4b352
--- /dev/null
+++ b/sys-boot/dvhtool/dvhtool-1.0.1-r2.ebuild
@@ -0,0 +1,43 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+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..4c41df3d6e65
--- /dev/null
+++ b/sys-boot/dvhtool/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 type="project">
+ <email>mips@gentoo.org</email>
+ <name>Gentoo/MIPS Port</name>
+</maintainer>
+</pkgmetadata>
diff --git a/sys-boot/efibootmgr/Manifest b/sys-boot/efibootmgr/Manifest
new file mode 100644
index 000000000000..27cf56ce6cdd
--- /dev/null
+++ b/sys-boot/efibootmgr/Manifest
@@ -0,0 +1,7 @@
+DIST efibootmgr-14.tar.bz2 34972 SHA256 377ec16484414b80afd1b8a586153d7ef55ccf048638080101d49b7c77f37ad8 SHA512 97935f8752440ce236162e174ea3404e907ebddc5877d597a97813da76ad580689fc2e97044885fc860a12a473af7183242b6120e78e53243d35e569fb002baf WHIRLPOOL e5a6860130d9b12274cfe74a962a277989e9961cc8fb70372e8ac0831f79561e30fad0222154c957ed525cf930b912a1d731caff7ef5b2b0987c7cf8f28c4383
+DIST efibootmgr-15.tar.bz2 35476 SHA256 2081add77eb0641805386acd0a0fbbe6dbfb71831b814507ef49087f748333f9 SHA512 d9d9eef14d373d5da88141e8105f754fea4c039755ed0a0cb9b3c9c2bb285733ad930fd912df42075fe2cf750585699307b067f594d8e65269b3b8a5a00b1cd1 WHIRLPOOL 3ee3351b3a380cef4d91afee0f4b7ffa342cee54c0b243568270d0d1ec605eec1c764277af6a73d6dd43477ef8cb458ee832c84e641bdbe2d07b1f7b5a23f3bf
+EBUILD efibootmgr-14.ebuild 598 SHA256 a39cede19659652ad02ef1a12cb9d49cdc4d1542b7bc1a63fed9887e94249b85 SHA512 3ac06c5e1af99dd5777db1460bc8cd26ebde024a6e7df5c3f597fcb3e16a030823c0a6999831efc137cc0c91eec487ae28b12c21d3d5c43fa10e826b9929cdb1 WHIRLPOOL aac0896224d98cd57a7960353cad287d1c45ac0000e29798f2d3e68a94aa7e507cc3f9045396278652df3712902c1b792d9b237518b4bb70b6b83a14fb1e0490
+EBUILD efibootmgr-15.ebuild 625 SHA256 c6f858cd43384f8cbb14c3e680cff698f4864684ea31b2066623e3ac79d28d69 SHA512 c5f76510764eac44a4ea9dbcfc8dcc4fc39e5495c736eeae3793b7fcf161482cff6e2dae048b80a5459fbb68665468022b643b8894881e2be80e2a3657263b8c WHIRLPOOL f13de0a5acbe80c20b3505dd833252a19d0e5272323caa9485c3d2ef9eaf44b353727ac560ae8f3b90e938b0d7b1617fcfe532edab0a948a1182612ede49ef34
+MISC ChangeLog 3916 SHA256 080f1fef57370f0bb99fe9b9765fbab56b443e7dec5be316a0599f076ba1c716 SHA512 7c2f16599672d66785984f4a9166eb5df0949decf436ef3a8f8d59a7cbac48c0dba4e5da0b4efea692091e1da274c126b31b345cade9c464ecacc31c8d05c0d7 WHIRLPOOL 439b88481e84fb49c4bc4ffea06e456af464f5df4a5d311eebcef4be90abe0234165cb95ecdac601a7a3696cbcf01eba76d35ae3d0db71c4e15cb7f4a95e948a
+MISC ChangeLog-2015 4861 SHA256 3a9f4656ef0633e6e5955d5fdef616a11b143fea1d8744bec2d2314ce0695463 SHA512 91c64bcb503a1d879ef9398887a3753368f5c99019d6d2ee5553c7f9058609537d95c544622ff51ebd0d7f39a7f20dcd9c4e9ab7801310f17e82868cc02f8a8a WHIRLPOOL 8341eaecf11ad95f0f02c08d67090ac8644f87bbd3654e69df98fd28d5cafb12a04f04ff4ccac00255ea26d9947eb3d443a3a81dbd8a228bf78ccbe1889adde9
+MISC metadata.xml 626 SHA256 44a2b529eab0c2cec715823ecc54948cb93fafb692ac97dd7c8b8bcb4f3170bd SHA512 d52646244bf9c0d10d8c5b986e110944905fc8f898c0330f65cd6c734e6d8cfabf72854cef362f411d3d63fed3f5e22207a7b94d1ea8076e566d8eff228bb33b WHIRLPOOL 56109722d4478b9980f2077a05b9f74f451646a7df62f5c32c9d6ed9de3ccf34c19f670b1c87e1f57573d2231caebdaae86fa3bc91901622d6aa098a8edeb957
diff --git a/sys-boot/efibootmgr/efibootmgr-14.ebuild b/sys-boot/efibootmgr/efibootmgr-14.ebuild
new file mode 100644
index 000000000000..93b101105ae4
--- /dev/null
+++ b/sys-boot/efibootmgr/efibootmgr-14.ebuild
@@ -0,0 +1,28 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+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/efibootmgr/releases/download/${PV}/${P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 ~arm64 ia64 x86"
+IUSE=""
+
+RDEPEND="sys-apps/pciutils
+ >=sys-libs/efivar-25:="
+DEPEND="${RDEPEND}"
+
+src_prepare() {
+ default
+ sed -i -e s/-Werror// Make.defaults || die
+}
+
+src_configure() {
+ tc-export CC
+}
diff --git a/sys-boot/efibootmgr/efibootmgr-15.ebuild b/sys-boot/efibootmgr/efibootmgr-15.ebuild
new file mode 100644
index 000000000000..24116a1cba1f
--- /dev/null
+++ b/sys-boot/efibootmgr/efibootmgr-15.ebuild
@@ -0,0 +1,29 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+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/efibootmgr/releases/download/${PV}/${P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~arm64 ~ia64 ~x86"
+IUSE=""
+
+RDEPEND="sys-apps/pciutils
+ >=sys-libs/efivar-25:="
+DEPEND="${RDEPEND}"
+
+src_prepare() {
+ default
+ sed -i -e s/-Werror// Make.defaults || die
+}
+
+src_configure() {
+ tc-export CC
+ export EFIDIR="Gentoo"
+}
diff --git a/sys-boot/efibootmgr/metadata.xml b/sys-boot/efibootmgr/metadata.xml
new file mode 100644
index 000000000000..2202a4d82065
--- /dev/null
+++ b/sys-boot/efibootmgr/metadata.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>floppym@gentoo.org</email>
+ <name>Mike Gilbert</name>
+ </maintainer>
+ <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>
+ <upstream>
+ <remote-id type="github">rhinstaller/efibootmgr</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-boot/elilo/Manifest b/sys-boot/elilo/Manifest
new file mode 100644
index 000000000000..be39757410a0
--- /dev/null
+++ b/sys-boot/elilo/Manifest
@@ -0,0 +1,19 @@
+AUX elilo-3.16-elilo-loop.patch 299 SHA256 efb6570cd3409b86ba8eacfcd13b19f7961b8c3b062adba10cbc0227f6aad445 SHA512 6480d3e9403bc54b4a923e77df049eeb42929020f222450e32c12d4dcb09b098aa52924be0ebdda95e01ee8d0ced624ec96c3977cc1213b66dc5a8639797bc20 WHIRLPOOL ce8b47290d22772f890fe22ae7152986143531d51f50ee2a179a4cd93e7343ac4a71f8f7cd454cc761d98f25b780cccdffd08186179c3cd37e34e1b79055dda8
+AUX elilo.conf.sample 150 SHA256 aa42c5582f5b282ed1fe5ef85c2c190e7c66283da905c4ef23886d313845d353 SHA512 3f99527724759f5c03a5f244b957bc6d50ca378f2b66cbcb19f73fa721d2fd76119ae90669e4cce045f5bc66a80d46b21e76e8c4895d23b22df23ec69262b0e0 WHIRLPOOL 40696631379b4ac54d10aa8f21ce345bdbc84663769020124a49c16f71e01a5c5e94f926b3d959add82c233490f889d038731b3a0313154a2d1268a7df918c02
+AUX elilo.sh-chkspace.patch 833 SHA256 bcab65496766878d6cd4c8aca9abf83145fc14fe659dc524756f210a0301a118 SHA512 063131fd53866e717d87a4ca23e5f4143cb166480d89312bbf9f5be9540e29930794657f1eb2709559435abceb415b7775e049a1f8d410ae5007dc967fbf9224 WHIRLPOOL 1c0fc3e307e1a4aaab9a2c2607844b346754a0f4c1cd50fa39c0e6ff225c83c0d1d201ee2db557ef993876677713e91ed0875e07913a2a0a34e0069f26dea96d
+AUX elilo.sh-vmm.patch 2099 SHA256 250fe3d335b8810d33de868f3599b11ab5b3b93bc27ed45344c7f1c675c5a10c SHA512 2bbeca88b38790b3821e4ba54c46d194fbb776cf56788634e91da91e028fedb81a38928d0dbbb503cdf1a047c281800aea1d56a2eae47953dbc2203d795862cc WHIRLPOOL f0bab314cfffb51cdc3a2151cbb0a08064cb1f33c11289ae5ac56191098e85c3892f32c5a135e4536cc900b8d4342e668754679424046047e89a6006b4e98b39
+DIST elilo-3.10.tar.gz 210896 SHA256 65d0d7cc31bd0ef6824b9394dbf8991eb850aa4ba2dde1f9302e3da3cb2a4399 SHA512 4ec104f2d6a36745689619976e9811b5f5cd0d25be0f613d649ca2ff379e0514ab77c03bb474b32da87d73bd687d3d9faa9f2d07859e4c208b5d5a5a50d47e24 WHIRLPOOL f2d70ab94f1b82aac9ad8409557f2b0fb5d25f124e546f1e457e20a4da2b68baf1749377fb7a45b3bb6203bf9c54309adf9b9e072d7871e9d1a6b1d17b3c2fdb
+DIST elilo-3.12-source.tar.gz 215125 SHA256 5005534ae972603c65caa8debb2bf3c4a22b895588323bc1b0a7a9f114e030ee SHA512 a9dceb1e03ec1cabcaef696e4d1b8fe8683b0feeef2171781536bc469f8bcd0b3ab9b4460b149bb1bf68c651bce8c7abec5ef4f47e78113a611594a69e91239c WHIRLPOOL 9e874b4512721c75b12f9c635e7bbdf63b0d0427bbcf880c38d9c53b54c53c15cf15a9ddfae788d7068a9d8ae615d1492f2af4f9046d6c7c48e3507ba13bbb7e
+DIST elilo-3.16-all.tar.gz 485844 SHA256 69e361d95c01ea2657200b2215464fc0235b01d3e317d2f2276284259b06d392 SHA512 4289b45f2e40b2a12167f2efd9a482cf97baedb13fc24813f360f375296d0d3f107d6c980b4b31262816f664a2536353fa124e689cbd65093da9b16fdddaf842 WHIRLPOOL 5cf749f7120cc1789afc856dc8e0ad7fd4a34885caac7ab96da838ea35eec2d09356d602e0e8a9f28ce5fd021f977d4d17b7c16e03c8e54dcfe658f5c9b42c4e
+DIST elilo-nightly_2006-03-14.tgz 168991 SHA256 b5174f1d921212b65f708869ea374e7c3e4e1b0771738b03ae6a1830cb4fe65c SHA512 8f4bab99c9e823e1755a299e04a5d89b09d74e06a986b9732b2f48bd96c389c54d5af1fb59c4e06fe55dbe80340cfcdf63a9b0c1de1a1ed5cd0a3dd2df5f5fc2 WHIRLPOOL d389ae56432d45ed96d156fb982f9f961e774ca41e6c8dc8cc3a1cc4290436b944b945a14954e9ca7eff4de67dd7fa9bd53960d8c92edc2e9de8c87bf47f3967
+DIST elilo_3.10-1.diff.gz 26456 SHA256 de81eb071d4c7a3f02c629911cfd95f0fdc8705575df7a596e5630788bbb3643 SHA512 87e5bea09e66c65f048fab99ca9dfc5f0e61dd48b4ee012b7139d66af92291a79b33e2577139bfa529fd3c303b247a344384614927dfc3c2cff894bb032a3bc6 WHIRLPOOL d8c33bd0b5310206c89bf9b8d02443b9414adb2754651a412ff05a0727ae70e7d97a5d26817295dea0b37d71662f016ec58d95f0d33d6dba828d61e962dabcaf
+DIST elilo_3.12-1.diff.gz 28806 SHA256 26532bdf9a8c3455d12f22c59d1d5d9656dcb432dabd1a80cdbcd010e93305b5 SHA512 ed3394880ae0dae63a3e6b92ccb2a8251b6fa6bbfda7e45a53fa45a06a899a89b9a760dafd44425b424b0455b7d37d6e8738da2477fae42ebf67a3b038a7e944 WHIRLPOOL 0167eb79a8fdb9d6f0417abd75c1f325ddab2f451126955a7542045f42febd6188c03e3f7dd5a0020c67bba489dbb8afb4585687a53d2c026f03a49104c0c032
+DIST elilo_3.14-3.debian.tar.gz 32179 SHA256 30d4e5eabfcdea8bc6c3ae3af05cff9e182847d388a83016c85a1f3fbb42296f SHA512 b2d5927bf84d61cc432fc916301ddb3be74db16d3e5ba4f13039e2925606b8870991fbb17f837005d8f2b655b7dcd2b2311dfacd7f02183762caf7081ede638f WHIRLPOOL c5ffda521ee6e4253bc45160e712371d2a561841198152289d84971430a17a973e93382cec460efa9f7a09053b910748352ce97dde7e45d2ea737b14ddc5078e
+DIST elilo_3.6-1.diff.gz 14944 SHA256 cc9e3d753823ad1bc50f935017e8b5cdc5d76cac2a37c498c862ef021e0e0073 SHA512 962672f516de48f88bd453248d6469a4962fb7551214de9f73125deb64121ab08d123746b2cf8c1c202177f7272aad4cb63e6970f1860c772930bae580817bee WHIRLPOOL 23f1c3b6fd8cfb7356cc165765b724ab10278b35ad36427c018b2931a9723e887f2cbecaa21bd3cd13fa5784035683e40a8cfc6df4cf65acaeb3fac1d6488dc9
+EBUILD elilo-3.10.ebuild 1881 SHA256 df03502788a0f76dac436bcdce3df9215427d122e7315323a7702eec7fd502b6 SHA512 40c43228a756ed0ffe1b6ee0e7ca1a15dd4eeae4ef11533e7604f1f9bc25a3395048721403abb84bf1bbe97652da0d8b2992e80698e49e0135f8f2e3804f40c6 WHIRLPOOL b61a60ff0caa810c56f64a5ac8029c596c6847d978b9b30de591b172ab329a0a0ab35feb94a1b48ac2f93d0aa4f65acb069845e09386ed857096dfadd60f6384
+EBUILD elilo-3.12.ebuild 1875 SHA256 923a3f6d3b436acd089d08b4034b62c455fcf9106ebe26c3e3a6f6a9b0b7b93a SHA512 e1133533b8727e744457086550771ead877279a919676006562d38e0a6e2949f2d95eb828d1664b3f726d072a83b184ea32632785df92d20b9f5d09cb0914c57 WHIRLPOOL 8a59509a883e53c448ba5f4d36c4f1538640c881a81b93aaf9e9a3c94784a8955ea9e5f11dd3c8300c2affd2403e5b8518f804726b2a47d15c008687805a7d23
+EBUILD elilo-3.16.ebuild 2032 SHA256 e30db8c54b106438ff7a359a347928ab9111d443b332c2b5a98aea4c72a58541 SHA512 3eefb2956ce6cd1f5322c7ef537fb04fb9518ffb294361c0a449154adf11729ec7999167754cd034cfcbadb16616324c6866f8356e72e73e4aaf52a4e4f77398 WHIRLPOOL 0ff95755beb1e098269004ef3429f6379a29cf3f2867dee92c5a35df0c5fa6d5019421af7520550f0c1ebea4659124977a18ee4489a275e5716b34dcb1957159
+EBUILD elilo-3.6_p20060314.ebuild 2290 SHA256 fd41faa19fefafb93848303a7aacc0fc25f130264ad9fe19f5cdbde41df20eea SHA512 4eb9e60abbec84dbe1a65138feb2ff0411faf54144549a4bff521aa867833cb211457589bc457cac072061714197b77abaf4267e3f21b6af591878114dd1b5ff WHIRLPOOL c71fc9bf7968da058283ed3990e4edbad669d4350d5f3012f1b1337be73e7f4d7780f58c9827457acdb97eb9618da95170d22b970aac0cb0c70ba2fc831c9424
+MISC ChangeLog 2888 SHA256 6aaf0a0d7c0bf53b10e05a06e5f7066e76e398f3848006bf292442d25f1bae27 SHA512 f0b5106b0c3971cb1e82ae8152d03bbde757ba9b5ee69c6d6167dea45b051c984b74ec16bc865d6d43dff8d7ccba035e323f6f811544f210e9a82edd46a88098 WHIRLPOOL eb32a8fdcf5fd78837166f1852675e7b4f60240d00e6f067208047037daabb298c893ed68770a4c8292ef0192bd059d3da692c432c039f7ae31f38084a8e78f9
+MISC ChangeLog-2015 4029 SHA256 6fde80c697a8680b90668245e303ee3315e237b21a1e40eeba5d0eae0f74f4fc SHA512 f439f59e34207303ac5c80a06837dab822054085160d254cb1bba63b30080cc6a250fa38008f73faad2e07b58cbd14c975c5d89a7fe3a6206f7ab88d267dfe00 WHIRLPOOL 1aa0ca8e2db2e41df73207cf7d273808df3e2eb8cea099c3fd8bda16991b6abcad721680be2517c30a54e6a1f976e3bf7d5c708d74ae9c0c821ee043af60d68f
+MISC metadata.xml 337 SHA256 0a5b7153575e772762185fe50c7abaf7a92cdc34717b943b6b605c73b3647cc5 SHA512 13691bef927bf7f8a4a6d0640d38dabb53fdae1d8bd986c5fe73c1643e2bdbaaac50bfe864e2185a584fa6265a3197afc5273b60b70675481cef61706dde8d87 WHIRLPOOL 06f158011c1fd2f7fcdd4e86a3a42301cf297cda1dd2638683cc12a8712becbd8b92454538cc9f15ccf28caa52cd11dae62bb7f6e08a165cab444e2f4b7b9ac9
diff --git a/sys-boot/elilo/elilo-3.10.ebuild b/sys-boot/elilo/elilo-3.10.ebuild
new file mode 100644
index 000000000000..7ce19bd20040
--- /dev/null
+++ b/sys-boot/elilo/elilo-3.10.ebuild
@@ -0,0 +1,70 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+inherit toolchain-funcs eutils
+
+DESCRIPTION="Linux boot loader for EFI-based systems such as IA-64"
+HOMEPAGE="https://sourceforge.net/projects/elilo/"
+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..47665b54ee25
--- /dev/null
+++ b/sys-boot/elilo/elilo-3.12.ebuild
@@ -0,0 +1,70 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+inherit toolchain-funcs eutils
+
+DESCRIPTION="Linux boot loader for EFI-based systems such as IA-64"
+HOMEPAGE="https://sourceforge.net/projects/elilo/"
+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.16.ebuild b/sys-boot/elilo/elilo-3.16.ebuild
new file mode 100644
index 000000000000..7f215a841415
--- /dev/null
+++ b/sys-boot/elilo/elilo-3.16.ebuild
@@ -0,0 +1,85 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+inherit toolchain-funcs eutils multilib
+
+DESCRIPTION="Linux boot loader for EFI-based systems such as IA-64"
+HOMEPAGE="https://sourceforge.net/projects/elilo/"
+SRC_URI="mirror://sourceforge/elilo/${P}-all.tar.gz
+ mirror://debian/pool/main/e/elilo/elilo_3.14-3.debian.tar.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
+ dev-util/patchutils"
+RDEPEND="sys-boot/efibootmgr
+ sys-fs/dosfstools"
+
+S="${WORKDIR}/${P}-source"
+
+src_unpack() {
+ unpack ${A} ./${P}-source.tar.gz
+ mv debian "${S}"/ || die
+}
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-3.16-elilo-loop.patch #299665
+
+ # The patches Debian had were merged upstream.
+ #epatch debian/patches/*.diff
+
+ case $(tc-arch) in
+ ia64) iarch=ia64 ;;
+ x86) iarch=ia32 ;;
+ amd64) iarch=x86_64 ;;
+ *) die "unknown architecture: $(tc-arch)" ;;
+ esac
+
+ # Now Gentooize it.
+ sed -i \
+ -e '1s:/bin/sh:/bin/bash:' \
+ -e "s:##VERSION##:${PV}:" \
+ -e 's:Debian GNU/:Gentoo :g' \
+ -e 's:Debian:Gentoo:g' \
+ -e 's:debian:gentoo:g' \
+ -e "s:dpkg --print-architecture:echo ${iarch}:" \
+ debian/elilo.sh || die
+}
+
+src_compile() {
+ # "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.
+ local libdir="${SYSROOT}${EPREFIX}/usr/$(get_libdir)"
+ emake -j1 \
+ prefix= \
+ AS="$(tc-getAS)" \
+ CC="$(tc-getCC)" \
+ LD="$(tc-getLD)" \
+ HOSTARCH=${iarch} \
+ ARCH=${iarch} \
+ EFIINC="${SYSROOT}${EPREFIX}/usr/include/efi" \
+ GNUEFILIB="${libdir}" \
+ EFILIB="${libdir}" \
+ EFICRT0="${libdir}"
+}
+
+src_install() {
+ exeinto /usr/lib/elilo
+ doexe elilo.efi
+
+ newsbin debian/elilo.sh elilo
+ dosbin tools/eliloalt
+
+ 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..c17dc805837a
--- /dev/null
+++ b/sys-boot/elilo/elilo-3.6_p20060314.ebuild
@@ -0,0 +1,86 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+inherit toolchain-funcs eutils
+
+DESCRIPTION="Linux boot loader for EFI-based systems such as IA-64"
+HOMEPAGE="https://sourceforge.net/projects/elilo/"
+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-3.16-elilo-loop.patch b/sys-boot/elilo/files/elilo-3.16-elilo-loop.patch
new file mode 100644
index 000000000000..b574c29f220b
--- /dev/null
+++ b/sys-boot/elilo/files/elilo-3.16-elilo-loop.patch
@@ -0,0 +1,15 @@
+https://bugs.gentoo.org/299665
+
+patch by Dennis Schridde <devurandom@gmx.net>
+
+--- a/debian/elilo.sh
++++ b/debian/elilo.sh
+@@ -321,6 +321,8 @@
+
+ mnt()
+ {
++ local loop
++
+ ## we can even create bootstrap filesystem images directly if you
+ ## ever wanted too.
+ if [ -f "$boot" ] ; then
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..e9138bcbce78
--- /dev/null
+++ b/sys-boot/elilo/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 type="project">
+ <email>ia64@gentoo.org</email>
+ <name>Gentoo Linux IA-64 Development</name>
+ </maintainer>
+ <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..0106258b7c21
--- /dev/null
+++ b/sys-boot/getdvhoff/Manifest
@@ -0,0 +1,5 @@
+DIST sgibootcd-0.12.tar.bz2 3810 SHA256 2b0bfd0ebaa218fec414ff7102b8128dc658110fbeac83a510dc87d6559f299c SHA512 180e4f5a185b14c0b2c8158b368a50a3a55673fa86760e2a424c9533b1bb8ec37824c715ba02fd264621e2e31906ddd310398e9f24cf19147bce3e49fc62da3e WHIRLPOOL a1c98b2b6fc48201f4db47ac3a48cd64bb84becd5d664a8418a02115c47cb462e527aa1ba1dad4c58367441178101fe2661e9e2b08f67f1c8566f73e3c9eb08c
+EBUILD getdvhoff-0.12-r1.ebuild 1111 SHA256 1d1aa431dc201425984a18977f68b3a681779ab3aed10507020f83a85f79c0a3 SHA512 0237e2e6e784edb5c98efcff2cfc7c59bb0a4edb9f0b349303281907d98239ccc8e344942bfe88394e7efba84f2dafef4f5d90a048c4c354013b064c7b38a076 WHIRLPOOL 63a4ba9adf6b0e0a1f3885b2f124cc624103df31490b533653f9457cc34a9d8e6b9dcba3f818e907cade5cb621a752aaea0b204f4d041897a6e952f2f9967c5d
+MISC ChangeLog 2830 SHA256 6d47cf5abac498f96a6f2785f2d67ccf3b4e0854ecff0a9cef49277d7969be3c SHA512 07f872a7427f2f899bb3b382a829aff865fc2ef86a5ad07f396710f4d35a9794496acfc9e366add239ab38b4e077ea1f2b592d8c79462b8994098bc2da90b404 WHIRLPOOL 58bdf172552ccaa30abe04efde2fbdfb7429dda37fcf7952ef8a623c4f45364ceffd27346ab927bb8cbc5e5a1b8e8693adb1ce7fe9e4b9f9be056d9cd74da52f
+MISC ChangeLog-2015 1217 SHA256 0227588c137a1f6809ea73d41ba050f9f216915afb4772a72e89e4433ef20fc7 SHA512 8939341609f79baee538432b576b1b23300a415ad4a7c545a281c276421feddcfb504c7a55db0463305b841c0fcc1ddf30714eebd46b77b812edc005eddcea43 WHIRLPOOL 223ba97afbfe5c5154f8dbd22ae7d9aac4532caeb70eb32f3449c83bdf277b5fd575e281b42211b7a8289f4d5d658d0d412cb9c8aaf5f4e0a86bcdeb5ce16c55
+MISC metadata.xml 376 SHA256 ff8cde3b2d5537933401b949d4a9778bfd699a74f7ff93ef292418a4ca3a8b79 SHA512 9ebced4e75b5b65674d03e6cf1ac6c7c13cce64bca5bcaef4d31a718428e1954b06d2869d56cfc7b0dbeb63c450d48f14b389cf30789ce21a52bb841b4542fb5 WHIRLPOOL 490cb61730b4dddf367e63382313d666bdac3e8926ac5c1365eaf44daafa4db2653a48e15051eb40e75f1e327f065461642e48db3dae5fb8555113ce6cff86d6
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..44d53d1e9199
--- /dev/null
+++ b/sys-boot/getdvhoff/getdvhoff-0.12-r1.ebuild
@@ -0,0 +1,36 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+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..e4344125b38d
--- /dev/null
+++ b/sys-boot/getdvhoff/metadata.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <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..65a11647a4ab
--- /dev/null
+++ b/sys-boot/gnu-efi/Manifest
@@ -0,0 +1,9 @@
+DIST gnu-efi-3.0.2.tar.bz2 136134 SHA256 194b580ecdb1fad0e41914845ba064c279afb687855960b58693459e5537b4d7 SHA512 960dc0374dd63dea5eb25e2bf6670d3f7474ebeca2090514c2895b28ff6e058a852958d028eadbe156df4645bd04d1a93ffaae1153861fce6e7da72f8f9dbeec WHIRLPOOL 3e692058a74f3f42867f84fe6af41cc0911280b2a295c441b2c4e27d116f162e0d166fe713b8eb15a6c6a8184037bae34db6ee1f0fdf7c2f9e53ee8215b2cfdb
+DIST gnu-efi-3.0.3.tar.bz2 142229 SHA256 c530f21a15fd9c214dd92d29a6caa20fac989289267512020b6da1f5e6f5b4cb SHA512 0b0582e22344ea8a544aba540b56dc36364febfeb5bb655e87277e638fd4e549214a0cd2079a852d15ee376cd51c33794f65a7efb23be9a7a929e889cd616c8c WHIRLPOOL 79796e2f46086b3cae100cda1f1ace48af0e743d5b0129246b4ebf8fd7b46392550a834085c73798e59163cbcc8778251ed7e1d9c1a9036f888e1de265387f16
+DIST gnu-efi-3.0.6.tar.bz2 152088 SHA256 21515902d80fbea23328a61d70d3d51a47204abd1507ebfa27550a7b9bf22c91 SHA512 f1b17766d8ae000c0177ea2126d87883f254ab01ac020e4bfaa9ad2d3d60a66d07b6237d9842e5989c4da3fd23152b5c592ef863fdc9806901f43c43582a2258 WHIRLPOOL c333af26fadfe85c7e699eab68dcaf2769d1a97ee3f49ba96b159ba8cdb2cf0ab108b1b455c6327bdce0c3761d74fa138463d358f6bcea7254ef1843fd34188a
+EBUILD gnu-efi-3.0.2.ebuild 1167 SHA256 ec67ddff30bb66c6bb8ce8431243b3818f431dd603518e31a6193a3b9e88c996 SHA512 0e5eebcd16fafef41cef71911650184470e504d2a623aebe281a1ffabcdb0eb24a37441bacf89c9d1daf9ac70463f6996aa545e6732576aba93b4296dc680195 WHIRLPOOL 5f2443587a3a752d347535714a28f74302c66018a74ca9232b7886fc9af01a7c7da4a17d3a2cecaf0608f93cb55bd8fae1b4deed8b9ab1075e049d8a7e3d9f06
+EBUILD gnu-efi-3.0.3.ebuild 1732 SHA256 74ca66d2420e8557a24023d54676d667a00e5d25af987f784ba559a2cf575f6a SHA512 2b4cdc3cc522ed6d9c6a716756fec4009d52af85369c2be1c81cf6afd03dc78b7e836adb351427a0cd0656de8f5e19a287e093d985a68e15726721d58c2fb6ef WHIRLPOOL 8de926429cb94424bacc067a067075aeebe1094158dcc1887539f9012a91ca3a918a7e606be9864fcf3630ddab4344babec5db3b3f939eb02780aadc9aeb0f0e
+EBUILD gnu-efi-3.0.6-r1.ebuild 1952 SHA256 df659f55a8cc9b404a6ac6e7a3e0a8193d3b3486dcc9310e9683d68bc3daa386 SHA512 6e85f076b29bb3ae7a528a3d0a406ea9c26d87a481bcf9285bab0db11ffa24922d04eaec23ddaaeec577492794e7b8c01a55a4aaa406996f309809540150140f WHIRLPOOL 4edc644805f7369b07c19f7bc945cac291f204ee37daf0c982b917ef436a3554951619f2f4a777936d7355ee61348061667abb1a3111c181a8cfbbd314f260ab
+MISC ChangeLog 4375 SHA256 7774c47d74db64fd466ca211a1de811fd70968f906b2a40a32ff08aa3697a669 SHA512 1612aad0a191ee079ddf16910ab704772d25c15f20e8dcec44e90e3471f40140fa2001c0471c532d07789ff6d116ce89168cb4f4f5b855153bb9e0cc1567550a WHIRLPOOL 00a31d22f52cf4d9b039d2deb2c6ba02beb3bba88edc55bc78279d5719967e08117e57f29a13e211329935b26b5a310a1f859dd7c722ce2448f5f1a6b5658167
+MISC ChangeLog-2015 3623 SHA256 f655805551bbba0daf86b2b5b448592676152338687b4a46ab93ef9a8a39daad SHA512 ef8e81ea38a2c9b3215f3dd40e2a5915f96a79245e1df4f0198f97edb087c121ab00ef3c59c73831547b54b92833d830ecb473517acdd60b5ff37029f0fc19b6 WHIRLPOOL 11b0ea8ca05ecb29d21500d1944ba7292ae832faf8aeae7f577e3292cbae37775bc2008c3db256a1994efdf54f730c9371eec47848fed3b587957dde28369beb
+MISC metadata.xml 446 SHA256 e3c8b6eaf405251702b3cbc13e897552fafa9aa5510d462b355ba36ebc84c4d7 SHA512 114721b7dc26234a2bce0ab65f2513f5bdd4749fd8fc5beb9619dc449bde13c82c88716d3e9b94a192d4298019255fff1aa32beaa15b643490fdbc25e75d83f8 WHIRLPOOL 41bd85f12cce11a6befe606b7899ab6d1a94168a8b8023dcc28ce19f1820128fb86f182b5d26fbaf376d376d16de04a69c053b82ae9c618ae8cccbc8a82a1c48
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..733b5bab8e1e
--- /dev/null
+++ b/sys-boot/gnu-efi/gnu-efi-3.0.2.ebuild
@@ -0,0 +1,53 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+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"
+
+# inc/, lib/ dirs (README.efilib)
+# - BSD-2
+# gnuefi dir:
+# - BSD (3-cluase): crt0-efi-ia32.S
+# - GPL-2+ : setjmp_ia32.S
+LICENSE="GPL-2+ BSD BSD-2"
+SLOT="0"
+KEYWORDS="-* ~amd64 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.0.3.ebuild b/sys-boot/gnu-efi/gnu-efi-3.0.3.ebuild
new file mode 100644
index 000000000000..cb255538dac5
--- /dev/null
+++ b/sys-boot/gnu-efi/gnu-efi-3.0.3.ebuild
@@ -0,0 +1,78 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+inherit flag-o-matic multilib toolchain-funcs
+
+DESCRIPTION="Library for build EFI Applications"
+HOMEPAGE="http://gnu-efi.sourceforge.net/"
+SRC_URI="mirror://sourceforge/gnu-efi/${P}.tar.bz2"
+
+# inc/, lib/ dirs (README.efilib)
+# - BSD-2
+# gnuefi dir:
+# - BSD (3-cluase): crt0-efi-ia32.S
+# - GPL-2+ : setjmp_ia32.S
+LICENSE="GPL-2+ BSD BSD-2"
+SLOT="0"
+# IA64 build is broken in setjmp code:
+# https://sourceforge.net/p/gnu-efi/bugs/9/
+KEYWORDS="-* amd64 ~arm ~arm64 -ia64 x86"
+IUSE="abi_x86_32 abi_x86_64"
+
+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"
+RESTRICT="strip"
+
+efimake() {
+ local arch=
+ case ${CHOST} in
+ arm*) arch=arm ;;
+ aarch64*) arch=aarch64 ;;
+ ia64*) arch=ia64 ;;
+ i?86*) arch=ia32 ;;
+ x86_64*) arch=x86_64 ;;
+ *) die "Unknown CHOST" ;;
+ esac
+
+ local args=(
+ ARCH="${arch}"
+ HOSTCC="${BUILD_CC}"
+ CC="${CC}"
+ AS="${AS}"
+ LD="${LD}"
+ AR="${AR}"
+ PREFIX="${EPREFIX}/usr"
+ LIBDIR='$(PREFIX)'/$(get_libdir)
+ )
+ emake -j1 "${args[@]}" "$@"
+}
+
+src_compile() {
+ tc-export BUILD_CC AR AS CC LD
+
+ # https://bugs.gentoo.org/607992
+ filter-mfpmath sse
+
+ if [[ ${CHOST} == x86_64* ]]; then
+ use abi_x86_32 && CHOST=i686 ABI=x86 efimake
+ use abi_x86_64 && efimake
+ else
+ efimake
+ fi
+}
+
+src_install() {
+ if [[ ${CHOST} == x86_64* ]]; then
+ use abi_x86_32 && CHOST=i686 ABI=x86 efimake INSTALLROOT="${D}" install
+ use abi_x86_64 && efimake INSTALLROOT="${D}" install
+ else
+ efimake INSTALLROOT="${D}" install
+ fi
+ dodoc README* ChangeLog
+}
diff --git a/sys-boot/gnu-efi/gnu-efi-3.0.6-r1.ebuild b/sys-boot/gnu-efi/gnu-efi-3.0.6-r1.ebuild
new file mode 100644
index 000000000000..356ce6f38e93
--- /dev/null
+++ b/sys-boot/gnu-efi/gnu-efi-3.0.6-r1.ebuild
@@ -0,0 +1,90 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit flag-o-matic toolchain-funcs
+
+DESCRIPTION="Library for build EFI Applications"
+HOMEPAGE="http://gnu-efi.sourceforge.net/"
+SRC_URI="mirror://sourceforge/gnu-efi/${P}.tar.bz2"
+
+# inc/, lib/ dirs (README.efilib)
+# - BSD-2
+# gnuefi dir:
+# - BSD (3-cluase): crt0-efi-ia32.S
+# - GPL-2+ : setjmp_ia32.S
+LICENSE="GPL-2+ BSD BSD-2"
+SLOT="0"
+# IA64 build is broken in setjmp code:
+# https://sourceforge.net/p/gnu-efi/bugs/9/
+KEYWORDS="-* ~amd64 ~arm ~arm64 -ia64 ~x86"
+IUSE="abi_x86_32 abi_x86_64 -custom-cflags"
+
+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"
+RESTRICT="strip"
+
+src_prepare() {
+ sed -i -e "s/-Werror//" Make.defaults || die
+ default
+}
+
+efimake() {
+ local arch=
+ case ${CHOST} in
+ arm*) arch=arm ;;
+ aarch64*) arch=aarch64 ;;
+ ia64*) arch=ia64 ;;
+ i?86*) arch=ia32 ;;
+ x86_64*) arch=x86_64 ;;
+ *) die "Unknown CHOST" ;;
+ esac
+
+ local args=(
+ ARCH="${arch}"
+ HOSTCC="${BUILD_CC}"
+ CC="${CC}"
+ AS="${AS}"
+ LD="${LD}"
+ AR="${AR}"
+ PREFIX="${EPREFIX}/usr"
+ LIBDIR='$(PREFIX)'/$(get_libdir)
+ )
+ emake -j1 "${args[@]}" "$@"
+}
+
+src_compile() {
+ tc-export BUILD_CC AR AS CC LD
+
+ if use custom-cflags; then
+ # https://bugs.gentoo.org/607992
+ filter-mfpmath sse
+
+ # https://bugs.gentoo.org/619628
+ append-flags $(test-flags-CC -mno-avx)
+ else
+ unset CFLAGS CPPFLAGS LDFLAGS
+ fi
+
+ if [[ ${CHOST} == x86_64* ]]; then
+ use abi_x86_32 && CHOST=i686 ABI=x86 efimake
+ use abi_x86_64 && efimake
+ else
+ efimake
+ fi
+}
+
+src_install() {
+ if [[ ${CHOST} == x86_64* ]]; then
+ use abi_x86_32 && CHOST=i686 ABI=x86 efimake INSTALLROOT="${D}" install
+ use abi_x86_64 && efimake INSTALLROOT="${D}" install
+ else
+ efimake INSTALLROOT="${D}" install
+ fi
+ einstalldocs
+}
diff --git a/sys-boot/gnu-efi/metadata.xml b/sys-boot/gnu-efi/metadata.xml
new file mode 100644
index 000000000000..493998b4dac8
--- /dev/null
+++ b/sys-boot/gnu-efi/metadata.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>floppym@gentoo.org</email>
+ <name>Mike Gilbert</name>
+ </maintainer>
+ <maintainer type="project">
+ <email>ia64@gentoo.org</email>
+ <name>Gentoo Linux IA-64 Development</name>
+ </maintainer>
+ <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..dfe6c8c2a764
--- /dev/null
+++ b/sys-boot/grub-static/Manifest
@@ -0,0 +1,15 @@
+DIST grub-static-0.96.tar.bz2 859179 SHA256 3ece8910e7954ca2c2cbebc4d05cfb22e73455f826508661a5b1a60481dcbd76 SHA512 a623e230c3b2dd632daf65d897261a8b28a609b1adcfba67661cb42f43fe4f06bb4746f5095b41b689c2725f9d3379d03d02bca21b4acbf5faa3dccbad160a27 WHIRLPOOL 445acdfa2b1dfb0d15fc927a65f36ad8f956ea5d2b977695cdb25eef4c04c52686b8bf9278509291d3371bc02630e9a878b6f681a82d6e80f04a0f805316385f
+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 SHA512 a6edc311bcfccdb937c10ca1b4d33ecff52f3ee03ad827ecc849f6bb7d88204bcd29e8b7691bc1c0fd6386ed074ab8817667c0cf25cbb64bdd900fb01338727c WHIRLPOOL 05ea2865a7a48a4bfb8efb31e4420d27c4b0886611b19847440174311a8df18c79d5bd13ce14a93bc4d5d0dd473c82fa1bbc0d54b11fb3c717d63423e67b8d5a
+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 SHA512 e60b1384e60bc1261482f3bc41b98c1595d4377da68b251d93894ae7a1b3b2ca77219ca9b7685d1cc8db950e35afb1b403cb3e9b7df15e0ab96d452341547668 WHIRLPOOL d64f5f98c356848345d8d2c4d381e5027b4214048fd0e5170c94d67ae0f784b1702efaac318bcc6a4b4d2e0419b327ea92bab4d9c148cf71f97ae8bda1d504d2
+EBUILD grub-static-0.96-r1.ebuild 403 SHA256 1b3b5f6eb1d77f30d34fd8466767005abc298c820bc73c14acea008c5ace43c1 SHA512 4a49523d4e47cfbc7228a7b6ed802f190c045abbcf8749580615bdc59233c7a029943e55bae7adf690628a5081b157690d694c8f40926b79d49f645c15781df5 WHIRLPOOL d0690373447a3636966096324158ae24d04374542d94f0a31dd462b0aac7a2ec4b7fc8b7f064752f8d9e39f677210df211a011ffeb3abe212eaa17e8cbf74ab2
+EBUILD grub-static-0.97-r10.ebuild 5394 SHA256 37165e08bf26cd45038017d786efc080bb2e57056d008a5c3992f48299534e31 SHA512 fbc1fc21e85058008d6dfd6b71cba957ca94500474f95e29ed796fac9c9586971145433e8448a3709258fc7bd755a0f936822029f38435c9e39275a82b5162c3 WHIRLPOOL 4e1e9d05ae3f55597b49f20589b98eb84034254eeb8a9f456f1e2e5dcd6958a447bcc2bddbfbaa5b0c76c95b1ec8a8e6a759ec8a8888d0b2903ce3d5d537afd5
+EBUILD grub-static-0.97-r12.ebuild 5394 SHA256 8560911657316197d8bc08367a27b6c1c09d1b7b5b5b4d3189d9e8b4dd51aa12 SHA512 aca73438cf8a7e6760fcd340568b5f0847887eeec229e6b4b470252a95668ad9615be4a60eb33976b2b2cb7347b5595979238c4ccfb2dd5253fd4b78ac756c58 WHIRLPOOL 9c2ce66902399d58cb73147ed02ae5406e2483ed7d17994181d7bed2d423a9b4df3f22d16cea84b1da13b40c6b4e5a9553a86672b6baa1ebe47883368ed0ae16
+EBUILD grub-static-0.97-r6.ebuild 4324 SHA256 afdf7af1593da987ec930a286ad5ed727466d9b51881d452852a6102070d9955 SHA512 3ea6d41fa12d38b0580c1440a25e7ed5a23ac963ccc2746856e7b793186cc14b5d43071e6e338635dcf6bcc8286c73642538557d103eb052349b223aaa2a44b9 WHIRLPOOL 552c72bfefb7c53efab97f6c4a9b609ddcd0b62efbf50158ed15b21e63b5ad76db23e9e4c708f659bad3405db827a5fdc8358fcbfdc796fc059368bfdc74b2ad
+EBUILD grub-static-0.97-r9.ebuild 5289 SHA256 276c7bf803b73efe5c72a83207f2bec0d8b50eb677660f82cc47291efe0100ec SHA512 28be3fc41a6ad107d9a84549e8c49c1a61bf97b0b91ec6613c16434fa00d29fd9ba526eee3aa4c4486f585ddc488331071326ee22cc0b145b97c31b123855726 WHIRLPOOL 572805e671a487676581f080ee9f2bd99246a0944572f52947b83384a45a6e283c20c9a06ef7faa4fd15aeb01d7e008c0856abbc64838ba36157946a97f83ea8
+EBUILD grub-static-0.97.ebuild 1917 SHA256 e739816e2b52ea7a85386b68752496c8cdcfe500dfbb3907f59447fa9295c735 SHA512 64162d6c64e30f555d9bc642a416468911d960ce398f66bc6b36c0319f484dc516d95462ff13f83dab5e16cb75d3e69fff180ef1d1bdc5bd387706da5b197889 WHIRLPOOL 81f6f1db99ab03e8fe26e5fc7b288a113dbf1971ef990fb4f1fbc771b1a746e83d704b0b1e868db025c2c11b703e0fbbea51e427c9f4a6507556315ec5d788f0
+MISC ChangeLog 3188 SHA256 2048117ed63e0c7798841bb5b1ce2d7f50e6eba4703a0d0358c9fee377fe8321 SHA512 1131a8fe641f724a2710b905345d4c0548f6eafce5e50d87b4a37eb49ac4f3f332cf9c909e99caa1ff96a09175aab7963c9541b27c45d38b0a80e999e3efb6dc WHIRLPOOL 96deecaa48bba99425a8b5c7e65798b1d46690936da2f689149bd9b50ef85dd49ed97bdf7fa4f1485133a7a6010df55ba5a304d0696dac3395aa221a0fc20b24
+MISC ChangeLog-2015 5551 SHA256 fd373c083a05ef17a5074741d41801878c868780888a079f7fc200085e2cd90f SHA512 524d7b8cf0fe52981a189151d8be58aa545b36b8938378944aa6d29aaa717b07f449155e44a5a54025292162f72cd7562408808966b88970929826166e54af52 WHIRLPOOL d35df4dfea54ce55500d840f48e21b0a6fadb0f0521108e45849a8354b0bad5528afc635f0e149c2f27dd4dea308f4318b9c1bc322a6d2c88d5bb811b486c07e
+MISC metadata.xml 242 SHA256 aaef542427fe08d52a644c49a357a723fd550a8568e8ffb41aa655e36e0642f2 SHA512 0891a67242a0cd36cac143b427affa9241ec8f8173b79423632349d542f9bc6e2097ffbb8e96b560c41e13b5b43ddf0f822962da98b5d2e58068d7855acb4965 WHIRLPOOL e5a99a2a99090a4826c638ef55a5b813d33e6957c8150142bc14965d72f14aa11bc018d3f35406f9c6917531145e7401aad3661ed5745f57b2fe4df2af38840f
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..5e83aac12082
--- /dev/null
+++ b/sys-boot/grub-static/grub-static-0.96-r1.ebuild
@@ -0,0 +1,17 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+DESCRIPTION="Static GNU GRUB boot loader"
+
+HOMEPAGE="https://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..680b5c2e9d45
--- /dev/null
+++ b/sys-boot/grub-static/grub-static-0.97-r10.ebuild
@@ -0,0 +1,175 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+# 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="https://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 "https://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..3923c82a2a05
--- /dev/null
+++ b/sys-boot/grub-static/grub-static-0.97-r12.ebuild
@@ -0,0 +1,179 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+# 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="https://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 "https://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..c55d1f53800e
--- /dev/null
+++ b/sys-boot/grub-static/grub-static-0.97-r6.ebuild
@@ -0,0 +1,135 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+# 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="https://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 "https://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..d5788c08c0a2
--- /dev/null
+++ b/sys-boot/grub-static/grub-static-0.97-r9.ebuild
@@ -0,0 +1,171 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+# 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="https://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 "https://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..f5379a8a95c8
--- /dev/null
+++ b/sys-boot/grub-static/grub-static-0.97.ebuild
@@ -0,0 +1,75 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+inherit mount-boot
+
+DESCRIPTION="Static GNU GRUB boot loader"
+
+HOMEPAGE="https://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..0c723031cff1
--- /dev/null
+++ b/sys-boot/grub-static/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 type="project">
+ <email>amd64@gentoo.org</email>
+ <name>AMD64 Project</name>
+</maintainer>
+</pkgmetadata>
diff --git a/sys-boot/grub/Manifest b/sys-boot/grub/Manifest
new file mode 100644
index 000000000000..eadd66f1d43a
--- /dev/null
+++ b/sys-boot/grub/Manifest
@@ -0,0 +1,19 @@
+AUX gfxpayload.patch 1118 SHA256 3ac2043d55ed70649bccc7482918b762d5833cc1f100de0620af73b64e5e2c4b SHA512 00324825c369902a0383b792cd21e161853eadccbdc5abe2420f2d443bf6a74f72be6c15243107b936acd38c3547387c3771dc2cb566003c4c754c9260b4aa00 WHIRLPOOL 6417222278d437821221b09c3b18df5507a4edd57bfb5a8f682a53eea4f8491a6b2865b6223392a1f04dfca7200f71b4c5ecfc3b088f139ba94a90b31aa66918
+AUX grub-0.97-Add-esp-to-list-of-clobbered-registers.patch 1612 SHA256 515d609d54602c285e98aeaec66ac95136512d54bb16ee80f22cf06f02999948 SHA512 85241fc4f939cbf6dc9e18b0b68034835bcb4ac7162fa1dc497e169422b66f0320d59d8270bc13c827a325f45d260028276641cff3f12b4d6096e2d33a12261b WHIRLPOOL 4dda1385591e71766a7d3141038f67bee1ceda3d1deef97913a2a684dbea03ac5fd982291ae017d8bb82ac222e378db5c9cac537a0a7b47328361e00314e5ff3
+AUX grub-0.97-ncurses-pkgconfig.patch 799 SHA256 273bd077ae5591cd8fdcd6dc61bf8890e30a1c84a04ef05d5e5fa32176583162 SHA512 9456c422e05e75e4221101d66bf1c1ba3efa195ef67872a75790362da825bffe1bcd74c5ff6e3f5a9ccda6b364f02c631c0d513c0de5aa19a78be9bea525c13f WHIRLPOOL dd285a51cd10461b1b74b1a1bc892911015fbbc68c33de15b50cf642284ec67165b6d6ec0de345addcd4964bab694d444c0ab041a7f547efe8d29bbfb7095c67
+AUX grub-2.02_beta2-KERNEL_GLOBS.patch 2121 SHA256 444bf2afb4d009b106a2dc9f3f10e180f90d3aa5fef6b7e398f65fdb189b6115 SHA512 f85bc538ae647c46efbe07d7b87acf49daa7b07e9752af3aa3f77019f48ea24cd1b6a095a6f9c19d50128701753f453c531b9b068e11ee22a259f3fdf8ac205e WHIRLPOOL 7f82e79bfb3cc2bf1f9ec4fe4f37457066c975942f77a64a6e1380121b9b2fde3cac69ff15ad606bf85f8d214b53455e96c977204415481121aa55eb0dfcbaf9
+AUX grub.conf.gentoo 591 SHA256 e656b5716d6a5904a035960b460494431d8c1327df51fcd9ffb39243425fe142 SHA512 23036b9e558b604082d9ae8c848f18ea552181416937e3ef62287e53c38086b8d7ffef0e67d04af04f05f5b23c6da7aaf1f1f23e0ee1cffd5dbd5320e8648cb1 WHIRLPOOL 184284cac00bc039d36c5b2f8d7be0f425e75ba904c4c04c2ec531a094cd191c42cb7382276e73a5d176e1661dcdd1bdc5e3806b9d7abe9b38563575ecb6ee76
+AUX grub.default-3 2532 SHA256 5e25d29a7d6779163e440eb044dc6a6093541efbfcb4347ae4dc1952a98a7036 SHA512 2faf5e730331b7d04045ee64d990227ef02f1b14a1cf88b5b71a18c91a9a8cba773a601eb3f5442092f6937935efed02629a278bd6822fac60f9c72045e4b13d WHIRLPOOL 8104c756215ef78b9c480a369917f6dfba7f6b754f356bc85b5c920958bd68184991579a1012f558341757a17fd88aad77d85ddedbb15e50e5be41f90690b8a8
+DIST dejavu-sans-ttf-2.37.zip 417746 SHA256 5c6e497a2f36552cb5ffb112c413a6af39c0f3c47653662b90b4fa6499822fd7 SHA512 ede5899daa1984c5aa8cacb1c850eb53f189dddef3d9bb78bf9774d8976b7c0d6eb0bcf86237cd7d11f5b36cf5b5058d42cd94d3bd76f2bd0931c7ceb1271fae WHIRLPOOL 6f19280e76ea3efe265db09236e94bdd00268c5d8742c191100b8eb19faa532289fb03d838e33aa3c501d8a3243db248648af8929d5d5dba1bfd2ea2c10358cd
+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.02.tar.xz 6113260 SHA256 810b3798d316394f94096ec2797909dbf23c858e48f7b3830826b8daa06b7b0f SHA512 cc6eb0a42b5c8df2f671cc128ff725afb3ff1f8832a196022e433cf0d3b75decfca2316d0aa5fabea75747d55e88f3d021dd93508563f8ca80fd7b9e7fe1f088 WHIRLPOOL a7f5d786064642f926faa444b9db1555ccfbb460655f81a0ca408bc5ad2acfb89fe596f81d161078944ce1b2dc00e82e8fb056f050bf026fc07f6417af7b9776
+DIST splash.xpm.gz 33856 SHA256 b95600f777331b0dd31d51c68f60f0e846e4c8b628857a41165f4e6b30e6acaf SHA512 5ae1f786f7d46a95a7061068d5b2b3ad64607c7b190d6f28379508c5dce67e26308325bfd637542a84855dfcf1ea3d143947326fdb189a6a8972208d3ead23da WHIRLPOOL d95b7b588ea8ac7c2c8c53eb8057aef21c825da6411afe3b7e864c606aeffaaebce8ae41ce3e979f277bd6b48a9e82a1f2ea8afc836213b56523d8a854227d7b
+DIST unifont-9.0.06.pcf.gz 1360354 SHA256 6d23e82ea3fd3d79849d675c0c30129b62a3973a83b4cdc05f9994efef773b86 SHA512 dd0a1afa72f5204c62055d83f22750c74af38ffafdb8eda8e1f1cf7292e572a14969b8a9a6a2cb336d5bed4ab633f6b5a962c59117a590e4238788959cb82774 WHIRLPOOL 3153fe2a254cffa5aac6c5915468262bf60f993ce5a2aa47885ccef2a6714e205724b01fd9d26d499b9efbc5213e3cea0037c91f17fb2ae780ee289cab0de69b
+EBUILD grub-0.97-r16.ebuild 9699 SHA256 03223c6cec66ca01d0ee08db83a96ef3021bca3fa2414fd862727a9ae9cade07 SHA512 0edce20bd616493dc8e83276fd89fc2b762794cc25572c4ad3cc055c1c8c209ca2d6dc6a1a90a54deb17a245f7218468f7054099d20688ebd0debf227624c057 WHIRLPOOL e58455c072c3616fc317359e6d9a6bbf69399be84e30af641530c2892b0e05dec2cd799e2f49e244700982e62666cff33ddcc4a1ec6bb1112d7fff0f3f284b2c
+EBUILD grub-0.97-r17.ebuild 9281 SHA256 66a9f548b0b7e4def066a72a06b96ef3292c15c6adf9d90bade0f1552b960916 SHA512 659b416c659c023cbbbec587f1b6f2e7995016a41194905b647ebff5d0efb670bba83d468ed3b6dd01abd96f1df0c2b013f91c301e437a01e55febde7f223727 WHIRLPOOL a296fd473102bdfadb3ffd4fa8466dace236e183c815a68c9a1d8beb780ea5e20f7e1d39280f689636a6517a6f7b2c5a5997212c29e530f1dba416bbd5eac9d3
+EBUILD grub-2.02.ebuild 7597 SHA256 ada3921a987f213615b625b6d97491c1d33448f700410413d411a1d95a04660e SHA512 d3aa7a602989d0eee9c48ddd527253099cfb81887171c69add1f83fea36bac295147fc11cd9cdd2c06410670c435cf1c3f20303660675aa936668b04178cb8ba WHIRLPOOL f7032a2a33a7a571f15b99d02ba59bd30582e531a7330932d1d860485f83569fef9ef8bb5f16759691744fdfb28c6fb12bd24f64c82481281739289ae0da170d
+EBUILD grub-9999.ebuild 7599 SHA256 dda50136976d84a46106a3e6b6ffb657c2094a44d44e520b31c1654cc54b32a6 SHA512 cfb7ffc4a2d94d0ceaaf6fa63d6c587b8c35488c3f00cc667073926a00c90044c58e94f69e53d765b13ea792f7e79e49b59529ad2788460367259ad2524bd410 WHIRLPOOL fc8b0d52d2d7659fc1594f2ed07661bcc2edf52db8c9b3fa3d20dcd756e65002812cffac281149728d2e6e58f621fe0fb8cda082ba6946024a3a909d7ff4a002
+MISC ChangeLog 14166 SHA256 fd94eac2c96265c94e4fd203e094dd6f8985ab3146103f313b647aab5ea76814 SHA512 eeea31f9e358370b12e81075308271fe2ae64d6e84b2828261d1c74577fafdd33b412f0d0faa784a0fbd502481ae3619d2320542b49e06a3b6bd0c11c90a1d6d WHIRLPOOL 2732342665c419b0b6f5d8c75b888437cf73600857c30d06f2c39342f64055db79a2de7e4015827bca82ad6d3f0b16532bf6adab6f1e89a3c12e0e2f06556141
+MISC ChangeLog-2015 68266 SHA256 ef0fa0fe0c1cb3d89ada4d451fba86eddb65057241a162d038bb653fc24c8bc4 SHA512 b8f361b605eada55e197c0079843b3ead0390b1df356b9bc337dba8eb8718f3f7f9928b212b1dfda763b9df87181368518d6a035a4054403d598863ef9a2cb09 WHIRLPOOL 6e62ed831e8f960da784180691a2d529447491177ce5c26ab19080a7c18f6c286850220051f4fdcd18fa162ecb6b20ebbae78e7c424c5f0f87797d3718bf8003
+MISC metadata.xml 1488 SHA256 0ddda5b7b9fcb5e294d315fc49fa1718e0038097befe74d8d7a3738a109c210a SHA512 71f3e48b73c3d20f213ae928b16499131417562d98b83f2d82a5fb026c8cc06ecddf9db32565d9e1602d4258f7a2cc1796eb523c4cb98fb6b7753328a29e93ba WHIRLPOOL c105fd3480c9f1c30928558d5456778a916fb8ecf51ebffffc7937385f4393630bd93355180b149390f0506e4a8feba060b35eec485c1863bdb9931c52bc6b2d
diff --git a/sys-boot/grub/files/gfxpayload.patch b/sys-boot/grub/files/gfxpayload.patch
new file mode 100644
index 000000000000..6c63ef88b09e
--- /dev/null
+++ b/sys-boot/grub/files/gfxpayload.patch
@@ -0,0 +1,29 @@
+From e2d5bf1bc6aaaabeba538c1ca94ea8601e4e1474 Mon Sep 17 00:00:00 2001
+From: Mike Gilbert <floppym@gentoo.org>
+Date: Thu, 16 Oct 2014 23:43:51 -0400
+Subject: [PATCH] 10_linux: Default gfxpayload=keep only when booting using efi
+
+vesafb seems to be unreliable when using BIOS compat mode.
+
+---
+ util/grub.d/10_linux.in | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in
+index d2e2a8f..a54b888 100644
+--- a/util/grub.d/10_linux.in
++++ b/util/grub.d/10_linux.in
+@@ -104,7 +104,9 @@ linux_entry ()
+ echo " load_video" | sed "s/^/$submenu_indentation/"
+ if grep -qx "CONFIG_FB_EFI=y" "${config}" 2> /dev/null \
+ && grep -qx "CONFIG_VT_HW_CONSOLE_BINDING=y" "${config}" 2> /dev/null; then
+- echo " set gfxpayload=keep" | sed "s/^/$submenu_indentation/"
++ echo ' if [ "x$grub_platform" = xefi ]; then' | sed "s/^/$submenu_indentation/"
++ echo " set gfxpayload=keep" | sed "s/^/$submenu_indentation/"
++ echo ' fi' | sed "s/^/$submenu_indentation/"
+ fi
+ else
+ if [ "x$GRUB_GFXPAYLOAD_LINUX" != xtext ]; then
+--
+2.7.2
+
diff --git a/sys-boot/grub/files/grub-0.97-Add-esp-to-list-of-clobbered-registers.patch b/sys-boot/grub/files/grub-0.97-Add-esp-to-list-of-clobbered-registers.patch
new file mode 100644
index 000000000000..c550aabd6167
--- /dev/null
+++ b/sys-boot/grub/files/grub-0.97-Add-esp-to-list-of-clobbered-registers.patch
@@ -0,0 +1,53 @@
+From 5a52ee4b5cd152fa4ccd1c1f938ce2eba652af52 Mon Sep 17 00:00:00 2001
+From: Sergei Trofimovich <slyfox@gentoo.org>
+Date: Mon, 14 Dec 2015 23:59:17 +0000
+Subject: [PATCH] Add %esp to list of clobbered registers
+
+GCC assumes that it can combine stacks from
+outer
+ grub_stage2()
+and inner
+ trampoline doit()
+functions (optimisation -fcombine-stack-adjustments).
+
+But doit() function clobbers %esp in inline
+assebly statement as:
+
+ asm volatile ("movl %%esp, %0\n\tmovl %1, %%esp\n"
+ : "=&r" (realstack) : "r" (simstack));
+
+which tricks gcc into computing invalid local variable
+offsets from current %esp value.
+
+Fix by hinting gcc about %esp change in clobber list.
+
+Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
+---
+ grub/asmstub.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/grub/asmstub.c b/grub/asmstub.c
+index 6354806..44b056f 100644
+--- a/grub/asmstub.c
++++ b/grub/asmstub.c
+@@ -174,7 +174,7 @@ grub_stage2 (void)
+ {
+ /* Make sure our stack lives in the simulated memory area. */
+ asm volatile ("movl %%esp, %0\n\tmovl %1, %%esp\n"
+- : "=&r" (realstack) : "r" (simstack));
++ : "=&r" (realstack) : "r" (simstack) : "%esp");
+
+ /* Do a setjmp here for the stop command. */
+ if (! setjmp (env_for_exit))
+@@ -191,7 +191,7 @@ grub_stage2 (void)
+ }
+
+ /* Replace our stack before we use any local variables. */
+- asm volatile ("movl %0, %%esp\n" : : "r" (realstack));
++ asm volatile ("movl %0, %%esp\n" : : "r" (realstack) : "%esp");
+ }
+
+ assert (grub_scratch_mem == 0);
+--
+2.6.3
+
diff --git a/sys-boot/grub/files/grub-0.97-ncurses-pkgconfig.patch b/sys-boot/grub/files/grub-0.97-ncurses-pkgconfig.patch
new file mode 100644
index 000000000000..d62e4346c338
--- /dev/null
+++ b/sys-boot/grub/files/grub-0.97-ncurses-pkgconfig.patch
@@ -0,0 +1,18 @@
+--- a/configure.ac 2015-12-17 11:09:56.807893315 -0500
++++ b/configure.ac 2015-12-17 11:11:06.697570856 -0500
+@@ -234,10 +234,14 @@
+
+ # Unless the user specify --without-curses, check for curses.
+ if test "x$with_curses" != "xno"; then
++ PKG_CHECK_MODULES([NCURSES],[ncurses],[
++ AC_DEFINE(HAVE_LIBCURSES, 1, [Define if you have a curses library])
++ GRUB_LIBS="$GRUB_LIBS $NCURSES_LIBS"
++ ],[
+ AC_CHECK_LIB(ncurses, wgetch, [GRUB_LIBS="$GRUB_LIBS -lncurses"
+ AC_DEFINE(HAVE_LIBCURSES, 1, [Define if you have a curses library])],
+ [AC_CHECK_LIB(curses, wgetch, [GRUB_LIBS="$GRUB_LIBS -lcurses"
+- AC_DEFINE(HAVE_LIBCURSES, 1, [Define if you have a curses library])])])
++ AC_DEFINE(HAVE_LIBCURSES, 1, [Define if you have a curses library])])])])
+ fi
+
+ AC_SUBST(GRUB_LIBS)
diff --git a/sys-boot/grub/files/grub-2.02_beta2-KERNEL_GLOBS.patch b/sys-boot/grub/files/grub-2.02_beta2-KERNEL_GLOBS.patch
new file mode 100644
index 000000000000..c66ee68dc8de
--- /dev/null
+++ b/sys-boot/grub/files/grub-2.02_beta2-KERNEL_GLOBS.patch
@@ -0,0 +1,67 @@
+From 43e3295aaad5278a1e53c5282e2660b72cd76d28 Mon Sep 17 00:00:00 2001
+From: "Robin H. Johnson" <robbat2@gentoo.org>
+Date: Tue, 29 Dec 2015 15:29:14 -0800
+Subject: [PATCH] GRUB_LINUX_KERNEL_GLOBS: configurable kernel selection
+
+* util/grub.d/10_linux.in: Implement GRUB_LINUX_KERNEL_GLOBS
+* docs/grub.texi: Document GRUB_LINUX_KERNEL_GLOBS
+
+Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
+---
+ docs/grub.texi | 5 +++++
+ util/grub.d/10_linux.in | 21 +++++++++++----------
+ 2 files changed, 16 insertions(+), 10 deletions(-)
+
+diff --git a/docs/grub.texi b/docs/grub.texi
+index 9a25a0b..d1129ec 100644
+--- a/docs/grub.texi
++++ b/docs/grub.texi
+@@ -1490,6 +1490,11 @@ This option may be set to a list of GRUB module names separated by spaces.
+ Each module will be loaded as early as possible, at the start of
+ @file{grub.cfg}.
+
++@item GRUB_LINUX_KERNEL_GLOBS
++This option may be set to override the list of path globs used to find Linux
++kernels. The defaults vary by architecture, and generally include both
++@file{/boot} and @file{/}.
++
+ @end table
+
+ The following options are still accepted for compatibility with existing
+diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in
+index 859b608..e5ac11d 100644
+--- a/util/grub.d/10_linux.in
++++ b/util/grub.d/10_linux.in
+@@ -145,18 +145,19 @@ EOF
+ }
+
+ machine=`uname -m`
+-case "x$machine" in
++globs="$GRUB_LINUX_KERNEL_GLOBS"
++[ -z "$globs" ] && case "x$machine" in
+ xi?86 | xx86_64)
+- list=
+- for i in /boot/vmlinuz-* /vmlinuz-* /boot/kernel-* ; do
+- if grub_file_is_not_garbage "$i" ; then list="$list $i" ; fi
+- done ;;
+- *)
+- list=
+- for i in /boot/vmlinuz-* /boot/vmlinux-* /vmlinuz-* /vmlinux-* /boot/kernel-* ; do
+- if grub_file_is_not_garbage "$i" ; then list="$list $i" ; fi
+- done ;;
++ globs="/boot/vmlinuz-* /vmlinuz-* /boot/kernel-*"
++ ;;
++ *)
++ globs="/boot/vmlinuz-* /boot/vmlinux-* /vmlinuz-* /vmlinux-* /boot/kernel-*"
++ ;;
+ esac
++list=
++for i in ${globs} ; do
++ if grub_file_is_not_garbage "$i" ; then list="$list $i" ; fi
++done
+
+ case "$machine" in
+ i?86) GENKERNEL_ARCH="x86" ;;
+--
+2.3.0
+
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-3 b/sys-boot/grub/files/grub.default-3
new file mode 100644
index 000000000000..593b019db7d4
--- /dev/null
+++ b/sys-boot/grub/files/grub.default-3
@@ -0,0 +1,73 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+#
+# 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-r16.ebuild b/sys-boot/grub/grub-0.97-r16.ebuild
new file mode 100644
index 000000000000..06d9aa23b124
--- /dev/null
+++ b/sys-boot/grub/grub-0.97-r16.ebuild
@@ -0,0 +1,301 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+# 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="5"
+
+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="https://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:0[static-libs(+),abi_x86_32(-)] )"
+RDEPEND="!static? ( ${LIB_DEPEND//[static-libs(+),/=[} )"
+DEPEND="${RDEPEND}
+ static? ( ${LIB_DEPEND} )"
+RDEPEND+=" !sys-boot/grub:2[-multislot]"
+
+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
+
+ # Work around issue where the default CFLAGS fail with gcc-4.9.3 (possibly newer), force -O0 instead
+ # bug 564890, 566638
+ if [[ $(gcc-major-version) -ge 5 || $(gcc-major-version) -eq 4 && $(gcc-minor-version) -ge 9 ]]; then
+ if use custom-cflags; then
+ ewarn "You are using custom cflags with gcc-4.9 or newer."
+ ewarn "Be aware the result may segfault at runtime due to unknown optimization"
+ ewarn "incompatibilities."
+ else
+ einfo "Forcing -O0 to get around optimization issue caused by gcc-4.9 and newer with -O2"
+ sed -i -e "/CFLAGS/s/-O2/-O0/" \
+ "${S}"/configure.ac || die
+ fi
+ fi
+
+ 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 wiki:"
+ ewarn "https://wiki.gentoo.org/wiki/GRUB"
+ 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-0.97-r17.ebuild b/sys-boot/grub/grub-0.97-r17.ebuild
new file mode 100644
index 000000000000..038a541f8795
--- /dev/null
+++ b/sys-boot/grub/grub-0.97-r17.ebuild
@@ -0,0 +1,293 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+# 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="5"
+
+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="https://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:0[static-libs(+),abi_x86_32(-)] )"
+RDEPEND="!static? ( ${LIB_DEPEND//[static-libs(+),/=[} )"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig
+ static? ( ${LIB_DEPEND} )"
+RDEPEND+=" !sys-boot/grub:2[-multislot]"
+
+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
+ # bug 564890, 566638
+ epatch "${FILESDIR}"/grub-0.97-Add-esp-to-list-of-clobbered-registers.patch
+ epatch "${FILESDIR}"/grub-0.97-ncurses-pkgconfig.patch
+
+ epatch_user
+
+ 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 wiki:"
+ ewarn "https://wiki.gentoo.org/wiki/GRUB"
+ 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.02.ebuild b/sys-boot/grub/grub-2.02.ebuild
new file mode 100644
index 000000000000..44db1517a9f3
--- /dev/null
+++ b/sys-boot/grub/grub-2.02.ebuild
@@ -0,0 +1,298 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+if [[ ${PV} == 9999 ]]; then
+ GRUB_AUTOGEN=1
+fi
+
+if [[ -n ${GRUB_AUTOGEN} ]]; then
+ PYTHON_COMPAT=( python{2_7,3_3,3_4,3_5} )
+ WANT_LIBTOOL=none
+ inherit autotools python-any-r1
+fi
+
+inherit autotools bash-completion-r1 flag-o-matic 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"
+ S=${WORKDIR}/${P%_*}
+ fi
+ KEYWORDS="amd64 ~arm64 x86"
+else
+ inherit git-r3
+ EGIT_REPO_URI="git://git.sv.gnu.org/grub.git
+ http://git.savannah.gnu.org/r/grub.git"
+fi
+
+PATCHES=(
+ "${FILESDIR}"/gfxpayload.patch
+ "${FILESDIR}"/grub-2.02_beta2-KERNEL_GLOBS.patch
+)
+
+DEJAVU=dejavu-sans-ttf-2.37
+UNIFONT=unifont-9.0.06
+SRC_URI+=" fonts? ( mirror://gnu/unifont/${UNIFONT}/${UNIFONT}.pcf.gz )
+ themes? ( mirror://sourceforge/dejavu/${DEJAVU}.zip )"
+
+DESCRIPTION="GNU GRUB boot loader"
+HOMEPAGE="https://www.gnu.org/software/grub/"
+
+# Includes licenses for dejavu and unifont
+LICENSE="GPL-3 fonts? ( GPL-2-with-font-exception ) themes? ( BitstreamVera )"
+SLOT="2/${PVR}"
+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 xen-32 )
+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:0=
+ 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:= )
+ grub_platforms_xen-32? ( 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? (
+ app-admin/genromfs
+ app-arch/cpio
+ app-arch/lzop
+ app-emulation/qemu
+ dev-libs/libisoburn
+ sys-apps/miscfiles
+ sys-block/parted
+ sys-fs/squashfs-tools
+ )
+ 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 !sys-boot/grub-static )
+ nls? ( sys-devel/gettext )
+"
+
+DEPEND+=" !!=media-libs/freetype-2.5.4"
+
+RESTRICT="strip !test? ( test )"
+
+QA_EXECSTACK="usr/bin/grub*-emu* usr/lib/grub/*"
+QA_WX_LOAD="usr/lib/grub/*"
+QA_MULTILIB_PATHS="usr/lib/grub/.*"
+
+src_unpack() {
+ if [[ ${PV} == 9999 ]]; then
+ git-r3_src_unpack
+ fi
+ default
+}
+
+src_prepare() {
+ default
+
+ 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
+
+ # Nothing in Gentoo packages 'american-english' in the exact path
+ # wanted for the test, but all that is needed is a compressible text
+ # file, and we do have 'words' from miscfiles in the same path.
+ sed -i \
+ -e '/CFILESSRC.*=/s,american-english,words,' \
+ tests/util/grub-fs-tester.in \
+ || die
+
+ if [[ -n ${GRUB_AUTOGEN} ]]; then
+ python_setup
+ bash autogen.sh || die
+ autopoint() { :; }
+ eautoreconf
+ fi
+}
+
+grub_do() {
+ multibuild_foreach_variant run_in_build_dir "$@"
+}
+
+grub_do_once() {
+ multibuild_for_best_variant run_in_build_dir "$@"
+}
+
+grub_configure() {
+ local platform
+
+ case ${MULTIBUILD_VARIANT} in
+ efi*) platform=efi ;;
+ xen*) platform=xen ;;
+ guessed) ;;
+ *) platform=${MULTIBUILD_VARIANT} ;;
+ esac
+
+ case ${MULTIBUILD_VARIANT} in
+ *-32)
+ if [[ ${CTARGET:-${CHOST}} == x86_64* ]]; then
+ local CTARGET=i386
+ fi ;;
+ *-64)
+ if [[ ${CTARGET:-${CHOST}} == i?86* ]]; then
+ local CTARGET=x86_64
+ local -x TARGET_CFLAGS="-Os -march=x86-64 ${TARGET_CFLAGS}"
+ local -x TARGET_CPPFLAGS="-march=x86-64 ${TARGET_CPPFLAGS}"
+ fi ;;
+ 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 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
+
+ # Set up font symlinks
+ ln -s "${WORKDIR}/${UNIFONT}.pcf" unifont.pcf || die
+ if use themes; then
+ ln -s "${WORKDIR}/${DEJAVU}/ttf/DejaVuSans.ttf" DejaVuSans.ttf || die
+ fi
+
+ local ECONF_SOURCE="${S}"
+ econf "${myeconfargs[@]}"
+}
+
+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
+
+ MULTIBUILD_VARIANTS=()
+ local p
+ for p in "${GRUB_ALL_PLATFORMS[@]}"; do
+ use "grub_platforms_${p}" && MULTIBUILD_VARIANTS+=( "${p}" )
+ done
+ [[ ${#MULTIBUILD_VARIANTS[@]} -eq 0 ]] && MULTIBUILD_VARIANTS=( guessed )
+ grub_do grub_configure
+}
+
+src_compile() {
+ # Sandbox bug 404013.
+ use libzfs && addpredict /etc/dfs:/dev/zfs
+
+ grub_do emake
+ use doc && grub_do_once emake -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.
+ grub_do emake check
+}
+
+src_install() {
+ grub_do emake install DESTDIR="${D}" bashcompletiondir="$(get_bashcompdir)"
+ use doc && grub_do_once emake -C docs install-html DESTDIR="${D}"
+
+ einstalldocs
+
+ 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() {
+ elog "For information on how to configure GRUB2 please refer to the guide:"
+ elog " https://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.ebuild b/sys-boot/grub/grub-9999.ebuild
new file mode 100644
index 000000000000..cc6db989c6e8
--- /dev/null
+++ b/sys-boot/grub/grub-9999.ebuild
@@ -0,0 +1,298 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+if [[ ${PV} == 9999 ]]; then
+ GRUB_AUTOGEN=1
+fi
+
+if [[ -n ${GRUB_AUTOGEN} ]]; then
+ PYTHON_COMPAT=( python{2_7,3_3,3_4,3_5} )
+ WANT_LIBTOOL=none
+ inherit autotools python-any-r1
+fi
+
+inherit autotools bash-completion-r1 flag-o-matic 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"
+ S=${WORKDIR}/${P%_*}
+ fi
+ KEYWORDS="~amd64 ~arm64 ~x86"
+else
+ inherit git-r3
+ EGIT_REPO_URI="git://git.sv.gnu.org/grub.git
+ http://git.savannah.gnu.org/r/grub.git"
+fi
+
+PATCHES=(
+ "${FILESDIR}"/gfxpayload.patch
+ "${FILESDIR}"/grub-2.02_beta2-KERNEL_GLOBS.patch
+)
+
+DEJAVU=dejavu-sans-ttf-2.37
+UNIFONT=unifont-9.0.06
+SRC_URI+=" fonts? ( mirror://gnu/unifont/${UNIFONT}/${UNIFONT}.pcf.gz )
+ themes? ( mirror://sourceforge/dejavu/${DEJAVU}.zip )"
+
+DESCRIPTION="GNU GRUB boot loader"
+HOMEPAGE="https://www.gnu.org/software/grub/"
+
+# Includes licenses for dejavu and unifont
+LICENSE="GPL-3 fonts? ( GPL-2-with-font-exception ) themes? ( BitstreamVera )"
+SLOT="2/${PVR}"
+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 xen-32 )
+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:0=
+ 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:= )
+ grub_platforms_xen-32? ( 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? (
+ app-admin/genromfs
+ app-arch/cpio
+ app-arch/lzop
+ app-emulation/qemu
+ dev-libs/libisoburn
+ sys-apps/miscfiles
+ sys-block/parted
+ sys-fs/squashfs-tools
+ )
+ 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 !sys-boot/grub-static )
+ nls? ( sys-devel/gettext )
+"
+
+DEPEND+=" !!=media-libs/freetype-2.5.4"
+
+RESTRICT="strip !test? ( test )"
+
+QA_EXECSTACK="usr/bin/grub*-emu* usr/lib/grub/*"
+QA_WX_LOAD="usr/lib/grub/*"
+QA_MULTILIB_PATHS="usr/lib/grub/.*"
+
+src_unpack() {
+ if [[ ${PV} == 9999 ]]; then
+ git-r3_src_unpack
+ fi
+ default
+}
+
+src_prepare() {
+ default
+
+ 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
+
+ # Nothing in Gentoo packages 'american-english' in the exact path
+ # wanted for the test, but all that is needed is a compressible text
+ # file, and we do have 'words' from miscfiles in the same path.
+ sed -i \
+ -e '/CFILESSRC.*=/s,american-english,words,' \
+ tests/util/grub-fs-tester.in \
+ || die
+
+ if [[ -n ${GRUB_AUTOGEN} ]]; then
+ python_setup
+ bash autogen.sh || die
+ autopoint() { :; }
+ eautoreconf
+ fi
+}
+
+grub_do() {
+ multibuild_foreach_variant run_in_build_dir "$@"
+}
+
+grub_do_once() {
+ multibuild_for_best_variant run_in_build_dir "$@"
+}
+
+grub_configure() {
+ local platform
+
+ case ${MULTIBUILD_VARIANT} in
+ efi*) platform=efi ;;
+ xen*) platform=xen ;;
+ guessed) ;;
+ *) platform=${MULTIBUILD_VARIANT} ;;
+ esac
+
+ case ${MULTIBUILD_VARIANT} in
+ *-32)
+ if [[ ${CTARGET:-${CHOST}} == x86_64* ]]; then
+ local CTARGET=i386
+ fi ;;
+ *-64)
+ if [[ ${CTARGET:-${CHOST}} == i?86* ]]; then
+ local CTARGET=x86_64
+ local -x TARGET_CFLAGS="-Os -march=x86-64 ${TARGET_CFLAGS}"
+ local -x TARGET_CPPFLAGS="-march=x86-64 ${TARGET_CPPFLAGS}"
+ fi ;;
+ 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 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
+
+ # Set up font symlinks
+ ln -s "${WORKDIR}/${UNIFONT}.pcf" unifont.pcf || die
+ if use themes; then
+ ln -s "${WORKDIR}/${DEJAVU}/ttf/DejaVuSans.ttf" DejaVuSans.ttf || die
+ fi
+
+ local ECONF_SOURCE="${S}"
+ econf "${myeconfargs[@]}"
+}
+
+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
+
+ MULTIBUILD_VARIANTS=()
+ local p
+ for p in "${GRUB_ALL_PLATFORMS[@]}"; do
+ use "grub_platforms_${p}" && MULTIBUILD_VARIANTS+=( "${p}" )
+ done
+ [[ ${#MULTIBUILD_VARIANTS[@]} -eq 0 ]] && MULTIBUILD_VARIANTS=( guessed )
+ grub_do grub_configure
+}
+
+src_compile() {
+ # Sandbox bug 404013.
+ use libzfs && addpredict /etc/dfs:/dev/zfs
+
+ grub_do emake
+ use doc && grub_do_once emake -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.
+ grub_do emake check
+}
+
+src_install() {
+ grub_do emake install DESTDIR="${D}" bashcompletiondir="$(get_bashcompdir)"
+ use doc && grub_do_once emake -C docs install-html DESTDIR="${D}"
+
+ einstalldocs
+
+ 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() {
+ elog "For information on how to configure GRUB2 please refer to the guide:"
+ elog " https://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..9070bcc55024
--- /dev/null
+++ b/sys-boot/grub/metadata.xml
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<maintainer restrict="&gt;=sys-boot/grub-2" type="person">
+ <email>floppym@gentoo.org</email>
+ <name>Mike Gilbert</name>
+ <description>GRUB2 only - do not assign bugs related to GRUB Legacy (0.97)</description>
+</maintainer>
+<maintainer restrict="&lt;sys-boot/grub-1" type="person">
+ <email>axs@gentoo.org</email>
+ <name>Ian Stakenvicius</name>
+ <description>GRUB-Legacy only - do not assign bugs related to GRUB2</description>
+</maintainer>
+<maintainer type="project">
+ <email>base-system@gentoo.org</email>
+ <name>Gentoo Base System</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</pkg> SLOT 0 and
+ <pkg>sys-boot/grub</pkg> SLOT 2 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/lilo/Manifest b/sys-boot/lilo/Manifest
new file mode 100644
index 000000000000..dfb42afece60
--- /dev/null
+++ b/sys-boot/lilo/Manifest
@@ -0,0 +1,22 @@
+AUX lilo-22.8-correct-usage-info.patch 464 SHA256 52d63f53dd5c769d2b42c4f4c2447696394a6e213f0253fcaf2b7501faaef382 SHA512 a4dcaac22e66a6480e7a7783bf93d509a1b288d9d9f7e7674b8c3aaf43b9168a766c135f3f05f3ae3f22bc3c1689100cf429ffc9ddc8b825abbc514b9cb857fe WHIRLPOOL 88f90e35f6fc852a45c819fab5b93758864bf584764865fb119d5afe0a0c6ee8aaab2d0c7fa132517c4f272f3754ae5887194dc111e6f80ae61e01a2a20b3367
+AUX lilo-22.8-makefile.patch 1273 SHA256 d481f4452bee0ec839830a3a3c572394bf9d7e5abea99ab87d18a70859730536 SHA512 d8a0c8017f895f52a2b06ebcccca99bbd1a6020d8dad7f158d99196c98d1781620485c6c9fd980c55d2b28c4acc4581be38db86620d211c5a2ecf82a328111cc WHIRLPOOL 40c8a9747c5f01bb2bffdd6ef3c8758cc958d1155acad43fc2c457fe653700c2fbeefb825aa28577944baab8b311d0f98a909a07eb86efa50d6ca910f15e8f7e
+AUX lilo-22.8-nodevmapper.patch 437 SHA256 0d9c747650db3afd65a9dc8467af4262073f2a66c9f70490298b37e3d9f9f1a6 SHA512 401132c02ccfd554b247c62eea778e025591f94b79a82e41b061b7aae5e52f3c3cbebaef96cf56fdc8b4858f1af6202b7ed75881e8a633668bb53bdb26e3e702 WHIRLPOOL 346863230433b6511763a0a6d7d36438bd2b2d174ef1f0052b52c3167937eba53832047a635f3f4c9b3d291e6c6d3f471d18b08cdf2f144c468b98f0d5f445bc
+AUX lilo-22.8-novga.patch 295 SHA256 f4fc887a0950a32262dc4f36d84fe2b5ec6df2ae67d1dd0110fdfe1aadf65d9c SHA512 ee619280265191f80f07429ed0abe9434219cc00b31d204b613138de449ae9de83f8eb80110c3af36ac52156f3a2b52b8d0795abc8dd8a4ad3df15b654cf71e6 WHIRLPOOL e4e1db110f4247f1a3232e967a2969324f63307738bb28e58c53148d98b4e464b1e65f4107c5988a6ca2dde5e1f233a232db7ec7c3ed87f7dd6fe41a1c8b8c36
+AUX lilo-24.0-novga.patch 497 SHA256 fe9df228f7a9c8585182e6dc457b784b60ed7f357e22a52b0ec629d53a305cf2 SHA512 f09dbca336c6117592ec24e972c393941ae336f01a03449a455b9694e7e7c62fe24cd9fabab96380c91472fc701633a0ca41277180b73525e92cadbb71459d45 WHIRLPOOL 7c5ac6f8ffde38dc104d6196832728326f357ff0e0c0aa69816f1648bb470ae9b3b570facaeaad1c73812da3ce4601d053bc28b48cb9a2b8944c9a8ba05a63a3
+AUX lilo-24.1-novga.patch 500 SHA256 4911147939095f0315ea6f6e48fe53e9daaf8917b5bc3c254f56a1c8d4f37b10 SHA512 067a741086b6df6b5f728ffde3cac949dd9b59cdc11ac1b022f240b69c4a8ef883f5623cc610becd4648f02ad3a243a0d6a939aa8d8c63d9b0158426e6b6f300 WHIRLPOOL 4b9a8ed4d99a6ce6ee3d80ec63d822a6b5d3c18e4d621b7b9037fa9a3f272d118e81d1ae9cbe754ded7eef7b15aeb4e3b8130008d4a536c5357837f732a71781
+AUX lilo.conf 1613 SHA256 954761b93eee56f97a9ce23c40c54f0c41c26e53e5552cba1122049e641064ea SHA512 be59f5b97cbf8eda744e8a7a281526b3262c80af7d3c61e5476697e1569e6e419c4055a8e7deaa4f65688769d941466043af81e159367bf893a88b77eb3732d5 WHIRLPOOL d05910ef36494a64ce183d30cb3d512983964e13c4682cad3e73f47b7f24e4373dab1b4988b5e30ce85e1e5245eae71e291e33d6da3879442674e2a82fa0801e
+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
+DIST lilo-24.2.tar.gz 777400 SHA256 e158f19de4560c935ebe0507c21b79bff17618b9230d8076fe8c5fff9fdbd5b1 SHA512 4437cae21345f483194a5dc95f686f3f3cb2beec78faae3fba959db25eae29fe2c56732e055c05f1d101682c5d442cdc9561fae8074f61f5537dde0413204c54 WHIRLPOOL 4e6e0e2b97592bd00121fef75f6a33f77a0186d4e63f4abd4ef564f7c7b3866c683371969f7aacb696e19813c7dc178490ba9cb7e41f0fcf9fd1739579fc24e8
+EBUILD lilo-22.8-r2.ebuild 4499 SHA256 40fb958ca8470b18fa3824c04a07c95c1c63da262f86480bf1c9ae7226c1646c SHA512 59db4e1c57318005ab339bd8986cd45a5859667c2d2c736a389cc873a6af35e8d652c3edc865a21e4f885e651c7bbf894ac5c537f2a2a383a944e5d4b3394c75 WHIRLPOOL 11067eb1e0d43871d1706b6b40568df420b33be5947b03536f326c1156ddc51c3d9b657bbd48817815c2c083e2a56d6670d02defc0f18a809f2c50315044b218
+EBUILD lilo-23.2-r2.ebuild 4214 SHA256 c11f2472ffdc5ea6672cf159fbaab9e9a3bab8d4673c88e3a886dbe0e60a3f14 SHA512 7b4c1c4b712a986b952e713f244b0ce5d9ef499c4d3d16189b1d1d250d7a42a77b107d6082638c2d98b048720b84fd78726d26557435d425006134e7d202e385 WHIRLPOOL c51f72e7d9a6f04a24a8679518b5dfb808ec7eb0a3ba3cec151f47669dd2742a736ea2ce7d96bfd0d781ae5aecf5bea18b3ac305ba6ef77c086e2ab2ef4df6cf
+EBUILD lilo-24.0-r1.ebuild 4163 SHA256 b3a9b28b9a72f6f9fc64b0f2083b6d551675298f788982f3f2d6659c235c2608 SHA512 71e7728dcd20715c9beaec31d8d9f0b2c7ddd87984d8a8c693ac50b18cbc1d9460acafa2ed7ea9728265ea7cfbd88ad7ff8027f5e30bc2423bdde2ec94ad5624 WHIRLPOOL 9f7427c681357a2def5156a56aad74821b8d233f74b88b1d3260e2a63f43e411bff8801ada680036b7bd0c5abacc9e92317f2b159dab679f14147b3f776bef8a
+EBUILD lilo-24.1.ebuild 4316 SHA256 2026d2721ca824fbc993a65cbc067320dbd2008cbe4468ebeee354556c2c4516 SHA512 88e7ad01b4f9839b15ec27b5453c7815a0c4086a8c1bcd10406f8c5899fef242f64c5e60ae2a88a8b7e56017176a1a7419e39503aa954ee77886ea217dce3933 WHIRLPOOL 2ec1cc3815df2d9a1159bf5fa450f686956184bd16fed5502739ce05442d26348d0d301d3e685d526946718afc05369f41ce65e88c326cba27fa0a23dbf44ecc
+EBUILD lilo-24.2.ebuild 4322 SHA256 18040017bdc8553d492e4bb4d2771e1f65aef6560361f0e229ddfcaf283faca6 SHA512 ac77ff568a93897225a2e72c86dea8f4895439d6ddda9db9f9506091a92b8bc3db6fdbbdc118585e1e3444d26fcbed6994678e01a50f3f0250b9758481f16477 WHIRLPOOL c1b93e3db6fbd51db199479c948d28bf2276eaa7d89e9af87154f10843b62f49c40c48ba8606ec42f5a9fd477312a2cc7196977b736ca716a32b3e934ed6867e
+MISC ChangeLog 3904 SHA256 8ed35641b76d4f7d7756a2df2382da956b02558d30c01673e2064cec28b92927 SHA512 b16f0d0c9631c4f3d3e55c2ebda962e6374a8f31aecf88607054094b374c00691bd321ff0a461c85b4fe9d31e7f2ee2029ba3927eb2b423653a36515c9fc7d52 WHIRLPOOL 0981a1eec2b0605906da67d76af3a16ceef96767ed38f1b496c31f1ac1d44404cdaf47f8346480c4928c0cdd1589ef74b61ba04eab908d3ff82b6605afc378e4
+MISC ChangeLog-2015 15090 SHA256 303e251cdc477edbd25737fb79f6b254685ad9688b0815afe846d27095c037da SHA512 eae9d006bb343a360f1ddb53d6cdedae712a48f5ade505aaef943d0b392ef7c2fab5a5563d57f22173118516ab49322954090d5d7acd68eaf0cbc621fd0e990c WHIRLPOOL 9e03ec8b0c59fd0c82f7fc65dcbb7d9cf9bbc8c0a6ae7255d4d0d615a18b1eeda3a24071f9134297d6396eee5552a90fe03931ee5170fb5271568ecc2cdfe57f
+MISC metadata.xml 582 SHA256 7c21cd3c98979e17fc840b788c7fc0281fd2049957ee826099097189a45f92f1 SHA512 e9c7e5bcd88fab10e756ab7e22a949d1eaa9552cfad60891ca3f47d92fb3487ec74baee67539fabf9db2c15b225ab40050ff5e3ef1d7f858723bf8ae1b80fa04 WHIRLPOOL 5912261c9f2ca72618acf5f6bb7bbb899ed10548f77afb7ed74364879eb47623f16002a6671dee111a6d1bf76e320c64601d8041619ad97faa27327f1e46cf9f
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-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..3848f779029b
--- /dev/null
+++ b/sys-boot/lilo/files/lilo.conf
@@ -0,0 +1,72 @@
+# 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..7ae95e523fe6
--- /dev/null
+++ b/sys-boot/lilo/lilo-22.8-r2.ebuild
@@ -0,0 +1,179 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+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-r2.ebuild b/sys-boot/lilo/lilo-23.2-r2.ebuild
new file mode 100644
index 000000000000..afbd4d2a7346
--- /dev/null
+++ b/sys-boot/lilo/lilo-23.2-r2.ebuild
@@ -0,0 +1,180 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+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..4de878e34d33
--- /dev/null
+++ b/sys-boot/lilo/lilo-24.0-r1.ebuild
@@ -0,0 +1,175 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+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.1.ebuild b/sys-boot/lilo/lilo-24.1.ebuild
new file mode 100644
index 000000000000..3d0cf52c05da
--- /dev/null
+++ b/sys-boot/lilo/lilo-24.1.ebuild
@@ -0,0 +1,182 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+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/lilo-24.2.ebuild b/sys-boot/lilo/lilo-24.2.ebuild
new file mode 100644
index 000000000000..d075d6bf7517
--- /dev/null
+++ b/sys-boot/lilo/lilo-24.2.ebuild
@@ -0,0 +1,182 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+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}/${PN}-24.1-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..0deb765df79f
--- /dev/null
+++ b/sys-boot/lilo/metadata.xml
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<maintainer type="person">
+ <email>chainsaw@gentoo.org</email>
+</maintainer>
+<maintainer type="project">
+ <email>base-system@gentoo.org</email>
+ <name>Gentoo Base System</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..307ae9fb7817
--- /dev/null
+++ b/sys-boot/makebootfat/Manifest
@@ -0,0 +1,5 @@
+DIST makebootfat-1.4.tar.gz 146722 SHA256 0287daafc04da2ae70676f0cf6b6c7fbd8742183ce82d005afd078d0550f0f6c SHA512 638356c951670187960d0050d963116391d4b494bc9b082b3d4673188450e47f22fda5733aa09b15cfbb1640807676f5f8743dd094b9931f150b445eb8d335dd WHIRLPOOL 0139d08b06aef6b39333bee40224b1374d87bf1389ca97529763c93339f14c51c8f6493bcd2436aee957ce56590f2e8f52dc95fd633b4d4fdc8fc3282971c3bd
+EBUILD makebootfat-1.4.ebuild 552 SHA256 9e4f5d72e9f2dad23b918ba4485cee34ec700d065d31f2c56bb484cb0ea6d0ed SHA512 9a8e2cfa1ec5775c7919b35818fddb99f05751ef08c562d15c3fe3b4d17144af80d1b3382fe646b7299a1d9984205cd5e3f81f44ac70ac919c3c3b3b9352f501 WHIRLPOOL 917f5ec6206a8e953747df1872b0aad1771bd35e193291a5ee4cb9253ab288824d25b6ef8d2cd9aa0291a08e6b75d48da7afcb6a3d9ca8165becabb8547982b5
+MISC ChangeLog 2184 SHA256 ace12adc56e89a3579d911c3e2bc276d133837e27ec90fa8bc0751c1f80b7702 SHA512 565d7c64514011007a0bce7d077dc44f8ef127019bc2ebda094750f15f6410af3165534799971f4511e39a39e8700d9d3f7ce97ca0ac43034aa6a29b311d4f90 WHIRLPOOL d395ac9edb5f4cd84379a9405bd3bd98be39b2b52926561e27c3b8e2546bf9ab187f440f00696d628ff141038ac91adfc9333ccc1b3466a6b6f0a9ced1803c33
+MISC ChangeLog-2015 533 SHA256 133f3223db6daee0cf50c05d067485b01f2ebc7c495381cfb7638661fc7825c9 SHA512 287ec693d61db7ba1666a49f893fa21f9ffe949644be28d2dad746e8dc8cdafed9908455525dc4999b6d9e2b2aaa91abf65029fcb0f0c68690d8cbc5d46e8d2c WHIRLPOOL 48555d846dea1859cc793c7293f7e2ff727705c70dfb5bc377bcd982798adb1526e91b85fdea10565482511ec583261a8e1ca40f6e80a8a8f5c4c2d803183751
+MISC metadata.xml 296 SHA256 ce871e37df3a80b06747146731bf35b385dc43a585ae8911f9291eed4c2333a2 SHA512 da7799c8fc7fa55a87627c32493dedaedef72d7d3e3fa2bc4eb7eff936c07774653b90c9a47602efabb7d8f9956ce0baed6bc2bb6879058b9326599fa58fbd11 WHIRLPOOL 3e6171d90b583fe9bfbb279ab09c4ac66ce1b93191255697103d3fad4e1a70ae7071b8fa1d8accc523a5f6023c3aac8fcd76d932feb44d88eacf13459e7a3d87
diff --git a/sys-boot/makebootfat/makebootfat-1.4.ebuild b/sys-boot/makebootfat/makebootfat-1.4.ebuild
new file mode 100644
index 000000000000..9dac047793df
--- /dev/null
+++ b/sys-boot/makebootfat/makebootfat-1.4.ebuild
@@ -0,0 +1,24 @@
+# Copyright 1999-2009 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+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..49d6fc17b308
--- /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 type="person">
+ <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..88c5d5f6e6df
--- /dev/null
+++ b/sys-boot/mbr-gpt/Manifest
@@ -0,0 +1,5 @@
+DIST mbr-gpt_0.0.1.tar.gz 15861 SHA256 c66cc48c6034f1db72ddba187a52f590001a946f87478171b3d362b601b26bc2 SHA512 eaabd84fc749ddee8fa40632ad49e15e894bf35a881fb7c35ba22796c2459a886e9bda601595e58d29567ff26959ae2befe6aec5db397d15e1dc5a292dafe165 WHIRLPOOL 840f2f1d5529fd88c0209eda38a5201d40dbaccc7fd77197f013bd949f899b8f470025c7264fbaed4ef2b9f51b2dd5da97db9e0b0238becc0dca62c988234a2f
+EBUILD mbr-gpt-0.0.1.ebuild 1389 SHA256 3d721113d140efe0e97dc1bf8a64107cdeacdcaf818b9305b4943311d982042e SHA512 9eb0d9967af218ad519ef5224e64e71d3558471d391a441d21dc5a31694c91fd19badcf80ef4097db949cfe544eed675c99229249a15291a014eb89939bf53d2 WHIRLPOOL c5c40936201decba3d966486d6dc9bf0c39e593eaf88f1de03f1df50d6c247ed8089fee2883f35f1d9ae6388deeae3fbec95a0f655815cc9bb8b3bb02320b9f2
+MISC ChangeLog 2926 SHA256 0468cca55f6d7d4a9596e20172de76aeaa8928800f983ca6e41205853730e98c SHA512 bf986593b7068901f111a8b9b81021cbb4201b3ddcab0a592af1afa84710930cae15556c80b802b708ccc76926a8bf4f0b3fdc5f2435944d946b83f973eee134 WHIRLPOOL 7b7c372c26ed8db08c8f4dcd65bf88a0c15fc321efc034a1342eb61a162c0ddd4be50314cd8217044b47ae91dc13b3011fb3c8deb3bcc7860117a445592c154d
+MISC ChangeLog-2015 560 SHA256 a57fcc9d27a368d4fcdf4f76a3bae1a9936de9592d3c72a5bbfe9c380a2be76d SHA512 90787e6f4efb4f80eff889df3c5ada5d7c6d6b47793a877b5358925d80a66bb715fcf08ac9f35913772029a03eacc418feb1cde932a1e0ecdfaba5c9279c5767 WHIRLPOOL c24da827a9a38c32a5e41318d6c502e1fa11dba15e9eee9eda1aa3f7eecc2ea1c01b233ca35b5c5fec8cd469a06ebc0b89d6699087ec5de3d87ccd5d05f53024
+MISC metadata.xml 329 SHA256 4ce73c4d5d41f458fc9039b8da317ba512dcc468f39b9db038e5d6416707179f SHA512 3baca06564c2219ea6175ea39cea467ada4e7bf21a4341fcdc9d5b885ae387f4ca4f93605464b900a2524d64badfae641c5459d0acd0569de1ce848528a46ee4 WHIRLPOOL 19cd1cebebe165ee3cde545b131693f98c677790b8cc07404639880f9c4c83576e5db8080af03f7e7409d0aa4b03b4053de460e6d30ae3ebbc8e645d984e1b56
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..cfea4df2fead
--- /dev/null
+++ b/sys-boot/mbr-gpt/mbr-gpt-0.0.1.ebuild
@@ -0,0 +1,51 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+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..9590fe15fc00
--- /dev/null
+++ b/sys-boot/mbr-gpt/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 type="person">
+ <email>robbat2@gentoo.org</email>
+</maintainer>
+<maintainer type="project">
+ <email>base-system@gentoo.org</email>
+ <name>Gentoo Base System</name>
+</maintainer>
+</pkgmetadata>
diff --git a/sys-boot/mbr/Manifest b/sys-boot/mbr/Manifest
new file mode 100644
index 000000000000..e60886a8b59b
--- /dev/null
+++ b/sys-boot/mbr/Manifest
@@ -0,0 +1,5 @@
+DIST mbr-1.1.11.tar.gz 132060 SHA256 c188692955763602e211be585b94c4e4d0fbe7b49fb12a6cd80ae06ccd421f55 SHA512 27637b7c37be22ec7947b73684156a38c76dd1d37fad12133dd614ac4b98b578b30a758e6179a7cd62f6044dde2dce19a1e28234aa4bd0d848ef97b44d6cd8f9 WHIRLPOOL af9e83e34e948c00fc74ed9419eae2a549936c731b50776e254f69a739bf25792718f5dcff9ca1d8f58acc35bb2df5622da38e767492177de7c3fed4f5cc4c8c
+EBUILD mbr-1.1.11.ebuild 766 SHA256 f0f0ecc18e2d1e7b2bb17d64ca12b2f7aefa1359bd855d11dc2fe54a01f3eeac SHA512 5c6555538c5442562b7244535917a2479ddcd809aed1b2b32fcd2613edca048cfadee0f85b73d07e92aca6ba7dcc59849b295baa1703ce4e967d72f008e2370d WHIRLPOOL 5295c6040c92315c24da840e37322bea3c4314def69d474e258c58fa2ce0e5b0460cbfcfff3bc88b8e9cdc57e720ac7e7e9c3428224851edf9640b2b6e6a7120
+MISC ChangeLog 2512 SHA256 85e03142c3b90c1515ad1bee41d9d29ad45a00d8254ca44d2f79f78902c15884 SHA512 d447a7216824383c752beff5e4b2df6ebe83830f0a6e63e6424f42d48e4ca9b8127cfd1a9f39de1bbacad510c05fbbc5b00418394ca68403f0ab4950669bff43 WHIRLPOOL 1e9e87774932854a32b3bd04ee3276811946425fe30e24997b859733f5992ed8a175456ce50da801a074e7da60cc8c825dd85412ac338417c445d7b04fe346d3
+MISC ChangeLog-2015 2675 SHA256 d8ef8b916b3a5e540d4ac9c6a041108ae8dc94ff2267ce5c74b4a6720589a62a SHA512 9285947d1c453da53e8f77034df0d308650a8d26503df9dff7f40e75482695732865e0ec7273795e73e704a9bd344d1d8f07af56f1b71f5b7345bacff4102109 WHIRLPOOL f390a0623060d235b19cff3c76bab9a218714faabca307691de0689beafdfc30ee45198021c82ab3338e2bce712549b6c3ea6e39727b8f57d64a3537d4c35c2e
+MISC metadata.xml 166 SHA256 2caff447f5bd2701d8456ada5cc633c41ef4373fa4bfeabeb73599d40bcc941b SHA512 a56648c974a1d14dd4c18237532773c72057a13ab90c58b5da04f185e3c12a8bd8d5c21fb06053507f31766291a82dc7d87b34cd65fd94cfe2af7295c813ef84 WHIRLPOOL 1ff70497eca6531f0e0614c72a19f4b8e5ff486a58d369f4f0b36308d1d6b01168f9da887740e3b9f536236be251d3fe05f904d27a9233a7cf613416ba882968
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..5c577069cbd8
--- /dev/null
+++ b/sys-boot/mbr/mbr-1.1.11.ebuild
@@ -0,0 +1,32 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+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..6f49eba8f496
--- /dev/null
+++ b/sys-boot/mbr/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<!-- maintainer-needed -->
+</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..9022f088be01
--- /dev/null
+++ b/sys-boot/milo/Manifest
@@ -0,0 +1,15 @@
+AUX README-gentoo 3390 SHA256 5ea6da5520997956c2eea4a4f5101a31e4220cd601babdb2984a22cdb9002f6d SHA512 ffe7c3202f6d65b892d5ef641e0e83a00f13a264f208e90fdaa20a392e4abc869c5513f10d481831b45e4b4e1cfaa7c79e2b89fcb541c0be186374f0e6a1d33c WHIRLPOOL afe91679b51749ec0fc7c8e796e746dccfbc8cd25b5a64724830e469eed31e704e9833d14686de23f8eba9b7a9b61c383b03cdf44285c800be7c4b6c429173e0
+AUX linux-2.2.25-gcc3-milo.diff 3542 SHA256 a6a342920de6919af0ee269a9c3d05be656e755dc145a47923a4f6c433552da3 SHA512 d709fbc5340a0cf01e6d23cc9080ca6afa585d4b4764de97f57c0c533015841ea4df557a68274f3406c323c781d73cca8ab2dd06f7a1a96cfaf0db118330d30e WHIRLPOOL bb723be2299bc2640b4bc5536778be075172ec17e7e0279897afe32682af74c550249e317b99f62f3531636786ff46c03a7c321cf38cc2d0ef40708efd3b72fc
+AUX milo-2.2-18-gcc3-gentoo.diff 5619 SHA256 573545ca2269f0296336c91ba4fc6901aec534752de9a521cd6bae3197f7a38d SHA512 1c265c007fd1f9f67d2df0533c2acbdf15ca5fedf503583675c102226bfb3a4c8c281dd5e424b92186461a59964009c6162a85e502a1951cc05c0fab878eaf46 WHIRLPOOL b688a6e469ada99a52ec7ac053d5879f1bc6fc32231d4e7d97f1698634fefb79c7c690e0cfe84610ba866ae25f6968f6208a7b8133eb284f43088bbdd0d7dadf
+AUX mkserial_no.c 1264 SHA256 4a9714e0a3a1aa9fa1cca410cf02c8559035bb67ed2cb12351efa24e3748f303 SHA512 29dffb49bff13f2961756747ef708f949d8a5ea064c9e0bf72cab46a9ae21054bb6d9f1d338ad4cc8efd073040f8e9ff940da1d94bcd8827d3aea44718bca2b4 WHIRLPOOL 36139f089404f47250bdd252adf14e6f4299c17ac51bd7c6a3285b2d074d9e410fee8e6ee408280c2704d264a25a0596dd0910985cc50c4069635a5fa621d1e6
+AUX objstrip.c 6126 SHA256 21be9424bfbfe238e402aecb55f9ff53bf042dbd287405f53f76bb148c1fe327 SHA512 04c8e26c8dd143a1de9feb3b3cd66f3eb70720bf297dc151b18840ec1ed827df6209b0c57553a2fef2a29caeb7d5c7ce090800ac9a05931769f32ef54972955f WHIRLPOOL 800c9946c00ee6ae33e5fda950ff67b3c0b47fa5e9f513571f118f057e690fe5d46122c6fd06f1db02406bfb45f85cd74820f180bfad6a78ccdfa2f111010ebe
+DIST MILO-HOWTO 52455 SHA256 d94f5d75d647f47f11fb691df3da450dc794dd9287464df71168d03d8bbcd4e3 SHA512 81e0fdc12a1e56af14af4a4167ccc9d6ffefa265fad3328c27b7640b51b07012870c0e57497d83084d1ff9c3681ceb617a4ff25f87e12d109c34df062a0c1432 WHIRLPOOL 154f7c527a43f18104fc5e67e03db593cf8b764b3beac7b2a31f8e87bced10e5582085ae41e6b2272bec2e758a3ed5cbe0ed96d3a060005b16ce7e5790b85f2a
+DIST ldmilo-patched-20010430 18944 SHA256 282745f24bc472871b5a4eda7a634847a874d04802056ffca360bf67883d753f SHA512 c02ba8805b0d28516534d679fef7073e6c2adea30d41a8bf9e40c48c57a889e5122f475970c6afe9ddd894970dfc2504ea89c276d920a1fbd88c3abc3eaa1e01 WHIRLPOOL 50c31440ee6edc199bb052de5b05f75ef8284f41fa653100b9ff6525742525fc7078f0c5c616d70861f50d55e56dd33deac798c106133ce8b964a59f08ba6507
+DIST linload.exe 7168 SHA256 15d1d8dcbefde7c94a1bbe4a243b13f9197c27cb19388f8de0d92d45a4be42e4 SHA512 604b1937d751b18a9204681a248ce9557912c10b2e2c68e5f9ce33030d5b0d8721f1afafaf22d6326bc4514a09a72696c4917d893a9e64ac44b61e563caac96c WHIRLPOOL 8013004d89ff724227de0a3b80f15440ed1c69260820fac4563132a1e1bfc5569368fd426e87fb5ea6ea397515789ec842342fef45306c35d9a00ebe40e8a760
+DIST linux-2.2.20-reiserfs-3.5.35.diff.bz2 154943 SHA256 a6aee45cf9814e45d9a3be05b35bda289c5f6d8672eaacc32fcec60527550e94 SHA512 b63d03d605d65cb7a15020ad38b80d77b810963edbdc0b5ccaf1706347de5026e390d8c2a5315f1d2734b793903c1a407b4db4129d11b7d5ff2ad9dc8f2137aa WHIRLPOOL 37fcde105083087f0afd62b6cd5102d769783f0c22efdb70cdee9f961aef4509df98f4bd1f67827b12835d664266a5fd4893c9572978d6ff4331ae9d95c5eff2
+DIST linux-2.2.25.tar.bz2 15791211 SHA256 cd15777cdb90af5136d40d13190def143ccf7a730722c7435e0daff48d0405d9 SHA512 63e83f4f184cdd09f39c24e2023fce3562ea550db7182ae94e36ce30c6b2415bac970306cd60c1d1a89a1a3b54ad957094629557a5782f181939efb219ad41bb WHIRLPOOL eb1680128c4a6c249ef71dd4668698a4d9f09ce2d7c8b6cf9366d129bbeb1f8bd0a37a2f43d8d50789b745373950b094e736b518b9d033dfd4d5567861462096
+DIST milo-2.2-18.tar.bz2 1074725 SHA256 b63e113d74eb40845ecdd111784d524c223694f236891279ae002b441a50258b SHA512 1ccc86c83d520d07040ba44d14e7e9353cf364bf5b83ba4df14b0560769643ce07f89feeab468144fe17b7bf482beb7480f5dad1a0e9b574e6e6150bb72aae93 WHIRLPOOL ac08d299f37fc7bbfd78cae8cb63c245f6a0828e93ec1c838a288889fc9390081e79450e98a0bf460a4a7d61fad555e7b1de63d3246cbc15ad1a82063f522984
+EBUILD milo-2.4.18.ebuild 7757 SHA256 7b59ed55aa14891be508522d0483b9092f515e42e46dc7678354a5b3d306f8e3 SHA512 f2a50d8c14494a3c3347391172c00dca536a45693136d60c73f785d3a4ad87117c8e13fd26519f75ab9ff363a8db24eb7d5b499af735b85860b0a61f2a29bd39 WHIRLPOOL 72cd85db923d99b4163f722b19ead9119b70774070b4740f3813b8cb40da811eb6186bdb578e32e316f7a77d4ad478a381f8fd8f91da8cb09cb5c524c085b009
+MISC ChangeLog 2580 SHA256 17cce35beb901ba12f32d5bb38d52a0ddecfb882be3d10d3d22de2a1344650b3 SHA512 345c58d12d0a853bfd655b9801e0f02533bc985ac887cb53cc3a2de07c182f04f67f08ba9ab3ccbe930ecb8b277da55a2c309ca75bb0d14fd89081ea1eaccc06 WHIRLPOOL e71e583fe4f2e6865c5eafcc1b89629e52a35a6625a0b409824733ffee7e0a1f15b01321c3c2c50c423db039153008a83baf8effd8665b23f28b87c3aeed145e
+MISC ChangeLog-2015 1939 SHA256 f719335c4a5eccb1e051e9ee39a9fd156997418164ea71c10e047b416e108bb7 SHA512 75c9516eab19211328b6116c73d414dfc69ad19b52516b17aad3622b87bca9567014e7b1818ee0925bd6c2c361ffc57040a8f9286db91d45c5d91b692fb1f660 WHIRLPOOL 59c3b6ec9901b5541728e43e2d3345d81a7328b366a435776817dd996096d25232cf9f5d860dd6518979a9100e3db47cd57dcaa4d0df8be7dd5d2e6283677473
+MISC metadata.xml 790 SHA256 76e0638d5ac18dc331a6ef706b1bad19371456780b694d8920c8b438494ae864 SHA512 513614f6b5be1bdca2676a618b1f1c6b70506ced43da83fe92b75876f88b7439e1a13b83e3a0252cffc1b1de09914f67276ea0cc239ee3c2efca108fb2a1b700 WHIRLPOOL 7a09e705be56988548b4e60b6a4247fd31416f07b3e18f6971d791f9692e4933d3cfc35b79698564a68df359550a31eb972e428225f116279debde08186b25ca
diff --git a/sys-boot/milo/files/README-gentoo b/sys-boot/milo/files/README-gentoo
new file mode 100644
index 000000000000..5ad8c753ba09
--- /dev/null
+++ b/sys-boot/milo/files/README-gentoo
@@ -0,0 +1,98 @@
+# Copyright 1999-2004 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+#
+##############################################
+# 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..a9870c74849d
--- /dev/null
+++ b/sys-boot/milo/metadata.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>alpha@gentoo.org</email>
+ <name>Gentoo Linux Alpha Development</name>
+ </maintainer>
+ <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..9c58de22f09c
--- /dev/null
+++ b/sys-boot/milo/milo-2.4.18.ebuild
@@ -0,0 +1,231 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+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
+ https://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
+ https://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..124d1af264a2
--- /dev/null
+++ b/sys-boot/netboot/Manifest
@@ -0,0 +1,6 @@
+AUX netboot-0.10.2-ldflags.patch 1208 SHA256 8868c285afe83d138736df4a8d6bd574abbe65e1ee2b5aa792ed3ada9f232790 SHA512 ab96af0ddd9956c293cf1088597b543e312bb10f535b26e379692dd94b14a34f56d9ee71c1c82e6946702d69f1665a92acff42afe4d0036d56f28c533f8f1bd3 WHIRLPOOL df48c13adbe0d85a5b7dbde80fcaecb5312e2551f95a2aa7c5c8656f4afe92f5235621f44626bab882916ae2612c8b73d10c664f83e176fc9d9cbae0a2925003
+DIST netboot-0.10.2.tar.gz 1457791 SHA256 e07148b0c396fa8c2c542399b79a6adaafa84684b97c0991fd1dacc7f74a8027 SHA512 422e78833c36e9975a77226523e14ebf8b5af5c02e98628ee030459ebf9f26d020551265899e84ea27bf6ab43c4d9bf8edc6722f942f49103bac897c7cc4fa3e WHIRLPOOL db28598558f9e4f9d949d049624318d9105c128e3743aecd9666b1c9d02cb3f61ebb0b1fd3a220bf577cbca6e61ee5716aec3d1b868d5b1c0fc0eb97a4c600b2
+EBUILD netboot-0.10.2.ebuild 1116 SHA256 a8272799ac1882e84aedc7c8aad812159875914467f6dc1b1597a8530d3d7b81 SHA512 13c6c05c03f5878a7f883bd5140182495b154bcc66b3125d769f751e90ecba83e56cb851f364c0c06b6e2d7618057b3a8fcbb499af108b20deb5ecddece312b2 WHIRLPOOL 8e17123a87d0afe7297bcf672f44500e28e6aac362d75bfbed62098e10d5031d9e7597723a94cbad89d88955af5745c46210ee8d9eaa33cd66a321c81b031961
+MISC ChangeLog 2561 SHA256 1db6a610563d24613d915c78b9459996233e84db35cb9c55baaa0f770ceb2df5 SHA512 5e1820ff9b1bcf3e89fd8eaf24a48883293caeb74273892df99dad842fcdb483bf78296865a27764e4b4e543d163ca6195f9e69bb50c7be1b367fd49164270fe WHIRLPOOL 6b27e8cbd79cdd839f88bd3db1769d22b2c28fc3f4e33b7c1cf2199d5e0cd2526925f617dc81047d9d49c3c157441c591619bf4af1fa4a357c8dcf4ea12f62b6
+MISC ChangeLog-2015 1486 SHA256 707590ca80210bb31b9088a4cd703042d469169f58f856d222fbbbc7fd90c5ad SHA512 cdcb5b26268b68f14947b338cc90cf0eb8696ea1ea3a0c2c51b56d9f7dd8390546cab03b2132b398d0d6701baeb859c354f29b8273d19a214d0a262575026cd4 WHIRLPOOL b33c37e0bf2b0fb03e4eaad90eeb9a1950713d8e622c760e3b531244c816a7657d84b472d2da5b6008d4feb88a838a2df94588fcd6fb30a75955c11f8fa6c67e
+MISC metadata.xml 244 SHA256 d048d64f213e678b2916354fe3b56216cf941e4d53afb55c024cf6da56fec442 SHA512 fad9a4d73b1f625842d6ee8f3db1cadd4db9c32cd8c67b4caf8b3825ff5305b80a7319e2912c7113468bbb43751b102d3dce4df195b4d6c8db1de8fa2523cf52 WHIRLPOOL 61184a5d05974a26f9ae3a61b845cabd2aa43fc01da7c6cfaab7b4ebbc2d743265855a923be56a9dae6510d45b618ea104f367f2574db2aa53d1d505982a53b7
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..7fcd5c3e9ed2
--- /dev/null
+++ b/sys-boot/netboot/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-needed -->
+ <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..861a4089eb28
--- /dev/null
+++ b/sys-boot/netboot/netboot-0.10.2.ebuild
@@ -0,0 +1,50 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+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..1290dd6607d8
--- /dev/null
+++ b/sys-boot/nettrom/Manifest
@@ -0,0 +1,5 @@
+DIST nettrom-2.3.3.tar.gz 801683 SHA256 6a9e06a0741c21e23c37e9449f833c0871af7cca3e7265ba4801214102641cdd SHA512 7b8b85d7a0cda8c5860663e19ce75223d667eeb1997b28eaa2ce67d3c14e609cf98706d54f86b0e91e3dac0570d0ffee7f1737f21bac774a1150e58d783bc925 WHIRLPOOL d1e288c2fcd851c47d9bba6d22f9f40f581b69041b4bffee87f95ef7b03438aa6ec17149c19f035baae0795d8a8476d538b9e22234f14dff3ac0891e68327714
+EBUILD nettrom-2.3.3.ebuild 459 SHA256 18196b25e48c4915b7fd211bac7bea8f938869d7e5615cdac9bba4c814eb13cf SHA512 6eed23a80ac471f01f0069aee346ea7fb03e1e52cf3786ffdeb84255c848943f45e22be9c70abeccdb8e60fffbd6f1512bff842222050809b6d6a9f8d7729b44 WHIRLPOOL fa3215b2b554d4493175640aea25a40dbc3faf4de80aa67852bb08c697ca1046153761c6172412dff48d44376a614d10c4d7a1e7fc80011612c1e41e58c26568
+MISC ChangeLog 2427 SHA256 12db9210d73e5797d6b5e05a1efc9e5ea18be2ed5767dd67e9cf51c58a5fa0e6 SHA512 a60b34644515f03d5e67142fd999c79af61bab89ff88bef7d79e0a6728d115833582bfa66437cc3f1662bff212bdd1a1a4f801fce02b0331a6cfc54e74021e90 WHIRLPOOL 3fb9fc3f7aca314419e67cb2bf6a7954ac425ea1be0d640eff0d9d036f37e871b42d917a02f7eccea489f7fbcb6884a2b873a46506f1b4fdb6b406a049a58865
+MISC ChangeLog-2015 875 SHA256 675584d1670cc67e8213a20aeac1569d9b77b2de9b19f35d16caaa0ae026e44d SHA512 f02fbc23b90faa010381a03dd65325b3772ebb31022c900579c25f4b0a6d69353437361394f2bde31711c892a60d86be9a585e16eeb52a4bdd602d7a890ac64b WHIRLPOOL 489af24afb363d82719bcd70fa1e0c2147e88d92c01804e97896cfe8133d9e3adb8fb2c88799a57700356e71066ded768b7e2eecb524e20843a145766016b1ca
+MISC metadata.xml 247 SHA256 751aa1f012df292bed9716a5c6a7e64114b695d2ba0c0572fc7e87fc3bbcebc5 SHA512 15df289e0f962f564551f61ada3cfef0311f6af639887def780bf5ad3be105515c8d24c950ff340ed35d89b9cd994af3540322b684c5dec3b43ec6bb0041aa4e WHIRLPOOL b6c074cf39f6ec1e2d085151836db47f9a4d71bcc9cc3296889bfa10172c7f07837ca79c8613f9c483b1332683e78eebe88e0a433a7caf801fc7ccac2552cd53
diff --git a/sys-boot/nettrom/metadata.xml b/sys-boot/nettrom/metadata.xml
new file mode 100644
index 000000000000..71b1461e1146
--- /dev/null
+++ b/sys-boot/nettrom/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 type="project">
+ <email>embedded@gentoo.org</email>
+ <name>Embedded Gentoo</name>
+</maintainer>
+</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..a2649e3bed37
--- /dev/null
+++ b/sys-boot/nettrom/nettrom-2.3.3.ebuild
@@ -0,0 +1,21 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+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..d93f6165865d
--- /dev/null
+++ b/sys-boot/os-prober/Manifest
@@ -0,0 +1,9 @@
+DIST os-prober_1.71.tar.xz 25540 SHA256 5d6141e02b58e82194422b97d683d61c7ff78175d89c2f055f5d2e7a363bdd20 SHA512 adb7b8cf54c6169510c7ce2bf40e4b659c97eecfb7c1dd149269520ef13cdc2b6587f221fcfcb95c18caf9dba8144bbba561abb158e986ab02f4e0d338317d04 WHIRLPOOL cb3d8596c1e753fc2d687b30c6bd386d160114524b7b4f2d39dfe208191b231962311103a3106a7ccad8fa05bee132a5faa72265c44c33e22cb3d6090dd1cb04
+DIST os-prober_1.73.tar.xz 26532 SHA256 588395e38e9123f414cc1e7ea2374e4bd133bb7a8d0e0aff18acc8d7f8d23adf SHA512 7db2c276a16fefb53750889c5e784cdfe285b0124e8eb0c5dd92a9ce7addef95ef6e62d6ccd3c66788f6d1c9d029e9e98ae21040d1d84885e756691504e63ea4 WHIRLPOOL 7ed340397ff4075b28d6de5e4de347a2cbfeddaa52f4861dbe96efb7b07dda729c39f926abbdf689899cee157c0b900edcacf10c7340c6118d9b84a431a385a8
+DIST os-prober_1.74.tar.xz 26692 SHA256 c8e97ae193783eb8b5f5aba6b6d447b2e3e60696bb71f86ad029c33e14c5a7be SHA512 5407fb3c782ae0532120995d60cfc307028de9bea52ce5534baaf940a99269b735c1174ef0f7a5316be485a1e8bfd097108c2819eadf00e2e38595bfc2c22245 WHIRLPOOL 31d478df1d8cf2fa353620632baf0b668ba3676f9286ec5eb21ed72be3995958f7d0cbbcd8403999dfe2234997f02589bb9b0e67aee919938282feb2c1d1a37d
+EBUILD os-prober-1.71.ebuild 1663 SHA256 f9e60ae3efa21ec0d6a6c6f1543902944e964dddb68423e211813b494900806e SHA512 e50c2c45dc01279394b1a6e45f6d21c28e0a2182b307ae10908e4e3a104f825d8acbd8318a477a3bf65612a24ddf37ddb38ef0e35aa1efd5d7ad685ae47a3229 WHIRLPOOL 5bf7aa592b32fb681815301d6f284e1cdb48ed091646f09161855c0557d032997b136318fcc3d9e4106dad5989a47e8e6c32063410a07941f590b3ad2b085223
+EBUILD os-prober-1.73.ebuild 1665 SHA256 6a23e8c205fb8c0481b41f51283e2dfa6e85a258bb0e8d0e48ac804092fe4815 SHA512 e1afd850dcb184949d466d3e5629ade95550e7cffba8573941c28dcda5c7b783557f8db98bf3fcf901ac31d35210c7495473a1e8c84a2e527fde9539be52c9a3 WHIRLPOOL 740c4ec84fdd67f10f7106b8184106e2bd27dc1e4ecf17ce6f7ed09420d973f3bd72da3c1e26687de4d08f6716431a5fb76e840471b8d7c263b72c19df2cb3cc
+EBUILD os-prober-1.74.ebuild 1685 SHA256 8777337f269511fb2ca7bcf52366fd68fbe299d08c05d3b2f729c2f7f736cb51 SHA512 ee0919eb87bd429c6d02c9cee1d8951ad345b0d95029559a7746bd92ab589607dfc9d21c9655e8e217ed871169d2f708dca393ff3a660d0f782908a3f0f878c7 WHIRLPOOL 537bcd331f0cae212fd9856a3ee6fb018e0a5ab105de7405c4b458a3c72ebdaabd9d48089b998cefe2efbea1c87219eca8b195ef85fc4a35be95e5f0984f6f60
+MISC ChangeLog 4139 SHA256 49a16fb257692342306dd9627f3843f5d26668672350a26cb7604c17949fedf1 SHA512 2d10788420d849838425a89326fae9c19b3062c4c5759e30c70e5c755b863949076f098c8071c82b60e143d99ac9c11012fbd0cac264138bbe8da555454920e9 WHIRLPOOL c2416f221addcd3cf2406bced8a27e21aa40214b2ecfe301f0b88d0844de71936eaa086d58b129082f703ba52461638402b611f281f07ac5013cdb5b71774f26
+MISC ChangeLog-2015 3834 SHA256 88da9fd9fe1d43e7148457b3fbe276bbf76834b461d29ff02f376f7a6c3da2c5 SHA512 a156b032401c77029b9cd3883c53ca3758a0c4be788fb30bf5476e2ad2a43c8853b2aebb55c705ad09b7eafdd62682d1da84351d578da69fa9eb14bf7305474e WHIRLPOOL 840b6c38fb1f32ec29aa0dd0d6a416c1250b3e85970db137bd4af70541e657c8d9d3ba17809c5c8620549526b8d23e925377cb6bb254b90069cb855aa95a802e
+MISC metadata.xml 362 SHA256 dd89b6496c03a542f049bf1972ea49f4c2bff18292267ff9f91d90c6921397d3 SHA512 a9a718618d29d0311b76367da3cb87ceaaed2a687aa0a30418ad74688e08996d95d8ba5a86f2af4e5919f2120af6cf07708ea37005d03235341377db5cdaa3a3 WHIRLPOOL e5b374175054b3fc8f355da5579ee951fcaaf7179bcf643212eb7ef094cdd0ee16d7e84162df4bb648b96ab73d2729120c682f2d267b4ec725817613a6f5b365
diff --git a/sys-boot/os-prober/metadata.xml b/sys-boot/os-prober/metadata.xml
new file mode 100644
index 000000000000..50b549386cf5
--- /dev/null
+++ b/sys-boot/os-prober/metadata.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<maintainer type="person">
+ <email>wizzleby@gmail.com</email>
+ <name>Locke Shinseiko</name>
+</maintainer>
+<maintainer type="project">
+ <email>proxy-maint@gentoo.org</email>
+ <name>Proxy Maintainers</name>
+</maintainer>
+</pkgmetadata>
diff --git a/sys-boot/os-prober/os-prober-1.71.ebuild b/sys-boot/os-prober/os-prober-1.71.ebuild
new file mode 100644
index 000000000000..f6aa7a1d903f
--- /dev/null
+++ b/sys-boot/os-prober/os-prober-1.71.ebuild
@@ -0,0 +1,74 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+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=""
+
+# bug 594250
+QA_MULTILIB_PATHS="usr/lib/os-prober/.*"
+
+src_prepare() {
+ # use default GNU rules
+ rm Makefile || die 'rm Makefile failed'
+}
+
+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.73.ebuild b/sys-boot/os-prober/os-prober-1.73.ebuild
new file mode 100644
index 000000000000..e7bd06a6be4f
--- /dev/null
+++ b/sys-boot/os-prober/os-prober-1.73.ebuild
@@ -0,0 +1,74 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+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=""
+
+# bug 594250
+QA_MULTILIB_PATHS="usr/lib/os-prober/.*"
+
+src_prepare() {
+ # use default GNU rules
+ rm Makefile || die 'rm Makefile failed'
+}
+
+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.74.ebuild b/sys-boot/os-prober/os-prober-1.74.ebuild
new file mode 100644
index 000000000000..db333f139291
--- /dev/null
+++ b/sys-boot/os-prober/os-prober-1.74.ebuild
@@ -0,0 +1,76 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+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}
+
+# bug 594250
+QA_MULTILIB_PATHS="usr/lib/os-prober/.*"
+
+src_prepare() {
+ # use default GNU rules
+ rm Makefile || die 'rm Makefile failed'
+}
+
+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..9c6e7529e263
--- /dev/null
+++ b/sys-boot/palo/Manifest
@@ -0,0 +1,10 @@
+AUX 99palo 19 SHA256 3f45c61bab5cab1db3721ef6591dbfd158cd8150557abceb78f4b7d4164c2c94 SHA512 1ca106eff8f34386b5fa6bd9f0bfb656567040a2d3bc18de8f6913c3b533369f7c267932904556517f599674226feec8a09df6965bc8f844cb7ca873f5f5d174 WHIRLPOOL 0317c64e1194373ff5b7c1a0fca7989615d7cb9c5f41103121820b980d2ba749140613a45eb294ea18a2e038c641fe03627f6d13c547bda52b6020b307500462
+AUX palo-1.96-toolchain.patch 742 SHA256 4a1365d6d66f59276b3f88eb43ee51ffb36a9315ae60984865ca216741aaaf27 SHA512 3b095d9cdd77fc9cc06731cccd2d7048bf18ba9e0348b74a0b77291dc543979c2107bc44a56b6820844c20cdb921bdebb8d4eb115246b2a1e6da073953cc1ce1 WHIRLPOOL 053e1d54e0acd82d03eb0ad866971a6dbcb0302c5812f98ab4242f45aa8c1f4400543d7509e523bc6bc1cb217c63e1681ff7a5b196f39e9498bf943817509f21
+AUX palo-9999-toolchain.patch 607 SHA256 db4fa4cb5f510331c329738af4e88f638ba0d5c617f0e23837dd856dbfaf5dee SHA512 8ef234d83d0c09c4a43f802990f5fa5638525d7ce05c89c6ae57871a076a840a09085ac05cce490d5c4ff94466fccc83650f39ab1d5ab94ea6b4f4825c77ab9d WHIRLPOOL 61d2f815d06c64bdb5c43d2a70d3535013bc93842539cbeda32f053b911fb9bcfdaa206f1bd9c7f2d4885cebc4690faa3047daccf988566caa007a1840c36496
+AUX palo.conf 260 SHA256 69d78cebaa80d793462670843a526497b1974668a4bf00a73433fa532627df43 SHA512 4147e480362161cd61ad9af8fb7048b87f9126c213661ab26f77ba98fe7f1acd03791b154667137e4a265e3c31e54e703d32daa86ff0805f47bc7c1b8b03cfe6 WHIRLPOOL 6152ff995d9aedce74dd0deada4731320e22095f8ab560e588d588f7cd57345a174cbcee3beaeb779748f71b69e285c93ba4b28fc321caf1fcc36a544a76e886
+DIST palo-1.99.tar.gz 123906 SHA256 6880524b44689d90d9faf9da111ea15f1da210d9d7325591085f39c6a7650483 SHA512 b859144a5b145aa47d44926b69172818f1fdd577958649d72a99be26dd68d4e2f366acfaec406c8d09ac751ffcdd380b70606e4f3f66e42328d387fcd9022b73 WHIRLPOOL e1768dda1f964044b80a870a37fbf872070a4d864bed10b0c29cc20d9e9d6bb3f030d623b55f766167e4af74af1c3809e63db5e7ecbac4f761f15fd250faedba
+EBUILD palo-1.99.ebuild 882 SHA256 2d4e065e50a434cb799bc17d53fd1ef47738dcbbd37219e4f53cd625963270ea SHA512 4c2e26fa3b2a43b2fa20e0236485053a772364662d6b9a3f92994d427cc3382b00e0505b1f538e155e13706d01984884fe8505e50601d32a423571d815c98698 WHIRLPOOL 7e406911dab0968037090c57c0cca1bc58924e872af42264f37a46a15b56b8a42425adc03f61a56ec9568fc08e724a8327e60bbf036d296479c64c1f66f6ff26
+EBUILD palo-9999.ebuild 968 SHA256 b53fe7fcb4fdd47812ca17b13114119905286b123b419e1dfe359dc8d739e314 SHA512 373154c2d8f19d8b64f5504190f97d8fce42fd49fef7503e5f5179ca3d7b9c7f5c7290ac09b46a79285a0983d6f5820008486aabf0bab1ae82195b8d30cab609 WHIRLPOOL 7adda896ab4ae78bfd5f50b09e4a67b13596b74bf140c16f9d4e050d133fc1ff9ece59bda9566c8fbcbf724d97f1a5995989449ddd65ddf7b41f6c242bf91890
+MISC ChangeLog 4015 SHA256 92f0807c55fd7049b34d70dba20a504056e705d1fc25ec79ccf382d8b476730f SHA512 f94fdbf53d5336f01d3b1a95432eeffbd9dcfdf0b9968d71b32e5a81b38d90ccbfd39156a823ec1e2dfbb2d2f1c52850314f1018cd1b7f23cd8e5d92743c0a04 WHIRLPOOL 84eb56939d5443f045c8eeb9ff41f472c236d2173538558460128d0941a9b904da5e3ce6f4ffe2d05a17276ec073f913db5727c89fa32ab7dd52666d973677dd
+MISC ChangeLog-2015 7958 SHA256 504b034f12b8c4c1fb006a3d4b529538e3dc10468c2ce312e0bb69b1f3c740ff SHA512 75511abb64454d5f539c0b4791753e2f69f7ce5264075c4400f0b1d468b4f7acc7336dbcd59e2208ac28e40a28d5309312568f812538d3762817090a5db618ae WHIRLPOOL b96d31c9802409e77078f827564b2f6b1ea1bff20d79d82a3858ac134e9879f296527547667b1404ae80db73cf6639c4b8f1c240cb33a8435efe336f271954f7
+MISC metadata.xml 318 SHA256 027a481bc6445d5dd066aee6e72ddd5791c464ef3da00d85d8ab21c9047742eb SHA512 7ff12a5eb42ac39840f8c9eb78b24aeecd9cbfe780d11eccd75fd6f02b11f4abafd514bc32f47f727047b069e446e9252914dcaf5c33d6f1054981a3c175fdef WHIRLPOOL 5e20ecd63018dab5814d27ad3b98bb762248734a3fb88914ca163afecb93e66183f6661cb225ff191bf1f2619585d108f2060a2bc6df505146e7a0e3a29ed2f1
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.96-toolchain.patch b/sys-boot/palo/files/palo-1.96-toolchain.patch
new file mode 100644
index 000000000000..5b9e792bf049
--- /dev/null
+++ b/sys-boot/palo/files/palo-1.96-toolchain.patch
@@ -0,0 +1,31 @@
+--- a/palo/Makefile
++++ b/palo/Makefile
+@@ -10,9 +10,9 @@
+ 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
+
+ ifneq ("$(wildcard /etc/debian_version)","")
+@@ -22,7 +22,6 @@
+ endif
+
+ # LDFLAGS=-Wl,-Bstatic
+-LDFLAGS=
+
+ OFILES2=mkbootable.o elf64.o load.o paloio.o elf32.o error.o gzip.o
+
+@@ -38,7 +37,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-9999-toolchain.patch b/sys-boot/palo/files/palo-9999-toolchain.patch
new file mode 100644
index 000000000000..12b9c5e73b6e
--- /dev/null
+++ b/sys-boot/palo/files/palo-9999-toolchain.patch
@@ -0,0 +1,23 @@
+--- a/palo/Makefile
++++ b/palo/Makefile
+@@ -10,9 +10,9 @@
+ 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
+
+ ifneq ("$(wildcard /etc/debian_version)","")
+@@ -38,7 +38,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..f6edb0bcf440
--- /dev/null
+++ b/sys-boot/palo/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 type="project">
+ <email>hppa@gentoo.org</email>
+ <name>Gentoo Linux HPPA Development</name>
+</maintainer>
+<longdescription>
+The PArisc Linux Loader
+</longdescription>
+</pkgmetadata>
diff --git a/sys-boot/palo/palo-1.99.ebuild b/sys-boot/palo/palo-1.99.ebuild
new file mode 100644
index 000000000000..ad697b0c5b8e
--- /dev/null
+++ b/sys-boot/palo/palo-1.99.ebuild
@@ -0,0 +1,42 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+inherit eutils flag-o-matic toolchain-funcs
+
+DESCRIPTION="PALO : PArisc Linux Loader"
+HOMEPAGE="http://parisc-linux.org/ https://parisc.wiki.kernel.org/"
+SRC_URI="https://git.kernel.org/pub/scm/linux/kernel/git/deller/${PN}.git/snapshot/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="-* hppa"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-1.96-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
+ dodoc TODO debian/changelog README.html
+
+ insinto /etc
+ doins "${FILESDIR}"/palo.conf
+
+ insinto /usr/share/palo
+ doins iplboot
+
+ insinto /etc/kernel/postinst.d/
+ insopts -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..2d47d63af700
--- /dev/null
+++ b/sys-boot/palo/palo-9999.ebuild
@@ -0,0 +1,47 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+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=""
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-9999-toolchain.patch
+)
+
+src_prepare() {
+ default
+ sed -i lib/common.h -e '/^#define PALOVERSION/{s|".*"|"'${PV}'"|g}' || 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
+ dodoc TODO debian/changelog README.html
+
+ insinto /etc
+ doins "${FILESDIR}"/palo.conf
+
+ insinto /usr/share/palo
+ doins iplboot
+
+ insinto /etc/kernel/postinst.d/
+ insopts -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..3708caca63f8
--- /dev/null
+++ b/sys-boot/plymouth-openrc-plugin/Manifest
@@ -0,0 +1,5 @@
+DIST plymouth-openrc-plugin-0.1.2.tar.bz2 8909 SHA256 029f469440ff95b0f8d256eb172fbfccf064101b0f24e8d38cf8721980124dfe SHA512 a6c578dcdcc770cf55cf150fbf67e99ef4fac08db17fd8a84ec5f76f96172aa4cb071a0ee695a6d6fe6883e5117c95b096ba5ce8260d71bea33a26909719457d WHIRLPOOL 6d52794857a100955d36a724896118d4b731aecb0891520e1f4ebd460714efbe40f9a160d26b34b1062b13dd64d73c368e9d572e9546e1de12db532ac13dfff2
+EBUILD plymouth-openrc-plugin-0.1.2.ebuild 1108 SHA256 c487248aedcb6758c9201ac2358527f01d8f3492f3167d795dda62b9950d871e SHA512 f8acf79f24c102d45ef0d2a65070100b750187b4b2c2114c65981628e3b6ef9671555394ce8559c4d1bf868cc93407405ac826259cb06bf7bc19d2c0ba167b0c WHIRLPOOL 74e94b68afd968c380fa2b94bff29fb1541edfdc94b7cad0e4b0ebb3d85d3443ad7d17fac2a71524612765a7d21d97d76608b06b19b324116cf7962d52e0a0fc
+MISC ChangeLog 2606 SHA256 10c05c4d13d712ceb72edcfb2d500d04bb3047c2661be8d5eba42626ab896819 SHA512 2b286d8091f16083f01c5e017abc37fba6f330f0c7331ec0cd3e475b88d2f3afdeb252762e44a00196d862a1a93cf1c441703bb48555c1de90cb488d81aa52f3 WHIRLPOOL a6ced6e5081c6494e0af29cebf662951dc7da61f7632aef6180acfca0ff52d0cc3e378e5b86143442554248d98a61994a6d325713565f5441dae55dc67401c82
+MISC ChangeLog-2015 3000 SHA256 97bfef619e9821f9ad2a1dc1e1b453453d7e1901b6b1c058ab0b247f46a5d3ff SHA512 d124d96d72057efb86e4213962bb96fa0a9fa79ecbbf543bd908a4f114e0ac7c9a35b4dcd007ba793ee42e0595d8137c971b55b0a3da2fdc9adda057ebe6964e WHIRLPOOL 0cd6eb78af6561f4c6c9e23e7016ac0136f2873c77ca4ffcd1be2f11d35893a4964437d076cf24f322b1c500b0f8791c4b6fd6139b77c70a4a26c2be32fb4665
+MISC metadata.xml 262 SHA256 ac25846d43e082204d1faa36a7019f76c35d73751e7b1710fd8df9bffb40b2dc SHA512 062bc7259e7fdd86c288426f96c43713cdbbb9f39a32a314385131e99a2bdd36700925898d516bdfbbfa87475106ef9fee3ac1c41209a4cdb510e6ee8de74e7c WHIRLPOOL 25b0f822e101c8bafae8ea7c2352a70f96410487c09e56c479aeffcd42a3050d2ed847ecd647dcc439effb40539846dc7f88bc65ef6552fbf4492f73bde52bc2
diff --git a/sys-boot/plymouth-openrc-plugin/metadata.xml b/sys-boot/plymouth-openrc-plugin/metadata.xml
new file mode 100644
index 000000000000..c6a8cf3f96bb
--- /dev/null
+++ b/sys-boot/plymouth-openrc-plugin/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-needed -->
+ <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..ac212491c9e0
--- /dev/null
+++ b/sys-boot/plymouth-openrc-plugin/plymouth-openrc-plugin-0.1.2.ebuild
@@ -0,0 +1,41 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=4
+
+inherit multilib
+
+DESCRIPTION="Plymouth plugin for OpenRC"
+HOMEPAGE="https://github.com/aidecoe/plymouth-openrc-plugin"
+SRC_URI="
+https://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..d8dca66fb091
--- /dev/null
+++ b/sys-boot/plymouth/Manifest
@@ -0,0 +1,12 @@
+AUX 0.9.2-systemdsystemunitdir.patch 798 SHA256 634295951d39df12cc1e282f175ed992a0a559640b1ba6c54539d7b03e614f32 SHA512 5855dfdbd2031b2b0c91991261eda01f310f55ef5526d6a29ae77ae7a6fa1d9431201f05db4cc0ae9f2f4b31575c19316e36a8d4fd9596505fbe0d8d8b847ac7 WHIRLPOOL cd898e9c85469423fdba0de9d893841726b9b360ffea0677f9a9629f5973f7ac28b5dfeeac3c8692a74dc5d307e44b74869e9b74fdcc1b8036e16c240a4a23d0
+AUX 0.9.3-glibc-sysmacros.patch 1170 SHA256 9ee95fa011ab0f4ea686e5252a6348d8e47de537255e6d653191080367672dd8 SHA512 82f40cd6ee78904e3ca2ed594c923a11c1a6015e56bfafebf035c25287e2c1708b87901c5b68c04aecf4d1891124d58ab6b3c84ba0e12c5bd5d69dea24bc49d5 WHIRLPOOL 6e4f3b34a997482c77c16ba0cbccc3eec4e09bb1dbc9906f3bb9481c4ef005afb6ace2463d89eabb2717da73dea1f6082d476003b287d2635e5646e1853bdf74
+DIST gentoo-logo.png 14501 SHA256 79ebc1d66693371a90e218ad421cfed05066b51a6645bd967bb7da356a0881fa SHA512 059a555931b6d2a910bcd887f5ea0cc17c6edf2d2d45c03a1fec1bdda0138ba6bca6bdf90a65c6520a3f8f1b51ecf6f7956098f45ed6c1276f29c835e729163c WHIRLPOOL 65496223badb9a96cc72ba6a2432860af0756eea57f67946d2466ff1c3c1171c84568c502aa576613b77767c41cf251856728b509c72003567d4cebd1943375e
+DIST plymouth-0.9.2.tar.bz2 1231336 SHA256 2f0ce82042cf9c7eadd2517a1f74c8a85fa8699781d9f294a06eade29fbed57f SHA512 89356eb8326504fbf3155de262ce15de0847f0a0e6d157d873cf1dea9af464a6cb9e11d7143ee9a595b217a2487060b5835eba5ac142c3cd6d66689deb272e60 WHIRLPOOL 5f9e662dec633bb606cf4246611b442a0eb9eaa92942b37c53d1c48b6ca8ef96c5f4330d574b82de6a026ca175a770c1a45f52c7809c80d026126d805e707eba
+DIST plymouth-0.9.3.tar.xz 1102724 SHA256 9f8dd08a90ceaf6228dcd8c27759adf18fc9482f15b6c56dcbcced268b4e4a74 SHA512 d7b9ba97485cdac7ad6bcaf5a7f1a9c84ece54b8d46d5efce4170294c0aa6571656d7d9957b53aed9c1e51d4d525714f54b7dbb08d8ec0b196a1a4419fd186ed WHIRLPOOL a7ccc870fb6149da21873ec92b241f564ce76ee0319a626a423ed1f77820deb0d09ed52bab86fdd501a4827dd02bd7403e78af1cbbd4e9f77fc9bda57ce59fa3
+EBUILD plymouth-0.9.2-r1.ebuild 2494 SHA256 8d36fc90c9c33d4bf0f12d325748897025601d19c629db145fb46b02574cf719 SHA512 4413aec2441e4466eaf308f352264abd9147c3eba073affe7b9e7ba84f97169f6be605f64e73c28b83b664699c981349c345576b855274cee9942f490d644435 WHIRLPOOL dab5a053134a27795587cc08a2a3e877b5189d02b7456d94b0c4d5b4ce78c98c26c0a1daf8b477ad63ac1f7aa07b2ce4d235720d0a8dec851b6881a9f2d6fc11
+EBUILD plymouth-0.9.3-r1.ebuild 2547 SHA256 9d24e9afe4658579ba4eb352ad8af5c5dc0e8f9ddc64457a4bfee35b36f91242 SHA512 7b575637ab6f36faba8d8fbc864b15cdda588db146ef76daffd3b9ab6e352c3fce0a3357240d9a7220b1390cca68d0f1db18f6fbace5bb30fbd901afd91021f2 WHIRLPOOL 5b476495e70f76f99872d2917ba662124da504498ae14ff642c8abada9764df58660dab29ba4e67ada8ff79cfac7183bace90fbd59db21f00753c5b1d5487796
+EBUILD plymouth-0.9.3.ebuild 2432 SHA256 6ebf4f4938458405e48b271c6d19fb4fe0ad40591571dd3bdb9e3bb94890439c SHA512 65c076ee35d7d49427c5bc9f345c06bf7d7b85fbfc2fb5ab575d02a87b9037c3ee8311452aa2d78ebaf5e16af9c35b43b1349f1b949ebd056a3d2d33ddb6b7ad WHIRLPOOL 07bc72daa421e01e610820a4271cf410949c9e9775cc011e6da0cb3a76ead2e0f62a63fbbd2f68f0cd9a005dc345a0b51daeae97e8622bc3f8543d607807486a
+EBUILD plymouth-9999.ebuild 2481 SHA256 f8887533c1ebe597190b773404df95d92f4c09ca7d897aecf8e95b0c00b2abca SHA512 7357f1f65af91ccd2e13698d46292cebcbdbb952291d139128bfb76067968ad4756632fec75fcdadb914a0fd9a3d5cbe8e774503f0eac4cd98c858f5803239f9 WHIRLPOOL 8e6e5bc58d6c4dd1da75faf94822512d85ebf409b7cb53a99c826defb02e26db2b7842b0eb1732cb4c0d1fb0a43596a1401bb22d7648f014e98312c259f914e1
+MISC ChangeLog 5141 SHA256 1bc72234866d8ee0d4e1be6111a65bdb66f3420757e321077e01a105270b128d SHA512 ae63be932052c734edf101b234bee278a47843216c2263291ab7290e1b11b4e8e529b64eedc6e4a41426464e582e6447a93566dfe87972974bc7d57ac1cb7b5f WHIRLPOOL 268716a75b25b8982b0d49bf12f5c7ef02a078da9f93f4cb67d67bc90ab5e249d3de454404c16ec3b3fb5a93ab15da2e15e5b47d67c0a132295a8bd5426c8259
+MISC ChangeLog-2015 10655 SHA256 9da896a41fca4ad1508bc50659e40837949bab82e16afbe81fe7be8b10cfd64b SHA512 a9a05c1a468b144e2cafb5a42ed05d4da52441d4b9e455fee1f85f59ad09f1b929994ade0475c64e4398a48c442943d845c74dc16421ba5893040d880c83fbe0 WHIRLPOOL a68f93cb692cd7f2db5c6c5ee76d95754dd678cdc2c5bb7400cc87c46acf285636b315d60df9c22a01db8c534f5e2b9cc2447091a80da110e9dc56a8e3231dd6
+MISC metadata.xml 1154 SHA256 b6ab0784e3d7939e67aa58eefa72aab3a98024edfea298cbcd305e0fbca3ad38 SHA512 aa809296ffaf68e481a09ae75c1500bf01e7474dca0990cdb66182881d5bff269aa19c60a022e37157330a52c5319410061f0209cc08128828981a46f7dc1b4a WHIRLPOOL b45e9f7128c5b7bb38fc9a47aa2a97b42a7996410ce7202dcd6f49b6746ff12949490d201f60d97d618f0e312f84381620765c6800e96bf21eff2f46ad6c3d36
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/files/0.9.3-glibc-sysmacros.patch b/sys-boot/plymouth/files/0.9.3-glibc-sysmacros.patch
new file mode 100644
index 000000000000..8969161bb195
--- /dev/null
+++ b/sys-boot/plymouth/files/0.9.3-glibc-sysmacros.patch
@@ -0,0 +1,45 @@
+From f8d7813b32dfe129d1e5718719ee3eff131f4fac Mon Sep 17 00:00:00 2001
+From: Kjell Claesson <kjell.claesson@epost.tidanet.se>
+Date: Fri, 18 Aug 2017 00:25:56 +0200
+Subject: [PATCH] Fix build with newer glibc
+
+Signed-off-by: Gilles Dartiguelongue <eva@gentoo.org>
+---
+ configure.ac | 1 +
+ src/libply-splash-core/ply-terminal.c | 8 ++++++++
+ 2 files changed, 9 insertions(+)
+
+diff --git a/configure.ac b/configure.ac
+index c32697f..8376789 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -5,6 +5,7 @@ AC_CONFIG_AUX_DIR(build-tools)
+
+ AC_USE_SYSTEM_EXTENSIONS
+ AC_SYS_LARGEFILE
++AC_HEADER_MAJOR
+ AC_PROG_AWK
+ AC_PROG_CC_STDC
+ AM_PROG_CC_C_O
+diff --git a/src/libply-splash-core/ply-terminal.c b/src/libply-splash-core/ply-terminal.c
+index a0954f2..ef62bf8 100644
+--- a/src/libply-splash-core/ply-terminal.c
++++ b/src/libply-splash-core/ply-terminal.c
+@@ -36,6 +36,14 @@
+ #include <unistd.h>
+ #include <wchar.h>
+
++/* major()/minor() */
++#ifdef MAJOR_IN_MKDEV
++# include <sys/mkdev.h>
++#endif
++#ifdef MAJOR_IN_SYSMACROS
++# include <sys/sysmacros.h>
++#endif
++
+ #include <linux/kd.h>
+ #include <linux/major.h>
+ #include <linux/vt.h>
+--
+2.14.1
+
diff --git a/sys-boot/plymouth/metadata.xml b/sys-boot/plymouth/metadata.xml
new file mode 100644
index 000000000000..22a2251fe995
--- /dev/null
+++ b/sys-boot/plymouth/metadata.xml
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>prometheanfire@gentoo.org</email>
+ <name>Matthew Thode</name>
+ </maintainer>
+ <maintainer type="person">
+ <email>eva@gentoo.org</email>
+ <name>Gilles Dartiguelongue</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.9.2-r1.ebuild b/sys-boot/plymouth/plymouth-0.9.2-r1.ebuild
new file mode 100644
index 000000000000..e0c922e5449d
--- /dev/null
+++ b/sys-boot/plymouth/plymouth-0.9.2-r1.ebuild
@@ -0,0 +1,100 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+SRC_URI="
+ https://dev.gentoo.org/~aidecoe/distfiles/sys-boot/plymouth/gentoo-logo.png"
+
+AUTOTOOLS_AUTORECONF="1"
+if [[ ${PV} == 9999 ]]; then
+ EGIT_REPO_URI="https://anongit.freedesktop.org/git/plymouth"
+ inherit git-r3
+else
+ SRC_URI="${SRC_URI} https://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="https://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
+ https://wiki.gentoo.org/wiki/Plymouth#Configuration
+"
+
+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-0.9.3-r1.ebuild b/sys-boot/plymouth/plymouth-0.9.3-r1.ebuild
new file mode 100644
index 000000000000..eca80c890f83
--- /dev/null
+++ b/sys-boot/plymouth/plymouth-0.9.3-r1.ebuild
@@ -0,0 +1,99 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+SRC_URI="https://dev.gentoo.org/~aidecoe/distfiles/${CATEGORY}/${PN}/gentoo-logo.png"
+
+if [[ ${PV} == 9999 ]]; then
+ EGIT_REPO_URI="git://anongit.freedesktop.org/plymouth"
+ inherit git-r3
+else
+ SRC_URI="${SRC_URI} https://www.freedesktop.org/software/plymouth/releases/${P}.tar.xz"
+fi
+
+inherit autotools readme.gentoo-r1 systemd toolchain-funcs
+
+DESCRIPTION="Graphical boot animation (splash) and logger"
+HOMEPAGE="https://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}
+ app-text/docbook-xsl-stylesheets
+ dev-libs/libxslt
+ 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
+ https://wiki.gentoo.org/wiki/Plymouth#Configuration
+"
+
+PATCHES=(
+ "${FILESDIR}"/0.9.3-glibc-sysmacros.patch
+)
+
+src_configure() {
+ local myconf
+ myconf="--with-system-root-install=no
+ --localstatedir=/var
+ --without-rhgb-compat-link
+ --enable-documentation
+ --enable-systemd-integration
+ --with-systemdunitdir="$(systemd_get_systemunitdir)"
+ $(use_enable !static-libs shared)
+ $(use_enable static-libs static)
+ $(use_enable debug tracing)
+ $(use_enable gtk gtk)
+ $(use_enable libkms drm)
+ $(use_enable pango)
+ $(use_enable gdm gdm-transition)"
+ eautoreconf
+ econf ${myconf}
+}
+
+src_install() {
+ default
+
+ 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.3.ebuild b/sys-boot/plymouth/plymouth-0.9.3.ebuild
new file mode 100644
index 000000000000..ea9aa1bd7d6b
--- /dev/null
+++ b/sys-boot/plymouth/plymouth-0.9.3.ebuild
@@ -0,0 +1,95 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+SRC_URI="https://dev.gentoo.org/~aidecoe/distfiles/${CATEGORY}/${PN}/gentoo-logo.png"
+
+if [[ ${PV} == 9999 ]]; then
+ EGIT_REPO_URI="git://anongit.freedesktop.org/plymouth"
+ inherit git-r3
+else
+ SRC_URI="${SRC_URI} https://www.freedesktop.org/software/plymouth/releases/${P}.tar.xz"
+fi
+
+inherit autotools readme.gentoo-r1 systemd toolchain-funcs
+
+DESCRIPTION="Graphical boot animation (splash) and logger"
+HOMEPAGE="https://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
+ https://wiki.gentoo.org/wiki/Plymouth#Configuration
+"
+
+PATCHES=(
+)
+
+src_configure() {
+ local myconf
+ myconf="--with-system-root-install=no
+ --localstatedir=/var
+ --without-rhgb-compat-link
+ --enable-systemd-integration
+ --with-systemdunitdir="$(systemd_get_systemunitdir)"
+ $(use_enable !static-libs shared)
+ $(use_enable static-libs static)
+ $(use_enable debug tracing)
+ $(use_enable gtk gtk)
+ $(use_enable libkms drm)
+ $(use_enable pango)
+ $(use_enable gdm gdm-transition)"
+ eautoreconf
+ econf ${myconf}
+}
+
+src_install() {
+ default
+
+ 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..49ce1012fe83
--- /dev/null
+++ b/sys-boot/plymouth/plymouth-9999.ebuild
@@ -0,0 +1,96 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+SRC_URI="https://dev.gentoo.org/~aidecoe/distfiles/${CATEGORY}/${PN}/gentoo-logo.png"
+
+if [[ ${PV} == 9999 ]]; then
+ EGIT_REPO_URI="https://anongit.freedesktop.org/git/plymouth"
+ inherit git-r3
+else
+ SRC_URI="${SRC_URI} https://www.freedesktop.org/software/plymouth/releases/${P}.tar.xz"
+fi
+
+inherit autotools readme.gentoo-r1 systemd toolchain-funcs
+
+DESCRIPTION="Graphical boot animation (splash) and logger"
+HOMEPAGE="https://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
+ https://wiki.gentoo.org/wiki/Plymouth#Configuration
+"
+
+PATCHES=(
+ "${FILESDIR}"/0.9.3-glibc-sysmacros.patch
+)
+
+src_configure() {
+ local myconf
+ myconf="--with-system-root-install=no
+ --localstatedir=/var
+ --without-rhgb-compat-link
+ --enable-systemd-integration
+ --with-systemdunitdir="$(systemd_get_systemunitdir)"
+ $(use_enable !static-libs shared)
+ $(use_enable static-libs static)
+ $(use_enable debug tracing)
+ $(use_enable gtk gtk)
+ $(use_enable libkms drm)
+ $(use_enable pango)
+ $(use_enable gdm gdm-transition)"
+ eautoreconf
+ econf ${myconf}
+}
+
+src_install() {
+ default
+
+ 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..1af681ba1332
--- /dev/null
+++ b/sys-boot/psoload/Manifest
@@ -0,0 +1,5 @@
+DIST PSOloadV2.0_Linux.zip 384266 SHA256 11037f249df41bb5548500cb0d2fae7fc5163b0f5065064fcd71709d8b5602bb SHA512 21daf5f3889666980eed9f712cacd9544bb0c6380ea7059b14f7df793ab8cd2db4ba6f6cfc6b555a33372b79d82ff4ce34d50b359d899c1546219df763938784 WHIRLPOOL 687935b1257172b479f99f4ea3170f5c4e73a98a3bb3a57dab747e6c28a7bda48397d02775635f5d79afa7d850110300fbcdf971a55be66dc422eb22c45bfdff
+EBUILD psoload-2.0.ebuild 566 SHA256 a7dd38214c5b5b43adf5d95cb3cb80b69258baad703162594debf333157701ef SHA512 5c62e3145ac95ffc68e70aed758190851da720508eb7f87250ceb3e584e17091cb1c38abdbaf5c4310663fcf1cc52a7cb4ded4b091daf941fc67fe2903e42f04 WHIRLPOOL dea4b917cc2cee085d8915eb6f20b2961066212c7bfa8c647a8aa36fef1aca14926aaf3e1c0fde946988f2b276c00ffc0ec95ffa56ef78817e95aba58f832ed2
+MISC ChangeLog 2518 SHA256 d03cf86c98db91a235698bec604ca81dbf9565b7a4bbd3c3fa88fb5cca913e3a SHA512 abca3706918e25474b8d273089d9e57a85ab00249ce7e26d8ab81611977c5520be74979292b5b1d7e6187dc9dfe6a36962617fb0cb6e7400a7a3e30cccec85f6 WHIRLPOOL e188892a5b1ffad261b6936a776518da24d3ed428c297569041587baade125e7dc2ca694b82291da0fa21364f7550b051fd75847c0ccd82834b4b7381394aaba
+MISC ChangeLog-2015 550 SHA256 a8685c48df543633b3ea28542337e39c9657eb5a628ac1d11f297dee34505344 SHA512 f9e972203327b36c92f102a3e3c6be0656f7d207ec69f97fa03043f8266040fc8c393057c4991878912840ab74498442a1fb275c0a24e1cb1a9e59566da8f74e WHIRLPOOL 30864fc4da21b80304343b60d288899036797f0ef1c1f214ca17c38efc1e2597f7026c37072f9376752bba92a258d26ce5dadd1061c45d005b538bf6746e8880
+MISC metadata.xml 166 SHA256 2caff447f5bd2701d8456ada5cc633c41ef4373fa4bfeabeb73599d40bcc941b SHA512 a56648c974a1d14dd4c18237532773c72057a13ab90c58b5da04f185e3c12a8bd8d5c21fb06053507f31766291a82dc7d87b34cd65fd94cfe2af7295c813ef84 WHIRLPOOL 1ff70497eca6531f0e0614c72a19f4b8e5ff486a58d369f4f0b36308d1d6b01168f9da887740e3b9f536236be251d3fe05f904d27a9233a7cf613416ba882968
diff --git a/sys-boot/psoload/metadata.xml b/sys-boot/psoload/metadata.xml
new file mode 100644
index 000000000000..6f49eba8f496
--- /dev/null
+++ b/sys-boot/psoload/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<!-- maintainer-needed -->
+</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..d81b7aa74395
--- /dev/null
+++ b/sys-boot/psoload/psoload-2.0.ebuild
@@ -0,0 +1,25 @@
+# Copyright 1999-2009 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+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..e7f53b13dda6
--- /dev/null
+++ b/sys-boot/quik/Manifest
@@ -0,0 +1,7 @@
+AUX headers.patch 991 SHA256 3ef7f4ef85e8f210a82e4bb96e94e5c61b59cef119ca1cec7656746d3a83e2f6 SHA512 8cc1f3e41248198bb08c3f70d00e340318bdf11d9d03a8c76eba2a88d67a40265f31ad6b77076b597e37edce5fc64943d09d7d32551b179a598261c6691fc01e WHIRLPOOL bd3b30b97cb11464866694f1e9f074cdcd61dbd3398f85803dd716bc57c7c693d3aa2a1bafffaf1dc6da5703f6f5b4fd2daf636ccbf1edaee29c38c8e776c552
+AUX md-fix.diff 392 SHA256 6529d6b01a17e5a2a0cea17358c3c8376e1ef4be6d3943bcb0e39d42715a264f SHA512 b118693bb6c230fba7e371e3de2ae19f2d82760558b27e12c8bc4d3e1764225c1120104e11660ab2692b39a65e9b574af599cec62e81e7051c73e102acc6a2fd WHIRLPOOL bae80888b2ac71c7882633a4fdb444575c78b33ba9c5971eb6239fcf3ac1e41c1c1fc14d911069a51ff3cbf360a6877681d2a052839db686ae5725bbd5190939
+DIST quik-2.1-6.ydl4.src.rpm 91961 SHA256 a4c8c95fa97ef0e01e7ca981442c8dc8761f79c9bc4c683bfde03378a8ee9db2 SHA512 92cdea02afd5053fb51b390e79f4d2d404691be5de9ea3d9c88739fc4fa993b68a017be10ff1b5fa359f8c5493f34d0d743975f5ce99525bdaf5921b0146aa63 WHIRLPOOL 6326c38729dcd871858c75d74539b9d02c815b20b47825d0134d609e9e9be67e3ef91add7a4e7932ce105a6e4ac60a055489f3be285aadd6879b0a462b06597a
+EBUILD quik-2.1.6.ebuild 953 SHA256 f9b2a42c169e491a7c4b2f2fa4073f9e83e59ed8f07fe56b195d0e7e837419f4 SHA512 cab21263f9831ae8994dd8a532060e7a2f6c2cb77371b3c5b5d47d31cf591dc3e2c9b333a310ec44c500d82449f5df3fabac5f27fe03dd3684409cc1e199a8bd WHIRLPOOL 49baf10ab010627061dca1e459af3c84acec5fd61052ff8375ac49f076a49c50b8239d7b9483e15e7f011a107ea97c069473135573882fe72800db3ac2c15d04
+MISC ChangeLog 2460 SHA256 f3e2f93bf1ca69112571e3006b01e1726b8dbcc36a54e1f0444152e9f397529d SHA512 3bd2569005f069aa0af9b7f7ef68d85524391675c1953d0f30fb99e23ecc76bb7c58070f2e2467faced14d147a8587fa38d456f4d9a43d3a2c19898cb32db37b WHIRLPOOL f8f0745df0536807271a65f1f6a2a1c5f013e5c477a057b437446eb7d509c73468de1334da55ad896ba035729d509e89535b662e4949cc87beedc2006f569958
+MISC ChangeLog-2015 3665 SHA256 1bf4772423062fadce9cc2bc1da03879c890870826963caca75a1b1a224ca598 SHA512 972a611ccbb8626a773b3d436460773330aae20f2b461698c2e0271831e21e65df2a30b88e9b0dfcece6bf85643ae779078128ca51f062705e58782eb7814452 WHIRLPOOL 366b9be1da9dc3e83efaa3f5fc9bbd8c15aee4b3e185192e917129b19c55f62e5a73543a71dd0df63a1ff92cdbc73e93c9d03278d9d7f026a77af7390d9d462e
+MISC metadata.xml 259 SHA256 e7ac6b67c4c89040a00b23bda7a3b2fd4ac8affc1055daf3015ccc8580640f6f SHA512 ca71b1781806d20022c238e5b5d10f9154c78e0fa51f2603de34c48ecbe4cbc2c3190cf046526840546743644c691ee7fe51e31a4617b01bb7602dde803c1538 WHIRLPOOL 2a2aa19a448eca4dea84d129fd194a7ee4d77bdc1b5120abd3b667ce156cdeeb4616a7c7cd23fbccb7ba08e6e166aaba0fac63a6afa208d826acee37b0e560fe
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..5eb05198076b
--- /dev/null
+++ b/sys-boot/quik/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 type="project">
+ <email>ppc@gentoo.org</email>
+ <name>Gentoo Linux PowerPC Development</name>
+</maintainer>
+</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..0b14ed0098cc
--- /dev/null
+++ b/sys-boot/quik/quik-2.1.6.ebuild
@@ -0,0 +1,43 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+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..da892012e4df
--- /dev/null
+++ b/sys-boot/raincoat/Manifest
@@ -0,0 +1,8 @@
+AUX raincoat-0.11-build.patch 420 SHA256 bc623106cc4257ba53a73e044224cf71846850168a8ec93b0d2d9015b307395b SHA512 fb1d0735e9f29ce5173fd2eb7467527d025146f235b3930973e9a0b91d3a8015909bac506fb17c16da447ebf08d6ca366622c845cce08d40e8743398773255b8 WHIRLPOOL e050e5e87e59063b11f0650ff2aef936bdd20923d9fa5a654953053e11c77e514c3cafd7830e870ed733ac7c07d176e62a5a909e98ad6338efb8abea357e5245
+DIST raincoat-0.11.tbz2 240759 SHA256 3d0b2ae95880ea7053b58a9852381ef81b7d0839153e9a164e78531b22cc24bc SHA512 acd56386f8b0de2b2e268b62304e5b1323a96865394993fb76004c92c09992185b6fe6c7bf2d001ff5e5f2cc7e067d9962229aceb17838f7661890f5b4c4b2f1 WHIRLPOOL 10049ea8069987373f5b75ce20317c52bc66fe63140993eeab17651c0b4fd660efb132c06a483efba9fb33df6e5614021c06b766ba5dcf944ffba50c0f5d4a89
+DIST raincoat-0.5+.tar.gz 220761 SHA256 b7a357204b482021282f7ea05a9413162491ae240d4bb932ff249a8604ec57bc SHA512 5e99b2ef2ec6a2cfdd6a26115f607e122df5a973c677cdf0f971fd1a82b2a01888feabce670b7956a6cd1e03b56fda462b305416c68175170dba1b3bf340da12 WHIRLPOOL 0eb77c242bd7fdd3554754f459c26c5d6fbf1a04a6ef5a849440063dfab9b3e1d76b2b548c84be669d3ce11849c9ae58a1c2257593a6aabe5698cf01f02672f0
+EBUILD raincoat-0.11.ebuild 530 SHA256 290037927cf4f1df0957666c2533e0c0b4ea265ccd5f18e29ee1baf0db3df3e2 SHA512 8ec38bf7dcc7def6b29de50086477a93464a25950d7514850ceb6ef2423794b9003959f8aaef25cd8d5b3e0790fe449f4ea9fd179caaf8eb68d2e4d5969a3ab7 WHIRLPOOL f249b76e41ba7852eec3d589e004574182b77ee21235629b850577ac50d44b06c0704900d88ff867e8579d7866ea69ed8495888096a31126bf32cc6cc036a09a
+EBUILD raincoat-0.5.ebuild 475 SHA256 8f3875da0076955d3eebc56b3da2b61e8c8f3c36e730e660f0412b7aee33f31a SHA512 e4262584572f0abab5deeda99effea935f880a069e1bd9151e420b3ce2e810d588ea328bb6beaaf774f0296d57866ca513492c89d6d8304023c9237bfad6aa8b WHIRLPOOL dcba503efbf0af6e5c4e5bdb8a981ee1908c73baf44ecd698799d62a45c9addc646925b59a5780d33a4b6c422ca972c9c4a47bdeef608ae5fb4581b0bcbb4fce
+MISC ChangeLog 3278 SHA256 2a772f88a852ffa2b383503084e9e2843ebd76ab5e881b2618b0c3f3313ec90c SHA512 d26b354dce2e16e558a24319d74ea5b4660e6f3983abd60438aad328f2341c4fa03e7c76e6f15e8f370db4772fa3c842794317dc4a65b028f17280f7bcbdebc8 WHIRLPOOL 729c664d2c7448d1de993d8db2b19980fbeb6e7034a8d6269936a7b27b47901d71ee7f5d6596059a4b76ddc95588596a3d505877a305aec2d4ab61aecb53233e
+MISC ChangeLog-2015 926 SHA256 219ad253923a46feeac5eb423693b5bb3e899df252158a800419d50973860dc3 SHA512 b201832123aede0864d4115c1a8ec083adbf502c976ae8988ac42ba38a0f1b56716e30ed73351f203350c6779bcc8e4d33dd477e67e42d4e0ce18a1c0d977331 WHIRLPOOL 9f880a59f6f11603467b75eaf09053b74fe77679afbc83ec0f905a27c503ad0611b825ce0e4aa430daa0297094c4deb77b513b0149154c41269aae11b38289e2
+MISC metadata.xml 367 SHA256 c975d067e0b5cfcc7a1ab9b113dcf1a1bbcb06ef9a53af178ed0b65d2eadab8d SHA512 b05b4220fce0ced6003dc20e44aa4c6774f7e6b7a45a8a3739bae92b0843a54798e15dbb1c084dbf0be34aac5bb099117667b02d29bcb5db3f1e7c25a0245844 WHIRLPOOL 2189391e4e52501e2cc9143dee0a3a56a67619eb4bb2256849fe40160180fb0b69b69897b280cb639aee23731507e89d94f32a4485f6023f39482b6933627db3
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..c5203c8df796
--- /dev/null
+++ b/sys-boot/raincoat/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 type="person">
+ <email>vapier@gentoo.org</email>
+ </maintainer>
+ <longdescription>Flash the Xbox boot chip</longdescription>
+ <upstream>
+ <remote-id type="sourceforge">xbox-linux</remote-id>
+ </upstream>
+</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..7e15ffba97d5
--- /dev/null
+++ b/sys-boot/raincoat/raincoat-0.11.ebuild
@@ -0,0 +1,25 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+inherit eutils
+
+DESCRIPTION="Flash the Xbox boot chip"
+HOMEPAGE="https://sourceforge.net/projects/xbox-linux/"
+SRC_URI="https://sourceforge.net/projects/xbox-linux/files/Other/Raincoat/${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..7d5836dcf4d8
--- /dev/null
+++ b/sys-boot/raincoat/raincoat-0.5.ebuild
@@ -0,0 +1,25 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+DESCRIPTION="Flash the Xbox boot chip"
+HOMEPAGE="https://sourceforge.net/projects/xbox-linux/"
+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..b3475418e160
--- /dev/null
+++ b/sys-boot/raspberrypi-firmware/Manifest
@@ -0,0 +1,19 @@
+AUX raspberrypi-firmware-0_p20130711-cmdline.txt 203 SHA256 4a5b380215cf65e7849ec11071abde3fdb002335747886cda35fa45b6d93fdb3 SHA512 ea4ddd6005bf8979d4299867a8889d67192c91467833beff8785bc01ac8d33544e712b2956da51b58a7b4ab1a1acaf4f27428d294f0dfae87ec91da8a71e3c9f WHIRLPOOL 11245812d1a7363ab0ac2849d92e0fb927d6d1f7a4efdc95508c52db471822e2c62dd9781a3dcb6fa46c3c819392091bc3a271f8408c71ca15f32341729684c1
+AUX raspberrypi-firmware-0_p20130711-config.txt 1706 SHA256 e34a2735eb15dc3927ca0c8f782d7c3b6ba9aa7271aabfa794985eadb3ce5c5a SHA512 2a0a19a84ab871d73e330e870b086b85a7776a1b17dd6054451be735249208a982249ca62f6d2fe51aba74c78f36266143d65ffe0549cdf8afbf20bcf637c78f WHIRLPOOL ba3854d8bc2e352d1e15635d63fcb1508a2d74288e9e3dc6d19fdd79cff439c0ad4fb10f459f9ed88e1898d1f81c6aadb8a2a117c6dcd9d159ca0fd20ca0249d
+AUX raspberrypi-firmware-0_p20130711-envd 53 SHA256 5daacb075f5501dc76c7cacce643ce43b42da5ad69932098eab6d184e36104a8 SHA512 032aa497cbde187ed8cfa5ba5adaf96b28f9dd2babb882d934d9009771ca50e9d8c6a8d5535551a8e8cf8e1932865dd0e4806ba56c9694952cbb3d93f9081ca7 WHIRLPOOL d003045db57217f55c29d8f144a59fa3be7196945512e1d9c9135eb38440ff1c1247edcf8268393e65776f750eeae5136802f46b20065e3bf3783ee1c6f11955
+DIST raspberrypi-firmware-1.20160209.tar.gz 114792438 SHA256 ca6a88db72e90ef821b8ca7755bbee9c1d5bdb9a621a45eb029af195d2d29751 SHA512 281092c11d422d821e5e2b0479c3b8f891f8df66cfbf931992902d759c99ed40cbb2d9fada1f944372e5bcd8af69784739e79e9912db3482892b10bf668611f2 WHIRLPOOL 81974a53562ee91544d7a01dc9f4f4173a6e882891f8cf744b700162ddd8f8607b1cfcbbde04cafe2bcea47489f9ea4fd8840adf776e806bef0dba574448e76e
+DIST raspberrypi-firmware-1.20160309.tar.gz 115673896 SHA256 ead0e82b930fdeed9636a6d2d6e07b2512b5f36de3c902da5beaa9328708e181 SHA512 30a6396ef52355c6f6404354645e8d0f5bbf70332b0e1661dfa8ef3456154d07e105d3b7b5bd64efb3e7397fa2fb8c36de1aa78040dc4118060b26949c2ab884 WHIRLPOOL 19a2a28e7dc1403958f12338b5029187bb752f1367f9a46e217b3d91b098960f1cf75efb3610defe3bb2f521559019453cf50a52def3abb9c1ac61419b8ea328
+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
+EBUILD raspberrypi-firmware-1.20160209.ebuild 1156 SHA256 3d480075f4befbe22e897104c2e10ad874dabc77014ba8bdb2698da98a6a09a2 SHA512 b28b1633169d77f939ac0853898c828b34c0ba73589e20858ad07e836bdd604bd9392fe84d24e729b1eca360190a853461e04e87a08889a8e3e97df5a1fc83f5 WHIRLPOOL 9b06c3dbf0b9cc7c6ee15ae1415a226e7e49fe7f7862df57a7e68c1479b8b9c2d610428fd064118ca58fdfc031f46d611c3bda20376607b7c698574c92900b0e
+EBUILD raspberrypi-firmware-1.20160309.ebuild 1156 SHA256 3d480075f4befbe22e897104c2e10ad874dabc77014ba8bdb2698da98a6a09a2 SHA512 b28b1633169d77f939ac0853898c828b34c0ba73589e20858ad07e836bdd604bd9392fe84d24e729b1eca360190a853461e04e87a08889a8e3e97df5a1fc83f5 WHIRLPOOL 9b06c3dbf0b9cc7c6ee15ae1415a226e7e49fe7f7862df57a7e68c1479b8b9c2d610428fd064118ca58fdfc031f46d611c3bda20376607b7c698574c92900b0e
+EBUILD raspberrypi-firmware-1_pre20130807.ebuild 1639 SHA256 59f345d8cbe52a01c12bc1f1c5a746999c04d571cd753e3f142a08f6523fe22a SHA512 ac655e12570990ad9bf7381b4205bddd4bb8a6248001f9b9def2988bcc3ec30ee828332423b993fed86dffeeaf94f48d0d21dab9c91da88a26329841c40a59fe WHIRLPOOL 967486bc837019a23853cc107ac98dfae738a8ce5df38cabd5bac0ef10f610da896c3a081eda0900b44bb207b0550aeaf2ccd402e40e21a7169b4a4edd9c615a
+EBUILD raspberrypi-firmware-9999.ebuild 1419 SHA256 5a47add205301140cbb1889ca10b2561a2c0008bb4f329b8e0a208af7942aceb SHA512 384b8be784a224702cf843bc9ed8ed6777d55f836717fc08a355787564e58c5e463a20d8b2a42342f2bc0b1bd772a0d54dbec82bef05b951b90a42884fdaaddf WHIRLPOOL 7fa7a5f5d409035de1a6c982f908a377deef455a8607e0c0ad6e177f5e511f6d4d51383f32dd856ff9600a572fdb981458f2f452bf338da756daf4d48c9fa942
+MISC ChangeLog 3519 SHA256 3db8daae9427836d65adb59d79f57679cb527cd725864882c63bc57ea2525190 SHA512 f05561ff8b8beba6fc233adeb084c97ec4a757eaf39312dce3d42bda9188f9c98f5a4b0a4a8c69b4a0ff32c177838f6a952a2be44cd96288384d12e35a3201b6 WHIRLPOOL 30540afbbae5d41199f0f2a516c45be159042f0c6216e1f417144e3777b5f9ae4ea3c5fd4465dd52672f6f3b7e0cd8c29240aa5eeacac7c04389b454ba8e1627
+MISC ChangeLog-2015 2689 SHA256 a0f06173b825e0a90a8903b68fe073311c5324b09493463751cfa7c9505cb5f9 SHA512 56cb570e80679910e73822e33b32f44c30f0382b4dd646d39d8fbc548d9f05b694aa31c11780c4d269ae3c6d82ac1e63a3a5fcfb6d3f300676d587f17dde8173 WHIRLPOOL f90032c9729a1fbc46115ca29d1eee4030ae894504c14e4efb6f29db490e5413b0743088ad24e6eafbf55eed115d51653d8c3c73cc8e81af8d69978d53a9f945
+MISC metadata.xml 328 SHA256 adde4d5f834d63864f747c98c70e137549ff61561f515e6c87e3ecf053f4dc29 SHA512 4cde6e59e1ac26fa36447734906b1f68432121175d6691cb6b5f8fc1e50e1afea3121e108a1c75fa58704a4882491143c97111ef5e3dcc49665b89c0a7bd6494 WHIRLPOOL 1f0b32e8a40dc92ca29863f2eadd21f56efa3a3843e4274fd6b7bcbccf5c85d0d348c97bd4f5a295057be5e83d4eecf3a970f955bff378b3e8c73e5dbac9e44c
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..97bc25425603
--- /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 type="person">
+ <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-1.20160209.ebuild b/sys-boot/raspberrypi-firmware/raspberrypi-firmware-1.20160209.ebuild
new file mode 100644
index 000000000000..7dc51e4b7b0b
--- /dev/null
+++ b/sys-boot/raspberrypi-firmware/raspberrypi-firmware-1.20160209.ebuild
@@ -0,0 +1,47 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+inherit readme.gentoo
+
+DESCRIPTION="Raspberry PI boot loader and firmware"
+HOMEPAGE="https://github.com/raspberrypi/firmware"
+SRC_URI="https://github.com/raspberrypi/firmware/archive/${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="GPL-2 raspberrypi-videocore-bin"
+SLOT="0"
+KEYWORDS="~arm -*"
+IUSE=""
+
+DEPEND=""
+RDEPEND=""
+
+S=${WORKDIR}/${P/raspberrypi-}
+
+RESTRICT="binchecks strip"
+
+pkg_preinst() {
+ if ! grep "${ROOT}boot" /proc/mounts >/dev/null 2>&1; then
+ ewarn "${ROOT}boot is not mounted, the files might not be installed at the right place"
+ fi
+}
+
+src_configure() { :; }
+
+src_compile() { :; }
+
+src_install() {
+ rm boot/{kernel{,7}.img,COPYING.linux,LICENCE.broadcom} || die
+ insinto /boot
+ doins -r boot/*
+
+ newenvd "${FILESDIR}"/${PN}-0_p20130711-envd 90${PN}
+ readme.gentoo_create_doc
+}
+
+DOC_CONTENTS=" config.txt and cmdline.txt need to be generated by you
+More information here:
+https://www.raspberrypi.org/documentation/configuration/config-txt.md
+Another good source http://elinux.org/RPi_config.txt
+http://elinux.org/RPi_cmdline.txt"
diff --git a/sys-boot/raspberrypi-firmware/raspberrypi-firmware-1.20160309.ebuild b/sys-boot/raspberrypi-firmware/raspberrypi-firmware-1.20160309.ebuild
new file mode 100644
index 000000000000..7dc51e4b7b0b
--- /dev/null
+++ b/sys-boot/raspberrypi-firmware/raspberrypi-firmware-1.20160309.ebuild
@@ -0,0 +1,47 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+inherit readme.gentoo
+
+DESCRIPTION="Raspberry PI boot loader and firmware"
+HOMEPAGE="https://github.com/raspberrypi/firmware"
+SRC_URI="https://github.com/raspberrypi/firmware/archive/${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="GPL-2 raspberrypi-videocore-bin"
+SLOT="0"
+KEYWORDS="~arm -*"
+IUSE=""
+
+DEPEND=""
+RDEPEND=""
+
+S=${WORKDIR}/${P/raspberrypi-}
+
+RESTRICT="binchecks strip"
+
+pkg_preinst() {
+ if ! grep "${ROOT}boot" /proc/mounts >/dev/null 2>&1; then
+ ewarn "${ROOT}boot is not mounted, the files might not be installed at the right place"
+ fi
+}
+
+src_configure() { :; }
+
+src_compile() { :; }
+
+src_install() {
+ rm boot/{kernel{,7}.img,COPYING.linux,LICENCE.broadcom} || die
+ insinto /boot
+ doins -r boot/*
+
+ newenvd "${FILESDIR}"/${PN}-0_p20130711-envd 90${PN}
+ readme.gentoo_create_doc
+}
+
+DOC_CONTENTS=" config.txt and cmdline.txt need to be generated by you
+More information here:
+https://www.raspberrypi.org/documentation/configuration/config-txt.md
+Another good source http://elinux.org/RPi_config.txt
+http://elinux.org/RPi_cmdline.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..b4a3474a5182
--- /dev/null
+++ b/sys-boot/raspberrypi-firmware/raspberrypi-firmware-1_pre20130807.ebuild
@@ -0,0 +1,61 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+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-firmware/raspberrypi-firmware-9999.ebuild b/sys-boot/raspberrypi-firmware/raspberrypi-firmware-9999.ebuild
new file mode 100644
index 000000000000..0ed95ddb5337
--- /dev/null
+++ b/sys-boot/raspberrypi-firmware/raspberrypi-firmware-9999.ebuild
@@ -0,0 +1,53 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+inherit git-r3 readme.gentoo
+
+DESCRIPTION="Raspberry PI boot loader and firmware"
+HOMEPAGE="https://github.com/raspberrypi/firmware"
+SRC_URI=""
+
+LICENSE="GPL-2 raspberrypi-videocore-bin"
+SLOT="0"
+KEYWORDS=""
+IUSE=""
+
+DEPEND=""
+RDEPEND="!sys-boot/raspberrypi-loader"
+
+EGIT_REPO_URI="https://github.com/raspberrypi/firmware"
+
+RESTRICT="binchecks strip"
+
+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
+ cd boot
+ doins bootcode.bin COPYING.linux fixup*.dat LICENCE.broadcom start*elf
+ 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/Manifest b/sys-boot/raspberrypi-mkimage/Manifest
new file mode 100644
index 000000000000..1b892ecb7740
--- /dev/null
+++ b/sys-boot/raspberrypi-mkimage/Manifest
@@ -0,0 +1,9 @@
+AUX raspberrypi-mkimage-0_p20120201-args-uncompressed.txt 157 SHA256 f6085b24ab74440159a836713620ca3193df9da365884f6b56917655898f00dc SHA512 f9f3ad4640ae4973b97924f08ded2a6fad4f8fea576715053d860a15e2ba3dfc39c5082eee95ef0f7fa4ccb36e9a39d9d2f2e90ab7d0550a0a51d6b31cf6030d WHIRLPOOL 3a220b2310540c4d8558f48b1645ec01e3062670a1e1bc095ae0c9ef43de121c370cb1e96fecd8c73ca1480c4a32da62ff70ea81366738f5f7509b48f1d1c04c
+AUX raspberrypi-mkimage-0_p20120201-boot-uncompressed.txt 201 SHA256 4af6e284f892cdf6960874cc176d8a16ee2d812ebffb1aa46ebf1b6927a20ce7 SHA512 cc0ce918e1533222be481aade51fd7ec2ba6b41a23470517efb1260d790ff958c8f4c6232e632faf8be4664a264d12034c4f01a67ef29d9124cafd4f58d94ebd WHIRLPOOL 4511e32ff969c36c7111678e0ac260ef9e132631cd2fe6cf5bfdf0e2f5826d2018e310025561c78a2731804f019726659e80b65ca425c57e77e7b39b9d8fa8d8
+AUX raspberrypi-mkimage-0_p20120201-imagetool-uncompressed-python3.patch 224 SHA256 8bcd4ed04b536d57ae3acbd24b5d5b6190074bfe12baaaa47c510445dd2b3af9 SHA512 338a39f6050b1f49640aa42b6100bdaea965d44f541d57ea5758efe83f0ba4749b135f20474a14d66ebd8c46a22d4db4ed87bdbd849b04421a067f5376dfa9dd WHIRLPOOL 62fbbf73d068b6f9fcf6d2d22a0793fe23959c393aa839e3ab81b929dc398e3c3f53bf83dc9c91f440b5e3d6b22b6d3923810b8cb08482199301024a0d8d93c1
+AUX raspberrypi-mkimage-0_p20120201-imagetool-uncompressed.patch 1294 SHA256 b601110d6f83e5cb11b4787b28acb6aeac8a50f35d3e00221c1287c450362048 SHA512 71495224bbe3d5064eda438f2d5534422a5e94be8d0a47a4020feab62a67fdebe6a29ced6b97aea970e505edeebd43a8aa9642198979ad57293b6d6cf4221633 WHIRLPOOL e4d930b90085539a2a9c105e094463fc75db2f05c074be95bc7d79a2aa9a5e33421e47778d50126ef04a83d0cd7eb3fc1c5f644c8eccde2c234d21ad8e5c9f14
+AUX raspberrypi-mkimage-0_p20120201-imagetool-uncompressed.py 822 SHA256 08979410301ea3737a4cf8b49e7440daf4ef3583941fcd5a0df0aa37da3db8d2 SHA512 00a3e1936b44e7a3c73b3ca0fc9597016a31dce869da04101785c1e5fd0987747a828092335402820cba96caae1c9d463a9bba6a5ec1e4ccc89bb6a31f025c5c WHIRLPOOL 1ae637d1f35bec54ee95f4b05c0a3e7d77dd50b9f9c540fb15bc206f0cd86c54fde85c7a9f0b08305f4d2d5fcb775c948c3e35eddbffbfc42809e52de5897662
+EBUILD raspberrypi-mkimage-0_p20120201.ebuild 1194 SHA256 8b17800e0b8af4c480bd209a2645386bb513becb607590e73f6e2fb0aacb7933 SHA512 29018cc42f1d43178adeb2c2030e642f8147da9cc82aafb9327c1d784dd1c3a26849c9cc02e6f33282a18684f896d15a33d53a23b8cee72433bda85fd0f787ed WHIRLPOOL 70f08b1b9f7e423c6b597971683e793d181ae04a87580346af7219c9f14b7b612111d9350ee062fd504f9658a73624c2b46a9fe4eba1ba7155ce19bb4f8879da
+MISC ChangeLog 2718 SHA256 7fc74ba672d97a138394c898edc5a023d04e99f02c79a3dadbc624025c11c942 SHA512 51984e9379d35589214756eb2df7a92090b436010309cd13e595285326eb78c399bc77f26d9f8a003b7bb83493db39c55b015ea95929b7c4908b22664671af55 WHIRLPOOL 1b5e9515b5eca7f1751725edb35d611a5ba275560cad65053cb72267cb9764d881c65f23d7a5ae608b24286fa9b42b2a3aa5ab08bcf160bdcb37c0025fcd8f1f
+MISC ChangeLog-2015 1138 SHA256 1d9aac7da589dd50d27ad27b117cc4ea4136c38435d7a0e33428864233caaed7 SHA512 4484e08339247854ff9e6a59097568ee6667c717285e247871005e82640820c9835a900d1b131f1449e96db0554d6ded1ef8e5aad24110a5ff89296f1aa5619d WHIRLPOOL dc138f992cbd9f0b1386df7f912a1e5f5f1264a6c06b27c88e83b49f31292ed5bb393dde1c2ce8820abaf94ef294274acdfdfe977a605c109ac9befbf5ebb7b3
+MISC metadata.xml 325 SHA256 6bc025a564a2dc54c02499e865bbda2d5c42247b7bbac92582a39ffe21ec42e4 SHA512 0b72cf51be51303a405f2b9caf872966249e1522def22364c4bd49352201de59706a2590fcc508a0e4a0bbe6f2cb4cbcc4bb062c7f5a0c2226c68c8c3d054432 WHIRLPOOL a127361f533a7037e52b1246f66ed4aecd4904634a40a5e2c31af12b19e8ad90863f6d9ed64acfd8133070e669707d38a06f7fa369b0c73b6db30617b64ea65e
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..28b8a6f3170f
--- /dev/null
+++ b/sys-boot/raspberrypi-mkimage/files/raspberrypi-mkimage-0_p20120201-imagetool-uncompressed-python3.patch
@@ -0,0 +1,11 @@
+--- a/imagetool-uncompressed.py
++++ b/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..adba8bbcdbbf
--- /dev/null
+++ b/sys-boot/raspberrypi-mkimage/files/raspberrypi-mkimage-0_p20120201-imagetool-uncompressed.patch
@@ -0,0 +1,48 @@
+--- a/imagetool-uncompressed.py
++++ b/imagetool-uncompressed.py
+@@ -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..de18e3066ff4
--- /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 type="person">
+ <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..202e65282d26
--- /dev/null
+++ b/sys-boot/raspberrypi-mkimage/raspberrypi-mkimage-0_p20120201.ebuild
@@ -0,0 +1,56 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+PYTHON_COMPAT=( python{2_7,3_4,3_5,3_6} )
+DISTUTILS_IN_SOURCE_BUILD=1
+
+inherit 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=""
+
+PATCHES=( "${FILESDIR}"/${P}-imagetool-uncompressed.patch )
+
+src_unpack() {
+ mkdir "${S}" || die
+ cp {"${FILESDIR}"/${P}-,"${S}"/}imagetool-uncompressed.py || die
+}
+
+python_prepare_all() {
+ sed -e '/^load_to_mem("/s:(":("'${EPREFIX}'/usr/share/'${PN}'/:' \
+ -e '1s:python2:python:' \
+ -i imagetool-uncompressed.py || die
+
+ distutils-r1_python_prepare_all
+}
+
+python_prepare() {
+ if python_is_python3; then
+ eapply "${FILESDIR}"/${P}-imagetool-uncompressed-python3.patch
+ fi
+}
+
+python_compile() { :; }
+
+python_install() {
+ python_doscript imagetool-uncompressed.py
+}
+
+python_install_all() {
+ insinto /usr/share/${PN}
+ newins {"${FILESDIR}"/${P}-,}args-uncompressed.txt
+ newins {"${FILESDIR}"/${P}-,}boot-uncompressed.txt
+
+ distutils-r1_python_install_all
+}
diff --git a/sys-boot/refind/Manifest b/sys-boot/refind/Manifest
new file mode 100644
index 000000000000..15875e965a4f
--- /dev/null
+++ b/sys-boot/refind/Manifest
@@ -0,0 +1,6 @@
+DIST refind-src-0.10.4.tar.gz 3970380 SHA256 c3e428b27a0d4c61ee052603aedea7118bf04a7917216b10bfde2a3d2a2442a5 SHA512 a75a6210ee51427c474e69c2de8c719545b2599c19f1c7541048b77ab1996a0e4b4b5fd4840f6240cd6704e5f5338cbaff432d7dc5ec4042854e26d6df18bed5 WHIRLPOOL a5d84831ea3c6282560fcc7491e7aabeb4a0598c34843a09b7baadf9398092a9495290180d05fbd935ad09207814a3fa4f72cfa3bf798f2422fecf07dc27037d
+DIST refind-src-0.10.8.tar.gz 4059265 SHA256 e4fc7f474fe4a13b70c7bc3611c13976dbc4edc7323f0f27f3b50147ab47f1e6 SHA512 a4576920dd68a9436ee6d008787104842e192c6a5eb52cc580258bc8e13daadf170c21270e8cfd86f27733e3e86b050af9102d35c939677b1f1c3627aeeafb32 WHIRLPOOL 970ea1b6207c526288496f4ad04cf58d86fc8352bad673574bb06de64e4fd37c45b1f7b7b8b9dca2bd0bb5c61cec9e4eaaccf88e237dc515c42e950ec2a425c4
+EBUILD refind-0.10.4-r2.ebuild 6190 SHA256 c57f2ae2adb2e44b94dffa3edfdf260e51e7a43cce531575b9952767e09d50d2 SHA512 6fe8b2aafc877a5536d8adf26503e40f350205d2b7e1edeff946198b17971d3bb0b49d5c181f1f939a7264acfb9fc3a42c63120b2b9e36ff47f9c63ab5feb67d WHIRLPOOL 3597d42a4b63d3c4f06b032fb1af737a4e080cf4d8fc3bebdba5c9ac95a719508889ba8886b38e98a5d5b1c4bec44215a8605c639329db11f3bc66ced42c9907
+EBUILD refind-0.10.8.ebuild 6192 SHA256 be1de1679be81704690b239fcee03012d0d879b8a7fdbb61cb4af3cd5336ed55 SHA512 1f0ff9e9bde5ce71ca4d4f408b19eab437db23307888873480600eae55b523b402d705b6b298be673d5c3feef92be43ad1f7b77fad27b007751d385796bff937 WHIRLPOOL 1889a4d84e8e95d6d106ce94b09e645490aba22960968c6f3e8383c937eea8174b8dac5a79e7e386c972246a4e31e378e1f7de3586aff51530d2fabd69e8381d
+MISC ChangeLog 4569 SHA256 b510a3b2856255ccb0d272e209613a1376c15a7b191c3e09939b20795ab45301 SHA512 dca791fcbf72861c61444a5beb011970a5c966dc567b5d18556cb2d70fee87adf016c710e559dfdc131585ffa196a834499ba03ca51ae859358c71804e41febe WHIRLPOOL 16d3d684d88192ca480dfad108b9ffab8966fa82d08706f30ae2e233e8f9c333015e4a0d40ee9fe9075cf7279238c9a78ca07b927edf8fca6623884784e3a532
+MISC metadata.xml 3924 SHA256 a457f009d9269bfc8b5a7986b2c79df07ef0be1e9ed44f2d102f2d6f575c9ac1 SHA512 40432e3b97f448c671c9af35f25457481069f7c4b43e7d93958cf93e52856badf576f878f656185c58eda880e6e1eb1bc6c4a96d67d6f7a6b569da870bcea6bd WHIRLPOOL e63447393367e44e7081fe640c9731b31d70fd6db6fafec286689b6902b8e42541cba1998207dc409f29ff43e782e65905bfa259e3696715c3536b90023199f7
diff --git a/sys-boot/refind/metadata.xml b/sys-boot/refind/metadata.xml
new file mode 100644
index 000000000000..a5f94e9e04e5
--- /dev/null
+++ b/sys-boot/refind/metadata.xml
@@ -0,0 +1,69 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>wraeth@gentoo.org</email>
+ <name>Sam Jorna</name>
+ </maintainer>
+ <maintainer type="person">
+ <email>sveyret@gmail.com</email>
+ <name>Stéphane Veyret</name>
+ </maintainer>
+ <maintainer type="project">
+ <email>proxy-maint@gentoo.org</email>
+ <name>Proxy Maintainers</name>
+ </maintainer>
+ <longdescription lang="en">
+A graphical boot manager for EFI- and UEFI-based computers, such as all
+Intel-based Macs and recent (most 2011 and later) PCs. rEFInd presents a
+boot menu showing all the EFI boot loaders on the EFI-accessible
+partitions, and optionally BIOS-bootable partitions on Macs and BIOS boot
+entries on UEFI PCs with CSMs. EFI-compatbile OSes, including Linux,
+provide boot loaders that rEFInd can detect and launch. rEFInd can launch
+Linux EFI boot loaders such as ELILO, GRUB Legacy, GRUB 2, and 3.3.0 and
+later kernels with EFI stub support. EFI filesystem drivers for ext2/3/4fs,
+ReiserFS, Btrfs, NTFS, HFS+, and ISO-9660 enable rEFInd to read boot
+loaders from these filesystems, too. rEFInd's ability to detect boot
+loaders at runtime makes it very easy to use, particularly when paired with
+Linux kernels that provide EFI stub support.
+ </longdescription>
+ <longdescription lang="fr">
+Un gestionnaire d'amorçage pour ordinateur EFI ou UEFI tel que tous les Macs
+contenant un processeur Intel et les PC récents (2011 et après). rEFInd affiche
+un menu d'amorçage montrant tous les gestionnaires d'amorçage sur les
+partitions EFI accessibles et optionnellement les partitions amorçable en BIOS
+sur Macs et les entrées BIOS sur les PC UEFI avec CSM. Les systèmes
+d'exploitation compatibles EFI, incluant Linux, fournissent des gestionnaires
+d'amorçage que rEFInd détecte et démarre. rEFInd peut démarrer les
+gestionnaires d'amorçage EFI Linux tel que ELILO, GRUB Legacy, GRUB 2 ainsi que
+les noyaux 3.3.0 et suivants avec le support EFI stub. Les pilotes EFI pour les
+sytèmes de fichiers ext2/3/4fs, ReiserFS, Btrfs, NTFS, HFS+ et ISO-9660
+permettent à rEFInd de lire les gestionnaires d'amorçage également depuis ces
+systèmes de fichiers. La capacité de rEFInd à détecter les gestionnaires
+d'amorçage au moment de l'exécution le rend très facile à utiliser, en
+particulier associé à des noyau Linux qui fournissent un support EFI stub.
+ </longdescription>
+ <use lang="en">
+ <flag name="ext2">Builds the EFI binary ext2 filesystem driver</flag>
+ <flag name="ext4">Builds the EFI binary ext4 filesystem driver</flag>
+ <flag name="reiserfs">Builds the EFI binary reiserfs filesystem driver</flag>
+ <flag name="iso9660">Builds the EFI binary iso9660 filesystem driver</flag>
+ <flag name="hfs">Builds the EFI binary hfs filesystem driver</flag>
+ <flag name="btrfs">Builds the EFI binary btrfs filesystem driver</flag>
+ <flag name="ntfs">Builds the EFI binary ntfs filesystem driver</flag>
+ <flag name="gnuefi">Compile using GNU-EFI instead of Tianocore</flag>
+ </use>
+ <use lang="fr">
+ <flag name="ext2">Construire le gestionnaire EFI pour le système de fichier ext2</flag>
+ <flag name="ext4">Construire le gestionnaire EFI pour le système de fichier ext4</flag>
+ <flag name="reiserfs">Construire le gestionnaire EFI pour le système de fichier reiserfs</flag>
+ <flag name="iso9660">Construire le gestionnaire EFI pour le système de fichier iso9660</flag>
+ <flag name="hfs">Construire le gestionnaire EFI pour le système de fichier hfs</flag>
+ <flag name="btrfs">Construire le gestionnaire EFI pour le système de fichier btrfs</flag>
+ <flag name="ntfs">Construire le gestionnaire EFI pour le système de fichier ntfs</flag>
+ <flag name="gnuefi">Compiler en utilisant GNU-EFI au lieu de Tianocore</flag>
+ </use>
+ <upstream>
+ <remote-id type="sourceforge">refind</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-boot/refind/refind-0.10.4-r2.ebuild b/sys-boot/refind/refind-0.10.4-r2.ebuild
new file mode 100644
index 000000000000..4ce8cce2382c
--- /dev/null
+++ b/sys-boot/refind/refind-0.10.4-r2.ebuild
@@ -0,0 +1,197 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit toolchain-funcs flag-o-matic versionator
+
+DESCRIPTION="The rEFInd UEFI Boot Manager by Rod Smith"
+HOMEPAGE="http://www.rodsbooks.com/refind/"
+
+SRC_URI="mirror://sourceforge/project/${PN}/${PV}/${PN}-src-${PV}.tar.gz"
+
+LICENSE="BSD GPL-2 GPL-3 FDL-1.3"
+SLOT="0"
+KEYWORDS="amd64 x86"
+FS_USE="btrfs +ext2 +ext4 hfs +iso9660 ntfs reiserfs"
+IUSE="${FS_USE} -gnuefi doc -custom-cflags"
+
+DEPEND="gnuefi? ( >=sys-boot/gnu-efi-3.0.2 )
+ !gnuefi? ( >=sys-boot/udk-2015 )"
+
+DOCS="NEWS.txt README.txt docs/refind docs/Styles"
+
+pkg_pretend() {
+ if use custom-cflags; then
+ ewarn
+ ewarn "You have enabled building with USE=custom-cflags. Be aware that"
+ ewarn "using this can result in EFI binaries that fail to run and may"
+ ewarn "fail to build at all. This is strongly advised against by upstream."
+ ewarn
+ ewarn "See https://bugs.gentoo.org/598587#c3 for more information"
+ ewarn
+ fi
+}
+
+pkg_setup() {
+ if use x86 ; then
+ export EFIARCH=ia32
+ export BUILDARCH=ia32
+ elif use amd64; then
+ export EFIARCH=x64
+ export BUILDARCH=x86_64
+ else
+ # Try to support anyway
+ export BUILDARCH=$( uname -m | sed s,i[3456789]86,ia32, )
+ if [[ ${BUILDARCH} == "x86_64" ]] ; then
+ export EFIARCH=x64
+ else
+ export EFIARCH=${ARCH}
+ fi
+ fi
+}
+
+src_prepare() {
+ default
+
+ # bug 598647 - PIE not supported
+ sed -e 's:CFLAGS =:& -fno-PIE:' -i "${S}/Make.common" || die
+
+ local f
+ for f in "${S}"/*/Make.tiano "${S}"/Make.common; do
+ sed -i -e 's/^\(include .*target.txt.*\)$/#\1/' \
+ -e 's@^\(TIANO_INCLUDE_DIRS\s*=\s*-I\s*\).*$@\1/usr/include/udk \\@' \
+ -e '/^\s*-I \$(EDK2BASE).*$/d' \
+ "${f}" || die "Failed to patch Tianocore make file in" \
+ $(basename $(dirname ${f}))
+ done
+ for f in "${S}"/*/Make.tiano; do
+ sed -i -e 's@^\(EFILIB\s*=\s*\).*$@\1/usr/lib@' \
+ -e 's@\$(EFILIB).*/\([^/]*\).lib@-l\1@' \
+ -e 's/\(--start-group\s*\$(ALL_EFILIBS)\)/-L \$(EFILIB) \1/' \
+ "${f}" || die "Failed to patch Tianocore make file in" \
+ $(basename $(dirname ${f}))
+ done
+ sed -i -e '/Guids/i#include "AutoGen.h"\n' "${S}/filesystems/AutoGen.c" \
+ || die "Failed to patch AutoGen.c"
+ for f in "${S}"/*/AutoGen.c; do
+ cat >>"${f}" <<-EOF || die "Failed to patch AutoGen.c"
+
+ #define _PCD_TOKEN_PcdFixedDebugPrintErrorLevel 11U
+ #define _PCD_SIZE_PcdFixedDebugPrintErrorLevel 4
+ #define _PCD_GET_MODE_SIZE_PcdFixedDebugPrintErrorLevel _PCD_SIZE_PcdFixedDebugPrintErrorLevel
+ #define _PCD_VALUE_PcdFixedDebugPrintErrorLevel 0xFFFFFFFFU
+ GLOBAL_REMOVE_IF_UNREFERENCED const UINT32 _gPcd_FixedAtBuild_PcdFixedDebugPrintErrorLevel = _PCD_VALUE_PcdFixedDebugPrintErrorLevel;
+ extern const UINT32 _gPcd_FixedAtBuild_PcdFixedDebugPrintErrorLevel;
+ #define _PCD_GET_MODE_32_PcdFixedDebugPrintErrorLevel _gPcd_FixedAtBuild_PcdFixedDebugPrintErrorLevel
+ //#define _PCD_SET_MODE_32_PcdFixedDebugPrintErrorLevel ASSERT(FALSE) // It is not allowed to set value for a FIXED_AT_BUILD PCD
+ EOF
+ done
+}
+
+src_compile() {
+ # Prepare flags
+ local pecoff_header_size
+ [[ $EFIARCH == x64 ]] && pecoff_header_size='0x228' \
+ || pecoff_header_size='0x220'
+ local make_flags=(
+ ARCH="${BUILDARCH}"
+ GENFW="/usr/bin/GenFw"
+ CC="$(tc-getCC)"
+ AS="$(tc-getAS)"
+ LD="$(tc-getLD)"
+ AR="$(tc-getAR)"
+ RANLIB="$(tc-getRANLIB)"
+ OBJCOPY="$(tc-getOBJCOPY)"
+ GNUEFI_LDFLAGS="-T \$(GNUEFI_LDSCRIPT) -shared -nostdlib -Bsymbolic \
+ -L\$(EFILIB) -L\$(GNUEFILIB) \$(CRTOBJS) -znocombreloc -zdefs"
+ TIANO_LDSCRIPT="/usr/lib/GccBase.lds"
+ TIANO_LDFLAGS="-n -q --gc-sections -nostdlib \
+ --script=\$(TIANO_LDSCRIPT) \
+ --defsym=PECOFF_HEADER_SIZE=${pecoff_header_size} \
+ --entry \$(ENTRYPOINT) -u \$(ENTRYPOINT) -m \$(LD_CODE)"
+ )
+
+ # Make main EFI
+ local all_target
+ use gnuefi && all_target="gnuefi" || all_target="tiano"
+
+ if use custom-cflags; then
+ emake CFLAGS="${CFLAGS}" "${make_flags[@]}" ${all_target}
+ else
+ emake "${make_flags[@]}" ${all_target}
+ fi
+
+ # Make filesystem drivers
+ local gnuefi_target
+ use gnuefi && gnuefi_target="_gnuefi"
+ local fs
+ for fs in ${FS_USE}; do
+ fs=${fs#+}
+ if use "${fs}"; then
+ einfo "Building ${fs} filesystem driver"
+ if use custom-cflags; then
+ emake CFLAGS="${CFLAGS}" "${make_flags[@]}" -C "${S}/filesystems" ${fs}${gnuefi_target}
+ else
+ emake "${make_flags[@]}" -C "${S}/filesystems" ${fs}${gnuefi_target}
+ fi
+ fi
+ done
+}
+
+src_install() {
+ exeinto "/usr/share/${P}"
+ doexe refind-install
+ dosym "/usr/share/${P}/refind-install" "/usr/sbin/refind-install"
+
+ dodoc "${S}"/{COPYING.txt,LICENSE.txt,CREDITS.txt}
+ if use doc; then
+ doman "${S}/docs/man/"*
+ dodoc -r ${DOCS}
+ fi
+
+ insinto "/usr/share/${P}/refind"
+ doins "${S}/refind/refind_${EFIARCH}.efi"
+ doins "${S}/refind.conf-sample"
+ doins -r images icons fonts banners
+
+ if [[ -d "${S}/drivers_${EFIARCH}" ]]; then
+ doins -r "${S}/drivers_${EFIARCH}"
+ fi
+
+ insinto "/usr/share/${P}/refind/tools_${EFIARCH}"
+ doins "${S}/gptsync/gptsync_${EFIARCH}.efi"
+
+ insinto "/etc/refind.d"
+ doins -r "${S}/keys"
+
+ dosbin "${S}/mkrlconf"
+ dosbin "${S}/mvrefind"
+ dosbin "${S}/refind-mkdefault"
+}
+
+pkg_postinst() {
+ elog "rEFInd has been built and installed into ${EROOT%/}/usr/share/${P}"
+ elog "You will need to use the command 'refind-install' to install"
+ elog "the binaries into your EFI System Partition"
+ elog ""
+ if [[ -z "${REPLACING_VERSIONS}" ]]; then
+ elog "refind-install requires additional packages to be fully functional:"
+ elog " app-crypt/sbsigntool for binary signing for use with SecureBoot"
+ elog " sys-boot/efibootmgr for writing to NVRAM"
+ elog " sys-block/parted for automatic ESP location and mount"
+ elog ""
+ elog "refind-mkdefault requires >=dev-lang/python-3"
+ elog ""
+ elog "A sample configuration can be found at"
+ elog "${EROOT%}/usr/share/${P}/refind/refind.conf-sample"
+ else
+ if ! version_is_at_least "0.10.3" "${REPLACING_VERSIONS}"; then
+ elog "The new refind-mkdefault script requires >=dev-lang/python-3"
+ elog "to be installed"
+ elog ""
+ fi
+ ewarn "Note that this installation will not update any EFI binaries"
+ ewarn "on your EFI System Partition - this needs to be done manually"
+ fi
+}
diff --git a/sys-boot/refind/refind-0.10.8.ebuild b/sys-boot/refind/refind-0.10.8.ebuild
new file mode 100644
index 000000000000..044b7ed7c12e
--- /dev/null
+++ b/sys-boot/refind/refind-0.10.8.ebuild
@@ -0,0 +1,197 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit toolchain-funcs flag-o-matic versionator
+
+DESCRIPTION="The rEFInd UEFI Boot Manager by Rod Smith"
+HOMEPAGE="http://www.rodsbooks.com/refind/"
+
+SRC_URI="mirror://sourceforge/project/${PN}/${PV}/${PN}-src-${PV}.tar.gz"
+
+LICENSE="BSD GPL-2 GPL-3 FDL-1.3"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+FS_USE="btrfs +ext2 +ext4 hfs +iso9660 ntfs reiserfs"
+IUSE="${FS_USE} -gnuefi doc -custom-cflags"
+
+DEPEND="gnuefi? ( >=sys-boot/gnu-efi-3.0.2 )
+ !gnuefi? ( >=sys-boot/udk-2015 )"
+
+DOCS="NEWS.txt README.txt docs/refind docs/Styles"
+
+pkg_pretend() {
+ if use custom-cflags; then
+ ewarn
+ ewarn "You have enabled building with USE=custom-cflags. Be aware that"
+ ewarn "using this can result in EFI binaries that fail to run and may"
+ ewarn "fail to build at all. This is strongly advised against by upstream."
+ ewarn
+ ewarn "See https://bugs.gentoo.org/598587#c3 for more information"
+ ewarn
+ fi
+}
+
+pkg_setup() {
+ if use x86 ; then
+ export EFIARCH=ia32
+ export BUILDARCH=ia32
+ elif use amd64; then
+ export EFIARCH=x64
+ export BUILDARCH=x86_64
+ else
+ # Try to support anyway
+ export BUILDARCH=$( uname -m | sed s,i[3456789]86,ia32, )
+ if [[ ${BUILDARCH} == "x86_64" ]] ; then
+ export EFIARCH=x64
+ else
+ export EFIARCH=${ARCH}
+ fi
+ fi
+}
+
+src_prepare() {
+ default
+
+ # bug 598647 - PIE not supported
+ sed -e 's:CFLAGS =:& -fno-PIE:' -i "${S}/Make.common" || die
+
+ local f
+ for f in "${S}"/*/Make.tiano "${S}"/Make.common; do
+ sed -i -e 's/^\(include .*target.txt.*\)$/#\1/' \
+ -e 's@^\(TIANO_INCLUDE_DIRS\s*=\s*-I\s*\).*$@\1/usr/include/udk \\@' \
+ -e '/^\s*-I \$(EDK2BASE).*$/d' \
+ "${f}" || die "Failed to patch Tianocore make file in" \
+ $(basename $(dirname ${f}))
+ done
+ for f in "${S}"/*/Make.tiano; do
+ sed -i -e 's@^\(EFILIB\s*=\s*\).*$@\1/usr/lib@' \
+ -e 's@\$(EFILIB).*/\([^/]*\).lib@-l\1@' \
+ -e 's/\(--start-group\s*\$(ALL_EFILIBS)\)/-L \$(EFILIB) \1/' \
+ "${f}" || die "Failed to patch Tianocore make file in" \
+ $(basename $(dirname ${f}))
+ done
+ sed -i -e '/Guids/i#include "AutoGen.h"\n' "${S}/filesystems/AutoGen.c" \
+ || die "Failed to patch AutoGen.c"
+ for f in "${S}"/*/AutoGen.c; do
+ cat >>"${f}" <<-EOF || die "Failed to patch AutoGen.c"
+
+ #define _PCD_TOKEN_PcdFixedDebugPrintErrorLevel 11U
+ #define _PCD_SIZE_PcdFixedDebugPrintErrorLevel 4
+ #define _PCD_GET_MODE_SIZE_PcdFixedDebugPrintErrorLevel _PCD_SIZE_PcdFixedDebugPrintErrorLevel
+ #define _PCD_VALUE_PcdFixedDebugPrintErrorLevel 0xFFFFFFFFU
+ GLOBAL_REMOVE_IF_UNREFERENCED const UINT32 _gPcd_FixedAtBuild_PcdFixedDebugPrintErrorLevel = _PCD_VALUE_PcdFixedDebugPrintErrorLevel;
+ extern const UINT32 _gPcd_FixedAtBuild_PcdFixedDebugPrintErrorLevel;
+ #define _PCD_GET_MODE_32_PcdFixedDebugPrintErrorLevel _gPcd_FixedAtBuild_PcdFixedDebugPrintErrorLevel
+ //#define _PCD_SET_MODE_32_PcdFixedDebugPrintErrorLevel ASSERT(FALSE) // It is not allowed to set value for a FIXED_AT_BUILD PCD
+ EOF
+ done
+}
+
+src_compile() {
+ # Prepare flags
+ local pecoff_header_size
+ [[ $EFIARCH == x64 ]] && pecoff_header_size='0x228' \
+ || pecoff_header_size='0x220'
+ local make_flags=(
+ ARCH="${BUILDARCH}"
+ GENFW="/usr/bin/GenFw"
+ CC="$(tc-getCC)"
+ AS="$(tc-getAS)"
+ LD="$(tc-getLD)"
+ AR="$(tc-getAR)"
+ RANLIB="$(tc-getRANLIB)"
+ OBJCOPY="$(tc-getOBJCOPY)"
+ GNUEFI_LDFLAGS="-T \$(GNUEFI_LDSCRIPT) -shared -nostdlib -Bsymbolic \
+ -L\$(EFILIB) -L\$(GNUEFILIB) \$(CRTOBJS) -znocombreloc -zdefs"
+ TIANO_LDSCRIPT="/usr/lib/GccBase.lds"
+ TIANO_LDFLAGS="-n -q --gc-sections -nostdlib \
+ --script=\$(TIANO_LDSCRIPT) \
+ --defsym=PECOFF_HEADER_SIZE=${pecoff_header_size} \
+ --entry \$(ENTRYPOINT) -u \$(ENTRYPOINT) -m \$(LD_CODE)"
+ )
+
+ # Make main EFI
+ local all_target
+ use gnuefi && all_target="gnuefi" || all_target="tiano"
+
+ if use custom-cflags; then
+ emake CFLAGS="${CFLAGS}" "${make_flags[@]}" ${all_target}
+ else
+ emake "${make_flags[@]}" ${all_target}
+ fi
+
+ # Make filesystem drivers
+ local gnuefi_target
+ use gnuefi && gnuefi_target="_gnuefi"
+ local fs
+ for fs in ${FS_USE}; do
+ fs=${fs#+}
+ if use "${fs}"; then
+ einfo "Building ${fs} filesystem driver"
+ if use custom-cflags; then
+ emake CFLAGS="${CFLAGS}" "${make_flags[@]}" -C "${S}/filesystems" ${fs}${gnuefi_target}
+ else
+ emake "${make_flags[@]}" -C "${S}/filesystems" ${fs}${gnuefi_target}
+ fi
+ fi
+ done
+}
+
+src_install() {
+ exeinto "/usr/share/${P}"
+ doexe refind-install
+ dosym "/usr/share/${P}/refind-install" "/usr/sbin/refind-install"
+
+ dodoc "${S}"/{COPYING.txt,LICENSE.txt,CREDITS.txt}
+ if use doc; then
+ doman "${S}/docs/man/"*
+ dodoc -r ${DOCS}
+ fi
+
+ insinto "/usr/share/${P}/refind"
+ doins "${S}/refind/refind_${EFIARCH}.efi"
+ doins "${S}/refind.conf-sample"
+ doins -r images icons fonts banners
+
+ if [[ -d "${S}/drivers_${EFIARCH}" ]]; then
+ doins -r "${S}/drivers_${EFIARCH}"
+ fi
+
+ insinto "/usr/share/${P}/refind/tools_${EFIARCH}"
+ doins "${S}/gptsync/gptsync_${EFIARCH}.efi"
+
+ insinto "/etc/refind.d"
+ doins -r "${S}/keys"
+
+ dosbin "${S}/mkrlconf"
+ dosbin "${S}/mvrefind"
+ dosbin "${S}/refind-mkdefault"
+}
+
+pkg_postinst() {
+ elog "rEFInd has been built and installed into ${EROOT%/}/usr/share/${P}"
+ elog "You will need to use the command 'refind-install' to install"
+ elog "the binaries into your EFI System Partition"
+ elog ""
+ if [[ -z "${REPLACING_VERSIONS}" ]]; then
+ elog "refind-install requires additional packages to be fully functional:"
+ elog " app-crypt/sbsigntool for binary signing for use with SecureBoot"
+ elog " sys-boot/efibootmgr for writing to NVRAM"
+ elog " sys-block/parted for automatic ESP location and mount"
+ elog ""
+ elog "refind-mkdefault requires >=dev-lang/python-3"
+ elog ""
+ elog "A sample configuration can be found at"
+ elog "${EROOT%}/usr/share/${P}/refind/refind.conf-sample"
+ else
+ if ! version_is_at_least "0.10.3" "${REPLACING_VERSIONS}"; then
+ elog "The new refind-mkdefault script requires >=dev-lang/python-3"
+ elog "to be installed"
+ elog ""
+ fi
+ ewarn "Note that this installation will not update any EFI binaries"
+ ewarn "on your EFI System Partition - this needs to be done manually"
+ fi
+}
diff --git a/sys-boot/sgibootcd/Manifest b/sys-boot/sgibootcd/Manifest
new file mode 100644
index 000000000000..c520e9cd8eb3
--- /dev/null
+++ b/sys-boot/sgibootcd/Manifest
@@ -0,0 +1,5 @@
+DIST sgibootcd-0.12.tar.bz2 3810 SHA256 2b0bfd0ebaa218fec414ff7102b8128dc658110fbeac83a510dc87d6559f299c SHA512 180e4f5a185b14c0b2c8158b368a50a3a55673fa86760e2a424c9533b1bb8ec37824c715ba02fd264621e2e31906ddd310398e9f24cf19147bce3e49fc62da3e WHIRLPOOL a1c98b2b6fc48201f4db47ac3a48cd64bb84becd5d664a8418a02115c47cb462e527aa1ba1dad4c58367441178101fe2661e9e2b08f67f1c8566f73e3c9eb08c
+EBUILD sgibootcd-0.12.ebuild 677 SHA256 150be199a792da406983c074ab624eaf48ca3b048c5db9f01429ee5966aef5f8 SHA512 870950229f51eb94bdeae66858903fa5e50f85a9024cf410ea691e8a2ecb6df9553771f800fc146d0f5b08807f5724b8acc9e2b70f2689193c1b0f0445150496 WHIRLPOOL 8129179ae24fb42418becff8c32c10a7f4e8f9a6d14b3ea5358277a22b022259810481c66b28095104bea31127f2d518fbbbe0b6ba1b0a053795dbe6b3def784
+MISC ChangeLog 2824 SHA256 17949bb756f8bacf514edc490ddd0779030333c5c09572b87c5563b31968f90e SHA512 173faa234dbb1e3b997af1f9f1ae3f930c058f0117068a314773f266f6d8116f4b9fabed81a449eaa82d26e9d4b98e96f0e554397ddef95ddef5dee7ceb84a5c WHIRLPOOL c1087c298c838f971c37929f4b0e727d5ee02746cf7dab4f30609867dd8e2bf9b591df8c526d2428d56bdca90f231987df6f2d16ac0e3d513b5418d147cb9139
+MISC ChangeLog-2015 853 SHA256 5da39d85f1b075f1daa5df0a96fa26459c0abb829ad025433d5f7e37fe4a786e SHA512 e7cd7d049371bcc7ead03a7ea21a9fae92bb1e650dea8a9b7ebdecaaa0847bd450d22e06e5040f6d752e88248e08f33ef5eb48592f54cd3354fab8ae832eda31 WHIRLPOOL 6f9700cf79d30955cb9a856d40592b38b68ea92efcbe9301d484c3aecd0b931c3d148fb8e457fb9efd8280ab44704cfeae3eee8e890bd7ff0aae12dccf131454
+MISC metadata.xml 339 SHA256 c183a9c1a837436f37d6f4c7cd3b408cbe5073f65ec97a3b739a591f6048ee3f SHA512 51188e51d70801259aaad7e5d0e2f7b923dbb4d36972f0fdae13f66d5fe74e706e33da20e76fb7a142a986bd09613270e6c9caf69fbd86ec2302d3b73f8446ee WHIRLPOOL f321dda691b4eef270e064e049b44866241788431a2cc9dda0535b908300e841d3ee78fcb454387a37a47d12c4b14fbd5603913c9e762b3c45edb66d64670117
diff --git a/sys-boot/sgibootcd/metadata.xml b/sys-boot/sgibootcd/metadata.xml
new file mode 100644
index 000000000000..c8505b31da19
--- /dev/null
+++ b/sys-boot/sgibootcd/metadata.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <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..c2b3c0449c57
--- /dev/null
+++ b/sys-boot/sgibootcd/sgibootcd-0.12.ebuild
@@ -0,0 +1,28 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+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..b3a9dcebac6a
--- /dev/null
+++ b/sys-boot/shlilo-lantank/Manifest
@@ -0,0 +1,6 @@
+AUX lilo.conf 279 SHA256 bb8d165a5b444b68d2d14eafd6c8396fd52fd2aa16677ac5a7141ea98952fe5e SHA512 317f08697ad868b105bd2df9615527b321453cffeff7834e0f2b64d2c012aff25068662ab4e5f9d0cd6ab155b17301cafad4bf982fc4d7c1e52b6dbdf207ef46 WHIRLPOOL 8f22b26cdd1cf9bb6706face756186ec900cfb97e140af75177e6d79d0b835ebd262697a9163b9438f60bd3d90ac2569e54f11cc9bddd90720afe16b4a38bf6a
+DIST sh-lilo-sel-20040408.tar.gz 85932 SHA256 60b653c63baa160bb4652b56acafd17e462b1bd1dc713620f1e150239ae2877d SHA512 81d79d3fda076b8e6ae9112e0f93f5bd544cb4613eff1ec7cd21decd9350489c6b3f5bf4d19a77ca8d60658a08fa3a464dfe5d66617c4d61e929641fc1c5ff16 WHIRLPOOL 9aef727748e9094db0110c5225e46f2d4a00ba8917e0bfd03996e35a393d5c0b06f2ddec91498f540dbc0a99f7e40c1d9ec68b26cff289a09ac26855f5864601
+EBUILD shlilo-lantank-20040408.ebuild 630 SHA256 88adea777cd39973b7f6eff1b912dc0758c9dd590a11b2387fb2eaa7f139e437 SHA512 7d8cc89c71ed3ca3e6a7a1774ad9b529d4598fc0d5cf7eb7e2bec1c87080aa9e8487175c90fd873d463666dc546d71d02de3fd1199414a66da43c1a365460463 WHIRLPOOL 45aa21a91b8233bbbd55202258856b5832bbf48c3f6b961dcf7fa3c0f31063e1f79da20ddf5a41208844c9666f23200715f12d489aa96d2c23127bb69a2fbdc8
+MISC ChangeLog 2583 SHA256 328fc49db84bbc586eef9268f80e0b5ce37111b8061f580bf9f97be6bcb7d6b8 SHA512 b4a91da73f84edd03acd4177ed15bbf4040cd44b4efa92a51a9a9126aa982077efe76aa1c5f1601dd611ed347ec19383beaf3aeb8a370250b94a3ee2497623f5 WHIRLPOOL 8e3cc563556f6df496467c74c94a1f9f737f9148cb09b11a97f39cf8facb628d17b9bbf3f7a14cdb9350628abe45de7a61acde968d6f64531a255eeb9a8dc76d
+MISC ChangeLog-2015 572 SHA256 39c5f3f8df4faa63926f88cd26c082d61a947d606091cbd8760f7c2abebe3eef SHA512 107928baa1dadd35bd20a1c2f84594dd850ec34f161d481e29c01a33793f1060c4e583fcc844390b0752f2f4dbe7f1a17bccbc33117a4b285c287e02a0bf2ddc WHIRLPOOL 6560dd1d361c864cc1fe658d77692daa118b54b4e78e308e60aeea4e34d84de06c61045b7577384defeb1eb8123017bb52448abdae026c4ec22732ba2de3a89f
+MISC metadata.xml 257 SHA256 880577e3b14bd5f3e93bef718f3e4e7ee6cd901bd04aaca8a8a16f22924f07ed SHA512 7af06754c364d6434a6f11c9cf1516a6cceb3a9f376717de2a48ffa1d953bdb304e1041b63cb80d89236a94ecb5c867b7a66ca3bcf6c69d4f54992514cc9415a WHIRLPOOL 73dbb8c5d99536be7a6337f5fd6784c80a685610745188125cea4474bd69ff8dd9af485a6712f6b51842fd690d6bcc8735c52c853cb56503f919c110cf896cb0
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..1afd1e74d6d4
--- /dev/null
+++ b/sys-boot/shlilo-lantank/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 type="project">
+ <email>sh@gentoo.org</email>
+ <name>Gentoo Linux SuperH Development</name>
+</maintainer>
+</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..113901cf38cc
--- /dev/null
+++ b/sys-boot/shlilo-lantank/shlilo-lantank-20040408.ebuild
@@ -0,0 +1,32 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+inherit mount-boot
+
+MY_P="sh-lilo-sel-${PV}"
+DESCRIPTION="bootloader for the SuperH Lantank"
+HOMEPAGE="http://oss.renesas.com/"
+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..5cdad9e2b55b
--- /dev/null
+++ b/sys-boot/silo/Manifest
@@ -0,0 +1,13 @@
+AUX silo-e2fsprogs-1.4.14.patch 1349 SHA256 8d8f7a88bda1b2b739a0fcbbe66d16a70492e34b7d62f21ed55fefd22da2e19a SHA512 f914e1ddfbdbac71fc1b67ebf188a66f1f55a1d5b19654e77d1f6e614f9adc4f1848c90754be60bdc4a9b4a4750d66cf5ef4db13db08719dc0877e4b1205ef6b WHIRLPOOL d75a216e47c1545559f5f87d7fd596d7205397083644d34b1f49fcafddc50f25fe186e59d4649e644833e36deb7eb379694f72892c70b2952cbcb7f5690839d3
+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
+EBUILD silo-1.4.14_p20100228.ebuild 1719 SHA256 9643d5bf347a269af343a305ccc67c8437b242b80cfa05439c18da19b8fa7180 SHA512 e968690916ca701d8c55e682c3c8f599bab8bbd51fdd8567a9edc3f9959cf4c1727716dbd522c94eb1ba53c28949c7ae2ab5b0694cd541fb5ff3f55f1cb23b4d WHIRLPOOL bb67953baa4e5891de44a1cf33742a8f65266e8d41c3637d6449a17a21860c84f0f7f59c7b8926a527d5d347ae43321d25c9e33c219766d52a05b7ffc1e0ff27
+EBUILD silo-1.4.14_p20120226.ebuild 1735 SHA256 fc9af825a98d728732e8fd7c5fec637517d19ff88c51092e76320a3b1e46727f SHA512 93f02430b14ccd2ab7d64d32cf3edd7cb5b4824c61327e06cb04ef5f5c050058f13a9de3aaae21d789095af71efad6d79c0470e338950b21d576640eae8307d4 WHIRLPOOL f3386d585217ea0df7a10358d5b0593247e4c92607ee7ab6524c99ce50dc7fa80c8aff59549368be2be24839d983b8433e4534919a2896c46339903ad81d0616
+EBUILD silo-1.4.14_p20120819.ebuild 1569 SHA256 662b487f2dd228340efec647fccda14fbe104190338481303217b52b8f490573 SHA512 39d1ce19e0ffbd5743abc2e4141f8ede3877b0f438728be8c9913d06b2931080dc3503cd89ec8e1813e611a15751b522afa16d9229bfc0790c4df288cde03c13 WHIRLPOOL e496ab676797a9a739f28a0126b234e597a7f11a88a70ce2730704a4cf8b5f57c9885fb677e22cb0d45b8e193c834cbc78d06fef0996e346759d855d0d310ca9
+MISC ChangeLog 2848 SHA256 4909165992180d0af507ff9393dfe418ffe22a9de1814153a7279666423282b5 SHA512 6e0f9f5378d2ce41bf42198bc8c75f15eee879e1d94ca0600db1f95cd3595eb9ff14799d215728370440223a445a927fccc572f2a414a5128d493e919dd981b2 WHIRLPOOL ffb3881bf3d17abf9b5fa48e8a4f7f380612e3e3b0b1a802c56c03ab40a517b9d09231024ee98c264fce8a26d4fd19621f37490984e7b1abf81ab00bc0cbc99e
+MISC ChangeLog-2015 10148 SHA256 405958261ef3767c07afa42b5475ee7fa8a630d4256aeacdac644986e7f68c14 SHA512 ac880a11d26c365c9179e17196e7e63567c6c4989a74bc7eddbff280566ac5900151ccf647e6cdefcb1838b8bf1104f466381582bf9e006cb0ca18634dbc0acf WHIRLPOOL f8b9ff92a107697ce5bdce8622a59f66d8031fe382f3d2b5d2ece2ee6d7e4820181f583aaf1dd5bdde4fa8f7818c8581c9a0272cfd0a1e02712b4e96a747ca82
+MISC metadata.xml 383 SHA256 93ac78c1a40dc7b65295986f32404a9731d7ebaff76e17384224f389ce3975d9 SHA512 4d4c999f52f1dfb269edc79e10df3fe667273d895eceaa4db695e9bcfe5ba781a0f9f7367411fb4be71ecedc679ce792c2359801e28b2c164fd7f44b971ced5a WHIRLPOOL 83e075d0de5a2052ad1b695f4803dc908867994191c1d6e33728d9582d9b05cc05c9b87ae09a3db8849ee970932d6fba21b717018028c195af74de0675d55c73
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..fd1c35f8fbe2
--- /dev/null
+++ b/sys-boot/silo/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 type="project">
+ <email>sparc@gentoo.org</email>
+ <name>Gentoo Linux SPARC Development</name>
+</maintainer>
+<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..33094a3840cf
--- /dev/null
+++ b/sys-boot/silo/silo-1.4.14_p20100228.ebuild
@@ -0,0 +1,69 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+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="https://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..f8ebb8a6813f
--- /dev/null
+++ b/sys-boot/silo/silo-1.4.14_p20120226.ebuild
@@ -0,0 +1,69 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+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="https://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..40219701f90d
--- /dev/null
+++ b/sys-boot/silo/silo-1.4.14_p20120819.ebuild
@@ -0,0 +1,63 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+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="https://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..03b28ba67493
--- /dev/null
+++ b/sys-boot/syslinux/Manifest
@@ -0,0 +1,16 @@
+AUX syslinux-3.86-nopie.patch 551 SHA256 90c3173728f6b3efef6fe9865d64bd571a7638537f51fae0cda14df5c7d9a39b SHA512 340a458817f45ac6a81721745e470c30e2ac02aa10ed174e77ea224fba4f1919cb9faf9c5fac2233d5b081a43339bb3dc0c35420afb3a9c134c754835ff89582 WHIRLPOOL 519fa43a58777eeeff47b29f600f8e5a7e0c9bf5c2eb7096bde61b04fa988a107ba4b76804f7473049f7a6ee0775206db3557adfee83f4a12d1916e65cc732ca
+AUX syslinux-4.05-nopie.patch 519 SHA256 2780aa55dec67a2375e28579392ed9658c4d47d0c47e4c43c22371dc926c47fc SHA512 75160574c024bd841cd5e098d81f89c8532153cfd98beb17ca1549e0bdd7106d6494e8436e56560d3e501318fd8109b5f5765d244dcdfcbfc5306d35f9cbb4a8 WHIRLPOOL 9f696e2836cf8cff2dca2c879db4262b52701cb410117ab28fa53c0fbc56fcca67d9cb3f64fafecc446dcb131179cdc12d53910dab2e528bcab74e05f6232747
+AUX syslinux-6.03-sysmacros.patch 950 SHA256 e87e4c5f64dc888f578cca5ae3216b98b473bdd9dcda44a706a4eb4bb1e0dbab SHA512 8659e82e5a5402633c807c8a8f99b25fd6e3066fd0838a7e984452e2ebeccc0331481c93101f00a698e573cadcd98966ea216e4f2d9873e6893af817998e2549 WHIRLPOOL 92ce77dc0f3be59364efef7f2798ffbdd6bc45b7d086e49bb2d5db90a66dafe8e4d6866e0d32142dfc92b7924c67d8795a4b79f0e5ee5c2defb07390074d4218
+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.03.tar.xz 6855224 SHA256 26d3986d2bea109d5dc0e4f8c4822a459276cf021125e8c9f23c3cca5d8c850e SHA512 dd2b2916962b9e93bc1e714182e3ca2a727a229b8afabe913050bcfdd43ee2af51ee3acf79121d8c20caf434583efaa7f3196871e0e07c04d82191323a50fe31 WHIRLPOOL c3abf6dd84610f2265ce94ce0991e200e3f7fcf2cf2926d46c389c7235544e959ee52aef4a510258b861da2233fd38696d3164a7d0e75f0060a18cc13f23b546
+DIST syslinux-6.04-pre1.tar.xz 5283272 SHA256 3f6d50a57f3ed47d8234fd0ab4492634eb7c9aaf7dd902f33d3ac33564fd631d SHA512 7927dd39be8e2dcf4138a6fea33def67d19d938379d694f15b48fdd2f5924c028b7a9e7bd71d0c7c6630c203e9e2a54296628e530632ad5e6f55b1ebefe8fc98 WHIRLPOOL d8d3765b974122a1265ca95470379c577108a6aba755c19c1f0373f3986d117c1cfaf1f3f2a9477d2558e66f82db3de980ab12d66c721396154dea7ee1edc28a
+EBUILD syslinux-3.86.ebuild 1461 SHA256 c1651a1e027bda3993b72574de7145d227a1aa4f97309f6ddb9f715f2c24e66c SHA512 0eebbb75484c0053d017c31ea9f1d84bb24f0d21d29277711419728cbedb9f4f4c18cf6b77b674d0e6c60c89cfa31a398604eb468410e79b01270e9265c5bc52 WHIRLPOOL 64ee196006a88eb8aa559562db2c4a4c2e634ec323cc48e6cd655699bfd99b3d0d261a98f75bb31631811bd750071f25397eecbfa624be39bbf0326294ae322a
+EBUILD syslinux-4.07.ebuild 1757 SHA256 cd73015dc2c4b41488b6abc82920e4fe01d2984350e442595e97c297a0cceed4 SHA512 baaff341d9a8e173b7739b0d53b9aea2d53c9e29b319d663d7223a21f7d21422dbb2504b70fc9ec8b92b5f565832ec179276261d01b817be31e2814e66296fc0 WHIRLPOOL 911a669a72427009371cc3800c3c695ade751b34b7eca76f629b17923e62232d5113629e150f75e5e81a3f86a9dc4d9c2cbd51301347b38273e9416c6050c1a9
+EBUILD syslinux-5.10.ebuild 2218 SHA256 f1fc8abe4306f807a92bd3dcae54d61b849d1a10651b26aabfa8f636ad8a8b14 SHA512 2bb2224850aed70306f29d475f5297fc466a4d04e5a70cf749ab1edefe56fe94b0c30eddf0ed226e07338a8e5ecc37ada691b6b4f0edbe62438a8e7e3b359a4b WHIRLPOOL 3a83ea98c845b123142c75013ab33713876692ddedc03efb0c8eeea4e5fe72388c9a5255a506bda0dd36e3829b8f9a4bf50f3038b5b5e93c9eaa1775f8bc3a61
+EBUILD syslinux-6.03.ebuild 3409 SHA256 5c087820814f2a5fb8040659de9e1f5d340d7e06e293f4bad4b69bb27fc586d8 SHA512 55f895a2b6bbdf0e1e7fa321b700138db1dc2dcd073acec722d222adccb55c092057fa90d4421f5b428aec9b66c746f30ae7ec4c62c84bdf04974c7a4a5e1cef WHIRLPOOL 8316e5c2a39e67d2890ac9ad576bfac541b8fdbecee361ed6ab923ceed04c1116eb11f2c6bb8664422e11f7b28f37eca078eea8a3c0848ad4a95d32e9227fe82
+EBUILD syslinux-6.04_pre1.ebuild 3409 SHA256 5c087820814f2a5fb8040659de9e1f5d340d7e06e293f4bad4b69bb27fc586d8 SHA512 55f895a2b6bbdf0e1e7fa321b700138db1dc2dcd073acec722d222adccb55c092057fa90d4421f5b428aec9b66c746f30ae7ec4c62c84bdf04974c7a4a5e1cef WHIRLPOOL 8316e5c2a39e67d2890ac9ad576bfac541b8fdbecee361ed6ab923ceed04c1116eb11f2c6bb8664422e11f7b28f37eca078eea8a3c0848ad4a95d32e9227fe82
+MISC ChangeLog 4181 SHA256 3211f59f31e63894c8de54ae33b2b959e46e6009b590e86826975a6f41b99be7 SHA512 67dc70ec6005eb4948a09a1fff31e479cb709bc8a4f9334fd9e2dcdea55bfe0f39a77598184725eeed07ad95f112c671d3c823b28a63122514f312856685ad4b WHIRLPOOL 60f5f82fe575a8b57f5b4df6e4dcacd8a04542756b3d3c1174d61b6fa5f8fdfa3758f333947c293170de6778f5993104d44b315163b39137fccfe05a06ef387e
+MISC ChangeLog-2015 20427 SHA256 15fdf0f85aafb3fff824366a1b2f7523c70f7d783e8d868125638499fe73dbd5 SHA512 1b3177021e8ee7e458b89f9baaef66ff6fa5d387cb37a958a64f39102b21ed0d080227c2a7baa881ab8373bd81e27d63b2c0c3543ac066fd7dc99146ae36888f WHIRLPOOL 2a1d22d6b95dfb400687463a3b39f0d8ece73b287d0d49af2ca5b2ce8ba97952b40c5a7ce0aa471adf603c7a6b941a71dcc3ffd237ff1514ddbaa9db2be2a4c1
+MISC metadata.xml 330 SHA256 264a473aea8781b3aa141a0307ff5445e3e0c800262c209b8bdeb5b36b55b627 SHA512 89e1dde9592f2cc3ed391f6f3ad29b877751b95b0c1bbb4416cd0c38f136c4a293f4687ebb5758adab540d6f3ff63f20f43847e294644c9e68ee84f3223657ac WHIRLPOOL fd7bf363f8a45db96a14e83625a63c0333a7527cc664b323fa2aa5cd40043e0094441052fa701e687cd115a3eded20f9a2aa5c18c9226cbbe6a559fbc95a622d
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.03-sysmacros.patch b/sys-boot/syslinux/files/syslinux-6.03-sysmacros.patch
new file mode 100644
index 000000000000..af464fe534e1
--- /dev/null
+++ b/sys-boot/syslinux/files/syslinux-6.03-sysmacros.patch
@@ -0,0 +1,34 @@
+https://bugs.gentoo.org/579928
+
+From d84db34dbe39d55b4d7e868764c056689aa0793b Mon Sep 17 00:00:00 2001
+From: Mike Frysinger <vapier@gentoo.org>
+Date: Tue, 19 Apr 2016 01:56:41 -0400
+Subject: [PATCH] extlinux: pull in sys/sysmacros.h for major/minor/makedev
+
+These functions are defined in sys/sysmacros.h, so add the include to
+main.c. This is already handled correctly in mountinfo.c. Otherwise
+we get build failures like:
+
+main.o: In function 'find_device_sysfs':
+extlinux/main.c:1131: undefined reference to 'minor'
+
+Signed-off-by: Mike Frysinger <vapier@gentoo.org>
+---
+ extlinux/main.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/extlinux/main.c b/extlinux/main.c
+index a7ebd49..ebff7ea 100644
+--- a/extlinux/main.c
++++ b/extlinux/main.c
+@@ -38,6 +38,7 @@
+ #include <sysexits.h>
+ #include <sys/ioctl.h>
+ #include <sys/stat.h>
++#include <sys/sysmacros.h>
+ #include <sys/types.h>
+ #include <sys/mount.h>
+ #include <sys/vfs.h>
+--
+2.7.4
+
diff --git a/sys-boot/syslinux/metadata.xml b/sys-boot/syslinux/metadata.xml
new file mode 100644
index 000000000000..dbe176cabd0d
--- /dev/null
+++ b/sys-boot/syslinux/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 type="person">
+ <email>chithanh@gentoo.org</email>
+</maintainer>
+<maintainer type="project">
+ <email>base-system@gentoo.org</email>
+ <name>Gentoo Base System</name>
+</maintainer>
+</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..2d346e659351
--- /dev/null
+++ b/sys-boot/syslinux/syslinux-3.86.ebuild
@@ -0,0 +1,55 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+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..961a36ebcac5
--- /dev/null
+++ b/sys-boot/syslinux/syslinux-4.07.ebuild
@@ -0,0 +1,68 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+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..978e1f047d96
--- /dev/null
+++ b/sys-boot/syslinux/syslinux-5.10.ebuild
@@ -0,0 +1,82 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+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.03.ebuild b/sys-boot/syslinux/syslinux-6.03.ebuild
new file mode 100644
index 000000000000..3dcc890decaf
--- /dev/null
+++ b/sys-boot/syslinux/syslinux-6.03.ebuild
@@ -0,0 +1,112 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+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
+
+ epatch "${FILESDIR}"/${PN}-6.03-sysmacros.patch #579928
+
+ # 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
+
+ # building with ld.gold causes problems, bug #563364
+ if tc-ld-is-gold; then
+ ewarn "Building syslinux with the gold linker may cause problems, see bug #563364"
+ if [[ -z "${I_KNOW_WHAT_I_AM_DOING}" ]]; then
+ tc-ld-disable-gold
+ ewarn "set I_KNOW_WHAT_I_AM_DOING=1 to override this."
+ else
+ ewarn "Continuing anyway as requested."
+ fi
+ fi
+}
+
+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/syslinux/syslinux-6.04_pre1.ebuild b/sys-boot/syslinux/syslinux-6.04_pre1.ebuild
new file mode 100644
index 000000000000..3dcc890decaf
--- /dev/null
+++ b/sys-boot/syslinux/syslinux-6.04_pre1.ebuild
@@ -0,0 +1,112 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+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
+
+ epatch "${FILESDIR}"/${PN}-6.03-sysmacros.patch #579928
+
+ # 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
+
+ # building with ld.gold causes problems, bug #563364
+ if tc-ld-is-gold; then
+ ewarn "Building syslinux with the gold linker may cause problems, see bug #563364"
+ if [[ -z "${I_KNOW_WHAT_I_AM_DOING}" ]]; then
+ tc-ld-disable-gold
+ ewarn "set I_KNOW_WHAT_I_AM_DOING=1 to override this."
+ else
+ ewarn "Continuing anyway as requested."
+ fi
+ fi
+}
+
+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/systemd-boot/Manifest b/sys-boot/systemd-boot/Manifest
new file mode 100644
index 000000000000..3cb5f24b94fc
--- /dev/null
+++ b/sys-boot/systemd-boot/Manifest
@@ -0,0 +1,5 @@
+AUX 233-Force-libsystemd-shared-to-be-static.patch 601 SHA256 bea583b588b90d5a5395048fddbfe4671e9eb1a3bdaf47544b0a181dfa9f6dac SHA512 05e666114764a97d20bf115e1b114035fc882b101ad01bde8864a31385886e0711e4b37e03d713052aa985503cf7a94eeb5d28c33cc4a504cbb4fc263998d4e1 WHIRLPOOL 2987133747f15dc8bf19f5ce2509a27c29e8cac29fa3cea2aa26fced5e816f39a309620d56f7f226039ea69ab3e5e11ae2ab98dfdce3750262a11537c05d5707
+DIST systemd-233.tar.gz 4660737 SHA256 8b3e99da3d4164b66581830a7f2436c0c8fe697b5fbdc3927bdb960646be0083 SHA512 5ad5329ea116d973cf67096f7e7ad28e9ea0905696e9451291f1d25e5064f4a9bfcfae87e912996c6a38397e9f4a148d4ccecfa9b70f7ecdf04deadb61784c8e WHIRLPOOL ce19f6a546b8f899cfa952e49d47f063fd29186be4a53391bc30ea2c487eb2c140a74ad843a1dc499bb61bba3e9ca055613852291e38b85af5d79c59409dc176
+EBUILD systemd-boot-233.ebuild 2118 SHA256 a14d60c2a42c71ebf7c46320bb67aa6ac5bd07c3962e8101edea22447fe3a8d0 SHA512 aa7f7259549b397403b7a539015f1435c47e2933d0f67c68e0a633393fc64ac4bb0fac99d7860d400e9da8f68dbc8235340426ceab715e51f4881fbc991ecfa8 WHIRLPOOL 2fb71f53c50b3e50aaf65ac4531ae26557d182eb0cf409cb3b045a72e1b0438a59340e809b09a37b81bf48d5e70ff40490e10d870edcb3c0fb09bbab791dc83f
+MISC ChangeLog 1089 SHA256 0c62560cd19a3c9ab743e6d3448a377940679713665237c52c298c4bafd37609 SHA512 4bdd3605a1d10e2a7a288e59b40f84f8d1ddc13934b533fdb529856d88c256fd8386732d9ceeb54309add48f153b1d5eb65872f6502a7edae6fe78cc7922a54a WHIRLPOOL 8745a0810f3fea2565eca895b2f89a3f742f0be40b6b2f83f1a0087cbfe984dabcbbe91c872910e73d1d7d6c8c91e4ea797af136e4545024d8e5cd9d64a757f6
+MISC metadata.xml 326 SHA256 34ba1807453912614ec297b91439f8294b267d052561d599f2ed24ea459d219d SHA512 7d33f5273a066af06b319d04f9a01c2d8f14a6de2102cf77918d7abdf6846fd0b271f5c5adb503354f93402eb341af280853f20dbb673264196c552aa24eb6fe WHIRLPOOL a278cf5be263e4b220cf1337ae41136a5b478bb1b70d91a0472985e05d2ea02e871e2a858a6e63d69f060dc28550c07c322085f665128ec94c693128c8958a95
diff --git a/sys-boot/systemd-boot/files/233-Force-libsystemd-shared-to-be-static.patch b/sys-boot/systemd-boot/files/233-Force-libsystemd-shared-to-be-static.patch
new file mode 100644
index 000000000000..b837890f6162
--- /dev/null
+++ b/sys-boot/systemd-boot/files/233-Force-libsystemd-shared-to-be-static.patch
@@ -0,0 +1,25 @@
+From 5aefd5fddd2af5f979ece96cda8ed1ab0492709c Mon Sep 17 00:00:00 2001
+From: Mike Gilbert <floppym@gentoo.org>
+Date: Tue, 30 May 2017 14:05:41 -0400
+Subject: [PATCH] Force libsystemd-shared to be static
+
+---
+ Makefile.am | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/Makefile.am b/Makefile.am
+index 2a5610740..4e95cb316 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -1145,7 +1145,7 @@ libshared_la_LIBADD = \
+ $(BLKID_LIBS) \
+ $(LIBCRYPTSETUP_LIBS)
+
+-rootlibexec_LTLIBRARIES += \
++noinst_LTLIBRARIES += \
+ libsystemd-shared.la
+
+ libsystemd_shared_la_SOURCES = \
+--
+2.13.0
+
diff --git a/sys-boot/systemd-boot/metadata.xml b/sys-boot/systemd-boot/metadata.xml
new file mode 100644
index 000000000000..709bb609069e
--- /dev/null
+++ b/sys-boot/systemd-boot/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 type="person">
+ <email>floppym@gentoo.org</email>
+ <name>Mike Gilbert</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="github">systemd/systemd</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-boot/systemd-boot/systemd-boot-233.ebuild b/sys-boot/systemd-boot/systemd-boot-233.ebuild
new file mode 100644
index 000000000000..313b919e089d
--- /dev/null
+++ b/sys-boot/systemd-boot/systemd-boot-233.ebuild
@@ -0,0 +1,111 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit autotools toolchain-funcs
+
+DESCRIPTION="UEFI boot manager from systemd (formerly gummiboot)"
+HOMEPAGE="https://www.freedesktop.org/wiki/Software/systemd/systemd-boot/"
+SRC_URI="https://github.com/systemd/systemd/archive/v${PV}.tar.gz -> systemd-${PV}.tar.gz"
+
+LICENSE="GPL-2 LGPL-2.1 MIT public-domain"
+SLOT="0"
+KEYWORDS="~amd64"
+IUSE=""
+RESTRICT="test"
+
+COMMON_DEPEND="
+ >=sys-apps/util-linux-2.27.1
+"
+DEPEND="${COMMON_DEPEND}
+ app-text/docbook-xml-dtd:4.2
+ app-text/docbook-xml-dtd:4.5
+ app-text/docbook-xsl-stylesheets
+ dev-libs/libxslt:0
+ >=dev-util/intltool-0.50
+ dev-util/gperf
+ >=sys-boot/gnu-efi-3.0.2
+ sys-libs/libcap
+ virtual/pkgconfig
+"
+RDEPEND="${COMMON_DEPEND}
+ !sys-apps/systemd
+"
+
+S="${WORKDIR}/systemd-${PV}"
+
+PATCHES=(
+ "${FILESDIR}"/233-Force-libsystemd-shared-to-be-static.patch
+)
+
+src_prepare() {
+ default
+ eautoreconf
+}
+
+src_configure() {
+ local myeconfargs=(
+ EFI_CC="$(tc-getPROG "EFI_CC CC" gcc)"
+ cc_cv_CFLAGS__flto=no
+ cc_cv_LDFLAGS__Wl__fuse_ld_gold=no
+ --enable-blkid
+ --enable-efi
+ --enable-gnuefi
+ --disable-acl
+ --disable-apparmor
+ --disable-audit
+ --disable-bzip2
+ --disable-elfutils
+ --disable-gcrypt
+ --disable-gnutls
+ --disable-kmod
+ --disable-libcryptsetup
+ --disable-libcurl
+ --disable-libidn
+ --disable-lz4
+ --disable-microhttpd
+ --disable-myhostname
+ --disable-pam
+ --disable-qrencode
+ --disable-seccomp
+ --disable-selinux
+ --disable-xkbcommon
+ --disable-xz
+ --disable-zlib
+ )
+ econf "${myeconfargs[@]}"
+}
+
+src_compile() {
+ local targets=(
+ bootctl
+ man/bootctl.1
+ man/kernel-install.8
+ '$(bootlib_DATA)'
+ )
+ emake built-sources
+ echo "gentoo: ${targets[*]}" | emake -f Makefile -f - gentoo
+}
+
+src_install() {
+ local args=(
+ DESTDIR="${D%/}"
+
+ # bootctl
+ bin_PROGRAMS=bootctl
+ install-binPROGRAMS
+
+ # kernel-install
+ install-dist_binSCRIPTS
+ install-dist_kernelinstallSCRIPTS
+
+ man_MANS="man/bootctl.1 man/kernel-install.8"
+ install-man1
+ install-man8
+
+ install-bootlibDATA
+ )
+ emake "${args[@]}"
+ einstalldocs
+}
diff --git a/sys-boot/systemrescuecd-x86-grub/Manifest b/sys-boot/systemrescuecd-x86-grub/Manifest
new file mode 100644
index 000000000000..f742c572d412
--- /dev/null
+++ b/sys-boot/systemrescuecd-x86-grub/Manifest
@@ -0,0 +1,5 @@
+AUX systemrescuecd.default 845 SHA256 63831f0da197cd3c4da52540ae23df67e4722a5bab34206718dc06a98112ae70 SHA512 81aebf9999cfe82696fc72f520fc88355fc8d3077a1c76858175f3367d33119db96c6cb639935b01d32ab1f1d0aaa1c41b7ea3b12e1c732e474de519cb50b2d6 WHIRLPOOL 909fbfcafc118e5abcf4d5e1b6452dce321903d0f89f162acd236f2216f01b10f8f1487b9c41924d29c42ff44cec481a451ae851406bc9b929967d9ec09d79de
+AUX systemrescuecd.grub 1910 SHA256 3cf041d995310ea349592d714cf490e2cc5bd5b2dabfabcc77503675cae7c145 SHA512 34c8f4445589d58ddf0e0088184bfdc56f8fab19bbffc2cf0ac2646710eefe8b654066de196b3eb18377198dba38a2fa4b9a9b89f130a15a3ac2a94b75c7366e WHIRLPOOL 918cc10682f1c8fa49a76a245458e18774ed7786cbcf97af7adcd73c7712f327e02774d9e8524788f06bcb8fb0faa4d7dc083a068fb59cd0ee0fae6c76c631c3
+EBUILD systemrescuecd-x86-grub-0.1.ebuild 759 SHA256 869de08b6c51773a2679195f067848f0c6af68101cf6dc470bcc4b347e5b044a SHA512 43ea43f4532f6ef3a69089aef6ca286fba2ebfee6c1fec9295c5fb37eb6c1c350de67fd37ccb8c2c428ed7cc2c8a18ca1cc83a4db2ea21f4dbf71fbf0e8d7900 WHIRLPOOL c9b123c0d5caa864d586b74f3939a8fba2315682a9fb6ad09b572705dc62eedc526a4ea89d77b679cdaea9f3c69fa423e7f2861e29006e218f06d60c7e2347bf
+MISC ChangeLog 989 SHA256 c9bdc9fa79db4b6cdfec802dc3495909c1a6edcedfc7ab9c130a2b3aec94dda3 SHA512 6290427004612ce0a92ffcb70926b8b4b7775b152532252309fe8021cfc6ba8068165988a8a533436cf33deef574ef316155cb8f51d23d7b8fbd4887491dcfe6 WHIRLPOOL 9c63ebfe6853d49db31205a5e90fbbdf2660cde0434e2e33ca5d2449a119130a0e04115af482168625ac26fd28322e61e999145367cbc1055a69d18606129d52
+MISC metadata.xml 610 SHA256 4eefce26d0916183c95f484e5852fa3f426da6a4306e9914327dd5e82d953879 SHA512 84101ca441d24894df8063a2d82ecf7f516bb6c3255d6b147b1448e27874f2ff634c5822f925a6648010fa83c6e75d60159237a44b99cd5a031e19174a17295d WHIRLPOOL b21ad5b66b0ee635b010eba5ca7e9911a7cdce4a2172f2b35a36288400c79f904a8f51a26534c2f3400bf6fe4d43fcac59271e8b0ec90182bc89d69d098f8985
diff --git a/sys-boot/systemrescuecd-x86-grub/files/systemrescuecd.default b/sys-boot/systemrescuecd-x86-grub/files/systemrescuecd.default
new file mode 100644
index 000000000000..d9b2d0b8db7d
--- /dev/null
+++ b/sys-boot/systemrescuecd-x86-grub/files/systemrescuecd.default
@@ -0,0 +1,21 @@
+# Here you can set custom bootoptions for the SystemRescueCD
+#
+# You can add for example in a space separated list:
+# setkmap=xx: which defines the keymap to load (example: setkmap=de)
+# dostartx: load the X.Org graphical environment and launch Xfce
+# docache: causes the iso file to be fully loaded into memory
+# this requires 400MB of memory to cache everything
+# doload=xxx: loads needed kernel modules (example: doload=3c59x,e1000)
+# noload=xxx: prevents loading kernel modules
+# nomodeset: do not load the Kernel-Mode-Setting video driver
+#
+# Example:
+# SRCD_BOOTOPTIONS="setkmap=de docache dostartx"
+#
+# For all available bootoptions see:
+# http://www.sysresccd.org/Sysresccd-manual-en_Booting_the_CD-ROM
+#
+# Note:
+# After changing this, you must update your grub configuration file, to take effect
+
+SRCD_BOOTOPTIONS=""
diff --git a/sys-boot/systemrescuecd-x86-grub/files/systemrescuecd.grub b/sys-boot/systemrescuecd-x86-grub/files/systemrescuecd.grub
new file mode 100644
index 000000000000..e9695c4b4821
--- /dev/null
+++ b/sys-boot/systemrescuecd-x86-grub/files/systemrescuecd.grub
@@ -0,0 +1,64 @@
+#!/bin/sh
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+. /usr/share/grub/grub-mkconfig_lib
+
+if [ -r /etc/default/systemrescuecd ] ; then
+ . /etc/default/systemrescuecd
+fi
+
+# srcd = path of newest link to iso of systemrescuecd, created by the ebuild
+# of systemrescuecd-x86
+srcd="/usr/share/systemrescuecd/systemrescuecd-x86-newest.iso"
+
+longname="SystemRescueCD"
+bootops=")"
+
+if [ ! -z "${SRCD_BOOTOPTIONS}" ]; then
+ bootops=" with bootoptions)"
+fi
+
+if [ -f "${srcd}" ]; then
+
+ device=$(${grub_probe} --target=device "${srcd}")
+ path=$(make_system_path_relative_to_its_root "${srcd}")
+ grub_string=$(prepare_grub_to_access_device "${device}" | grub_add_tab | grub_add_tab)
+
+ gettext_printf "Found %s on %s\n" "${longname}" "${device}" >&2
+ onstr=$(gettext_printf "(on %s)" "${device}")
+
+ cat << EOF
+submenu "${longname}" --class submenu {
+ menuentry "${longname} (32bit standard${bootops}" --class rescue {
+${grub_string}
+ set isofile=${srcd}
+ loopback loop \${isofile}
+ linux (loop)/isolinux/rescue32 ${SRCD_BOOTOPTIONS} isoloop=\${isofile}
+ initrd (loop)/isolinux/initram.igz
+ }
+ menuentry "${longname} (64bit standard${bootops}" --class rescue {
+${grub_string}
+ set isofile=${srcd}
+ loopback loop \${isofile}
+ linux (loop)/isolinux/rescue64 ${SRCD_BOOTOPTIONS} isoloop=\${isofile}
+ initrd (loop)/isolinux/initram.igz
+ }
+ menuentry "${longname} (32bit alternative${bootops}" --class rescue {
+${grub_string}
+ set isofile=${srcd}
+ loopback loop \${isofile}
+ linux (loop)/isolinux/altker32 ${SRCD_BOOTOPTIONS} isoloop=\${isofile}
+ initrd (loop)/isolinux/initram.igz
+ }
+ menuentry "${longname} (64bit alternative${bootops}" --class rescue {
+${grub_string}
+ set isofile=${srcd}
+ loopback loop \${isofile}
+ linux (loop)/isolinux/altker64 ${SRCD_BOOTOPTIONS} isoloop=\${isofile}
+ initrd (loop)/isolinux/initram.igz
+ }
+}
+EOF
+
+fi
diff --git a/sys-boot/systemrescuecd-x86-grub/metadata.xml b/sys-boot/systemrescuecd-x86-grub/metadata.xml
new file mode 100644
index 000000000000..2e146c34fc2e
--- /dev/null
+++ b/sys-boot/systemrescuecd-x86-grub/metadata.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>gentoobugs@milaw.biz</email>
+ <name>Michael Lange</name>
+ <description>Accepts only mails from Gentoo's Bugzilla</description>
+ </maintainer>
+ <maintainer type="person">
+ <email>mgorny@gentoo.org</email>
+ <name>Michał Górny</name>
+ </maintainer>
+ <longdescription>
+ This package adds menu entries in GRUB for the SystemRescueCD. You can
+ add custom bootoptions for SystemRescueCD in a special config file.
+ </longdescription>
+</pkgmetadata>
diff --git a/sys-boot/systemrescuecd-x86-grub/systemrescuecd-x86-grub-0.1.ebuild b/sys-boot/systemrescuecd-x86-grub/systemrescuecd-x86-grub-0.1.ebuild
new file mode 100644
index 000000000000..3a5d11ae858b
--- /dev/null
+++ b/sys-boot/systemrescuecd-x86-grub/systemrescuecd-x86-grub-0.1.ebuild
@@ -0,0 +1,32 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+DESCRIPTION="Grub menu entries for the .iso image of systemrescuecd-x86"
+HOMEPAGE="http://www.sysresccd.org/"
+SRC_URI=""
+
+LICENSE="GPL-2"
+SLOT=0
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+S=${WORKDIR}
+
+RDEPEND="app-admin/systemrescuecd-x86
+ sys-boot/grub"
+
+src_install() {
+ exeinto /etc/grub.d
+ newexe "${FILESDIR}"/systemrescuecd.grub 39_systemrescuecd
+
+ insinto /etc/default
+ newins "${FILESDIR}"/systemrescuecd.default systemrescuecd
+}
+
+pkg_postinst() {
+ elog "To add the menu entries for systemrescuecd to grub, you should now run"
+ elog " grub-mkconfig -o /boot/grub/grub.cfg"
+ elog "You can set custom bootoptions in /etc/default/systemrescuecd"
+}
diff --git a/sys-boot/tboot/Manifest b/sys-boot/tboot/Manifest
new file mode 100644
index 000000000000..87a8060cd582
--- /dev/null
+++ b/sys-boot/tboot/Manifest
@@ -0,0 +1,8 @@
+AUX tboot-1.9.5-genkernel-path.patch 2366 SHA256 3a351b6ab2bf2ae76f348bf125936968e8d580dd4e1dda5940c70135b1a61a2f SHA512 1b2e5d3a3c1af62e7f88143b1b7e7c1bfc8e222889f4ac63e648da348b030c757173700ba419f53c31c57bc0ba91d47afa0c2998f982a376bf33b0f8cd968f98 WHIRLPOOL 4d61e64821e7bdd6a9c3a2957060d7b1a3df8bf103f87b6ed837c2cce20e56bbe813c53fbdae47423d2d69920aeabb56be5e8a4e6fd6837173c5890220c9cb98
+DIST tboot-1.9.5.tar.gz 685460 SHA256 c7032e367ac0129493c9bb1fcd1437f400ff5533c970119ddce281ff4d58a13f SHA512 d806b692d3d57d0aaf4095ef514a2859b2b054ec695cb5589b3a6133eec7f7a9a0e76544e4b557df02add5ed67c3c15fb3ee5f17d6438252b659d6e5c7d17fe9 WHIRLPOOL 04843854b1a646d6126079a3b46bacf0c8191d5b5c322f8bc04ea39c0d5470bba2f7f2499761d42aa258552c1dfbeb626275e7473628b21719a6fe59bc05029c
+DIST tboot-1.9.6.tar.gz 693564 SHA256 1b55eed6ca8196b2a003936594248a242888ac34ff970eda651e7660c4772a39 SHA512 f53f5535f7ab031439514b43811cd2ec93efcb7614cb7bc7d1f3051d808d942e8a4942fd1d0ab6fe0c245740c2a10ba7adbcd44f2c42b2a577d9a20c0c5df90e WHIRLPOOL 889af09491c599d73976a0a4b456e9d01f44c47bffd047cb0f84ca786953b02c952a2d8c1fe873ac0390f6faffe7f41c0871e07f8c9466c9bc719f683dfc4a36
+EBUILD tboot-1.9.5-r1.ebuild 1606 SHA256 d2b1d41c3aae5a67354c776b5ae758e2a4a98dbd55d1163af7ff686fac2e6fb5 SHA512 abae3028d4cf2fda7cbbc8ce6b9a14af845e4fd5885278526debb8afd7db14b5aee5570b02c96935d5764a3ad98b68b53ff7e4ba9afedc78b48fdfde5a74f21d WHIRLPOOL 67c8f69e46e9079b68aad3ef7d6b00205d8960b944150bdf23198541010dad6e6526b62994f29ac78e87638fd728fa3453900cca379f5f0189717a7bb28081e2
+EBUILD tboot-1.9.6.ebuild 1606 SHA256 d2b1d41c3aae5a67354c776b5ae758e2a4a98dbd55d1163af7ff686fac2e6fb5 SHA512 abae3028d4cf2fda7cbbc8ce6b9a14af845e4fd5885278526debb8afd7db14b5aee5570b02c96935d5764a3ad98b68b53ff7e4ba9afedc78b48fdfde5a74f21d WHIRLPOOL 67c8f69e46e9079b68aad3ef7d6b00205d8960b944150bdf23198541010dad6e6526b62994f29ac78e87638fd728fa3453900cca379f5f0189717a7bb28081e2
+MISC ChangeLog 3369 SHA256 9851ed023a617cf2e7e0a6060e8b8d21f294cd6bca6d512b77dd63da4ac1993d SHA512 cb046d05f9c08029e63fcd01a198ab58859aebcbee13d858410efbd1f6c30be88df8e74fa35a6b14d0e1485a4304d078a2acead6fda4aa366d8009736d368d10 WHIRLPOOL e694be17912f560c5fab0d7dbcd717780d3ca4c628e0980aa8f19e27f92f29b977b9e1fa4a67646c79e644c008673ed12b37811b57540590c7a1ffe80de29a1c
+MISC ChangeLog-2015 472 SHA256 89cb089f9ab0625e7faf0b85fd9391125146e9b8a870288e6c20410edbcd2d5a SHA512 5d3882c8a3f4a682b70ea6d8373e6c8c91bd5471bec0b4bdbe074628951c76780726a3d8e73c1d30f1a0a66e961c436016db375e8619e88a67e1c0492e17fbad WHIRLPOOL 9d147ee23ec5b6255ea67ee666fad26afe630d07b4774e0e02e2d9dee007a474aacd34c28daa0362b91ff340b0a9b30cd7d3089207c9ca45a9b9e4b20c6ec8a5
+MISC metadata.xml 507 SHA256 6fb6773f5ae99f9a1f5454b09b46d5dddaedd563945bc0f0e81bdada049f81a9 SHA512 d32632b8a672121164071b95f681213874f9ff0b47fabddc96eb3a60cfa4491c01dd5334af55dd1964c72cd437eb146ee7a0c4a3c0e99fb96c556db5de4d9e36 WHIRLPOOL d5283f6d70cf5b564f9108216a97b66af82a02e19b6e1fb2f7405699cf67bb6e24dd4216415db83421bef79cae579d374bd653294c5ae2c0cef0c3f7b522abcb
diff --git a/sys-boot/tboot/files/tboot-1.9.5-genkernel-path.patch b/sys-boot/tboot/files/tboot-1.9.5-genkernel-path.patch
new file mode 100644
index 000000000000..4914be6e4e7d
--- /dev/null
+++ b/sys-boot/tboot/files/tboot-1.9.5-genkernel-path.patch
@@ -0,0 +1,60 @@
+diff -ur tboot-1.9.5.orig/tboot/20_linux_tboot tboot-1.9.5/tboot/20_linux_tboot
+--- tboot-1.9.5.orig/tboot/20_linux_tboot 2016-12-21 06:29:15.000000000 +0800
++++ tboot-1.9.5/tboot/20_linux_tboot 2017-08-02 23:33:52.732748172 +0800
+@@ -171,6 +171,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")
+@@ -217,7 +226,9 @@
+ "initrd.img-${alt_version}" "initrd-${alt_version}.img" \
+ "initrd-${alt_version}" "initramfs-${alt_version}.img" \
+ "initramfs-genkernel-${version}" \
+- "initramfs-genkernel-${alt_version}"; do
++ "initramfs-genkernel-${alt_version}" \
++ "initramfs-genkernel-${GENKERNEL_ARCH}-${version}" \
++ "initramfs-genkernel-${GENKERNEL_ARCH}-${alt_version}"; do
+ if test -e "${dirname}/${i}" ; then
+ initrd="$i"
+ break
+diff -ur tboot-1.9.5.orig/tboot/20_linux_xen_tboot tboot-1.9.5/tboot/20_linux_xen_tboot
+--- tboot-1.9.5.orig/tboot/20_linux_xen_tboot 2016-12-21 06:29:54.000000000 +0800
++++ tboot-1.9.5/tboot/20_linux_xen_tboot 2017-08-02 23:34:01.347685520 +0800
+@@ -165,6 +165,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]-* /boot/kernel-*; do
+ if grub_file_is_not_garbage "$i"; then
+ basename=$(basename $i)
+@@ -232,7 +241,9 @@
+ "initrd-${version}" "initrd.img-${alt_version}" \
+ "initrd-${alt_version}.img" "initrd-${alt_version}" \
+ "initramfs-genkernel-${version}" \
+- "initramfs-genkernel-${alt_version}" ; do
++ "initramfs-genkernel-${alt_version}" \
++ "initramfs-genkernel-${GENKERNEL_ARCH}-${version}" \
++ "initramfs-genkernel-${GENKERNEL_ARCH}-${alt_version}"; do
+ if test -e "${dirname}/${i}" ; then
+ initrd="$i"
+ break
diff --git a/sys-boot/tboot/metadata.xml b/sys-boot/tboot/metadata.xml
new file mode 100644
index 000000000000..a607f9b9a029
--- /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 type="person">
+ <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.9.5-r1.ebuild b/sys-boot/tboot/tboot-1.9.5-r1.ebuild
new file mode 100644
index 000000000000..9e6d141c268e
--- /dev/null
+++ b/sys-boot/tboot/tboot-1.9.5-r1.ebuild
@@ -0,0 +1,71 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit flag-o-matic mount-boot
+
+DESCRIPTION="Performs a measured and verified boot using Intel Trusted Execution Technology"
+HOMEPAGE="https://sourceforge.net/projects/tboot/"
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~amd64 ~x86 -*"
+IUSE="custom-cflags selinux"
+
+# requires patching the kernel src
+RESTRICT="test"
+
+DEPEND="app-crypt/trousers
+app-crypt/tpm-tools
+dev-libs/openssl:0=[-bindist]"
+
+RDEPEND="${DEPEND}
+sys-boot/grub:2
+selinux? ( sec-policy/selinux-tboot )"
+
+DOCS=(README COPYING CHANGELOG)
+PATCHES=( "${FILESDIR}/${PN}-1.9.5-genkernel-path.patch" )
+
+src_prepare() {
+ sed -i 's/ -Werror//g' Config.mk || die
+ sed -i 's/^INSTALL_STRIP = -s$//' Config.mk || die # QA Errors
+
+ default
+}
+
+src_compile() {
+ use custom-cflags && export TBOOT_CFLAGS=${CFLAGS} || unset CCASFLAGS CFLAGS CPPFLAGS LDFLAGS
+
+ if use amd64; then
+ export MAKEARGS="TARGET_ARCH=x86_64"
+ else
+ export MAKEARGS="TARGET_ARCH=i686"
+ fi
+
+ default
+}
+
+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/tboot/tboot-1.9.6.ebuild b/sys-boot/tboot/tboot-1.9.6.ebuild
new file mode 100644
index 000000000000..9e6d141c268e
--- /dev/null
+++ b/sys-boot/tboot/tboot-1.9.6.ebuild
@@ -0,0 +1,71 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit flag-o-matic mount-boot
+
+DESCRIPTION="Performs a measured and verified boot using Intel Trusted Execution Technology"
+HOMEPAGE="https://sourceforge.net/projects/tboot/"
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~amd64 ~x86 -*"
+IUSE="custom-cflags selinux"
+
+# requires patching the kernel src
+RESTRICT="test"
+
+DEPEND="app-crypt/trousers
+app-crypt/tpm-tools
+dev-libs/openssl:0=[-bindist]"
+
+RDEPEND="${DEPEND}
+sys-boot/grub:2
+selinux? ( sec-policy/selinux-tboot )"
+
+DOCS=(README COPYING CHANGELOG)
+PATCHES=( "${FILESDIR}/${PN}-1.9.5-genkernel-path.patch" )
+
+src_prepare() {
+ sed -i 's/ -Werror//g' Config.mk || die
+ sed -i 's/^INSTALL_STRIP = -s$//' Config.mk || die # QA Errors
+
+ default
+}
+
+src_compile() {
+ use custom-cflags && export TBOOT_CFLAGS=${CFLAGS} || unset CCASFLAGS CFLAGS CPPFLAGS LDFLAGS
+
+ if use amd64; then
+ export MAKEARGS="TARGET_ARCH=x86_64"
+ else
+ export MAKEARGS="TARGET_ARCH=i686"
+ fi
+
+ default
+}
+
+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/udk/Manifest b/sys-boot/udk/Manifest
new file mode 100644
index 000000000000..f2f4052bb6b7
--- /dev/null
+++ b/sys-boot/udk/Manifest
@@ -0,0 +1,6 @@
+AUX 2015-makefile.template 1543 SHA256 4cc009c29bc9008c6ba0aa2736187b99f11e60464111dd78e3ff0bec9a340786 SHA512 c09aca05b07dbd5d2ac1979b98d889e0a2a44e6c12292cca5c6033e1c094acbf155ef1649a7f0b923e3062f4f2fd8f650f57523625628a29828c22ef1f95b405 WHIRLPOOL 6fa49719a477da3feb4d5a9fd9c5d35f0fd964cd914615aa356b97be4da5fcddb2c00d480210d852ac61b3992f158e845182e3571e893a840b70c87cdd698ca2
+AUX 2015-tools_def.template 2575 SHA256 689949a05a2a99c1b6d9bab38667985029f6f7d0a21fa56d8c69ce753dcd769c SHA512 7bf9e23434ec6e4abaf525a857719d5ddf3c355a4dd2f2f6666db62cfb9b9f981180a4886d9e98f43b82b2b4a397a862201ded196ed12726b2f813d5a61bbc86 WHIRLPOOL 376a8bbf7ee1dc829c4f6fb1a4b8f28572fe43ff6a516bf19884ed1e4774358624e5ed57fdf8648742c170f5ff01169569d4e61855fbbfb6e6cfdbf26034caae
+DIST UDK2015.Complete.MyWorkSpace.zip 121736982 SHA256 ff11e68feafae13510ad5ee951bf7b219b3483ab335c1d0c85f45a5b7ba48b5e SHA512 7856a8f29296f817e8fd09d8eaf7207f4e25a13faa10936d1ceb10cb6a900be265379722c0ade0ef93b1c640fef8693667d2567962e3288b20ae77f607f03d39 WHIRLPOOL 8b1e283e0ae3ec422eea609a418784260119410a87c5397803730f1c73be0b113eec41ed4cd1920d32735a23377acd80bedf1867518733be6d698c3891775276
+EBUILD udk-2015.ebuild 8401 SHA256 0cf669eaca16ee872f7e49dc67ae73944021954847aa2e74eac1ed7257e24e9e SHA512 7cd8fa58cb06e9d9bfbe93c8f2b84a0579706422d12ce3eb970b319b4025f191fb0d2578d70e6d28045d12c8fc12419951b83163e77671ac8ee2e0d355e82a22 WHIRLPOOL 7f07173812c7d27627864cf414e92b8c0120ccb34359a5fe5e36ea457b4c36e191793f25ef1347832e736f75a8f6dba047b2b69022f6e81beae67bc86af52ee9
+MISC ChangeLog 799 SHA256 951d1dc2b800802013f538775b4cf1a8c7c33490e77b502232d1c662706dc531 SHA512 983f5ece33654f612c1034ce633e6ed5c7696e19048e926093d99a74ee031e3e6d5c34c5a4f0bc2709cb536ca02688e1eae600438873fd377a6a92ae40298682 WHIRLPOOL d363134dd6e65d627561e79f1f99ba00a7f1c1483f4e6ca4d560ec006338ac6a411c4eaa3cafd464003ec6961d40dbdf607581e464e1c586fdfbde76d29b951a
+MISC metadata.xml 721 SHA256 0b8f3ba65452abb55f323dd8a2c7bdc52f40fa967cdc5f3c95380fa36e656682 SHA512 20ac00286729ab06e607513002f2bcfe75866108914015d11a3139f95073b393c62046832fd3295f4e849a5cc810b996f0ca8b589cc6639e726563110e1c60fe WHIRLPOOL 0285d410c73903cf5c3be60b647069c76eb6d303fcfc3314b5da9b14a602589d5064b29723bc61bac26c0da25c608de153e4e190cbe6973ff640c702224494ae
diff --git a/sys-boot/udk/files/2015-makefile.template b/sys-boot/udk/files/2015-makefile.template
new file mode 100644
index 000000000000..c8ae8b6b420e
--- /dev/null
+++ b/sys-boot/udk/files/2015-makefile.template
@@ -0,0 +1,54 @@
+TOP := $(abspath $(dir $(lastword $(MAKEFILE_LIST))))
+EXEC = «MODULE».efi
+SRC = $(shell find $(TOP) -type f -name '*.c')
+OBJ = $(SRC:.c=.o)
+INC_DIR = /usr/include/«PACKAGE_NAME»
+LIB_DIR = /usr/lib
+«STATIC_LIBS»
+
+EFI_LDS = $(LIB_DIR)/GccBase.lds
+
+«MODULE_TYPE»
+«IMAGE_ENTRY_POINT»
+
+«CP»
+«RM»
+«CC»
+«DLINK»
+«OBJCOPY»
+«GENFW»
+
+CC_FLAGS = -g -fshort-wchar -fno-strict-aliasing -Wall -Werror \
+ -Wno-array-bounds -ffunction-sections -fdata-sections -c -iquote$(TOP) \
+ -include AutoGen.h -I$(INC_DIR) -DSTRING_ARRAY_NAME=«MODULE»Strings -m64 \
+ -fno-stack-protector "-DEFIAPI=__attribute__((ms_abi))" -DNO_BUILTIN_VA_FUNCS \
+ -mno-red-zone -Wno-address -mcmodel=large -Wno-address \
+ -Wno-unused-but-set-variable
+DLINK_FLAGS=-nostdlib -n -q --gc-sections --entry $(IMAGE_ENTRY_POINT) \
+ -u $(IMAGE_ENTRY_POINT) -melf_x86_64 --oformat=elf64-x86-64 -L $(LIB_DIR) \
+ --script=$(EFI_LDS) --defsym=PECOFF_HEADER_SIZE=«PECOFF_HEADER_SIZE»
+«OBJCOPY_FLAGS»
+«GENFW_FLAGS»
+
+all: $(EXEC)
+
+%.efi: $(OBJ)
+ $(DLINK) -o $(@:.efi=.dll) $(DLINK_FLAGS) \
+ --start-group $(STATIC_LIBRARY_FILES) $^ --end-group
+ $(OBJCOPY) $(OBJCOPY_FLAGS) $(@:.efi=.dll)
+ $(CP) $(@:.efi=.dll) $(@:.efi=.debug)
+ $(OBJCOPY) --strip-unneeded -R .eh_frame $(@:.efi=.dll)
+ $(OBJCOPY) --add-gnu-debuglink=$(@:.efi=.debug) $(@:.efi=.dll)
+ $(GENFW) -e $(MODULE_TYPE) -o $@ $(@:.efi=.dll) $(GENFW_FLAGS)
+ $(RM) $(@:.efi=.dll)
+
+%.o: %.c
+ $(CC) $(CC_FLAGS) -o $@ $^
+
+clean:
+ $(RM) *.o
+
+mrproper: clean
+ $(RM) $(EXEC) $(EXEC:.efi=.debug)
+
+.PHONY: all clean mrproper
diff --git a/sys-boot/udk/files/2015-tools_def.template b/sys-boot/udk/files/2015-tools_def.template
new file mode 100644
index 000000000000..5c866354a85c
--- /dev/null
+++ b/sys-boot/udk/files/2015-tools_def.template
@@ -0,0 +1,42 @@
+
+#################
+# My custom toolchain
+#################
+*_CUSTOM_*_*_FAMILY = GCC
+*_CUSTOM_*_MAKE_PATH = make
+*_CUSTOM_*_ASL_PATH = DEF(UNIX_IASL_BIN)
+*_CUSTOM_*_OBJCOPY_PATH = «OBJCOPY»
+*_CUSTOM_*_CC_PATH = «CC»
+*_CUSTOM_*_SLINK_PATH = «AR»
+*_CUSTOM_*_DLINK_PATH = «LD»
+*_CUSTOM_*_ASLDLINK_PATH = «LD»
+*_CUSTOM_*_ASM_PATH = «CC»
+*_CUSTOM_*_PP_PATH = «CC»
+*_CUSTOM_*_VFRPP_PATH = «CC»
+*_CUSTOM_*_ASLCC_PATH = «CC»
+*_CUSTOM_*_ASLPP_PATH = «CC»
+*_CUSTOM_*_RC_PATH = «OBJCOPY»
+*_CUSTOM_*_PP_FLAGS = DEF(GCC_PP_FLAGS)
+*_CUSTOM_*_ASLPP_FLAGS = DEF(GCC_ASLPP_FLAGS)
+*_CUSTOM_*_ASLCC_FLAGS = DEF(GCC_ASLCC_FLAGS)
+*_CUSTOM_*_VFRPP_FLAGS = DEF(GCC_VFRPP_FLAGS)
+*_CUSTOM_*_APP_FLAGS =
+*_CUSTOM_*_ASL_FLAGS = DEF(IASL_FLAGS)
+*_CUSTOM_*_ASL_OUTFLAGS = DEF(IASL_OUTFLAGS)
+*_CUSTOM_*_OBJCOPY_FLAGS =
+*_CUSTOM_IA32_ASLCC_FLAGS = DEF(GCC_ASLCC_FLAGS) -m32
+*_CUSTOM_IA32_ASM_FLAGS = DEF(GCC_ASM_FLAGS) -m32 -march=i386
+*_CUSTOM_IA32_CC_FLAGS = «CFLAGS» -include AutoGen.h -DSTRING_ARRAY_NAME=$(BASE_NAME)Strings -D EFI32
+*_CUSTOM_IA32_ASLDLINK_FLAGS = -nostdlib -n -q --gc-sections -z common-page-size=0x40 --entry ReferenceAcpiTable -u ReferenceAcpiTable -m elf_i386
+*_CUSTOM_IA32_DLINK_FLAGS = -nostdlib -n -q --gc-sections -z common-page-size=0x40 --entry $(IMAGE_ENTRY_POINT) -u $(IMAGE_ENTRY_POINT) -Map $(DEST_DIR_DEBUG)/$(BASE_NAME).map -m elf_i386 --oformat=elf32-i386
+*_CUSTOM_IA32_DLINK2_FLAGS = DEF(GCC_DLINK2_FLAGS_COMMON) --defsym=PECOFF_HEADER_SIZE=0x220
+*_CUSTOM_IA32_RC_FLAGS = DEF(GCC_IA32_RC_FLAGS)
+*_CUSTOM_IA32_NASM_FLAGS = -f elf32
+*_CUSTOM_X64_ASLCC_FLAGS = DEF(GCC_ASLCC_FLAGS) -m64
+*_CUSTOM_X64_ASM_FLAGS = DEF(GCC_ASM_FLAGS) -m64
+*_CUSTOM_X64_CC_FLAGS = «CFLAGS» -include AutoGen.h -DSTRING_ARRAY_NAME=$(BASE_NAME)Strings "-DEFIAPI=__attribute__((ms_abi))" -DNO_BUILTIN_VA_FUNCS
+*_CUSTOM_X64_ASLDLINK_FLAGS = -nostdlib -n -q --gc-sections -z common-page-size=0x40 --entry ReferenceAcpiTable -u ReferenceAcpiTable -m elf_x86_64
+*_CUSTOM_X64_DLINK_FLAGS = -nostdlib -n -q --gc-sections -z common-page-size=0x40 --entry $(IMAGE_ENTRY_POINT) -u $(IMAGE_ENTRY_POINT) -Map $(DEST_DIR_DEBUG)/$(BASE_NAME).map -m elf_x86_64 --oformat=elf64-x86-64
+*_CUSTOM_X64_DLINK2_FLAGS = DEF(GCC_DLINK2_FLAGS_COMMON) --defsym=PECOFF_HEADER_SIZE=0x228
+*_CUSTOM_X64_RC_FLAGS = DEF(GCC_X64_RC_FLAGS)
+*_CUSTOM_X64_NASM_FLAGS = -f elf64
diff --git a/sys-boot/udk/metadata.xml b/sys-boot/udk/metadata.xml
new file mode 100644
index 000000000000..422810daaa88
--- /dev/null
+++ b/sys-boot/udk/metadata.xml
@@ -0,0 +1,23 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>sveyret@gmail.com</email>
+ <name>Stéphane Veyret</name>
+ </maintainer>
+ <maintainer type="project">
+ <email>proxy-maint@gentoo.org</email>
+ <name>Proxy Maintainers</name>
+ </maintainer>
+ <longdescription lang="fr">
+ Kit de développement UEFI Tianocore, une version stable de portions du
+ projet EDK II.
+ </longdescription>
+ <longdescription lang="en">
+ Tianocore UEFI Development Kit, a stable release of portions of the
+ EDK II project.
+ </longdescription>
+ <upstream>
+ <remote-id type="github">tianocore/udk</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-boot/udk/udk-2015.ebuild b/sys-boot/udk/udk-2015.ebuild
new file mode 100644
index 000000000000..877b99c94eb1
--- /dev/null
+++ b/sys-boot/udk/udk-2015.ebuild
@@ -0,0 +1,247 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+PYTHON_COMPAT=( python2_7 )
+PYTHON_REQ_USE="sqlite"
+
+inherit flag-o-matic multiprocessing python-single-r1 toolchain-funcs versionator
+
+MY_V="${PN^^}$(get_version_component_range 1)"
+
+DESCRIPTION="Tianocore UEFI Development kit"
+HOMEPAGE=" https://github.com/tianocore/tianocore.github.io/wiki/EDK-II"
+SRC_URI="https://github.com/tianocore/${PN}/releases/download/${MY_V}/${MY_V}.Complete.MyWorkSpace.zip"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="doc examples"
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+RDEPEND="${PYTHON_DEPS}"
+DEPEND="${RDEPEND}
+ app-arch/unzip
+ dev-lang/nasm"
+
+S="${WORKDIR}/MyWorkSpace"
+
+pkg_setup() {
+ python_setup 'python2.7'
+
+ local uname_arch=$(uname -m | sed -e 's:i[3456789]86:IA32:')
+ if [[ ${uname_arch} == "x86_64" ]] || [[ ${uname_arch} == "amd64" ]] ; then
+ export ARCH=X64
+ else
+ export ARCH=${uname_arch}
+ fi
+
+ # We will create a custom toolchain with user defined settings
+ export TOOLCHAIN_TAG="CUSTOM"
+}
+
+src_unpack() {
+ unpack ${A}
+ unpack "${WORKDIR}/${MY_V}.MyWorkSpace.zip"
+
+ pushd "${S}" || die
+ unpack "${WORKDIR}/BaseTools(Unix).tar"
+
+ local doc_name
+ local f
+ if use doc; then
+ mkdir -p "${S}/doc" || die
+ pushd "${S}/doc" >/dev/null || die
+ for f in "${WORKDIR}/Documents/"*" Document.zip"; do
+ doc_name=$(echo ${f} | sed -e 's:^.*/\([^/]*\) Document[.]zip$:\1:')
+ if [[ -f "${WORKDIR}/Documents/${doc_name} Document.zip" ]]; then
+ unpack "${WORKDIR}/Documents/${doc_name} Document.zip"
+ mv "${S}/doc/html" "${S}/doc/${doc_name}" || die
+ fi
+ done
+ popd >/dev/null || die
+ fi
+
+ popd >/dev/null || die
+}
+
+src_configure() {
+ # Compile of Base Tools is required for further setting up the environment
+ # Base tools does not like parallel make
+ local cflags_save=${CFLAGS}
+ append-cflags $(test-flags-CC -MD) $(test-flags-CC -fshort-wchar)
+ append-cflags $(test-flags-CC -fno-strict-aliasing)
+ append-cflags $(test-flags-CC -nostdlib) $(test-flags-CC -c)
+ append-cflags $(test-flags-CC -fPIC)
+ sed -e "s:^\(CFLAGS\s*=\).*$:\1 ${CFLAGS}:" \
+ -i "${S}/BaseTools/Source/C/Makefiles/header.makefile" \
+ || die "Failed to update makefile header"
+ local make_flags=(
+ CC="$(tc-getCC)"
+ CXX="$(tc-getCXX)"
+ AS="$(tc-getAS)"
+ AR="$(tc-getAR)"
+ LD="$(tc-getLD)"
+ )
+ emake "${make_flags[@]}" -j1 -C BaseTools
+ . edksetup.sh BaseTools
+
+ # Update flags in UDK parameter files
+ CFLAGS=${cflags_save}
+ append-cflags $(test-flags-CC -fshort-wchar)
+ append-cflags $(test-flags-CC -fno-strict-aliasing) $(test-flags-CC -c)
+ append-cflags $(test-flags-CC -ffunction-sections)
+ append-cflags $(test-flags-CC -fdata-sections)
+ append-cflags $(test-flags-CC -fno-stack-protector)
+ append-cflags $(test-flags-CC -fno-asynchronous-unwind-tables)
+ if [[ "${ARCH}" == "X64" ]]; then
+ append-cflags $(test-flags-CC -m64) $(test-flags-CC -mno-red-zone)
+ append-cflags $(test-flags-CC -mcmodel=large)
+ else
+ append-cflags $(test-flags-CC -m32) $(test-flags-CC -malign-double)
+ fi
+ sed -e "s:^\(ACTIVE_PLATFORM\s*=\).*$:\1 MdeModulePkg/MdeModulePkg.dsc:" \
+ -e "s:^\(TARGET\s*=\).*$:\1 RELEASE:" \
+ -e "s:^\(TARGET_ARCH\s*=\).*$:\1 ${ARCH}:" \
+ -e "s:^\(TOOL_CHAIN_TAG\s*=\).*$:\1 ${TOOLCHAIN_TAG}:" \
+ -e "s:^\(MAX_CONCURRENT_THREAD_NUMBER\s*=\).*$:\1 $(makeopts_jobs):" \
+ -i "${S}/Conf/target.txt" || die "Failed to configure target file"
+ sed -e "s:«CC»:$(tc-getCC):" \
+ -e "s:«AR»:$(tc-getAR):" \
+ -e "s:«LD»:$(tc-getLD):" \
+ -e "s:«OBJCOPY»:$(tc-getOBJCOPY):" \
+ -e "s:«CFLAGS»:${CFLAGS}:" \
+ "${FILESDIR}/${PV}-tools_def.template" >>"${S}/Conf/tools_def.txt" \
+ || die "Failed to prepare tools definition file"
+}
+
+src_compile() {
+ local build_target
+ if use examples; then
+ build_target=all
+ else
+ build_target=libraries
+ fi
+
+ build ${build_target} || die "Failed to compile environment"
+}
+
+src_install() {
+ local f
+ local build_dir="${S}/Build/MdeModule/RELEASE_${TOOLCHAIN_TAG}/${ARCH}"
+
+ for f in "${build_dir}"/*/Library/*/*/OUTPUT/*.lib; do
+ newlib.a "${f}" lib$(basename "${f}" .lib).a
+ done
+ dolib "${S}/BaseTools/Scripts/GccBase.lds"
+
+ local include_dest="/usr/include/${PN}"
+ for f in "" /Guid /IndustryStandard /Library /Pi /Ppi /Protocol /Uefi; do
+ insinto "${include_dest}${f}"
+ doins "${S}/MdePkg/Include${f}"/*.h
+ done
+ insinto "${include_dest}"
+ doins "${S}/MdePkg/Include/${ARCH}"/*.h
+ local hfile
+ find "${S}" -name 'BaseTools' -prune -o -name 'MdePkg' -prune -o \
+ -name 'CryptoPkg' -prune -o -type d -name Include \
+ -exec find {} -maxdepth 0 \; \
+ | while read hfile; do
+ doins -r "${hfile}"/*
+ done
+
+ dobin "${S}/BaseTools/Source/C/bin/GenFw"
+
+ if use doc; then
+ docinto "html"
+ # Document installation may be very long, so split it and display message
+ for f in "${S}"/doc/*; do
+ ebegin "Installing documentation for $(basename ${f}), please wait"
+ dodoc -r "${f}"
+ eend $?
+ done
+ fi
+
+ local ex_rebuild_dir
+ local ex_name
+ local ex_build_dir
+ if use examples; then
+ ex_rebuild_dir="${S}/${P}-exemples"
+ for f in "${S}/MdeModulePkg/Application"/*; do
+ ex_name=$(basename "${f}")
+ ebegin "Preparing ${ex_name} example"
+ mkdir -p "${ex_rebuild_dir}/${ex_name}" || die
+ ex_build_dir="${build_dir}/MdeModulePkg/Application"
+ ex_build_dir="${ex_build_dir}/${ex_name}/${ex_name}"
+
+ copySourceFiles "${f}" "${ex_rebuild_dir}/${ex_name}"
+ copySourceFiles "${ex_build_dir}/DEBUG" "${ex_rebuild_dir}/${ex_name}"
+ createMakefile "${ex_rebuild_dir}/${ex_name}/Makefile" \
+ "${ex_name}" "${ex_build_dir}/GNUmakefile"
+
+ tar -C "${ex_rebuild_dir}" -cf "${ex_rebuild_dir}/${ex_name}.tar" \
+ "${ex_name}" || die
+
+ eend $? "Failed to create example file"
+ done
+ docinto "examples"
+ dodoc "${ex_rebuild_dir}"/*.tar
+ fi
+
+# TODO * QA Notice: The following files contain writable and executable sections
+# TODO * !WX --- --- usr/lib64/libBaseLib.a:Thunk16.obj
+# TODO * !WX --- --- usr/lib64/libBaseLib.a:SwitchStack.obj
+# TODO * !WX --- --- usr/lib64/libBaseLib.a:SetJump.obj
+# TODO * !WX --- --- usr/lib64/libBaseLib.a:LongJump.obj
+# TODO * !WX --- --- usr/lib64/libBaseLib.a:EnableDisableInterrupts.obj
+# TODO * !WX --- --- usr/lib64/libBaseLib.a:DisablePaging64.obj
+# TODO * !WX --- --- usr/lib64/libBaseLib.a:CpuId.obj
+# TODO * !WX --- --- usr/lib64/libBaseLib.a:CpuIdEx.obj
+# TODO * !WX --- --- usr/lib64/libBaseLib.a:EnableCache.obj
+# TODO * !WX --- --- usr/lib64/libBaseLib.a:DisableCache.obj
+# TODO * QA Notice: Package triggers severe warnings which indicate that it
+# TODO * may exhibit random runtime failures.
+# TODO * /usr/include/bits/string3.h:90:70: warning: call to void* __builtin___memset_chk(void*, int, long unsigned int, long unsigned int) will always overflow destination buffer
+}
+
+##
+# Parameters :
+# 1 - Path where to search for source files.
+# 2 - Path where source files must be copied.
+copySourceFiles() {
+ local dest_file
+ while read -d '' -r filename; do
+ dest_file="${2}${filename#${1}}"
+ mkdir -p $(dirname "${dest_file}") || die
+ mv "${filename}" "${dest_file}" || die
+ done < <(find "${1}" -name '*.h' -print0 -o -name '*.c' -print0)
+}
+
+##
+# Parameters :
+# 1 - Path of the file to create.
+# 2 - Name of the module.
+# 3 - Path of the generated Makefile.
+createMakefile() {
+ local static_libs=$(sed -n '/^STATIC_LIBRARY_FILES\s*=/,/^\s*\$(OUTPUT_DIR)/{/^\s*\$(OUTPUT_DIR)/b;p}' ${3} \
+ | sed -e 's:^\s*\$(BIN_DIR).*/\([^/]*\)\.lib:\t-l\1:' -e 's:\\$:\\\\\\n:' | tr --delete '\n')
+ local pecoff_header_size;
+ [[ $ARCH == X64 ]] && pecoff_header_size='0x228' || pecoff_header_size='0x220'
+ sed -e "s:«MODULE»:${2}:" \
+ -e "s:«PACKAGE_NAME»:${PN}:" \
+ -e "s:«STATIC_LIBS»:${static_libs}:" \
+ -e "s:«MODULE_TYPE»:$(grep -e '^MODULE_TYPE\s*=' ${3} | tail -1):" \
+ -e "s:«IMAGE_ENTRY_POINT»:$(grep -e '^IMAGE_ENTRY_POINT\s*=' ${3}):" \
+ -e "s:«CP»:$(grep -e '^CP\s*=' ${3}):" \
+ -e "s:«RM»:$(grep -e '^RM\s*=' ${3}):" \
+ -e "s:«CC»:$(grep -e '^CC\s*=' ${3}):" \
+ -e "s:«DLINK»:$(grep -e '^DLINK\s*=' ${3}):" \
+ -e "s:«OBJCOPY»:$(grep -e '^OBJCOPY\s*=' ${3}):" \
+ -e "s:«GENFW»:$(grep -e '^GENFW\s*=' ${3}):" \
+ -e "s:«PECOFF_HEADER_SIZE»:${pecoff_header_size}:" \
+ -e "s:«OBJCOPY_FLAGS»:$(grep -e '^OBJCOPY_FLAGS\s*=' ${3}):" \
+ -e "s:«GENFW_FLAGS»:$(grep -e '^GENFW_FLAGS\s*=' ${3}):" \
+ "${FILESDIR}/${PV}-makefile.template" >${1} \
+ || die "Failed to create Makefile"
+}
diff --git a/sys-boot/unetbootin/Manifest b/sys-boot/unetbootin/Manifest
new file mode 100644
index 000000000000..803f772c1776
--- /dev/null
+++ b/sys-boot/unetbootin/Manifest
@@ -0,0 +1,11 @@
+AUX unetbootin-581-desktop.patch 707 SHA256 f0baf1835aa8ae51d0c81a2a1a9bc9a6e77ee2f7b443931f525d9fff1bd56124 SHA512 036f887c7fb4209cd08710be88ef25671e8c1e481e3d82bc78cc1e3b1480224573cbbbf8c290846373937863400ee108b72521c1d6a9a883e01209c1da33cae2 WHIRLPOOL be30f248621adb6432c08821fbeb31d5605313a93ccfc397517e8a11c232c931a04affe2ed82aad6d8172a724ed8784465b99e0fdeb8b828b89a210511085070
+AUX unetbootin-647-frebootbutton.patch 301 SHA256 ac20c9974d8ba63855c6c6f8595ec37228986c08d4e8b6bcc08243236a676c69 SHA512 21a452adc3a4c157d99a785d65550e2dba4add3fe9ce8545d7e0588d1884d768a2557d5bedd025c592b5e6d40c038eaff64706ebf95e84df6c1c5355c06fcf0d WHIRLPOOL d5099df591ae9098bae4bafd4c661b032e5a2d90d7e1b1a909d6a2d607de10bf51beaa1f2ebe5d510f1c926783a06cb86b4cd36c0ded3680aa5319980a330df3
+DIST unetbootin-625.tar.gz 22671470 SHA256 1c63265cbbeccfb0c45978e5235a35fcdb6f40fdd6a8b438539c1785703d05a1 SHA512 0dc672097eb857f8516208f8cbe5a0ec3229aa5dbe56108f64c415d2d9d4679a41e3f8a4b7279c511197303a2e020c95293a305de4df2dc63dc4522b3d13259b WHIRLPOOL 2444d5ca7be19d1747de641e92bb4c255c0298faac9d446eadbb3ce0b28ed7a57822c83fdebce2aaeacefa3ca0718250ca967d12e2b4fb0e4135d88f042bc93c
+DIST unetbootin-647.tar.gz 16253287 SHA256 895e67366fa4b225037d7c74fc70f17932e4176fe0f784bdbb4062d5b838715f SHA512 487be195286dd1e7712afa86cb75f8a79a3acce77f5cbd2571ddad74533d84a90e17b96afecfd2c9831825975b6c562bfb218b583a042600c49a14179129e8bb WHIRLPOOL 72ab1d5598cdb4f1b456626d013bc27cd8871e301a8e36f5cfe01a3cadf6c94ccca37042641ae9fcb4a35287eed39f01a4f6e7ad115060efe279510eeaeafb41
+DIST unetbootin-655.tar.gz 16258032 SHA256 4b8b565933111c5ecea84b443b40e861f828ef10e5f6bb2342ea69b77703d705 SHA512 723b4c1499b5c9afd93e5ee3803c9ca18ee5ef5f7731797eedc194a2bbcc2c5be93cc6cb1059f8514f93a8c9e6d650aec40513f649b41382ae27c2f92389d709 WHIRLPOOL fa593fddc1407ae610cca0b76e2c723481a4c6bf8e5d2e85fc73ce431504cb151488bec41815eaddbd8eb90a3e50d604d483f86d12769bf36de646aa66c7b761
+EBUILD unetbootin-625.ebuild 1959 SHA256 10b5aa8cc535997358943a4dba656c61a4cb6846a966cdfec5676d952b5bf2e4 SHA512 afb27adbe35f5f0086dc7e36e51ea0ef1750d878fe34fce70feaa768ec78d28b1f40f0a2c2926977451869e9c8c60798d46402826252cd8a5edde87a2eba1be0 WHIRLPOOL a7fe684248245e05a877b168bd29e8b5ad9c5f91c0d2d0d1fb637ad52e4eb04456260db5cae8703e5cacf66c06840b96fa37758ff490eefbe1856d5f14a7f48b
+EBUILD unetbootin-647.ebuild 1885 SHA256 edf01efb0069829b71a3272d5cddd0a3366af82337359492cb91c54194afc56c SHA512 3468235ed6b64ec3075c771360b993669478844db1fec6184397b6adbf7f98b4933885de7ea370c02cf47c38dcb4250b0f99e1e619e34822ce21ddc32ac25b8f WHIRLPOOL 785a21e82564421ec6012213c90dff930f42e9eaaa40763997b639f402af2819da5c67e20af1d235a2ab46eb3d4cb8e759558b9d371d5dddb66cacd23c8e9da0
+EBUILD unetbootin-655.ebuild 1840 SHA256 c394d8e2f5f443271359fceec2574273a968fc124f8a6aae094554e3da75a06e SHA512 63377a246ad1e402bdee0b5f8e18a758263031edd241b0a71dbdf0c1676610acc012b823f6c588123d03caf77c6beb43ef955f342cf3d7fefe2ca2319423f278 WHIRLPOOL 94651045f2a0d86e93a39360755d09180a17a4d98338043e5ad8e86b2d0691a601b7a88b9a908d25c83b157685e60c3553c7ff335885adbcf8354bfb600cbe93
+MISC ChangeLog 3566 SHA256 8e5bf06a0e5afa92ad13d12d2d9c71532547759965426134d5748e62095b3056 SHA512 15c47f20a80ea5db6ffd59bcefbdf36f118b3cfec117c6a5f96141b7665d4bb0abd5fc681ec8f9e565569f62166f22057f7a396760cf526b92d94ec82d4a3d3a WHIRLPOOL 998da8ee021dfa24351d20112c08e34dfbcc4c02fc2a9341936a948195fab4fd3130e850e9e6d90939a57cd87566f19d989158801491f885cd5a2e6dd1a32cd8
+MISC ChangeLog-2015 13986 SHA256 12329fc1af8be2e6d566b47236b9076f5ee50046f8e8842debcc05f8f9f6011e SHA512 0934a896faae95865ec2723336de079ebd339f22c723ff26525a8a4b25fcb353d45b0b6cc22775af2d28916acfd1a14be9f43d1a331b8a3ad8dc28f63e2ae8d2 WHIRLPOOL de865f2c926e681d0f2d3124333bc736d1fb3c0b91d6ed4e4469440710a215eb6381cd43df33cae8eedddca366717202e502c57fe71dc4d17c5f63389db625ab
+MISC metadata.xml 385 SHA256 447ae7b425037b230a5c5e19e0487d1e6f19104e183f29df8a59f47583617b83 SHA512 9676e393ac2d18489433f0e658340a3eec0e01e0b35ca786540b07a6466f0b572f5d5bf115e6dc0b5c4898c00f630b9f5023f62f8e8f3a96c105bc74f918eb21 WHIRLPOOL cedbea9e98b3d83fadd5d045c0ab42432fe1d550334d36648bf4d0d395b6ba5abe3cdc0a82321bb60c763943e97ad207d333f37460c82f8c5264816b1404064b
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/files/unetbootin-647-frebootbutton.patch b/sys-boot/unetbootin/files/unetbootin-647-frebootbutton.patch
new file mode 100644
index 000000000000..d616d12c7406
--- /dev/null
+++ b/sys-boot/unetbootin/files/unetbootin-647-frebootbutton.patch
@@ -0,0 +1,10 @@
+--- a/unetbootin.ui
++++ b/unetbootin.ui
+@@ -708,7 +708,6 @@
+ <tabstop>driveselect</tabstop>
+ <tabstop>okbutton</tabstop>
+ <tabstop>cancelbutton</tabstop>
+- <tabstop>frebootbutton</tabstop>
+ <tabstop>fexitbutton</tabstop>
+ <tabstop>intromessage</tabstop>
+ <tabstop>rebootmsgtext</tabstop>
diff --git a/sys-boot/unetbootin/metadata.xml b/sys-boot/unetbootin/metadata.xml
new file mode 100644
index 000000000000..91ac65507330
--- /dev/null
+++ b/sys-boot/unetbootin/metadata.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>jer@gentoo.org</email>
+ <name>Jeroen Roovers</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="sourceforge">unetbootin</remote-id>
+ <remote-id type="github">unetbootin/unetbootin</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-boot/unetbootin/unetbootin-625.ebuild b/sys-boot/unetbootin/unetbootin-625.ebuild
new file mode 100644
index 000000000000..f6884665740b
--- /dev/null
+++ b/sys-boot/unetbootin/unetbootin-625.ebuild
@@ -0,0 +1,90 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+inherit eutils qmake-utils
+
+DESCRIPTION="UNetbootin installs Linux/BSD distributions to a partition or USB drive"
+HOMEPAGE="https://github.com/unetbootin/unetbootin"
+SRC_URI="${HOMEPAGE}/archive/${PV}.tar.gz -> ${P}.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
+
+ UNBN_QTPATH="$(qt4_get_bindir)/"
+ "${UNBN_QTPATH}"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-647.ebuild b/sys-boot/unetbootin/unetbootin-647.ebuild
new file mode 100644
index 000000000000..e449aefee55a
--- /dev/null
+++ b/sys-boot/unetbootin/unetbootin-647.ebuild
@@ -0,0 +1,89 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit eutils qmake-utils
+
+DESCRIPTION="UNetbootin installs Linux/BSD distributions to a partition or USB drive"
+HOMEPAGE="https://github.com/unetbootin/unetbootin"
+SRC_URI="${HOMEPAGE}/archive/${PV}.tar.gz -> ${P}.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
+"
+PATCHES=(
+ "${FILESDIR}/${PN}-581-desktop.patch"
+ "${FILESDIR}/${PN}-647-frebootbutton.patch"
+)
+
+src_prepare() {
+ default
+
+ # 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
+
+ # 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
+
+ UNBN_QTPATH="$(qt4_get_bindir)/"
+ "${UNBN_QTPATH}"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-655.ebuild b/sys-boot/unetbootin/unetbootin-655.ebuild
new file mode 100644
index 000000000000..453496db6670
--- /dev/null
+++ b/sys-boot/unetbootin/unetbootin-655.ebuild
@@ -0,0 +1,88 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit eutils qmake-utils
+
+DESCRIPTION="UNetbootin installs Linux/BSD distributions to a partition or USB drive"
+HOMEPAGE="https://github.com/unetbootin/unetbootin"
+SRC_URI="${HOMEPAGE}/archive/${PV}.tar.gz -> ${P}.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
+"
+PATCHES=(
+ "${FILESDIR}/${PN}-581-desktop.patch"
+)
+
+src_prepare() {
+ default
+
+ # 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
+
+ # 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
+
+ UNBN_QTPATH="$(qt4_get_bindir)/"
+ "${UNBN_QTPATH}"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..9a7d135d3ff2
--- /dev/null
+++ b/sys-boot/vboot-utils/Manifest
@@ -0,0 +1,13 @@
+AUX vboot-utils-42_p20150219-cgpt-static.patch 1092 SHA256 2b437033206b7f79a4e84912475066e8678bbbee987cc973a4e0b7a39f81a621 SHA512 bb01fbb11d015bc8e817e14e4326908d5338a9a3bb657004c8539b561e0be21c7f3ee9d2b43d8fcadc302ee9991effb65778d22b2a8ade92faa5234041288d4f WHIRLPOOL 32bf0459e775ccc4be2721f029fded8e9f8942fa71b7e8c1abb97b34a4494c3660ba0b194ba88c7c64895a59d5bfa8016393be958affaa37851f9ae6c34ea08a
+AUX vboot-utils-42_p20150219-sysmacros.patch 1228 SHA256 63b8ebedcc02f5b78f516bb85a7b07761e8503b3033245c680a7bf7f54e87d20 SHA512 50bb342dbe6266562d979e453f8744ad43cc859e35a2a9b6e5a420b0e395012d88bd631bc6c02b023cd58c80e0371932d8d7539a541d5adfc79b769659411fbc WHIRLPOOL 99c1d97f655ccde10dc194867d15d378394b55eb338075ef1c9df1f28c034c615a1b40c1c6386e83f44dbd0ba0c42d64c57074989de5cd79bb969b68b06b916e
+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
+DIST vboot-utils-51_p20160427.tar.xz 18377808 SHA256 6fc03136474c7cfd88074a9ffe7880dc83917cc0a6be344df422e3f851b50146 SHA512 5b9af2815b8939ae21f4e430744902ccd811627d668eaba709354901eb70553e57050b9068b07fecdfec5bb2ece0c11f1cf0f1a01c0e5f886d1913e1478fe3d7 WHIRLPOOL 4aa9c506c77596b3b598293872ada9cfc127d02f5cf23248ebf131612dcff38058f28bd61d22fc516dfacd7ff9c97d656795cdcce0dd07471930bcc085061a47
+DIST vboot-utils-59_p20170413.tar.xz 18431260 SHA256 1ce188295f4e3eea88dae2f2c541cbfdeca1755e0fdffd8fcea6744c52063535 SHA512 f92b9aed7a52ac7bab49b624725d4963564a22a03741619ad4ef1bc0a1fdee5123c68f3dad5bef9fb033f94f2a9ae99478c16386758fe4667a361bc91dda8048 WHIRLPOOL 636c3ceb75aabfac27796f785c2e4bbbbde1980d8f16dd1a985ef732a7ec883275ac7076754b762cf483668f6d55f8459ab9441f7a15f1f0925ed49728903c43
+EBUILD vboot-utils-1.0_p20130222.ebuild 1527 SHA256 55048db63487ee84e1c947bcceaefaaa33776ec103a645736c5f12a40b336e0d SHA512 0617df165249896f758a7f623edf0cc80e7ed470510097a5f60b3eab46dbfa7210d4500b80bebc2d38ac4b48b1ef60fef2bbcfed113ca2526c8fa640f2853433 WHIRLPOOL 3abb5b9cbbe5fa1471e35a50f1a7371c2afce340acd4355ae545209cdb2cb787f30e68b9d5733fed3904f390136c7952f4109724d5c11f7a8b24585459b81d2b
+EBUILD vboot-utils-42_p20150219.ebuild 2021 SHA256 6d879921ab18edb9d8f5481779322ca2162158585e6075d7389ea0b928e4980e SHA512 ebae142d837a43b011e8979597b42564ef22e990a1e84dc40f49b0263edfa5be49b770c551bd0bc167447bebb6edd2fc55c14289628aac9e8c51e9c7e9288568 WHIRLPOOL f185cc53b9966c61a17261ba9c3445265792819eb59b2487c0b45c7b9a160ac14171fe6873df45e4cfbb4778d84ac5b6cd00810c27394595c77867151acfdd97
+EBUILD vboot-utils-51_p20160427.ebuild 1950 SHA256 41d707449f65e0a26dec065da638317997bfbb827c4e74bca6ebe0a6c4fd0ff0 SHA512 4bf2d1bbcebe4d9396d606c58a5adcb0593b0189e049a6429ddf6966c3419a0f4349e7b3abd76ec58496c13d5f5a09dab79acf1278aa1a88eb408bdffc22cf4f WHIRLPOOL c8d174062af3dd7ee18c3045d8ad51d03cc8f43d98b92cad26a2a23986da5ba533c98e0cb381a3ce9ff150b18059f75749485dc4662a0196e89884257609333b
+EBUILD vboot-utils-59_p20170413.ebuild 1959 SHA256 e5f5fe6905d1d87b2909ca29ef7122781e696dc8afe9dccd92ac968dfabdc182 SHA512 111a065659df702beb8982fc65d1e8cf962156fed5e317b659d7480fa5751c9ea8fed7af9e7b81c549a3c1deb72691da570faadd59494d2cebd4521eb7976ea3 WHIRLPOOL efa716c9d7da72c0e2d800ce65ca69ebfb50c029f843eeb6003420d8b26218be1728e4b6780cad25a0d92a0dfebf5c4ac4f0a8aff41bf4ad0d82f43230829833
+MISC ChangeLog 3325 SHA256 11514f7cfad9dda3db2ef5a7e0fab4f890026cc35cd8e3b858c4ac2c1f5f0cb8 SHA512 8af81b1518ecdacc38c44b17ea989a7634d442a2ddb158770b99da630ddce72a7fd63da11b5382551dd267f1642694aea75c1e6a4adfc0515908bac1ac74c13b WHIRLPOOL 8a32ef0b8720163eab86aeb1f63fb3c832d93170b0572bd042e4e330412ca2b8d7149d7f81f84189bf7e89e58e4ca42cf47f7ac76a3df112a9ec772eaeb1398b
+MISC ChangeLog-2015 1024 SHA256 9485d4565e88468c45630fc99576c8482cc768af691288fc91b81643a6187835 SHA512 1baac9982d071db0d942384ed868069992dda387a12997a7ff8993c879916b0468ff9c67309b65f03d449710675e11b935226e9260d7133591224079445eed8a WHIRLPOOL 8dee9a32c3638d29121fced600e6561377c10b1950b529dcfd82e7ac99d92430c7c8444c1f9a115aa6448aba72127971cd290c7f7dc42edbdd9701aa187583c6
+MISC metadata.xml 565 SHA256 6c493730b67a4623a7370cfdfebd800de76d983c2e5246db6920f7b9cf8e3824 SHA512 247f753942d515dc4db5fdefefc925ae00ecab4577f3936841555655613d4159b0f3f837f9368cd77d21dfde8670b9dc9e7b8505fb4a9dfcbd923c19834a283d WHIRLPOOL 571fc3a4eadee1f51f62977d84b54acb4522c16f4b0239d7abb0a8ef0733fec9143113f8473a324f7c775259e9e3549e1662513248017a32410128e0881da349
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/files/vboot-utils-42_p20150219-sysmacros.patch b/sys-boot/vboot-utils/files/vboot-utils-42_p20150219-sysmacros.patch
new file mode 100644
index 000000000000..508f54076766
--- /dev/null
+++ b/sys-boot/vboot-utils/files/vboot-utils-42_p20150219-sysmacros.patch
@@ -0,0 +1,43 @@
+https://chromium-review.googlesource.com/339680
+https://bugs.gentoo.org/580554
+
+From 7fff56afefd4e63dce2366636c084d4c1f1f95d4 Mon Sep 17 00:00:00 2001
+From: Mike Frysinger <vapier@chromium.org>
+Date: Tue, 19 Apr 2016 13:58:49 -0400
+Subject: [PATCH] include sys/sysmacros.h for major()
+
+The major() func is defined in the sys/sysmacros.h header, so include it
+explicitly for the prototype. Upstream C libs are moving away from having
+sys/types.h include it all the time implicitly.
+
+BUG=None
+TEST=precq passes
+BRANCH=None
+
+Change-Id: I56b84138f08ded2376193403f9c9db22c5f24f71
+---
+
+diff --git a/cgpt/cgpt_wrapper.c b/cgpt/cgpt_wrapper.c
+index dcfaab9..1716cdd 100644
+--- a/cgpt/cgpt_wrapper.c
++++ b/cgpt/cgpt_wrapper.c
+@@ -18,6 +18,7 @@
+ #include <stdio.h>
+ #include <string.h>
+ #include <sys/stat.h>
++#include <sys/sysmacros.h>
+ #include <sys/types.h>
+ #include <unistd.h>
+
+diff --git a/futility/dump_kernel_config_lib.c b/futility/dump_kernel_config_lib.c
+index 4fe990c..abf37ae 100644
+--- a/futility/dump_kernel_config_lib.c
++++ b/futility/dump_kernel_config_lib.c
+@@ -10,6 +10,7 @@
+ #include <string.h>
+ #include <sys/mman.h>
+ #include <sys/stat.h>
++#include <sys/sysmacros.h>
+ #include <sys/types.h>
+ #include <unistd.h>
+
diff --git a/sys-boot/vboot-utils/metadata.xml b/sys-boot/vboot-utils/metadata.xml
new file mode 100644
index 000000000000..97022468c144
--- /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 type="person">
+ <email>zmedico@gentoo.org</email>
+ </maintainer>
+ <maintainer type="person">
+ <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..8a5b61a8c149
--- /dev/null
+++ b/sys-boot/vboot-utils/vboot-utils-1.0_p20130222.ebuild
@@ -0,0 +1,74 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+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..5b70868f8f2b
--- /dev/null
+++ b/sys-boot/vboot-utils/vboot-utils-42_p20150219.ebuild
@@ -0,0 +1,85 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+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="libressl minimal static"
+
+LIB_DEPEND="
+ !libressl? ( dev-libs/openssl:0=[static-libs(+)] )
+ libressl? ( dev-libs/libressl:0=[static-libs(+)] )
+ sys-apps/util-linux:=[static-libs(+)]"
+RDEPEND="!static? ( ${LIB_DEPEND//\[static-libs(+)]} )
+ !minimal? (
+ app-arch/xz-utils:=
+ dev-libs/libyaml:=
+ )"
+DEPEND="${RDEPEND}
+ static? ( ${LIB_DEPEND} )
+ app-crypt/trousers"
+
+S=${WORKDIR}
+
+src_prepare() {
+ epatch "${FILESDIR}"/${P}-cgpt-static.patch
+ epatch "${FILESDIR}"/${P}-sysmacros.patch #580554
+ sed -i \
+ -e 's: -Werror : :g' \
+ -e 's:${DESTDIR}/\(bin\|${LIBDIR}\):${DESTDIR}/usr/\1:g' \
+ -e 's:${DESTDIR}/default:${DESTDIR}/etc/default: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}" install
+
+ 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/vboot-utils/vboot-utils-51_p20160427.ebuild b/sys-boot/vboot-utils/vboot-utils-51_p20160427.ebuild
new file mode 100644
index 000000000000..67c54ce41195
--- /dev/null
+++ b/sys-boot/vboot-utils/vboot-utils-51_p20160427.ebuild
@@ -0,0 +1,84 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+inherit eutils toolchain-funcs
+
+# This is the latest commit in the latest branch.
+GIT_SHA1="48b1a50b086e39332d2e1e51a73434e39c40b329"
+
+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="libressl minimal static"
+
+LIB_DEPEND="
+ !libressl? ( dev-libs/openssl:0=[static-libs(+)] )
+ libressl? ( dev-libs/libressl:0=[static-libs(+)] )
+ sys-apps/util-linux:=[static-libs(+)]"
+RDEPEND="!static? ( ${LIB_DEPEND//\[static-libs(+)]} )
+ !minimal? (
+ app-arch/xz-utils:=
+ dev-libs/libyaml:=
+ )"
+DEPEND="${RDEPEND}
+ static? ( ${LIB_DEPEND} )
+ app-crypt/trousers"
+
+S=${WORKDIR}
+
+src_prepare() {
+ sed -i \
+ -e 's:${DESTDIR}/\(bin\|${LIBDIR}\):${DESTDIR}/usr/\1:g' \
+ -e 's:${DESTDIR}/default:${DESTDIR}/etc/default:g' \
+ Makefile || die
+}
+
+_emake() {
+ local arch=$(tc-arch)
+ emake \
+ V=1 \
+ QEMU_ARCH= \
+ ARCH=${arch} \
+ HOST_ARCH=${arch} \
+ LIBDIR="$(get_libdir)" \
+ DEBUG_FLAGS= \
+ WERROR= \
+ MINIMAL=$(usev minimal) \
+ STATIC=$(usev static) \
+ $(usex elibc_musl HAVE_MUSL=1 "") \
+ "$@"
+}
+
+src_compile() {
+ tc-export CC AR CXX PKG_CONFIG
+ _emake TEST_BINS= all
+}
+
+src_test() {
+ _emake runtests
+}
+
+src_install() {
+ _emake DESTDIR="${ED}" install
+
+ 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/vboot-utils/vboot-utils-59_p20170413.ebuild b/sys-boot/vboot-utils/vboot-utils-59_p20170413.ebuild
new file mode 100644
index 000000000000..15f315769e8d
--- /dev/null
+++ b/sys-boot/vboot-utils/vboot-utils-59_p20170413.ebuild
@@ -0,0 +1,85 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit eutils toolchain-funcs
+
+# This is the latest commit in the latest branch.
+GIT_SHA1="748af73c67abf473d45bbacd708ce79bfc264ff5"
+
+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="libressl minimal static"
+
+LIB_DEPEND="
+ !libressl? ( dev-libs/openssl:0=[static-libs(+)] )
+ libressl? ( dev-libs/libressl:0=[static-libs(+)] )
+ sys-apps/util-linux:=[static-libs(+)]"
+RDEPEND="!static? ( ${LIB_DEPEND//\[static-libs(+)]} )
+ !minimal? (
+ app-arch/xz-utils:=
+ dev-libs/libyaml:=
+ )"
+DEPEND="${RDEPEND}
+ static? ( ${LIB_DEPEND} )
+ app-crypt/trousers"
+
+S=${WORKDIR}
+
+src_prepare() {
+ default
+ sed -i \
+ -e 's:${DESTDIR}/\(bin\|${LIBDIR}\):${DESTDIR}/usr/\1:g' \
+ -e 's:${DESTDIR}/default:${DESTDIR}/etc/default:g' \
+ Makefile || die
+}
+
+_emake() {
+ local arch=$(tc-arch)
+ emake \
+ V=1 \
+ QEMU_ARCH= \
+ ARCH=${arch} \
+ HOST_ARCH=${arch} \
+ LIBDIR="$(get_libdir)" \
+ DEBUG_FLAGS= \
+ WERROR= \
+ MINIMAL=$(usev minimal) \
+ STATIC=$(usev static) \
+ $(usex elibc_musl HAVE_MUSL=1 "") \
+ "$@"
+}
+
+src_compile() {
+ tc-export CC AR CXX PKG_CONFIG
+ _emake TEST_BINS= all
+}
+
+src_test() {
+ _emake runtests
+}
+
+src_install() {
+ _emake DESTDIR="${ED}" install
+
+ 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..ed639b4a86bd
--- /dev/null
+++ b/sys-boot/winusb/Manifest
@@ -0,0 +1,5 @@
+DIST winusb-1.0.11.tar.gz 566128 SHA256 7bd8d2e63651134bd4173dcf358708fb9e6de1677c088e67d45995a1d5066bc9 SHA512 4d60aa440b811d6fb0a5bb71155f689f767e976572736c324040651b77bfc58d883a98e95afdef63c3cd97b3a49027a059e8e70ebb1d23ba830d7251ac72ae42 WHIRLPOOL 751af916c4eac9b9ca6b60b605466ffd68926a6640a4dbc80013a16122b98b37afb74d1b4ac5832618e060d9d1cd6afbf9724b0aab2a73d9f8b51693956166d4
+EBUILD winusb-1.0.11.ebuild 708 SHA256 02cb6871e9c2c484252c643516213067901130e2e80d10cc720ab85ab9d54d94 SHA512 c6380fa3808b4f0698ed34cf91a2dfde9763cbe10152040507aa659c6a638a8fc638dcc5096ac8e8a3c437a21e3662646011a140cc822f383eec57c9f94400b0 WHIRLPOOL bab0652827b664a4347b1a5cb9c08789a98281529a61be1d766e79074e61bcc99276b4d6baee9018545aef7f93e91ff5df5f72ced86020eea4edb4c449ae058d
+MISC ChangeLog 2296 SHA256 6457a228129270789f58f78d190db01ea9bc7332535a4b865eea0d7c4cc7ce1c SHA512 0964b3eb2698e3ca7963b7820080b796f8a8303bcf0b7a217df2a9a702649022637c61873cad072a46930a7fe941511ced5b165d2d02ef63d64062a8888f0227 WHIRLPOOL 0cf6c6a3d75566bdc8f37e7fad84ff5d910d08a68b86f2536eb8436d4bf295f0c66db822e63af8ddb7cdfc9064f6f3254bfd66a0286b153b101e811f1e06637b
+MISC ChangeLog-2015 430 SHA256 74b46459945b16ed78d5c77114a35c0d3b2a7d5742c92b663868cdfbe58e5662 SHA512 ff0a1af39870ab7d7c97b609fd4fe9ad1f93cfb476b772948754c78cc4eab3a4aa344e6f162a9d125dd2d8cd21d0aa90f18289d355c87991970b150810afe5f1 WHIRLPOOL 542fc9e992bca7728b2ffb02aa54e3b3337e1c82b255590bdc741f2eb720231c9d8fd74d5cce8a89b0d5b77a02ebd743a04da571b8e4f3c039e95d3ddbf05efc
+MISC metadata.xml 139 SHA256 5cdc1888ebc8807b9a37b1d33429c61cabe7415a4f240e21a4c2ff8eca7a34ed SHA512 8be912ace7468a4396eb1da00a9785030a8ce35da4357a01591876a1056fd45e44da65de2af3e1eb0506ce6551714962c40c3ae5a3aefa2ad231de35af2519be WHIRLPOOL 620431014dd4fb752c3d46d11904ecb2c6d4525f5b4e30f4f778a3b74d3f7187ae4ccd856ebd7eabb48ce261b21849c732928fe647edce024a3fdc082d8f8630
diff --git a/sys-boot/winusb/metadata.xml b/sys-boot/winusb/metadata.xml
new file mode 100644
index 000000000000..097975e3adc2
--- /dev/null
+++ b/sys-boot/winusb/metadata.xml
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+</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..9f11c7f4262d
--- /dev/null
+++ b/sys-boot/winusb/winusb-1.0.11.ebuild
@@ -0,0 +1,40 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+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..2bbc96fb560b
--- /dev/null
+++ b/sys-boot/yaboot-static/Manifest
@@ -0,0 +1,11 @@
+AUX new-ofpath-devspec.patch 906 SHA256 cf71eb58b94d7aaa359a5e915c2fac1e2dc098cdfabf03e0c3c7eca69ec0f7f4 SHA512 e609c8bf8efc9a131f9706e2c6d9978b4b2759e25d11705dfde06f01954054c0217620db156cd3547284ffbcae5bb19e1adff5dc9c590ada05d716ff2286d203 WHIRLPOOL 181c004dc88b44bf22762e9cd6f783af6b79663055390f9cfb86ab0ac8cea23aad0d5460a4c10db5f00cdd84e166987276a091fdcb2b527277f20af2b04902f3
+AUX sysfs-ofpath.patch 3440 SHA256 6fe57d768b400cdbf7774ec127dcc61a1a7a098869c9708785cfbf16d6c72c45 SHA512 a4c9f89fb09e116f5f4bd0dfacd8b1d2e5f88733892f3f5041466380d499a2ade6fa0d96a0e7870c94ad1ef94cd7f4c609f6b6886a93e5e1b125c30f86a6a660 WHIRLPOOL 7d1f9d7240c8e2ccef922e440b9175089e72e06f2e435803309b009f3728ff1ad1463e13f2cbba8f4135eb0619cb0f612a22fc44e51aa3d1aec9e3f06d9838ac
+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
+EBUILD yaboot-static-1.3.14-r1.ebuild 889 SHA256 a7d4c307a7d4e2dad670753a82d6b6580b546e2f15e05bd14b274db7f5092fd1 SHA512 0b25fbc7e6393c8133c8fe8237d4111648684644924ce50e42a2df333c11c6761f44ee47adca77a426c1c12ae17f686cad3abc10a8f6647d37bf1035f414bfd7 WHIRLPOOL 7ee3352417f2382e2702b4dc022e06ffaf869a93b88612e0fd40698b1475b5599d90ff21dfe15ec2078b2007336ff7844b78bede41485f8ddfbf8fac5c371737
+EBUILD yaboot-static-1.3.16-r1.ebuild 735 SHA256 093b76dc1410ea804e4292475f391cf53d61add977418780741a7adc245c80ce SHA512 711bdede68f4f04aef740089f0cdc648075129edd048f75195b96cb214a846f4e00347920f35f5132e2b9af4e64924ad2575b6bec61c7d145fa608fbbd879aa3 WHIRLPOOL 78ffd7198ad970c3b71d433599a12cfd6f18e9a4011faf7aa467e95d248062b80ae45a3b84bf2feb985e5b75b66d08287bb1bf421cc26ac3f1994233278ef758
+EBUILD yaboot-static-1.3.17-r1.ebuild 801 SHA256 1515951a532291c7c377be6823b500a78b17aba2c77633b0b268653f21d05d31 SHA512 836ccaba5e466fe89f791167d03a7f9744c3c7a2d5986ee0798f754715a2b21c3dc45f2ba332929882a7a0371f39dd8a7d5f4ef3caae52e8d880dda244d18b7e WHIRLPOOL 619883e90278146814306bfda3afe1c2303cfeef64f1de955695d813a5ed14d8a39da84ba75ac24ffd49c5c6131a3efe37776c36abf7c058640744b5f600251a
+MISC ChangeLog 2661 SHA256 528532271f0cc2bc705358d09e4dae4fbf4aae8a85f0fd3faf385a0002ddc2b7 SHA512 c90507ee6ab01639d3a3cee80c59480406874b21875a62a35997d733c749414f202f8071a64a71f16adf2380721c41ca711b6444585525aeb157e457a4225dd2 WHIRLPOOL 04900523cd6ac1e5be6558c394f3d344dc12d5cf7c4360fa3f8aecf68bff1437e8e99fa435a6b6465a34545bee9f443458e1abfd6a6da657988f6dbe26df4367
+MISC ChangeLog-2015 5657 SHA256 58d3d77fd5ad6ac6ab8e73d719f51e85e63a1bd06505d165c0819ca8c3ce7948 SHA512 64f8674fd371c0979ec1c02c11ad451dfbdb2146967c1f4fe103532392eafada2f59d1e94e5ba8c45534b437f3656885e6662121a076bc334e7e62a1ae8aea0b WHIRLPOOL 2f1921d656f2e4419d5533260ede918d3defa5f3d90dcb79205134e0b92decb9bf9df1b7f3eeb0cf6a969cccdebd788504e01f7fd80947fbe16b6d58c847b3ce
+MISC metadata.xml 259 SHA256 e7ac6b67c4c89040a00b23bda7a3b2fd4ac8affc1055daf3015ccc8580640f6f SHA512 ca71b1781806d20022c238e5b5d10f9154c78e0fa51f2603de34c48ecbe4cbc2c3190cf046526840546743644c691ee7fe51e31a4617b01bb7602dde803c1538 WHIRLPOOL 2a2aa19a448eca4dea84d129fd194a7ee4d77bdc1b5120abd3b667ce156cdeeb4616a7c7cd23fbccb7ba08e6e166aaba0fac63a6afa208d826acee37b0e560fe
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..5eb05198076b
--- /dev/null
+++ b/sys-boot/yaboot-static/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 type="project">
+ <email>ppc@gentoo.org</email>
+ <name>Gentoo Linux PowerPC Development</name>
+</maintainer>
+</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..72f3850f3c17
--- /dev/null
+++ b/sys-boot/yaboot-static/yaboot-static-1.3.14-r1.ebuild
@@ -0,0 +1,43 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+# 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..4ed2be3006cb
--- /dev/null
+++ b/sys-boot/yaboot-static/yaboot-static-1.3.16-r1.ebuild
@@ -0,0 +1,37 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+# 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..531874033bde
--- /dev/null
+++ b/sys-boot/yaboot-static/yaboot-static-1.3.17-r1.ebuild
@@ -0,0 +1,41 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+# 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..d93bfde5cd43
--- /dev/null
+++ b/sys-boot/yaboot/Manifest
@@ -0,0 +1,18 @@
+AUX chrpfix.patch 979 SHA256 cbd5d5e1df0111619b58975d8605d36ce30767a129dd9de53fc302d750e03045 SHA512 e9be3e0a49b24c6b3879f45b29a14e186df95ebcfb2f4960b38c96c341de5123bc0bb8d42ed6ccab9a0bfb6632d1a5424b2167b4c6b566ee2a914a6594b80510 WHIRLPOOL 22168cd2916be096504c5c3b0a8833e4f98180caebfa834985e90f727dbcb384e34388b0dda9836f66de5a1be525319c6f0eb8faf105663b5c3682f3b3ea9043
+AUX new-ofpath 4319 SHA256 7a20474bdb92f0f99b1142c45583883932807bcb3534cdc14c1238a438152dcc SHA512 8095d1e085a38d3c058e750acabaaf58464117f1af03fcc4604e86c58cd305e138b340420d3f1a5da5e3752dea59cc823599a6cc7a585195011f0030f1b80787 WHIRLPOOL 4599f740b20bb45afde6088a5c89052d31b5d671f8ce3a36182dd37b3d3f806e2edf3f7922ba1881f4fb8a04887f26c690f04b8ebd4d85b087433e8d3ca65732
+AUX new-ofpath-devspec.patch 936 SHA256 dc01e8fbfcd90a6361ee77c7d8e21a8f94e415155c2101dbd0d381bee1559e5b SHA512 4848ebb10a3879224a5748741ed7134c3ae54f7425b786eae7ab6a9f13bdc893c70c15c2e1986a4a2d1f3f26fdc20c0da92c81c9f47e42c061670963d5cb82f0 WHIRLPOOL 367370688c1f79e00879c4fcd36c959c4487a24736a5533276615752e1c34b198ebda187fd2f90bbb852eee789cde9314f2f7c43b12cf1071b82bbf0ceddfaa5
+AUX sysfs-ofpath.patch 3432 SHA256 a00601f12a361f19ec6ab7ef38c65b1f424624d65f80e30d9591618dc22a1f0e SHA512 e99946565708581ac0c606b4490f129eb7fd3687ef30350c4fd5a184a296cf8803d9ea4429a8c00011e7a491040ac2369185bd56cc327437755ce533e4749e38 WHIRLPOOL 08620422b67f26bbe79b755d026c2b3c07d88ed46c677981b136ffc077e1ce656b675bbc804ef033d107cabc7c8a9085153338664229a1c4b5de78714078382e
+AUX yaboot-1.3.16-memalign.patch 889 SHA256 babf5a43e40197a234cb4c637e8f542b89c26ab801175f1977aaf05882d8592f SHA512 d80c9c9d8592f33d39b900c86dbda3a13ec23f8d6b1a6d9612ba59b6c38218b9e41b9f3a3aa01bd39c8b91ae01d7ea4693ae93b0e7cf9c0912f7243e1364820c WHIRLPOOL 94606fabdbcb854141642e2bb7c6a5b7d0a571dedc489b22b3de658bd2c3e74118cdfbb44f100faaacb48b34b7162fd4313e8f66d3b389efff317b1f93b693ac
+AUX yaboot-1.3.17-nopiessp-gcc4.patch 1229 SHA256 0c00ec6c191723d2bd5621ee193ab4b0483cb3bb2443d7ac4b7f8ba859952917 SHA512 32e41b33a1e7109ec0a7ba9ca97ff0d45144d9499aa7657bc93a8007c6c6fa8206a6b406729cbb27407c84ef004b4cdb85e4664d9a4666cbde7700e7b3e82231 WHIRLPOOL cb1f12289c4217b01b6810b5ba21b44a57f450eb734b3af37293b0668934f1973261cd7aee73d2c3cbd2f62319cd7c43acd63878a15333085c04a43191d19f65
+AUX yaboot-nopiessp-gcc4.patch 1355 SHA256 b877f5e21ca658fbfe23ecf7c0053c0db585df72c18348e8aeb249048353bb0e SHA512 413b2353735d82a81e2831d1e51a995096eadfb3c17feb51b6b75035057557ed8c9adebd58fa1635fcaae36fd25c1783e491b85b4437dfb73e1569cf48a51359 WHIRLPOOL 14b8531069c1af0eb19291f0425544254ca3737df8eb74fa79d7beba83b4045fad6f0451de20b8424e7b6e9a457289a9674ca348d3d95ae593425ac9d21ff80c
+AUX yaboot-stubfuncs.patch 4602 SHA256 bd9ec796349c5711cd832b848b7f615bbfbe53e2f1775a32289eab343ef423e9 SHA512 599b0c0e1b1907ace9e0d449bddd934cf1d96364ff446e1cbbe5e743f46b44412a38b169f896a0a6fa51c19652b751089643331196ae66f0314bedc689ef04b8 WHIRLPOOL 9de4aa95b9ebb0eb1f352cde359620ae3bc57143f709f84c63b33bbc21e479151c7d3f83c2a90b8c928a2fa67f6ca26830d7854cffead7f320dcc3a30fd646d1
+AUX yabootconfig-1.3.13.patch 1655 SHA256 ee662c068ba7800d1d0c85a927f3990658cc488ebd3672e40740b7473ba3bb20 SHA512 0efcae987f7cc9b93a86bbcbe1e74b3ee6228b0db3937adea1f6c8b2e48c58cab35db80209ae6e79ff3e9f992c374b65a7786adf46787c0bbe400270ae006e98 WHIRLPOOL 28fb906a0de9bab0d383de289d25ab5be5941c1be51d2348f2c4bd12ee7c6259785eb948b5239be5d19a0c32c3962f05cfa7bad52fad1b889dfa09ea2633f5cd
+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
+EBUILD yaboot-1.3.14-r2.ebuild 1090 SHA256 506f35782a5c1cf30cfd0856289a087528d6abe9f4c108870eb718ae6064e608 SHA512 e400c540823a82924328d46385fcc5aac8b72aa29e7a0f85daf8d9ba7a87461300cc95acb9c01547c0209b4274e28447772e84aa94df18d53108da303eb9b4e3 WHIRLPOOL 0ce4155e4aa8ba5c925fbb45473975aa93b28a1d2d0b9cd1721b86a06346262bd9d83553acd3f459d04db872fced6a5ace78656b9d451f38c9940b5aacf80852
+EBUILD yaboot-1.3.16.ebuild 1258 SHA256 b312c265fbbcbfeb99e691db9dfbb89e48ad1909fc4741d23e1e51267c64b5dc SHA512 447724cc4ad94e30c9cfa1520f599edce8363b127d244ac98c9680089af9a598f330fc33f954adafd764527e5b4bbfb85fcdcdf9ae192c941ab2b039d907a770 WHIRLPOOL 1e6a77d6d62d62d4019482e7198e8756b4c5bc2ac4e22a8a175f59cf3b4165b7d61812b1042dd652f2daf58749d65fcdc3824741ec7898ff0628ee0d3c3fc75e
+EBUILD yaboot-1.3.17-r2.ebuild 1422 SHA256 6c8bca5c6fe45e259102b6dfb68e11bf68793a4ff8da8c1d44f8891a2b86a07a SHA512 06714ef51cb0a8597a8fd548a53c0c50390e9e6b89eec2bcc307cbb3d2fe88c1c6af98e07cee325d6b84e30aa6a53c5fd4c4d9a4588c7ce9814ee018d1c09c58 WHIRLPOOL d762b95bf8204e4d51fc5d63efbcda8c923399a4c5bed710bf1631b70f715322fa122ca55f80f8e7fdb42d44652907ede1c558abe8f09ae5608cac8d9814e118
+MISC ChangeLog 3049 SHA256 97a347d04bacac9f1315e3a221e94e7ff596c175d1ccf6db9de2587a6e68a4d2 SHA512 c586d0ced641b8b471fc26a06384eb1c772a34d5b9b8d5438ab14093b74caa6b4145a489378d5ae7b4696185db2cdbe16ce53c16461587cb3c83b3c7e82d8476 WHIRLPOOL 6ad66fdc00a6065b2ffe149308dece3669dc2c91f7f8ba99e173ef864dd2d319147a7bb5baf64b86f84f9f9d272fc4e2587883d9ab8d0c73774ee34eb1c05332
+MISC ChangeLog-2015 13000 SHA256 a08e401b4d758e61014357c25c5b75f2bb2193328b2a12073ffd9abf5805a661 SHA512 834ec93164092b8e4da6c349ac4b4c6e82b43dbd442553cc816f8cf143dddbdfcf9fdbcb47060a119586799895bd3677cb36ebfbdee614c4012f21e17ee4e940 WHIRLPOOL 2a52a985d0d7070970776fefd0d203135fb4a31feced94603b6032f8b20963d61454b0618e05898a88ddf638acc851aa1695d2d61dc60b6a85936fa79d4fc2fb
+MISC metadata.xml 259 SHA256 e7ac6b67c4c89040a00b23bda7a3b2fd4ac8affc1055daf3015ccc8580640f6f SHA512 ca71b1781806d20022c238e5b5d10f9154c78e0fa51f2603de34c48ecbe4cbc2c3190cf046526840546743644c691ee7fe51e31a4617b01bb7602dde803c1538 WHIRLPOOL 2a2aa19a448eca4dea84d129fd194a7ee4d77bdc1b5120abd3b667ce156cdeeb4616a7c7cd23fbccb7ba08e6e166aaba0fac63a6afa208d826acee37b0e560fe
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 100644
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..5eb05198076b
--- /dev/null
+++ b/sys-boot/yaboot/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 type="project">
+ <email>ppc@gentoo.org</email>
+ <name>Gentoo Linux PowerPC Development</name>
+</maintainer>
+</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..dae3363bec71
--- /dev/null
+++ b/sys-boot/yaboot/yaboot-1.3.14-r2.ebuild
@@ -0,0 +1,47 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+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..d7c35c1ef85b
--- /dev/null
+++ b/sys-boot/yaboot/yaboot-1.3.16.ebuild
@@ -0,0 +1,56 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+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..388d67bca957
--- /dev/null
+++ b/sys-boot/yaboot/yaboot-1.3.17-r2.ebuild
@@ -0,0 +1,59 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+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
+}