public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/proj/kernel:master commit in: sys-kernel/dracut-crypt-ssh/, sys-kernel/linux-headers/, sys-kernel/rt-sources/, ...
@ 2018-11-02  7:24 Alice Ferrazzi
  0 siblings, 0 replies; only message in thread
From: Alice Ferrazzi @ 2018-11-02  7:24 UTC (permalink / raw
  To: gentoo-commits

commit:     45a6d830fb44980db4f9c03b7285d3a19fde42f5
Author:     Alice Ferrazzi <alicef <AT> gentoo <DOT> org>
AuthorDate: Fri Nov  2 07:20:57 2018 +0000
Commit:     Alice Ferrazzi <alicef <AT> gentoo <DOT> org>
CommitDate: Fri Nov  2 07:24:12 2018 +0000
URL:        https://gitweb.gentoo.org/repo/proj/kernel.git/commit/?id=45a6d830

Initial commit of kernel related packages

Signed-off-by: Alice Ferrazzi <alicef <AT> gentoo.org>

 eclass/kernel-2.eclass                             | 1637 ++++++++++++++++++++
 eclass/linux-info.eclass                           |  966 ++++++++++++
 eclass/linux-mod.eclass                            |  758 +++++++++
 .../aufs-sources/aufs-sources-4.14.52.ebuild       |   84 +
 .../aufs-sources/aufs-sources-4.14.65.ebuild       |   84 +
 .../aufs-sources/aufs-sources-4.14.71.ebuild       |   84 +
 .../aufs-sources/aufs-sources-4.14.72.ebuild       |   84 +
 .../aufs-sources/aufs-sources-4.14.73.ebuild       |   84 +
 .../aufs-sources/aufs-sources-4.14.74.ebuild       |   84 +
 .../aufs-sources/aufs-sources-4.14.75.ebuild       |   84 +
 .../aufs-sources/aufs-sources-4.14.76.ebuild       |   84 +
 .../aufs-sources/aufs-sources-4.14.77.ebuild       |   84 +
 .../aufs-sources/aufs-sources-4.14.78.ebuild       |   84 +
 .../aufs-sources/aufs-sources-4.18.10.ebuild       |   84 +
 .../aufs-sources/aufs-sources-4.18.11.ebuild       |   84 +
 .../aufs-sources/aufs-sources-4.18.12.ebuild       |   84 +
 .../aufs-sources/aufs-sources-4.18.13.ebuild       |   84 +
 .../aufs-sources/aufs-sources-4.18.14.ebuild       |   84 +
 .../aufs-sources/aufs-sources-4.18.15.ebuild       |   84 +
 .../aufs-sources/aufs-sources-4.18.16.ebuild       |   84 +
 sys-kernel/aufs-sources/aufs-sources-4.18.9.ebuild |   84 +
 sys-kernel/aufs-sources/aufs-sources-4.19.0.ebuild |   84 +
 sys-kernel/aufs-sources/files/README.gentoo        |   21 +
 sys-kernel/aufs-sources/files/README.gentoo-r1     |   21 +
 sys-kernel/aufs-sources/metadata.xml               |   25 +
 .../bliss-initramfs/bliss-initramfs-7.1.3.ebuild   |   45 +
 sys-kernel/bliss-initramfs/metadata.xml            |    8 +
 sys-kernel/ck-sources/ck-sources-4.14.63.ebuild    |   64 +
 sys-kernel/ck-sources/ck-sources-4.14.66.ebuild    |   64 +
 sys-kernel/ck-sources/ck-sources-4.14.67.ebuild    |   64 +
 sys-kernel/ck-sources/ck-sources-4.14.69.ebuild    |   64 +
 sys-kernel/ck-sources/ck-sources-4.14.71.ebuild    |   64 +
 sys-kernel/ck-sources/ck-sources-4.14.73.ebuild    |   64 +
 sys-kernel/ck-sources/ck-sources-4.14.75.ebuild    |   57 +
 sys-kernel/ck-sources/ck-sources-4.14.78.ebuild    |   57 +
 sys-kernel/ck-sources/ck-sources-4.18.11.ebuild    |   54 +
 sys-kernel/ck-sources/ck-sources-4.18.13.ebuild    |   47 +
 sys-kernel/ck-sources/ck-sources-4.18.16.ebuild    |   47 +
 sys-kernel/ck-sources/ck-sources-4.18.5.ebuild     |   54 +
 sys-kernel/ck-sources/ck-sources-4.18.7.ebuild     |   54 +
 sys-kernel/ck-sources/ck-sources-4.18.9.ebuild     |   54 +
 sys-kernel/ck-sources/ck-sources-4.9.120.ebuild    |   59 +
 sys-kernel/ck-sources/ck-sources-4.9.123.ebuild    |   59 +
 sys-kernel/ck-sources/ck-sources-4.9.124.ebuild    |   59 +
 sys-kernel/ck-sources/ck-sources-4.9.126.ebuild    |   59 +
 sys-kernel/ck-sources/ck-sources-4.9.128.ebuild    |   59 +
 sys-kernel/ck-sources/ck-sources-4.9.130.ebuild    |   59 +
 sys-kernel/ck-sources/ck-sources-4.9.132.ebuild    |   52 +
 sys-kernel/ck-sources/ck-sources-4.9.135.ebuild    |   52 +
 sys-kernel/ck-sources/metadata.xml                 |   26 +
 sys-kernel/cryptodev/cryptodev-1.9.ebuild          |   56 +
 sys-kernel/cryptodev/cryptodev-9999.ebuild         |   57 +
 .../cryptodev-1.9-fix-build-with-4.14-629958.patch |   44 +
 .../files/ioctl.c-Fix-build-with-linux-4.17.patch  |   39 +
 sys-kernel/cryptodev/metadata.xml                  |    8 +
 .../dracut-crypt-ssh-1.0.6-r1.ebuild               |   20 +
 sys-kernel/dracut-crypt-ssh/metadata.xml           |   15 +
 sys-kernel/dracut/dracut-044-r1.ebuild             |  259 ++++
 sys-kernel/dracut/dracut-044-r3.ebuild             |  246 +++
 sys-kernel/dracut/dracut-045-r2.ebuild             |  164 ++
 sys-kernel/dracut/dracut-046-r1.ebuild             |  165 ++
 sys-kernel/dracut/dracut-047-r1.ebuild             |  154 ++
 sys-kernel/dracut/dracut-048-r1.ebuild             |  152 ++
 sys-kernel/dracut/dracut-048.ebuild                |  148 ++
 sys-kernel/dracut/dracut-9999.ebuild               |  158 ++
 ...-lib.sh-dev_unit_name-guard-against-dev-b.patch |   32 +
 ...temd-initrd-add-initrd-root-device.target.patch |   24 +
 ...03-50-dracut.install-use-bin-bash-shebang.patch |   23 +
 sys-kernel/dracut/files/045-systemdutildir.patch   |   45 +
 sys-kernel/dracut/files/046-amd-microcode.patch    |   30 +
 .../047-all-fix-issues-found-by-shellcheck.patch   |   77 +
 ...mouth-fix-detection-of-plymouth-directory.patch |   31 +
 ...dracut-install-simplify-ldd-parsing-logic.patch |   41 +
 sys-kernel/dracut/files/dracut-044-bash-4.4.patch  |   80 +
 .../dracut-044-preserve-xattrs-when-copying.patch  |   51 +
 sys-kernel/dracut/metadata.xml                     |   24 +
 sys-kernel/genkernel-next/genkernel-next-66.ebuild |   51 +
 sys-kernel/genkernel-next/genkernel-next-68.ebuild |   51 +
 sys-kernel/genkernel-next/metadata.xml             |   19 +
 .../files/genkernel-3.4.52.4-crc32c.patch          |  130 ++
 .../files/genkernel-3.4.52.4-grub-mkconfig.patch   |   17 +
 .../files/genkernel-3.4.52.4-system-map.patch      |   38 +
 sys-kernel/genkernel/files/genkernel.bash          |   73 +
 sys-kernel/genkernel/files/initramfs.mounts        |   23 +
 sys-kernel/genkernel/genkernel-3.4.52.3.ebuild     |  154 ++
 sys-kernel/genkernel/genkernel-3.4.52.4-r1.ebuild  |  155 ++
 sys-kernel/genkernel/genkernel-3.4.52.4-r2.ebuild  |  156 ++
 sys-kernel/genkernel/genkernel-3.4.52.4-r3.ebuild  |  157 ++
 sys-kernel/genkernel/genkernel-3.5.1.1.ebuild      |  158 ++
 sys-kernel/genkernel/genkernel-3.5.2.0-r1.ebuild   |  159 ++
 sys-kernel/genkernel/genkernel-3.5.2.1.ebuild      |  159 ++
 sys-kernel/genkernel/genkernel-3.5.2.2.ebuild      |  159 ++
 sys-kernel/genkernel/genkernel-3.5.2.3.ebuild      |  159 ++
 sys-kernel/genkernel/genkernel-3.5.2.4.ebuild      |  159 ++
 sys-kernel/genkernel/genkernel-3.5.2.5.ebuild      |  159 ++
 sys-kernel/genkernel/genkernel-3.5.3.2.ebuild      |  159 ++
 sys-kernel/genkernel/genkernel-3.5.3.3.ebuild      |  159 ++
 sys-kernel/genkernel/genkernel-9999.ebuild         |  159 ++
 sys-kernel/genkernel/metadata.xml                  |   19 +
 .../gentoo-sources/gentoo-sources-4.14.52.ebuild   |   28 +
 .../gentoo-sources/gentoo-sources-4.14.65.ebuild   |   28 +
 .../gentoo-sources/gentoo-sources-4.14.71.ebuild   |   28 +
 .../gentoo-sources/gentoo-sources-4.14.72.ebuild   |   28 +
 .../gentoo-sources/gentoo-sources-4.14.73.ebuild   |   28 +
 .../gentoo-sources/gentoo-sources-4.14.74.ebuild   |   28 +
 .../gentoo-sources/gentoo-sources-4.14.75.ebuild   |   28 +
 .../gentoo-sources/gentoo-sources-4.14.76.ebuild   |   28 +
 .../gentoo-sources/gentoo-sources-4.14.77.ebuild   |   28 +
 .../gentoo-sources/gentoo-sources-4.14.78.ebuild   |   28 +
 .../gentoo-sources/gentoo-sources-4.18.10.ebuild   |   28 +
 .../gentoo-sources/gentoo-sources-4.18.11.ebuild   |   28 +
 .../gentoo-sources/gentoo-sources-4.18.12.ebuild   |   28 +
 .../gentoo-sources/gentoo-sources-4.18.13.ebuild   |   28 +
 .../gentoo-sources/gentoo-sources-4.18.14.ebuild   |   28 +
 .../gentoo-sources/gentoo-sources-4.18.15.ebuild   |   28 +
 .../gentoo-sources/gentoo-sources-4.18.16.ebuild   |   28 +
 .../gentoo-sources/gentoo-sources-4.18.9.ebuild    |   28 +
 .../gentoo-sources/gentoo-sources-4.19.0.ebuild    |   28 +
 .../gentoo-sources/gentoo-sources-4.4.150.ebuild   |   28 +
 .../gentoo-sources/gentoo-sources-4.4.157.ebuild   |   28 +
 .../gentoo-sources/gentoo-sources-4.4.159.ebuild   |   28 +
 .../gentoo-sources/gentoo-sources-4.4.160.ebuild   |   28 +
 .../gentoo-sources/gentoo-sources-4.4.161.ebuild   |   28 +
 .../gentoo-sources/gentoo-sources-4.4.162.ebuild   |   28 +
 .../gentoo-sources/gentoo-sources-4.9.122.ebuild   |   28 +
 .../gentoo-sources/gentoo-sources-4.9.132.ebuild   |   28 +
 .../gentoo-sources/gentoo-sources-4.9.133.ebuild   |   28 +
 .../gentoo-sources/gentoo-sources-4.9.134.ebuild   |   28 +
 .../gentoo-sources/gentoo-sources-4.9.135.ebuild   |   28 +
 .../gentoo-sources/gentoo-sources-4.9.49-r1.ebuild |   28 +
 sys-kernel/gentoo-sources/metadata.xml             |   14 +
 sys-kernel/git-sources/git-sources-4.19_rc1.ebuild |   40 +
 sys-kernel/git-sources/git-sources-4.19_rc2.ebuild |   40 +
 sys-kernel/git-sources/git-sources-4.19_rc3.ebuild |   40 +
 sys-kernel/git-sources/git-sources-4.19_rc4.ebuild |   40 +
 sys-kernel/git-sources/git-sources-4.19_rc5.ebuild |   40 +
 sys-kernel/git-sources/git-sources-4.19_rc6.ebuild |   40 +
 sys-kernel/git-sources/git-sources-4.19_rc7.ebuild |   40 +
 sys-kernel/git-sources/git-sources-4.19_rc8.ebuild |   40 +
 sys-kernel/git-sources/metadata.xml                |   18 +
 .../hardened-sources-4.8.17-r2.ebuild              |   44 +
 .../hardened-sources-4.9.21.ebuild                 |   45 +
 .../hardened-sources-4.9.22.ebuild                 |   45 +
 .../hardened-sources-4.9.23.ebuild                 |   45 +
 .../hardened-sources-4.9.24.ebuild                 |   45 +
 sys-kernel/hardened-sources/metadata.xml           |   23 +
 sys-kernel/kergen/kergen-0.1.3.ebuild              |   17 +
 sys-kernel/kergen/kergen-0.1.4.ebuild              |   17 +
 sys-kernel/kergen/metadata.xml                     |   11 +
 sys-kernel/kpatch/kpatch-0.4.0-r1.ebuild           |   76 +
 sys-kernel/kpatch/kpatch-0.6.0.ebuild              |   76 +
 sys-kernel/kpatch/kpatch-0.6.2.ebuild              |   76 +
 sys-kernel/kpatch/kpatch-9999.ebuild               |   77 +
 sys-kernel/kpatch/metadata.xml                     |    8 +
 sys-kernel/linux-docs/linux-docs-4.1.ebuild        |   64 +
 sys-kernel/linux-docs/linux-docs-4.4.ebuild        |   64 +
 sys-kernel/linux-docs/linux-docs-4.9.ebuild        |   64 +
 sys-kernel/linux-docs/metadata.xml                 |   10 +
 .../linux-firmware/linux-firmware-20181026.ebuild  |  114 ++
 .../linux-firmware/linux-firmware-99999999.ebuild  |  114 ++
 sys-kernel/linux-firmware/metadata.xml             |   19 +
 sys-kernel/linux-headers/linux-headers-3.18.ebuild |   53 +
 sys-kernel/linux-headers/linux-headers-4.13.ebuild |   55 +
 .../linux-headers/linux-headers-4.14-r1.ebuild     |   57 +
 .../linux-headers/linux-headers-4.15-r1.ebuild     |   57 +
 .../linux-headers/linux-headers-4.16-r2.ebuild     |   60 +
 sys-kernel/linux-headers/linux-headers-4.16.ebuild |   60 +
 sys-kernel/linux-headers/linux-headers-4.17.ebuild |   57 +
 sys-kernel/linux-headers/linux-headers-4.18.ebuild |   60 +
 sys-kernel/linux-headers/linux-headers-4.19.ebuild |   60 +
 sys-kernel/linux-headers/linux-headers-4.4.ebuild  |   55 +
 sys-kernel/linux-headers/linux-headers-4.9.ebuild  |   55 +
 sys-kernel/linux-headers/metadata.xml              |   11 +
 sys-kernel/metadata.xml                            |   39 +
 sys-kernel/mips-sources/metadata.xml               |   21 +
 .../mips-sources/mips-sources-4.14.67.ebuild       |  346 +++++
 .../mips-sources/mips-sources-4.17.19.ebuild       |  346 +++++
 .../mips-sources/mips-sources-4.4.152.ebuild       |  350 +++++
 .../mips-sources/mips-sources-4.9.124.ebuild       |  346 +++++
 sys-kernel/pf-sources/metadata.xml                 |    8 +
 sys-kernel/pf-sources/pf-sources-4.10_p3.ebuild    |   77 +
 sys-kernel/pf-sources/pf-sources-4.11_p3.ebuild    |   77 +
 sys-kernel/pf-sources/pf-sources-4.11_p4.ebuild    |   77 +
 sys-kernel/pf-sources/pf-sources-4.13_p4.ebuild    |   77 +
 sys-kernel/pf-sources/pf-sources-4.4_p8.ebuild     |   77 +
 sys-kernel/pf-sources/pf-sources-4.5_p4.ebuild     |   77 +
 sys-kernel/pf-sources/pf-sources-4.8_p8.ebuild     |   77 +
 sys-kernel/raspberrypi-image/metadata.xml          |   11 +
 .../raspberrypi-image-4.1.17_p20160209.ebuild      |   62 +
 .../raspberrypi-image-4.1.19_p20160309.ebuild      |   62 +
 .../raspberrypi-image-9999.ebuild                  |   57 +
 sys-kernel/raspberrypi-sources/metadata.xml        |   11 +
 .../raspberrypi-sources-4.10.9999.ebuild           |   27 +
 .../raspberrypi-sources-4.11.9999.ebuild           |   27 +
 .../raspberrypi-sources-4.12.9999.ebuild           |   27 +
 .../raspberrypi-sources-4.13.9999.ebuild           |   27 +
 .../raspberrypi-sources-4.14.9999.ebuild           |   27 +
 .../raspberrypi-sources-4.4.9999.ebuild            |   27 +
 .../raspberrypi-sources-4.9.9999.ebuild            |   27 +
 .../rt-sources/files/rt-sources-posix-printf.patch |   40 +
 sys-kernel/rt-sources/metadata.xml                 |   21 +
 .../rt-sources/rt-sources-3.18.121_p106.ebuild     |   58 +
 .../rt-sources/rt-sources-3.18.123_p107.ebuild     |   58 +
 .../rt-sources/rt-sources-4.14.69_p43.ebuild       |   54 +
 .../rt-sources/rt-sources-4.14.71_p44.ebuild       |   54 +
 .../rt-sources/rt-sources-4.16.18_p12.ebuild       |   54 +
 sys-kernel/rt-sources/rt-sources-4.18.12_p7.ebuild |   54 +
 sys-kernel/rt-sources/rt-sources-4.18.16_p9.ebuild |   54 +
 sys-kernel/rt-sources/rt-sources-4.18.7_p5.ebuild  |   54 +
 .../rt-sources/rt-sources-4.4.148_p165.ebuild      |   58 +
 .../rt-sources/rt-sources-4.4.157_p174.ebuild      |   58 +
 .../rt-sources/rt-sources-4.4.162_p175.ebuild      |   58 +
 .../rt-sources/rt-sources-4.9.115_p93.ebuild       |   58 +
 sys-kernel/spl/metadata.xml                        |   15 +
 sys-kernel/spl/spl-0.6.5.11.ebuild                 |  112 ++
 sys-kernel/spl/spl-0.7.11.ebuild                   |  111 ++
 sys-kernel/spl/spl-0.7.8.ebuild                    |  111 ++
 sys-kernel/spl/spl-0.7.9-r1.ebuild                 |  120 ++
 sys-kernel/spl/spl-0.7.9.ebuild                    |  111 ++
 sys-kernel/spl/spl-0.7.9999.ebuild                 |  113 ++
 sys-kernel/spl/spl-9999.ebuild                     |  112 ++
 sys-kernel/vanilla-sources/metadata.xml            |   19 +
 .../vanilla-sources/vanilla-sources-3.16.60.ebuild |   16 +
 .../vanilla-sources/vanilla-sources-4.14.78.ebuild |   16 +
 .../vanilla-sources/vanilla-sources-4.18.16.ebuild |   16 +
 .../vanilla-sources/vanilla-sources-4.19.0.ebuild  |   16 +
 .../vanilla-sources/vanilla-sources-4.4.162.ebuild |   16 +
 .../vanilla-sources/vanilla-sources-4.9.135.ebuild |   16 +
 sys-kernel/xbox-sources/metadata.xml               |   13 +
 .../xbox-sources/xbox-sources-2.6.16.26.ebuild     |   24 +
 sys-kernel/zen-sources/metadata.xml                |    8 +
 .../zen-sources/zen-sources-4.14.9999.ebuild       |   39 +
 .../zen-sources/zen-sources-4.15.9999.ebuild       |   39 +
 .../zen-sources/zen-sources-4.16.9999.ebuild       |   39 +
 234 files changed, 18260 insertions(+)

diff --git a/eclass/kernel-2.eclass b/eclass/kernel-2.eclass
new file mode 100644
index 0000000..8e595d5
--- /dev/null
+++ b/eclass/kernel-2.eclass
@@ -0,0 +1,1637 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+# @ECLASS: kernel-2.eclass
+# @MAINTAINER:
+# Gentoo Kernel project <kernel@gentoo.org>
+# @AUTHOR:
+# John Mylchreest <johnm@gentoo.org>
+# Mike Pagano <mpagano@gentoo.org>
+# <so many, many others, please add yourself>
+# @SUPPORTED_EAPIS: 2 3 4 5 6
+# @BLURB: Eclass for kernel packages
+# @DESCRIPTION:
+# This is the kernel.eclass rewrite for a clean base regarding the 2.6
+# series of kernel with back-compatibility for 2.4
+# Please direct your bugs to the current eclass maintainer :)
+# added functionality:
+# unipatch		- a flexible, singular method to extract, add and remove patches.
+
+# @ECLASS-VARIABLE: K_USEPV
+# @DEFAULT_UNSET
+# @DESCRIPTION:
+# When setting the EXTRAVERSION variable, it should
+# add PV to the end.
+# this is useful for things like wolk. IE:
+# EXTRAVERSION would be something like : -wolk-4.19-r1
+
+# @ECLASS-VARIABLE:  K_NOSETEXTRAVERSION
+# @DEFAULT_UNSET
+# @DESCRIPTION:
+# if this is set then EXTRAVERSION will not be
+# automatically set within the kernel Makefile
+
+# @ECLASS-VARIABLE: K_NOUSENAME
+# @DEFAULT_UNSET
+# @DESCRIPTION:
+# if this is set then EXTRAVERSION will not include the
+# first part of ${PN} in EXTRAVERSION
+
+# @ECLASS-VARIABLE: K_NOUSEPR
+# @DEFAULT_UNSET
+# @DESCRIPTION:
+# if this is set then EXTRAVERSION will not include the
+# anything based on ${PR}.
+
+# @ECLASS-VARIABLE: K_PREPATCHED
+# @DEFAULT_UNSET
+# @DESCRIPTION:
+# if the patchset is prepatched (ie: mm-sources,
+# ck-sources, ac-sources) it will use PR (ie: -r5) as
+# the patchset version for
+# and not use it as a true package revision
+
+# @ECLASS-VARIABLE:  K_EXTRAEINFO
+# @DEFAULT_UNSET
+# @DESCRIPTION:
+# this is a new-line seperated list of einfo displays in
+# postinst and can be used to carry additional postinst
+# messages
+
+# @ECLASS-VARIABLE:  K_EXTRAELOG
+# @DEFAULT_UNSET
+# @DESCRIPTION:
+# same as K_EXTRAEINFO except using elog instead of einfo
+
+# @ECLASS-VARIABLE:  K_EXTRAEWARN
+# @DEFAULT_UNSET
+# @DESCRIPTION:
+# same as K_EXTRAEINFO except using ewarn instead of einfo
+
+# @ECLASS-VARIABLE:  K_SYMLINK
+# @DEFAULT_UNSET
+# @DESCRIPTION:
+# if this is set, then forcably create symlink anyway
+
+# @ECLASS-VARIABLE:  K_BASE_VER
+# @DEFAULT_UNSET
+# @DESCRIPTION:
+# for git-sources, declare the base version this patch is
+# based off of.
+
+# @ECLASS-VARIABLE:  K_DEFCONFIG
+# @DEFAULT_UNSET
+# @DESCRIPTION:
+# Allow specifying a different defconfig target.
+# If length zero, defaults to "defconfig".
+
+# @ECLASS-VARIABLE:  K_WANT_GENPATCHES
+# @DEFAULT_UNSET
+# @DESCRIPTION:
+# Apply genpatches to kernel source. Provide any
+# combination of "base", "extras" or "experimental".
+
+# @ECLASS-VARIABLE:  K_EXP_GENPATCHES_PULL
+# @DEFAULT_UNSET
+# @DESCRIPTION:
+# If set, we pull "experimental" regardless of the USE FLAG
+# but expect the ebuild maintainer to use K_EXP_GENPATCHES_LIST.
+
+# @ECLASS-VARIABLE:  K_EXP_GENPATCHES_NOUSE
+# @DEFAULT_UNSET
+# @DESCRIPTION:
+# If set, no USE flag will be provided for "experimental";
+# as a result the user cannot choose to apply those patches.
+
+# @ECLASS-VARIABLE:  K_EXP_GENPATCHES_LIST
+# @DEFAULT_UNSET
+# @DESCRIPTION:
+# A list of patches to pick from "experimental" to apply when
+# the USE flag is unset and K_EXP_GENPATCHES_PULL is set.
+
+# @ECLASS-VARIABLE:  K_FROM_GIT
+# @DEFAULT_UNSET
+# @DESCRIPTION:
+# If set, this variable signals that the kernel sources derives
+# from a git tree and special handling will be applied so that
+# any patches that are applied will actually apply.
+
+# @ECLASS-VARIABLE:  K_GENPATCHES_VER
+# @DEFAULT_UNSET
+# @DESCRIPTION:
+# The version of the genpatches tarball(s) to apply.
+# A value of "5" would apply genpatches-2.6.12-5 to
+# my-sources-2.6.12.ebuild
+
+# @ECLASS-VARIABLE:  K_SECURITY_UNSUPPORTED
+# @DEFAULT_UNSET
+# @DESCRIPTION:
+# If set, this kernel is unsupported by Gentoo Security
+# to the current eclass maintainer :)
+
+# @ECLASS-VARIABLE:  K_DEBLOB_AVAILABLE
+# @DEFAULT_UNSET
+# @DESCRIPTION:
+# A value of "0" will disable all of the optional deblob
+# code. If empty, will be set to "1" if deblobbing is
+# possible. Test ONLY for "1".
+
+# @ECLASS-VARIABLE:  K_DEBLOB_TAG
+# @DEFAULT_UNSET
+# @DESCRIPTION:
+# This will be the version of deblob script. It's a upstream SVN tag
+# such asw -gnu or -gnu1.
+
+# @ECLASS-VARIABLE:  K_PREDEBLOBBED
+# @DEFAULT_UNSET
+# @DESCRIPTION:
+# This kernel was already deblobbed elsewhere.
+# If false, either optional deblobbing will be available
+# or the license will note the inclusion of linux-firmware code.
+
+# @ECLASS-VARIABLE:  K_LONGTERM
+# @DEFAULT_UNSET
+# @DESCRIPTION:
+# If set, the eclass will search for the kernel source
+# in the long term directories on the upstream servers
+# as the location has been changed by upstream
+
+# @ECLASS-VARIABLE:  H_SUPPORTEDARCH
+# @DEFAULT_UNSET
+# @DESCRIPTION:
+# this should be a space separated list of ARCH's which
+# can be supported by the headers ebuild
+
+# @ECLASS-VARIABLE:  UNIPATCH_LIST
+# @DEFAULT_UNSET
+# @DESCRIPTION:
+# space delimetered list of patches to be applied to the kernel
+
+# @ECLASS-VARIABLE:  UNIPATCH_EXCLUDE
+# @DEFAULT_UNSET
+# @DESCRIPTION:
+# An addition var to support exlusion based completely
+# on "<passedstring>*" and not "<passedno#>_*"
+# this should _NOT_ be used from the ebuild as this is
+# reserved for end users passing excludes from the cli
+
+# @ECLASS-VARIABLE:  UNIPATCH_DOCS
+# @DEFAULT_UNSET
+# @DESCRIPTION:
+# space delimemeted list of docs to be installed to
+# the doc dir
+
+# @ECLASS-VARIABLE:  UNIPATCH_STRICTORDER
+# @DEFAULT_UNSET
+# @DESCRIPTION:
+# if this is set places patches into directories of
+# order, so they are applied in the order passed
+# Changing any other variable in this eclass is not supported; you can request
+# for additional variables to be added by contacting the current maintainer.
+# If you do change them, there is a chance that we will not fix resulting bugs;
+# that of course does not mean we're not willing to help.
+
+PYTHON_COMPAT=( python{2_6,2_7} )
+
+inherit toolchain-funcs python-any-r1
+[[ ${EAPI:-0} == [012345] ]] && inherit epatch
+[[ ${EAPI:-0} == [0123456] ]] && inherit estack eapi7-ver
+case ${EAPI:-0} in
+	2|3|4|5|6)
+		EXPORT_FUNCTIONS src_{unpack,prepare,compile,install,test} \
+			pkg_{setup,preinst,postinst,postrm} ;;
+	*) die "${ECLASS}: EAPI ${EAPI} not supported" ;;
+esac
+
+# Added by Daniel Ostrow <dostrow@gentoo.org>
+# This is an ugly hack to get around an issue with a 32-bit userland on ppc64.
+# I will remove it when I come up with something more reasonable.
+[[ ${PROFILE_ARCH} == "ppc64" ]] && CHOST="powerpc64-${CHOST#*-}"
+
+export CTARGET=${CTARGET:-${CHOST}}
+if [[ ${CTARGET} == ${CHOST} && ${CATEGORY/cross-} != ${CATEGORY} ]]; then
+	export CTARGET=${CATEGORY/cross-}
+fi
+
+HOMEPAGE="https://www.kernel.org/ https://www.gentoo.org/ ${HOMEPAGE}"
+: ${LICENSE:="GPL-2"}
+
+# This is the latest KV_PATCH of the deblob tool available from the
+# libre-sources upstream. If you bump this, you MUST regenerate the Manifests
+# for ALL kernel-2 consumer packages where deblob is available.
+: ${DEBLOB_MAX_VERSION:=38}
+
+# No need to run scanelf/strip on kernel sources/headers (bug #134453).
+RESTRICT="binchecks strip"
+
+# set LINUX_HOSTCFLAGS if not already set
+: ${LINUX_HOSTCFLAGS:="-Wall -Wstrict-prototypes -Os -fomit-frame-pointer -I${S}/include"}
+
+
+# @FUNCTION: debug-print-kernel2-variables
+# @USAGE:
+# @DESCRIPTION:
+# this function exists only to help debug kernel-2.eclass
+# if you are adding new functionality in, put a call to it
+# at the start of src_unpack, or during SRC_URI/dep generation.
+
+debug-print-kernel2-variables() {
+	for v in PVR CKV OKV KV KV_FULL KV_MAJOR KV_MINOR KV_PATCH RELEASETYPE \
+			RELEASE UNIPATCH_LIST_DEFAULT UNIPATCH_LIST_GENPATCHES \
+			UNIPATCH_LIST S KERNEL_URI K_WANT_GENPATCHES ; do
+		debug-print "${v}: ${!v}"
+	done
+}
+
+# @FUNCTION: handle_genpatches
+# @USAGE: [--set-unipatch-list]
+# @DESCRIPTION:
+# add genpatches to list of patches to apply if wanted
+
+handle_genpatches() {
+	local tarball want_unipatch_list
+	[[ -z ${K_WANT_GENPATCHES} || -z ${K_GENPATCHES_VER} ]] && return 1
+
+	if [[ -n ${1} ]]; then
+		# set UNIPATCH_LIST_GENPATCHES only on explicit request
+		# since that requires 'use' call which can be used only in phase
+		# functions, while the function is also called in global scope
+		if [[ ${1} == --set-unipatch-list ]]; then
+			want_unipatch_list=1
+		else
+			die "Usage: ${FUNCNAME} [--set-unipatch-list]"
+		fi
+	fi
+
+	debug-print "Inside handle_genpatches"
+	local OKV_ARRAY
+	IFS="." read -r -a OKV_ARRAY <<<"${OKV}"
+
+	# for > 3.0 kernels, handle genpatches tarball name
+	# genpatches for 3.0 and 3.0.1 might be named
+	# genpatches-3.0-1.base.tar.xz and genpatches-3.0-2.base.tar.xz
+	# respectively.  Handle this.
+
+	for i in ${K_WANT_GENPATCHES} ; do
+		if [[ ${KV_MAJOR} -ge 3 ]]; then
+			if [[ ${#OKV_ARRAY[@]} -ge 3 ]]; then
+				tarball="genpatches-${KV_MAJOR}.${KV_MINOR}-${K_GENPATCHES_VER}.${i}.tar.xz"
+			else
+				tarball="genpatches-${KV_MAJOR}.${KV_PATCH}-${K_GENPATCHES_VER}.${i}.tar.xz"
+			fi
+		else
+			tarball="genpatches-${OKV}-${K_GENPATCHES_VER}.${i}.tar.xz"
+		fi
+
+		local use_cond_start="" use_cond_end=""
+
+		if [[ "${i}" == "experimental" && -z ${K_EXP_GENPATCHES_PULL} && -z ${K_EXP_GENPATCHES_NOUSE} ]] ; then
+			use_cond_start="experimental? ( "
+			use_cond_end=" )"
+
+			if [[ -n ${want_unipatch_list} ]] && use experimental ; then
+				UNIPATCH_LIST_GENPATCHES+=" ${DISTDIR}/${tarball}"
+				debug-print "genpatches tarball: $tarball"
+			fi
+		elif [[ -n ${want_unipatch_list} ]]; then
+			UNIPATCH_LIST_GENPATCHES+=" ${DISTDIR}/${tarball}"
+			debug-print "genpatches tarball: $tarball"
+		fi
+		GENPATCHES_URI+=" ${use_cond_start}mirror://gentoo/${tarball}${use_cond_end}"
+	done
+}
+
+# @FUNCTION: detect_version
+# @USAGE:
+# @DESCRIPTION:
+# this function will detect and set
+# - OKV: Original Kernel Version (2.6.0/2.6.0-test11)
+# - KV: Kernel Version (2.6.0-gentoo/2.6.0-test11-gentoo-r1)
+# - EXTRAVERSION: The additional version appended to OKV (-gentoo/-gentoo-r1)
+detect_version() {
+
+	# We've already run, so nothing to do here.
+	[[ -n ${KV_FULL} ]] && return 0
+
+	# CKV is used as a comparison kernel version, which is used when
+	# PV doesnt reflect the genuine kernel version.
+	# this gets set to the portage style versioning. ie:
+	#   CKV=2.6.11_rc4
+	CKV=${CKV:-${PV}}
+	OKV=${OKV:-${CKV}}
+	OKV=${OKV/_beta/-test}
+	OKV=${OKV/_rc/-rc}
+	OKV=${OKV/-r*}
+	OKV=${OKV/_p*}
+
+	KV_MAJOR=$(ver_cut 1 ${OKV})
+	# handle if OKV is X.Y or X.Y.Z (e.g. 3.0 or 3.0.1)
+	local OKV_ARRAY
+	IFS="." read -r -a OKV_ARRAY <<<"${OKV}"
+
+	# if KV_MAJOR >= 3, then we have no more KV_MINOR
+	#if [[ ${KV_MAJOR} -lt 3 ]]; then
+	if [[ ${#OKV_ARRAY[@]} -ge 3 ]]; then
+		KV_MINOR=$(ver_cut 2 ${OKV})
+		KV_PATCH=$(ver_cut 3 ${OKV})
+		if [[ ${KV_MAJOR}${KV_MINOR}${KV_PATCH} -ge 269 ]]; then
+			KV_EXTRA=$(ver_cut 4- ${OKV})
+			KV_EXTRA=${KV_EXTRA/[-_]*}
+		else
+			KV_PATCH=$(ver_cut 3- ${OKV})
+		fi
+	else
+		KV_PATCH=$(ver_cut 2 ${OKV})
+		KV_EXTRA=$(ver_cut 3- ${OKV})
+		KV_EXTRA=${KV_EXTRA/[-_]*}
+	fi
+
+	debug-print "KV_EXTRA is ${KV_EXTRA}"
+
+	KV_PATCH=${KV_PATCH/[-_]*}
+
+	local v n=0 missing
+	#if [[ ${KV_MAJOR} -lt 3 ]]; then
+	if [[ ${#OKV_ARRAY[@]} -ge 3 ]]; then
+		for v in CKV OKV KV_{MAJOR,MINOR,PATCH} ; do
+			[[ -z ${!v} ]] && n=1 && missing="${missing}${v} ";
+		done
+	else
+		for v in CKV OKV KV_{MAJOR,PATCH} ; do
+			[[ -z ${!v} ]] && n=1 && missing="${missing}${v} ";
+		done
+	fi
+
+	[[ $n -eq 1 ]] && \
+		eerror "Missing variables: ${missing}" && \
+		die "Failed to extract kernel version (try explicit CKV in ebuild)!"
+	unset v n missing
+
+#	if [[ ${KV_MAJOR} -ge 3 ]]; then
+	if [[ ${#OKV_ARRAY[@]} -lt 3 ]]; then
+		KV_PATCH_ARR=(${KV_PATCH//\./ })
+
+		# at this point 031412, Linus is putting all 3.x kernels in a
+		# 3.x directory, may need to revisit when 4.x is released
+		KERNEL_BASE_URI="mirror://kernel/linux/kernel/v${KV_MAJOR}.x"
+
+		[[ -n "${K_LONGTERM}" ]] &&
+			KERNEL_BASE_URI="${KERNEL_BASE_URI}/longterm/v${KV_MAJOR}.${KV_PATCH_ARR}"
+	else
+		#KERNEL_BASE_URI="mirror://kernel/linux/kernel/v${KV_MAJOR}.0"
+		#KERNEL_BASE_URI="mirror://kernel/linux/kernel/v${KV_MAJOR}.${KV_MINOR}"
+		if [[ ${KV_MAJOR} -ge 3 ]]; then
+			KERNEL_BASE_URI="mirror://kernel/linux/kernel/v${KV_MAJOR}.x"
+		else
+			KERNEL_BASE_URI="mirror://kernel/linux/kernel/v${KV_MAJOR}.${KV_MINOR}"
+		fi
+
+		[[ -n "${K_LONGTERM}" ]] &&
+			#KERNEL_BASE_URI="${KERNEL_BASE_URI}/longterm"
+			KERNEL_BASE_URI="${KERNEL_BASE_URI}/longterm/v${KV_MAJOR}.${KV_MINOR}.${KV_PATCH}"
+	fi
+
+	debug-print "KERNEL_BASE_URI is ${KERNEL_BASE_URI}"
+
+	if [[ ${#OKV_ARRAY[@]} -ge 3 ]] && [[ ${KV_MAJOR} -ge 3 ]]; then
+		# handle non genpatch using sources correctly
+		if [[ -z ${K_WANT_GENPATCHES} && -z ${K_GENPATCHES_VER} && ${KV_PATCH} -gt 0 ]]; then
+			KERNEL_URI="${KERNEL_BASE_URI}/patch-${OKV}.xz"
+			UNIPATCH_LIST_DEFAULT="${DISTDIR}/patch-${CKV}.xz"
+		fi
+		KERNEL_URI="${KERNEL_URI} ${KERNEL_BASE_URI}/linux-${KV_MAJOR}.${KV_MINOR}.tar.xz"
+	else
+		KERNEL_URI="${KERNEL_BASE_URI}/linux-${OKV}.tar.xz"
+	fi
+
+	RELEASE=${CKV/${OKV}}
+	RELEASE=${RELEASE/_beta}
+	RELEASE=${RELEASE/_rc/-rc}
+	RELEASE=${RELEASE/_pre/-pre}
+	# We cannot trivally call kernel_is here, because it calls us to detect the
+	# version
+	#kernel_is ge 2 6 && RELEASE=${RELEASE/-pre/-git}
+	[ $(($KV_MAJOR * 1000 + ${KV_MINOR:-0})) -ge 2006 ] && RELEASE=${RELEASE/-pre/-git}
+	RELEASETYPE=${RELEASE//[0-9]}
+
+	# Now we know that RELEASE is the -rc/-git
+	# and RELEASETYPE is the same but with its numerics stripped
+	# we can work on better sorting EXTRAVERSION.
+	# first of all, we add the release
+	EXTRAVERSION="${RELEASE}"
+	debug-print "0 EXTRAVERSION:${EXTRAVERSION}"
+	[[ -n ${KV_EXTRA} ]] && [[ ${KV_MAJOR} -lt 3 ]] && EXTRAVERSION=".${KV_EXTRA}${EXTRAVERSION}"
+
+	debug-print "1 EXTRAVERSION:${EXTRAVERSION}"
+	if [[ -n "${K_NOUSEPR}" ]]; then
+		# Don't add anything based on PR to EXTRAVERSION
+		debug-print "1.0 EXTRAVERSION:${EXTRAVERSION}"
+	elif [[ -n ${K_PREPATCHED} ]]; then
+		debug-print "1.1 EXTRAVERSION:${EXTRAVERSION}"
+		EXTRAVERSION="${EXTRAVERSION}-${PN/-*}${PR/r}"
+	elif [[ "${ETYPE}" = "sources" ]]; then
+		debug-print "1.2 EXTRAVERSION:${EXTRAVERSION}"
+		# For some sources we want to use the PV in the extra version
+		# This is because upstream releases with a completely different
+		# versioning scheme.
+		case ${PN/-*} in
+		     wolk) K_USEPV=1;;
+		  vserver) K_USEPV=1;;
+		esac
+
+		[[ -z "${K_NOUSENAME}" ]] && EXTRAVERSION="${EXTRAVERSION}-${PN/-*}"
+		[[ -n "${K_USEPV}" ]]     && EXTRAVERSION="${EXTRAVERSION}-${PV//_/-}"
+		[[ -n "${PR//r0}" ]] && EXTRAVERSION="${EXTRAVERSION}-${PR}"
+	fi
+	debug-print "2 EXTRAVERSION:${EXTRAVERSION}"
+
+	# The only messing around which should actually effect this is for KV_EXTRA
+	# since this has to limit OKV to MAJ.MIN.PAT and strip EXTRA off else
+	# KV_FULL evaluates to MAJ.MIN.PAT.EXT.EXT after EXTRAVERSION
+
+	if [[ -n ${KV_EXTRA} ]]; then
+		if [[ -n ${KV_MINOR} ]]; then
+			OKV="${KV_MAJOR}.${KV_MINOR}.${KV_PATCH}"
+		else
+			OKV="${KV_MAJOR}.${KV_PATCH}"
+		fi
+		KERNEL_URI="${KERNEL_BASE_URI}/patch-${CKV}.xz
+					${KERNEL_BASE_URI}/linux-${OKV}.tar.xz"
+		UNIPATCH_LIST_DEFAULT="${DISTDIR}/patch-${CKV}.xz"
+	fi
+
+	# We need to set this using OKV, but we need to set it before we do any
+	# messing around with OKV based on RELEASETYPE
+	KV_FULL=${OKV}${EXTRAVERSION}
+
+	# we will set this for backwards compatibility.
+	S="${WORKDIR}"/linux-${KV_FULL}
+	KV=${KV_FULL}
+
+	# -rc-git pulls can be achieved by specifying CKV
+	# for example:
+	#   CKV="2.6.11_rc3_pre2"
+	# will pull:
+	#   linux-2.6.10.tar.xz & patch-2.6.11-rc3.xz & patch-2.6.11-rc3-git2.xz
+
+	if [[ ${KV_MAJOR}${KV_MINOR} -eq 26 ]]; then
+
+		if [[ ${RELEASETYPE} == -rc ]] || [[ ${RELEASETYPE} == -pre ]]; then
+			OKV="${KV_MAJOR}.${KV_MINOR}.$((${KV_PATCH} - 1))"
+			KERNEL_URI="${KERNEL_BASE_URI}/testing/patch-${CKV//_/-}.xz
+						${KERNEL_BASE_URI}/linux-${OKV}.tar.xz"
+			UNIPATCH_LIST_DEFAULT="${DISTDIR}/patch-${CKV//_/-}.xz"
+		fi
+
+		if [[ ${RELEASETYPE} == -git ]]; then
+			KERNEL_URI="${KERNEL_BASE_URI}/snapshots/patch-${OKV}${RELEASE}.xz
+						${KERNEL_BASE_URI}/linux-${OKV}.tar.xz"
+			UNIPATCH_LIST_DEFAULT="${DISTDIR}/patch-${OKV}${RELEASE}.xz"
+		fi
+
+		if [[ ${RELEASETYPE} == -rc-git ]]; then
+			OKV="${KV_MAJOR}.${KV_MINOR}.$((${KV_PATCH} - 1))"
+			KERNEL_URI="${KERNEL_BASE_URI}/snapshots/patch-${KV_MAJOR}.${KV_MINOR}.${KV_PATCH}${RELEASE}.xz
+						${KERNEL_BASE_URI}/testing/patch-${KV_MAJOR}.${KV_MINOR}.${KV_PATCH}${RELEASE/-git*}.xz
+						${KERNEL_BASE_URI}/linux-${OKV}.tar.xz"
+
+			UNIPATCH_LIST_DEFAULT="${DISTDIR}/patch-${KV_MAJOR}.${KV_MINOR}.${KV_PATCH}${RELEASE/-git*}.xz ${DISTDIR}/patch-${KV_MAJOR}.${KV_MINOR}.${KV_PATCH}${RELEASE}.xz"
+		fi
+	else
+		KV_PATCH_ARR=(${KV_PATCH//\./ })
+
+		# the different majorminor versions have different patch start versions
+		OKV_DICT=(["2"]="${KV_MAJOR}.$((${KV_PATCH_ARR} - 1))" ["3"]="2.6.39" ["4"]="3.19")
+
+		if [[ ${RELEASETYPE} == -rc ]] || [[ ${RELEASETYPE} == -pre ]]; then
+
+			OKV=${K_BASE_VER:-$OKV_DICT["${KV_MAJOR}"]}
+
+			# as of 12/5/2017, the rc patch is no longer offered as a compressed
+			# file, and no longer is it mirrored on kernel.org
+			if [[ ${KV_MAJOR} -ge 4 ]] && [[ ${KV_PATCH} -ge 12 ]]; then
+				KERNEL_URI="https://git.kernel.org/torvalds/p/v${KV_FULL}/v${OKV} -> patch-${KV_FULL}.patch
+							${KERNEL_BASE_URI}/linux-${OKV}.tar.xz"
+				UNIPATCH_LIST_DEFAULT="${DISTDIR}/patch-${CKV//_/-}.patch"
+			else
+				KERNEL_URI="${KERNEL_BASE_URI}/testing/patch-${CKV//_/-}.xz
+							${KERNEL_BASE_URI}/linux-${OKV}.tar.xz"
+				UNIPATCH_LIST_DEFAULT="${DISTDIR}/patch-${CKV//_/-}.xz"
+			fi
+		fi
+
+		if [[ ${RELEASETYPE} == -git ]]; then
+			KERNEL_URI="${KERNEL_BASE_URI}/snapshots/patch-${OKV}${RELEASE}.xz
+						${KERNEL_BASE_URI}/linux-${OKV}.tar.xz"
+			UNIPATCH_LIST_DEFAULT="${DISTDIR}/patch-${OKV}${RELEASE}.xz"
+		fi
+
+		if [[ ${RELEASETYPE} == -rc-git ]]; then
+			OKV=${K_BASE_VER:-$OKV_DICT["${KV_MAJOR}"]}
+			KERNEL_URI="${KERNEL_BASE_URI}/snapshots/patch-${KV_MAJOR}.${KV_PATCH}${RELEASE}.xz
+						${KERNEL_BASE_URI}/testing/patch-${KV_MAJOR}.${KV_PATCH}${RELEASE/-git*}.xz
+						${KERNEL_BASE_URI}/linux-${OKV}.tar.xz"
+
+			UNIPATCH_LIST_DEFAULT="${DISTDIR}/patch-${KV_MAJOR}.${KV_PATCH}${RELEASE/-git*}.xz ${DISTDIR}/patch-${KV_MAJOR}.${KV_PATCH}${RELEASE}.xz"
+		fi
+
+
+	fi
+
+	debug-print-kernel2-variables
+
+	handle_genpatches
+}
+
+# @FUNCTION: kernel_is
+# @USAGE: <conditional version | version>
+# @DESCRIPTION:
+# user for comparing kernel versions
+# or just identifying a version
+# e.g kernel_is 2 4
+# e.g kernel_is ge 4.8.11
+# Note: duplicated in linux-info.eclass
+kernel_is() {
+	# ALL of these should be set before we can safely continue this function.
+	# some of the sources have in the past had only one set.
+	local v n=0
+	for v in OKV KV_{MAJOR,MINOR,PATCH} ; do [[ -z ${!v} ]] && n=1 ; done
+	[[ $n -eq 1 ]] && detect_version
+	unset v n
+
+	# Now we can continue
+	local operator test value
+
+	case ${1#-} in
+	  lt) operator="-lt"; shift;;
+	  gt) operator="-gt"; shift;;
+	  le) operator="-le"; shift;;
+	  ge) operator="-ge"; shift;;
+	  eq) operator="-eq"; shift;;
+	   *) operator="-eq";;
+	esac
+	[[ $# -gt 3 ]] && die "Error in kernel-2_kernel_is(): too many parameters"
+
+	: $(( test = (KV_MAJOR << 16) + (KV_MINOR << 8) + KV_PATCH ))
+	: $(( value = (${1:-${KV_MAJOR}} << 16) + (${2:-${KV_MINOR}} << 8) + ${3:-${KV_PATCH}} ))
+	[ ${test} ${operator} ${value} ]
+}
+
+# @FUNCTION: kernel_is_2_4
+# @USAGE:
+# @DESCRIPTION:
+# return true if kernel is version 2.4
+kernel_is_2_4() {
+	kernel_is 2 4
+}
+
+# @FUNCTION: kernel_is_2_6
+# @USAGE:
+# @DESCRIPTION:
+# return true if kernel is version 2.6
+kernel_is_2_6() {
+	kernel_is 2 6 || kernel_is 2 5
+}
+
+# Capture the sources type and set DEPENDs
+if [[ ${ETYPE} == sources ]]; then
+	DEPEND="!build? (
+		sys-apps/sed
+		>=sys-devel/binutils-2.11.90.0.31
+	)"
+	RDEPEND="!build? (
+		dev-lang/perl
+		sys-devel/bc
+		sys-devel/bison
+		sys-devel/flex
+		sys-devel/make
+		>=sys-libs/ncurses-5.2
+		virtual/libelf
+	)"
+
+	SLOT="${PVR}"
+	DESCRIPTION="Sources based on the Linux Kernel."
+	IUSE="symlink build"
+
+	# Bug #266157, deblob for libre support
+	if [[ -z ${K_PREDEBLOBBED} ]] ; then
+		# Bug #359865, force a call to detect_version if needed
+		kernel_is ge 2 6 27 && \
+			[[ -z "${K_DEBLOB_AVAILABLE}" ]] && \
+				kernel_is le 2 6 ${DEBLOB_MAX_VERSION} && \
+					K_DEBLOB_AVAILABLE=1
+		if [[ ${K_DEBLOB_AVAILABLE} == "1" ]] ; then
+			IUSE="${IUSE} deblob"
+
+			# Reflect that kernels contain firmware blobs unless otherwise
+			# stripped
+			LICENSE="${LICENSE} !deblob? ( linux-firmware )"
+
+			DEPEND+=" deblob? ( ${PYTHON_DEPS} )"
+
+			if [[ -n KV_MINOR ]]; then
+				DEBLOB_PV="${KV_MAJOR}.${KV_MINOR}.${KV_PATCH}"
+			else
+				DEBLOB_PV="${KV_MAJOR}.${KV_PATCH}"
+			fi
+
+			if [[ ${KV_MAJOR} -ge 3 ]]; then
+				DEBLOB_PV="${KV_MAJOR}.${KV_MINOR}"
+			fi
+
+			# deblob svn tag, default is -gnu, to change, use K_DEBLOB_TAG in ebuild
+			K_DEBLOB_TAG=${K_DEBLOB_TAG:--gnu}
+			DEBLOB_A="deblob-${DEBLOB_PV}"
+			DEBLOB_CHECK_A="deblob-check-${DEBLOB_PV}"
+			DEBLOB_HOMEPAGE="https://www.fsfla.org/svn/fsfla/software/linux-libre/releases/tags/"
+			DEBLOB_URI_PATH="${DEBLOB_PV}${K_DEBLOB_TAG}"
+			DEBLOB_CHECK_URI="${DEBLOB_HOMEPAGE}/${DEBLOB_URI_PATH}/deblob-check -> ${DEBLOB_CHECK_A}"
+			DEBLOB_URI="${DEBLOB_HOMEPAGE}/${DEBLOB_URI_PATH}/${DEBLOB_A}"
+			HOMEPAGE="${HOMEPAGE} ${DEBLOB_HOMEPAGE}"
+
+			KERNEL_URI="${KERNEL_URI}
+				deblob? (
+					${DEBLOB_URI}
+					${DEBLOB_CHECK_URI}
+				)"
+		else
+			# We have no way to deblob older kernels, so just mark them as
+			# tainted with non-libre materials.
+			LICENSE="${LICENSE} linux-firmware"
+		fi
+	fi
+
+elif [[ ${ETYPE} == headers ]]; then
+	DESCRIPTION="Linux system headers"
+	IUSE="headers-only"
+
+	# Since we should NOT honour KBUILD_OUTPUT in headers
+	# lets unset it here.
+	unset KBUILD_OUTPUT
+
+	SLOT="0"
+fi
+
+# Cross-compile support functions
+
+# @FUNCTION: kernel_header_destdir
+# @USAGE:
+# @DESCRIPTION:
+# return header destination directory
+kernel_header_destdir() {
+	[[ ${CTARGET} == ${CHOST} ]] \
+		&& echo /usr/include \
+		|| echo /usr/${CTARGET}/usr/include
+}
+
+# @FUNCTION: cross_pre_c_headers
+# @USAGE:
+# @DESCRIPTION:
+# set use if necessary for cross compile support
+cross_pre_c_headers() {
+	use headers-only && [[ ${CHOST} != ${CTARGET} ]]
+}
+
+# @FUNCTION: env_setup_xmakeopts
+# @USAGE:
+# @DESCRIPTION:
+# set the ARCH/CROSS_COMPILE when cross compiling
+
+env_setup_xmakeopts() {
+	# Kernel ARCH != portage ARCH
+	export KARCH=$(tc-arch-kernel)
+
+	# When cross-compiling, we need to set the ARCH/CROSS_COMPILE
+	# variables properly or bad things happen !
+	xmakeopts="ARCH=${KARCH}"
+	if [[ ${CTARGET} != ${CHOST} ]] && ! cross_pre_c_headers ; then
+		xmakeopts="${xmakeopts} CROSS_COMPILE=${CTARGET}-"
+	elif type -p ${CHOST}-ar > /dev/null ; then
+		xmakeopts="${xmakeopts} CROSS_COMPILE=${CHOST}-"
+	fi
+	export xmakeopts
+}
+
+# @FUNCTION: unpack_2_4
+# @USAGE:
+# @DESCRIPTION:
+# unpack and generate .config for 2.4 kernels
+
+unpack_2_4() {
+	# this file is required for other things to build properly,
+	# so we autogenerate it
+	make -s mrproper ${xmakeopts} || die "make mrproper failed"
+	make -s symlinks ${xmakeopts} || die "make symlinks failed"
+	make -s include/linux/version.h ${xmakeopts} || die "make include/linux/version.h failed"
+	echo ">>> version.h compiled successfully."
+}
+
+# @FUNCTION: unpack_2_6
+# @USAGE:
+# @DESCRIPTION:
+# unpack and generate .config for 2.6 kernels
+
+unpack_2_6() {
+	# this file is required for other things to build properly, so we
+	# autogenerate it ... generate a .config to keep version.h build from
+	# spitting out an annoying warning
+	make -s mrproper ${xmakeopts} 2>/dev/null \
+		|| die "make mrproper failed"
+
+	# quick fix for bug #132152 which triggers when it cannot include linux
+	# headers (ie, we have not installed it yet)
+	if ! make -s defconfig ${xmakeopts} &>/dev/null 2>&1 ; then
+		touch .config
+		eerror "make defconfig failed."
+		eerror "assuming you dont have any headers installed yet and continuing"
+	fi
+
+	make -s include/linux/version.h ${xmakeopts} 2>/dev/null \
+		|| die "make include/linux/version.h failed"
+	rm -f .config >/dev/null
+}
+
+# @FUNCTION: universal_unpack
+# @USAGE:
+# @DESCRIPTION:
+# unpack kernel sources
+
+universal_unpack() {
+	debug-print "Inside universal_unpack"
+
+	local OKV_ARRAY
+	IFS="." read -r -a OKV_ARRAY <<<"${OKV}"
+
+	cd "${WORKDIR}"
+	if [[ ${#OKV_ARRAY[@]} -ge 3 ]] && [[ ${KV_MAJOR} -ge 3 ]]; then
+		unpack linux-${KV_MAJOR}.${KV_MINOR}.tar.xz
+	else
+		unpack linux-${OKV}.tar.xz
+	fi
+
+	if [[ -d "linux" ]]; then
+		debug-print "Moving linux to linux-${KV_FULL}"
+		mv linux linux-${KV_FULL} \
+			|| die "Unable to move source tree to ${KV_FULL}."
+	elif [[ "${OKV}" != "${KV_FULL}" ]]; then
+		if [[ ${#OKV_ARRAY[@]} -ge 3 ]] && [[ ${KV_MAJOR} -ge 3 ]] &&
+			[[ "${ETYPE}" = "sources" ]]; then
+			debug-print "moving linux-${KV_MAJOR}.${KV_MINOR} to linux-${KV_FULL} "
+			mv linux-${KV_MAJOR}.${KV_MINOR} linux-${KV_FULL} \
+				|| die "Unable to move source tree to ${KV_FULL}."
+		else
+			debug-print "moving linux-${OKV} to linux-${KV_FULL} "
+			mv linux-${OKV} linux-${KV_FULL} \
+				|| die "Unable to move source tree to ${KV_FULL}."
+		fi
+	elif [[ ${#OKV_ARRAY[@]} -ge 3 ]] && [[ ${KV_MAJOR} -ge 3 ]]; then
+		mv linux-${KV_MAJOR}.${KV_MINOR} linux-${KV_FULL} \
+			|| die "Unable to move source tree to ${KV_FULL}."
+	fi
+	cd "${S}"
+
+	# remove all backup files
+	find . -iname "*~" -exec rm {} \; 2> /dev/null
+
+}
+
+# @FUNCTION: unpack_set_extraversion
+# @USAGE:
+# @DESCRIPTION:
+# handle EXTRAVERSION
+
+unpack_set_extraversion() {
+	cd "${S}"
+	sed -i -e "s:^\(EXTRAVERSION =\).*:\1 ${EXTRAVERSION}:" Makefile
+	cd "${OLDPWD}"
+}
+
+# @FUNCTION: unpack_fix_install_path
+# @USAGE:
+# @DESCRIPTION:
+# Should be done after patches have been applied
+# Otherwise patches that modify the same area of Makefile will fail
+
+unpack_fix_install_path() {
+	cd "${S}"
+	sed	-i -e 's:#export\tINSTALL_PATH:export\tINSTALL_PATH:' Makefile
+}
+
+# Compile Functions
+
+# @FUNCTION: compile_headers
+# @USAGE:
+# @DESCRIPTION:
+# header compilation
+
+compile_headers() {
+	env_setup_xmakeopts
+
+	# if we couldnt obtain HOSTCFLAGS from the Makefile,
+	# then set it to something sane
+	local HOSTCFLAGS=$(getfilevar HOSTCFLAGS "${S}"/Makefile)
+	HOSTCFLAGS=${HOSTCFLAGS:--Wall -Wstrict-prototypes -O2 -fomit-frame-pointer}
+
+	if kernel_is 2 4; then
+		yes "" | make oldconfig ${xmakeopts}
+		echo ">>> make oldconfig complete"
+		make dep ${xmakeopts}
+	elif kernel_is 2 6; then
+		# 2.6.18 introduces headers_install which means we dont need any
+		# of this crap anymore :D
+		kernel_is ge 2 6 18 && return 0
+
+		# autoconf.h isnt generated unless it already exists. plus, we have
+		# no guarantee that any headers are installed on the system...
+		[[ -f ${EROOT}usr/include/linux/autoconf.h ]] \
+			|| touch include/linux/autoconf.h
+
+		# if K_DEFCONFIG isn't set, force to "defconfig"
+		# needed by mips
+		if [[ -z ${K_DEFCONFIG} ]]; then
+			if kernel_is ge 2 6 16 ; then
+				case ${CTARGET} in
+					powerpc64*)	K_DEFCONFIG="ppc64_defconfig";;
+					powerpc*)	K_DEFCONFIG="pmac32_defconfig";;
+					*)			K_DEFCONFIG="defconfig";;
+				esac
+			else
+				K_DEFCONFIG="defconfig"
+			fi
+		fi
+
+		# if there arent any installed headers, then there also isnt an asm
+		# symlink in /usr/include/, and make defconfig will fail, so we have
+		# to force an include path with $S.
+		HOSTCFLAGS="${HOSTCFLAGS} -I${S}/include/"
+		ln -sf asm-${KARCH} "${S}"/include/asm || die
+		cross_pre_c_headers && return 0
+
+		make ${K_DEFCONFIG} HOSTCFLAGS="${HOSTCFLAGS}" ${xmakeopts} || die "defconfig failed (${K_DEFCONFIG})"
+		if compile_headers_tweak_config ; then
+			yes "" | make oldconfig HOSTCFLAGS="${HOSTCFLAGS}" ${xmakeopts} || die "2nd oldconfig failed"
+		fi
+		make prepare HOSTCFLAGS="${HOSTCFLAGS}" ${xmakeopts} || die "prepare failed"
+		make prepare-all HOSTCFLAGS="${HOSTCFLAGS}" ${xmakeopts} || die "prepare failed"
+	fi
+}
+
+# @FUNCTION: compile_headers_tweak_config
+# @USAGE:
+# @DESCRIPTION:
+# some targets can be very very picky, so let's finesse the
+# .config based upon any info we may have
+
+compile_headers_tweak_config() {
+	case ${CTARGET} in
+	sh*)
+		sed -i '/CONFIG_CPU_SH/d' .config || die
+		echo "CONFIG_CPU_SH${CTARGET:2:1}=y" >> .config
+		return 0;;
+	esac
+
+	# no changes, so lets do nothing
+	return 1
+}
+
+# install functions
+
+# @FUNCTION: install_universal
+# @USAGE:
+# @DESCRIPTION:
+# Fix permissions in tarball
+
+install_universal() {
+	cd "${WORKDIR}"
+	chown -R 0:0 * >& /dev/null
+	chmod -R a+r-w+X,u+w *
+	cd ${OLDPWD}
+}
+
+# @FUNCTION: install_headers
+# @USAGE:
+# @DESCRIPTION:
+# Install headers
+
+install_headers() {
+	local ddir=$(kernel_header_destdir)
+
+	# 2.6.18 introduces headers_install which means we dont need any
+	# of this crap anymore :D
+	if kernel_is ge 2 6 18 ; then
+		env_setup_xmakeopts
+		emake headers_install INSTALL_HDR_PATH="${ED}"${ddir}/.. ${xmakeopts} || die
+
+		# let other packages install some of these headers
+		rm -rf "${ED}"${ddir}/scsi || die #glibc/uclibc/etc...
+		return 0
+	fi
+
+	# Do not use "linux/*" as that can cause problems with very long
+	# $S values where the cmdline to cp is too long
+	pushd "${S}" >/dev/null
+	dodir ${ddir}/linux
+	cp -pPR "${S}"/include/linux "${ED}"${ddir}/ || die
+	rm -rf "${ED}"${ddir}/linux/modules || die
+
+	dodir ${ddir}/asm
+	cp -pPR "${S}"/include/asm/* "${ED}"${ddir}/asm || die
+
+	if kernel_is 2 6 ; then
+		dodir ${ddir}/asm-generic
+		cp -pPR "${S}"/include/asm-generic/* "${ED}"${ddir}/asm-generic || die
+	fi
+
+	# clean up
+	find "${D}" -name '*.orig' -exec rm -f {} \;
+
+	popd >/dev/null
+}
+
+# @FUNCTION: install_sources
+# @USAGE:
+# @DESCRIPTION:
+# Install sources
+
+install_sources() {
+	local file
+
+	cd "${S}"
+	dodir /usr/src
+	echo ">>> Copying sources ..."
+
+	file="$(find ${WORKDIR} -iname "docs" -type d)"
+	if [[ -n ${file} ]]; then
+		for file in $(find ${file} -type f); do
+			echo "${file//*docs\/}" >> "${S}"/patches.txt
+			echo "===================================================" >> "${S}"/patches.txt
+			cat ${file} >> "${S}"/patches.txt
+			echo "===================================================" >> "${S}"/patches.txt
+			echo "" >> "${S}"/patches.txt
+		done
+	fi
+
+	mv "${WORKDIR}"/linux* "${ED}"usr/src || die
+
+	if [[ -n "${UNIPATCH_DOCS}" ]] ; then
+		for i in ${UNIPATCH_DOCS}; do
+			dodoc "${T}"/${i}
+		done
+	fi
+}
+
+# @FUNCTION: preinst_headers
+# @USAGE:
+# @DESCRIPTION:
+# Headers preinst steps
+
+preinst_headers() {
+	local ddir=$(kernel_header_destdir)
+	[[ -L ${EPREFIX}${ddir}/linux ]] && { rm "${EPREFIX}"${ddir}/linux || die; }
+	[[ -L ${EPREFIX}${ddir}/asm ]] && { rm "${EPREFIX}"${ddir}/asm || die; }
+}
+
+# @FUNCTION: postinst_sources
+# @USAGE:
+# @DESCRIPTION:
+# Sources post installation function.
+# see inline comments
+
+postinst_sources() {
+	local MAKELINK=0
+
+	# if we have USE=symlink, then force K_SYMLINK=1
+	use symlink && K_SYMLINK=1
+
+	# We do support security on a deblobbed kernel, bug #555878.
+	# If some particular kernel version doesn't have security
+	# supported because of USE=deblob or otherwise, one can still
+	# set K_SECURITY_UNSUPPORTED on a per ebuild basis.
+	#[[ $K_DEBLOB_AVAILABLE == 1 ]] && \
+	#	use deblob && \
+	#	K_SECURITY_UNSUPPORTED=deblob
+
+	# if we are to forcably symlink, delete it if it already exists first.
+	if [[ ${K_SYMLINK} > 0 ]]; then
+		[[ -h ${EROOT}usr/src/linux ]] && { rm "${EROOT}"usr/src/linux || die; }
+		MAKELINK=1
+	fi
+
+	# if the link doesnt exist, lets create it
+	[[ ! -h ${EROOT}usr/src/linux ]] && MAKELINK=1
+
+	if [[ ${MAKELINK} == 1 ]]; then
+		ln -sf linux-${KV_FULL} "${EROOT}"usr/src/linux || die
+	fi
+
+	# Don't forget to make directory for sysfs
+	[[ ! -d ${EROOT}sys ]] && kernel_is 2 6 && { mkdir "${EROOT}"sys || die ; }
+
+	echo
+	elog "If you are upgrading from a previous kernel, you may be interested"
+	elog "in the following document:"
+	elog "  - General upgrade guide: https://wiki.gentoo.org/wiki/Kernel/Upgrade"
+	echo
+
+	# if K_EXTRAEINFO is set then lets display it now
+	if [[ -n ${K_EXTRAEINFO} ]]; then
+		echo ${K_EXTRAEINFO} | fmt |
+		while read -s ELINE; do	einfo "${ELINE}"; done
+	fi
+
+	# if K_EXTRAELOG is set then lets display it now
+	if [[ -n ${K_EXTRAELOG} ]]; then
+		echo ${K_EXTRAELOG} | fmt |
+		while read -s ELINE; do	elog "${ELINE}"; done
+	fi
+
+	# if K_EXTRAEWARN is set then lets display it now
+	if [[ -n ${K_EXTRAEWARN} ]]; then
+		echo ${K_EXTRAEWARN} | fmt |
+		while read -s ELINE; do ewarn "${ELINE}"; done
+	fi
+
+	# optionally display security unsupported message
+	#  Start with why
+	if [[ -n ${K_SECURITY_UNSUPPORTED} ]]; then
+		ewarn "${PN} is UNSUPPORTED by Gentoo Security."
+	fi
+	#  And now the general message.
+	if [[ -n ${K_SECURITY_UNSUPPORTED} ]]; then
+		ewarn "This means that it is likely to be vulnerable to recent security issues."
+		echo
+		ewarn "Upstream kernel developers recommend always running the latest "
+		ewarn "release of any current long term supported Linux kernel version."
+		ewarn "To see a list of these versions, their most current release and "
+		ewarn "long term support status, please go to https://www.kernel.org ."
+		echo
+		ewarn "For specific information on why this kernel is unsupported, please read:"
+		ewarn "https://wiki.gentoo.org/wiki/Project:Kernel_Security"
+	fi
+
+	# warn sparc users that they need to do cross-compiling with >= 2.6.25(bug #214765)
+	KV_MAJOR=$(ver_cut 1 ${OKV})
+	KV_MINOR=$(ver_cut 2 ${OKV})
+	KV_PATCH=$(ver_cut 3 ${OKV})
+	if [[ "$(tc-arch)" = "sparc" ]]; then
+		if [[ $(gcc-major-version) -lt 4 && $(gcc-minor-version) -lt 4 ]]; then
+			if [[ ${KV_MAJOR} -ge 3 || ${KV_MAJOR}.${KV_MINOR}.${KV_PATCH} > 2.6.24 ]] ; then
+				echo
+				elog "NOTE: Since 2.6.25 the kernel Makefile has changed in a way that"
+				elog "you now need to do"
+				elog "  make CROSS_COMPILE=sparc64-unknown-linux-gnu-"
+				elog "instead of just"
+				elog "  make"
+				elog "to compile the kernel. For more information please browse to"
+				elog "https://bugs.gentoo.org/show_bug.cgi?id=214765"
+				echo
+			fi
+		fi
+	fi
+}
+
+# pkg_setup functions
+
+# @FUNCTION: setup_headers
+# @USAGE:
+# @DESCRIPTION:
+# Determine if ${PN} supports arch
+
+setup_headers() {
+	[[ -z ${H_SUPPORTEDARCH} ]] && H_SUPPORTEDARCH=${PN/-*/}
+	for i in ${H_SUPPORTEDARCH}; do
+		[[ $(tc-arch) == "${i}" ]] && H_ACCEPT_ARCH="yes"
+	done
+
+	if [[ ${H_ACCEPT_ARCH} != "yes" ]]; then
+		echo
+		eerror "This version of ${PN} does not support $(tc-arch)."
+		eerror "Please merge the appropriate sources, in most cases"
+		eerror "(but not all) this will be called $(tc-arch)-headers."
+		die "Package unsupported for $(tc-arch)"
+	fi
+}
+
+# @FUNCTION: unipatch
+# @USAGE: <list of patches to apply>
+# @DESCRIPTION:
+# Universal function that will apply patches to source
+
+unipatch() {
+	local i x y z extention PIPE_CMD UNIPATCH_DROP KPATCH_DIR PATCH_DEPTH ELINE
+	local STRICT_COUNT PATCH_LEVEL myLC_ALL myLANG
+
+	# set to a standard locale to ensure sorts are ordered properly.
+	myLC_ALL="${LC_ALL}"
+	myLANG="${LANG}"
+	LC_ALL="C"
+	LANG=""
+
+	[ -z "${KPATCH_DIR}" ] && KPATCH_DIR="${WORKDIR}/patches/"
+	[ ! -d ${KPATCH_DIR} ] && mkdir -p ${KPATCH_DIR}
+
+	# We're gonna need it when doing patches with a predefined patchlevel
+	eshopts_push -s extglob
+
+	# This function will unpack all passed tarballs, add any passed patches,
+	# and remove any passed patchnumbers
+	# usage can be either via an env var or by params
+	# although due to the nature we pass this within this eclass
+	# it shall be by param only.
+	# -z "${UNIPATCH_LIST}" ] && UNIPATCH_LIST="${@}"
+	UNIPATCH_LIST="${@}"
+
+	#unpack any passed tarballs
+	for i in ${UNIPATCH_LIST}; do
+		if echo ${i} | grep -qs -e "\.tar" -e "\.tbz" -e "\.tgz" ; then
+			if [ -n "${UNIPATCH_STRICTORDER}" ]; then
+				unset z
+				STRICT_COUNT=$((10#${STRICT_COUNT} + 1))
+				for((y=0; y<$((6 - ${#STRICT_COUNT})); y++));
+					do z="${z}0";
+				done
+				PATCH_ORDER="${z}${STRICT_COUNT}"
+
+				mkdir -p "${KPATCH_DIR}/${PATCH_ORDER}"
+				pushd "${KPATCH_DIR}/${PATCH_ORDER}" >/dev/null
+				unpack ${i##*/}
+				popd >/dev/null
+			else
+				pushd "${KPATCH_DIR}" >/dev/null
+				unpack ${i##*/}
+				popd >/dev/null
+			fi
+
+			[[ ${i} == *:* ]] && echo ">>> Strict patch levels not currently supported for tarballed patchsets"
+		else
+			extention=${i/*./}
+			extention=${extention/:*/}
+			PIPE_CMD=""
+			case ${extention} in
+				     xz) PIPE_CMD="xz -dc";;
+				   lzma) PIPE_CMD="lzma -dc";;
+				    bz2) PIPE_CMD="bzip2 -dc";;
+				 patch*) PIPE_CMD="cat";;
+				   diff) PIPE_CMD="cat";;
+				 gz|Z|z) PIPE_CMD="gzip -dc";;
+				ZIP|zip) PIPE_CMD="unzip -p";;
+				      *) UNIPATCH_DROP="${UNIPATCH_DROP} ${i/:*/}";;
+			esac
+
+			PATCH_LEVEL=${i/*([^:])?(:)}
+			i=${i/:*/}
+			x=${i/*\//}
+			x=${x/\.${extention}/}
+
+			if [ -n "${PIPE_CMD}" ]; then
+				if [ ! -r "${i}" ]; then
+					echo
+					eerror "FATAL: unable to locate:"
+					eerror "${i}"
+					eerror "for read-only. The file either has incorrect permissions"
+					eerror "or does not exist."
+					die Unable to locate ${i}
+				fi
+
+				if [ -n "${UNIPATCH_STRICTORDER}" ]; then
+					unset z
+					STRICT_COUNT=$((10#${STRICT_COUNT} + 1))
+					for((y=0; y<$((6 - ${#STRICT_COUNT})); y++));
+						do z="${z}0";
+					done
+					PATCH_ORDER="${z}${STRICT_COUNT}"
+
+					mkdir -p ${KPATCH_DIR}/${PATCH_ORDER}/
+					$(${PIPE_CMD} ${i} > ${KPATCH_DIR}/${PATCH_ORDER}/${x}.patch${PATCH_LEVEL}) || die "uncompressing patch failed"
+				else
+					$(${PIPE_CMD} ${i} > ${KPATCH_DIR}/${x}.patch${PATCH_LEVEL}) || die "uncompressing patch failed"
+				fi
+			fi
+		fi
+
+		# If experimental was not chosen by the user, drop experimental patches not in K_EXP_GENPATCHES_LIST.
+		if [[ "${i}" == *"genpatches-"*".experimental."* && -n ${K_EXP_GENPATCHES_PULL} ]] ; then
+			if [[ -z ${K_EXP_GENPATCHES_NOUSE} ]] && use experimental; then
+				continue
+			fi
+
+			local j
+			for j in ${KPATCH_DIR}/*/50*_*.patch*; do
+				for k in ${K_EXP_GENPATCHES_LIST} ; do
+					[[ "$(basename ${j})" == ${k}* ]] && continue 2
+				done
+				UNIPATCH_DROP+=" $(basename ${j})"
+			done
+		else
+			UNIPATCH_LIST_GENPATCHES+=" ${DISTDIR}/${tarball}"
+			debug-print "genpatches tarball: $tarball"
+
+			# check gcc version < 4.9.X uses patch 5000 and = 4.9.X uses patch 5010
+			if [[ $(gcc-major-version) -eq 4 ]] && [[ $(gcc-minor-version) -ne 9 ]]; then
+				# drop 5000_enable-additional-cpu-optimizations-for-gcc-4.9.patch
+				if [[ $UNIPATCH_DROP != *"5010_enable-additional-cpu-optimizations-for-gcc-4.9.patch"* ]]; then
+					UNIPATCH_DROP+=" 5010_enable-additional-cpu-optimizations-for-gcc-4.9.patch"
+				fi
+			else
+				if [[ $UNIPATCH_DROP != *"5000_enable-additional-cpu-optimizations-for-gcc.patch"* ]]; then
+					#drop 5000_enable-additional-cpu-optimizations-for-gcc.patch
+					UNIPATCH_DROP+=" 5000_enable-additional-cpu-optimizations-for-gcc.patch"
+				fi
+			fi
+		fi
+	done
+
+	#populate KPATCH_DIRS so we know where to look to remove the excludes
+	x=${KPATCH_DIR}
+	KPATCH_DIR=""
+	for i in $(find ${x} -type d | sort -n); do
+		KPATCH_DIR="${KPATCH_DIR} ${i}"
+	done
+
+	# do not apply fbcondecor patch to sparc/sparc64 as it breaks boot
+	# bug #272676
+	if [[ "$(tc-arch)" = "sparc" || "$(tc-arch)" = "sparc64" ]]; then
+		if [[ ${KV_MAJOR} -ge 3 || ${KV_MAJOR}.${KV_MINOR}.${KV_PATCH} > 2.6.28 ]]; then
+			if [[ ! -z ${K_WANT_GENPATCHES} ]] ; then
+				UNIPATCH_DROP="${UNIPATCH_DROP} *_fbcondecor*.patch"
+				echo
+				ewarn "fbcondecor currently prevents sparc/sparc64 from booting"
+				ewarn "for kernel versions >= 2.6.29. Removing fbcondecor patch."
+				ewarn "See https://bugs.gentoo.org/show_bug.cgi?id=272676 for details"
+				echo
+			fi
+		fi
+	fi
+
+	#so now lets get rid of the patchno's we want to exclude
+	UNIPATCH_DROP="${UNIPATCH_EXCLUDE} ${UNIPATCH_DROP}"
+	for i in ${UNIPATCH_DROP}; do
+		ebegin "Excluding Patch #${i}"
+		for x in ${KPATCH_DIR}; do rm -f ${x}/${i}* 2>/dev/null; done
+		eend $?
+	done
+
+	# and now, finally, we patch it :)
+	for x in ${KPATCH_DIR}; do
+		for i in $(find ${x} -maxdepth 1 -iname "*.patch*" -or -iname "*.diff*" | sort -n); do
+			STDERR_T="${T}/${i/*\//}"
+			STDERR_T="${STDERR_T/.patch*/.err}"
+
+			[ -z ${i/*.patch*/} ] && PATCH_DEPTH=${i/*.patch/}
+			#[ -z ${i/*.diff*/} ]  && PATCH_DEPTH=${i/*.diff/}
+
+			if [ -z "${PATCH_DEPTH}" ]; then PATCH_DEPTH=0; fi
+
+			####################################################################
+			# IMPORTANT: This is temporary code to support Linux git 3.15_rc1! #
+			#                                                                  #
+			# The patch contains a removal of a symlink, followed by addition  #
+			# of a file with the same name as the symlink in the same          #
+			# location; this causes the dry-run to fail, filed bug #507656.    #
+			#                                                                  #
+			# https://bugs.gentoo.org/show_bug.cgi?id=507656                   #
+			####################################################################
+			if [[ -n ${K_FROM_GIT} ]] ; then
+				if [[ ${KV_MAJOR} -gt 3 || ( ${KV_MAJOR} -eq 3 && ${KV_PATCH} -gt 15 ) &&
+					${RELEASETYPE} == -rc ]] ; then
+					ebegin "Applying ${i/*\//} (-p1)"
+					if [ $(patch -p1 --no-backup-if-mismatch -f < ${i} >> ${STDERR_T}) "$?" -le 2 ]; then
+						eend 0
+						rm ${STDERR_T} || die
+						break
+					else
+						eend 1
+						eerror "Failed to apply patch ${i/*\//}"
+						eerror "Please attach ${STDERR_T} to any bug you may post."
+						eshopts_pop
+						die "Failed to apply ${i/*\//} on patch depth 1."
+					fi
+				fi
+			fi
+			####################################################################
+
+			while [ ${PATCH_DEPTH} -lt 5 ]; do
+				echo "Attempting Dry-run:" >> ${STDERR_T}
+				echo "cmd: patch -p${PATCH_DEPTH} --no-backup-if-mismatch --dry-run -f < ${i}" >> ${STDERR_T}
+				echo "=======================================================" >> ${STDERR_T}
+				if [ $(patch -p${PATCH_DEPTH} --no-backup-if-mismatch --dry-run -f < ${i} >> ${STDERR_T}) $? -eq 0 ]; then
+					ebegin "Applying ${i/*\//} (-p${PATCH_DEPTH})"
+					echo "Attempting patch:" > ${STDERR_T}
+					echo "cmd: patch -p${PATCH_DEPTH} --no-backup-if-mismatch -f < ${i}" >> ${STDERR_T}
+					echo "=======================================================" >> ${STDERR_T}
+					if [ $(patch -p${PATCH_DEPTH} --no-backup-if-mismatch -f < ${i} >> ${STDERR_T}) "$?" -eq 0 ]; then
+						eend 0
+						rm ${STDERR_T} || die
+						break
+					else
+						eend 1
+						eerror "Failed to apply patch ${i/*\//}"
+						eerror "Please attach ${STDERR_T} to any bug you may post."
+						eshopts_pop
+						die "Failed to apply ${i/*\//} on patch depth ${PATCH_DEPTH}."
+					fi
+				else
+					PATCH_DEPTH=$((${PATCH_DEPTH} + 1))
+				fi
+			done
+			if [ ${PATCH_DEPTH} -eq 5 ]; then
+				eerror "Failed to dry-run patch ${i/*\//}"
+				eerror "Please attach ${STDERR_T} to any bug you may post."
+				eshopts_pop
+				die "Unable to dry-run patch on any patch depth lower than 5."
+			fi
+		done
+	done
+
+	# When genpatches is used, we want to install 0000_README which documents
+	# the patches that were used; such that the user can see them, bug #301478.
+	if [[ ! -z ${K_WANT_GENPATCHES} ]] ; then
+		UNIPATCH_DOCS="${UNIPATCH_DOCS} 0000_README"
+	fi
+
+	# When files listed in UNIPATCH_DOCS are found in KPATCH_DIR's, we copy it
+	# to the temporary directory and remember them in UNIPATCH_DOCS to install
+	# them during the install phase.
+	local tmp
+	for x in ${KPATCH_DIR}; do
+		for i in ${UNIPATCH_DOCS}; do
+			if [[ -f ${x}/${i} ]] ; then
+				tmp="${tmp} ${i}"
+				cp -f "${x}/${i}" "${T}"/ || die
+			fi
+		done
+	done
+	UNIPATCH_DOCS="${tmp}"
+
+	# clean up  KPATCH_DIR's - fixes bug #53610
+	for x in ${KPATCH_DIR}; do rm -Rf ${x}; done
+
+	LC_ALL="${myLC_ALL}"
+	LANG="${myLANG}"
+	eshopts_pop
+}
+
+# @FUNCTION: getfilevar
+# @USAGE: <variable> <configfile>
+# @DESCRIPTION:
+# pulled from linux-info
+
+getfilevar() {
+	local workingdir basefname basedname xarch=$(tc-arch-kernel)
+
+	if [[ -z ${1} ]] && [[ ! -f ${2} ]]; then
+		echo -e "\n"
+		eerror "getfilevar requires 2 variables, with the second a valid file."
+		eerror "   getfilevar <VARIABLE> <CONFIGFILE>"
+	else
+		workingdir=${PWD}
+		basefname=$(basename ${2})
+		basedname=$(dirname ${2})
+		unset ARCH
+
+		cd ${basedname}
+		echo -e "include ${basefname}\ne:\n\t@echo \$(${1})" | \
+			make ${BUILD_FIXES} -s -f - e 2>/dev/null
+		cd ${workingdir}
+
+		ARCH=${xarch}
+	fi
+}
+
+# @FUNCTION: detect_arch
+# @USAGE:
+# @DESCRIPTION:
+# This function sets ARCH_URI and ARCH_PATCH
+# with the neccessary info for the arch sepecific compatibility
+# patchsets.
+
+detect_arch() {
+
+	local ALL_ARCH LOOP_ARCH LOOP_ARCH_L COMPAT_URI i TC_ARCH_KERNEL
+
+	# COMPAT_URI is the contents of ${ARCH}_URI
+	# ARCH_URI is the URI for all the ${ARCH}_URI patches
+	# ARCH_PATCH is ARCH_URI broken into files for UNIPATCH
+
+	ARCH_URI=""
+	ARCH_PATCH=""
+	TC_ARCH_KERNEL=""
+	ALL_ARCH="ALPHA AMD64 ARM HPPA IA64 M68K MIPS PPC PPC64 S390 SH SPARC X86"
+
+	for LOOP_ARCH in ${ALL_ARCH}; do
+		COMPAT_URI="${LOOP_ARCH}_URI"
+		COMPAT_URI="${!COMPAT_URI}"
+
+		declare -l LOOP_ARCH_L=${LOOP_ARCH}
+
+		[[ -n ${COMPAT_URI} ]] && \
+			ARCH_URI="${ARCH_URI} ${LOOP_ARCH_L}? ( ${COMPAT_URI} )"
+
+		declare -u TC_ARCH_KERNEL=$(tc-arch-kernel)
+		if [[ ${LOOP_ARCH} == ${TC_ARCH_KERNEL} ]]; then
+			for i in ${COMPAT_URI}; do
+				ARCH_PATCH="${ARCH_PATCH} ${DISTDIR}/${i/*\//}"
+			done
+		fi
+
+	done
+}
+
+# @FUNCTION: headers___fix
+# @USAGE:
+# @DESCRIPTION:
+# Voodoo to partially fix broken upstream headers.
+# note: do not put inline/asm/volatile together (breaks "inline asm volatile")
+
+headers___fix() {
+	sed -i \
+		-e '/^\#define.*_TYPES_H/{:loop n; bloop}' \
+		-e 's:\<\([us]\(8\|16\|32\|64\)\)\>:__\1:g' \
+		-e "s/\([[:space:]]\)inline\([[:space:](]\)/\1__inline__\2/g" \
+		-e "s/\([[:space:]]\)asm\([[:space:](]\)/\1__asm__\2/g" \
+		-e "s/\([[:space:]]\)volatile\([[:space:](]\)/\1__volatile__\2/g" \
+		"$@"
+}
+
+# @FUNCTION: kernel-2_src_unpack
+# @USAGE:
+# @DESCRIPTION:
+# unpack sources, handle genpatches, deblob
+
+kernel-2_src_unpack() {
+	universal_unpack
+	debug-print "Doing unipatch"
+
+	# request UNIPATCH_LIST_GENPATCHES in phase since it calls 'use'
+	handle_genpatches --set-unipatch-list
+	[[ -n ${UNIPATCH_LIST} || -n ${UNIPATCH_LIST_DEFAULT} || -n ${UNIPATCH_LIST_GENPATCHES} ]] && \
+		unipatch "${UNIPATCH_LIST_DEFAULT} ${UNIPATCH_LIST_GENPATCHES} ${UNIPATCH_LIST}"
+
+	debug-print "Doing premake"
+
+	# allow ebuilds to massage the source tree after patching but before
+	# we run misc `make` functions below
+	[[ $(type -t kernel-2_hook_premake) == "function" ]] && kernel-2_hook_premake
+
+	debug-print "Doing unpack_set_extraversion"
+
+	[[ -z ${K_NOSETEXTRAVERSION} ]] && unpack_set_extraversion
+	unpack_fix_install_path
+
+	# Setup xmakeopts and cd into sourcetree.
+	env_setup_xmakeopts
+	cd "${S}"
+
+	# We dont need a version.h for anything other than headers
+	# at least, I should hope we dont. If this causes problems
+	# take out the if/fi block and inform me please.
+	# unpack_2_6 should now be 2.6.17 safe anyways
+	if [[ ${ETYPE} == headers ]]; then
+		kernel_is 2 4 && unpack_2_4
+		kernel_is 2 6 && unpack_2_6
+	fi
+
+	if [[ $K_DEBLOB_AVAILABLE == 1 ]] && use deblob ; then
+		cp "${DISTDIR}/${DEBLOB_A}" "${T}" || die "cp ${DEBLOB_A} failed"
+		cp "${DISTDIR}/${DEBLOB_CHECK_A}" "${T}/deblob-check" || die "cp ${DEBLOB_CHECK_A} failed"
+		chmod +x "${T}/${DEBLOB_A}" "${T}/deblob-check" || die "chmod deblob scripts failed"
+	fi
+
+	# fix a problem on ppc where TOUT writes to /usr/src/linux breaking sandbox
+	# only do this for kernel < 2.6.27 since this file does not exist in later
+	# kernels
+	if [[ -n ${KV_MINOR} &&  ${KV_MAJOR}.${KV_MINOR}.${KV_PATCH} < 2.6.27 ]] ; then
+		sed -i \
+			-e 's|TOUT      := .tmp_gas_check|TOUT  := $(T).tmp_gas_check|' \
+			"${S}"/arch/ppc/Makefile
+	else
+		sed -i \
+			-e 's|TOUT      := .tmp_gas_check|TOUT  := $(T).tmp_gas_check|' \
+			"${S}"/arch/powerpc/Makefile
+	fi
+}
+
+# @FUNCTION: kernel-2_src_prepare
+# @USAGE:
+# @DESCRIPTION:
+# Apply any user patches
+
+kernel-2_src_prepare() {
+
+	debug-print "Applying any user patches"
+
+	# apply any user patches
+	case ${EAPI:-0} in
+		0|1|2|3|4|5) epatch_user ;;
+		6) eapply_user ;;
+	esac
+}
+
+# @FUNCTION: kernel-2_src_compile
+# @USAGE:
+# @DESCRIPTION:
+# conpile headers or run deblob script
+
+kernel-2_src_compile() {
+	cd "${S}"
+	[[ ${ETYPE} == headers ]] && compile_headers
+
+	if [[ $K_DEBLOB_AVAILABLE == 1 ]] && use deblob ; then
+		echo ">>> Running deblob script ..."
+		python_setup
+		sh "${T}/${DEBLOB_A}" --force || die "Deblob script failed to run!!!"
+	fi
+}
+
+# @FUNCTION: kernel-2_src_test
+# @USAGE:
+# @DESCRIPTION:
+# if you leave it to the default src_test, it will run make to
+# find whether test/check targets are present; since "make test"
+# actually produces a few support files, they are installed even
+# though the package is binchecks-restricted.
+#
+# Avoid this altogether by making the function moot.
+kernel-2_src_test() { :; }
+
+# @FUNCTION: kernel-2_pkg_preinst
+# @DESCRIPTION:
+# if ETYPE = headers, call preinst_headers
+
+kernel-2_pkg_preinst() {
+	[[ ${ETYPE} == headers ]] && preinst_headers
+}
+
+# @FUNCTION: kernel-2_src_install
+# @USAGE:
+# @DESCRIPTION:
+# Install headers or sources dependant on ETYPE
+
+kernel-2_src_install() {
+	install_universal
+	[[ ${ETYPE} == headers ]] && install_headers
+	[[ ${ETYPE} == sources ]] && install_sources
+}
+
+# @FUNCTION: kernel-2_pkg_postinst
+# @USAGE:
+# @DESCRIPTION:
+# call postinst_sources for ETYPE = sources
+
+kernel-2_pkg_postinst() {
+	[[ ${ETYPE} == sources ]] && postinst_sources
+}
+
+# @FUNCTION: kernel-2_pkg_setup
+# @USAGE:
+# @DESCRIPTION:
+# check for supported kernel version, die if ETYPE is unknown, call setup_headers
+# if necessary
+
+kernel-2_pkg_setup() {
+	if kernel_is 2 4; then
+		if [[ $(gcc-major-version) -ge 4 ]] ; then
+			echo
+			ewarn "Be warned !! >=sys-devel/gcc-4.0.0 isn't supported with linux-2.4!"
+			ewarn "Either switch to another gcc-version (via gcc-config) or use a"
+			ewarn "newer kernel that supports gcc-4."
+			echo
+			ewarn "Also be aware that bugreports about gcc-4 not working"
+			ewarn "with linux-2.4 based ebuilds will be closed as INVALID!"
+			echo
+		fi
+	fi
+
+	ABI="${KERNEL_ABI}"
+	if [[ ${ETYPE} != sources ]] && [[ ${ETYPE} != headers ]]; then
+		eerror "Unknown ETYPE=\"${ETYPE}\", must be \"sources\" or \"headers\""
+		die "Unknown ETYPE=\"${ETYPE}\", must be \"sources\" or \"headers\""
+	fi
+
+	[[ ${ETYPE} == headers ]] && setup_headers
+	[[ ${ETYPE} == sources ]] && echo ">>> Preparing to unpack ..."
+}
+
+# @FUNCTION: kernel-2_pkg_postrm
+# @USAGE:
+# @DESCRIPTION:
+# Notify the user that after a depclean, there may be sources
+# left behind that need to be manually cleaned
+
+kernel-2_pkg_postrm() {
+	# This warning only makes sense for kernel sources.
+	[[ ${ETYPE} == headers ]] && return 0
+
+	# If there isn't anything left behind, then don't complain.
+	[[ -e ${EROOT}usr/src/linux-${KV_FULL} ]] || return 0
+	echo
+	ewarn "Note: Even though you have successfully unmerged "
+	ewarn "your kernel package, directories in kernel source location: "
+	ewarn "${EROOT}usr/src/linux-${KV_FULL}"
+	ewarn "with modified files will remain behind. By design, package managers"
+	ewarn "will not remove these modified files and the directories they reside in."
+	echo
+	ewarn "For more detailed kernel removal instructions, please see: "
+	ewarn "https://wiki.gentoo.org/wiki/Kernel/Removal"
+	echo
+}

diff --git a/eclass/linux-info.eclass b/eclass/linux-info.eclass
new file mode 100644
index 0000000..98ec0ac
--- /dev/null
+++ b/eclass/linux-info.eclass
@@ -0,0 +1,966 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+# @ECLASS: linux-info.eclass
+# @MAINTAINER:
+# kernel@gentoo.org
+# @AUTHOR:
+# Original author: John Mylchreest <johnm@gentoo.org>
+# @BLURB: eclass used for accessing kernel related information
+# @DESCRIPTION:
+# This eclass is used as a central eclass for accessing kernel
+# related information for source or binary already installed.
+# It is vital for linux-mod.eclass to function correctly, and is split
+# out so that any ebuild behaviour "templates" are abstracted out
+# using additional eclasses.
+#
+# "kernel config" in this file means:
+# The .config of the currently installed sources is used as the first
+# preference, with a fall-back to bundled config (/proc/config.gz) if available.
+#
+# Before using any of the config-handling functions in this eclass, you must
+# ensure that one of the following functions has been called (in order of
+# preference), otherwise you will get bugs like #364041):
+# linux-info_pkg_setup
+# linux-info_get_any_version
+# get_version
+# get_running_version
+
+# A Couple of env vars are available to effect usage of this eclass
+# These are as follows:
+
+# @ECLASS-VARIABLE: KERNEL_DIR
+# @DESCRIPTION:
+# A string containing the directory of the target kernel sources. The default value is
+# "/usr/src/linux"
+
+# @ECLASS-VARIABLE: CONFIG_CHECK
+# @DESCRIPTION:
+# A string containing a list of .config options to check for before
+# proceeding with the install.
+#
+#   e.g.: CONFIG_CHECK="MTRR"
+#
+# You can also check that an option doesn't exist by
+# prepending it with an exclamation mark (!).
+#
+#   e.g.: CONFIG_CHECK="!MTRR"
+#
+# To simply warn about a missing option, prepend a '~'.
+# It may be combined with '!'.
+#
+# In general, most checks should be non-fatal. The only time fatal checks should
+# be used is for building kernel modules or cases that a compile will fail
+# without the option.
+#
+# This is to allow usage of binary kernels, and minimal systems without kernel
+# sources.
+
+# @ECLASS-VARIABLE: ERROR_<CFG>
+# @DESCRIPTION:
+# A string containing the error message to display when the check against CONFIG_CHECK
+# fails. <CFG> should reference the appropriate option used in CONFIG_CHECK.
+#
+#   e.g.: ERROR_MTRR="MTRR exists in the .config but shouldn't!!"
+
+# @ECLASS-VARIABLE: KBUILD_OUTPUT
+# @DESCRIPTION:
+# A string passed on commandline, or set from the kernel makefile. It contains the directory
+# which is to be used as the kernel object directory.
+
+# There are also a couple of variables which are set by this, and shouldn't be
+# set by hand. These are as follows:
+
+# @ECLASS-VARIABLE: KV_FULL
+# @DESCRIPTION:
+# A read-only variable. It's a string containing the full kernel version. ie: 2.6.9-gentoo-johnm-r1
+
+# @ECLASS-VARIABLE: KV_MAJOR
+# @DESCRIPTION:
+# A read-only variable. It's an integer containing the kernel major version. ie: 2
+
+# @ECLASS-VARIABLE: KV_MINOR
+# @DESCRIPTION:
+# A read-only variable. It's an integer containing the kernel minor version. ie: 6
+
+# @ECLASS-VARIABLE: KV_PATCH
+# @DESCRIPTION:
+# A read-only variable. It's an integer containing the kernel patch version. ie: 9
+
+# @ECLASS-VARIABLE: KV_EXTRA
+# @DESCRIPTION:
+# A read-only variable. It's a string containing the kernel EXTRAVERSION. ie: -gentoo
+
+# @ECLASS-VARIABLE: KV_LOCAL
+# @DESCRIPTION:
+# A read-only variable. It's a string containing the kernel LOCALVERSION concatenation. ie: -johnm
+
+# @ECLASS-VARIABLE: KV_DIR
+# @DESCRIPTION:
+# A read-only variable. It's a string containing the kernel source directory, will be null if
+# KERNEL_DIR is invalid.
+
+# @ECLASS-VARIABLE: KV_OUT_DIR
+# @DESCRIPTION:
+# A read-only variable. It's a string containing the kernel object directory, will be KV_DIR unless
+# KBUILD_OUTPUT is used. This should be used for referencing .config.
+
+# And to ensure all the weirdness with crosscompile
+inherit toolchain-funcs
+[[ ${EAPI:-0} == [0123456] ]] && inherit eapi7-ver
+
+EXPORT_FUNCTIONS pkg_setup
+
+IUSE="kernel_linux"
+
+# Overwritable environment Var's
+# ---------------------------------------
+KERNEL_DIR="${KERNEL_DIR:-${ROOT%/}/usr/src/linux}"
+
+
+# Bug fixes
+# fix to bug #75034
+case ${ARCH} in
+	ppc)	BUILD_FIXES="${BUILD_FIXES} TOUT=${T}/.tmp_gas_check";;
+	ppc64)	BUILD_FIXES="${BUILD_FIXES} TOUT=${T}/.tmp_gas_check";;
+esac
+
+# @FUNCTION: set_arch_to_kernel
+# @DESCRIPTION:
+# Set the env ARCH to match what the kernel expects.
+set_arch_to_kernel() { export ARCH=$(tc-arch-kernel); }
+# @FUNCTION: set_arch_to_portage
+# @DESCRIPTION:
+# Set the env ARCH to match what portage expects.
+set_arch_to_portage() { export ARCH=$(tc-arch); }
+
+# qeinfo "Message"
+# -------------------
+# qeinfo is a quiet einfo call when EBUILD_PHASE
+# should not have visible output.
+qout() {
+	local outputmsg type
+	type=${1}
+	shift
+	outputmsg="${@}"
+	case "${EBUILD_PHASE}" in
+		depend)  unset outputmsg;;
+		clean)   unset outputmsg;;
+		preinst) unset outputmsg;;
+	esac
+	[ -n "${outputmsg}" ] && ${type} "${outputmsg}"
+}
+
+qeinfo() { qout einfo "${@}" ; }
+qewarn() { qout ewarn "${@}" ; }
+qeerror() { qout eerror "${@}" ; }
+
+# File Functions
+# ---------------------------------------
+
+# @FUNCTION: getfilevar
+# @USAGE: variable configfile
+# @RETURN: the value of the variable
+# @DESCRIPTION:
+# It detects the value of the variable defined in the file configfile. This is
+# done by including the configfile, and printing the variable with Make.
+# It WILL break if your makefile has missing dependencies!
+getfilevar() {
+	local ERROR basefname basedname myARCH="${ARCH}" M="${S}"
+	ERROR=0
+
+	[ -z "${1}" ] && ERROR=1
+	[ ! -f "${2}" ] && ERROR=1
+
+	if [ "${ERROR}" = 1 ]
+	then
+		echo -e "\n"
+		eerror "getfilevar requires 2 variables, with the second a valid file."
+		eerror "   getfilevar <VARIABLE> <CONFIGFILE>"
+	else
+		basefname="$(basename ${2})"
+		basedname="$(dirname ${2})"
+		unset ARCH
+
+		# We use nonfatal because we want the caller to take care of things #373151
+		[[ ${EAPI:-0} == [0123] ]] && nonfatal() { "$@"; }
+		case ${EBUILD_PHASE_FUNC} in
+			pkg_info|pkg_nofetch|pkg_pretend) M="${T}" ;;
+		esac
+		echo -e "e:\\n\\t@echo \$(${1})\\ninclude ${basefname}" | \
+			nonfatal emake -C "${basedname}" M="${M}" ${BUILD_FIXES} -s -f - 2>/dev/null
+
+		ARCH=${myARCH}
+	fi
+}
+
+# @FUNCTION: getfilevar_noexec
+# @USAGE: variable configfile
+# @RETURN: the value of the variable
+# @DESCRIPTION:
+# It detects the value of the variable defined in the file configfile.
+# This is done with sed matching an expression only. If the variable is defined,
+# you will run into problems. See getfilevar for those cases.
+getfilevar_noexec() {
+	local ERROR basefname basedname mycat myARCH="${ARCH}"
+	ERROR=0
+	mycat='cat'
+
+	[ -z "${1}" ] && ERROR=1
+	[ ! -f "${2}" ] && ERROR=1
+	[ "${2%.gz}" != "${2}" ] && mycat='zcat'
+
+	if [ "${ERROR}" = 1 ]
+	then
+		echo -e "\n"
+		eerror "getfilevar_noexec requires 2 variables, with the second a valid file."
+		eerror "   getfilevar_noexec <VARIABLE> <CONFIGFILE>"
+	else
+		${mycat} "${2}" | \
+		sed -n \
+		-e "/^[[:space:]]*${1}[[:space:]]*:\\?=[[:space:]]*\(.*\)\$/{
+			s,^[^=]*[[:space:]]*=[[:space:]]*,,g ;
+			s,[[:space:]]*\$,,g ;
+			p
+		}"
+	fi
+}
+
+# @ECLASS-VARIABLE: _LINUX_CONFIG_EXISTS_DONE
+# @INTERNAL
+# @DESCRIPTION:
+# This is only set if one of the linux_config_*exists functions has been called.
+# We use it for a QA warning that the check for a config has not been performed,
+# as linux_chkconfig* in non-legacy mode WILL return an undefined value if no
+# config is available at all.
+_LINUX_CONFIG_EXISTS_DONE=
+
+linux_config_qa_check() {
+	local f="$1"
+	if [ -z "${_LINUX_CONFIG_EXISTS_DONE}" ]; then
+		ewarn "QA: You called $f before any linux_config_exists!"
+		ewarn "QA: The return value of $f will NOT guaranteed later!"
+	fi
+
+	if ! use kernel_linux; then
+		die "$f called on non-Linux system, please fix the ebuild"
+	fi
+}
+
+# @FUNCTION: linux_config_src_exists
+# @RETURN: true or false
+# @DESCRIPTION:
+# It returns true if .config exists in a build directory otherwise false
+linux_config_src_exists() {
+	export _LINUX_CONFIG_EXISTS_DONE=1
+	use kernel_linux && [[ -n ${KV_OUT_DIR} && -s ${KV_OUT_DIR}/.config ]]
+}
+
+# @FUNCTION: linux_config_bin_exists
+# @RETURN: true or false
+# @DESCRIPTION:
+# It returns true if .config exists in /proc, otherwise false
+linux_config_bin_exists() {
+	export _LINUX_CONFIG_EXISTS_DONE=1
+	use kernel_linux && [[ -s /proc/config.gz ]]
+}
+
+# @FUNCTION: linux_config_exists
+# @RETURN: true or false
+# @DESCRIPTION:
+# It returns true if .config exists otherwise false
+#
+# This function MUST be checked before using any of the linux_chkconfig_*
+# functions.
+linux_config_exists() {
+	linux_config_src_exists || linux_config_bin_exists
+}
+
+# @FUNCTION: linux_config_path
+# @DESCRIPTION:
+# Echo the name of the config file to use.  If none are found,
+# then return false.
+linux_config_path() {
+	if linux_config_src_exists; then
+		echo "${KV_OUT_DIR}/.config"
+	elif linux_config_bin_exists; then
+		echo "/proc/config.gz"
+	else
+		return 1
+	fi
+}
+
+# @FUNCTION: require_configured_kernel
+# @DESCRIPTION:
+# This function verifies that the current kernel is configured (it checks against the existence of .config)
+# otherwise it dies.
+require_configured_kernel() {
+	if ! use kernel_linux; then
+		die "${FUNCNAME}() called on non-Linux system, please fix the ebuild"
+	fi
+
+	if ! linux_config_src_exists; then
+		qeerror "Could not find a usable .config in the kernel source directory."
+		qeerror "Please ensure that ${KERNEL_DIR} points to a configured set of Linux sources."
+		qeerror "If you are using KBUILD_OUTPUT, please set the environment var so that"
+		qeerror "it points to the necessary object directory so that it might find .config."
+		die "Kernel not configured; no .config found in ${KV_OUT_DIR}"
+	fi
+	get_version || die "Unable to determine configured kernel version"
+}
+
+# @FUNCTION: linux_chkconfig_present
+# @USAGE: option
+# @RETURN: true or false
+# @DESCRIPTION:
+# It checks that CONFIG_<option>=y or CONFIG_<option>=m is present in the current kernel .config
+# If linux_config_exists returns false, the results of this are UNDEFINED. You
+# MUST call linux_config_exists first.
+linux_chkconfig_present() {
+	linux_config_qa_check linux_chkconfig_present
+	[[ $(getfilevar_noexec "CONFIG_$1" "$(linux_config_path)") == [my] ]]
+}
+
+# @FUNCTION: linux_chkconfig_module
+# @USAGE: option
+# @RETURN: true or false
+# @DESCRIPTION:
+# It checks that CONFIG_<option>=m is present in the current kernel .config
+# If linux_config_exists returns false, the results of this are UNDEFINED. You
+# MUST call linux_config_exists first.
+linux_chkconfig_module() {
+	linux_config_qa_check linux_chkconfig_module
+	[[ $(getfilevar_noexec "CONFIG_$1" "$(linux_config_path)") == m ]]
+}
+
+# @FUNCTION: linux_chkconfig_builtin
+# @USAGE: option
+# @RETURN: true or false
+# @DESCRIPTION:
+# It checks that CONFIG_<option>=y is present in the current kernel .config
+# If linux_config_exists returns false, the results of this are UNDEFINED. You
+# MUST call linux_config_exists first.
+linux_chkconfig_builtin() {
+	linux_config_qa_check linux_chkconfig_builtin
+	[[ $(getfilevar_noexec "CONFIG_$1" "$(linux_config_path)") == y ]]
+}
+
+# @FUNCTION: linux_chkconfig_string
+# @USAGE: option
+# @RETURN: CONFIG_<option>
+# @DESCRIPTION:
+# It prints the CONFIG_<option> value of the current kernel .config (it requires a configured kernel).
+# If linux_config_exists returns false, the results of this are UNDEFINED. You
+# MUST call linux_config_exists first.
+linux_chkconfig_string() {
+	linux_config_qa_check linux_chkconfig_string
+	getfilevar_noexec "CONFIG_$1" "$(linux_config_path)"
+}
+
+# Versioning Functions
+# ---------------------------------------
+
+# @FUNCTION: kernel_is
+# @USAGE: [-lt -gt -le -ge -eq] major_number [minor_number patch_number]
+# @RETURN: true or false
+# @DESCRIPTION:
+# It returns true when the current kernel version satisfies the comparison against the passed version.
+# -eq is the default comparison.
+#
+# @CODE
+# For Example where KV = 2.6.9
+# kernel_is 2 4   returns false
+# kernel_is 2     returns true
+# kernel_is 2 6   returns true
+# kernel_is 2 6 8 returns false
+# kernel_is 2 6 9 returns true
+# @CODE
+
+# Note: duplicated in kernel-2.eclass
+kernel_is() {
+	if ! use kernel_linux; then
+		die "${FUNCNAME}() called on non-Linux system, please fix the ebuild"
+	fi
+
+	# if we haven't determined the version yet, we need to.
+	linux-info_get_any_version
+
+	# Now we can continue
+	local operator test value
+
+	case ${1#-} in
+	  lt) operator="-lt"; shift;;
+	  gt) operator="-gt"; shift;;
+	  le) operator="-le"; shift;;
+	  ge) operator="-ge"; shift;;
+	  eq) operator="-eq"; shift;;
+	   *) operator="-eq";;
+	esac
+	[[ $# -gt 3 ]] && die "Error in kernel-2_kernel_is(): too many parameters"
+
+	: $(( test = (KV_MAJOR << 16) + (KV_MINOR << 8) + KV_PATCH ))
+	: $(( value = (${1:-${KV_MAJOR}} << 16) + (${2:-${KV_MINOR}} << 8) + ${3:-${KV_PATCH}} ))
+	[ ${test} ${operator} ${value} ]
+}
+
+get_localversion() {
+	local lv_list i x
+
+	local shopt_save=$(shopt -p nullglob)
+	shopt -s nullglob
+	local files=( ${1}/localversion* )
+	${shopt_save}
+
+	# ignore files with ~ in it.
+	for i in "${files[@]}"; do
+		[[ -n ${i//*~*} ]] && lv_list="${lv_list} ${i}"
+	done
+
+	for i in ${lv_list}; do
+		x="${x}$(<${i})"
+	done
+	x=${x/ /}
+	echo ${x}
+}
+
+# Check if the Makefile is valid for direct parsing.
+# Check status results:
+# - PASS, use 'getfilevar' to extract values
+# - FAIL, use 'getfilevar_noexec' to extract values
+# The check may fail if:
+# - make is not present
+# - corruption exists in the kernel makefile
+get_makefile_extract_function() {
+	local a='' b='' mkfunc='getfilevar'
+	a="$(getfilevar VERSION ${KERNEL_MAKEFILE})"
+	b="$(getfilevar_noexec VERSION ${KERNEL_MAKEFILE})"
+	[[ "${a}" != "${b}" ]] && mkfunc='getfilevar_noexec'
+	echo "${mkfunc}"
+}
+
+# internal variable, so we know to only print the warning once
+get_version_warning_done=
+
+# @FUNCTION: get_version
+# @DESCRIPTION:
+# It gets the version of the kernel inside KERNEL_DIR and populates the KV_FULL variable
+# (if KV_FULL is already set it does nothing).
+#
+# The kernel version variables (KV_MAJOR, KV_MINOR, KV_PATCH, KV_EXTRA and KV_LOCAL) are also set.
+#
+# The KV_DIR is set using the KERNEL_DIR env var, the KV_DIR_OUT is set using a valid
+# KBUILD_OUTPUT (in a decreasing priority list, we look for the env var, makefile var or the
+# symlink /lib/modules/${KV_MAJOR}.${KV_MINOR}.${KV_PATCH}${KV_EXTRA}/build).
+get_version() {
+	if ! use kernel_linux; then
+		die "${FUNCNAME}() called on non-Linux system, please fix the ebuild"
+	fi
+
+	local tmplocal
+
+	# no need to execute this twice assuming KV_FULL is populated.
+	# we can force by unsetting KV_FULL
+	[ -n "${KV_FULL}" ] && return 0
+
+	# if we dont know KV_FULL, then we need too.
+	# make sure KV_DIR isnt set since we need to work it out via KERNEL_DIR
+	unset KV_DIR
+
+	# KV_DIR will contain the full path to the sources directory we should use
+	[ -z "${get_version_warning_done}" ] && \
+	qeinfo "Determining the location of the kernel source code"
+	[ -d "${KERNEL_DIR}" ] && KV_DIR="${KERNEL_DIR}"
+
+	if [ -z "${KV_DIR}" ]
+	then
+		if [ -z "${get_version_warning_done}" ]; then
+			get_version_warning_done=1
+			qewarn "Unable to find kernel sources at ${KERNEL_DIR}"
+			#qeinfo "This package requires Linux sources."
+			if [ "${KERNEL_DIR}" == "/usr/src/linux" ] ; then
+				qeinfo "Please make sure that ${KERNEL_DIR} points at your running kernel, "
+				qeinfo "(or the kernel you wish to build against)."
+				qeinfo "Alternatively, set the KERNEL_DIR environment variable to the kernel sources location"
+			else
+				qeinfo "Please ensure that the KERNEL_DIR environment variable points at full Linux sources of the kernel you wish to compile against."
+			fi
+		fi
+		return 1
+	fi
+
+	# See if the kernel dir is actually an output dir. #454294
+	if [ -z "${KBUILD_OUTPUT}" -a -L "${KERNEL_DIR}/source" ]; then
+		KBUILD_OUTPUT=${KERNEL_DIR}
+		KERNEL_DIR=$(readlink -f "${KERNEL_DIR}/source")
+		KV_DIR=${KERNEL_DIR}
+	fi
+
+	if [ -z "${get_version_warning_done}" ]; then
+		qeinfo "Found kernel source directory:"
+		qeinfo "    ${KV_DIR}"
+	fi
+
+	if [ ! -s "${KV_DIR}/Makefile" ]
+	then
+		if [ -z "${get_version_warning_done}" ]; then
+			get_version_warning_done=1
+			qeerror "Could not find a Makefile in the kernel source directory."
+			qeerror "Please ensure that ${KERNEL_DIR} points to a complete set of Linux sources"
+		fi
+		return 1
+	fi
+
+	# OK so now we know our sources directory, but they might be using
+	# KBUILD_OUTPUT, and we need this for .config and localversions-*
+	# so we better find it eh?
+	# do we pass KBUILD_OUTPUT on the CLI?
+	local OUTPUT_DIR=${KBUILD_OUTPUT}
+
+	# keep track of it
+	KERNEL_MAKEFILE="${KV_DIR}/Makefile"
+
+	if [[ -z ${OUTPUT_DIR} ]]; then
+		# Decide the function used to extract makefile variables.
+		local mkfunc=$(get_makefile_extract_function "${KERNEL_MAKEFILE}")
+
+		# And if we didn't pass it, we can take a nosey in the Makefile.
+		OUTPUT_DIR=$(${mkfunc} KBUILD_OUTPUT "${KERNEL_MAKEFILE}")
+	fi
+
+	# And contrary to existing functions I feel we shouldn't trust the
+	# directory name to find version information as this seems insane.
+	# So we parse ${KERNEL_MAKEFILE}.  We should be able to trust that
+	# the Makefile is simple enough to use the noexec extract function.
+	# This has been true for every release thus far, and it's faster
+	# than using make to evaluate the Makefile every time.
+	KV_MAJOR=$(getfilevar_noexec VERSION "${KERNEL_MAKEFILE}")
+	KV_MINOR=$(getfilevar_noexec PATCHLEVEL "${KERNEL_MAKEFILE}")
+	KV_PATCH=$(getfilevar_noexec SUBLEVEL "${KERNEL_MAKEFILE}")
+	KV_EXTRA=$(getfilevar_noexec EXTRAVERSION "${KERNEL_MAKEFILE}")
+
+	if [ -z "${KV_MAJOR}" -o -z "${KV_MINOR}" -o -z "${KV_PATCH}" ]
+	then
+		if [ -z "${get_version_warning_done}" ]; then
+			get_version_warning_done=1
+			qeerror "Could not detect kernel version."
+			qeerror "Please ensure that ${KERNEL_DIR} points to a complete set of Linux sources."
+		fi
+		return 1
+	fi
+
+	[ -d "${OUTPUT_DIR}" ] && KV_OUT_DIR="${OUTPUT_DIR}"
+	if [ -n "${KV_OUT_DIR}" ];
+	then
+		qeinfo "Found kernel object directory:"
+		qeinfo "    ${KV_OUT_DIR}"
+	fi
+	# and if we STILL have not got it, then we better just set it to KV_DIR
+	KV_OUT_DIR="${KV_OUT_DIR:-${KV_DIR}}"
+
+	# Grab the kernel release from the output directory.
+	# TODO: we MUST detect kernel.release being out of date, and 'return 1' from
+	# this function.
+	if [ -s "${KV_OUT_DIR}"/include/config/kernel.release ]; then
+		KV_LOCAL=$(<"${KV_OUT_DIR}"/include/config/kernel.release)
+	elif [ -s "${KV_OUT_DIR}"/.kernelrelease ]; then
+		KV_LOCAL=$(<"${KV_OUT_DIR}"/.kernelrelease)
+	else
+		KV_LOCAL=
+	fi
+
+	# KV_LOCAL currently contains the full release; discard the first bits.
+	tmplocal=${KV_LOCAL#${KV_MAJOR}.${KV_MINOR}.${KV_PATCH}${KV_EXTRA}}
+
+	# If the updated local version was not changed, the tree is not prepared.
+	# Clear out KV_LOCAL in that case.
+	# TODO: this does not detect a change in the localversion part between
+	# kernel.release and the value that would be generated.
+	if [ "$KV_LOCAL" = "$tmplocal" ]; then
+		KV_LOCAL=
+	else
+		KV_LOCAL=$tmplocal
+	fi
+
+	# and in newer versions we can also pull LOCALVERSION if it is set.
+	# but before we do this, we need to find if we use a different object directory.
+	# This *WILL* break if the user is using localversions, but we assume it was
+	# caught before this if they are.
+	if [[ -z ${OUTPUT_DIR} ]] ; then
+		# Try to locate a kernel that is most relevant for us.
+		for OUTPUT_DIR in "${SYSROOT}" "${ROOT%/}" "" ; do
+			OUTPUT_DIR+="/lib/modules/${KV_MAJOR}.${KV_MINOR}.${KV_PATCH}${KV_EXTRA}${KV_LOCAL}/build"
+			if [[ -e ${OUTPUT_DIR} ]] ; then
+				break
+			fi
+		done
+	fi
+
+	# And we should set KV_FULL to the full expanded version
+	KV_FULL="${KV_MAJOR}.${KV_MINOR}.${KV_PATCH}${KV_EXTRA}${KV_LOCAL}"
+
+	qeinfo "Found sources for kernel version:"
+	qeinfo "    ${KV_FULL}"
+
+	return 0
+}
+
+# @FUNCTION: get_running_version
+# @DESCRIPTION:
+# It gets the version of the current running kernel and the result is the same as get_version() if the
+# function can find the sources.
+get_running_version() {
+	if ! use kernel_linux; then
+		die "${FUNCNAME}() called on non-Linux system, please fix the ebuild"
+	fi
+
+	KV_FULL=$(uname -r)
+
+	if [[ -f ${ROOT%/}/lib/modules/${KV_FULL}/source/Makefile && -f ${ROOT%/}/lib/modules/${KV_FULL}/build/Makefile ]]; then
+		KERNEL_DIR=$(readlink -f ${ROOT%/}/lib/modules/${KV_FULL}/source)
+		KBUILD_OUTPUT=$(readlink -f ${ROOT%/}/lib/modules/${KV_FULL}/build)
+		unset KV_FULL
+		get_version
+		return $?
+	elif [[ -f ${ROOT%/}/lib/modules/${KV_FULL}/source/Makefile ]]; then
+		KERNEL_DIR=$(readlink -f ${ROOT%/}/lib/modules/${KV_FULL}/source)
+		unset KV_FULL
+		get_version
+		return $?
+	elif [[ -f ${ROOT%/}/lib/modules/${KV_FULL}/build/Makefile ]]; then
+		KERNEL_DIR=$(readlink -f ${ROOT%/}/lib/modules/${KV_FULL}/build)
+		unset KV_FULL
+		get_version
+		return $?
+	else
+		# This handles a variety of weird kernel versions.  Make sure to update
+		# tests/linux-info_get_running_version.sh if you want to change this.
+		local kv_full=${KV_FULL//[-+_]*}
+		KV_MAJOR=$(ver_cut 1 ${kv_full})
+		KV_MINOR=$(ver_cut 2 ${kv_full})
+		KV_PATCH=$(ver_cut 3 ${kv_full})
+		KV_EXTRA="${KV_FULL#${KV_MAJOR}.${KV_MINOR}${KV_PATCH:+.${KV_PATCH}}}"
+		: ${KV_PATCH:=0}
+	fi
+	return 0
+}
+
+# This next function is named with the eclass prefix to avoid conflicts with
+# some old versionator-like eclass functions.
+
+# @FUNCTION: linux-info_get_any_version
+# @DESCRIPTION:
+# This attempts to find the version of the sources, and otherwise falls back to
+# the version of the running kernel.
+linux-info_get_any_version() {
+	if ! use kernel_linux; then
+		die "${FUNCNAME}() called on non-Linux system, please fix the ebuild"
+	fi
+
+	if ! get_version; then
+		ewarn "Unable to calculate Linux Kernel version for build, attempting to use running version"
+		if ! get_running_version; then
+			die "Unable to determine any Linux Kernel version, please report a bug"
+		fi
+	fi
+}
+
+
+# ebuild check functions
+# ---------------------------------------
+
+# @FUNCTION: check_kernel_built
+# @DESCRIPTION:
+# This function verifies that the current kernel sources have been already prepared otherwise it dies.
+check_kernel_built() {
+	if ! use kernel_linux; then
+		die "${FUNCNAME}() called on non-Linux system, please fix the ebuild"
+	fi
+
+	# if we haven't determined the version yet, we need to
+	require_configured_kernel
+
+	local versionh_path
+	if kernel_is -ge 3 7; then
+		versionh_path="include/generated/uapi/linux/version.h"
+	else
+		versionh_path="include/linux/version.h"
+	fi
+
+	if [ ! -f "${KV_OUT_DIR}/${versionh_path}" ]
+	then
+		eerror "These sources have not yet been prepared."
+		eerror "We cannot build against an unprepared tree."
+		eerror "To resolve this, please type the following:"
+		eerror
+		eerror "# cd ${KV_DIR}"
+		eerror "# make oldconfig"
+		eerror "# make modules_prepare"
+		eerror
+		eerror "Then please try merging this module again."
+		die "Kernel sources need compiling first"
+	fi
+}
+
+# @FUNCTION: check_modules_supported
+# @DESCRIPTION:
+# This function verifies that the current kernel support modules (it checks CONFIG_MODULES=y) otherwise it dies.
+check_modules_supported() {
+	if ! use kernel_linux; then
+		die "${FUNCNAME}() called on non-Linux system, please fix the ebuild"
+	fi
+
+	# if we haven't determined the version yet, we need too.
+	require_configured_kernel
+
+	if ! linux_chkconfig_builtin "MODULES"; then
+		eerror "These sources do not support loading external modules."
+		eerror "to be able to use this module please enable \"Loadable modules support\""
+		eerror "in your kernel, recompile and then try merging this module again."
+		die "No support for external modules in ${KV_FULL} config"
+	fi
+}
+
+# @FUNCTION: check_extra_config
+# @DESCRIPTION:
+# It checks the kernel config options specified by CONFIG_CHECK. It dies only when a required config option (i.e.
+# the prefix ~ is not used) doesn't satisfy the directive. Ignored on non-Linux systems.
+check_extra_config() {
+	use kernel_linux || return
+
+	local config negate die error reworkmodulenames
+	local soft_errors_count=0 hard_errors_count=0 config_required=0
+	# store the value of the QA check, because otherwise we won't catch usages
+	# after if check_extra_config is called AND other direct calls are done
+	# later.
+	local old_LINUX_CONFIG_EXISTS_DONE="${_LINUX_CONFIG_EXISTS_DONE}"
+
+	# if we haven't determined the version yet, we need to
+	linux-info_get_any_version
+
+	# Determine if we really need a .config. The only time when we don't need
+	# one is when all of the CONFIG_CHECK options are prefixed with "~".
+	for config in ${CONFIG_CHECK}; do
+		if [[ "${config:0:1}" != "~" ]]; then
+			config_required=1
+			break
+		fi
+	done
+
+	if [[ ${config_required} == 0 ]]; then
+		# In the case where we don't require a .config, we can now bail out
+		# if the user has no .config as there is nothing to do. Otherwise
+		# code later will cause a failure due to missing .config.
+		if ! linux_config_exists; then
+			ewarn "Unable to check for the following kernel config options due"
+			ewarn "to absence of any configured kernel sources or compiled"
+			ewarn "config:"
+			for config in ${CONFIG_CHECK}; do
+				config=${config#\~}
+				config=${config#\!}
+				local_error="ERROR_${config}"
+				msg="${!local_error}"
+				if [[ -z ${msg} ]]; then
+					local_error="WARNING_${config}"
+					msg="${!local_error}"
+				fi
+				ewarn " - ${config}${msg:+ - }${msg}"
+			done
+			ewarn "You're on your own to make sure they are set if needed."
+			export LINUX_CONFIG_EXISTS_DONE="${old_LINUX_CONFIG_EXISTS_DONE}"
+			return 0
+		fi
+	else
+		require_configured_kernel
+	fi
+
+	einfo "Checking for suitable kernel configuration options..."
+
+	for config in ${CONFIG_CHECK}
+	do
+		# if we specify any fatal, ensure we honor them
+		die=1
+		error=0
+		negate=0
+		reworkmodulenames=0
+
+		if [[ ${config:0:1} == "~" ]]; then
+			die=0
+			config=${config:1}
+		elif [[ ${config:0:1} == "@" ]]; then
+			die=0
+			reworkmodulenames=1
+			config=${config:1}
+		fi
+		if [[ ${config:0:1} == "!" ]]; then
+			negate=1
+			config=${config:1}
+		fi
+
+		if [[ ${negate} == 1 ]]; then
+			linux_chkconfig_present ${config} && error=2
+		elif [[ ${reworkmodulenames} == 1 ]]; then
+			local temp_config="${config//*:}" i n
+			config="${config//:*}"
+			if linux_chkconfig_present ${config}; then
+				for i in ${MODULE_NAMES}; do
+					n="${i//${temp_config}}"
+					[[ -z ${n//\(*} ]] && \
+						MODULE_IGNORE="${MODULE_IGNORE} ${temp_config}"
+				done
+				error=2
+			fi
+		else
+			linux_chkconfig_present ${config} || error=1
+		fi
+
+		if [[ ${error} > 0 ]]; then
+			local report_func="eerror" local_error
+			local_error="ERROR_${config}"
+			local_error="${!local_error}"
+
+			if [[ -z "${local_error}" ]]; then
+				# using old, deprecated format.
+				local_error="${config}_ERROR"
+				local_error="${!local_error}"
+			fi
+			if [[ ${die} == 0 && -z "${local_error}" ]]; then
+				#soft errors can be warnings
+				local_error="WARNING_${config}"
+				local_error="${!local_error}"
+				if [[ -n "${local_error}" ]] ; then
+					report_func="ewarn"
+				fi
+			fi
+
+			if [[ -z "${local_error}" ]]; then
+				[[ ${error} == 1 ]] \
+					&& local_error="is not set when it should be." \
+					|| local_error="should not be set. But it is."
+				local_error="CONFIG_${config}:\t ${local_error}"
+			fi
+			if [[ ${die} == 0 ]]; then
+				${report_func} "  ${local_error}"
+				soft_errors_count=$[soft_errors_count + 1]
+			else
+				${report_func} "  ${local_error}"
+				hard_errors_count=$[hard_errors_count + 1]
+			fi
+		fi
+	done
+
+	if [[ ${hard_errors_count} > 0 ]]; then
+		eerror "Please check to make sure these options are set correctly."
+		eerror "Failure to do so may cause unexpected problems."
+		eerror "Once you have satisfied these options, please try merging"
+		eerror "this package again."
+		export LINUX_CONFIG_EXISTS_DONE="${old_LINUX_CONFIG_EXISTS_DONE}"
+		die "Incorrect kernel configuration options"
+	elif [[ ${soft_errors_count} > 0 ]]; then
+		ewarn "Please check to make sure these options are set correctly."
+		ewarn "Failure to do so may cause unexpected problems."
+	else
+		eend 0
+	fi
+	export LINUX_CONFIG_EXISTS_DONE="${old_LINUX_CONFIG_EXISTS_DONE}"
+}
+
+check_zlibinflate() {
+	if ! use kernel_linux; then
+		die "${FUNCNAME}() called on non-Linux system, please fix the ebuild"
+	fi
+
+	# if we haven't determined the version yet, we need to
+	require_configured_kernel
+
+	# although I restructured this code - I really really really dont support it!
+
+	# bug #27882 - zlib routines are only linked into the kernel
+	# if something compiled into the kernel calls them
+	#
+	# plus, for the cloop module, it appears that there's no way
+	# to get cloop.o to include a static zlib if CONFIG_MODVERSIONS
+	# is on
+
+	local INFLATE
+	local DEFLATE
+
+	einfo "Determining the usability of ZLIB_INFLATE support in your kernel"
+
+	ebegin "checking ZLIB_INFLATE"
+	linux_chkconfig_builtin CONFIG_ZLIB_INFLATE
+	eend $? || die
+
+	ebegin "checking ZLIB_DEFLATE"
+	linux_chkconfig_builtin CONFIG_ZLIB_DEFLATE
+	eend $? || die
+
+	local LINENO_START
+	local LINENO_END
+	local SYMBOLS
+	local x
+
+	LINENO_END="$(grep -n 'CONFIG_ZLIB_INFLATE y' ${KV_DIR}/lib/Config.in | cut -d : -f 1)"
+	LINENO_START="$(head -n $LINENO_END ${KV_DIR}/lib/Config.in | grep -n 'if \[' | tail -n 1 | cut -d : -f 1)"
+	(( LINENO_AMOUNT = $LINENO_END - $LINENO_START ))
+	(( LINENO_END = $LINENO_END - 1 ))
+	SYMBOLS="$(head -n $LINENO_END ${KV_DIR}/lib/Config.in | tail -n $LINENO_AMOUNT | sed -e 's/^.*\(CONFIG_[^\" ]*\).*/\1/g;')"
+
+	# okay, now we have a list of symbols
+	# we need to check each one in turn, to see whether it is set or not
+	for x in $SYMBOLS ; do
+		if [ "${!x}" = "y" ]; then
+			# we have a winner!
+			einfo "${x} ensures zlib is linked into your kernel - excellent"
+			return 0
+		fi
+	done
+
+	eerror
+	eerror "This kernel module requires ZLIB library support."
+	eerror "You have enabled zlib support in your kernel, but haven't enabled"
+	eerror "enabled any option that will ensure that zlib is linked into your"
+	eerror "kernel."
+	eerror
+	eerror "Please ensure that you enable at least one of these options:"
+	eerror
+
+	for x in $SYMBOLS ; do
+		eerror "  * $x"
+	done
+
+	eerror
+	eerror "Please remember to recompile and install your kernel, and reboot"
+	eerror "into your new kernel before attempting to load this kernel module."
+
+	die "Kernel doesn't include zlib support"
+}
+
+################################
+# Default pkg_setup
+# Also used when inheriting linux-mod to force a get_version call
+# @FUNCTION: linux-info_pkg_setup
+# @DESCRIPTION:
+# Force a get_version() call when inherited from linux-mod.eclass and then check if the kernel is configured
+# to support the options specified in CONFIG_CHECK (if not null)
+linux-info_pkg_setup() {
+	use kernel_linux || return
+
+	linux-info_get_any_version
+
+	if kernel_is 2 4; then
+		if [ "$( gcc-major-version )" -eq "4" ] ; then
+			echo
+			ewarn "Be warned !! >=sys-devel/gcc-4.0.0 isn't supported with"
+			ewarn "linux-2.4 (or modules building against a linux-2.4 kernel)!"
+			echo
+			ewarn "Either switch to another gcc-version (via gcc-config) or use a"
+			ewarn "newer kernel that supports gcc-4."
+			echo
+			ewarn "Also be aware that bugreports about gcc-4 not working"
+			ewarn "with linux-2.4 based ebuilds will be closed as INVALID!"
+			echo
+		fi
+	fi
+
+	[ -n "${CONFIG_CHECK}" ] && check_extra_config;
+}

diff --git a/eclass/linux-mod.eclass b/eclass/linux-mod.eclass
new file mode 100644
index 0000000..920790b
--- /dev/null
+++ b/eclass/linux-mod.eclass
@@ -0,0 +1,758 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+# @ECLASS: linux-mod.eclass
+# @MAINTAINER:
+# kernel@gentoo.org
+# @AUTHOR:
+# John Mylchreest <johnm@gentoo.org>,
+# Stefan Schweizer <genstef@gentoo.org>
+# @BLURB: It provides the functionality required to install external modules against a kernel source tree.
+# @DESCRIPTION:
+# This eclass is used to interface with linux-info.eclass in such a way
+# to provide the functionality and initial functions
+# required to install external modules against a kernel source
+# tree.
+
+# A Couple of env vars are available to effect usage of this eclass
+# These are as follows:
+
+# @ECLASS-VARIABLE: MODULES_OPTIONAL_USE
+# @DESCRIPTION:
+# A string containing the USE flag to use for making this eclass optional
+# The recommended non-empty value is 'modules'
+
+# @ECLASS-VARIABLE: MODULES_OPTIONAL_USE_IUSE_DEFAULT
+# @DESCRIPTION:
+# A boolean to control the IUSE default state for the MODULES_OPTIONAL_USE USE
+# flag. Default value is unset (false). True represented by 1 or 'on', other
+# values including unset treated as false.
+
+# @ECLASS-VARIABLE: KERNEL_DIR
+# @DESCRIPTION:
+# A string containing the directory of the target kernel sources. The default value is
+# "/usr/src/linux"
+
+# @ECLASS-VARIABLE: ECONF_PARAMS
+# @DESCRIPTION:
+# It's a string containing the parameters to pass to econf.
+# If this is not set, then econf isn't run.
+
+# @ECLASS-VARIABLE: BUILD_PARAMS
+# @DESCRIPTION:
+# It's a string with the parameters to pass to emake.
+
+# @ECLASS-VARIABLE: BUILD_TARGETS
+# @DESCRIPTION:
+# It's a string with the build targets to pass to make. The default value is "clean module"
+
+# @ECLASS-VARIABLE: MODULE_NAMES
+# @DESCRIPTION:
+# It's a string containing the modules to be built automatically using the default
+# src_compile/src_install. It will only make ${BUILD_TARGETS} once in any directory.
+#
+# The structure of each MODULE_NAMES entry is as follows:
+#
+#   modulename(libdir:srcdir:objdir)
+#
+# where:
+#
+#   modulename = name of the module file excluding the .ko
+#   libdir     = place in system modules directory where module is installed (by default it's misc)
+#   srcdir     = place for ebuild to cd to before running make (by default it's ${S})
+#   objdir     = place the .ko and objects are located after make runs (by default it's set to srcdir)
+#
+# To get an idea of how these variables are used, here's a few lines
+# of code from around line 540 in this eclass:
+#
+#	einfo "Installing ${modulename} module"
+#	cd ${objdir} || die "${objdir} does not exist"
+#	insinto /lib/modules/${KV_FULL}/${libdir}
+#	doins ${modulename}.${KV_OBJ} || die "doins ${modulename}.${KV_OBJ} failed"
+#
+# For example:
+#   MODULE_NAMES="module_pci(pci:${S}/pci:${S}) module_usb(usb:${S}/usb:${S})"
+#
+# what this would do is
+#
+#   cd "${S}"/pci
+#   make ${BUILD_PARAMS} ${BUILD_TARGETS}
+#   cd "${S}"
+#   insinto /lib/modules/${KV_FULL}/pci
+#   doins module_pci.${KV_OBJ}
+#
+#   cd "${S}"/usb
+#   make ${BUILD_PARAMS} ${BUILD_TARGETS}
+#   cd "${S}"
+#   insinto /lib/modules/${KV_FULL}/usb
+#   doins module_usb.${KV_OBJ}
+
+# There is also support for automated modprobe.d file generation.
+# This can be explicitly enabled by setting any of the following variables.
+
+# @ECLASS-VARIABLE: MODULESD_<modulename>_ENABLED
+# @DESCRIPTION:
+# This is used to disable the modprobe.d file generation otherwise the file will be
+# always generated (unless no MODULESD_<modulename>_* variable is provided). Set to "no" to disable
+# the generation of the file and the installation of the documentation.
+
+# @ECLASS-VARIABLE: MODULESD_<modulename>_EXAMPLES
+# @DESCRIPTION:
+# This is a bash array containing a list of examples which should
+# be used. If you want us to try and take a guess set this to "guess".
+#
+# For each array_component it's added an options line in the modprobe.d file
+#
+#   options array_component
+#
+# where array_component is "<modulename> options" (see modprobe.conf(5))
+
+# @ECLASS-VARIABLE: MODULESD_<modulename>_ALIASES
+# @DESCRIPTION:
+# This is a bash array containing a list of associated aliases.
+#
+# For each array_component it's added an alias line in the modprobe.d file
+#
+#   alias array_component
+#
+# where array_component is "wildcard <modulename>" (see modprobe.conf(5))
+
+# @ECLASS-VARIABLE: MODULESD_<modulename>_ADDITIONS
+# @DESCRIPTION:
+# This is a bash array containing a list of additional things to
+# add to the bottom of the file. This can be absolutely anything.
+# Each entry is a new line.
+
+# @ECLASS-VARIABLE: MODULESD_<modulename>_DOCS
+# @DESCRIPTION:
+# This is a string list which contains the full path to any associated
+# documents for <modulename>. These files are installed in the live tree.
+
+# @ECLASS-VARIABLE: KV_OBJ
+# @DESCRIPTION:
+# It's a read-only variable. It contains the extension of the kernel modules.
+
+inherit eutils linux-info multilib
+EXPORT_FUNCTIONS pkg_setup pkg_preinst pkg_postinst src_install src_compile pkg_postrm
+
+case ${MODULES_OPTIONAL_USE_IUSE_DEFAULT:-n} in
+  [nNfF]*|[oO][fF]*|0|-) _modules_optional_use_iuse_default='' ;;
+  *) _modules_optional_use_iuse_default='+' ;;
+esac
+
+[[ -n "${_modules_optional_use_iuse_default}" ]] && case ${EAPI:-0} in
+	0) die "EAPI=${EAPI} is not supported with MODULES_OPTIONAL_USE_IUSE_DEFAULT due to lack of IUSE defaults" ;;
+esac
+
+IUSE="kernel_linux ${MODULES_OPTIONAL_USE:+${_modules_optional_use_iuse_default}}${MODULES_OPTIONAL_USE}"
+SLOT="0"
+RDEPEND="${MODULES_OPTIONAL_USE}${MODULES_OPTIONAL_USE:+? (} kernel_linux? ( virtual/modutils ) ${MODULES_OPTIONAL_USE:+)}"
+DEPEND="${RDEPEND}
+    ${MODULES_OPTIONAL_USE}${MODULES_OPTIONAL_USE:+? (}
+	sys-apps/sed
+	kernel_linux? ( virtual/linux-sources virtual/libelf )
+	${MODULES_OPTIONAL_USE:+)}"
+
+# eclass utilities
+# ----------------------------------
+
+check_vermagic() {
+	debug-print-function ${FUNCNAME} $*
+
+	local curr_gcc_ver=$(gcc -dumpversion)
+	local tmpfile old_chost old_gcc_ver result=0
+	[ -n "${MODULES_OPTIONAL_USE}" ] && use !${MODULES_OPTIONAL_USE} && return
+
+	tmpfile=`find "${KV_DIR}/" -iname "*.o.cmd" -exec grep usr/lib/gcc {} \; -quit`
+	tmpfile=${tmpfile//*usr/lib}
+	tmpfile=${tmpfile//\/include*}
+	old_chost=${tmpfile//*gcc\/}
+	old_chost=${old_chost//\/*}
+	old_gcc_ver=${tmpfile//*\/}
+
+	if [[ -z ${old_gcc_ver} || -z ${old_chost} ]]; then
+		ewarn ""
+		ewarn "Unable to detect what version of GCC was used to compile"
+		ewarn "the kernel. Build will continue, but you may experience problems."
+	elif [[ ${curr_gcc_ver} != ${old_gcc_ver} ]]; then
+		ewarn ""
+		ewarn "The version of GCC you are using (${curr_gcc_ver}) does"
+		ewarn "not match the version of GCC used to compile the"
+		ewarn "kernel (${old_gcc_ver})."
+		result=1
+	elif [[ ${CHOST} != ${old_chost} ]]; then
+		ewarn ""
+		ewarn "The current CHOST (${CHOST}) does not match the chost"
+		ewarn "used when compiling the kernel (${old_chost})."
+		result=1
+	fi
+
+	if [[ ${result} -gt 0 ]]; then
+		ewarn ""
+		ewarn "Build will not continue, because you will experience problems."
+		ewarn "To fix this either change the version of GCC you wish to use"
+		ewarn "to match the kernel, or recompile the kernel first."
+		die "GCC Version Mismatch."
+	fi
+}
+
+# @FUNCTION: use_m
+# @RETURN: true or false
+# @DESCRIPTION:
+# It checks if the kernel version is greater than 2.6.5.
+use_m() {
+	debug-print-function ${FUNCNAME} $*
+
+	# if we haven't determined the version yet, we need too.
+	get_version;
+
+	# if the kernel version is greater than 2.6.6 then we should use
+	# M= instead of SUBDIRS=
+	[ ${KV_MAJOR} -eq 3 ] && return 0
+	[ ${KV_MAJOR} -eq 2 -a ${KV_MINOR} -gt 5 -a ${KV_PATCH} -gt 5 ] && \
+		return 0 || return 1
+}
+
+# @FUNCTION: convert_to_m
+# @USAGE: /path/to/the/file
+# @DESCRIPTION:
+# It converts a file (e.g. a makefile) to use M= instead of SUBDIRS=
+convert_to_m() {
+	debug-print-function ${FUNCNAME} $*
+
+	if use_m
+	then
+		[ ! -f "${1}" ] && \
+			die "convert_to_m() requires a filename as an argument"
+		ebegin "Converting ${1/${WORKDIR}\//} to use M= instead of SUBDIRS="
+		sed -i 's:SUBDIRS=:M=:g' "${1}"
+		eend $?
+	fi
+}
+
+# internal function
+#
+# FUNCTION: update_depmod
+# DESCRIPTION:
+# It updates the modules.dep file for the current kernel.
+update_depmod() {
+	debug-print-function ${FUNCNAME} $*
+
+	# if we haven't determined the version yet, we need too.
+	get_version;
+
+	ebegin "Updating module dependencies for ${KV_FULL}"
+	if [ -r "${KV_OUT_DIR}"/System.map ]
+	then
+		depmod -ae -F "${KV_OUT_DIR}"/System.map -b "${ROOT:-/}" ${KV_FULL}
+		eend $?
+	else
+		ewarn
+		ewarn "${KV_OUT_DIR}/System.map not found."
+		ewarn "You must manually update the kernel module dependencies using depmod."
+		eend 1
+		ewarn
+	fi
+}
+
+# internal function
+#
+# FUNCTION: move_old_moduledb
+# DESCRIPTION:
+# It updates the location of the database used by the module-rebuild utility.
+move_old_moduledb() {
+	debug-print-function ${FUNCNAME} $*
+
+	local OLDDIR="${ROOT%/}"/usr/share/module-rebuild
+	local NEWDIR="${ROOT%/}"/var/lib/module-rebuild
+
+	if [[ -f "${OLDDIR}"/moduledb ]]; then
+		[[ ! -d "${NEWDIR}" ]] && mkdir -p "${NEWDIR}"
+		[[ ! -f "${NEWDIR}"/moduledb ]] && \
+			mv "${OLDDIR}"/moduledb "${NEWDIR}"/moduledb
+		rm -f "${OLDDIR}"/*
+		rmdir "${OLDDIR}"
+	fi
+}
+
+# internal function
+#
+# FUNCTION: update_moduledb
+# DESCRIPTION:
+# It adds the package to the /var/lib/module-rebuild/moduledb database used by the module-rebuild utility.
+update_moduledb() {
+	debug-print-function ${FUNCNAME} $*
+
+	local MODULEDB_DIR="${ROOT%/}"/var/lib/module-rebuild
+	move_old_moduledb
+
+	if [[ ! -f "${MODULEDB_DIR}"/moduledb ]]; then
+		[[ ! -d "${MODULEDB_DIR}" ]] && mkdir -p "${MODULEDB_DIR}"
+		touch "${MODULEDB_DIR}"/moduledb
+	fi
+
+	if ! grep -qs ${CATEGORY}/${PN}-${PVR} "${MODULEDB_DIR}"/moduledb ; then
+		einfo "Adding module to moduledb."
+		echo "a:1:${CATEGORY}/${PN}-${PVR}" >> "${MODULEDB_DIR}"/moduledb
+	fi
+}
+
+# internal function
+#
+# FUNCTION: remove_moduledb
+# DESCRIPTION:
+# It removes the package from the /var/lib/module-rebuild/moduledb database used by
+# the module-rebuild utility.
+remove_moduledb() {
+	debug-print-function ${FUNCNAME} $*
+
+	local MODULEDB_DIR="${ROOT%/}"/var/lib/module-rebuild
+	move_old_moduledb
+
+	if grep -qs ${CATEGORY}/${PN}-${PVR} "${MODULEDB_DIR}"/moduledb ; then
+		einfo "Removing ${CATEGORY}/${PN}-${PVR} from moduledb."
+		sed -i -e "/.*${CATEGORY}\/${PN}-${PVR}.*/d" "${MODULEDB_DIR}"/moduledb
+	fi
+}
+
+# @FUNCTION: set_kvobj
+# @DESCRIPTION:
+# It sets the KV_OBJ variable.
+set_kvobj() {
+	debug-print-function ${FUNCNAME} $*
+
+	if kernel_is ge 2 6
+	then
+		KV_OBJ="ko"
+	else
+		KV_OBJ="o"
+	fi
+	# Do we really need to know this?
+	# Lets silence it.
+	# einfo "Using KV_OBJ=${KV_OBJ}"
+}
+
+get-KERNEL_CC() {
+	debug-print-function ${FUNCNAME} $*
+
+	if [[ -n ${KERNEL_CC} ]] ; then
+		echo "${KERNEL_CC}"
+		return
+	fi
+
+	local kernel_cc
+	if [ -n "${KERNEL_ABI}" ]; then
+		# In future, an arch might want to define CC_$ABI
+		#kernel_cc="$(get_abi_CC)"
+		#[ -z "${kernel_cc}" ] &&
+		kernel_cc="$(tc-getCC $(ABI=${KERNEL_ABI} get_abi_CHOST))"
+	else
+		kernel_cc=$(tc-getCC)
+	fi
+	echo "${kernel_cc}"
+}
+
+# internal function
+#
+# FUNCTION:
+# USAGE: /path/to/the/modulename_without_extension
+# RETURN: A file in /etc/modprobe.d
+# DESCRIPTION:
+# This function will generate and install the neccessary modprobe.d file from the
+# information contained in the modules exported parms.
+# (see the variables MODULESD_<modulename>_ENABLED, MODULESD_<modulename>_EXAMPLES,
+# MODULESD_<modulename>_ALIASES, MODULESD_<modulename>_ADDITION and MODULESD_<modulename>_DOCS).
+#
+# At the end the documentation specified with MODULESD_<modulename>_DOCS is installed.
+generate_modulesd() {
+	debug-print-function ${FUNCNAME} $*
+	[ -n "${MODULES_OPTIONAL_USE}" ] && use !${MODULES_OPTIONAL_USE} && return
+
+	local 	currm_path currm currm_t t myIFS myVAR
+	local 	module_docs module_enabled module_aliases \
+			module_additions module_examples module_modinfo module_opts
+
+	for currm_path in ${@}
+	do
+		currm=${currm_path//*\/}
+		currm=$(echo ${currm} | tr '[:lower:]' '[:upper:]')
+		currm_t=${currm}
+		while [[ -z ${currm_t//*-*} ]]; do
+			currm_t=${currm_t/-/_}
+		done
+
+		module_docs="$(eval echo \${MODULESD_${currm_t}_DOCS})"
+		module_enabled="$(eval echo \${MODULESD_${currm_t}_ENABLED})"
+		module_aliases="$(eval echo \${#MODULESD_${currm_t}_ALIASES[*]})"
+		module_additions="$(eval echo \${#MODULESD_${currm_t}_ADDITIONS[*]})"
+		module_examples="$(eval echo \${#MODULESD_${currm_t}_EXAMPLES[*]})"
+
+		[[ ${module_aliases} -eq 0 ]] 	&& unset module_aliases
+		[[ ${module_additions} -eq 0 ]]	&& unset module_additions
+		[[ ${module_examples} -eq 0 ]] 	&& unset module_examples
+
+		# If we specify we dont want it, then lets exit, otherwise we assume
+		# that if its set, we do want it.
+		[[ ${module_enabled} == no ]] && return 0
+
+		# unset any unwanted variables.
+		for t in ${!module_*}
+		do
+			[[ -z ${!t} ]] && unset ${t}
+		done
+
+		[[ -z ${!module_*} ]] && return 0
+
+		# OK so now if we have got this far, then we know we want to continue
+		# and generate the modprobe.d file.
+		module_modinfo="$(modinfo -p ${currm_path}.${KV_OBJ})"
+		module_config="${T}/modulesd-${currm}"
+
+		ebegin "Preparing file for modprobe.d"
+		#-----------------------------------------------------------------------
+		echo "# modprobe.d configuration file for ${currm}" >> "${module_config}"
+		#-----------------------------------------------------------------------
+		[[ -n ${module_docs} ]] && \
+			echo "# For more information please read:" >> "${module_config}"
+		for t in ${module_docs}
+		do
+			echo "#    ${t//*\/}" >> "${module_config}"
+		done
+		echo >> "${module_config}"
+
+		#-----------------------------------------------------------------------
+		if [[ ${module_aliases} -gt 0 ]]
+		then
+			echo  "# Internal Aliases - Do not edit" >> "${module_config}"
+			echo  "# ------------------------------" >> "${module_config}"
+
+			for((t=0; t<${module_aliases}; t++))
+			do
+				echo "alias $(eval echo \${MODULESD_${currm}_ALIASES[$t]})" \
+					>> "${module_config}"
+			done
+			echo '' >> "${module_config}"
+		fi
+
+		#-----------------------------------------------------------------------
+		if [[ -n ${module_modinfo} ]]
+		then
+			echo >> "${module_config}"
+			echo  "# Configurable module parameters" >> "${module_config}"
+			echo  "# ------------------------------" >> "${module_config}"
+			myIFS="${IFS}"
+			IFS="$(echo -en "\n\b")"
+
+			for t in ${module_modinfo}
+			do
+				myVAR="$(echo ${t#*:}  | grep -o "[^ ]*[0-9][ =][^ ]*" | tail -1  | grep -o "[0-9]")"
+				if [[ -n ${myVAR} ]]
+				then
+					module_opts="${module_opts} ${t%%:*}:${myVAR}"
+				fi
+				echo -e "# ${t%%:*}:\t${t#*:}" >> "${module_config}"
+			done
+			IFS="${myIFS}"
+			echo '' >> "${module_config}"
+		fi
+
+		#-----------------------------------------------------------------------
+		if [[ $(eval echo \${MODULESD_${currm}_ALIASES[0]}) == guess ]]
+		then
+			# So lets do some guesswork eh?
+			if [[ -n ${module_opts} ]]
+			then
+				echo "# For Example..." >> "${module_config}"
+				echo "# --------------" >> "${module_config}"
+				for t in ${module_opts}
+				do
+					echo "# options ${currm} ${t//:*}=${t//*:}" >> "${module_config}"
+				done
+				echo '' >> "${module_config}"
+			fi
+		elif [[ ${module_examples} -gt 0 ]]
+		then
+			echo "# For Example..." >> "${module_config}"
+			echo "# --------------" >> "${module_config}"
+			for((t=0; t<${module_examples}; t++))
+			do
+				echo "options $(eval echo \${MODULESD_${currm}_EXAMPLES[$t]})" \
+					>> "${module_config}"
+			done
+			echo '' >> "${module_config}"
+		fi
+
+		#-----------------------------------------------------------------------
+		if [[ ${module_additions} -gt 0 ]]
+		then
+			for((t=0; t<${module_additions}; t++))
+			do
+				echo "$(eval echo \${MODULESD_${currm}_ADDITIONS[$t]})" \
+					>> "${module_config}"
+			done
+			echo '' >> "${module_config}"
+		fi
+
+		#-----------------------------------------------------------------------
+
+		# then we install it
+		insinto /etc/modprobe.d
+		newins "${module_config}" "${currm_path//*\/}.conf"
+
+		# and install any documentation we might have.
+		[[ -n ${module_docs} ]] && dodoc ${module_docs}
+	done
+	eend 0
+	return 0
+}
+
+# internal function
+#
+# FUNCTION: find_module_params
+# USAGE: A string "NAME(LIBDIR:SRCDIR:OBJDIR)"
+# RETURN: The string "modulename:NAME libdir:LIBDIR srcdir:SRCDIR objdir:OBJDIR"
+# DESCRIPTION:
+# Analyze the specification NAME(LIBDIR:SRCDIR:OBJDIR) of one module as described in MODULE_NAMES.
+find_module_params() {
+	debug-print-function ${FUNCNAME} $*
+
+	local matched_offset=0 matched_opts=0 test="${@}" temp_var result
+	local i=0 y=0 z=0
+
+	for((i=0; i<=${#test}; i++))
+	do
+		case ${test:${i}:1} in
+			\()		matched_offset[0]=${i};;
+			\:)		matched_opts=$((${matched_opts} + 1));
+					matched_offset[${matched_opts}]="${i}";;
+			\))		matched_opts=$((${matched_opts} + 1));
+					matched_offset[${matched_opts}]="${i}";;
+		esac
+	done
+
+	for((i=0; i<=${matched_opts}; i++))
+	do
+		# i			= offset were working on
+		# y			= last offset
+		# z			= current offset - last offset
+		# temp_var	= temporary name
+		case ${i} in
+			0)	tempvar=${test:0:${matched_offset[0]}};;
+			*)	y=$((${matched_offset[$((${i} - 1))]} + 1))
+				z=$((${matched_offset[${i}]} - ${matched_offset[$((${i} - 1))]}));
+				z=$((${z} - 1))
+				tempvar=${test:${y}:${z}};;
+		esac
+
+		case ${i} in
+			0)	result="${result} modulename:${tempvar}";;
+			1)	result="${result} libdir:${tempvar}";;
+			2)	result="${result} srcdir:${tempvar}";;
+			3)	result="${result} objdir:${tempvar}";;
+		esac
+	done
+
+	echo ${result}
+}
+
+# default ebuild functions
+# --------------------------------
+
+# @FUNCTION: linux-mod_pkg_setup
+# @DESCRIPTION:
+# It checks the CONFIG_CHECK options (see linux-info.eclass(5)), verifies that the kernel is
+# configured, verifies that the sources are prepared, verifies that the modules support is builtin
+# in the kernel and sets the object extension KV_OBJ.
+linux-mod_pkg_setup() {
+	debug-print-function ${FUNCNAME} $*
+	[ -n "${MODULES_OPTIONAL_USE}" ] && use !${MODULES_OPTIONAL_USE} && return
+
+	local is_bin="${MERGE_TYPE}"
+
+	# If we are installing a binpkg, take a different path.
+	# use MERGE_TYPE if available (eapi>=4); else use non-PMS EMERGE_FROM (eapi<4)
+	if has ${EAPI} 0 1 2 3; then
+		is_bin=${EMERGE_FROM}
+	fi
+
+	if [[ ${is_bin} == binary ]]; then
+		linux-mod_pkg_setup_binary
+		return
+	fi
+
+	# External modules use kernel symbols (bug #591832)
+	CONFIG_CHECK+=" !TRIM_UNUSED_KSYMS"
+
+	linux-info_pkg_setup;
+	require_configured_kernel
+	check_kernel_built;
+	strip_modulenames;
+	[[ -n ${MODULE_NAMES} ]] && check_modules_supported
+	set_kvobj;
+	# Commented out with permission from johnm until a fixed version for arches
+	# who intentionally use different kernel and userland compilers can be
+	# introduced - Jason Wever <weeve@gentoo.org>, 23 Oct 2005
+	#check_vermagic;
+}
+
+# @FUNCTION: linux-mod_pkg_setup_binary
+# @DESCRIPTION:
+# Perform all kernel option checks non-fatally, as the .config and
+# /proc/config.gz might not be present. Do not do anything that requires kernel
+# sources.
+linux-mod_pkg_setup_binary() {
+	debug-print-function ${FUNCNAME} $*
+	local new_CONFIG_CHECK
+	# ~ needs always to be quoted, else bash expands it.
+	for config in $CONFIG_CHECK ; do
+		optional='~'
+		[[ ${config:0:1} == "~" ]] && optional=''
+		new_CONFIG_CHECK="${new_CONFIG_CHECK} ${optional}${config}"
+	done
+	CONFIG_CHECK="${new_CONFIG_CHECK}"
+	linux-info_pkg_setup;
+}
+
+strip_modulenames() {
+	debug-print-function ${FUNCNAME} $*
+
+	local i
+	for i in ${MODULE_IGNORE}; do
+		MODULE_NAMES=${MODULE_NAMES//${i}(*}
+	done
+}
+
+# @FUNCTION: linux-mod_src_compile
+# @DESCRIPTION:
+# It compiles all the modules specified in MODULE_NAMES. For each module the econf command is
+# executed only if ECONF_PARAMS is defined, the name of the target is specified by BUILD_TARGETS
+# while the options are in BUILD_PARAMS (all the modules share these variables). The compilation
+# happens inside ${srcdir}.
+#
+# Look at the description of these variables for more details.
+linux-mod_src_compile() {
+	debug-print-function ${FUNCNAME} $*
+	[ -n "${MODULES_OPTIONAL_USE}" ] && use !${MODULES_OPTIONAL_USE} && return
+
+	local modulename libdir srcdir objdir i n myABI="${ABI}"
+	set_arch_to_kernel
+	ABI="${KERNEL_ABI}"
+
+	BUILD_TARGETS=${BUILD_TARGETS:-clean module}
+	strip_modulenames;
+	cd "${S}"
+	touch Module.symvers
+	for i in ${MODULE_NAMES}
+	do
+		unset libdir srcdir objdir
+		for n in $(find_module_params ${i})
+		do
+			eval ${n/:*}=${n/*:/}
+		done
+		libdir=${libdir:-misc}
+		srcdir=${srcdir:-${S}}
+		objdir=${objdir:-${srcdir}}
+
+		if [ ! -f "${srcdir}/.built" ];
+		then
+			cd "${srcdir}"
+			ln -s "${S}"/Module.symvers Module.symvers
+			einfo "Preparing ${modulename} module"
+			if [[ -n ${ECONF_PARAMS} ]]
+			then
+				econf ${ECONF_PARAMS} || \
+				die "Unable to run econf ${ECONF_PARAMS}"
+			fi
+
+			# This looks messy, but it is needed to handle multiple variables
+			# being passed in the BUILD_* stuff where the variables also have
+			# spaces that must be preserved. If don't do this, then the stuff
+			# inside the variables gets used as targets for Make, which then
+			# fails.
+			eval "emake HOSTCC=\"$(tc-getBUILD_CC)\" \
+						CROSS_COMPILE=${CHOST}- \
+						LDFLAGS=\"$(get_abi_LDFLAGS)\" \
+						${BUILD_FIXES} \
+						${BUILD_PARAMS} \
+						${BUILD_TARGETS} " \
+				|| die "Unable to emake HOSTCC="$(tc-getBUILD_CC)" CROSS_COMPILE=${CHOST}- LDFLAGS="$(get_abi_LDFLAGS)" ${BUILD_FIXES} ${BUILD_PARAMS} ${BUILD_TARGETS}"
+			cd "${OLDPWD}"
+			touch "${srcdir}"/.built
+		fi
+	done
+
+	set_arch_to_portage
+	ABI="${myABI}"
+}
+
+# @FUNCTION: linux-mod_src_install
+# @DESCRIPTION:
+# It install the modules specified in MODULES_NAME. The modules should be inside the ${objdir}
+# directory and they are installed inside /lib/modules/${KV_FULL}/${libdir}.
+#
+# The modprobe.d configuration file is automatically generated if the
+# MODULESD_<modulename>_* variables are defined. The only way to stop this process is by
+# setting MODULESD_<modulename>_ENABLED=no. At the end the documentation specified via
+# MODULESD_<modulename>_DOCS is also installed.
+#
+# Look at the description of these variables for more details.
+linux-mod_src_install() {
+	debug-print-function ${FUNCNAME} $*
+	[ -n "${MODULES_OPTIONAL_USE}" ] && use !${MODULES_OPTIONAL_USE} && return
+
+	local modulename libdir srcdir objdir i n
+
+	strip_modulenames;
+	for i in ${MODULE_NAMES}
+	do
+		unset libdir srcdir objdir
+		for n in $(find_module_params ${i})
+		do
+			eval ${n/:*}=${n/*:/}
+		done
+		libdir=${libdir:-misc}
+		srcdir=${srcdir:-${S}}
+		objdir=${objdir:-${srcdir}}
+
+		einfo "Installing ${modulename} module"
+		cd "${objdir}" || die "${objdir} does not exist"
+		insinto /lib/modules/${KV_FULL}/${libdir}
+		doins ${modulename}.${KV_OBJ} || die "doins ${modulename}.${KV_OBJ} failed"
+		cd "${OLDPWD}"
+
+		generate_modulesd "${objdir}/${modulename}"
+	done
+}
+
+# @FUNCTION: linux-mod_pkg_preinst
+# @DESCRIPTION:
+# It checks what to do after having merged the package.
+linux-mod_pkg_preinst() {
+	debug-print-function ${FUNCNAME} $*
+	[ -n "${MODULES_OPTIONAL_USE}" ] && use !${MODULES_OPTIONAL_USE} && return
+
+	[ -d "${D%/}/lib/modules" ] && UPDATE_DEPMOD=true || UPDATE_DEPMOD=false
+	[ -d "${D%/}/lib/modules" ] && UPDATE_MODULEDB=true || UPDATE_MODULEDB=false
+}
+
+# @FUNCTION: linux-mod_pkg_postinst
+# @DESCRIPTION:
+# It executes /sbin/depmod and adds the package to the /var/lib/module-rebuild/moduledb
+# database (if ${D}/lib/modules is created)"
+linux-mod_pkg_postinst() {
+	debug-print-function ${FUNCNAME} $*
+	[ -n "${MODULES_OPTIONAL_USE}" ] && use !${MODULES_OPTIONAL_USE} && return
+
+	${UPDATE_DEPMOD} && update_depmod;
+	${UPDATE_MODULEDB} && update_moduledb;
+}
+
+# @FUNCTION: linux-mod_pkg_postrm
+# @DESCRIPTION:
+# It removes the package from the /var/lib/module-rebuild/moduledb database but it doens't
+# call /sbin/depmod because the modules are still installed.
+linux-mod_pkg_postrm() {
+	debug-print-function ${FUNCNAME} $*
+	[ -n "${MODULES_OPTIONAL_USE}" ] && use !${MODULES_OPTIONAL_USE} && return
+	remove_moduledb;
+}

diff --git a/sys-kernel/aufs-sources/aufs-sources-4.14.52.ebuild b/sys-kernel/aufs-sources/aufs-sources-4.14.52.ebuild
new file mode 100644
index 0000000..3f568b1
--- /dev/null
+++ b/sys-kernel/aufs-sources/aufs-sources-4.14.52.ebuild
@@ -0,0 +1,84 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+ETYPE="sources"
+K_WANT_GENPATCHES="base extras experimental"
+K_GENPATCHES_VER=57
+UNIPATCH_STRICTORDER=1
+inherit kernel-2 eutils readme.gentoo-r1
+
+AUFS_VERSION=4.14_p20180702
+AUFS_TARBALL="aufs-sources-${AUFS_VERSION}.tar.xz"
+# git archive -v --remote=git://git.code.sf.net/p/aufs/aufs4-standalone aufs${AUFS_VERSION/_p*} > aufs-sources-${AUFS_VERSION}.tar
+AUFS_URI="https://dev.gentoo.org/~jlec/distfiles/${AUFS_TARBALL}"
+
+KEYWORDS="~amd64 ~x86"
+HOMEPAGE="https://dev.gentoo.org/~mpagano/genpatches http://aufs.sourceforge.net/"
+IUSE="experimental module vanilla"
+
+DESCRIPTION="Full sources (incl. Gentoo patchset) for the linux kernel tree and aufs4 support"
+SRC_URI="
+	${KERNEL_URI}
+	${ARCH_URI}
+	${AUFS_URI}
+	!vanilla? ( ${GENPATCHES_URI} )
+	"
+
+PDEPEND="=sys-fs/aufs-util-4*"
+
+README_GENTOO_SUFFIX="-r1"
+
+src_unpack() {
+	detect_version
+	detect_arch
+	if use vanilla; then
+		unset UNIPATCH_LIST_GENPATCHES UNIPATCH_LIST_DEFAULT
+		ewarn "You are using USE=vanilla"
+		ewarn "This will drop all support from the gentoo kernel security team"
+	fi
+
+	UNIPATCH_LIST="
+		"${WORKDIR}"/aufs4-kbuild.patch
+		"${WORKDIR}"/aufs4-base.patch
+		"${WORKDIR}"/aufs4-mmap.patch"
+
+	use module && UNIPATCH_LIST+=" "${WORKDIR}"/aufs4-standalone.patch"
+
+	unpack ${AUFS_TARBALL}
+
+	einfo "Using aufs4 version: ${AUFS_VERSION}"
+
+	kernel-2_src_unpack
+}
+
+src_prepare() {
+	kernel-2_src_prepare
+	if ! use module; then
+		sed -e 's:tristate:bool:g' -i "${WORKDIR}"/fs/aufs/Kconfig || die
+	fi
+	cp -f "${WORKDIR}"/include/uapi/linux/aufs_type.h include/uapi/linux/aufs_type.h || die
+	cp -rf "${WORKDIR}"/{Documentation,fs} . || die
+}
+
+src_install() {
+	kernel-2_src_install
+	dodoc "${WORKDIR}"/{aufs4-loopback,vfs-ino,tmpfs-idr}.patch
+	docompress -x /usr/share/doc/${PF}/{aufs4-loopback,vfs-ino,tmpfs-idr}.patch
+	readme.gentoo_create_doc
+}
+
+pkg_postinst() {
+	kernel-2_pkg_postinst
+	einfo "For more info on this patchset, and how to report problems, see:"
+	einfo "${HOMEPAGE}"
+	has_version sys-fs/aufs-util || \
+		elog "In order to use aufs FS you need to install sys-fs/aufs-util"
+
+	readme.gentoo_print_elog
+}
+
+pkg_postrm() {
+	kernel-2_pkg_postrm
+}

diff --git a/sys-kernel/aufs-sources/aufs-sources-4.14.65.ebuild b/sys-kernel/aufs-sources/aufs-sources-4.14.65.ebuild
new file mode 100644
index 0000000..07e3a54
--- /dev/null
+++ b/sys-kernel/aufs-sources/aufs-sources-4.14.65.ebuild
@@ -0,0 +1,84 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+ETYPE="sources"
+K_WANT_GENPATCHES="base extras experimental"
+K_GENPATCHES_VER=71
+UNIPATCH_STRICTORDER=1
+inherit kernel-2 eutils readme.gentoo-r1
+
+AUFS_VERSION=4.14.56+_p20181008
+AUFS_TARBALL="aufs-sources-${AUFS_VERSION}.tar.xz"
+# git archive -v --remote=git://git.code.sf.net/p/aufs/aufs4-standalone aufs${AUFS_VERSION/_p*} > aufs-sources-${AUFS_VERSION}.tar
+AUFS_URI="https://dev.gentoo.org/~jlec/distfiles/${AUFS_TARBALL}"
+
+KEYWORDS="~amd64 ~x86"
+HOMEPAGE="https://dev.gentoo.org/~mpagano/genpatches http://aufs.sourceforge.net/"
+IUSE="experimental module vanilla"
+
+DESCRIPTION="Full sources (incl. Gentoo patchset) for the linux kernel tree and aufs4 support"
+SRC_URI="
+	${KERNEL_URI}
+	${ARCH_URI}
+	${AUFS_URI}
+	!vanilla? ( ${GENPATCHES_URI} )
+	"
+
+PDEPEND="=sys-fs/aufs-util-4*"
+
+README_GENTOO_SUFFIX="-r1"
+
+src_unpack() {
+	detect_version
+	detect_arch
+	if use vanilla; then
+		unset UNIPATCH_LIST_GENPATCHES UNIPATCH_LIST_DEFAULT
+		ewarn "You are using USE=vanilla"
+		ewarn "This will drop all support from the gentoo kernel security team"
+	fi
+
+	UNIPATCH_LIST="
+		"${WORKDIR}"/aufs4-kbuild.patch
+		"${WORKDIR}"/aufs4-base.patch
+		"${WORKDIR}"/aufs4-mmap.patch"
+
+	use module && UNIPATCH_LIST+=" "${WORKDIR}"/aufs4-standalone.patch"
+
+	unpack ${AUFS_TARBALL}
+
+	einfo "Using aufs4 version: ${AUFS_VERSION}"
+
+	kernel-2_src_unpack
+}
+
+src_prepare() {
+	kernel-2_src_prepare
+	if ! use module; then
+		sed -e 's:tristate:bool:g' -i "${WORKDIR}"/fs/aufs/Kconfig || die
+	fi
+	cp -f "${WORKDIR}"/include/uapi/linux/aufs_type.h include/uapi/linux/aufs_type.h || die
+	cp -rf "${WORKDIR}"/{Documentation,fs} . || die
+}
+
+src_install() {
+	kernel-2_src_install
+	dodoc "${WORKDIR}"/{aufs4-loopback,vfs-ino,tmpfs-idr}.patch
+	docompress -x /usr/share/doc/${PF}/{aufs4-loopback,vfs-ino,tmpfs-idr}.patch
+	readme.gentoo_create_doc
+}
+
+pkg_postinst() {
+	kernel-2_pkg_postinst
+	einfo "For more info on this patchset, and how to report problems, see:"
+	einfo "${HOMEPAGE}"
+	has_version sys-fs/aufs-util || \
+		elog "In order to use aufs FS you need to install sys-fs/aufs-util"
+
+	readme.gentoo_print_elog
+}
+
+pkg_postrm() {
+	kernel-2_pkg_postrm
+}

diff --git a/sys-kernel/aufs-sources/aufs-sources-4.14.71.ebuild b/sys-kernel/aufs-sources/aufs-sources-4.14.71.ebuild
new file mode 100644
index 0000000..c8d291f
--- /dev/null
+++ b/sys-kernel/aufs-sources/aufs-sources-4.14.71.ebuild
@@ -0,0 +1,84 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+ETYPE="sources"
+K_WANT_GENPATCHES="base extras experimental"
+K_GENPATCHES_VER=77
+UNIPATCH_STRICTORDER=1
+inherit kernel-2 eutils readme.gentoo-r1
+
+AUFS_VERSION=4.14.56+_p20181008
+AUFS_TARBALL="aufs-sources-${AUFS_VERSION}.tar.xz"
+# git archive -v --remote=git://git.code.sf.net/p/aufs/aufs4-standalone aufs${AUFS_VERSION/_p*} > aufs-sources-${AUFS_VERSION}.tar
+AUFS_URI="https://dev.gentoo.org/~jlec/distfiles/${AUFS_TARBALL}"
+
+KEYWORDS="~amd64 ~x86"
+HOMEPAGE="https://dev.gentoo.org/~mpagano/genpatches http://aufs.sourceforge.net/"
+IUSE="experimental module vanilla"
+
+DESCRIPTION="Full sources (incl. Gentoo patchset) for the linux kernel tree and aufs4 support"
+SRC_URI="
+	${KERNEL_URI}
+	${ARCH_URI}
+	${AUFS_URI}
+	!vanilla? ( ${GENPATCHES_URI} )
+	"
+
+PDEPEND="=sys-fs/aufs-util-4*"
+
+README_GENTOO_SUFFIX="-r1"
+
+src_unpack() {
+	detect_version
+	detect_arch
+	if use vanilla; then
+		unset UNIPATCH_LIST_GENPATCHES UNIPATCH_LIST_DEFAULT
+		ewarn "You are using USE=vanilla"
+		ewarn "This will drop all support from the gentoo kernel security team"
+	fi
+
+	UNIPATCH_LIST="
+		"${WORKDIR}"/aufs4-kbuild.patch
+		"${WORKDIR}"/aufs4-base.patch
+		"${WORKDIR}"/aufs4-mmap.patch"
+
+	use module && UNIPATCH_LIST+=" "${WORKDIR}"/aufs4-standalone.patch"
+
+	unpack ${AUFS_TARBALL}
+
+	einfo "Using aufs4 version: ${AUFS_VERSION}"
+
+	kernel-2_src_unpack
+}
+
+src_prepare() {
+	kernel-2_src_prepare
+	if ! use module; then
+		sed -e 's:tristate:bool:g' -i "${WORKDIR}"/fs/aufs/Kconfig || die
+	fi
+	cp -f "${WORKDIR}"/include/uapi/linux/aufs_type.h include/uapi/linux/aufs_type.h || die
+	cp -rf "${WORKDIR}"/{Documentation,fs} . || die
+}
+
+src_install() {
+	kernel-2_src_install
+	dodoc "${WORKDIR}"/{aufs4-loopback,vfs-ino,tmpfs-idr}.patch
+	docompress -x /usr/share/doc/${PF}/{aufs4-loopback,vfs-ino,tmpfs-idr}.patch
+	readme.gentoo_create_doc
+}
+
+pkg_postinst() {
+	kernel-2_pkg_postinst
+	einfo "For more info on this patchset, and how to report problems, see:"
+	einfo "${HOMEPAGE}"
+	has_version sys-fs/aufs-util || \
+		elog "In order to use aufs FS you need to install sys-fs/aufs-util"
+
+	readme.gentoo_print_elog
+}
+
+pkg_postrm() {
+	kernel-2_pkg_postrm
+}

diff --git a/sys-kernel/aufs-sources/aufs-sources-4.14.72.ebuild b/sys-kernel/aufs-sources/aufs-sources-4.14.72.ebuild
new file mode 100644
index 0000000..3d93e29
--- /dev/null
+++ b/sys-kernel/aufs-sources/aufs-sources-4.14.72.ebuild
@@ -0,0 +1,84 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+ETYPE="sources"
+K_WANT_GENPATCHES="base extras experimental"
+K_GENPATCHES_VER=78
+UNIPATCH_STRICTORDER=1
+inherit kernel-2 eutils readme.gentoo-r1
+
+AUFS_VERSION=4.14.56+_p20181008
+AUFS_TARBALL="aufs-sources-${AUFS_VERSION}.tar.xz"
+# git archive -v --remote=git://git.code.sf.net/p/aufs/aufs4-standalone aufs${AUFS_VERSION/_p*} > aufs-sources-${AUFS_VERSION}.tar
+AUFS_URI="https://dev.gentoo.org/~jlec/distfiles/${AUFS_TARBALL}"
+
+KEYWORDS="~amd64 ~x86"
+HOMEPAGE="https://dev.gentoo.org/~mpagano/genpatches http://aufs.sourceforge.net/"
+IUSE="experimental module vanilla"
+
+DESCRIPTION="Full sources (incl. Gentoo patchset) for the linux kernel tree and aufs4 support"
+SRC_URI="
+	${KERNEL_URI}
+	${ARCH_URI}
+	${AUFS_URI}
+	!vanilla? ( ${GENPATCHES_URI} )
+	"
+
+PDEPEND="=sys-fs/aufs-util-4*"
+
+README_GENTOO_SUFFIX="-r1"
+
+src_unpack() {
+	detect_version
+	detect_arch
+	if use vanilla; then
+		unset UNIPATCH_LIST_GENPATCHES UNIPATCH_LIST_DEFAULT
+		ewarn "You are using USE=vanilla"
+		ewarn "This will drop all support from the gentoo kernel security team"
+	fi
+
+	UNIPATCH_LIST="
+		"${WORKDIR}"/aufs4-kbuild.patch
+		"${WORKDIR}"/aufs4-base.patch
+		"${WORKDIR}"/aufs4-mmap.patch"
+
+	use module && UNIPATCH_LIST+=" "${WORKDIR}"/aufs4-standalone.patch"
+
+	unpack ${AUFS_TARBALL}
+
+	einfo "Using aufs4 version: ${AUFS_VERSION}"
+
+	kernel-2_src_unpack
+}
+
+src_prepare() {
+	kernel-2_src_prepare
+	if ! use module; then
+		sed -e 's:tristate:bool:g' -i "${WORKDIR}"/fs/aufs/Kconfig || die
+	fi
+	cp -f "${WORKDIR}"/include/uapi/linux/aufs_type.h include/uapi/linux/aufs_type.h || die
+	cp -rf "${WORKDIR}"/{Documentation,fs} . || die
+}
+
+src_install() {
+	kernel-2_src_install
+	dodoc "${WORKDIR}"/{aufs4-loopback,vfs-ino,tmpfs-idr}.patch
+	docompress -x /usr/share/doc/${PF}/{aufs4-loopback,vfs-ino,tmpfs-idr}.patch
+	readme.gentoo_create_doc
+}
+
+pkg_postinst() {
+	kernel-2_pkg_postinst
+	einfo "For more info on this patchset, and how to report problems, see:"
+	einfo "${HOMEPAGE}"
+	has_version sys-fs/aufs-util || \
+		elog "In order to use aufs FS you need to install sys-fs/aufs-util"
+
+	readme.gentoo_print_elog
+}
+
+pkg_postrm() {
+	kernel-2_pkg_postrm
+}

diff --git a/sys-kernel/aufs-sources/aufs-sources-4.14.73.ebuild b/sys-kernel/aufs-sources/aufs-sources-4.14.73.ebuild
new file mode 100644
index 0000000..4c2d64a
--- /dev/null
+++ b/sys-kernel/aufs-sources/aufs-sources-4.14.73.ebuild
@@ -0,0 +1,84 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+ETYPE="sources"
+K_WANT_GENPATCHES="base extras experimental"
+K_GENPATCHES_VER=79
+UNIPATCH_STRICTORDER=1
+inherit kernel-2 eutils readme.gentoo-r1
+
+AUFS_VERSION=4.14.56+_p20181008
+AUFS_TARBALL="aufs-sources-${AUFS_VERSION}.tar.xz"
+# git archive -v --remote=git://git.code.sf.net/p/aufs/aufs4-standalone aufs${AUFS_VERSION/_p*} > aufs-sources-${AUFS_VERSION}.tar
+AUFS_URI="https://dev.gentoo.org/~jlec/distfiles/${AUFS_TARBALL}"
+
+KEYWORDS="~amd64 ~x86"
+HOMEPAGE="https://dev.gentoo.org/~mpagano/genpatches http://aufs.sourceforge.net/"
+IUSE="experimental module vanilla"
+
+DESCRIPTION="Full sources (incl. Gentoo patchset) for the linux kernel tree and aufs4 support"
+SRC_URI="
+	${KERNEL_URI}
+	${ARCH_URI}
+	${AUFS_URI}
+	!vanilla? ( ${GENPATCHES_URI} )
+	"
+
+PDEPEND="=sys-fs/aufs-util-4*"
+
+README_GENTOO_SUFFIX="-r1"
+
+src_unpack() {
+	detect_version
+	detect_arch
+	if use vanilla; then
+		unset UNIPATCH_LIST_GENPATCHES UNIPATCH_LIST_DEFAULT
+		ewarn "You are using USE=vanilla"
+		ewarn "This will drop all support from the gentoo kernel security team"
+	fi
+
+	UNIPATCH_LIST="
+		"${WORKDIR}"/aufs4-kbuild.patch
+		"${WORKDIR}"/aufs4-base.patch
+		"${WORKDIR}"/aufs4-mmap.patch"
+
+	use module && UNIPATCH_LIST+=" "${WORKDIR}"/aufs4-standalone.patch"
+
+	unpack ${AUFS_TARBALL}
+
+	einfo "Using aufs4 version: ${AUFS_VERSION}"
+
+	kernel-2_src_unpack
+}
+
+src_prepare() {
+	kernel-2_src_prepare
+	if ! use module; then
+		sed -e 's:tristate:bool:g' -i "${WORKDIR}"/fs/aufs/Kconfig || die
+	fi
+	cp -f "${WORKDIR}"/include/uapi/linux/aufs_type.h include/uapi/linux/aufs_type.h || die
+	cp -rf "${WORKDIR}"/{Documentation,fs} . || die
+}
+
+src_install() {
+	kernel-2_src_install
+	dodoc "${WORKDIR}"/{aufs4-loopback,vfs-ino,tmpfs-idr}.patch
+	docompress -x /usr/share/doc/${PF}/{aufs4-loopback,vfs-ino,tmpfs-idr}.patch
+	readme.gentoo_create_doc
+}
+
+pkg_postinst() {
+	kernel-2_pkg_postinst
+	einfo "For more info on this patchset, and how to report problems, see:"
+	einfo "${HOMEPAGE}"
+	has_version sys-fs/aufs-util || \
+		elog "In order to use aufs FS you need to install sys-fs/aufs-util"
+
+	readme.gentoo_print_elog
+}
+
+pkg_postrm() {
+	kernel-2_pkg_postrm
+}

diff --git a/sys-kernel/aufs-sources/aufs-sources-4.14.74.ebuild b/sys-kernel/aufs-sources/aufs-sources-4.14.74.ebuild
new file mode 100644
index 0000000..eadd06c
--- /dev/null
+++ b/sys-kernel/aufs-sources/aufs-sources-4.14.74.ebuild
@@ -0,0 +1,84 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+ETYPE="sources"
+K_WANT_GENPATCHES="base extras experimental"
+K_GENPATCHES_VER=80
+UNIPATCH_STRICTORDER=1
+inherit kernel-2 eutils readme.gentoo-r1
+
+AUFS_VERSION=4.14.56+_p20181008
+AUFS_TARBALL="aufs-sources-${AUFS_VERSION}.tar.xz"
+# git archive -v --remote=git://git.code.sf.net/p/aufs/aufs4-standalone aufs${AUFS_VERSION/_p*} > aufs-sources-${AUFS_VERSION}.tar
+AUFS_URI="https://dev.gentoo.org/~jlec/distfiles/${AUFS_TARBALL}"
+
+KEYWORDS="~amd64 ~x86"
+HOMEPAGE="https://dev.gentoo.org/~mpagano/genpatches http://aufs.sourceforge.net/"
+IUSE="experimental module vanilla"
+
+DESCRIPTION="Full sources (incl. Gentoo patchset) for the linux kernel tree and aufs4 support"
+SRC_URI="
+	${KERNEL_URI}
+	${ARCH_URI}
+	${AUFS_URI}
+	!vanilla? ( ${GENPATCHES_URI} )
+	"
+
+PDEPEND="=sys-fs/aufs-util-4*"
+
+README_GENTOO_SUFFIX="-r1"
+
+src_unpack() {
+	detect_version
+	detect_arch
+	if use vanilla; then
+		unset UNIPATCH_LIST_GENPATCHES UNIPATCH_LIST_DEFAULT
+		ewarn "You are using USE=vanilla"
+		ewarn "This will drop all support from the gentoo kernel security team"
+	fi
+
+	UNIPATCH_LIST="
+		"${WORKDIR}"/aufs4-kbuild.patch
+		"${WORKDIR}"/aufs4-base.patch
+		"${WORKDIR}"/aufs4-mmap.patch"
+
+	use module && UNIPATCH_LIST+=" "${WORKDIR}"/aufs4-standalone.patch"
+
+	unpack ${AUFS_TARBALL}
+
+	einfo "Using aufs4 version: ${AUFS_VERSION}"
+
+	kernel-2_src_unpack
+}
+
+src_prepare() {
+	kernel-2_src_prepare
+	if ! use module; then
+		sed -e 's:tristate:bool:g' -i "${WORKDIR}"/fs/aufs/Kconfig || die
+	fi
+	cp -f "${WORKDIR}"/include/uapi/linux/aufs_type.h include/uapi/linux/aufs_type.h || die
+	cp -rf "${WORKDIR}"/{Documentation,fs} . || die
+}
+
+src_install() {
+	kernel-2_src_install
+	dodoc "${WORKDIR}"/{aufs4-loopback,vfs-ino,tmpfs-idr}.patch
+	docompress -x /usr/share/doc/${PF}/{aufs4-loopback,vfs-ino,tmpfs-idr}.patch
+	readme.gentoo_create_doc
+}
+
+pkg_postinst() {
+	kernel-2_pkg_postinst
+	einfo "For more info on this patchset, and how to report problems, see:"
+	einfo "${HOMEPAGE}"
+	has_version sys-fs/aufs-util || \
+		elog "In order to use aufs FS you need to install sys-fs/aufs-util"
+
+	readme.gentoo_print_elog
+}
+
+pkg_postrm() {
+	kernel-2_pkg_postrm
+}

diff --git a/sys-kernel/aufs-sources/aufs-sources-4.14.75.ebuild b/sys-kernel/aufs-sources/aufs-sources-4.14.75.ebuild
new file mode 100644
index 0000000..e34ce12
--- /dev/null
+++ b/sys-kernel/aufs-sources/aufs-sources-4.14.75.ebuild
@@ -0,0 +1,84 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+ETYPE="sources"
+K_WANT_GENPATCHES="base extras experimental"
+K_GENPATCHES_VER=81
+UNIPATCH_STRICTORDER=1
+inherit kernel-2 eutils readme.gentoo-r1
+
+AUFS_VERSION=4.14.56+_p20181008
+AUFS_TARBALL="aufs-sources-${AUFS_VERSION}.tar.xz"
+# git archive -v --remote=git://git.code.sf.net/p/aufs/aufs4-standalone aufs${AUFS_VERSION/_p*} > aufs-sources-${AUFS_VERSION}.tar
+AUFS_URI="https://dev.gentoo.org/~jlec/distfiles/${AUFS_TARBALL}"
+
+KEYWORDS="~amd64 ~x86"
+HOMEPAGE="https://dev.gentoo.org/~mpagano/genpatches http://aufs.sourceforge.net/"
+IUSE="experimental module vanilla"
+
+DESCRIPTION="Full sources (incl. Gentoo patchset) for the linux kernel tree and aufs4 support"
+SRC_URI="
+	${KERNEL_URI}
+	${ARCH_URI}
+	${AUFS_URI}
+	!vanilla? ( ${GENPATCHES_URI} )
+	"
+
+PDEPEND="=sys-fs/aufs-util-4*"
+
+README_GENTOO_SUFFIX="-r1"
+
+src_unpack() {
+	detect_version
+	detect_arch
+	if use vanilla; then
+		unset UNIPATCH_LIST_GENPATCHES UNIPATCH_LIST_DEFAULT
+		ewarn "You are using USE=vanilla"
+		ewarn "This will drop all support from the gentoo kernel security team"
+	fi
+
+	UNIPATCH_LIST="
+		"${WORKDIR}"/aufs4-kbuild.patch
+		"${WORKDIR}"/aufs4-base.patch
+		"${WORKDIR}"/aufs4-mmap.patch"
+
+	use module && UNIPATCH_LIST+=" "${WORKDIR}"/aufs4-standalone.patch"
+
+	unpack ${AUFS_TARBALL}
+
+	einfo "Using aufs4 version: ${AUFS_VERSION}"
+
+	kernel-2_src_unpack
+}
+
+src_prepare() {
+	kernel-2_src_prepare
+	if ! use module; then
+		sed -e 's:tristate:bool:g' -i "${WORKDIR}"/fs/aufs/Kconfig || die
+	fi
+	cp -f "${WORKDIR}"/include/uapi/linux/aufs_type.h include/uapi/linux/aufs_type.h || die
+	cp -rf "${WORKDIR}"/{Documentation,fs} . || die
+}
+
+src_install() {
+	kernel-2_src_install
+	dodoc "${WORKDIR}"/{aufs4-loopback,vfs-ino,tmpfs-idr}.patch
+	docompress -x /usr/share/doc/${PF}/{aufs4-loopback,vfs-ino,tmpfs-idr}.patch
+	readme.gentoo_create_doc
+}
+
+pkg_postinst() {
+	kernel-2_pkg_postinst
+	einfo "For more info on this patchset, and how to report problems, see:"
+	einfo "${HOMEPAGE}"
+	has_version sys-fs/aufs-util || \
+		elog "In order to use aufs FS you need to install sys-fs/aufs-util"
+
+	readme.gentoo_print_elog
+}
+
+pkg_postrm() {
+	kernel-2_pkg_postrm
+}

diff --git a/sys-kernel/aufs-sources/aufs-sources-4.14.76.ebuild b/sys-kernel/aufs-sources/aufs-sources-4.14.76.ebuild
new file mode 100644
index 0000000..c470534
--- /dev/null
+++ b/sys-kernel/aufs-sources/aufs-sources-4.14.76.ebuild
@@ -0,0 +1,84 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+ETYPE="sources"
+K_WANT_GENPATCHES="base extras experimental"
+K_GENPATCHES_VER=82
+UNIPATCH_STRICTORDER=1
+inherit kernel-2 eutils readme.gentoo-r1
+
+AUFS_VERSION=4.14.56+_p20181008
+AUFS_TARBALL="aufs-sources-${AUFS_VERSION}.tar.xz"
+# git archive -v --remote=git://git.code.sf.net/p/aufs/aufs4-standalone aufs${AUFS_VERSION/_p*} > aufs-sources-${AUFS_VERSION}.tar
+AUFS_URI="https://dev.gentoo.org/~jlec/distfiles/${AUFS_TARBALL}"
+
+KEYWORDS="~amd64 ~x86"
+HOMEPAGE="https://dev.gentoo.org/~mpagano/genpatches http://aufs.sourceforge.net/"
+IUSE="experimental module vanilla"
+
+DESCRIPTION="Full sources (incl. Gentoo patchset) for the linux kernel tree and aufs4 support"
+SRC_URI="
+	${KERNEL_URI}
+	${ARCH_URI}
+	${AUFS_URI}
+	!vanilla? ( ${GENPATCHES_URI} )
+	"
+
+PDEPEND="=sys-fs/aufs-util-4*"
+
+README_GENTOO_SUFFIX="-r1"
+
+src_unpack() {
+	detect_version
+	detect_arch
+	if use vanilla; then
+		unset UNIPATCH_LIST_GENPATCHES UNIPATCH_LIST_DEFAULT
+		ewarn "You are using USE=vanilla"
+		ewarn "This will drop all support from the gentoo kernel security team"
+	fi
+
+	UNIPATCH_LIST="
+		"${WORKDIR}"/aufs4-kbuild.patch
+		"${WORKDIR}"/aufs4-base.patch
+		"${WORKDIR}"/aufs4-mmap.patch"
+
+	use module && UNIPATCH_LIST+=" "${WORKDIR}"/aufs4-standalone.patch"
+
+	unpack ${AUFS_TARBALL}
+
+	einfo "Using aufs4 version: ${AUFS_VERSION}"
+
+	kernel-2_src_unpack
+}
+
+src_prepare() {
+	kernel-2_src_prepare
+	if ! use module; then
+		sed -e 's:tristate:bool:g' -i "${WORKDIR}"/fs/aufs/Kconfig || die
+	fi
+	cp -f "${WORKDIR}"/include/uapi/linux/aufs_type.h include/uapi/linux/aufs_type.h || die
+	cp -rf "${WORKDIR}"/{Documentation,fs} . || die
+}
+
+src_install() {
+	kernel-2_src_install
+	dodoc "${WORKDIR}"/{aufs4-loopback,vfs-ino,tmpfs-idr}.patch
+	docompress -x /usr/share/doc/${PF}/{aufs4-loopback,vfs-ino,tmpfs-idr}.patch
+	readme.gentoo_create_doc
+}
+
+pkg_postinst() {
+	kernel-2_pkg_postinst
+	einfo "For more info on this patchset, and how to report problems, see:"
+	einfo "${HOMEPAGE}"
+	has_version sys-fs/aufs-util || \
+		elog "In order to use aufs FS you need to install sys-fs/aufs-util"
+
+	readme.gentoo_print_elog
+}
+
+pkg_postrm() {
+	kernel-2_pkg_postrm
+}

diff --git a/sys-kernel/aufs-sources/aufs-sources-4.14.77.ebuild b/sys-kernel/aufs-sources/aufs-sources-4.14.77.ebuild
new file mode 100644
index 0000000..733afd7
--- /dev/null
+++ b/sys-kernel/aufs-sources/aufs-sources-4.14.77.ebuild
@@ -0,0 +1,84 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+ETYPE="sources"
+K_WANT_GENPATCHES="base extras experimental"
+K_GENPATCHES_VER=84
+UNIPATCH_STRICTORDER=1
+inherit kernel-2 eutils readme.gentoo-r1
+
+AUFS_VERSION=4.14.56+_p20181008
+AUFS_TARBALL="aufs-sources-${AUFS_VERSION}.tar.xz"
+# git archive -v --remote=git://git.code.sf.net/p/aufs/aufs4-standalone aufs${AUFS_VERSION/_p*} > aufs-sources-${AUFS_VERSION}.tar
+AUFS_URI="https://dev.gentoo.org/~jlec/distfiles/${AUFS_TARBALL}"
+
+KEYWORDS="~amd64 ~x86"
+HOMEPAGE="https://dev.gentoo.org/~mpagano/genpatches http://aufs.sourceforge.net/"
+IUSE="experimental module vanilla"
+
+DESCRIPTION="Full sources (incl. Gentoo patchset) for the linux kernel tree and aufs4 support"
+SRC_URI="
+	${KERNEL_URI}
+	${ARCH_URI}
+	${AUFS_URI}
+	!vanilla? ( ${GENPATCHES_URI} )
+	"
+
+PDEPEND="=sys-fs/aufs-util-4*"
+
+README_GENTOO_SUFFIX="-r1"
+
+src_unpack() {
+	detect_version
+	detect_arch
+	if use vanilla; then
+		unset UNIPATCH_LIST_GENPATCHES UNIPATCH_LIST_DEFAULT
+		ewarn "You are using USE=vanilla"
+		ewarn "This will drop all support from the gentoo kernel security team"
+	fi
+
+	UNIPATCH_LIST="
+		"${WORKDIR}"/aufs4-kbuild.patch
+		"${WORKDIR}"/aufs4-base.patch
+		"${WORKDIR}"/aufs4-mmap.patch"
+
+	use module && UNIPATCH_LIST+=" "${WORKDIR}"/aufs4-standalone.patch"
+
+	unpack ${AUFS_TARBALL}
+
+	einfo "Using aufs4 version: ${AUFS_VERSION}"
+
+	kernel-2_src_unpack
+}
+
+src_prepare() {
+	kernel-2_src_prepare
+	if ! use module; then
+		sed -e 's:tristate:bool:g' -i "${WORKDIR}"/fs/aufs/Kconfig || die
+	fi
+	cp -f "${WORKDIR}"/include/uapi/linux/aufs_type.h include/uapi/linux/aufs_type.h || die
+	cp -rf "${WORKDIR}"/{Documentation,fs} . || die
+}
+
+src_install() {
+	kernel-2_src_install
+	dodoc "${WORKDIR}"/{aufs4-loopback,vfs-ino,tmpfs-idr}.patch
+	docompress -x /usr/share/doc/${PF}/{aufs4-loopback,vfs-ino,tmpfs-idr}.patch
+	readme.gentoo_create_doc
+}
+
+pkg_postinst() {
+	kernel-2_pkg_postinst
+	einfo "For more info on this patchset, and how to report problems, see:"
+	einfo "${HOMEPAGE}"
+	has_version sys-fs/aufs-util || \
+		elog "In order to use aufs FS you need to install sys-fs/aufs-util"
+
+	readme.gentoo_print_elog
+}
+
+pkg_postrm() {
+	kernel-2_pkg_postrm
+}

diff --git a/sys-kernel/aufs-sources/aufs-sources-4.14.78.ebuild b/sys-kernel/aufs-sources/aufs-sources-4.14.78.ebuild
new file mode 100644
index 0000000..9550ecf
--- /dev/null
+++ b/sys-kernel/aufs-sources/aufs-sources-4.14.78.ebuild
@@ -0,0 +1,84 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+ETYPE="sources"
+K_WANT_GENPATCHES="base extras experimental"
+K_GENPATCHES_VER=85
+UNIPATCH_STRICTORDER=1
+inherit kernel-2 eutils readme.gentoo-r1
+
+AUFS_VERSION=4.14.56+_p20181008
+AUFS_TARBALL="aufs-sources-${AUFS_VERSION}.tar.xz"
+# git archive -v --remote=git://git.code.sf.net/p/aufs/aufs4-standalone aufs${AUFS_VERSION/_p*} > aufs-sources-${AUFS_VERSION}.tar
+AUFS_URI="https://dev.gentoo.org/~jlec/distfiles/${AUFS_TARBALL}"
+
+KEYWORDS="~amd64 ~x86"
+HOMEPAGE="https://dev.gentoo.org/~mpagano/genpatches http://aufs.sourceforge.net/"
+IUSE="experimental module vanilla"
+
+DESCRIPTION="Full sources (incl. Gentoo patchset) for the linux kernel tree and aufs4 support"
+SRC_URI="
+	${KERNEL_URI}
+	${ARCH_URI}
+	${AUFS_URI}
+	!vanilla? ( ${GENPATCHES_URI} )
+	"
+
+PDEPEND="=sys-fs/aufs-util-4*"
+
+README_GENTOO_SUFFIX="-r1"
+
+src_unpack() {
+	detect_version
+	detect_arch
+	if use vanilla; then
+		unset UNIPATCH_LIST_GENPATCHES UNIPATCH_LIST_DEFAULT
+		ewarn "You are using USE=vanilla"
+		ewarn "This will drop all support from the gentoo kernel security team"
+	fi
+
+	UNIPATCH_LIST="
+		"${WORKDIR}"/aufs4-kbuild.patch
+		"${WORKDIR}"/aufs4-base.patch
+		"${WORKDIR}"/aufs4-mmap.patch"
+
+	use module && UNIPATCH_LIST+=" "${WORKDIR}"/aufs4-standalone.patch"
+
+	unpack ${AUFS_TARBALL}
+
+	einfo "Using aufs4 version: ${AUFS_VERSION}"
+
+	kernel-2_src_unpack
+}
+
+src_prepare() {
+	kernel-2_src_prepare
+	if ! use module; then
+		sed -e 's:tristate:bool:g' -i "${WORKDIR}"/fs/aufs/Kconfig || die
+	fi
+	cp -f "${WORKDIR}"/include/uapi/linux/aufs_type.h include/uapi/linux/aufs_type.h || die
+	cp -rf "${WORKDIR}"/{Documentation,fs} . || die
+}
+
+src_install() {
+	kernel-2_src_install
+	dodoc "${WORKDIR}"/{aufs4-loopback,vfs-ino,tmpfs-idr}.patch
+	docompress -x /usr/share/doc/${PF}/{aufs4-loopback,vfs-ino,tmpfs-idr}.patch
+	readme.gentoo_create_doc
+}
+
+pkg_postinst() {
+	kernel-2_pkg_postinst
+	einfo "For more info on this patchset, and how to report problems, see:"
+	einfo "${HOMEPAGE}"
+	has_version sys-fs/aufs-util || \
+		elog "In order to use aufs FS you need to install sys-fs/aufs-util"
+
+	readme.gentoo_print_elog
+}
+
+pkg_postrm() {
+	kernel-2_pkg_postrm
+}

diff --git a/sys-kernel/aufs-sources/aufs-sources-4.18.10.ebuild b/sys-kernel/aufs-sources/aufs-sources-4.18.10.ebuild
new file mode 100644
index 0000000..04513e7
--- /dev/null
+++ b/sys-kernel/aufs-sources/aufs-sources-4.18.10.ebuild
@@ -0,0 +1,84 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+ETYPE="sources"
+K_WANT_GENPATCHES="base extras experimental"
+K_GENPATCHES_VER=13
+UNIPATCH_STRICTORDER=1
+inherit kernel-2 eutils readme.gentoo-r1
+
+AUFS_VERSION=4.18_p20181008
+AUFS_TARBALL="aufs-sources-${AUFS_VERSION}.tar.xz"
+# git archive -v --remote=git://git.code.sf.net/p/aufs/aufs4-standalone aufs${AUFS_VERSION/_p*} > aufs-sources-${AUFS_VERSION}.tar
+AUFS_URI="https://dev.gentoo.org/~jlec/distfiles/${AUFS_TARBALL}"
+
+KEYWORDS="~amd64 ~x86"
+HOMEPAGE="https://dev.gentoo.org/~mpagano/genpatches http://aufs.sourceforge.net/"
+IUSE="experimental module vanilla"
+
+DESCRIPTION="Full sources (incl. Gentoo patchset) for the linux kernel tree and aufs4 support"
+SRC_URI="
+	${KERNEL_URI}
+	${ARCH_URI}
+	${AUFS_URI}
+	!vanilla? ( ${GENPATCHES_URI} )
+	"
+
+PDEPEND="=sys-fs/aufs-util-4*"
+
+README_GENTOO_SUFFIX="-r1"
+
+src_unpack() {
+	detect_version
+	detect_arch
+	if use vanilla; then
+		unset UNIPATCH_LIST_GENPATCHES UNIPATCH_LIST_DEFAULT
+		ewarn "You are using USE=vanilla"
+		ewarn "This will drop all support from the gentoo kernel security team"
+	fi
+
+	UNIPATCH_LIST="
+		"${WORKDIR}"/aufs4-kbuild.patch
+		"${WORKDIR}"/aufs4-base.patch
+		"${WORKDIR}"/aufs4-mmap.patch"
+
+	use module && UNIPATCH_LIST+=" "${WORKDIR}"/aufs4-standalone.patch"
+
+	unpack ${AUFS_TARBALL}
+
+	einfo "Using aufs4 version: ${AUFS_VERSION}"
+
+	kernel-2_src_unpack
+}
+
+src_prepare() {
+	kernel-2_src_prepare
+	if ! use module; then
+		sed -e 's:tristate:bool:g' -i "${WORKDIR}"/fs/aufs/Kconfig || die
+	fi
+	cp -f "${WORKDIR}"/include/uapi/linux/aufs_type.h include/uapi/linux/aufs_type.h || die
+	cp -rf "${WORKDIR}"/{Documentation,fs} . || die
+}
+
+src_install() {
+	kernel-2_src_install
+	dodoc "${WORKDIR}"/{aufs4-loopback,vfs-ino,tmpfs-idr}.patch
+	docompress -x /usr/share/doc/${PF}/{aufs4-loopback,vfs-ino,tmpfs-idr}.patch
+	readme.gentoo_create_doc
+}
+
+pkg_postinst() {
+	kernel-2_pkg_postinst
+	einfo "For more info on this patchset, and how to report problems, see:"
+	einfo "${HOMEPAGE}"
+	has_version sys-fs/aufs-util || \
+		elog "In order to use aufs FS you need to install sys-fs/aufs-util"
+
+	readme.gentoo_print_elog
+}
+
+pkg_postrm() {
+	kernel-2_pkg_postrm
+}

diff --git a/sys-kernel/aufs-sources/aufs-sources-4.18.11.ebuild b/sys-kernel/aufs-sources/aufs-sources-4.18.11.ebuild
new file mode 100644
index 0000000..952a3f8
--- /dev/null
+++ b/sys-kernel/aufs-sources/aufs-sources-4.18.11.ebuild
@@ -0,0 +1,84 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+ETYPE="sources"
+K_WANT_GENPATCHES="base extras experimental"
+K_GENPATCHES_VER=14
+UNIPATCH_STRICTORDER=1
+inherit kernel-2 eutils readme.gentoo-r1
+
+AUFS_VERSION=4.18.11+_p20181008
+AUFS_TARBALL="aufs-sources-${AUFS_VERSION}.tar.xz"
+# git archive -v --remote=git://git.code.sf.net/p/aufs/aufs4-standalone aufs${AUFS_VERSION/_p*} > aufs-sources-${AUFS_VERSION}.tar
+AUFS_URI="https://dev.gentoo.org/~jlec/distfiles/${AUFS_TARBALL}"
+
+KEYWORDS="~amd64 ~x86"
+HOMEPAGE="https://dev.gentoo.org/~mpagano/genpatches http://aufs.sourceforge.net/"
+IUSE="experimental module vanilla"
+
+DESCRIPTION="Full sources (incl. Gentoo patchset) for the linux kernel tree and aufs4 support"
+SRC_URI="
+	${KERNEL_URI}
+	${ARCH_URI}
+	${AUFS_URI}
+	!vanilla? ( ${GENPATCHES_URI} )
+	"
+
+PDEPEND="=sys-fs/aufs-util-4*"
+
+README_GENTOO_SUFFIX="-r1"
+
+src_unpack() {
+	detect_version
+	detect_arch
+	if use vanilla; then
+		unset UNIPATCH_LIST_GENPATCHES UNIPATCH_LIST_DEFAULT
+		ewarn "You are using USE=vanilla"
+		ewarn "This will drop all support from the gentoo kernel security team"
+	fi
+
+	UNIPATCH_LIST="
+		"${WORKDIR}"/aufs4-kbuild.patch
+		"${WORKDIR}"/aufs4-base.patch
+		"${WORKDIR}"/aufs4-mmap.patch"
+
+	use module && UNIPATCH_LIST+=" "${WORKDIR}"/aufs4-standalone.patch"
+
+	unpack ${AUFS_TARBALL}
+
+	einfo "Using aufs4 version: ${AUFS_VERSION}"
+
+	kernel-2_src_unpack
+}
+
+src_prepare() {
+	kernel-2_src_prepare
+	if ! use module; then
+		sed -e 's:tristate:bool:g' -i "${WORKDIR}"/fs/aufs/Kconfig || die
+	fi
+	cp -f "${WORKDIR}"/include/uapi/linux/aufs_type.h include/uapi/linux/aufs_type.h || die
+	cp -rf "${WORKDIR}"/{Documentation,fs} . || die
+}
+
+src_install() {
+	kernel-2_src_install
+	dodoc "${WORKDIR}"/{aufs4-loopback,vfs-ino,tmpfs-idr}.patch
+	docompress -x /usr/share/doc/${PF}/{aufs4-loopback,vfs-ino,tmpfs-idr}.patch
+	readme.gentoo_create_doc
+}
+
+pkg_postinst() {
+	kernel-2_pkg_postinst
+	einfo "For more info on this patchset, and how to report problems, see:"
+	einfo "${HOMEPAGE}"
+	has_version sys-fs/aufs-util || \
+		elog "In order to use aufs FS you need to install sys-fs/aufs-util"
+
+	readme.gentoo_print_elog
+}
+
+pkg_postrm() {
+	kernel-2_pkg_postrm
+}

diff --git a/sys-kernel/aufs-sources/aufs-sources-4.18.12.ebuild b/sys-kernel/aufs-sources/aufs-sources-4.18.12.ebuild
new file mode 100644
index 0000000..41f3c60
--- /dev/null
+++ b/sys-kernel/aufs-sources/aufs-sources-4.18.12.ebuild
@@ -0,0 +1,84 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+ETYPE="sources"
+K_WANT_GENPATCHES="base extras experimental"
+K_GENPATCHES_VER=15
+UNIPATCH_STRICTORDER=1
+inherit kernel-2 eutils readme.gentoo-r1
+
+AUFS_VERSION=4.18.11+_p20181008
+AUFS_TARBALL="aufs-sources-${AUFS_VERSION}.tar.xz"
+# git archive -v --remote=git://git.code.sf.net/p/aufs/aufs4-standalone aufs${AUFS_VERSION/_p*} > aufs-sources-${AUFS_VERSION}.tar
+AUFS_URI="https://dev.gentoo.org/~jlec/distfiles/${AUFS_TARBALL}"
+
+KEYWORDS="~amd64 ~x86"
+HOMEPAGE="https://dev.gentoo.org/~mpagano/genpatches http://aufs.sourceforge.net/"
+IUSE="experimental module vanilla"
+
+DESCRIPTION="Full sources (incl. Gentoo patchset) for the linux kernel tree and aufs4 support"
+SRC_URI="
+	${KERNEL_URI}
+	${ARCH_URI}
+	${AUFS_URI}
+	!vanilla? ( ${GENPATCHES_URI} )
+	"
+
+PDEPEND="=sys-fs/aufs-util-4*"
+
+README_GENTOO_SUFFIX="-r1"
+
+src_unpack() {
+	detect_version
+	detect_arch
+	if use vanilla; then
+		unset UNIPATCH_LIST_GENPATCHES UNIPATCH_LIST_DEFAULT
+		ewarn "You are using USE=vanilla"
+		ewarn "This will drop all support from the gentoo kernel security team"
+	fi
+
+	UNIPATCH_LIST="
+		"${WORKDIR}"/aufs4-kbuild.patch
+		"${WORKDIR}"/aufs4-base.patch
+		"${WORKDIR}"/aufs4-mmap.patch"
+
+	use module && UNIPATCH_LIST+=" "${WORKDIR}"/aufs4-standalone.patch"
+
+	unpack ${AUFS_TARBALL}
+
+	einfo "Using aufs4 version: ${AUFS_VERSION}"
+
+	kernel-2_src_unpack
+}
+
+src_prepare() {
+	kernel-2_src_prepare
+	if ! use module; then
+		sed -e 's:tristate:bool:g' -i "${WORKDIR}"/fs/aufs/Kconfig || die
+	fi
+	cp -f "${WORKDIR}"/include/uapi/linux/aufs_type.h include/uapi/linux/aufs_type.h || die
+	cp -rf "${WORKDIR}"/{Documentation,fs} . || die
+}
+
+src_install() {
+	kernel-2_src_install
+	dodoc "${WORKDIR}"/{aufs4-loopback,vfs-ino,tmpfs-idr}.patch
+	docompress -x /usr/share/doc/${PF}/{aufs4-loopback,vfs-ino,tmpfs-idr}.patch
+	readme.gentoo_create_doc
+}
+
+pkg_postinst() {
+	kernel-2_pkg_postinst
+	einfo "For more info on this patchset, and how to report problems, see:"
+	einfo "${HOMEPAGE}"
+	has_version sys-fs/aufs-util || \
+		elog "In order to use aufs FS you need to install sys-fs/aufs-util"
+
+	readme.gentoo_print_elog
+}
+
+pkg_postrm() {
+	kernel-2_pkg_postrm
+}

diff --git a/sys-kernel/aufs-sources/aufs-sources-4.18.13.ebuild b/sys-kernel/aufs-sources/aufs-sources-4.18.13.ebuild
new file mode 100644
index 0000000..dfd53d0
--- /dev/null
+++ b/sys-kernel/aufs-sources/aufs-sources-4.18.13.ebuild
@@ -0,0 +1,84 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+ETYPE="sources"
+K_WANT_GENPATCHES="base extras experimental"
+K_GENPATCHES_VER=16
+UNIPATCH_STRICTORDER=1
+inherit kernel-2 eutils readme.gentoo-r1
+
+AUFS_VERSION=4.18.11+_p20181008
+AUFS_TARBALL="aufs-sources-${AUFS_VERSION}.tar.xz"
+# git archive -v --remote=git://git.code.sf.net/p/aufs/aufs4-standalone aufs${AUFS_VERSION/_p*} > aufs-sources-${AUFS_VERSION}.tar
+AUFS_URI="https://dev.gentoo.org/~jlec/distfiles/${AUFS_TARBALL}"
+
+KEYWORDS="~amd64 ~x86"
+HOMEPAGE="https://dev.gentoo.org/~mpagano/genpatches http://aufs.sourceforge.net/"
+IUSE="experimental module vanilla"
+
+DESCRIPTION="Full sources (incl. Gentoo patchset) for the linux kernel tree and aufs4 support"
+SRC_URI="
+	${KERNEL_URI}
+	${ARCH_URI}
+	${AUFS_URI}
+	!vanilla? ( ${GENPATCHES_URI} )
+	"
+
+PDEPEND="=sys-fs/aufs-util-4*"
+
+README_GENTOO_SUFFIX="-r1"
+
+src_unpack() {
+	detect_version
+	detect_arch
+	if use vanilla; then
+		unset UNIPATCH_LIST_GENPATCHES UNIPATCH_LIST_DEFAULT
+		ewarn "You are using USE=vanilla"
+		ewarn "This will drop all support from the gentoo kernel security team"
+	fi
+
+	UNIPATCH_LIST="
+		"${WORKDIR}"/aufs4-kbuild.patch
+		"${WORKDIR}"/aufs4-base.patch
+		"${WORKDIR}"/aufs4-mmap.patch"
+
+	use module && UNIPATCH_LIST+=" "${WORKDIR}"/aufs4-standalone.patch"
+
+	unpack ${AUFS_TARBALL}
+
+	einfo "Using aufs4 version: ${AUFS_VERSION}"
+
+	kernel-2_src_unpack
+}
+
+src_prepare() {
+	kernel-2_src_prepare
+	if ! use module; then
+		sed -e 's:tristate:bool:g' -i "${WORKDIR}"/fs/aufs/Kconfig || die
+	fi
+	cp -f "${WORKDIR}"/include/uapi/linux/aufs_type.h include/uapi/linux/aufs_type.h || die
+	cp -rf "${WORKDIR}"/{Documentation,fs} . || die
+}
+
+src_install() {
+	kernel-2_src_install
+	dodoc "${WORKDIR}"/{aufs4-loopback,vfs-ino,tmpfs-idr}.patch
+	docompress -x /usr/share/doc/${PF}/{aufs4-loopback,vfs-ino,tmpfs-idr}.patch
+	readme.gentoo_create_doc
+}
+
+pkg_postinst() {
+	kernel-2_pkg_postinst
+	einfo "For more info on this patchset, and how to report problems, see:"
+	einfo "${HOMEPAGE}"
+	has_version sys-fs/aufs-util || \
+		elog "In order to use aufs FS you need to install sys-fs/aufs-util"
+
+	readme.gentoo_print_elog
+}
+
+pkg_postrm() {
+	kernel-2_pkg_postrm
+}

diff --git a/sys-kernel/aufs-sources/aufs-sources-4.18.14.ebuild b/sys-kernel/aufs-sources/aufs-sources-4.18.14.ebuild
new file mode 100644
index 0000000..18f5b37
--- /dev/null
+++ b/sys-kernel/aufs-sources/aufs-sources-4.18.14.ebuild
@@ -0,0 +1,84 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+ETYPE="sources"
+K_WANT_GENPATCHES="base extras experimental"
+K_GENPATCHES_VER=17
+UNIPATCH_STRICTORDER=1
+inherit kernel-2 eutils readme.gentoo-r1
+
+AUFS_VERSION=4.18.11+_p20181008
+AUFS_TARBALL="aufs-sources-${AUFS_VERSION}.tar.xz"
+# git archive -v --remote=git://git.code.sf.net/p/aufs/aufs4-standalone aufs${AUFS_VERSION/_p*} > aufs-sources-${AUFS_VERSION}.tar
+AUFS_URI="https://dev.gentoo.org/~jlec/distfiles/${AUFS_TARBALL}"
+
+KEYWORDS="~amd64 ~x86"
+HOMEPAGE="https://dev.gentoo.org/~mpagano/genpatches http://aufs.sourceforge.net/"
+IUSE="experimental module vanilla"
+
+DESCRIPTION="Full sources (incl. Gentoo patchset) for the linux kernel tree and aufs4 support"
+SRC_URI="
+	${KERNEL_URI}
+	${ARCH_URI}
+	${AUFS_URI}
+	!vanilla? ( ${GENPATCHES_URI} )
+	"
+
+PDEPEND="=sys-fs/aufs-util-4*"
+
+README_GENTOO_SUFFIX="-r1"
+
+src_unpack() {
+	detect_version
+	detect_arch
+	if use vanilla; then
+		unset UNIPATCH_LIST_GENPATCHES UNIPATCH_LIST_DEFAULT
+		ewarn "You are using USE=vanilla"
+		ewarn "This will drop all support from the gentoo kernel security team"
+	fi
+
+	UNIPATCH_LIST="
+		"${WORKDIR}"/aufs4-kbuild.patch
+		"${WORKDIR}"/aufs4-base.patch
+		"${WORKDIR}"/aufs4-mmap.patch"
+
+	use module && UNIPATCH_LIST+=" "${WORKDIR}"/aufs4-standalone.patch"
+
+	unpack ${AUFS_TARBALL}
+
+	einfo "Using aufs4 version: ${AUFS_VERSION}"
+
+	kernel-2_src_unpack
+}
+
+src_prepare() {
+	kernel-2_src_prepare
+	if ! use module; then
+		sed -e 's:tristate:bool:g' -i "${WORKDIR}"/fs/aufs/Kconfig || die
+	fi
+	cp -f "${WORKDIR}"/include/uapi/linux/aufs_type.h include/uapi/linux/aufs_type.h || die
+	cp -rf "${WORKDIR}"/{Documentation,fs} . || die
+}
+
+src_install() {
+	kernel-2_src_install
+	dodoc "${WORKDIR}"/{aufs4-loopback,vfs-ino,tmpfs-idr}.patch
+	docompress -x /usr/share/doc/${PF}/{aufs4-loopback,vfs-ino,tmpfs-idr}.patch
+	readme.gentoo_create_doc
+}
+
+pkg_postinst() {
+	kernel-2_pkg_postinst
+	einfo "For more info on this patchset, and how to report problems, see:"
+	einfo "${HOMEPAGE}"
+	has_version sys-fs/aufs-util || \
+		elog "In order to use aufs FS you need to install sys-fs/aufs-util"
+
+	readme.gentoo_print_elog
+}
+
+pkg_postrm() {
+	kernel-2_pkg_postrm
+}

diff --git a/sys-kernel/aufs-sources/aufs-sources-4.18.15.ebuild b/sys-kernel/aufs-sources/aufs-sources-4.18.15.ebuild
new file mode 100644
index 0000000..43b26f2
--- /dev/null
+++ b/sys-kernel/aufs-sources/aufs-sources-4.18.15.ebuild
@@ -0,0 +1,84 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+ETYPE="sources"
+K_WANT_GENPATCHES="base extras experimental"
+K_GENPATCHES_VER=18
+UNIPATCH_STRICTORDER=1
+inherit kernel-2 eutils readme.gentoo-r1
+
+AUFS_VERSION=4.18.11+_p20181008
+AUFS_TARBALL="aufs-sources-${AUFS_VERSION}.tar.xz"
+# git archive -v --remote=git://git.code.sf.net/p/aufs/aufs4-standalone aufs${AUFS_VERSION/_p*} > aufs-sources-${AUFS_VERSION}.tar
+AUFS_URI="https://dev.gentoo.org/~jlec/distfiles/${AUFS_TARBALL}"
+
+KEYWORDS="~amd64 ~x86"
+HOMEPAGE="https://dev.gentoo.org/~mpagano/genpatches http://aufs.sourceforge.net/"
+IUSE="experimental module vanilla"
+
+DESCRIPTION="Full sources (incl. Gentoo patchset) for the linux kernel tree and aufs4 support"
+SRC_URI="
+	${KERNEL_URI}
+	${ARCH_URI}
+	${AUFS_URI}
+	!vanilla? ( ${GENPATCHES_URI} )
+	"
+
+PDEPEND="=sys-fs/aufs-util-4*"
+
+README_GENTOO_SUFFIX="-r1"
+
+src_unpack() {
+	detect_version
+	detect_arch
+	if use vanilla; then
+		unset UNIPATCH_LIST_GENPATCHES UNIPATCH_LIST_DEFAULT
+		ewarn "You are using USE=vanilla"
+		ewarn "This will drop all support from the gentoo kernel security team"
+	fi
+
+	UNIPATCH_LIST="
+		"${WORKDIR}"/aufs4-kbuild.patch
+		"${WORKDIR}"/aufs4-base.patch
+		"${WORKDIR}"/aufs4-mmap.patch"
+
+	use module && UNIPATCH_LIST+=" "${WORKDIR}"/aufs4-standalone.patch"
+
+	unpack ${AUFS_TARBALL}
+
+	einfo "Using aufs4 version: ${AUFS_VERSION}"
+
+	kernel-2_src_unpack
+}
+
+src_prepare() {
+	kernel-2_src_prepare
+	if ! use module; then
+		sed -e 's:tristate:bool:g' -i "${WORKDIR}"/fs/aufs/Kconfig || die
+	fi
+	cp -f "${WORKDIR}"/include/uapi/linux/aufs_type.h include/uapi/linux/aufs_type.h || die
+	cp -rf "${WORKDIR}"/{Documentation,fs} . || die
+}
+
+src_install() {
+	kernel-2_src_install
+	dodoc "${WORKDIR}"/{aufs4-loopback,vfs-ino,tmpfs-idr}.patch
+	docompress -x /usr/share/doc/${PF}/{aufs4-loopback,vfs-ino,tmpfs-idr}.patch
+	readme.gentoo_create_doc
+}
+
+pkg_postinst() {
+	kernel-2_pkg_postinst
+	einfo "For more info on this patchset, and how to report problems, see:"
+	einfo "${HOMEPAGE}"
+	has_version sys-fs/aufs-util || \
+		elog "In order to use aufs FS you need to install sys-fs/aufs-util"
+
+	readme.gentoo_print_elog
+}
+
+pkg_postrm() {
+	kernel-2_pkg_postrm
+}

diff --git a/sys-kernel/aufs-sources/aufs-sources-4.18.16.ebuild b/sys-kernel/aufs-sources/aufs-sources-4.18.16.ebuild
new file mode 100644
index 0000000..471393e
--- /dev/null
+++ b/sys-kernel/aufs-sources/aufs-sources-4.18.16.ebuild
@@ -0,0 +1,84 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+ETYPE="sources"
+K_WANT_GENPATCHES="base extras experimental"
+K_GENPATCHES_VER=19
+UNIPATCH_STRICTORDER=1
+inherit kernel-2 eutils readme.gentoo-r1
+
+AUFS_VERSION=4.18.11+_p20181008
+AUFS_TARBALL="aufs-sources-${AUFS_VERSION}.tar.xz"
+# git archive -v --remote=git://git.code.sf.net/p/aufs/aufs4-standalone aufs${AUFS_VERSION/_p*} > aufs-sources-${AUFS_VERSION}.tar
+AUFS_URI="https://dev.gentoo.org/~jlec/distfiles/${AUFS_TARBALL}"
+
+KEYWORDS="~amd64 ~x86"
+HOMEPAGE="https://dev.gentoo.org/~mpagano/genpatches http://aufs.sourceforge.net/"
+IUSE="experimental module vanilla"
+
+DESCRIPTION="Full sources (incl. Gentoo patchset) for the linux kernel tree and aufs4 support"
+SRC_URI="
+	${KERNEL_URI}
+	${ARCH_URI}
+	${AUFS_URI}
+	!vanilla? ( ${GENPATCHES_URI} )
+	"
+
+PDEPEND="=sys-fs/aufs-util-4*"
+
+README_GENTOO_SUFFIX="-r1"
+
+src_unpack() {
+	detect_version
+	detect_arch
+	if use vanilla; then
+		unset UNIPATCH_LIST_GENPATCHES UNIPATCH_LIST_DEFAULT
+		ewarn "You are using USE=vanilla"
+		ewarn "This will drop all support from the gentoo kernel security team"
+	fi
+
+	UNIPATCH_LIST="
+		"${WORKDIR}"/aufs4-kbuild.patch
+		"${WORKDIR}"/aufs4-base.patch
+		"${WORKDIR}"/aufs4-mmap.patch"
+
+	use module && UNIPATCH_LIST+=" "${WORKDIR}"/aufs4-standalone.patch"
+
+	unpack ${AUFS_TARBALL}
+
+	einfo "Using aufs4 version: ${AUFS_VERSION}"
+
+	kernel-2_src_unpack
+}
+
+src_prepare() {
+	kernel-2_src_prepare
+	if ! use module; then
+		sed -e 's:tristate:bool:g' -i "${WORKDIR}"/fs/aufs/Kconfig || die
+	fi
+	cp -f "${WORKDIR}"/include/uapi/linux/aufs_type.h include/uapi/linux/aufs_type.h || die
+	cp -rf "${WORKDIR}"/{Documentation,fs} . || die
+}
+
+src_install() {
+	kernel-2_src_install
+	dodoc "${WORKDIR}"/{aufs4-loopback,vfs-ino,tmpfs-idr}.patch
+	docompress -x /usr/share/doc/${PF}/{aufs4-loopback,vfs-ino,tmpfs-idr}.patch
+	readme.gentoo_create_doc
+}
+
+pkg_postinst() {
+	kernel-2_pkg_postinst
+	einfo "For more info on this patchset, and how to report problems, see:"
+	einfo "${HOMEPAGE}"
+	has_version sys-fs/aufs-util || \
+		elog "In order to use aufs FS you need to install sys-fs/aufs-util"
+
+	readme.gentoo_print_elog
+}
+
+pkg_postrm() {
+	kernel-2_pkg_postrm
+}

diff --git a/sys-kernel/aufs-sources/aufs-sources-4.18.9.ebuild b/sys-kernel/aufs-sources/aufs-sources-4.18.9.ebuild
new file mode 100644
index 0000000..4ba7781
--- /dev/null
+++ b/sys-kernel/aufs-sources/aufs-sources-4.18.9.ebuild
@@ -0,0 +1,84 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+ETYPE="sources"
+K_WANT_GENPATCHES="base extras experimental"
+K_GENPATCHES_VER=12
+UNIPATCH_STRICTORDER=1
+inherit kernel-2 eutils readme.gentoo-r1
+
+AUFS_VERSION=4.18.11+_p20181008
+AUFS_TARBALL="aufs-sources-${AUFS_VERSION}.tar.xz"
+# git archive -v --remote=git://git.code.sf.net/p/aufs/aufs4-standalone aufs${AUFS_VERSION/_p*} > aufs-sources-${AUFS_VERSION}.tar
+AUFS_URI="https://dev.gentoo.org/~jlec/distfiles/${AUFS_TARBALL}"
+
+KEYWORDS="~amd64 ~x86"
+HOMEPAGE="https://dev.gentoo.org/~mpagano/genpatches http://aufs.sourceforge.net/"
+IUSE="experimental module vanilla"
+
+DESCRIPTION="Full sources (incl. Gentoo patchset) for the linux kernel tree and aufs4 support"
+SRC_URI="
+	${KERNEL_URI}
+	${ARCH_URI}
+	${AUFS_URI}
+	!vanilla? ( ${GENPATCHES_URI} )
+	"
+
+PDEPEND="=sys-fs/aufs-util-4*"
+
+README_GENTOO_SUFFIX="-r1"
+
+src_unpack() {
+	detect_version
+	detect_arch
+	if use vanilla; then
+		unset UNIPATCH_LIST_GENPATCHES UNIPATCH_LIST_DEFAULT
+		ewarn "You are using USE=vanilla"
+		ewarn "This will drop all support from the gentoo kernel security team"
+	fi
+
+	UNIPATCH_LIST="
+		"${WORKDIR}"/aufs4-kbuild.patch
+		"${WORKDIR}"/aufs4-base.patch
+		"${WORKDIR}"/aufs4-mmap.patch"
+
+	use module && UNIPATCH_LIST+=" "${WORKDIR}"/aufs4-standalone.patch"
+
+	unpack ${AUFS_TARBALL}
+
+	einfo "Using aufs4 version: ${AUFS_VERSION}"
+
+	kernel-2_src_unpack
+}
+
+src_prepare() {
+	kernel-2_src_prepare
+	if ! use module; then
+		sed -e 's:tristate:bool:g' -i "${WORKDIR}"/fs/aufs/Kconfig || die
+	fi
+	cp -f "${WORKDIR}"/include/uapi/linux/aufs_type.h include/uapi/linux/aufs_type.h || die
+	cp -rf "${WORKDIR}"/{Documentation,fs} . || die
+}
+
+src_install() {
+	kernel-2_src_install
+	dodoc "${WORKDIR}"/{aufs4-loopback,vfs-ino,tmpfs-idr}.patch
+	docompress -x /usr/share/doc/${PF}/{aufs4-loopback,vfs-ino,tmpfs-idr}.patch
+	readme.gentoo_create_doc
+}
+
+pkg_postinst() {
+	kernel-2_pkg_postinst
+	einfo "For more info on this patchset, and how to report problems, see:"
+	einfo "${HOMEPAGE}"
+	has_version sys-fs/aufs-util || \
+		elog "In order to use aufs FS you need to install sys-fs/aufs-util"
+
+	readme.gentoo_print_elog
+}
+
+pkg_postrm() {
+	kernel-2_pkg_postrm
+}

diff --git a/sys-kernel/aufs-sources/aufs-sources-4.19.0.ebuild b/sys-kernel/aufs-sources/aufs-sources-4.19.0.ebuild
new file mode 100644
index 0000000..4882884
--- /dev/null
+++ b/sys-kernel/aufs-sources/aufs-sources-4.19.0.ebuild
@@ -0,0 +1,84 @@
+# Copyright 1999-2018 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+ETYPE="sources"
+K_WANT_GENPATCHES="base extras experimental"
+K_GENPATCHES_VER=1
+UNIPATCH_STRICTORDER=1
+inherit kernel-2 eutils readme.gentoo-r1
+
+AUFS_VERSION=4.19_p20181029
+AUFS_TARBALL="aufs-sources-${AUFS_VERSION}.tar.xz"
+# git archive -v --remote=git://git.code.sf.net/p/aufs/aufs4-standalone aufs${AUFS_VERSION/_p*} > aufs-sources-${AUFS_VERSION}.tar
+AUFS_URI="https://dev.gentoo.org/~jlec/distfiles/${AUFS_TARBALL}"
+
+KEYWORDS="~amd64 ~x86"
+HOMEPAGE="https://dev.gentoo.org/~mpagano/genpatches http://aufs.sourceforge.net/"
+IUSE="experimental module vanilla"
+
+DESCRIPTION="Full sources (incl. Gentoo patchset) for the linux kernel tree and aufs4 support"
+SRC_URI="
+	${KERNEL_URI}
+	${ARCH_URI}
+	${AUFS_URI}
+	!vanilla? ( ${GENPATCHES_URI} )
+	"
+
+PDEPEND="=sys-fs/aufs-util-4*"
+
+README_GENTOO_SUFFIX="-r1"
+
+src_unpack() {
+	detect_version
+	detect_arch
+	if use vanilla; then
+		unset UNIPATCH_LIST_GENPATCHES UNIPATCH_LIST_DEFAULT
+		ewarn "You are using USE=vanilla"
+		ewarn "This will drop all support from the gentoo kernel security team"
+	fi
+
+	UNIPATCH_LIST="
+		"${WORKDIR}"/aufs4-kbuild.patch
+		"${WORKDIR}"/aufs4-base.patch
+		"${WORKDIR}"/aufs4-mmap.patch"
+
+	use module && UNIPATCH_LIST+=" "${WORKDIR}"/aufs4-standalone.patch"
+
+	unpack ${AUFS_TARBALL}
+
+	einfo "Using aufs4 version: ${AUFS_VERSION}"
+
+	kernel-2_src_unpack
+}
+
+src_prepare() {
+	kernel-2_src_prepare
+	if ! use module; then
+		sed -e 's:tristate:bool:g' -i "${WORKDIR}"/fs/aufs/Kconfig || die
+	fi
+	cp -f "${WORKDIR}"/include/uapi/linux/aufs_type.h include/uapi/linux/aufs_type.h || die
+	cp -rf "${WORKDIR}"/{Documentation,fs} . || die
+}
+
+src_install() {
+	kernel-2_src_install
+	dodoc "${WORKDIR}"/{aufs4-loopback,vfs-ino,tmpfs-idr}.patch
+	docompress -x /usr/share/doc/${PF}/{aufs4-loopback,vfs-ino,tmpfs-idr}.patch
+	readme.gentoo_create_doc
+}
+
+pkg_postinst() {
+	kernel-2_pkg_postinst
+	einfo "For more info on this patchset, and how to report problems, see:"
+	einfo "${HOMEPAGE}"
+	has_version sys-fs/aufs-util || \
+		elog "In order to use aufs FS you need to install sys-fs/aufs-util"
+
+	readme.gentoo_print_elog
+}
+
+pkg_postrm() {
+	kernel-2_pkg_postrm
+}

diff --git a/sys-kernel/aufs-sources/files/README.gentoo b/sys-kernel/aufs-sources/files/README.gentoo
new file mode 100644
index 0000000..d9afb84
--- /dev/null
+++ b/sys-kernel/aufs-sources/files/README.gentoo
@@ -0,0 +1,21 @@
+
+There several other patches in aufs3.
+They are all optional. When you meet some problems, they will help you. You 
+can find them in the documentation directory.
+
+	- aufs3-loopback.patch
+	  Supports a nested loopback mount in a branch-fs. This patch is
+	  unnecessary until aufs produces a message such like "you may want to try
+	  another patch for loopback file".
+
+	- vfs-ino.patch
+	  Modifies a system global kernel internal function get_next_ino() in
+	  order to stop assigning 0 for an inode-number. Not directly related to
+	  aufs, but recommended generally.
+
+	- tmpfs-ibitmap.patch/tmpfs-idr.patch
+	  Keeps the tmpfs inode number as the lowest value. Effective to reduce
+	  the size of aufs XINO files for tmpfs branch. Also it prevents the
+	  duplication of inode number, which is important for backup
+	  tools, aubrsync or other utilities. When you find aufs XINO files for
+	  tmpfs branch growing too much, try this patch.

diff --git a/sys-kernel/aufs-sources/files/README.gentoo-r1 b/sys-kernel/aufs-sources/files/README.gentoo-r1
new file mode 100644
index 0000000..d59b18d
--- /dev/null
+++ b/sys-kernel/aufs-sources/files/README.gentoo-r1
@@ -0,0 +1,21 @@
+
+There several other patches in aufs3.
+They are all optional. When you meet some problems, they will help you. You 
+can find them in the documentation directory.
+
+	- aufs3-loopback.patch
+	  Supports a nested loopback mount in a branch-fs. This patch is
+	  unnecessary until aufs produces a message such like "you may want to try
+	  another patch for loopback file".
+
+	- vfs-ino.patch
+	  Modifies a system global kernel internal function get_next_ino() in
+	  order to stop assigning 0 for an inode-number. Not directly related to
+	  aufs, but recommended generally.
+
+	- tmpfs-idr.patch
+	  Keeps the tmpfs inode number as the lowest value. Effective to reduce
+	  the size of aufs XINO files for tmpfs branch. Also it prevents the
+	  duplication of inode number, which is important for backup
+	  tools, aubrsync or other utilities. When you find aufs XINO files for
+	  tmpfs branch growing too much, try this patch.

diff --git a/sys-kernel/aufs-sources/metadata.xml b/sys-kernel/aufs-sources/metadata.xml
new file mode 100644
index 0000000..22b452c
--- /dev/null
+++ b/sys-kernel/aufs-sources/metadata.xml
@@ -0,0 +1,25 @@
+<?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>
+	<use>
+		<flag name="experimental">
+		Apply experimental patches; for more information, 
+		see "https://wiki.gentoo.org/wiki/Project:Kernel/Experimental".
+	</flag>
+		<flag name="module">
+		Patch kernel to allow aufs being build as a module.
+	</flag>
+		<flag name="vanilla">
+				Use vanilla kernel sources without applying genpatches. 
+		WARNING: This flag will drop all support from the Gentoo Kernel 
+		Security team
+	</flag>
+	</use>
+	<upstream>
+		<remote-id type="cpe">cpe:/o:linux:linux_kernel</remote-id>
+		<remote-id type="sourceforge">aufs</remote-id>
+	</upstream>
+</pkgmetadata>

diff --git a/sys-kernel/bliss-initramfs/bliss-initramfs-7.1.3.ebuild b/sys-kernel/bliss-initramfs/bliss-initramfs-7.1.3.ebuild
new file mode 100644
index 0000000..442f2fe
--- /dev/null
+++ b/sys-kernel/bliss-initramfs/bliss-initramfs-7.1.3.ebuild
@@ -0,0 +1,45 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+PYTHON_COMPAT=( python{3_4,3_5,3_6} )
+inherit python-single-r1
+
+GITHUB_USER="fearedbliss"
+GITHUB_REPO="bliss-initramfs"
+GITHUB_TAG="${PV}"
+
+DESCRIPTION="Boot your system's rootfs from ZFS, LVM, RAID, or a variety of other configs."
+HOMEPAGE="https://github.com/${GITHUB_USER}/${GITHUB_REPO}"
+SRC_URI="https://github.com/${GITHUB_USER}/${GITHUB_REPO}/archive/${GITHUB_TAG}.tar.gz -> ${P}.tar.gz"
+
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+RESTRICT="strip"
+LICENSE="BSD-2"
+SLOT="0"
+KEYWORDS="-* amd64"
+
+RDEPEND="
+	${PYTHON_DEPS}
+	app-arch/cpio
+	virtual/udev"
+
+S="${WORKDIR}/${GITHUB_REPO}-${GITHUB_TAG}"
+
+src_install() {
+	# Copy the main executable
+	local executable="mkinitrd.py"
+	exeinto "/opt/${PN}"
+	doexe "${executable}"
+
+	# Copy the libraries required by this executable
+	cp -r "${S}/files" "${D}/opt/${PN}" || die
+	cp -r "${S}/pkg" "${D}/opt/${PN}" || die
+
+	# Copy documentation files
+	dodoc README USAGE
+
+	# Make a symbolic link: /sbin/bliss-initramfs
+	dosym "${EPREFIX}/opt/${PN}/${executable}" "/sbin/${PN}"
+}

diff --git a/sys-kernel/bliss-initramfs/metadata.xml b/sys-kernel/bliss-initramfs/metadata.xml
new file mode 100644
index 0000000..b328d87
--- /dev/null
+++ b/sys-kernel/bliss-initramfs/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">fearedbliss/bliss-initramfs</remote-id>
+    </upstream>
+</pkgmetadata>

diff --git a/sys-kernel/ck-sources/ck-sources-4.14.63.ebuild b/sys-kernel/ck-sources/ck-sources-4.14.63.ebuild
new file mode 100644
index 0000000..a0c19c5
--- /dev/null
+++ b/sys-kernel/ck-sources/ck-sources-4.14.63.ebuild
@@ -0,0 +1,64 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+ETYPE="sources"
+KEYWORDS="~amd64 ~x86"
+
+HOMEPAGE="https://dev.gentoo.org/~mpagano/genpatches/
+	http://kernel.kolivas.org/"
+
+IUSE="experimental"
+
+K_WANT_GENPATCHES="base extras experimental"
+K_GENPATCHES_VER="69"
+K_SECURITY_UNSUPPORTED="1"
+K_DEBLOB_AVAILABLE="1"
+
+PYTHON_COMPAT=( python2_7 )
+inherit python-any-r1 kernel-2
+detect_version
+detect_arch
+
+DEPEND="deblob? ( ${PYTHON_DEPS} )"
+
+K_BRANCH_ID="${KV_MAJOR}.${KV_MINOR}"
+
+DESCRIPTION="Gentoo's genpatches for Linux ${K_BRANCH_ID}, with Con Kolivas' MuQSS process scheduler."
+
+MUQSS_VERSION="162"
+MUQSS_FILE="${K_BRANCH_ID}-sched-MuQSS_${MUQSS_VERSION}.patch"
+MUQSS_BASE_URL="http://ck.kolivas.org/patches/muqss/4.0"
+
+# clearly identify package name in distrdir
+MUQSS_DISTNAME="${PN}-${K_BRANCH_ID}-muqss.patch"
+
+CK_LVER_URL="${MUQSS_BASE_URL}/${K_BRANCH_ID}"
+CK_URI="${CK_LVER_URL}/${MUQSS_FILE} -> ${MUQSS_DISTNAME}"
+
+# Fix for: https://github.com/gentoo/gentoo/pull/6942
+BLKIO_HASH="25849740d77dfc089fdbfb53623e50d38a972aff"
+BLKIO_FILE="${PN}-4.14-blkio-fix.patch"
+BLKIO_URI="https://github.com/ckolivas/linux/commit/${BLKIO_HASH}.patch -> ${BLKIO_FILE}"
+
+# Upstream: https://github.com/ckolivas/linux/pull/9/
+IRQREGS_HASH="7bb09fbdf490f5de8eafc635ab858b1f38dca84c"
+IRQREGS_FILE="${PN}-4.14-irqregsdeclaration-fix.patch"
+IRQREGS_URI="https://github.com/ckolivas/linux/commit/${IRQREGS_HASH}.patch -> ${IRQREGS_FILE}"
+
+SRC_URI="${KERNEL_URI} ${GENPATCHES_URI} ${ARCH_URI} ${CK_URI} ${BLKIO_URI} ${IRQREGS_URI}"
+
+UNIPATCH_LIST="${DISTDIR}/${MUQSS_DISTNAME} ${DISTDIR}/${BLKIO_FILE} ${DISTDIR}/${IRQREGS_FILE}"
+UNIPATCH_STRICTORDER="yes"
+
+pkg_setup() {
+	use deblob && python-any-r1_pkg_setup
+	kernel-2_pkg_setup
+}
+
+pkg_postinst() {
+	elog "CPU optimizations patch (from genpatches) is off by default."
+	elog "Set USE=\"experimental\" if you need this patch / feature."
+	elog "This can be set in /etc/portage/package.use (or make.conf)"
+	elog "make menuconfig as usual to edit .config for this feature."
+}

diff --git a/sys-kernel/ck-sources/ck-sources-4.14.66.ebuild b/sys-kernel/ck-sources/ck-sources-4.14.66.ebuild
new file mode 100644
index 0000000..baa6ef3
--- /dev/null
+++ b/sys-kernel/ck-sources/ck-sources-4.14.66.ebuild
@@ -0,0 +1,64 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+ETYPE="sources"
+KEYWORDS="~amd64 ~x86"
+
+HOMEPAGE="https://dev.gentoo.org/~mpagano/genpatches/
+	http://kernel.kolivas.org/"
+
+IUSE="experimental"
+
+K_WANT_GENPATCHES="base extras experimental"
+K_GENPATCHES_VER="72"
+K_SECURITY_UNSUPPORTED="1"
+K_DEBLOB_AVAILABLE="1"
+
+PYTHON_COMPAT=( python2_7 )
+inherit python-any-r1 kernel-2
+detect_version
+detect_arch
+
+DEPEND="deblob? ( ${PYTHON_DEPS} )"
+
+K_BRANCH_ID="${KV_MAJOR}.${KV_MINOR}"
+
+DESCRIPTION="Gentoo's genpatches for Linux ${K_BRANCH_ID}, with Con Kolivas' MuQSS process scheduler."
+
+MUQSS_VERSION="162"
+MUQSS_FILE="${K_BRANCH_ID}-sched-MuQSS_${MUQSS_VERSION}.patch"
+MUQSS_BASE_URL="http://ck.kolivas.org/patches/muqss/4.0"
+
+# clearly identify package name in distrdir
+MUQSS_DISTNAME="${PN}-${K_BRANCH_ID}-muqss.patch"
+
+CK_LVER_URL="${MUQSS_BASE_URL}/${K_BRANCH_ID}"
+CK_URI="${CK_LVER_URL}/${MUQSS_FILE} -> ${MUQSS_DISTNAME}"
+
+# Fix for: https://github.com/gentoo/gentoo/pull/6942
+BLKIO_HASH="25849740d77dfc089fdbfb53623e50d38a972aff"
+BLKIO_FILE="${PN}-4.14-blkio-fix.patch"
+BLKIO_URI="https://github.com/ckolivas/linux/commit/${BLKIO_HASH}.patch -> ${BLKIO_FILE}"
+
+# Upstream: https://github.com/ckolivas/linux/pull/9/
+IRQREGS_HASH="7bb09fbdf490f5de8eafc635ab858b1f38dca84c"
+IRQREGS_FILE="${PN}-4.14-irqregsdeclaration-fix.patch"
+IRQREGS_URI="https://github.com/ckolivas/linux/commit/${IRQREGS_HASH}.patch -> ${IRQREGS_FILE}"
+
+SRC_URI="${KERNEL_URI} ${GENPATCHES_URI} ${ARCH_URI} ${CK_URI} ${BLKIO_URI} ${IRQREGS_URI}"
+
+UNIPATCH_LIST="${DISTDIR}/${MUQSS_DISTNAME} ${DISTDIR}/${BLKIO_FILE} ${DISTDIR}/${IRQREGS_FILE}"
+UNIPATCH_STRICTORDER="yes"
+
+pkg_setup() {
+	use deblob && python-any-r1_pkg_setup
+	kernel-2_pkg_setup
+}
+
+pkg_postinst() {
+	elog "CPU optimizations patch (from genpatches) is off by default."
+	elog "Set USE=\"experimental\" if you need this patch / feature."
+	elog "This can be set in /etc/portage/package.use (or make.conf)"
+	elog "make menuconfig as usual to edit .config for this feature."
+}

diff --git a/sys-kernel/ck-sources/ck-sources-4.14.67.ebuild b/sys-kernel/ck-sources/ck-sources-4.14.67.ebuild
new file mode 100644
index 0000000..19fdd21
--- /dev/null
+++ b/sys-kernel/ck-sources/ck-sources-4.14.67.ebuild
@@ -0,0 +1,64 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+ETYPE="sources"
+KEYWORDS="~amd64 ~x86"
+
+HOMEPAGE="https://dev.gentoo.org/~mpagano/genpatches/
+	http://kernel.kolivas.org/"
+
+IUSE="experimental"
+
+K_WANT_GENPATCHES="base extras experimental"
+K_GENPATCHES_VER="73"
+K_SECURITY_UNSUPPORTED="1"
+K_DEBLOB_AVAILABLE="1"
+
+PYTHON_COMPAT=( python2_7 )
+inherit python-any-r1 kernel-2
+detect_version
+detect_arch
+
+DEPEND="deblob? ( ${PYTHON_DEPS} )"
+
+K_BRANCH_ID="${KV_MAJOR}.${KV_MINOR}"
+
+DESCRIPTION="Gentoo's genpatches for Linux ${K_BRANCH_ID}, with Con Kolivas' MuQSS process scheduler."
+
+MUQSS_VERSION="162"
+MUQSS_FILE="${K_BRANCH_ID}-sched-MuQSS_${MUQSS_VERSION}.patch"
+MUQSS_BASE_URL="http://ck.kolivas.org/patches/muqss/4.0"
+
+# clearly identify package name in distrdir
+MUQSS_DISTNAME="${PN}-${K_BRANCH_ID}-muqss.patch"
+
+CK_LVER_URL="${MUQSS_BASE_URL}/${K_BRANCH_ID}"
+CK_URI="${CK_LVER_URL}/${MUQSS_FILE} -> ${MUQSS_DISTNAME}"
+
+# Fix for: https://github.com/gentoo/gentoo/pull/6942
+BLKIO_HASH="25849740d77dfc089fdbfb53623e50d38a972aff"
+BLKIO_FILE="${PN}-4.14-blkio-fix.patch"
+BLKIO_URI="https://github.com/ckolivas/linux/commit/${BLKIO_HASH}.patch -> ${BLKIO_FILE}"
+
+# Upstream: https://github.com/ckolivas/linux/pull/9/
+IRQREGS_HASH="7bb09fbdf490f5de8eafc635ab858b1f38dca84c"
+IRQREGS_FILE="${PN}-4.14-irqregsdeclaration-fix.patch"
+IRQREGS_URI="https://github.com/ckolivas/linux/commit/${IRQREGS_HASH}.patch -> ${IRQREGS_FILE}"
+
+SRC_URI="${KERNEL_URI} ${GENPATCHES_URI} ${ARCH_URI} ${CK_URI} ${BLKIO_URI} ${IRQREGS_URI}"
+
+UNIPATCH_LIST="${DISTDIR}/${MUQSS_DISTNAME} ${DISTDIR}/${BLKIO_FILE} ${DISTDIR}/${IRQREGS_FILE}"
+UNIPATCH_STRICTORDER="yes"
+
+pkg_setup() {
+	use deblob && python-any-r1_pkg_setup
+	kernel-2_pkg_setup
+}
+
+pkg_postinst() {
+	elog "CPU optimizations patch (from genpatches) is off by default."
+	elog "Set USE=\"experimental\" if you need this patch / feature."
+	elog "This can be set in /etc/portage/package.use (or make.conf)"
+	elog "make menuconfig as usual to edit .config for this feature."
+}

diff --git a/sys-kernel/ck-sources/ck-sources-4.14.69.ebuild b/sys-kernel/ck-sources/ck-sources-4.14.69.ebuild
new file mode 100644
index 0000000..911cc37
--- /dev/null
+++ b/sys-kernel/ck-sources/ck-sources-4.14.69.ebuild
@@ -0,0 +1,64 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+ETYPE="sources"
+KEYWORDS="~amd64 ~x86"
+
+HOMEPAGE="https://dev.gentoo.org/~mpagano/genpatches/
+	http://kernel.kolivas.org/"
+
+IUSE="experimental"
+
+K_WANT_GENPATCHES="base extras experimental"
+K_GENPATCHES_VER="75"
+K_SECURITY_UNSUPPORTED="1"
+K_DEBLOB_AVAILABLE="1"
+
+PYTHON_COMPAT=( python2_7 )
+inherit python-any-r1 kernel-2
+detect_version
+detect_arch
+
+DEPEND="deblob? ( ${PYTHON_DEPS} )"
+
+K_BRANCH_ID="${KV_MAJOR}.${KV_MINOR}"
+
+DESCRIPTION="Gentoo's genpatches for Linux ${K_BRANCH_ID}, with Con Kolivas' MuQSS process scheduler."
+
+MUQSS_VERSION="162"
+MUQSS_FILE="${K_BRANCH_ID}-sched-MuQSS_${MUQSS_VERSION}.patch"
+MUQSS_BASE_URL="http://ck.kolivas.org/patches/muqss/4.0"
+
+# clearly identify package name in distrdir
+MUQSS_DISTNAME="${PN}-${K_BRANCH_ID}-muqss.patch"
+
+CK_LVER_URL="${MUQSS_BASE_URL}/${K_BRANCH_ID}"
+CK_URI="${CK_LVER_URL}/${MUQSS_FILE} -> ${MUQSS_DISTNAME}"
+
+# Fix for: https://github.com/gentoo/gentoo/pull/6942
+BLKIO_HASH="25849740d77dfc089fdbfb53623e50d38a972aff"
+BLKIO_FILE="${PN}-4.14-blkio-fix.patch"
+BLKIO_URI="https://github.com/ckolivas/linux/commit/${BLKIO_HASH}.patch -> ${BLKIO_FILE}"
+
+# Upstream: https://github.com/ckolivas/linux/pull/9/
+IRQREGS_HASH="7bb09fbdf490f5de8eafc635ab858b1f38dca84c"
+IRQREGS_FILE="${PN}-4.14-irqregsdeclaration-fix.patch"
+IRQREGS_URI="https://github.com/ckolivas/linux/commit/${IRQREGS_HASH}.patch -> ${IRQREGS_FILE}"
+
+SRC_URI="${KERNEL_URI} ${GENPATCHES_URI} ${ARCH_URI} ${CK_URI} ${BLKIO_URI} ${IRQREGS_URI}"
+
+UNIPATCH_LIST="${DISTDIR}/${MUQSS_DISTNAME} ${DISTDIR}/${BLKIO_FILE} ${DISTDIR}/${IRQREGS_FILE}"
+UNIPATCH_STRICTORDER="yes"
+
+pkg_setup() {
+	use deblob && python-any-r1_pkg_setup
+	kernel-2_pkg_setup
+}
+
+pkg_postinst() {
+	elog "CPU optimizations patch (from genpatches) is off by default."
+	elog "Set USE=\"experimental\" if you need this patch / feature."
+	elog "This can be set in /etc/portage/package.use (or make.conf)"
+	elog "make menuconfig as usual to edit .config for this feature."
+}

diff --git a/sys-kernel/ck-sources/ck-sources-4.14.71.ebuild b/sys-kernel/ck-sources/ck-sources-4.14.71.ebuild
new file mode 100644
index 0000000..0a60f04
--- /dev/null
+++ b/sys-kernel/ck-sources/ck-sources-4.14.71.ebuild
@@ -0,0 +1,64 @@
+# Copyright 2018 kuzetsa℠ and others
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+ETYPE="sources"
+KEYWORDS="~amd64 ~x86"
+
+HOMEPAGE="https://dev.gentoo.org/~mpagano/genpatches/
+	http://kernel.kolivas.org/"
+
+IUSE="experimental"
+
+K_WANT_GENPATCHES="base extras experimental"
+K_GENPATCHES_VER="77"
+K_SECURITY_UNSUPPORTED="1"
+K_DEBLOB_AVAILABLE="1"
+
+PYTHON_COMPAT=( python2_7 )
+inherit python-any-r1 kernel-2
+detect_version
+detect_arch
+
+DEPEND="deblob? ( ${PYTHON_DEPS} )"
+
+K_BRANCH_ID="${KV_MAJOR}.${KV_MINOR}"
+
+DESCRIPTION="Gentoo's genpatches for Linux ${K_BRANCH_ID}, with Con Kolivas' MuQSS process scheduler."
+
+MUQSS_VERSION="162"
+MUQSS_FILE="${K_BRANCH_ID}-sched-MuQSS_${MUQSS_VERSION}.patch"
+MUQSS_BASE_URL="http://ck.kolivas.org/patches/muqss/4.0"
+
+# clearly identify package name in distrdir
+MUQSS_DISTNAME="${PN}-${K_BRANCH_ID}-muqss.patch"
+
+CK_LVER_URL="${MUQSS_BASE_URL}/${K_BRANCH_ID}"
+CK_URI="${CK_LVER_URL}/${MUQSS_FILE} -> ${MUQSS_DISTNAME}"
+
+# Fix for: https://github.com/gentoo/gentoo/pull/6942
+BLKIO_HASH="25849740d77dfc089fdbfb53623e50d38a972aff"
+BLKIO_FILE="${PN}-4.14-blkio-fix.patch"
+BLKIO_URI="https://github.com/ckolivas/linux/commit/${BLKIO_HASH}.patch -> ${BLKIO_FILE}"
+
+# Upstream: https://github.com/ckolivas/linux/pull/9/
+IRQREGS_HASH="7bb09fbdf490f5de8eafc635ab858b1f38dca84c"
+IRQREGS_FILE="${PN}-4.14-irqregsdeclaration-fix.patch"
+IRQREGS_URI="https://github.com/ckolivas/linux/commit/${IRQREGS_HASH}.patch -> ${IRQREGS_FILE}"
+
+SRC_URI="${KERNEL_URI} ${GENPATCHES_URI} ${ARCH_URI} ${CK_URI} ${BLKIO_URI} ${IRQREGS_URI}"
+
+UNIPATCH_LIST="${DISTDIR}/${MUQSS_DISTNAME} ${DISTDIR}/${BLKIO_FILE} ${DISTDIR}/${IRQREGS_FILE}"
+UNIPATCH_STRICTORDER="yes"
+
+pkg_setup() {
+	use deblob && python-any-r1_pkg_setup
+	kernel-2_pkg_setup
+}
+
+pkg_postinst() {
+	elog "CPU optimizations patch (from genpatches) is off by default."
+	elog "Set USE=\"experimental\" if you need this patch / feature."
+	elog "This can be set in /etc/portage/package.use (or make.conf)"
+	elog "make menuconfig as usual to edit .config for this feature."
+}

diff --git a/sys-kernel/ck-sources/ck-sources-4.14.73.ebuild b/sys-kernel/ck-sources/ck-sources-4.14.73.ebuild
new file mode 100644
index 0000000..9e4b49a
--- /dev/null
+++ b/sys-kernel/ck-sources/ck-sources-4.14.73.ebuild
@@ -0,0 +1,64 @@
+# Copyright 2018 kuzetsa℠ and others
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+ETYPE="sources"
+KEYWORDS="~amd64 ~x86"
+
+HOMEPAGE="https://dev.gentoo.org/~mpagano/genpatches/
+	http://kernel.kolivas.org/"
+
+IUSE="experimental"
+
+K_WANT_GENPATCHES="base extras experimental"
+K_GENPATCHES_VER="79"
+K_SECURITY_UNSUPPORTED="1"
+K_DEBLOB_AVAILABLE="1"
+
+PYTHON_COMPAT=( python2_7 )
+inherit python-any-r1 kernel-2
+detect_version
+detect_arch
+
+DEPEND="deblob? ( ${PYTHON_DEPS} )"
+
+K_BRANCH_ID="${KV_MAJOR}.${KV_MINOR}"
+
+DESCRIPTION="Gentoo's genpatches for Linux ${K_BRANCH_ID}, with Con Kolivas' MuQSS process scheduler."
+
+MUQSS_VERSION="162"
+MUQSS_FILE="${K_BRANCH_ID}-sched-MuQSS_${MUQSS_VERSION}.patch"
+MUQSS_BASE_URL="http://ck.kolivas.org/patches/muqss/4.0"
+
+# clearly identify package name in distrdir
+MUQSS_DISTNAME="${PN}-${K_BRANCH_ID}-muqss.patch"
+
+CK_LVER_URL="${MUQSS_BASE_URL}/${K_BRANCH_ID}"
+CK_URI="${CK_LVER_URL}/${MUQSS_FILE} -> ${MUQSS_DISTNAME}"
+
+# Fix for: https://github.com/gentoo/gentoo/pull/6942
+BLKIO_HASH="25849740d77dfc089fdbfb53623e50d38a972aff"
+BLKIO_FILE="${PN}-4.14-blkio-fix.patch"
+BLKIO_URI="https://github.com/ckolivas/linux/commit/${BLKIO_HASH}.patch -> ${BLKIO_FILE}"
+
+# Upstream: https://github.com/ckolivas/linux/pull/9/
+IRQREGS_HASH="7bb09fbdf490f5de8eafc635ab858b1f38dca84c"
+IRQREGS_FILE="${PN}-4.14-irqregsdeclaration-fix.patch"
+IRQREGS_URI="https://github.com/ckolivas/linux/commit/${IRQREGS_HASH}.patch -> ${IRQREGS_FILE}"
+
+SRC_URI="${KERNEL_URI} ${GENPATCHES_URI} ${ARCH_URI} ${CK_URI} ${BLKIO_URI} ${IRQREGS_URI}"
+
+UNIPATCH_LIST="${DISTDIR}/${MUQSS_DISTNAME} ${DISTDIR}/${BLKIO_FILE} ${DISTDIR}/${IRQREGS_FILE}"
+UNIPATCH_STRICTORDER="yes"
+
+pkg_setup() {
+	use deblob && python-any-r1_pkg_setup
+	kernel-2_pkg_setup
+}
+
+pkg_postinst() {
+	elog "CPU optimizations patch (from genpatches) is off by default."
+	elog "Set USE=\"experimental\" if you need this patch / feature."
+	elog "This can be set in /etc/portage/package.use (or make.conf)"
+	elog "make menuconfig as usual to edit .config for this feature."
+}

diff --git a/sys-kernel/ck-sources/ck-sources-4.14.75.ebuild b/sys-kernel/ck-sources/ck-sources-4.14.75.ebuild
new file mode 100644
index 0000000..1156a3a
--- /dev/null
+++ b/sys-kernel/ck-sources/ck-sources-4.14.75.ebuild
@@ -0,0 +1,57 @@
+# Copyright 2018 kuzetsa℠ and others
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+ETYPE="sources"
+KEYWORDS="~amd64 ~x86"
+
+HOMEPAGE="https://dev.gentoo.org/~mpagano/genpatches/
+	http://kernel.kolivas.org/"
+
+IUSE="experimental"
+
+K_WANT_GENPATCHES="base extras experimental"
+K_GENPATCHES_VER="81"
+K_SECURITY_UNSUPPORTED="1"
+K_DEBLOB_AVAILABLE="1"
+
+PYTHON_COMPAT=( python2_7 )
+inherit python-any-r1 kernel-2
+detect_version
+detect_arch
+
+DEPEND="deblob? ( ${PYTHON_DEPS} )"
+
+K_BRANCH_ID="${KV_MAJOR}.${KV_MINOR}"
+
+DESCRIPTION="Gentoo's genpatches for Linux ${K_BRANCH_ID}, with Con Kolivas' MuQSS process scheduler."
+
+MUQSS_VERSION="162"
+MUQSS_FILE="${K_BRANCH_ID}-sched-MuQSS_${MUQSS_VERSION}.patch"
+MUQSS_BASE_URL="http://ck.kolivas.org/patches/muqss/4.0"
+
+# clearly identify package name in distrdir
+MUQSS_DISTNAME="${PN}-${K_BRANCH_ID}-muqss.patch"
+
+CK_LVER_URL="${MUQSS_BASE_URL}/${K_BRANCH_ID}"
+CK_URI="${CK_LVER_URL}/${MUQSS_FILE} -> ${MUQSS_DISTNAME}"
+
+# Fix for: https://github.com/gentoo/gentoo/pull/6942
+BLKIO_HASH="25849740d77dfc089fdbfb53623e50d38a972aff"
+BLKIO_FILE="${PN}-4.14-blkio-fix.patch"
+BLKIO_URI="https://github.com/ckolivas/linux/commit/${BLKIO_HASH}.patch -> ${BLKIO_FILE}"
+
+# Upstream: https://github.com/ckolivas/linux/pull/9/
+IRQREGS_HASH="7bb09fbdf490f5de8eafc635ab858b1f38dca84c"
+IRQREGS_FILE="${PN}-4.14-irqregsdeclaration-fix.patch"
+IRQREGS_URI="https://github.com/ckolivas/linux/commit/${IRQREGS_HASH}.patch -> ${IRQREGS_FILE}"
+
+SRC_URI="${KERNEL_URI} ${GENPATCHES_URI} ${ARCH_URI} ${CK_URI} ${BLKIO_URI} ${IRQREGS_URI}"
+
+UNIPATCH_LIST="${DISTDIR}/${MUQSS_DISTNAME} ${DISTDIR}/${BLKIO_FILE} ${DISTDIR}/${IRQREGS_FILE}"
+UNIPATCH_STRICTORDER="yes"
+
+pkg_setup() {
+	use deblob && python-any-r1_pkg_setup
+	kernel-2_pkg_setup
+}

diff --git a/sys-kernel/ck-sources/ck-sources-4.14.78.ebuild b/sys-kernel/ck-sources/ck-sources-4.14.78.ebuild
new file mode 100644
index 0000000..712f46c
--- /dev/null
+++ b/sys-kernel/ck-sources/ck-sources-4.14.78.ebuild
@@ -0,0 +1,57 @@
+# Copyright 2018 kuzetsa℠ and others
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+ETYPE="sources"
+KEYWORDS="~amd64 ~x86"
+
+HOMEPAGE="https://dev.gentoo.org/~mpagano/genpatches/
+	http://kernel.kolivas.org/"
+
+IUSE="experimental"
+
+K_WANT_GENPATCHES="base extras experimental"
+K_GENPATCHES_VER="85"
+K_SECURITY_UNSUPPORTED="1"
+K_DEBLOB_AVAILABLE="1"
+
+PYTHON_COMPAT=( python2_7 )
+inherit python-any-r1 kernel-2
+detect_version
+detect_arch
+
+DEPEND="deblob? ( ${PYTHON_DEPS} )"
+
+K_BRANCH_ID="${KV_MAJOR}.${KV_MINOR}"
+
+DESCRIPTION="Gentoo's genpatches for Linux ${K_BRANCH_ID}, with Con Kolivas' MuQSS process scheduler."
+
+MUQSS_VERSION="162"
+MUQSS_FILE="${K_BRANCH_ID}-sched-MuQSS_${MUQSS_VERSION}.patch"
+MUQSS_BASE_URL="http://ck.kolivas.org/patches/muqss/4.0"
+
+# clearly identify package name in distrdir
+MUQSS_DISTNAME="${PN}-${K_BRANCH_ID}-muqss.patch"
+
+CK_LVER_URL="${MUQSS_BASE_URL}/${K_BRANCH_ID}"
+CK_URI="${CK_LVER_URL}/${MUQSS_FILE} -> ${MUQSS_DISTNAME}"
+
+# Fix for: https://github.com/gentoo/gentoo/pull/6942
+BLKIO_HASH="25849740d77dfc089fdbfb53623e50d38a972aff"
+BLKIO_FILE="${PN}-4.14-blkio-fix.patch"
+BLKIO_URI="https://github.com/ckolivas/linux/commit/${BLKIO_HASH}.patch -> ${BLKIO_FILE}"
+
+# Upstream: https://github.com/ckolivas/linux/pull/9/
+IRQREGS_HASH="7bb09fbdf490f5de8eafc635ab858b1f38dca84c"
+IRQREGS_FILE="${PN}-4.14-irqregsdeclaration-fix.patch"
+IRQREGS_URI="https://github.com/ckolivas/linux/commit/${IRQREGS_HASH}.patch -> ${IRQREGS_FILE}"
+
+SRC_URI="${KERNEL_URI} ${GENPATCHES_URI} ${ARCH_URI} ${CK_URI} ${BLKIO_URI} ${IRQREGS_URI}"
+
+UNIPATCH_LIST="${DISTDIR}/${MUQSS_DISTNAME} ${DISTDIR}/${BLKIO_FILE} ${DISTDIR}/${IRQREGS_FILE}"
+UNIPATCH_STRICTORDER="yes"
+
+pkg_setup() {
+	use deblob && python-any-r1_pkg_setup
+	kernel-2_pkg_setup
+}

diff --git a/sys-kernel/ck-sources/ck-sources-4.18.11.ebuild b/sys-kernel/ck-sources/ck-sources-4.18.11.ebuild
new file mode 100644
index 0000000..b009eb9
--- /dev/null
+++ b/sys-kernel/ck-sources/ck-sources-4.18.11.ebuild
@@ -0,0 +1,54 @@
+# Copyright 2018 kuzetsa℠ and others
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+ETYPE="sources"
+KEYWORDS="~amd64 ~x86"
+
+HOMEPAGE="https://dev.gentoo.org/~mpagano/genpatches/
+	http://kernel.kolivas.org/"
+
+IUSE="experimental"
+
+K_WANT_GENPATCHES="base extras experimental"
+K_GENPATCHES_VER="14"
+K_SECURITY_UNSUPPORTED="1"
+K_DEBLOB_AVAILABLE="1"
+
+PYTHON_COMPAT=( python2_7 )
+inherit python-any-r1 kernel-2
+detect_version
+detect_arch
+
+DEPEND="deblob? ( ${PYTHON_DEPS} )"
+
+K_BRANCH_ID="${KV_MAJOR}.${KV_MINOR}"
+
+DESCRIPTION="Gentoo's genpatches for Linux ${K_BRANCH_ID}, with Con Kolivas' MuQSS process scheduler."
+
+MUQSS_VERSION="173"
+MUQSS_FILE="0001-MultiQueue-Skiplist-Scheduler-version-v0.${MUQSS_VERSION}.patch"
+MUQSS_BASE_URL="http://ck.kolivas.org/patches/muqss/4.0"
+
+# clearly identify package name in distrdir
+MUQSS_DISTNAME="${PN}-${K_BRANCH_ID}-muqss.patch"
+
+CK_LVER_URL="${MUQSS_BASE_URL}/${K_BRANCH_ID}"
+CK_URI="${CK_LVER_URL}/${MUQSS_FILE} -> ${MUQSS_DISTNAME}"
+
+SRC_URI="${KERNEL_URI} ${GENPATCHES_URI} ${ARCH_URI} ${CK_URI}"
+
+UNIPATCH_LIST="${DISTDIR}/${MUQSS_DISTNAME}"
+UNIPATCH_STRICTORDER="yes"
+
+pkg_setup() {
+	use deblob && python-any-r1_pkg_setup
+	kernel-2_pkg_setup
+}
+
+pkg_postinst() {
+	elog "CPU optimizations patch (from genpatches) is off by default."
+	elog "Set USE=\"experimental\" if you need this patch / feature."
+	elog "This can be set in /etc/portage/package.use (or make.conf)"
+	elog "make menuconfig as usual to edit .config for this feature."
+}

diff --git a/sys-kernel/ck-sources/ck-sources-4.18.13.ebuild b/sys-kernel/ck-sources/ck-sources-4.18.13.ebuild
new file mode 100644
index 0000000..1c6f971
--- /dev/null
+++ b/sys-kernel/ck-sources/ck-sources-4.18.13.ebuild
@@ -0,0 +1,47 @@
+# Copyright 2018 kuzetsa℠ and others
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+ETYPE="sources"
+KEYWORDS="~amd64 ~x86"
+
+HOMEPAGE="https://dev.gentoo.org/~mpagano/genpatches/
+	http://kernel.kolivas.org/"
+
+IUSE="experimental"
+
+K_WANT_GENPATCHES="base extras experimental"
+K_GENPATCHES_VER="16"
+K_SECURITY_UNSUPPORTED="1"
+K_DEBLOB_AVAILABLE="1"
+
+PYTHON_COMPAT=( python2_7 )
+inherit python-any-r1 kernel-2
+detect_version
+detect_arch
+
+DEPEND="deblob? ( ${PYTHON_DEPS} )"
+
+K_BRANCH_ID="${KV_MAJOR}.${KV_MINOR}"
+
+DESCRIPTION="Gentoo's genpatches for Linux ${K_BRANCH_ID}, with Con Kolivas' MuQSS process scheduler."
+
+MUQSS_VERSION="173"
+MUQSS_FILE="0001-MultiQueue-Skiplist-Scheduler-version-v0.${MUQSS_VERSION}.patch"
+MUQSS_BASE_URL="http://ck.kolivas.org/patches/muqss/4.0"
+
+# clearly identify package name in distrdir
+MUQSS_DISTNAME="${PN}-${K_BRANCH_ID}-muqss.patch"
+
+CK_LVER_URL="${MUQSS_BASE_URL}/${K_BRANCH_ID}"
+CK_URI="${CK_LVER_URL}/${MUQSS_FILE} -> ${MUQSS_DISTNAME}"
+
+SRC_URI="${KERNEL_URI} ${GENPATCHES_URI} ${ARCH_URI} ${CK_URI}"
+
+UNIPATCH_LIST="${DISTDIR}/${MUQSS_DISTNAME}"
+UNIPATCH_STRICTORDER="yes"
+
+pkg_setup() {
+	use deblob && python-any-r1_pkg_setup
+	kernel-2_pkg_setup
+}

diff --git a/sys-kernel/ck-sources/ck-sources-4.18.16.ebuild b/sys-kernel/ck-sources/ck-sources-4.18.16.ebuild
new file mode 100644
index 0000000..044e8de
--- /dev/null
+++ b/sys-kernel/ck-sources/ck-sources-4.18.16.ebuild
@@ -0,0 +1,47 @@
+# Copyright 2018 kuzetsa℠ and others
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+ETYPE="sources"
+KEYWORDS="~amd64 ~x86"
+
+HOMEPAGE="https://dev.gentoo.org/~mpagano/genpatches/
+	http://kernel.kolivas.org/"
+
+IUSE="experimental"
+
+K_WANT_GENPATCHES="base extras experimental"
+K_GENPATCHES_VER="19"
+K_SECURITY_UNSUPPORTED="1"
+K_DEBLOB_AVAILABLE="1"
+
+PYTHON_COMPAT=( python2_7 )
+inherit python-any-r1 kernel-2
+detect_version
+detect_arch
+
+DEPEND="deblob? ( ${PYTHON_DEPS} )"
+
+K_BRANCH_ID="${KV_MAJOR}.${KV_MINOR}"
+
+DESCRIPTION="Gentoo's genpatches for Linux ${K_BRANCH_ID}, with Con Kolivas' MuQSS process scheduler."
+
+MUQSS_VERSION="173"
+MUQSS_FILE="0001-MultiQueue-Skiplist-Scheduler-version-v0.${MUQSS_VERSION}.patch"
+MUQSS_BASE_URL="http://ck.kolivas.org/patches/muqss/4.0"
+
+# clearly identify package name in distrdir
+MUQSS_DISTNAME="${PN}-${K_BRANCH_ID}-muqss.patch"
+
+CK_LVER_URL="${MUQSS_BASE_URL}/${K_BRANCH_ID}"
+CK_URI="${CK_LVER_URL}/${MUQSS_FILE} -> ${MUQSS_DISTNAME}"
+
+SRC_URI="${KERNEL_URI} ${GENPATCHES_URI} ${ARCH_URI} ${CK_URI}"
+
+UNIPATCH_LIST="${DISTDIR}/${MUQSS_DISTNAME}"
+UNIPATCH_STRICTORDER="yes"
+
+pkg_setup() {
+	use deblob && python-any-r1_pkg_setup
+	kernel-2_pkg_setup
+}

diff --git a/sys-kernel/ck-sources/ck-sources-4.18.5.ebuild b/sys-kernel/ck-sources/ck-sources-4.18.5.ebuild
new file mode 100644
index 0000000..b7c502b
--- /dev/null
+++ b/sys-kernel/ck-sources/ck-sources-4.18.5.ebuild
@@ -0,0 +1,54 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+ETYPE="sources"
+KEYWORDS="~amd64 ~x86"
+
+HOMEPAGE="https://dev.gentoo.org/~mpagano/genpatches/
+	http://kernel.kolivas.org/"
+
+IUSE="experimental"
+
+K_WANT_GENPATCHES="base extras experimental"
+K_GENPATCHES_VER="8"
+K_SECURITY_UNSUPPORTED="1"
+K_DEBLOB_AVAILABLE="1"
+
+PYTHON_COMPAT=( python2_7 )
+inherit python-any-r1 kernel-2
+detect_version
+detect_arch
+
+DEPEND="deblob? ( ${PYTHON_DEPS} )"
+
+K_BRANCH_ID="${KV_MAJOR}.${KV_MINOR}"
+
+DESCRIPTION="Gentoo's genpatches for Linux ${K_BRANCH_ID}, with Con Kolivas' MuQSS process scheduler."
+
+MUQSS_VERSION="173"
+MUQSS_FILE="0001-MultiQueue-Skiplist-Scheduler-version-v0.${MUQSS_VERSION}.patch"
+MUQSS_BASE_URL="http://ck.kolivas.org/patches/muqss/4.0"
+
+# clearly identify package name in distrdir
+MUQSS_DISTNAME="${PN}-${K_BRANCH_ID}-muqss.patch"
+
+CK_LVER_URL="${MUQSS_BASE_URL}/${K_BRANCH_ID}"
+CK_URI="${CK_LVER_URL}/${MUQSS_FILE} -> ${MUQSS_DISTNAME}"
+
+SRC_URI="${KERNEL_URI} ${GENPATCHES_URI} ${ARCH_URI} ${CK_URI}"
+
+UNIPATCH_LIST="${DISTDIR}/${MUQSS_DISTNAME}"
+UNIPATCH_STRICTORDER="yes"
+
+pkg_setup() {
+	use deblob && python-any-r1_pkg_setup
+	kernel-2_pkg_setup
+}
+
+pkg_postinst() {
+	elog "CPU optimizations patch (from genpatches) is off by default."
+	elog "Set USE=\"experimental\" if you need this patch / feature."
+	elog "This can be set in /etc/portage/package.use (or make.conf)"
+	elog "make menuconfig as usual to edit .config for this feature."
+}

diff --git a/sys-kernel/ck-sources/ck-sources-4.18.7.ebuild b/sys-kernel/ck-sources/ck-sources-4.18.7.ebuild
new file mode 100644
index 0000000..63fee71
--- /dev/null
+++ b/sys-kernel/ck-sources/ck-sources-4.18.7.ebuild
@@ -0,0 +1,54 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+ETYPE="sources"
+KEYWORDS="~amd64 ~x86"
+
+HOMEPAGE="https://dev.gentoo.org/~mpagano/genpatches/
+	http://kernel.kolivas.org/"
+
+IUSE="experimental"
+
+K_WANT_GENPATCHES="base extras experimental"
+K_GENPATCHES_VER="10"
+K_SECURITY_UNSUPPORTED="1"
+K_DEBLOB_AVAILABLE="1"
+
+PYTHON_COMPAT=( python2_7 )
+inherit python-any-r1 kernel-2
+detect_version
+detect_arch
+
+DEPEND="deblob? ( ${PYTHON_DEPS} )"
+
+K_BRANCH_ID="${KV_MAJOR}.${KV_MINOR}"
+
+DESCRIPTION="Gentoo's genpatches for Linux ${K_BRANCH_ID}, with Con Kolivas' MuQSS process scheduler."
+
+MUQSS_VERSION="173"
+MUQSS_FILE="0001-MultiQueue-Skiplist-Scheduler-version-v0.${MUQSS_VERSION}.patch"
+MUQSS_BASE_URL="http://ck.kolivas.org/patches/muqss/4.0"
+
+# clearly identify package name in distrdir
+MUQSS_DISTNAME="${PN}-${K_BRANCH_ID}-muqss.patch"
+
+CK_LVER_URL="${MUQSS_BASE_URL}/${K_BRANCH_ID}"
+CK_URI="${CK_LVER_URL}/${MUQSS_FILE} -> ${MUQSS_DISTNAME}"
+
+SRC_URI="${KERNEL_URI} ${GENPATCHES_URI} ${ARCH_URI} ${CK_URI}"
+
+UNIPATCH_LIST="${DISTDIR}/${MUQSS_DISTNAME}"
+UNIPATCH_STRICTORDER="yes"
+
+pkg_setup() {
+	use deblob && python-any-r1_pkg_setup
+	kernel-2_pkg_setup
+}
+
+pkg_postinst() {
+	elog "CPU optimizations patch (from genpatches) is off by default."
+	elog "Set USE=\"experimental\" if you need this patch / feature."
+	elog "This can be set in /etc/portage/package.use (or make.conf)"
+	elog "make menuconfig as usual to edit .config for this feature."
+}

diff --git a/sys-kernel/ck-sources/ck-sources-4.18.9.ebuild b/sys-kernel/ck-sources/ck-sources-4.18.9.ebuild
new file mode 100644
index 0000000..14f9f65
--- /dev/null
+++ b/sys-kernel/ck-sources/ck-sources-4.18.9.ebuild
@@ -0,0 +1,54 @@
+# Copyright 2018 kuzetsa℠ and others
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+ETYPE="sources"
+KEYWORDS="~amd64 ~x86"
+
+HOMEPAGE="https://dev.gentoo.org/~mpagano/genpatches/
+	http://kernel.kolivas.org/"
+
+IUSE="experimental"
+
+K_WANT_GENPATCHES="base extras experimental"
+K_GENPATCHES_VER="12"
+K_SECURITY_UNSUPPORTED="1"
+K_DEBLOB_AVAILABLE="1"
+
+PYTHON_COMPAT=( python2_7 )
+inherit python-any-r1 kernel-2
+detect_version
+detect_arch
+
+DEPEND="deblob? ( ${PYTHON_DEPS} )"
+
+K_BRANCH_ID="${KV_MAJOR}.${KV_MINOR}"
+
+DESCRIPTION="Gentoo's genpatches for Linux ${K_BRANCH_ID}, with Con Kolivas' MuQSS process scheduler."
+
+MUQSS_VERSION="173"
+MUQSS_FILE="0001-MultiQueue-Skiplist-Scheduler-version-v0.${MUQSS_VERSION}.patch"
+MUQSS_BASE_URL="http://ck.kolivas.org/patches/muqss/4.0"
+
+# clearly identify package name in distrdir
+MUQSS_DISTNAME="${PN}-${K_BRANCH_ID}-muqss.patch"
+
+CK_LVER_URL="${MUQSS_BASE_URL}/${K_BRANCH_ID}"
+CK_URI="${CK_LVER_URL}/${MUQSS_FILE} -> ${MUQSS_DISTNAME}"
+
+SRC_URI="${KERNEL_URI} ${GENPATCHES_URI} ${ARCH_URI} ${CK_URI}"
+
+UNIPATCH_LIST="${DISTDIR}/${MUQSS_DISTNAME}"
+UNIPATCH_STRICTORDER="yes"
+
+pkg_setup() {
+	use deblob && python-any-r1_pkg_setup
+	kernel-2_pkg_setup
+}
+
+pkg_postinst() {
+	elog "CPU optimizations patch (from genpatches) is off by default."
+	elog "Set USE=\"experimental\" if you need this patch / feature."
+	elog "This can be set in /etc/portage/package.use (or make.conf)"
+	elog "make menuconfig as usual to edit .config for this feature."
+}

diff --git a/sys-kernel/ck-sources/ck-sources-4.9.120.ebuild b/sys-kernel/ck-sources/ck-sources-4.9.120.ebuild
new file mode 100644
index 0000000..3f00921
--- /dev/null
+++ b/sys-kernel/ck-sources/ck-sources-4.9.120.ebuild
@@ -0,0 +1,59 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+ETYPE="sources"
+KEYWORDS="~amd64 ~x86"
+
+HOMEPAGE="https://dev.gentoo.org/~mpagano/genpatches/
+	http://kernel.kolivas.org/"
+
+IUSE="experimental"
+
+K_WANT_GENPATCHES="base extras experimental"
+K_GENPATCHES_VER="124"
+K_SECURITY_UNSUPPORTED="1"
+K_DEBLOB_AVAILABLE="1"
+
+PYTHON_COMPAT=( python2_7 )
+inherit python-any-r1 kernel-2
+detect_version
+detect_arch
+
+DEPEND="deblob? ( ${PYTHON_DEPS} )"
+
+K_BRANCH_ID="${KV_MAJOR}.${KV_MINOR}"
+
+DESCRIPTION="Gentoo's genpatches for Linux ${K_BRANCH_ID}, with Con Kolivas' MuQSS process scheduler."
+
+MUQSS_VERSION="150"
+MUQSS_FILE="${K_BRANCH_ID}-sched-MuQSS_${MUQSS_VERSION}.patch"
+MUQSS_BASE_URL="http://ck.kolivas.org/patches/muqss/4.0"
+
+# clearly identify package name in distrdir
+MUQSS_DISTNAME="${PN}-${K_BRANCH_ID}-muqss.patch"
+
+CK_LVER_URL="${MUQSS_BASE_URL}/${K_BRANCH_ID}"
+CK_URI="${CK_LVER_URL}/${MUQSS_FILE} -> ${MUQSS_DISTNAME}"
+
+# solves bug #606866 (Fix build for CONFIG_FREEZER disabled.x)
+FRZR_HASH="7de569950716147ed436b27936628ee3ab5b45cc"
+FRZR_FILE="${PN}-4.9-freezer-fix.patch"
+FRZR_URI="https://github.com/ckolivas/linux/commit/${FRZR_HASH}.patch -> ${FRZR_FILE}"
+
+SRC_URI="${KERNEL_URI} ${GENPATCHES_URI} ${ARCH_URI} ${CK_URI} ${FRZR_URI}"
+
+UNIPATCH_LIST="${DISTDIR}/${MUQSS_DISTNAME} ${DISTDIR}/${FRZR_FILE}"
+UNIPATCH_STRICTORDER="yes"
+
+pkg_setup() {
+	use deblob && python-any-r1_pkg_setup
+	kernel-2_pkg_setup
+}
+
+pkg_postinst() {
+	elog "CPU optimizations patch (from genpatches) is off by default."
+	elog "Set USE=\"experimental\" if you need this patch / feature."
+	elog "This can be set in /etc/portage/package.use (or make.conf)"
+	elog "make menuconfig as usual to edit .config for this feature."
+}

diff --git a/sys-kernel/ck-sources/ck-sources-4.9.123.ebuild b/sys-kernel/ck-sources/ck-sources-4.9.123.ebuild
new file mode 100644
index 0000000..95b48d8
--- /dev/null
+++ b/sys-kernel/ck-sources/ck-sources-4.9.123.ebuild
@@ -0,0 +1,59 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+ETYPE="sources"
+KEYWORDS="~amd64 ~x86"
+
+HOMEPAGE="https://dev.gentoo.org/~mpagano/genpatches/
+	http://kernel.kolivas.org/"
+
+IUSE="experimental"
+
+K_WANT_GENPATCHES="base extras experimental"
+K_GENPATCHES_VER="127"
+K_SECURITY_UNSUPPORTED="1"
+K_DEBLOB_AVAILABLE="1"
+
+PYTHON_COMPAT=( python2_7 )
+inherit python-any-r1 kernel-2
+detect_version
+detect_arch
+
+DEPEND="deblob? ( ${PYTHON_DEPS} )"
+
+K_BRANCH_ID="${KV_MAJOR}.${KV_MINOR}"
+
+DESCRIPTION="Gentoo's genpatches for Linux ${K_BRANCH_ID}, with Con Kolivas' MuQSS process scheduler."
+
+MUQSS_VERSION="150"
+MUQSS_FILE="${K_BRANCH_ID}-sched-MuQSS_${MUQSS_VERSION}.patch"
+MUQSS_BASE_URL="http://ck.kolivas.org/patches/muqss/4.0"
+
+# clearly identify package name in distrdir
+MUQSS_DISTNAME="${PN}-${K_BRANCH_ID}-muqss.patch"
+
+CK_LVER_URL="${MUQSS_BASE_URL}/${K_BRANCH_ID}"
+CK_URI="${CK_LVER_URL}/${MUQSS_FILE} -> ${MUQSS_DISTNAME}"
+
+# solves bug #606866 (Fix build for CONFIG_FREEZER disabled.x)
+FRZR_HASH="7de569950716147ed436b27936628ee3ab5b45cc"
+FRZR_FILE="${PN}-4.9-freezer-fix.patch"
+FRZR_URI="https://github.com/ckolivas/linux/commit/${FRZR_HASH}.patch -> ${FRZR_FILE}"
+
+SRC_URI="${KERNEL_URI} ${GENPATCHES_URI} ${ARCH_URI} ${CK_URI} ${FRZR_URI}"
+
+UNIPATCH_LIST="${DISTDIR}/${MUQSS_DISTNAME} ${DISTDIR}/${FRZR_FILE}"
+UNIPATCH_STRICTORDER="yes"
+
+pkg_setup() {
+	use deblob && python-any-r1_pkg_setup
+	kernel-2_pkg_setup
+}
+
+pkg_postinst() {
+	elog "CPU optimizations patch (from genpatches) is off by default."
+	elog "Set USE=\"experimental\" if you need this patch / feature."
+	elog "This can be set in /etc/portage/package.use (or make.conf)"
+	elog "make menuconfig as usual to edit .config for this feature."
+}

diff --git a/sys-kernel/ck-sources/ck-sources-4.9.124.ebuild b/sys-kernel/ck-sources/ck-sources-4.9.124.ebuild
new file mode 100644
index 0000000..b4e180d
--- /dev/null
+++ b/sys-kernel/ck-sources/ck-sources-4.9.124.ebuild
@@ -0,0 +1,59 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+ETYPE="sources"
+KEYWORDS="~amd64 ~x86"
+
+HOMEPAGE="https://dev.gentoo.org/~mpagano/genpatches/
+	http://kernel.kolivas.org/"
+
+IUSE="experimental"
+
+K_WANT_GENPATCHES="base extras experimental"
+K_GENPATCHES_VER="128"
+K_SECURITY_UNSUPPORTED="1"
+K_DEBLOB_AVAILABLE="1"
+
+PYTHON_COMPAT=( python2_7 )
+inherit python-any-r1 kernel-2
+detect_version
+detect_arch
+
+DEPEND="deblob? ( ${PYTHON_DEPS} )"
+
+K_BRANCH_ID="${KV_MAJOR}.${KV_MINOR}"
+
+DESCRIPTION="Gentoo's genpatches for Linux ${K_BRANCH_ID}, with Con Kolivas' MuQSS process scheduler."
+
+MUQSS_VERSION="150"
+MUQSS_FILE="${K_BRANCH_ID}-sched-MuQSS_${MUQSS_VERSION}.patch"
+MUQSS_BASE_URL="http://ck.kolivas.org/patches/muqss/4.0"
+
+# clearly identify package name in distrdir
+MUQSS_DISTNAME="${PN}-${K_BRANCH_ID}-muqss.patch"
+
+CK_LVER_URL="${MUQSS_BASE_URL}/${K_BRANCH_ID}"
+CK_URI="${CK_LVER_URL}/${MUQSS_FILE} -> ${MUQSS_DISTNAME}"
+
+# solves bug #606866 (Fix build for CONFIG_FREEZER disabled.x)
+FRZR_HASH="7de569950716147ed436b27936628ee3ab5b45cc"
+FRZR_FILE="${PN}-4.9-freezer-fix.patch"
+FRZR_URI="https://github.com/ckolivas/linux/commit/${FRZR_HASH}.patch -> ${FRZR_FILE}"
+
+SRC_URI="${KERNEL_URI} ${GENPATCHES_URI} ${ARCH_URI} ${CK_URI} ${FRZR_URI}"
+
+UNIPATCH_LIST="${DISTDIR}/${MUQSS_DISTNAME} ${DISTDIR}/${FRZR_FILE}"
+UNIPATCH_STRICTORDER="yes"
+
+pkg_setup() {
+	use deblob && python-any-r1_pkg_setup
+	kernel-2_pkg_setup
+}
+
+pkg_postinst() {
+	elog "CPU optimizations patch (from genpatches) is off by default."
+	elog "Set USE=\"experimental\" if you need this patch / feature."
+	elog "This can be set in /etc/portage/package.use (or make.conf)"
+	elog "make menuconfig as usual to edit .config for this feature."
+}

diff --git a/sys-kernel/ck-sources/ck-sources-4.9.126.ebuild b/sys-kernel/ck-sources/ck-sources-4.9.126.ebuild
new file mode 100644
index 0000000..4cc750c
--- /dev/null
+++ b/sys-kernel/ck-sources/ck-sources-4.9.126.ebuild
@@ -0,0 +1,59 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+ETYPE="sources"
+KEYWORDS="~amd64 ~x86"
+
+HOMEPAGE="https://dev.gentoo.org/~mpagano/genpatches/
+	http://kernel.kolivas.org/"
+
+IUSE="experimental"
+
+K_WANT_GENPATCHES="base extras experimental"
+K_GENPATCHES_VER="130"
+K_SECURITY_UNSUPPORTED="1"
+K_DEBLOB_AVAILABLE="1"
+
+PYTHON_COMPAT=( python2_7 )
+inherit python-any-r1 kernel-2
+detect_version
+detect_arch
+
+DEPEND="deblob? ( ${PYTHON_DEPS} )"
+
+K_BRANCH_ID="${KV_MAJOR}.${KV_MINOR}"
+
+DESCRIPTION="Gentoo's genpatches for Linux ${K_BRANCH_ID}, with Con Kolivas' MuQSS process scheduler."
+
+MUQSS_VERSION="150"
+MUQSS_FILE="${K_BRANCH_ID}-sched-MuQSS_${MUQSS_VERSION}.patch"
+MUQSS_BASE_URL="http://ck.kolivas.org/patches/muqss/4.0"
+
+# clearly identify package name in distrdir
+MUQSS_DISTNAME="${PN}-${K_BRANCH_ID}-muqss.patch"
+
+CK_LVER_URL="${MUQSS_BASE_URL}/${K_BRANCH_ID}"
+CK_URI="${CK_LVER_URL}/${MUQSS_FILE} -> ${MUQSS_DISTNAME}"
+
+# solves bug #606866 (Fix build for CONFIG_FREEZER disabled.x)
+FRZR_HASH="7de569950716147ed436b27936628ee3ab5b45cc"
+FRZR_FILE="${PN}-4.9-freezer-fix.patch"
+FRZR_URI="https://github.com/ckolivas/linux/commit/${FRZR_HASH}.patch -> ${FRZR_FILE}"
+
+SRC_URI="${KERNEL_URI} ${GENPATCHES_URI} ${ARCH_URI} ${CK_URI} ${FRZR_URI}"
+
+UNIPATCH_LIST="${DISTDIR}/${MUQSS_DISTNAME} ${DISTDIR}/${FRZR_FILE}"
+UNIPATCH_STRICTORDER="yes"
+
+pkg_setup() {
+	use deblob && python-any-r1_pkg_setup
+	kernel-2_pkg_setup
+}
+
+pkg_postinst() {
+	elog "CPU optimizations patch (from genpatches) is off by default."
+	elog "Set USE=\"experimental\" if you need this patch / feature."
+	elog "This can be set in /etc/portage/package.use (or make.conf)"
+	elog "make menuconfig as usual to edit .config for this feature."
+}

diff --git a/sys-kernel/ck-sources/ck-sources-4.9.128.ebuild b/sys-kernel/ck-sources/ck-sources-4.9.128.ebuild
new file mode 100644
index 0000000..41bbe58
--- /dev/null
+++ b/sys-kernel/ck-sources/ck-sources-4.9.128.ebuild
@@ -0,0 +1,59 @@
+# Copyright 2018 kuzetsa℠ and others
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+ETYPE="sources"
+KEYWORDS="~amd64 ~x86"
+
+HOMEPAGE="https://dev.gentoo.org/~mpagano/genpatches/
+	http://kernel.kolivas.org/"
+
+IUSE="experimental"
+
+K_WANT_GENPATCHES="base extras experimental"
+K_GENPATCHES_VER="132"
+K_SECURITY_UNSUPPORTED="1"
+K_DEBLOB_AVAILABLE="1"
+
+PYTHON_COMPAT=( python2_7 )
+inherit python-any-r1 kernel-2
+detect_version
+detect_arch
+
+DEPEND="deblob? ( ${PYTHON_DEPS} )"
+
+K_BRANCH_ID="${KV_MAJOR}.${KV_MINOR}"
+
+DESCRIPTION="Gentoo's genpatches for Linux ${K_BRANCH_ID}, with Con Kolivas' MuQSS process scheduler."
+
+MUQSS_VERSION="150"
+MUQSS_FILE="${K_BRANCH_ID}-sched-MuQSS_${MUQSS_VERSION}.patch"
+MUQSS_BASE_URL="http://ck.kolivas.org/patches/muqss/4.0"
+
+# clearly identify package name in distrdir
+MUQSS_DISTNAME="${PN}-${K_BRANCH_ID}-muqss.patch"
+
+CK_LVER_URL="${MUQSS_BASE_URL}/${K_BRANCH_ID}"
+CK_URI="${CK_LVER_URL}/${MUQSS_FILE} -> ${MUQSS_DISTNAME}"
+
+# solves bug #606866 (Fix build for CONFIG_FREEZER disabled.x)
+FRZR_HASH="7de569950716147ed436b27936628ee3ab5b45cc"
+FRZR_FILE="${PN}-4.9-freezer-fix.patch"
+FRZR_URI="https://github.com/ckolivas/linux/commit/${FRZR_HASH}.patch -> ${FRZR_FILE}"
+
+SRC_URI="${KERNEL_URI} ${GENPATCHES_URI} ${ARCH_URI} ${CK_URI} ${FRZR_URI}"
+
+UNIPATCH_LIST="${DISTDIR}/${MUQSS_DISTNAME} ${DISTDIR}/${FRZR_FILE}"
+UNIPATCH_STRICTORDER="yes"
+
+pkg_setup() {
+	use deblob && python-any-r1_pkg_setup
+	kernel-2_pkg_setup
+}
+
+pkg_postinst() {
+	elog "CPU optimizations patch (from genpatches) is off by default."
+	elog "Set USE=\"experimental\" if you need this patch / feature."
+	elog "This can be set in /etc/portage/package.use (or make.conf)"
+	elog "make menuconfig as usual to edit .config for this feature."
+}

diff --git a/sys-kernel/ck-sources/ck-sources-4.9.130.ebuild b/sys-kernel/ck-sources/ck-sources-4.9.130.ebuild
new file mode 100644
index 0000000..63e70f3
--- /dev/null
+++ b/sys-kernel/ck-sources/ck-sources-4.9.130.ebuild
@@ -0,0 +1,59 @@
+# Copyright 2018 kuzetsa℠ and others
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+ETYPE="sources"
+KEYWORDS="~amd64 ~x86"
+
+HOMEPAGE="https://dev.gentoo.org/~mpagano/genpatches/
+	http://kernel.kolivas.org/"
+
+IUSE="experimental"
+
+K_WANT_GENPATCHES="base extras experimental"
+K_GENPATCHES_VER="134"
+K_SECURITY_UNSUPPORTED="1"
+K_DEBLOB_AVAILABLE="1"
+
+PYTHON_COMPAT=( python2_7 )
+inherit python-any-r1 kernel-2
+detect_version
+detect_arch
+
+DEPEND="deblob? ( ${PYTHON_DEPS} )"
+
+K_BRANCH_ID="${KV_MAJOR}.${KV_MINOR}"
+
+DESCRIPTION="Gentoo's genpatches for Linux ${K_BRANCH_ID}, with Con Kolivas' MuQSS process scheduler."
+
+MUQSS_VERSION="150"
+MUQSS_FILE="${K_BRANCH_ID}-sched-MuQSS_${MUQSS_VERSION}.patch"
+MUQSS_BASE_URL="http://ck.kolivas.org/patches/muqss/4.0"
+
+# clearly identify package name in distrdir
+MUQSS_DISTNAME="${PN}-${K_BRANCH_ID}-muqss.patch"
+
+CK_LVER_URL="${MUQSS_BASE_URL}/${K_BRANCH_ID}"
+CK_URI="${CK_LVER_URL}/${MUQSS_FILE} -> ${MUQSS_DISTNAME}"
+
+# solves bug #606866 (Fix build for CONFIG_FREEZER disabled.x)
+FRZR_HASH="7de569950716147ed436b27936628ee3ab5b45cc"
+FRZR_FILE="${PN}-4.9-freezer-fix.patch"
+FRZR_URI="https://github.com/ckolivas/linux/commit/${FRZR_HASH}.patch -> ${FRZR_FILE}"
+
+SRC_URI="${KERNEL_URI} ${GENPATCHES_URI} ${ARCH_URI} ${CK_URI} ${FRZR_URI}"
+
+UNIPATCH_LIST="${DISTDIR}/${MUQSS_DISTNAME} ${DISTDIR}/${FRZR_FILE}"
+UNIPATCH_STRICTORDER="yes"
+
+pkg_setup() {
+	use deblob && python-any-r1_pkg_setup
+	kernel-2_pkg_setup
+}
+
+pkg_postinst() {
+	elog "CPU optimizations patch (from genpatches) is off by default."
+	elog "Set USE=\"experimental\" if you need this patch / feature."
+	elog "This can be set in /etc/portage/package.use (or make.conf)"
+	elog "make menuconfig as usual to edit .config for this feature."
+}

diff --git a/sys-kernel/ck-sources/ck-sources-4.9.132.ebuild b/sys-kernel/ck-sources/ck-sources-4.9.132.ebuild
new file mode 100644
index 0000000..7809ea8
--- /dev/null
+++ b/sys-kernel/ck-sources/ck-sources-4.9.132.ebuild
@@ -0,0 +1,52 @@
+# Copyright 2018 kuzetsa℠ and others
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+ETYPE="sources"
+KEYWORDS="~amd64 ~x86"
+
+HOMEPAGE="https://dev.gentoo.org/~mpagano/genpatches/
+	http://kernel.kolivas.org/"
+
+IUSE="experimental"
+
+K_WANT_GENPATCHES="base extras experimental"
+K_GENPATCHES_VER="136"
+K_SECURITY_UNSUPPORTED="1"
+K_DEBLOB_AVAILABLE="1"
+
+PYTHON_COMPAT=( python2_7 )
+inherit python-any-r1 kernel-2
+detect_version
+detect_arch
+
+DEPEND="deblob? ( ${PYTHON_DEPS} )"
+
+K_BRANCH_ID="${KV_MAJOR}.${KV_MINOR}"
+
+DESCRIPTION="Gentoo's genpatches for Linux ${K_BRANCH_ID}, with Con Kolivas' MuQSS process scheduler."
+
+MUQSS_VERSION="150"
+MUQSS_FILE="${K_BRANCH_ID}-sched-MuQSS_${MUQSS_VERSION}.patch"
+MUQSS_BASE_URL="http://ck.kolivas.org/patches/muqss/4.0"
+
+# clearly identify package name in distrdir
+MUQSS_DISTNAME="${PN}-${K_BRANCH_ID}-muqss.patch"
+
+CK_LVER_URL="${MUQSS_BASE_URL}/${K_BRANCH_ID}"
+CK_URI="${CK_LVER_URL}/${MUQSS_FILE} -> ${MUQSS_DISTNAME}"
+
+# solves bug #606866 (Fix build for CONFIG_FREEZER disabled.x)
+FRZR_HASH="7de569950716147ed436b27936628ee3ab5b45cc"
+FRZR_FILE="${PN}-4.9-freezer-fix.patch"
+FRZR_URI="https://github.com/ckolivas/linux/commit/${FRZR_HASH}.patch -> ${FRZR_FILE}"
+
+SRC_URI="${KERNEL_URI} ${GENPATCHES_URI} ${ARCH_URI} ${CK_URI} ${FRZR_URI}"
+
+UNIPATCH_LIST="${DISTDIR}/${MUQSS_DISTNAME} ${DISTDIR}/${FRZR_FILE}"
+UNIPATCH_STRICTORDER="yes"
+
+pkg_setup() {
+	use deblob && python-any-r1_pkg_setup
+	kernel-2_pkg_setup
+}

diff --git a/sys-kernel/ck-sources/ck-sources-4.9.135.ebuild b/sys-kernel/ck-sources/ck-sources-4.9.135.ebuild
new file mode 100644
index 0000000..4e9d7c1
--- /dev/null
+++ b/sys-kernel/ck-sources/ck-sources-4.9.135.ebuild
@@ -0,0 +1,52 @@
+# Copyright 2018 kuzetsa℠ and others
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+ETYPE="sources"
+KEYWORDS="~amd64 ~x86"
+
+HOMEPAGE="https://dev.gentoo.org/~mpagano/genpatches/
+	http://kernel.kolivas.org/"
+
+IUSE="experimental"
+
+K_WANT_GENPATCHES="base extras experimental"
+K_GENPATCHES_VER="139"
+K_SECURITY_UNSUPPORTED="1"
+K_DEBLOB_AVAILABLE="1"
+
+PYTHON_COMPAT=( python2_7 )
+inherit python-any-r1 kernel-2
+detect_version
+detect_arch
+
+DEPEND="deblob? ( ${PYTHON_DEPS} )"
+
+K_BRANCH_ID="${KV_MAJOR}.${KV_MINOR}"
+
+DESCRIPTION="Gentoo's genpatches for Linux ${K_BRANCH_ID}, with Con Kolivas' MuQSS process scheduler."
+
+MUQSS_VERSION="150"
+MUQSS_FILE="${K_BRANCH_ID}-sched-MuQSS_${MUQSS_VERSION}.patch"
+MUQSS_BASE_URL="http://ck.kolivas.org/patches/muqss/4.0"
+
+# clearly identify package name in distrdir
+MUQSS_DISTNAME="${PN}-${K_BRANCH_ID}-muqss.patch"
+
+CK_LVER_URL="${MUQSS_BASE_URL}/${K_BRANCH_ID}"
+CK_URI="${CK_LVER_URL}/${MUQSS_FILE} -> ${MUQSS_DISTNAME}"
+
+# solves bug #606866 (Fix build for CONFIG_FREEZER disabled.x)
+FRZR_HASH="7de569950716147ed436b27936628ee3ab5b45cc"
+FRZR_FILE="${PN}-4.9-freezer-fix.patch"
+FRZR_URI="https://github.com/ckolivas/linux/commit/${FRZR_HASH}.patch -> ${FRZR_FILE}"
+
+SRC_URI="${KERNEL_URI} ${GENPATCHES_URI} ${ARCH_URI} ${CK_URI} ${FRZR_URI}"
+
+UNIPATCH_LIST="${DISTDIR}/${MUQSS_DISTNAME} ${DISTDIR}/${FRZR_FILE}"
+UNIPATCH_STRICTORDER="yes"
+
+pkg_setup() {
+	use deblob && python-any-r1_pkg_setup
+	kernel-2_pkg_setup
+}

diff --git a/sys-kernel/ck-sources/metadata.xml b/sys-kernel/ck-sources/metadata.xml
new file mode 100644
index 0000000..3dcc977
--- /dev/null
+++ b/sys-kernel/ck-sources/metadata.xml
@@ -0,0 +1,26 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+  <maintainer type="person">
+    <email>kuzetsa@poindexter.ovh</email>
+    <name>Sarah White</name>
+  </maintainer>
+  <maintainer type="person">
+    <email>gokturk@gentoo.org</email>
+    <name>Göktürk Yüksek</name>
+  </maintainer>
+  <maintainer type="project">
+    <email>proxy-maint@gentoo.org</email>
+    <name>Proxy Maintainers</name>
+  </maintainer>
+  <use>
+    <flag name="deblob">Remove binary blobs from kernel sources to provide
+      libre license compliance.
+    </flag>
+    <flag name="experimental">Apply experimental patches; for more information, see "https://wiki.gentoo.org/wiki/Project:Kernel/Experimental".</flag>
+  </use>
+  <upstream>
+    <remote-id type="cpe">cpe:/o:linux:linux_kernel</remote-id>
+    <remote-id type="github">ckolivas/linux</remote-id>
+  </upstream>
+</pkgmetadata>

diff --git a/sys-kernel/cryptodev/cryptodev-1.9.ebuild b/sys-kernel/cryptodev/cryptodev-1.9.ebuild
new file mode 100644
index 0000000..7ac492c
--- /dev/null
+++ b/sys-kernel/cryptodev/cryptodev-1.9.ebuild
@@ -0,0 +1,56 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+inherit linux-info linux-mod
+
+DESCRIPTION="device that allows access to Linux kernel cryptographic drivers"
+HOMEPAGE="http://cryptodev-linux.org/index.html"
+SRC_URI="http://nwl.cc/pub/cryptodev-linux/${PN}-linux-${PV}.tar.gz"
+KEYWORDS="~amd64 ~arm ~x86"
+
+LICENSE="GPL-2+"
+SLOT="0"
+IUSE="examples"
+
+DEPEND="virtual/linux-sources"
+
+#test requires that the module is already loaded
+RESTRICT="test"
+
+S=${WORKDIR}/${PN}-linux-${PV}
+
+MODULE_NAMES="cryptodev(extra:${S})"
+BUILD_PARAMS="KERNEL_DIR=\"\${KV_OUT_DIR}\""
+
+PATCHES=(
+	"${FILESDIR}"/cryptodev-1.9-fix-build-with-4.14-629958.patch
+	"${FILESDIR}"/ioctl.c-Fix-build-with-linux-4.17.patch
+)
+
+pkg_pretend() {
+	if use kernel_linux ; then
+		CONFIG_CHECK="~CRYPTO ~CRYPTO_BLKCIPHER ~CRYPTO_AEAD"
+		check_extra_config
+	fi
+}
+
+pkg_setup() {
+	if use kernel_linux ; then
+		linux-mod_pkg_setup
+	else
+		die "cryptodev ebuild only support linux"
+	fi
+	BUILD_TARGETS="build"
+	export KERNEL_DIR
+}
+
+src_install() {
+	linux-mod_src_install
+	if use examples ; then
+		docinto examples
+		dodoc example/*
+	fi
+	insinto /usr/include/crypto
+	doins crypto/cryptodev.h
+}

diff --git a/sys-kernel/cryptodev/cryptodev-9999.ebuild b/sys-kernel/cryptodev/cryptodev-9999.ebuild
new file mode 100644
index 0000000..9718273
--- /dev/null
+++ b/sys-kernel/cryptodev/cryptodev-9999.ebuild
@@ -0,0 +1,57 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+inherit linux-info linux-mod
+
+DESCRIPTION="device that allows access to Linux kernel cryptographic drivers"
+HOMEPAGE="http://cryptodev-linux.org/index.html"
+
+if [[ ${PV} == 9999 ]]; then
+	inherit git-r3
+	EGIT_REPO_URI="https://github.com/cryptodev-linux/cryptodev-linux.git"
+	S="${WORKDIR}/${PN}-${PV}"
+else
+	SRC_URI="http://nwl.cc/pub/cryptodev-linux/${PN}-linux-${PV}.tar.gz"
+	KEYWORDS="~amd64 ~arm ~x86"
+	S=${WORKDIR}/${PN}-linux-${PV}
+fi
+
+LICENSE="GPL-2+"
+SLOT="0"
+IUSE="examples"
+
+DEPEND="virtual/linux-sources"
+
+#test requires that the module is already loaded
+RESTRICT="test"
+
+MODULE_NAMES="cryptodev(extra:${S})"
+BUILD_PARAMS="KERNEL_DIR=\"\${KV_OUT_DIR}\""
+
+pkg_pretend() {
+	if use kernel_linux ; then
+		CONFIG_CHECK="~CRYPTO ~CRYPTO_BLKCIPHER ~CRYPTO_AEAD"
+		check_extra_config
+	fi
+}
+
+pkg_setup() {
+	if use kernel_linux ; then
+		linux-mod_pkg_setup
+	else
+		die "cryptodev ebuild only support linux"
+	fi
+	BUILD_TARGETS="build"
+	export KERNEL_DIR
+}
+
+src_install() {
+	linux-mod_src_install
+	if use examples ; then
+		docinto examples
+		dodoc example/*
+	fi
+	insinto /usr/include/crypto
+	doins crypto/cryptodev.h
+}

diff --git a/sys-kernel/cryptodev/files/cryptodev-1.9-fix-build-with-4.14-629958.patch b/sys-kernel/cryptodev/files/cryptodev-1.9-fix-build-with-4.14-629958.patch
new file mode 100644
index 0000000..8a78d5e
--- /dev/null
+++ b/sys-kernel/cryptodev/files/cryptodev-1.9-fix-build-with-4.14-629958.patch
@@ -0,0 +1,44 @@
+From f0d69774afb27ffc62bf353465fba145e70cb85a Mon Sep 17 00:00:00 2001
+From: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
+Date: Mon, 4 Sep 2017 11:05:08 +0200
+Subject: [PATCH] ioctl.c: Fix build with linux 4.13
+
+git/ioctl.c:1127:3: error: positional initialization of field in 'struct' declared with 'designated_init' attribute [-Werror=designated-init]
+   {0, },
+    ^
+note: (near initialization for 'verbosity_ctl_dir[1]')
+git/ioctl.c:1136:3: error: positional initialization of field in 'struct' declared with 'designated_init' attribute [-Werror=designated-init]
+   {0, },
+    ^
+
+Linux kernel has added -Werror=designated-init around 4.11 (c834f0e8a8b)
+triggering build errors with gcc 5 and 6 (but not with gcc 4)
+
+Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
+Signed-off-by: Cristian Stoica <cristian.stoica@nxp.com>
+---
+ ioctl.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/ioctl.c b/ioctl.c
+index 0385203..8d4a162 100644
+--- a/ioctl.c
++++ b/ioctl.c
+@@ -1124,7 +1124,7 @@ static struct ctl_table verbosity_ctl_dir[] = {
+ 		.mode           = 0644,
+ 		.proc_handler   = proc_dointvec,
+ 	},
+-	{0, },
++	{},
+ };
+ 
+ static struct ctl_table verbosity_ctl_root[] = {
+@@ -1133,7 +1133,7 @@ static struct ctl_table verbosity_ctl_root[] = {
+ 		.mode           = 0555,
+ 		.child          = verbosity_ctl_dir,
+ 	},
+-	{0, },
++	{},
+ };
+ static struct ctl_table_header *verbosity_sysctl_header;
+ static int __init init_cryptodev(void)

diff --git a/sys-kernel/cryptodev/files/ioctl.c-Fix-build-with-linux-4.17.patch b/sys-kernel/cryptodev/files/ioctl.c-Fix-build-with-linux-4.17.patch
new file mode 100644
index 0000000..3eb81e4
--- /dev/null
+++ b/sys-kernel/cryptodev/files/ioctl.c-Fix-build-with-linux-4.17.patch
@@ -0,0 +1,39 @@
+From f60aa08c63fc02780554a0a12180a478ca27d49f Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Horia=20Geant=C4=83?= <horia.geanta@nxp.com>
+Date: Wed, 23 May 2018 18:43:39 +0300
+Subject: [PATCH] ioctl.c: Fix build with linux 4.17
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Since kernel 4.17-rc1, sys_* syscalls can no longer be called directly:
+819671ff849b ("syscalls: define and explain goal to not call syscalls in the kernel")
+
+Since cryptodev uses sys_close() - and this has been removed in commit:
+2ca2a09d6215 ("fs: add ksys_close() wrapper; remove in-kernel calls to sys_close()")
+cryptodev has to be updated to use the ksys_close() wrapper.
+
+Signed-off-by: Horia Geantă <horia.geanta@nxp.com>
+---
+ ioctl.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/ioctl.c b/ioctl.c
+index d831b0c..2571034 100644
+--- a/ioctl.c
++++ b/ioctl.c
+@@ -828,7 +828,11 @@ cryptodev_ioctl(struct file *filp, unsigned int cmd, unsigned long arg_)
+ 		fd = clonefd(filp);
+ 		ret = put_user(fd, p);
+ 		if (unlikely(ret)) {
++#if (LINUX_VERSION_CODE < KERNEL_VERSION(4, 17, 0))
+ 			sys_close(fd);
++#else
++			ksys_close(fd);
++#endif
+ 			return ret;
+ 		}
+ 		return ret;
+-- 
+2.16.4
+

diff --git a/sys-kernel/cryptodev/metadata.xml b/sys-kernel/cryptodev/metadata.xml
new file mode 100644
index 0000000..c7bb627
--- /dev/null
+++ b/sys-kernel/cryptodev/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>swegener@gentoo.org</email>
+		<name>Sven Wegener</name>
+	</maintainer>
+</pkgmetadata>

diff --git a/sys-kernel/dracut-crypt-ssh/dracut-crypt-ssh-1.0.6-r1.ebuild b/sys-kernel/dracut-crypt-ssh/dracut-crypt-ssh-1.0.6-r1.ebuild
new file mode 100644
index 0000000..9ec7b6f
--- /dev/null
+++ b/sys-kernel/dracut-crypt-ssh/dracut-crypt-ssh-1.0.6-r1.ebuild
@@ -0,0 +1,20 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+DESCRIPTION="early unlocking of encrypted systems via ssh for dracut"
+HOMEPAGE="https://github.com/dracut-crypt-ssh/dracut-crypt-ssh"
+SRC_URI="https://github.com/${PN}/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+DEPEND="sys-kernel/dracut"
+RDEPEND="${DEPEND}
+	net-misc/dhcp
+	net-misc/dropbear"
+
+DOCS=("README.md")

diff --git a/sys-kernel/dracut-crypt-ssh/metadata.xml b/sys-kernel/dracut-crypt-ssh/metadata.xml
new file mode 100644
index 0000000..41b596c
--- /dev/null
+++ b/sys-kernel/dracut-crypt-ssh/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>gentoo@asgar.de</email>
+		<name>Christian Baumhof</name>
+	</maintainer>
+	<maintainer type="project">
+		<email>proxy-maint@gentoo.org</email>
+		<name>Proxy Maintainers</name>
+	</maintainer> 
+<longdescription lang="en">
+crypt-ssh is a dracut module which allows remote unlocking of block devices encrypted with LUKS via ssh, during the initramfs stage of the boot.
+</longdescription>
+</pkgmetadata>

diff --git a/sys-kernel/dracut/dracut-044-r1.ebuild b/sys-kernel/dracut/dracut-044-r1.ebuild
new file mode 100644
index 0000000..d3f5fbf
--- /dev/null
+++ b/sys-kernel/dracut/dracut-044-r1.ebuild
@@ -0,0 +1,259 @@
+# Copyright 1999-2018 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+inherit bash-completion-r1 eutils linux-info multilib systemd
+
+DESCRIPTION="Generic initramfs generation tool"
+HOMEPAGE="https://dracut.wiki.kernel.org"
+SRC_URI="mirror://kernel/linux/utils/boot/${PN}/${P}.tar.xz"
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="alpha amd64 ~arm ia64 ppc ~ppc64 sparc x86"
+IUSE="debug selinux systemd"
+
+RESTRICT="test"
+
+CDEPEND="virtual/udev
+	systemd? ( >=sys-apps/systemd-199 )
+	"
+RDEPEND="${CDEPEND}
+	app-arch/cpio
+	>=app-shells/bash-4.0
+	>sys-apps/kmod-5[tools]
+	|| (
+		>=sys-apps/sysvinit-2.87-r3
+		sys-apps/systemd[sysv-utils]
+	)
+	>=sys-apps/util-linux-2.21
+
+	debug? ( dev-util/strace )
+	selinux? (
+		sys-libs/libselinux
+		sys-libs/libsepol
+		sec-policy/selinux-dracut
+	)
+	!>=app-shells/bash-4.4"
+DEPEND="${CDEPEND}
+	app-text/asciidoc
+	>=dev-libs/libxslt-1.1.26
+	app-text/docbook-xml-dtd:4.5
+	>=app-text/docbook-xsl-stylesheets-1.75.2
+	virtual/pkgconfig
+	"
+
+DOCS=( AUTHORS HACKING NEWS README README.generic README.kernel README.modules
+	README.testsuite TODO )
+MY_LIBDIR=/usr/lib
+QA_MULTILIB_PATHS="
+	usr/lib/dracut/dracut-install
+	usr/lib/dracut/skipcpio
+	"
+
+PATCHES=(
+	"${FILESDIR}"/044-0001-base-dracut-lib.sh-dev_unit_name-guard-against-dev-b.patch
+	"${FILESDIR}"/044-0002-systemd-initrd-add-initrd-root-device.target.patch
+	"${FILESDIR}"/044-0003-50-dracut.install-use-bin-bash-shebang.patch
+)
+
+#
+# Helper functions
+#
+
+# Removes module from modules.d.
+# $1 = module name
+# Module name can be specified without number prefix.
+rm_module() {
+	local force m
+	[[ $1 = -f ]] && force=-f
+
+	for m in $@; do
+		if [[ $m =~ ^[0-9][0-9][^\ ]*$ ]]; then
+			rm ${force} --interactive=never -r "${modules_dir}"/$m
+		else
+			rm ${force} --interactive=never -r "${modules_dir}"/[0-9][0-9]$m
+		fi
+	done
+}
+
+src_prepare() {
+	local libdirs="/$(get_libdir) /usr/$(get_libdir)"
+	if [[ ${SYMLINK_LIB} = yes ]]; then
+		# Preserve lib -> lib64 symlinks in initramfs
+		[[ $libdirs =~ /lib\  ]] || libdirs+=" /lib /usr/lib"
+	fi
+	einfo "Setting libdirs to \"${libdirs}\" ..."
+	sed -e "3alibdirs=\"${libdirs}\"" \
+		-i "${S}/dracut.conf.d/gentoo.conf.example" || die
+
+	local udevdir="$("$(tc-getPKG_CONFIG)" udev --variable=udevdir)"
+	einfo "Setting udevdir to ${udevdir}..."
+	sed -r -e "s|^(udevdir=).*$|\1${udevdir}|" \
+			-i "${S}/dracut.conf.d/gentoo.conf.example" || die
+
+	if use systemd; then
+		local systemdutildir="$(systemd_get_utildir)"
+		local systemdsystemunitdir="$(systemd_get_unitdir)"
+		local systemdsystemconfdir="$("$(tc-getPKG_CONFIG)" systemd \
+			--variable=systemdsystemconfdir)"
+		[[ ${systemdsystemconfdir} ]] \
+			|| systemdsystemconfdir=/etc/systemd/system
+		einfo "Setting systemdutildir to ${systemdutildir} and ..."
+		sed -e "5asystemdutildir=\"${systemdutildir}\"" \
+			-i "${S}/dracut.conf.d/gentoo.conf.example" || die
+		einfo "Setting systemdsystemunitdir to ${systemdsystemunitdir} and..."
+		sed -e "6asystemdsystemunitdir=\"${systemdsystemunitdir}\"" \
+			-i "${S}/dracut.conf.d/gentoo.conf.example" || die
+		einfo "Setting systemdsystemconfdir to ${systemdsystemconfdir}..."
+		sed -e "7asystemdsystemconfdir=\"${systemdsystemconfdir}\"" \
+			-i "${S}/dracut.conf.d/gentoo.conf.example" || die
+	else
+		local systemdutildir="/lib/systemd"
+		einfo "Setting systemdutildir for standalone udev to" \
+			"${systemdutildir}..."
+		sed -e "5asystemdutildir=\"${systemdutildir}\"" \
+			-i "${S}/dracut.conf.d/gentoo.conf.example" || die
+	fi
+
+	epatch "${PATCHES[@]}"
+
+	epatch_user
+}
+
+src_configure() {
+	local myconf=(
+		--libdir="${MY_LIBDIR}"
+		--bashcompletiondir="$(get_bashcompdir)"
+	)
+
+	if use systemd; then
+		myconf+=( --systemdsystemunitdir="$(systemd_get_unitdir)" )
+	fi
+
+	econf "${myconf[@]}"
+}
+
+src_compile() {
+	tc-export CC
+	emake doc install/dracut-install skipcpio/skipcpio
+}
+
+src_install() {
+	default
+
+	local my_libdir="${MY_LIBDIR}"
+	local dracutlibdir="${my_libdir#/}/dracut"
+
+	echo "DRACUT_VERSION=$PVR" > "${D%/}/${dracutlibdir}/dracut-version.sh"
+
+	insinto "${dracutlibdir}/dracut.conf.d/"
+	newins dracut.conf.d/gentoo.conf.example gentoo.conf
+
+	insinto /etc/logrotate.d
+	newins dracut.logrotate dracut
+
+	dodir /var/lib/dracut/overlay
+
+	dohtml dracut.html
+
+	if ! use systemd; then
+		# Scripts in kernel/install.d are systemd-specific
+		rm -r "${D%/}/${my_libdir}/kernel" || die
+	fi
+
+	#
+	# Modules
+	#
+	local module
+	modules_dir="${D%/}/${dracutlibdir}/modules.d"
+
+	use debug || rm_module 95debug
+	use selinux || rm_module 98selinux
+
+	if use systemd; then
+		# With systemd following modules do not make sense
+		rm_module 96securityfs 97masterkey 98integrity
+	else
+		rm_module 00systemd 98dracut-systemd
+		# Without systemd following modules do not make sense
+		rm_module 00systemd-bootchart 01systemd-initrd 02systemd-networkd
+	fi
+
+	# Remove modules which won't work for sure
+	rm_module 95fcoe # no tools
+	# fips module depends on masked app-crypt/hmaccalc
+	rm_module 01fips 02fips-aesni
+}
+
+pkg_postinst() {
+	if linux-info_get_any_version && linux_config_exists; then
+		ewarn ""
+		ewarn "If the following test report contains a missing kernel"
+		ewarn "configuration option, you should reconfigure and rebuild your"
+		ewarn "kernel before booting image generated with this Dracut version."
+		ewarn ""
+
+		local CONFIG_CHECK="~BLK_DEV_INITRD ~DEVTMPFS"
+
+		# Kernel configuration options descriptions:
+		local desc_DEVTMPFS="Maintain a devtmpfs filesystem to mount at /dev"
+		local desc_BLK_DEV_INITRD="Initial RAM filesystem and RAM disk "\
+"(initramfs/initrd) support"
+
+		local opt desc
+
+		# Generate ERROR_* variables for check_extra_config.
+		for opt in ${CONFIG_CHECK}; do
+			opt=${opt#\~}
+			desc=desc_${opt}
+			eval "local ERROR_${opt}='CONFIG_${opt}: \"${!desc}\"" \
+				"is missing and REQUIRED'"
+		done
+
+		check_extra_config
+		echo
+	else
+		ewarn ""
+		ewarn "Your kernel configuration couldn't be checked.  Do you have"
+		ewarn "/usr/src/linux/.config file there?  Please check manually if"
+		ewarn "following options are enabled:"
+		ewarn ""
+		ewarn "  CONFIG_BLK_DEV_INITRD"
+		ewarn "  CONFIG_DEVTMPFS"
+		ewarn ""
+	fi
+
+	elog "To get additional features, a number of optional runtime"
+	elog "dependencies may be installed:"
+	elog ""
+	optfeature "Networking support"  net-misc/curl "net-misc/dhcp[client]" \
+		sys-apps/iproute2
+	optfeature \
+		"Measure performance of the boot process for later visualisation" \
+		app-benchmarks/bootchart2 app-admin/killproc sys-process/acct
+	optfeature "Scan for Btrfs on block devices"  sys-fs/btrfs-progs
+	optfeature "Load kernel modules and drop this privilege for real init" \
+		sys-libs/libcap
+	optfeature "Support CIFS" net-fs/cifs-utils
+	optfeature "Decrypt devices encrypted with cryptsetup/LUKS" \
+		"sys-fs/cryptsetup[-static-libs]"
+	optfeature "Support for GPG-encrypted keys for crypt module" \
+		app-crypt/gnupg
+	optfeature \
+		"Allows use of dash instead of default bash (on your own risk)" \
+		app-shells/dash
+	optfeature "Support iSCSI" sys-block/open-iscsi
+	optfeature "Support Logical Volume Manager" sys-fs/lvm2
+	optfeature "Support MD devices, also known as software RAID devices" \
+		sys-fs/mdadm
+	optfeature "Support Device Mapper multipathing" sys-fs/multipath-tools
+	optfeature "Plymouth boot splash"  '>=sys-boot/plymouth-0.8.5-r5'
+	optfeature "Support network block devices" sys-block/nbd
+	optfeature "Support NFS" net-fs/nfs-utils net-nds/rpcbind
+	optfeature \
+		"Install ssh and scp along with config files and specified keys" \
+		net-misc/openssh
+	optfeature "Enable logging with syslog-ng or rsyslog" app-admin/syslog-ng \
+		app-admin/rsyslog
+}

diff --git a/sys-kernel/dracut/dracut-044-r3.ebuild b/sys-kernel/dracut/dracut-044-r3.ebuild
new file mode 100644
index 0000000..ba9c064
--- /dev/null
+++ b/sys-kernel/dracut/dracut-044-r3.ebuild
@@ -0,0 +1,246 @@
+# Copyright 1999-2018 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit bash-completion-r1 eutils linux-info toolchain-funcs systemd
+
+DESCRIPTION="Generic initramfs generation tool"
+HOMEPAGE="https://dracut.wiki.kernel.org"
+SRC_URI="mirror://kernel/linux/utils/boot/${PN}/${P}.tar.xz"
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~ia64 ~ppc ~ppc64 ~sparc ~x86"
+IUSE="debug selinux systemd"
+
+RESTRICT="test"
+
+CDEPEND="virtual/udev
+	systemd? (
+		>=sys-apps/systemd-199
+		virtual/pkgconfig
+	)
+	"
+RDEPEND="${CDEPEND}
+	app-arch/cpio
+	>=app-shells/bash-4.0
+	>sys-apps/kmod-5[tools]
+	|| (
+		>=sys-apps/sysvinit-2.87-r3
+		sys-apps/systemd[sysv-utils]
+	)
+	>=sys-apps/util-linux-2.21
+
+	debug? ( dev-util/strace )
+	selinux? (
+		sys-libs/libselinux
+		sys-libs/libsepol
+		sec-policy/selinux-dracut
+	)
+	"
+DEPEND="${CDEPEND}
+	app-text/asciidoc
+	>=dev-libs/libxslt-1.1.26
+	app-text/docbook-xml-dtd:4.5
+	>=app-text/docbook-xsl-stylesheets-1.75.2
+	virtual/pkgconfig
+	"
+
+DOCS=( AUTHORS HACKING NEWS README README.generic README.kernel README.modules
+	README.testsuite TODO )
+MY_LIBDIR=/usr/lib
+QA_MULTILIB_PATHS="
+	usr/lib/dracut/dracut-install
+	usr/lib/dracut/skipcpio
+	"
+
+PATCHES=(
+	"${FILESDIR}"/044-0001-base-dracut-lib.sh-dev_unit_name-guard-against-dev-b.patch
+	"${FILESDIR}"/044-0002-systemd-initrd-add-initrd-root-device.target.patch
+	"${FILESDIR}"/044-0003-50-dracut.install-use-bin-bash-shebang.patch
+	"${FILESDIR}"/dracut-044-bash-4.4.patch
+	"${FILESDIR}"/dracut-044-preserve-xattrs-when-copying.patch
+)
+
+#
+# Helper functions
+#
+
+# Removes module from modules.d.
+# $1 = module name
+# Module name can be specified without number prefix.
+rm_module() {
+	local force m
+	[[ $1 = -f ]] && force=-f
+
+	for m in $@; do
+		if [[ $m =~ ^[0-9][0-9][^\ ]*$ ]]; then
+			rm ${force} --interactive=never -r "${modules_dir}"/$m
+		else
+			rm ${force} --interactive=never -r "${modules_dir}"/[0-9][0-9]$m
+		fi
+	done
+}
+
+src_prepare() {
+	local libdirs="/$(get_libdir) /usr/$(get_libdir)"
+	if [[ ${SYMLINK_LIB} = yes ]]; then
+		# Preserve lib -> lib64 symlinks in initramfs
+		[[ $libdirs =~ /lib\  ]] || libdirs+=" /lib /usr/lib"
+	fi
+	einfo "Setting libdirs to \"${libdirs}\" ..."
+	sed -e "3alibdirs=\"${libdirs}\"" \
+		-i "${S}/dracut.conf.d/gentoo.conf.example" || die
+
+	local udevdir="$("$(tc-getPKG_CONFIG)" udev --variable=udevdir)"
+	einfo "Setting udevdir to ${udevdir}..."
+	sed -r -e "s|^(udevdir=).*$|\1${udevdir}|" \
+			-i "${S}/dracut.conf.d/gentoo.conf.example" || die
+
+	if ! use systemd; then
+		local systemdutildir="/lib/systemd"
+		einfo "Setting systemdutildir for standalone udev to" \
+			"${systemdutildir}..."
+		sed -e "5asystemdutildir=\"${systemdutildir}\"" \
+			-i "${S}/dracut.conf.d/gentoo.conf.example" || die
+	fi
+
+	default
+}
+
+src_configure() {
+	local myconf=(
+		--libdir="${MY_LIBDIR}"
+		--bashcompletiondir="$(get_bashcompdir)"
+	)
+
+	if use systemd; then
+		myconf+=( --systemdsystemunitdir="$(systemd_get_systemunitdir)" )
+	fi
+
+	econf "${myconf[@]}"
+}
+
+src_compile() {
+	tc-export CC
+	emake doc install/dracut-install skipcpio/skipcpio
+}
+
+src_install() {
+	default
+
+	local my_libdir="${MY_LIBDIR}"
+	local dracutlibdir="${my_libdir#/}/dracut"
+
+	echo "DRACUT_VERSION=$PVR" > "${D%/}/${dracutlibdir}/dracut-version.sh"
+
+	insinto "${dracutlibdir}/dracut.conf.d/"
+	newins dracut.conf.d/gentoo.conf.example gentoo.conf
+
+	insinto /etc/logrotate.d
+	newins dracut.logrotate dracut
+
+	dodir /var/lib/dracut/overlay
+
+	dodoc dracut.html
+
+	if ! use systemd; then
+		# Scripts in kernel/install.d are systemd-specific
+		rm -r "${D%/}/${my_libdir}/kernel" || die
+	fi
+
+	#
+	# Modules
+	#
+	local module
+	modules_dir="${D%/}/${dracutlibdir}/modules.d"
+
+	use debug || rm_module 95debug
+	use selinux || rm_module 98selinux
+
+	if use systemd; then
+		# With systemd following modules do not make sense
+		rm_module 96securityfs 97masterkey 98integrity
+	else
+		rm_module 00systemd 98dracut-systemd
+		# Without systemd following modules do not make sense
+		rm_module 00systemd-bootchart 01systemd-initrd 02systemd-networkd
+	fi
+
+	# Remove modules which won't work for sure
+	rm_module 95fcoe # no tools
+	# fips module depends on masked app-crypt/hmaccalc
+	rm_module 01fips 02fips-aesni
+}
+
+pkg_postinst() {
+	if linux-info_get_any_version && linux_config_exists; then
+		ewarn ""
+		ewarn "If the following test report contains a missing kernel"
+		ewarn "configuration option, you should reconfigure and rebuild your"
+		ewarn "kernel before booting image generated with this Dracut version."
+		ewarn ""
+
+		local CONFIG_CHECK="~BLK_DEV_INITRD ~DEVTMPFS"
+
+		# Kernel configuration options descriptions:
+		local desc_DEVTMPFS="Maintain a devtmpfs filesystem to mount at /dev"
+		local desc_BLK_DEV_INITRD="Initial RAM filesystem and RAM disk "\
+"(initramfs/initrd) support"
+
+		local opt desc
+
+		# Generate ERROR_* variables for check_extra_config.
+		for opt in ${CONFIG_CHECK}; do
+			opt=${opt#\~}
+			desc=desc_${opt}
+			eval "local ERROR_${opt}='CONFIG_${opt}: \"${!desc}\"" \
+				"is missing and REQUIRED'"
+		done
+
+		check_extra_config
+		echo
+	else
+		ewarn ""
+		ewarn "Your kernel configuration couldn't be checked.  Do you have"
+		ewarn "/usr/src/linux/.config file there?  Please check manually if"
+		ewarn "following options are enabled:"
+		ewarn ""
+		ewarn "  CONFIG_BLK_DEV_INITRD"
+		ewarn "  CONFIG_DEVTMPFS"
+		ewarn ""
+	fi
+
+	elog "To get additional features, a number of optional runtime"
+	elog "dependencies may be installed:"
+	elog ""
+	optfeature "Networking support"  net-misc/curl "net-misc/dhcp[client]" \
+		sys-apps/iproute2
+	optfeature \
+		"Measure performance of the boot process for later visualisation" \
+		app-benchmarks/bootchart2 app-admin/killproc sys-process/acct
+	optfeature "Scan for Btrfs on block devices"  sys-fs/btrfs-progs
+	optfeature "Load kernel modules and drop this privilege for real init" \
+		sys-libs/libcap
+	optfeature "Support CIFS" net-fs/cifs-utils
+	optfeature "Decrypt devices encrypted with cryptsetup/LUKS" \
+		"sys-fs/cryptsetup[-static-libs]"
+	optfeature "Support for GPG-encrypted keys for crypt module" \
+		app-crypt/gnupg
+	optfeature \
+		"Allows use of dash instead of default bash (on your own risk)" \
+		app-shells/dash
+	optfeature "Support iSCSI" sys-block/open-iscsi
+	optfeature "Support Logical Volume Manager" sys-fs/lvm2
+	optfeature "Support MD devices, also known as software RAID devices" \
+		sys-fs/mdadm
+	optfeature "Support Device Mapper multipathing" sys-fs/multipath-tools
+	optfeature "Plymouth boot splash"  '>=sys-boot/plymouth-0.8.5-r5'
+	optfeature "Support network block devices" sys-block/nbd
+	optfeature "Support NFS" net-fs/nfs-utils net-nds/rpcbind
+	optfeature \
+		"Install ssh and scp along with config files and specified keys" \
+		net-misc/openssh
+	optfeature "Enable logging with syslog-ng or rsyslog" app-admin/syslog-ng \
+		app-admin/rsyslog
+}

diff --git a/sys-kernel/dracut/dracut-045-r2.ebuild b/sys-kernel/dracut/dracut-045-r2.ebuild
new file mode 100644
index 0000000..396de86
--- /dev/null
+++ b/sys-kernel/dracut/dracut-045-r2.ebuild
@@ -0,0 +1,164 @@
+# Copyright 1999-2018 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit bash-completion-r1 eutils linux-info toolchain-funcs systemd
+
+DESCRIPTION="Generic initramfs generation tool"
+HOMEPAGE="https://dracut.wiki.kernel.org"
+SRC_URI="mirror://kernel/linux/utils/boot/${PN}/${P}.tar.xz"
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="alpha amd64 ~arm ia64 ~mips ppc ~ppc64 sparc x86"
+IUSE="debug selinux"
+
+RESTRICT="test"
+
+CDEPEND="virtual/udev
+	virtual/pkgconfig
+	>=sys-apps/kmod-15[tools]
+	"
+RDEPEND="${CDEPEND}
+	app-arch/cpio
+	>=app-shells/bash-4.0:0
+	|| (
+		>=sys-apps/sysvinit-2.87-r3
+		sys-apps/systemd[sysv-utils]
+	)
+	sys-apps/coreutils[xattr(-)]
+	>=sys-apps/util-linux-2.21
+
+	debug? ( dev-util/strace )
+	selinux? (
+		sys-libs/libselinux
+		sys-libs/libsepol
+		sec-policy/selinux-dracut
+	)
+	!net-analyzer/arping
+	"
+DEPEND="${CDEPEND}
+	app-text/asciidoc
+	>=dev-libs/libxslt-1.1.26
+	app-text/docbook-xml-dtd:4.5
+	>=app-text/docbook-xsl-stylesheets-1.75.2
+	"
+
+DOCS=( AUTHORS HACKING NEWS README README.generic README.kernel README.modules
+	README.testsuite TODO )
+
+QA_MULTILIB_PATHS="usr/lib/dracut/.*"
+
+PATCHES=(
+	"${FILESDIR}/045-systemdutildir.patch"
+)
+
+src_configure() {
+	local myconf=(
+		--prefix="${EPREFIX}/usr"
+		--sysconfdir="${EPREFIX}/etc"
+		--bashcompletiondir="$(get_bashcompdir)"
+		--systemdsystemunitdir="$(systemd_get_systemunitdir)"
+	)
+
+	tc-export CC PKG_CONFIG
+
+	echo ./configure "${myconf[@]}"
+	./configure "${myconf[@]}" || die
+}
+
+src_install() {
+	default
+
+	local dracutlibdir="usr/lib/dracut"
+
+	local libdirs="/$(get_libdir) /usr/$(get_libdir)"
+	if [[ ${SYMLINK_LIB} = yes ]]; then
+		# Preserve lib -> lib64 symlinks in initramfs
+		[[ $libdirs =~ /lib\  ]] || libdirs+=" /lib /usr/lib"
+	fi
+
+	einfo "Setting libdirs to \"${libdirs}\" ..."
+	echo "libdirs=\"${libdirs}\"" > "${T}/gentoo.conf"
+	insinto "${dracutlibdir}/dracut.conf.d"
+	doins "${T}/gentoo.conf"
+
+	insinto /etc/logrotate.d
+	newins dracut.logrotate dracut
+
+	dodir /var/lib/dracut/overlay
+
+	dodoc dracut.html
+}
+
+pkg_postinst() {
+	if linux-info_get_any_version && linux_config_exists; then
+		ewarn ""
+		ewarn "If the following test report contains a missing kernel"
+		ewarn "configuration option, you should reconfigure and rebuild your"
+		ewarn "kernel before booting image generated with this Dracut version."
+		ewarn ""
+
+		local CONFIG_CHECK="~BLK_DEV_INITRD ~DEVTMPFS"
+
+		# Kernel configuration options descriptions:
+		local desc_DEVTMPFS="Maintain a devtmpfs filesystem to mount at /dev"
+		local desc_BLK_DEV_INITRD="Initial RAM filesystem and RAM disk "\
+"(initramfs/initrd) support"
+
+		local opt desc
+
+		# Generate ERROR_* variables for check_extra_config.
+		for opt in ${CONFIG_CHECK}; do
+			opt=${opt#\~}
+			desc=desc_${opt}
+			eval "local ERROR_${opt}='CONFIG_${opt}: \"${!desc}\"" \
+				"is missing and REQUIRED'"
+		done
+
+		check_extra_config
+		echo
+	else
+		ewarn ""
+		ewarn "Your kernel configuration couldn't be checked.  Do you have"
+		ewarn "/usr/src/linux/.config file there?  Please check manually if"
+		ewarn "following options are enabled:"
+		ewarn ""
+		ewarn "  CONFIG_BLK_DEV_INITRD"
+		ewarn "  CONFIG_DEVTMPFS"
+		ewarn ""
+	fi
+
+	elog "To get additional features, a number of optional runtime"
+	elog "dependencies may be installed:"
+	elog ""
+	optfeature "Networking support"  net-misc/curl "net-misc/dhcp[client]" \
+		sys-apps/iproute2 "net-misc/iputils[arping]"
+	optfeature \
+		"Measure performance of the boot process for later visualisation" \
+		app-benchmarks/bootchart2 app-admin/killproc sys-process/acct
+	optfeature "Scan for Btrfs on block devices"  sys-fs/btrfs-progs
+	optfeature "Load kernel modules and drop this privilege for real init" \
+		sys-libs/libcap
+	optfeature "Support CIFS" net-fs/cifs-utils
+	optfeature "Decrypt devices encrypted with cryptsetup/LUKS" \
+		"sys-fs/cryptsetup[-static-libs]"
+	optfeature "Support for GPG-encrypted keys for crypt module" \
+		app-crypt/gnupg
+	optfeature \
+		"Allows use of dash instead of default bash (on your own risk)" \
+		app-shells/dash
+	optfeature "Support iSCSI" sys-block/open-iscsi
+	optfeature "Support Logical Volume Manager" sys-fs/lvm2
+	optfeature "Support MD devices, also known as software RAID devices" \
+		sys-fs/mdadm
+	optfeature "Support Device Mapper multipathing" sys-fs/multipath-tools
+	optfeature "Plymouth boot splash"  '>=sys-boot/plymouth-0.8.5-r5'
+	optfeature "Support network block devices" sys-block/nbd
+	optfeature "Support NFS" net-fs/nfs-utils net-nds/rpcbind
+	optfeature \
+		"Install ssh and scp along with config files and specified keys" \
+		net-misc/openssh
+	optfeature "Enable logging with syslog-ng or rsyslog" app-admin/syslog-ng \
+		app-admin/rsyslog
+}

diff --git a/sys-kernel/dracut/dracut-046-r1.ebuild b/sys-kernel/dracut/dracut-046-r1.ebuild
new file mode 100644
index 0000000..e3ba1f4
--- /dev/null
+++ b/sys-kernel/dracut/dracut-046-r1.ebuild
@@ -0,0 +1,165 @@
+# Copyright 1999-2018 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit bash-completion-r1 eutils linux-info toolchain-funcs systemd
+
+DESCRIPTION="Generic initramfs generation tool"
+HOMEPAGE="https://dracut.wiki.kernel.org"
+SRC_URI="mirror://kernel/linux/utils/boot/${PN}/${P}.tar.xz"
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="alpha amd64 ~arm ia64 ~mips ppc ~ppc64 sparc x86"
+IUSE="debug selinux"
+
+RESTRICT="test"
+
+CDEPEND="virtual/udev
+	virtual/pkgconfig
+	>=sys-apps/kmod-15[tools]
+	"
+RDEPEND="${CDEPEND}
+	app-arch/cpio
+	>=app-shells/bash-4.0:0
+	|| (
+		>=sys-apps/sysvinit-2.87-r3
+		sys-apps/systemd[sysv-utils]
+	)
+	sys-apps/coreutils[xattr(-)]
+	>=sys-apps/util-linux-2.21
+
+	debug? ( dev-util/strace )
+	selinux? (
+		sys-libs/libselinux
+		sys-libs/libsepol
+		sec-policy/selinux-dracut
+	)
+	!net-analyzer/arping
+	"
+DEPEND="${CDEPEND}
+	app-text/asciidoc
+	>=dev-libs/libxslt-1.1.26
+	app-text/docbook-xml-dtd:4.5
+	>=app-text/docbook-xsl-stylesheets-1.75.2
+	"
+
+DOCS=( AUTHORS HACKING NEWS README README.generic README.kernel README.modules
+	README.testsuite TODO )
+
+QA_MULTILIB_PATHS="usr/lib/dracut/.*"
+
+PATCHES=(
+	"${FILESDIR}/045-systemdutildir.patch"
+	"${FILESDIR}/046-amd-microcode.patch"
+)
+
+src_configure() {
+	local myconf=(
+		--prefix="${EPREFIX}/usr"
+		--sysconfdir="${EPREFIX}/etc"
+		--bashcompletiondir="$(get_bashcompdir)"
+		--systemdsystemunitdir="$(systemd_get_systemunitdir)"
+	)
+
+	tc-export CC PKG_CONFIG
+
+	echo ./configure "${myconf[@]}"
+	./configure "${myconf[@]}" || die
+}
+
+src_install() {
+	default
+
+	local dracutlibdir="usr/lib/dracut"
+
+	local libdirs="/$(get_libdir) /usr/$(get_libdir)"
+	if [[ ${SYMLINK_LIB} = yes ]]; then
+		# Preserve lib -> lib64 symlinks in initramfs
+		[[ $libdirs =~ /lib\  ]] || libdirs+=" /lib /usr/lib"
+	fi
+
+	einfo "Setting libdirs to \"${libdirs}\" ..."
+	echo "libdirs=\"${libdirs}\"" > "${T}/gentoo.conf"
+	insinto "${dracutlibdir}/dracut.conf.d"
+	doins "${T}/gentoo.conf"
+
+	insinto /etc/logrotate.d
+	newins dracut.logrotate dracut
+
+	dodir /var/lib/dracut/overlay
+
+	dodoc dracut.html
+}
+
+pkg_postinst() {
+	if linux-info_get_any_version && linux_config_exists; then
+		ewarn ""
+		ewarn "If the following test report contains a missing kernel"
+		ewarn "configuration option, you should reconfigure and rebuild your"
+		ewarn "kernel before booting image generated with this Dracut version."
+		ewarn ""
+
+		local CONFIG_CHECK="~BLK_DEV_INITRD ~DEVTMPFS"
+
+		# Kernel configuration options descriptions:
+		local desc_DEVTMPFS="Maintain a devtmpfs filesystem to mount at /dev"
+		local desc_BLK_DEV_INITRD="Initial RAM filesystem and RAM disk "\
+"(initramfs/initrd) support"
+
+		local opt desc
+
+		# Generate ERROR_* variables for check_extra_config.
+		for opt in ${CONFIG_CHECK}; do
+			opt=${opt#\~}
+			desc=desc_${opt}
+			eval "local ERROR_${opt}='CONFIG_${opt}: \"${!desc}\"" \
+				"is missing and REQUIRED'"
+		done
+
+		check_extra_config
+		echo
+	else
+		ewarn ""
+		ewarn "Your kernel configuration couldn't be checked.  Do you have"
+		ewarn "/usr/src/linux/.config file there?  Please check manually if"
+		ewarn "following options are enabled:"
+		ewarn ""
+		ewarn "  CONFIG_BLK_DEV_INITRD"
+		ewarn "  CONFIG_DEVTMPFS"
+		ewarn ""
+	fi
+
+	elog "To get additional features, a number of optional runtime"
+	elog "dependencies may be installed:"
+	elog ""
+	optfeature "Networking support"  net-misc/curl "net-misc/dhcp[client]" \
+		sys-apps/iproute2 "net-misc/iputils[arping]"
+	optfeature \
+		"Measure performance of the boot process for later visualisation" \
+		app-benchmarks/bootchart2 app-admin/killproc sys-process/acct
+	optfeature "Scan for Btrfs on block devices"  sys-fs/btrfs-progs
+	optfeature "Load kernel modules and drop this privilege for real init" \
+		sys-libs/libcap
+	optfeature "Support CIFS" net-fs/cifs-utils
+	optfeature "Decrypt devices encrypted with cryptsetup/LUKS" \
+		"sys-fs/cryptsetup[-static-libs]"
+	optfeature "Support for GPG-encrypted keys for crypt module" \
+		app-crypt/gnupg
+	optfeature \
+		"Allows use of dash instead of default bash (on your own risk)" \
+		app-shells/dash
+	optfeature "Support iSCSI" sys-block/open-iscsi
+	optfeature "Support Logical Volume Manager" sys-fs/lvm2
+	optfeature "Support MD devices, also known as software RAID devices" \
+		sys-fs/mdadm
+	optfeature "Support Device Mapper multipathing" sys-fs/multipath-tools
+	optfeature "Plymouth boot splash"  '>=sys-boot/plymouth-0.8.5-r5'
+	optfeature "Support network block devices" sys-block/nbd
+	optfeature "Support NFS" net-fs/nfs-utils net-nds/rpcbind
+	optfeature \
+		"Install ssh and scp along with config files and specified keys" \
+		net-misc/openssh
+	optfeature "Enable logging with syslog-ng or rsyslog" app-admin/syslog-ng \
+		app-admin/rsyslog
+}

diff --git a/sys-kernel/dracut/dracut-047-r1.ebuild b/sys-kernel/dracut/dracut-047-r1.ebuild
new file mode 100644
index 0000000..5010bcc
--- /dev/null
+++ b/sys-kernel/dracut/dracut-047-r1.ebuild
@@ -0,0 +1,154 @@
+# Copyright 1999-2018 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit bash-completion-r1 eutils linux-info systemd toolchain-funcs
+
+DESCRIPTION="Generic initramfs generation tool"
+HOMEPAGE="https://dracut.wiki.kernel.org"
+SRC_URI="mirror://kernel/linux/utils/boot/${PN}/${P}.tar.xz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86"
+IUSE="debug selinux"
+
+# Tests need root privileges, bug #298014
+RESTRICT="test"
+
+COMMON_DEPEND=">=sys-apps/kmod-23[tools]
+	virtual/pkgconfig
+	virtual/udev
+	"
+RDEPEND="${COMMON_DEPEND}
+	app-arch/cpio
+	>=app-shells/bash-4.0:0
+	sys-apps/coreutils[xattr(-)]
+	|| (
+		>=sys-apps/sysvinit-2.87-r3
+		sys-apps/systemd[sysv-utils]
+	)
+	>=sys-apps/util-linux-2.21
+
+	debug? ( dev-util/strace )
+	selinux? (
+		sec-policy/selinux-dracut
+		sys-libs/libselinux
+		sys-libs/libsepol
+	)
+	"
+DEPEND="${COMMON_DEPEND}
+	app-text/asciidoc
+	app-text/docbook-xml-dtd:4.5
+	>=app-text/docbook-xsl-stylesheets-1.75.2
+	>=dev-libs/libxslt-1.1.26
+	"
+
+DOCS=( AUTHORS HACKING NEWS README README.generic README.kernel README.modules
+	README.testsuite TODO )
+
+QA_MULTILIB_PATHS="usr/lib/dracut/.*"
+
+PATCHES=(
+	"${FILESDIR}/045-systemdutildir.patch"
+	"${FILESDIR}/047-all-fix-issues-found-by-shellcheck.patch"
+	"${FILESDIR}/047-plymouth-fix-detection-of-plymouth-directory.patch"
+)
+
+src_configure() {
+	local myconf=(
+		--prefix="${EPREFIX}/usr"
+		--sysconfdir="${EPREFIX}/etc"
+		--bashcompletiondir="$(get_bashcompdir)"
+		--systemdsystemunitdir="$(systemd_get_systemunitdir)"
+	)
+
+	tc-export CC PKG_CONFIG
+
+	echo ./configure "${myconf[@]}"
+	./configure "${myconf[@]}" || die
+}
+
+src_install() {
+	default
+
+	local libdirs=( /$(get_libdir) /usr/$(get_libdir) )
+	if [[ ${SYMLINK_LIB} = yes && $(get_libdir) != lib ]]; then
+		# Preserve lib -> lib64 symlinks in initramfs
+		libdirs+=( /lib /usr/lib )
+	fi
+
+	einfo "Setting libdirs to \"${libdirs[*]}\" ..."
+	echo "libdirs=\"${libdirs[*]}\"" > "${T}/gentoo.conf" || die
+	insinto "/usr/lib/dracut/dracut.conf.d"
+	doins "${T}/gentoo.conf"
+
+	insinto /etc/logrotate.d
+	newins dracut.logrotate dracut
+
+	docinto html
+	dodoc dracut.html
+}
+
+pkg_postinst() {
+	if linux-info_get_any_version && linux_config_exists; then
+		ewarn ""
+		ewarn "If the following test report contains a missing kernel"
+		ewarn "configuration option, you should reconfigure and rebuild your"
+		ewarn "kernel before booting image generated with this Dracut version."
+		ewarn ""
+
+		local CONFIG_CHECK="~BLK_DEV_INITRD ~DEVTMPFS"
+
+		# Kernel configuration options descriptions:
+		local ERROR_DEVTMPFS='CONFIG_DEVTMPFS: "Maintain a devtmpfs filesystem to mount at /dev" '
+		ERROR_DEVTMPFS+='is missing and REQUIRED'
+		local ERROR_BLK_DEV_INITRD='CONFIG_BLK_DEV_INITRD: "Initial RAM filesystem and RAM disk '
+		ERROR_BLK_DEV_INITRD+='(initramfs/initrd) support" is missing and REQUIRED'
+
+		check_extra_config
+		echo
+	else
+		ewarn ""
+		ewarn "Your kernel configuration couldn't be checked."
+		ewarn "Please check manually if following options are enabled:"
+		ewarn ""
+		ewarn "  CONFIG_BLK_DEV_INITRD"
+		ewarn "  CONFIG_DEVTMPFS"
+		ewarn ""
+	fi
+
+	elog "To get additional features, a number of optional runtime"
+	elog "dependencies may be installed:"
+	elog ""
+	optfeature "Networking support"  net-misc/curl "net-misc/dhcp[client]" \
+		sys-apps/iproute2 "net-misc/iputils[arping]"
+	optfeature \
+		"Measure performance of the boot process for later visualisation" \
+		app-benchmarks/bootchart2 app-admin/killproc sys-process/acct
+	optfeature "Scan for Btrfs on block devices"  sys-fs/btrfs-progs
+	optfeature "Load kernel modules and drop this privilege for real init" \
+		sys-libs/libcap
+	optfeature "Support CIFS" net-fs/cifs-utils
+	optfeature "Decrypt devices encrypted with cryptsetup/LUKS" \
+		"sys-fs/cryptsetup[-static-libs]"
+	optfeature "Support for GPG-encrypted keys for crypt module" \
+		app-crypt/gnupg
+	optfeature \
+		"Allows use of dash instead of default bash (on your own risk)" \
+		app-shells/dash
+	optfeature "Support iSCSI" sys-block/open-iscsi
+	optfeature "Support Logical Volume Manager" sys-fs/lvm2
+	optfeature "Support MD devices, also known as software RAID devices" \
+		sys-fs/mdadm
+	optfeature "Support Device Mapper multipathing" sys-fs/multipath-tools
+	optfeature "Plymouth boot splash"  '>=sys-boot/plymouth-0.8.5-r5'
+	optfeature "Support network block devices" sys-block/nbd
+	optfeature "Support NFS" net-fs/nfs-utils net-nds/rpcbind
+	optfeature \
+		"Install ssh and scp along with config files and specified keys" \
+		net-misc/openssh
+	optfeature "Enable logging with syslog-ng or rsyslog" app-admin/syslog-ng \
+		app-admin/rsyslog
+}

diff --git a/sys-kernel/dracut/dracut-048-r1.ebuild b/sys-kernel/dracut/dracut-048-r1.ebuild
new file mode 100644
index 0000000..274f7b9
--- /dev/null
+++ b/sys-kernel/dracut/dracut-048-r1.ebuild
@@ -0,0 +1,152 @@
+# Copyright 1999-2018 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit bash-completion-r1 eutils linux-info systemd toolchain-funcs
+
+DESCRIPTION="Generic initramfs generation tool"
+HOMEPAGE="https://dracut.wiki.kernel.org"
+SRC_URI="mirror://kernel/linux/utils/boot/${PN}/${P}.tar.xz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86"
+IUSE="debug selinux"
+
+# Tests need root privileges, bug #298014
+RESTRICT="test"
+
+COMMON_DEPEND=">=sys-apps/kmod-23[tools]
+	virtual/pkgconfig
+	virtual/udev
+	"
+RDEPEND="${COMMON_DEPEND}
+	app-arch/cpio
+	>=app-shells/bash-4.0:0
+	sys-apps/coreutils[xattr(-)]
+	|| (
+		>=sys-apps/sysvinit-2.87-r3
+		sys-apps/systemd[sysv-utils]
+	)
+	>=sys-apps/util-linux-2.21
+
+	debug? ( dev-util/strace )
+	selinux? (
+		sec-policy/selinux-dracut
+		sys-libs/libselinux
+		sys-libs/libsepol
+	)
+	"
+DEPEND="${COMMON_DEPEND}
+	app-text/asciidoc
+	app-text/docbook-xml-dtd:4.5
+	>=app-text/docbook-xsl-stylesheets-1.75.2
+	>=dev-libs/libxslt-1.1.26
+	"
+
+DOCS=( AUTHORS HACKING NEWS README README.generic README.kernel README.modules
+	README.testsuite TODO )
+
+QA_MULTILIB_PATHS="usr/lib/dracut/.*"
+
+PATCHES=(
+	"${FILESDIR}"/048-dracut-install-simplify-ldd-parsing-logic.patch
+)
+
+src_configure() {
+	local myconf=(
+		--prefix="${EPREFIX}/usr"
+		--sysconfdir="${EPREFIX}/etc"
+		--bashcompletiondir="$(get_bashcompdir)"
+		--systemdsystemunitdir="$(systemd_get_systemunitdir)"
+	)
+
+	tc-export CC PKG_CONFIG
+
+	echo ./configure "${myconf[@]}"
+	./configure "${myconf[@]}" || die
+}
+
+src_install() {
+	default
+
+	local libdirs=( /$(get_libdir) /usr/$(get_libdir) )
+	if [[ ${SYMLINK_LIB} = yes && $(get_libdir) != lib ]]; then
+		# Preserve lib -> lib64 symlinks in initramfs
+		libdirs+=( /lib /usr/lib )
+	fi
+
+	einfo "Setting libdirs to \"${libdirs[*]}\" ..."
+	echo "libdirs=\"${libdirs[*]}\"" > "${T}/gentoo.conf" || die
+	insinto "/usr/lib/dracut/dracut.conf.d"
+	doins "${T}/gentoo.conf"
+
+	insinto /etc/logrotate.d
+	newins dracut.logrotate dracut
+
+	docinto html
+	dodoc dracut.html
+}
+
+pkg_postinst() {
+	if linux-info_get_any_version && linux_config_exists; then
+		ewarn ""
+		ewarn "If the following test report contains a missing kernel"
+		ewarn "configuration option, you should reconfigure and rebuild your"
+		ewarn "kernel before booting image generated with this Dracut version."
+		ewarn ""
+
+		local CONFIG_CHECK="~BLK_DEV_INITRD ~DEVTMPFS"
+
+		# Kernel configuration options descriptions:
+		local ERROR_DEVTMPFS='CONFIG_DEVTMPFS: "Maintain a devtmpfs filesystem to mount at /dev" '
+		ERROR_DEVTMPFS+='is missing and REQUIRED'
+		local ERROR_BLK_DEV_INITRD='CONFIG_BLK_DEV_INITRD: "Initial RAM filesystem and RAM disk '
+		ERROR_BLK_DEV_INITRD+='(initramfs/initrd) support" is missing and REQUIRED'
+
+		check_extra_config
+		echo
+	else
+		ewarn ""
+		ewarn "Your kernel configuration couldn't be checked."
+		ewarn "Please check manually if following options are enabled:"
+		ewarn ""
+		ewarn "  CONFIG_BLK_DEV_INITRD"
+		ewarn "  CONFIG_DEVTMPFS"
+		ewarn ""
+	fi
+
+	elog "To get additional features, a number of optional runtime"
+	elog "dependencies may be installed:"
+	elog ""
+	optfeature "Networking support"  net-misc/curl "net-misc/dhcp[client]" \
+		sys-apps/iproute2 "net-misc/iputils[arping]"
+	optfeature \
+		"Measure performance of the boot process for later visualisation" \
+		app-benchmarks/bootchart2 app-admin/killproc sys-process/acct
+	optfeature "Scan for Btrfs on block devices"  sys-fs/btrfs-progs
+	optfeature "Load kernel modules and drop this privilege for real init" \
+		sys-libs/libcap
+	optfeature "Support CIFS" net-fs/cifs-utils
+	optfeature "Decrypt devices encrypted with cryptsetup/LUKS" \
+		"sys-fs/cryptsetup[-static-libs]"
+	optfeature "Support for GPG-encrypted keys for crypt module" \
+		app-crypt/gnupg
+	optfeature \
+		"Allows use of dash instead of default bash (on your own risk)" \
+		app-shells/dash
+	optfeature "Support iSCSI" sys-block/open-iscsi
+	optfeature "Support Logical Volume Manager" sys-fs/lvm2
+	optfeature "Support MD devices, also known as software RAID devices" \
+		sys-fs/mdadm
+	optfeature "Support Device Mapper multipathing" sys-fs/multipath-tools
+	optfeature "Plymouth boot splash"  '>=sys-boot/plymouth-0.8.5-r5'
+	optfeature "Support network block devices" sys-block/nbd
+	optfeature "Support NFS" net-fs/nfs-utils net-nds/rpcbind
+	optfeature \
+		"Install ssh and scp along with config files and specified keys" \
+		net-misc/openssh
+	optfeature "Enable logging with syslog-ng or rsyslog" app-admin/syslog-ng \
+		app-admin/rsyslog
+}

diff --git a/sys-kernel/dracut/dracut-048.ebuild b/sys-kernel/dracut/dracut-048.ebuild
new file mode 100644
index 0000000..122f8c7
--- /dev/null
+++ b/sys-kernel/dracut/dracut-048.ebuild
@@ -0,0 +1,148 @@
+# Copyright 1999-2018 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit bash-completion-r1 eutils linux-info systemd toolchain-funcs
+
+DESCRIPTION="Generic initramfs generation tool"
+HOMEPAGE="https://dracut.wiki.kernel.org"
+SRC_URI="mirror://kernel/linux/utils/boot/${PN}/${P}.tar.xz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86"
+IUSE="debug selinux"
+
+# Tests need root privileges, bug #298014
+RESTRICT="test"
+
+COMMON_DEPEND=">=sys-apps/kmod-23[tools]
+	virtual/pkgconfig
+	virtual/udev
+	"
+RDEPEND="${COMMON_DEPEND}
+	app-arch/cpio
+	>=app-shells/bash-4.0:0
+	sys-apps/coreutils[xattr(-)]
+	|| (
+		>=sys-apps/sysvinit-2.87-r3
+		sys-apps/systemd[sysv-utils]
+	)
+	>=sys-apps/util-linux-2.21
+
+	debug? ( dev-util/strace )
+	selinux? (
+		sec-policy/selinux-dracut
+		sys-libs/libselinux
+		sys-libs/libsepol
+	)
+	"
+DEPEND="${COMMON_DEPEND}
+	app-text/asciidoc
+	app-text/docbook-xml-dtd:4.5
+	>=app-text/docbook-xsl-stylesheets-1.75.2
+	>=dev-libs/libxslt-1.1.26
+	"
+
+DOCS=( AUTHORS HACKING NEWS README README.generic README.kernel README.modules
+	README.testsuite TODO )
+
+QA_MULTILIB_PATHS="usr/lib/dracut/.*"
+
+src_configure() {
+	local myconf=(
+		--prefix="${EPREFIX}/usr"
+		--sysconfdir="${EPREFIX}/etc"
+		--bashcompletiondir="$(get_bashcompdir)"
+		--systemdsystemunitdir="$(systemd_get_systemunitdir)"
+	)
+
+	tc-export CC PKG_CONFIG
+
+	echo ./configure "${myconf[@]}"
+	./configure "${myconf[@]}" || die
+}
+
+src_install() {
+	default
+
+	local libdirs=( /$(get_libdir) /usr/$(get_libdir) )
+	if [[ ${SYMLINK_LIB} = yes && $(get_libdir) != lib ]]; then
+		# Preserve lib -> lib64 symlinks in initramfs
+		libdirs+=( /lib /usr/lib )
+	fi
+
+	einfo "Setting libdirs to \"${libdirs[*]}\" ..."
+	echo "libdirs=\"${libdirs[*]}\"" > "${T}/gentoo.conf" || die
+	insinto "/usr/lib/dracut/dracut.conf.d"
+	doins "${T}/gentoo.conf"
+
+	insinto /etc/logrotate.d
+	newins dracut.logrotate dracut
+
+	docinto html
+	dodoc dracut.html
+}
+
+pkg_postinst() {
+	if linux-info_get_any_version && linux_config_exists; then
+		ewarn ""
+		ewarn "If the following test report contains a missing kernel"
+		ewarn "configuration option, you should reconfigure and rebuild your"
+		ewarn "kernel before booting image generated with this Dracut version."
+		ewarn ""
+
+		local CONFIG_CHECK="~BLK_DEV_INITRD ~DEVTMPFS"
+
+		# Kernel configuration options descriptions:
+		local ERROR_DEVTMPFS='CONFIG_DEVTMPFS: "Maintain a devtmpfs filesystem to mount at /dev" '
+		ERROR_DEVTMPFS+='is missing and REQUIRED'
+		local ERROR_BLK_DEV_INITRD='CONFIG_BLK_DEV_INITRD: "Initial RAM filesystem and RAM disk '
+		ERROR_BLK_DEV_INITRD+='(initramfs/initrd) support" is missing and REQUIRED'
+
+		check_extra_config
+		echo
+	else
+		ewarn ""
+		ewarn "Your kernel configuration couldn't be checked."
+		ewarn "Please check manually if following options are enabled:"
+		ewarn ""
+		ewarn "  CONFIG_BLK_DEV_INITRD"
+		ewarn "  CONFIG_DEVTMPFS"
+		ewarn ""
+	fi
+
+	elog "To get additional features, a number of optional runtime"
+	elog "dependencies may be installed:"
+	elog ""
+	optfeature "Networking support"  net-misc/curl "net-misc/dhcp[client]" \
+		sys-apps/iproute2 "net-misc/iputils[arping]"
+	optfeature \
+		"Measure performance of the boot process for later visualisation" \
+		app-benchmarks/bootchart2 app-admin/killproc sys-process/acct
+	optfeature "Scan for Btrfs on block devices"  sys-fs/btrfs-progs
+	optfeature "Load kernel modules and drop this privilege for real init" \
+		sys-libs/libcap
+	optfeature "Support CIFS" net-fs/cifs-utils
+	optfeature "Decrypt devices encrypted with cryptsetup/LUKS" \
+		"sys-fs/cryptsetup[-static-libs]"
+	optfeature "Support for GPG-encrypted keys for crypt module" \
+		app-crypt/gnupg
+	optfeature \
+		"Allows use of dash instead of default bash (on your own risk)" \
+		app-shells/dash
+	optfeature "Support iSCSI" sys-block/open-iscsi
+	optfeature "Support Logical Volume Manager" sys-fs/lvm2
+	optfeature "Support MD devices, also known as software RAID devices" \
+		sys-fs/mdadm
+	optfeature "Support Device Mapper multipathing" sys-fs/multipath-tools
+	optfeature "Plymouth boot splash"  '>=sys-boot/plymouth-0.8.5-r5'
+	optfeature "Support network block devices" sys-block/nbd
+	optfeature "Support NFS" net-fs/nfs-utils net-nds/rpcbind
+	optfeature \
+		"Install ssh and scp along with config files and specified keys" \
+		net-misc/openssh
+	optfeature "Enable logging with syslog-ng or rsyslog" app-admin/syslog-ng \
+		app-admin/rsyslog
+}

diff --git a/sys-kernel/dracut/dracut-9999.ebuild b/sys-kernel/dracut/dracut-9999.ebuild
new file mode 100644
index 0000000..a686d06
--- /dev/null
+++ b/sys-kernel/dracut/dracut-9999.ebuild
@@ -0,0 +1,158 @@
+# Copyright 1999-2018 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit bash-completion-r1 eutils linux-info systemd toolchain-funcs
+
+if [[ ${PV} == 9999 ]] ; then
+	inherit git-r3
+	EGIT_REPO_URI="https://github.com/dracutdevs/dracut"
+else
+	[[ "${PV}" = *_rc* ]] || \
+	KEYWORDS="~alpha amd64 ~arm ia64 ~mips ~ppc ~ppc64 sparc x86"
+	SRC_URI="mirror://kernel/linux/utils/boot/${PN}/${P}.tar.xz"
+fi
+
+DESCRIPTION="Generic initramfs generation tool"
+HOMEPAGE="https://dracut.wiki.kernel.org"
+
+LICENSE="GPL-2"
+SLOT="0"
+IUSE="debug selinux"
+
+# Tests need root privileges, bug #298014
+RESTRICT="test"
+
+COMMON_DEPEND=">=sys-apps/kmod-23[tools]
+	virtual/pkgconfig
+	virtual/udev
+	"
+RDEPEND="${COMMON_DEPEND}
+	app-arch/cpio
+	>=app-shells/bash-4.0:0
+	sys-apps/coreutils[xattr(-)]
+	|| (
+		>=sys-apps/sysvinit-2.87-r3
+		sys-apps/systemd[sysv-utils]
+	)
+	>=sys-apps/util-linux-2.21
+
+	debug? ( dev-util/strace )
+	selinux? (
+		sec-policy/selinux-dracut
+		sys-libs/libselinux
+		sys-libs/libsepol
+	)
+	"
+DEPEND="${COMMON_DEPEND}
+	app-text/asciidoc
+	app-text/docbook-xml-dtd:4.5
+	>=app-text/docbook-xsl-stylesheets-1.75.2
+	>=dev-libs/libxslt-1.1.26
+	"
+
+DOCS=( AUTHORS HACKING NEWS README README.generic README.kernel README.modules
+	README.testsuite TODO )
+
+QA_MULTILIB_PATHS="usr/lib/dracut/.*"
+
+PATCHES=(
+)
+
+src_configure() {
+	local myconf=(
+		--prefix="${EPREFIX}/usr"
+		--sysconfdir="${EPREFIX}/etc"
+		--bashcompletiondir="$(get_bashcompdir)"
+		--systemdsystemunitdir="$(systemd_get_systemunitdir)"
+	)
+
+	tc-export CC PKG_CONFIG
+
+	echo ./configure "${myconf[@]}"
+	./configure "${myconf[@]}" || die
+}
+
+src_install() {
+	default
+
+	local libdirs=( /$(get_libdir) /usr/$(get_libdir) )
+	if [[ ${SYMLINK_LIB} = yes && $(get_libdir) != lib ]]; then
+		# Preserve lib -> lib64 symlinks in initramfs
+		libdirs+=( /lib /usr/lib )
+	fi
+
+	einfo "Setting libdirs to \"${libdirs[*]}\" ..."
+	echo "libdirs=\"${libdirs[*]}\"" > "${T}/gentoo.conf" || die
+	insinto "/usr/lib/dracut/dracut.conf.d"
+	doins "${T}/gentoo.conf"
+
+	insinto /etc/logrotate.d
+	newins dracut.logrotate dracut
+
+	docinto html
+	dodoc dracut.html
+}
+
+pkg_postinst() {
+	if linux-info_get_any_version && linux_config_exists; then
+		ewarn ""
+		ewarn "If the following test report contains a missing kernel"
+		ewarn "configuration option, you should reconfigure and rebuild your"
+		ewarn "kernel before booting image generated with this Dracut version."
+		ewarn ""
+
+		local CONFIG_CHECK="~BLK_DEV_INITRD ~DEVTMPFS"
+
+		# Kernel configuration options descriptions:
+		local ERROR_DEVTMPFS='CONFIG_DEVTMPFS: "Maintain a devtmpfs filesystem to mount at /dev" '
+		ERROR_DEVTMPFS+='is missing and REQUIRED'
+		local ERROR_BLK_DEV_INITRD='CONFIG_BLK_DEV_INITRD: "Initial RAM filesystem and RAM disk '
+		ERROR_BLK_DEV_INITRD+='(initramfs/initrd) support" is missing and REQUIRED'
+
+		check_extra_config
+		echo
+	else
+		ewarn ""
+		ewarn "Your kernel configuration couldn't be checked."
+		ewarn "Please check manually if following options are enabled:"
+		ewarn ""
+		ewarn "  CONFIG_BLK_DEV_INITRD"
+		ewarn "  CONFIG_DEVTMPFS"
+		ewarn ""
+	fi
+
+	elog "To get additional features, a number of optional runtime"
+	elog "dependencies may be installed:"
+	elog ""
+	optfeature "Networking support"  net-misc/curl "net-misc/dhcp[client]" \
+		sys-apps/iproute2 "net-misc/iputils[arping]"
+	optfeature \
+		"Measure performance of the boot process for later visualisation" \
+		app-benchmarks/bootchart2 app-admin/killproc sys-process/acct
+	optfeature "Scan for Btrfs on block devices"  sys-fs/btrfs-progs
+	optfeature "Load kernel modules and drop this privilege for real init" \
+		sys-libs/libcap
+	optfeature "Support CIFS" net-fs/cifs-utils
+	optfeature "Decrypt devices encrypted with cryptsetup/LUKS" \
+		"sys-fs/cryptsetup[-static-libs]"
+	optfeature "Support for GPG-encrypted keys for crypt module" \
+		app-crypt/gnupg
+	optfeature \
+		"Allows use of dash instead of default bash (on your own risk)" \
+		app-shells/dash
+	optfeature "Support iSCSI" sys-block/open-iscsi
+	optfeature "Support Logical Volume Manager" sys-fs/lvm2
+	optfeature "Support MD devices, also known as software RAID devices" \
+		sys-fs/mdadm
+	optfeature "Support Device Mapper multipathing" sys-fs/multipath-tools
+	optfeature "Plymouth boot splash"  '>=sys-boot/plymouth-0.8.5-r5'
+	optfeature "Support network block devices" sys-block/nbd
+	optfeature "Support NFS" net-fs/nfs-utils net-nds/rpcbind
+	optfeature \
+		"Install ssh and scp along with config files and specified keys" \
+		net-misc/openssh
+	optfeature "Enable logging with syslog-ng or rsyslog" app-admin/syslog-ng \
+		app-admin/rsyslog
+}

diff --git a/sys-kernel/dracut/files/044-0001-base-dracut-lib.sh-dev_unit_name-guard-against-dev-b.patch b/sys-kernel/dracut/files/044-0001-base-dracut-lib.sh-dev_unit_name-guard-against-dev-b.patch
new file mode 100644
index 0000000..fd6f118
--- /dev/null
+++ b/sys-kernel/dracut/files/044-0001-base-dracut-lib.sh-dev_unit_name-guard-against-dev-b.patch
@@ -0,0 +1,32 @@
+From c41df7e1db1adc51399ab2c22f251b15eb2065b1 Mon Sep 17 00:00:00 2001
+From: Alexander Tsoy <alexander@tsoy.me>
+Date: Tue, 5 Jan 2016 22:11:57 +0300
+Subject: [PATCH] base/dracut-lib.sh:dev_unit_name() guard against $dev
+ beginning with "-"
+
+crypt/parse-crypt.sh generate initqueue job which always call
+dev_unit_name() with an argument beginning with "-". This results
+in the following error:
+
+dracut-initqueue[307]: + systemd-escape -p -cfb4aa43-2f02-4c6b-a313-60ea99288087
+dracut-initqueue[307]: systemd-escape: invalid option -- 'c'
+---
+ modules.d/99base/dracut-lib.sh | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/modules.d/99base/dracut-lib.sh b/modules.d/99base/dracut-lib.sh
+index ad03394..0a0b1b9 100755
+--- a/modules.d/99base/dracut-lib.sh
++++ b/modules.d/99base/dracut-lib.sh
+@@ -874,7 +874,7 @@ dev_unit_name()
+     local dev="$1"
+ 
+     if command -v systemd-escape >/dev/null; then
+-        systemd-escape -p  "$dev"
++        systemd-escape -p -- "$dev"
+         return
+     fi
+ 
+-- 
+2.10.2
+

diff --git a/sys-kernel/dracut/files/044-0002-systemd-initrd-add-initrd-root-device.target.patch b/sys-kernel/dracut/files/044-0002-systemd-initrd-add-initrd-root-device.target.patch
new file mode 100644
index 0000000..21cb679
--- /dev/null
+++ b/sys-kernel/dracut/files/044-0002-systemd-initrd-add-initrd-root-device.target.patch
@@ -0,0 +1,24 @@
+From d4efc0aeeecc470d9a267b7f3c130f472488905c Mon Sep 17 00:00:00 2001
+From: Harald Hoyer <harald@redhat.com>
+Date: Wed, 25 May 2016 15:06:29 +0200
+Subject: [PATCH] systemd-initrd: add initrd-root-device.target
+
+---
+ modules.d/01systemd-initrd/module-setup.sh | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/modules.d/01systemd-initrd/module-setup.sh b/modules.d/01systemd-initrd/module-setup.sh
+index fb6a9ea..c1ccd2a 100755
+--- a/modules.d/01systemd-initrd/module-setup.sh
++++ b/modules.d/01systemd-initrd/module-setup.sh
+@@ -28,6 +28,7 @@ install() {
+     inst_multiple -o \
+         $systemdsystemunitdir/initrd.target \
+         $systemdsystemunitdir/initrd-fs.target \
++        $systemdsystemunitdir/initrd-root-device.target \
+         $systemdsystemunitdir/initrd-root-fs.target \
+         $systemdsystemunitdir/initrd-switch-root.target \
+         $systemdsystemunitdir/initrd-switch-root.service \
+-- 
+2.10.2
+

diff --git a/sys-kernel/dracut/files/044-0003-50-dracut.install-use-bin-bash-shebang.patch b/sys-kernel/dracut/files/044-0003-50-dracut.install-use-bin-bash-shebang.patch
new file mode 100644
index 0000000..85ebc7e
--- /dev/null
+++ b/sys-kernel/dracut/files/044-0003-50-dracut.install-use-bin-bash-shebang.patch
@@ -0,0 +1,23 @@
+From 69395a528aed99ec04b16c14ebacf4c2e10afd26 Mon Sep 17 00:00:00 2001
+From: Mike Gilbert <floppym@gentoo.org>
+Date: Fri, 4 Nov 2016 13:09:28 -0400
+Subject: [PATCH] 50-dracut.install: use /bin/bash shebang
+
+This script utilizes several bash-specific constructs.
+---
+ 50-dracut.install | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/50-dracut.install b/50-dracut.install
+index 7d081d5..54c71d4 100755
+--- a/50-dracut.install
++++ b/50-dracut.install
+@@ -1,4 +1,4 @@
+-#!/bin/sh
++#!/bin/bash
+ 
+ COMMAND="$1"
+ KERNEL_VERSION="$2"
+-- 
+2.10.2
+

diff --git a/sys-kernel/dracut/files/045-systemdutildir.patch b/sys-kernel/dracut/files/045-systemdutildir.patch
new file mode 100644
index 0000000..e56abba
--- /dev/null
+++ b/sys-kernel/dracut/files/045-systemdutildir.patch
@@ -0,0 +1,45 @@
+From ed5cc98864c28eab2c4cb45ec0f67450699aaaa8 Mon Sep 17 00:00:00 2001
+From: Mike Gilbert <floppym@gentoo.org>
+Date: Mon, 3 Jul 2017 22:39:42 -0400
+Subject: [PATCH] dracut.sh: improve udevdir and systemdutildir fallback logic
+
+Check for a common binary in systemdutildir. This resolves an issue on
+split-usr systems, where it is common to have both /lib/systemd[/system]
+and /usr/lib/systemd[/user] present.
+
+Check for systemd-udevd specifically, since some distros (Gentoo) allow
+udev to be installed without the rest of the systemd stack.
+
+Similar logic is applied to udevdir simply for consistency.
+---
+ dracut.sh | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/dracut.sh b/dracut.sh
+index 64d94201..67c12a72 100755
+--- a/dracut.sh
++++ b/dracut.sh
+@@ -1266,16 +1266,16 @@ done
+ [[ -d $udevdir ]] \
+     || udevdir="$(pkg-config udev --variable=udevdir 2>/dev/null)"
+ if ! [[ -d "$udevdir" ]]; then
+-    [[ ! -h /lib ]] && [[ -d /lib/udev ]] && udevdir=/lib/udev
+-    [[ -d /usr/lib/udev ]] && udevdir=/usr/lib/udev
++    [[ -e /lib/udev/collect ]] && udevdir=/lib/udev
++    [[ -e /usr/lib/udev/collect ]] && udevdir=/usr/lib/udev
+ fi
+ 
+ [[ -d $systemdutildir ]] \
+     || systemdutildir=$(pkg-config systemd --variable=systemdutildir 2>/dev/null)
+ 
+ if ! [[ -d "$systemdutildir" ]]; then
+-    [[ ! -h /lib ]] && [[ -d /lib/systemd ]] && systemdutildir=/lib/systemd
+-    [[ -d /usr/lib/systemd ]] && systemdutildir=/usr/lib/systemd
++    [[ -e /lib/systemd/systemd-udevd ]] && systemdutildir=/lib/systemd
++    [[ -e /usr/lib/systemd/systemd-udevd ]] && systemdutildir=/usr/lib/systemd
+ fi
+ 
+ [[ -d $systemdsystemunitdir ]] \
+-- 
+2.13.2
+

diff --git a/sys-kernel/dracut/files/046-amd-microcode.patch b/sys-kernel/dracut/files/046-amd-microcode.patch
new file mode 100644
index 0000000..c351275
--- /dev/null
+++ b/sys-kernel/dracut/files/046-amd-microcode.patch
@@ -0,0 +1,30 @@
+From a1250a704e33c59f2395aaad054db1c745a5c98a Mon Sep 17 00:00:00 2001
+From: Daniel Molkentin <dmolkentin@suse.com>
+Date: Tue, 12 Dec 2017 17:48:36 +0100
+Subject: [PATCH] Simplify microcode lookup for for AMD CPUs
+
+---
+ dracut-functions.sh | 7 ++-----
+ 1 file changed, 2 insertions(+), 5 deletions(-)
+
+diff --git a/dracut-functions.sh b/dracut-functions.sh
+index 112b2434..d7fc5303 100755
+--- a/dracut-functions.sh
++++ b/dracut-functions.sh
+@@ -661,11 +661,8 @@ get_ucode_file ()
+     local stepping=`grep -E "stepping" /proc/cpuinfo | head -1 | sed s/.*:\ //`
+ 
+     if [[ "$(get_cpu_vendor)" == "AMD" ]]; then
+-        # If family greater than or equal to 0x16
+-        if [[ $family -ge 22 ]]; then
+-            printf "microcode_amd_fam16h.bin"
+-        elif [[ $family -eq 21 ]]; then
+-            printf "microcode_amd_fam15h.bin"
++        if [[ $family -ge 21 ]]; then
++            printf "microcode_amd_fam%xh.bin" $family
+         else
+             printf "microcode_amd.bin"
+         fi
+-- 
+2.16.0.rc0
+

diff --git a/sys-kernel/dracut/files/047-all-fix-issues-found-by-shellcheck.patch b/sys-kernel/dracut/files/047-all-fix-issues-found-by-shellcheck.patch
new file mode 100644
index 0000000..d5cbe04
--- /dev/null
+++ b/sys-kernel/dracut/files/047-all-fix-issues-found-by-shellcheck.patch
@@ -0,0 +1,77 @@
+From 3aa37cafde734719f2377600a17459fad30edfbc Mon Sep 17 00:00:00 2001
+From: Lukas Nykryn <lnykryn@redhat.com>
+Date: Fri, 2 Mar 2018 12:29:46 +0100
+Subject: [PATCH 06/14] all: fix issues found by shellcheck
+To: <initramfs@vger.kernel.org>
+
+Error: SHELLCHECK_WARNING:
+/usr/lib/dracut/dracut-init.sh:939:20: error: Argument to implicit -n is always true due to literal strings. [SC2157]
+  937|   dracut_kernel_post() {
+  938|       for _f in modules.builtin.bin modules.builtin modules.order; do
+  939|->         [[ $srcmods/$_f ]] && inst_simple "$srcmods/$_f" "/lib/modules/$kernel/$_f"
+  940|       done
+  941|
+
+Error: SHELLCHECK_WARNING:
+/usr/lib/dracut/modules.d/98syslog/parse-syslog-opts.sh:18:12: error: This expression is constant. Did you forget a $ somewhere? [SC2078]
+   16|       elif [ -e /sbin/syslogd ]; then
+   17|           syslogtype="syslogd"
+   18|->     elif [ /sbin/syslog-ng ]; then
+   19|           syslogtype="syslog-ng"
+   20|       else
+
+Error: SHELLCHECK_WARNING:
+/usr/lib/dracut/modules.d/90crypt/crypt-lib.sh:15:29: error: Since you double quoted this, it will not word split, and the loop will only run once. [SC2066]
+   13|               strstr "$d" "${luks##luks-}" && return 0
+   14|               if [ -n "$dev" ]; then
+   15|->                 for _dev in "$(devnames $d)"; do
+   16|                       [ "$dev" -ef "$_dev" ] && return 0
+   17|                   done
+---
+ dracut-init.sh                          | 2 +-
+ modules.d/90crypt/crypt-lib.sh          | 2 +-
+ modules.d/98syslog/parse-syslog-opts.sh | 2 +-
+ 3 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/dracut-init.sh b/dracut-init.sh
+index 53e6f13a..1278c638 100644
+--- a/dracut-init.sh
++++ b/dracut-init.sh
+@@ -942,7 +942,7 @@ for_each_kmod_dep() {
+ 
+ dracut_kernel_post() {
+     for _f in modules.builtin.bin modules.builtin modules.order; do
+-        [[ $srcmods/$_f ]] && inst_simple "$srcmods/$_f" "/lib/modules/$kernel/$_f"
++        [[ -e $srcmods/$_f ]] && inst_simple "$srcmods/$_f" "/lib/modules/$kernel/$_f"
+     done
+ 
+     # generate module dependencies for the initrd
+diff --git a/modules.d/90crypt/crypt-lib.sh b/modules.d/90crypt/crypt-lib.sh
+index 532b9a71..bbf485e0 100755
+--- a/modules.d/90crypt/crypt-lib.sh
++++ b/modules.d/90crypt/crypt-lib.sh
+@@ -12,7 +12,7 @@ crypttab_contains() {
+             strstr "${l##luks-}" "${luks##luks-}" && return 0
+             strstr "$d" "${luks##luks-}" && return 0
+             if [ -n "$dev" ]; then
+-                for _dev in "$(devnames $d)"; do
++                for _dev in $(devnames $d); do
+                     [ "$dev" -ef "$_dev" ] && return 0
+                 done
+             fi
+diff --git a/modules.d/98syslog/parse-syslog-opts.sh b/modules.d/98syslog/parse-syslog-opts.sh
+index 50ec2759..9ec6ad47 100755
+--- a/modules.d/98syslog/parse-syslog-opts.sh
++++ b/modules.d/98syslog/parse-syslog-opts.sh
+@@ -15,7 +15,7 @@ detect_syslog() {
+         syslogtype="rsyslogd"
+     elif [ -e /sbin/syslogd ]; then
+         syslogtype="syslogd"
+-    elif [ /sbin/syslog-ng ]; then
++    elif [ -e /sbin/syslog-ng ]; then
+         syslogtype="syslog-ng"
+     else
+         warn "Could not find any syslog binary although the syslogmodule is selected to be installed. Please check."
+-- 
+2.16.1
+

diff --git a/sys-kernel/dracut/files/047-plymouth-fix-detection-of-plymouth-directory.patch b/sys-kernel/dracut/files/047-plymouth-fix-detection-of-plymouth-directory.patch
new file mode 100644
index 0000000..42f8772
--- /dev/null
+++ b/sys-kernel/dracut/files/047-plymouth-fix-detection-of-plymouth-directory.patch
@@ -0,0 +1,31 @@
+From fe6c7e0f06cde65effb3503a47c31ac39aceefb6 Mon Sep 17 00:00:00 2001
+From: Alexander Tsoy <alexander@tsoy.me>
+Date: Fri, 23 Mar 2018 11:52:27 +0300
+Subject: [PATCH 14/14] plymouth: fix detection of plymouth directory
+To: <initramfs@vger.kernel.org>
+
+Some distros have both /usr/lib/plymouth and /usr/libexec/plymouth
+directorirs, so we should check the existance of plymouth-populate-initrd
+script.
+
+Fixes: 421b46f8ae89cfe2b62e880a8a5079ee8c1b3aae
+---
+ modules.d/50plymouth/module-setup.sh | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/modules.d/50plymouth/module-setup.sh b/modules.d/50plymouth/module-setup.sh
+index 5fbca8b0..b51913e8 100755
+--- a/modules.d/50plymouth/module-setup.sh
++++ b/modules.d/50plymouth/module-setup.sh
+@@ -6,7 +6,7 @@ pkglib_dir() {
+         _dirs+=" /usr/lib/$(dpkg-architecture -qDEB_HOST_MULTIARCH)/plymouth"
+     fi
+     for _dir in $_dirs; do
+-        if [ -d $_dir ]; then
++        if [ -x $_dir/plymouth-populate-initrd ]; then
+             echo $_dir
+             return
+         fi
+-- 
+2.16.1
+

diff --git a/sys-kernel/dracut/files/048-dracut-install-simplify-ldd-parsing-logic.patch b/sys-kernel/dracut/files/048-dracut-install-simplify-ldd-parsing-logic.patch
new file mode 100644
index 0000000..aa9c543
--- /dev/null
+++ b/sys-kernel/dracut/files/048-dracut-install-simplify-ldd-parsing-logic.patch
@@ -0,0 +1,41 @@
+From 6d886bb74d1608e4565d926aa259ea5afc9df7b9 Mon Sep 17 00:00:00 2001
+From: Mike Gilbert <floppym@gentoo.org>
+Date: Thu, 4 Oct 2018 16:45:47 -0400
+Subject: [PATCH] dracut-install: simplify ldd parsing logic
+
+The previous logic would not handle absolute paths on the left side of
+the "=>" properly. For example, on Gentoo ARM64, ldd outputs this:
+
+	/lib/ld-linux-aarch64.so.1 => /lib64/ld-linux-aarch64.so.1
+
+At runtime, the kernel tries to load the file from /lib, and fails if we
+only provide it in /lib64.
+
+Instead of looking for the first slash after the "=>", just look for the
+first slash, period. This would fail if we somehow had a relative path
+on the left side (foo/libbar.so), but I'm not aware of any binaries that
+would contain such an entry in DT_NEEDED.
+
+Bug: https://bugs.gentoo.org/667752
+Signed-off-by: Mike Gilbert <floppym@gentoo.org>
+---
+ install/dracut-install.c | 6 +-----
+ 1 file changed, 1 insertion(+), 5 deletions(-)
+
+diff --git a/install/dracut-install.c b/install/dracut-install.c
+index 88bca1d44..5f352b360 100644
+--- a/install/dracut-install.c
++++ b/install/dracut-install.c
+@@ -479,11 +479,7 @@ static int resolve_deps(const char *src)
+                 if (strstr(buf, destrootdir))
+                         break;
+ 
+-                p = strstr(buf, "=>");
+-                if (!p)
+-                        p = buf;
+-
+-                p = strchr(p, '/');
++                p = strchr(buf, '/');
+                 if (p) {
+                         char *q;
+ 

diff --git a/sys-kernel/dracut/files/dracut-044-bash-4.4.patch b/sys-kernel/dracut/files/dracut-044-bash-4.4.patch
new file mode 100644
index 0000000..3144c8e
--- /dev/null
+++ b/sys-kernel/dracut/files/dracut-044-bash-4.4.patch
@@ -0,0 +1,80 @@
+diff -urN dracut-044.orig/modules.d/50drm/module-setup.sh dracut-044/modules.d/50drm/module-setup.sh
+--- dracut-044.orig/modules.d/50drm/module-setup.sh	2015-11-25 16:22:28.000000000 +0300
++++ dracut-044/modules.d/50drm/module-setup.sh	2016-09-28 02:50:08.914967926 +0300
+@@ -24,9 +24,9 @@
+             local _fname _fcont
+             while read _fname || [ -n "$_fname" ]; do
+                 case "$_fname" in
+-                    *.ko)    _fcont="$(<        $_fname)" ;;
+-                    *.ko.gz) _fcont="$(gzip -dc $_fname)" ;;
+-                    *.ko.xz) _fcont="$(xz -dc   $_fname)" ;;
++                    *.ko)    _fcont="$(<        $_fname tr -d \\0)" ;;
++                    *.ko.gz) _fcont="$(gzip -dc $_fname | tr -d \\0)" ;;
++                    *.ko.xz) _fcont="$(xz -dc   $_fname | tr -d \\0)" ;;
+                 esac
+                 [[   $_fcont =~ $_drm_drivers
+                 && ! $_fcont =~ iw_handler_get_spy ]] \
+diff -urN dracut-044.orig/modules.d/90kernel-modules/module-setup.sh dracut-044/modules.d/90kernel-modules/module-setup.sh
+--- dracut-044.orig/modules.d/90kernel-modules/module-setup.sh	2015-11-25 16:22:28.000000000 +0300
++++ dracut-044/modules.d/90kernel-modules/module-setup.sh	2016-09-28 02:49:11.725390294 +0300
+@@ -10,9 +10,9 @@
+             function bmf1() {
+                 local _f
+                 while read _f || [ -n "$_f" ]; do case "$_f" in
+-                    *.ko)    [[ $(<         $_f) =~ $_blockfuncs ]] && echo "$_f" ;;
+-                    *.ko.gz) [[ $(gzip -dc <$_f) =~ $_blockfuncs ]] && echo "$_f" ;;
+-                    *.ko.xz) [[ $(xz -dc   <$_f) =~ $_blockfuncs ]] && echo "$_f" ;;
++                    *.ko)    [[ $(<         $_f tr -d \\0) =~ $_blockfuncs ]] && echo "$_f" ;;
++                    *.ko.gz) [[ $(gzip -dc <$_f | tr -d \\0) =~ $_blockfuncs ]] && echo "$_f" ;;
++                    *.ko.xz) [[ $(xz -dc   <$_f | tr -d \\0) =~ $_blockfuncs ]] && echo "$_f" ;;
+                     esac
+                 done
+                 return 0
+diff -urN dracut-044.orig/modules.d/90kernel-network-modules/module-setup.sh dracut-044/modules.d/90kernel-network-modules/module-setup.sh
+--- dracut-044.orig/modules.d/90kernel-network-modules/module-setup.sh	2015-11-25 16:22:28.000000000 +0300
++++ dracut-044/modules.d/90kernel-network-modules/module-setup.sh	2016-09-28 02:51:08.202422231 +0300
+@@ -26,9 +26,9 @@
+             while read _fname; do
+                 [[ $_fname =~ $_unwanted_drivers ]] && continue
+                 case "$_fname" in
+-                    *.ko)    _fcont="$(<        $_fname)" ;;
+-                    *.ko.gz) _fcont="$(gzip -dc $_fname)" ;;
+-                    *.ko.xz) _fcont="$(xz -dc   $_fname)" ;;
++                    *.ko)    _fcont="$(<        $_fname tr -d \\0)" ;;
++                    *.ko.gz) _fcont="$(gzip -dc $_fname | tr -d \\0)" ;;
++                    *.ko.xz) _fcont="$(xz -dc   $_fname | tr -d \\0)" ;;
+                 esac
+                 [[   $_fcont =~ $_net_drivers
+                 && ! $_fcont =~ iw_handler_get_spy ]] \
+diff -urN dracut-044.orig/modules.d/90multipath/module-setup.sh dracut-044/modules.d/90multipath/module-setup.sh
+--- dracut-044.orig/modules.d/90multipath/module-setup.sh	2015-11-25 16:22:28.000000000 +0300
++++ dracut-044/modules.d/90multipath/module-setup.sh	2016-09-28 02:49:11.726390235 +0300
+@@ -58,9 +58,9 @@
+             local _f
+             while read _f || [ -n "$_f" ]; do
+                 case "$_f" in
+-                    *.ko)    [[ $(<         $_f) =~ $_funcs ]] && echo "$_f" ;;
+-                    *.ko.gz) [[ $(gzip -dc <$_f) =~ $_funcs ]] && echo "$_f" ;;
+-                    *.ko.xz) [[ $(xz -dc   <$_f) =~ $_funcs ]] && echo "$_f" ;;
++                    *.ko)    [[ $(<         $_f tr -d \\0) =~ $_funcs ]] && echo "$_f" ;;
++                    *.ko.gz) [[ $(gzip -dc <$_f | tr -d \\0) =~ $_funcs ]] && echo "$_f" ;;
++                    *.ko.xz) [[ $(xz -dc   <$_f | tr -d \\0) =~ $_funcs ]] && echo "$_f" ;;
+                 esac
+             done
+             return 0
+diff -urN dracut-044.orig/modules.d/95iscsi/module-setup.sh dracut-044/modules.d/95iscsi/module-setup.sh
+--- dracut-044.orig/modules.d/95iscsi/module-setup.sh	2015-11-25 16:22:28.000000000 +0300
++++ dracut-044/modules.d/95iscsi/module-setup.sh	2016-09-28 02:49:11.726390235 +0300
+@@ -168,9 +168,9 @@
+             local _f
+             while read _f || [ -n "$_f" ]; do
+                 case "$_f" in
+-                    *.ko)    [[ $(<         $_f) =~ $_funcs ]] && echo "$_f" ;;
+-                    *.ko.gz) [[ $(gzip -dc <$_f) =~ $_funcs ]] && echo "$_f" ;;
+-                    *.ko.xz) [[ $(xz -dc   <$_f) =~ $_funcs ]] && echo "$_f" ;;
++                    *.ko)    [[ $(<         $_f tr -d \\0) =~ $_funcs ]] && echo "$_f" ;;
++                    *.ko.gz) [[ $(gzip -dc <$_f | tr -d \\0) =~ $_funcs ]] && echo "$_f" ;;
++                    *.ko.xz) [[ $(xz -dc   <$_f | tr -d \\0) =~ $_funcs ]] && echo "$_f" ;;
+                 esac
+             done
+             return 0

diff --git a/sys-kernel/dracut/files/dracut-044-preserve-xattrs-when-copying.patch b/sys-kernel/dracut/files/dracut-044-preserve-xattrs-when-copying.patch
new file mode 100644
index 0000000..3146d84
--- /dev/null
+++ b/sys-kernel/dracut/files/dracut-044-preserve-xattrs-when-copying.patch
@@ -0,0 +1,51 @@
+From 61c761bc2c35fb244d46fbbde97161f5927071dc Mon Sep 17 00:00:00 2001
+From: Stefan Berger <stefanb@us.ibm.com>
+Date: Tue, 25 Oct 2016 15:09:49 -0400
+Subject: [PATCH] dracut-install: preserve extended attributes when copying
+ files
+
+Preserve extended attributes when copying files using dracut-install.
+
+The copying of extended attributes avoids file execution denials when
+the Linux Integrity Measurement's Appraisal mode is active. In that mode
+executables need their file signatures copied. In particular, this patch
+solves the problem that dependent libaries are not included in the
+initramfs since the copied programs could not be executed due to missing
+signatures. The following audit record shows the type of failure that
+is now prevented:
+
+type=INTEGRITY_DATA msg=audit(1477409025.492:30065): pid=922 uid=0
+ auid=4294967295 ses=4294967295
+ subj=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023
+ op="appraise_data" cause="IMA-signature-required"
+ comm="ld-linux-x86-64"
+ name="/var/tmp/dracut.R6ySa4/initramfs/usr/bin/journalctl"
+ dev="dm-0" ino=37136 res=0
+
+Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
+---
+ install/dracut-install.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/install/dracut-install.c b/install/dracut-install.c
+index fe30bba..c0f1c17 100644
+--- a/install/dracut-install.c
++++ b/install/dracut-install.c
+@@ -294,7 +294,7 @@ static int cp(const char *src, const char *dst)
+  normal_copy:
+         pid = fork();
+         if (pid == 0) {
+-                execlp("cp", "cp", "--reflink=auto", "--sparse=auto", "--preserve=mode,timestamps", "-fL", src, dst,
++                execlp("cp", "cp", "--reflink=auto", "--sparse=auto", "--preserve=mode,timestamps,xattr", "-fL", src, dst,
+                        NULL);
+                 _exit(EXIT_FAILURE);
+         }
+@@ -302,7 +302,7 @@ static int cp(const char *src, const char *dst)
+         while (waitpid(pid, &ret, 0) < 0) {
+                 if (errno != EINTR) {
+                         ret = -1;
+-                        log_error("Failed: cp --reflink=auto --sparse=auto --preserve=mode,timestamps -fL %s %s", src,
++                        log_error("Failed: cp --reflink=auto --sparse=auto --preserve=mode,timestamps,xattr -fL %s %s", src,
+                                   dst);
+                         break;
+                 }

diff --git a/sys-kernel/dracut/metadata.xml b/sys-kernel/dracut/metadata.xml
new file mode 100644
index 0000000..153efe6
--- /dev/null
+++ b/sys-kernel/dracut/metadata.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+	<maintainer type="person">
+		<email>chutzpah@gentoo.org</email>
+		<name>Patrick McLean</name>
+	</maintainer>
+	<maintainer type="person">
+		<email>alexander@tsoy.me</email>
+		<name>Alexander Tsoy</name>
+	</maintainer>
+	<maintainer type="person">
+		<email>floppym@gentoo.org</email>
+		<name>Mike Gilbert</name>
+	</maintainer>
+	<use>
+		<flag name="debug">Module installing additional tools like strace, file
+			editor, ssh and more</flag>
+	</use>
+	<longdescription lang="en">
+	Generic, modular initramfs generation tool that can be used across various
+	distributions.
+	</longdescription>
+</pkgmetadata>

diff --git a/sys-kernel/genkernel-next/genkernel-next-66.ebuild b/sys-kernel/genkernel-next/genkernel-next-66.ebuild
new file mode 100644
index 0000000..ee350d7
--- /dev/null
+++ b/sys-kernel/genkernel-next/genkernel-next-66.ebuild
@@ -0,0 +1,51 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+SRC_URI="https://github.com/Sabayon/genkernel-next/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+KEYWORDS="~alpha amd64 ~arm ia64 ppc ppc64 x86"
+inherit bash-completion-r1
+
+DESCRIPTION="Gentoo automatic kernel building scripts, reloaded"
+HOMEPAGE="https://www.gentoo.org/"
+
+LICENSE="GPL-2"
+SLOT="0"
+
+IUSE="cryptsetup dmraid gpg iscsi mdadm plymouth selinux"
+DOCS=( AUTHORS )
+
+DEPEND="app-text/asciidoc
+	sys-fs/e2fsprogs
+	!sys-fs/eudev[-kmod,modutils]
+	selinux? ( sys-libs/libselinux )"
+RDEPEND="${DEPEND}
+	!sys-kernel/genkernel
+	cryptsetup? ( sys-fs/cryptsetup )
+	dmraid? ( >=sys-fs/dmraid-1.0.0_rc16 )
+	gpg? ( app-crypt/gnupg )
+	iscsi? ( sys-block/open-iscsi )
+	mdadm? ( sys-fs/mdadm )
+	plymouth? ( sys-boot/plymouth )
+	app-portage/portage-utils
+	app-arch/cpio
+	>=app-misc/pax-utils-0.6
+	!<sys-apps/openrc-0.9.9
+	sys-apps/util-linux
+	sys-block/thin-provisioning-tools
+	sys-fs/lvm2"
+
+src_prepare() {
+	default
+	sed -i "/^GK_V=/ s:GK_V=.*:GK_V=${PV}:g" "${S}/genkernel" || \
+		die "Could not setup release"
+}
+
+src_install() {
+	default
+
+	doman "${S}"/genkernel.8
+
+	newbashcomp "${S}"/genkernel.bash genkernel
+}

diff --git a/sys-kernel/genkernel-next/genkernel-next-68.ebuild b/sys-kernel/genkernel-next/genkernel-next-68.ebuild
new file mode 100644
index 0000000..842dfa4
--- /dev/null
+++ b/sys-kernel/genkernel-next/genkernel-next-68.ebuild
@@ -0,0 +1,51 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+SRC_URI="https://github.com/Sabayon/genkernel-next/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+KEYWORDS="~alpha amd64 ~arm ~hppa ia64 ppc ppc64 x86"
+inherit bash-completion-r1
+
+DESCRIPTION="Gentoo automatic kernel building scripts, reloaded"
+HOMEPAGE="https://www.gentoo.org/"
+
+LICENSE="GPL-2"
+SLOT="0"
+
+IUSE="cryptsetup dmraid gpg iscsi mdadm plymouth selinux"
+DOCS=( AUTHORS )
+
+DEPEND="app-text/asciidoc
+	sys-fs/e2fsprogs
+	!sys-fs/eudev[-kmod,modutils]
+	selinux? ( sys-libs/libselinux )"
+RDEPEND="${DEPEND}
+	!sys-kernel/genkernel
+	cryptsetup? ( sys-fs/cryptsetup )
+	dmraid? ( >=sys-fs/dmraid-1.0.0_rc16 )
+	gpg? ( app-crypt/gnupg )
+	iscsi? ( sys-block/open-iscsi )
+	mdadm? ( sys-fs/mdadm )
+	plymouth? ( sys-boot/plymouth )
+	app-portage/portage-utils
+	app-arch/cpio
+	>=app-misc/pax-utils-0.6
+	!<sys-apps/openrc-0.9.9
+	sys-apps/util-linux
+	sys-block/thin-provisioning-tools
+	sys-fs/lvm2"
+
+src_prepare() {
+	default
+	sed -i "/^GK_V=/ s:GK_V=.*:GK_V=${PV}:g" "${S}/genkernel" || \
+		die "Could not setup release"
+}
+
+src_install() {
+	default
+
+	doman "${S}"/genkernel.8
+
+	newbashcomp "${S}"/genkernel.bash genkernel
+}

diff --git a/sys-kernel/genkernel-next/metadata.xml b/sys-kernel/genkernel-next/metadata.xml
new file mode 100644
index 0000000..546f683
--- /dev/null
+++ b/sys-kernel/genkernel-next/metadata.xml
@@ -0,0 +1,19 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+	<maintainer type="person">
+		<email>mudler@gentoo.org</email>
+		<name>Ettore Di Giacinto</name>
+	</maintainer>
+	<use>
+		<flag name="cryptsetup">Enable support for Luks disk enrcyption using <pkg>sys-fs/cryptsetup</pkg></flag>
+		<flag name="dmraid">Enable support for DMRAID (include dmraid dependency)</flag>
+		<flag name="gpg">Enable support for GPG (include gnupg dependency)</flag>
+		<flag name="iscsi">Enable support for open-iscsi (include open-iscsi dependency)</flag>
+		<flag name="mdadm">Enable support for mdadm (include mdadm dependency)</flag>
+		<flag name="plymouth">Enable support for Plymouth (include Plymouth dependency)</flag>
+	</use>
+	<upstream>
+		<remote-id type="github">Sabayon/genkernel-next</remote-id>
+	</upstream>
+</pkgmetadata>

diff --git a/sys-kernel/genkernel/files/genkernel-3.4.52.4-crc32c.patch b/sys-kernel/genkernel/files/genkernel-3.4.52.4-crc32c.patch
new file mode 100644
index 0000000..48dada2
--- /dev/null
+++ b/sys-kernel/genkernel/files/genkernel-3.4.52.4-crc32c.patch
@@ -0,0 +1,130 @@
+modules_load: add crc32c
+
+commit 7308d72c3280da22cd94337b0eb248cdc53cb842 upstream.
+
+Bug: https://bugs.gentoo.org/655110
+
+--- a/arch/alpha/modules_load
++++ b/arch/alpha/modules_load
+@@ -27,3 +27,5 @@ MODULES_USB="ehci-pci ehci-hcd uhci usb-ohci hid usb-storage uhci-hcd ohci-hcd x
+ # Filesystems
+ MODULES_FS="ext2 ext3 ext4 btrfs reiserfs jfs nfs xfs zfs fuse"
+ 
++# Crypto
++MODULES_CRYPTO="sha256_generic cbc crc32c aes_generic xts"
+--- a/arch/arm/modules_load
++++ b/arch/arm/modules_load
+@@ -27,3 +27,5 @@ MODULES_USB="ehci-pci ehci-hcd uhci usb-ohci hid usb-storage uhci-hcd ohci-hcd x
+ # Filesystems
+ MODULES_FS="ext2 ext3 ext4 btrfs reiserfs jfs nfs xfs zfs fuse"
+ 
++# Crypto
++MODULES_CRYPTO="sha256_generic cbc crc32c aes_generic xts"
+--- a/arch/ia64/modules_load
++++ b/arch/ia64/modules_load
+@@ -26,3 +26,6 @@ MODULES_USB="ehci-pci ehci-hcd uhci usb-ohci hid usb-storage uhci-hcd ohci-hcd x
+ 
+ # Filesystems
+ MODULES_FS="ext2 ext3 ext4 btrfs reiserfs jfs nfs xfs zfs fuse"
++
++# Crypto
++MODULES_CRYPTO="sha256_generic cbc crc32c aes_generic xts"
+--- a/arch/mips/modules_load
++++ b/arch/mips/modules_load
+@@ -27,3 +27,5 @@ MODULES_USB="ehci-pci ehci-hcd uhci usb-ohci hid usb-storage uhci-hcd ohci-hcd x
+ # Filesystems
+ MODULES_FS="ext2 ext3 ext4 btrfs reiserfs jfs nfs xfs zfs fuse"
+ 
++# Crypto
++MODULES_CRYPTO="sha256_generic cbc crc32c aes_generic xts"
+--- a/arch/parisc/modules_load
++++ b/arch/parisc/modules_load
+@@ -27,3 +27,5 @@ MODULES_USB="ehci-pci ehci-hcd uhci usb-ohci hid usb-storage uhci-hcd ohci-hcd x
+ # Filesystems
+ MODULES_FS="ext2 ext3 ext4 btrfs reiserfs jfs nfs xfs zfs fuse"
+ 
++# Crypto
++MODULES_CRYPTO="sha256_generic cbc crc32c aes_generic xts"
+--- a/arch/parisc64/modules_load
++++ b/arch/parisc64/modules_load
+@@ -26,3 +26,6 @@ MODULES_USB="ehci-pci ehci-hcd uhci usb-ohci hid usb-storage uhci-hcd ohci-hcd x
+ 
+ # Filesystems
+ MODULES_FS="ext2 ext3 ext4 btrfs reiserfs jfs nfs xfs zfs fuse"
++
++# Crypto
++MODULES_CRYPTO="sha256_generic cbc crc32c aes_generic xts"
+--- a/arch/ppc/modules_load
++++ b/arch/ppc/modules_load
+@@ -27,3 +27,5 @@ MODULES_USB="ehci-pci ehci-hcd uhci usb-ohci hid usb-storage uhci-hcd ohci-hcd x
+ # Filesystems
+ MODULES_FS="ext2 ext3 ext4 btrfs reiserfs jfs nfs xfs zfs fuse"
+ 
++# Crypto
++MODULES_CRYPTO="sha256_generic cbc crc32c aes_generic xts"
+--- a/arch/ppc64/modules_load
++++ b/arch/ppc64/modules_load
+@@ -26,3 +26,6 @@ MODULES_USB="ehci-pci ehci-hcd uhci usb-ohci hid usb-storage uhci-hcd ohci-hcd x
+ 
+ # Filesystems
+ MODULES_FS="ext2 ext3 ext4 btrfs reiserfs jfs nfs xfs zfs fuse"
++
++# Crypto
++MODULES_CRYPTO="sha256_generic cbc crc32c aes_generic xts"
+--- a/arch/s390/modules_load
++++ b/arch/s390/modules_load
+@@ -27,3 +27,5 @@ MODULES_USB="ehci-pci ehci-hcd uhci usb-ohci hid usb-storage uhci-hcd ohci-hcd x
+ # Filesystems
+ MODULES_FS="ext2 ext3 ext4 btrfs reiserfs jfs nfs xfs zfs fuse"
+ 
++# Crypto
++MODULES_CRYPTO="sha256_generic cbc crc32c aes_generic xts"
+--- a/arch/sparc/modules_load
++++ b/arch/sparc/modules_load
+@@ -27,3 +27,5 @@ MODULES_USB="ehci-pci ehci-hcd uhci usb-ohci hid usb-storage uhci-hcd ohci-hcd x
+ # Filesystems
+ MODULES_FS="ext2 ext3 ext4 btrfs reiserfs jfs nfs xfs zfs fuse"
+ 
++# Crypto
++MODULES_CRYPTO="sha256_generic cbc crc32c aes_generic xts"
+--- a/arch/sparc64/modules_load
++++ b/arch/sparc64/modules_load
+@@ -26,3 +26,6 @@ MODULES_USB="ehci-pci ehci-hcd uhci usb-ohci hid usb-storage uhci-hcd ohci-hcd x
+ 
+ # Filesystems
+ MODULES_FS="ext2 ext3 ext4 btrfs reiserfs jfs nfs xfs zfs fuse"
++
++# Crypto
++MODULES_CRYPTO="sha256_generic cbc crc32c aes_generic xts"
+--- a/arch/um/modules_load
++++ b/arch/um/modules_load
+@@ -27,3 +27,5 @@ MODULES_USB="ehci-pci ehci-hcd uhci usb-ohci hid usb-storage uhci-hcd ohci-hcd x
+ # Filesystems
+ MODULES_FS="ext2 ext3 ext4 btrfs reiserfs jfs nfs xfs zfs fuse"
+ 
++# Crypto
++MODULES_CRYPTO="sha256_generic cbc crc32c aes_generic xts"
+--- a/arch/x86/modules_load
++++ b/arch/x86/modules_load
+@@ -29,4 +29,4 @@ MODULES_USB="ehci-pci ehci-hcd uhci usb-ohci hid usb-storage uhci-hcd ohci-hcd x
+ MODULES_FS="ext2 ext3 ext4 btrfs reiserfs jfs nfs xfs zfs fuse"
+ 
+ # Crypto
+-MODULES_CRYPTO="sha256_generic cbc aes_generic aes_586 aesni-intel xts"
++MODULES_CRYPTO="sha256_generic cbc crc32c aes_generic aes_586 aesni-intel xts"
+--- a/arch/x86_64/modules_load
++++ b/arch/x86_64/modules_load
+@@ -28,4 +28,4 @@ MODULES_USB="ehci-pci ehci-hcd uhci usb-ohci hid usb-storage uhci-hcd ohci-hcd x
+ MODULES_FS="ext2 ext3 ext4 btrfs reiserfs jfs nfs xfs zfs fuse"
+ 
+ # Crypto
+-MODULES_CRYPTO="sha256_generic cbc aes_generic aes-x86_64 aesni-intel xts"
++MODULES_CRYPTO="sha256_generic cbc crc32c aes_generic aes-x86_64 aesni-intel xts"
+--- a/defaults/modules_load
++++ b/defaults/modules_load
+@@ -28,4 +28,4 @@ MODULES_USB="ehci-hcd uhci usb-ohci hid usb-storage uhci-hcd ohci-hcd xhci-hcd x
+ MODULES_FS="ext2 ext3 ext4 btrfs reiserfs jfs nfs xfs zfs fuse"
+ 
+ # Crypto
+-MODULES_CRYPTO="sha256_generic cbc aes_generic xts"
++MODULES_CRYPTO="sha256_generic cbc crc32c aes_generic xts"

diff --git a/sys-kernel/genkernel/files/genkernel-3.4.52.4-grub-mkconfig.patch b/sys-kernel/genkernel/files/genkernel-3.4.52.4-grub-mkconfig.patch
new file mode 100644
index 0000000..9e55301
--- /dev/null
+++ b/sys-kernel/genkernel/files/genkernel-3.4.52.4-grub-mkconfig.patch
@@ -0,0 +1,17 @@
+diff --git a/gen_bootloader.sh b/gen_bootloader.sh
+index 4bbd303..fdca749 100755
+--- a/gen_bootloader.sh
++++ b/gen_bootloader.sh
+@@ -49,8 +49,10 @@ set_bootloader_grub2() {
+ 	fi
+ 
+ 	print_info 1 "You can customize Grub2 parameters in /etc/default/grub."
+-	print_info 1 "Running grub2-mkconfig to create ${GRUB_CONF}..."
+-	grub2-mkconfig -o "${GRUB_CONF}" 2> /dev/null || gen_die "grub2-mkconfig failed"
++	print_info 1 "Running grub-mkconfig to create ${GRUB_CONF}..."
++	grub-mkconfig -o "${GRUB_CONF}" 2> /dev/null ||
++		grub2-mkconfig -o "${GRUB_CONF}" 2> /dev/null ||
++		gen_die "grub-mkconfig failed"
+ 	[ "${BUILD_RAMDISK}" -ne 0 ] && sed -i 's/ro single/ro debug/' "${GRUB_CONF}"
+ }
+ 

diff --git a/sys-kernel/genkernel/files/genkernel-3.4.52.4-system-map.patch b/sys-kernel/genkernel/files/genkernel-3.4.52.4-system-map.patch
new file mode 100644
index 0000000..1a85c49
--- /dev/null
+++ b/sys-kernel/genkernel/files/genkernel-3.4.52.4-system-map.patch
@@ -0,0 +1,38 @@
+From 4fb8318037a8ea12f54b7c711d702b432113f233 Mon Sep 17 00:00:00 2001
+From: Mike Frysinger <vapier@gentoo.org>
+Date: Sun, 27 Mar 2016 02:04:41 -0400
+Subject: [PATCH] adjust System.map die check for #570822
+
+Builds with newer genkernel have been failing in catalyst like so:
+* ERROR: Could not copy System.map from kerncache for the kernel package!
+
+The code that added it seems to have been meant to check the minkernpackage/
+subdir where the file was renamed instead of the current subdir.  Change the
+check to simplify verify the mv didn't fail instead of duplicating the file
+name entirely.
+
+Signed-off-by: Mike Frysinger <vapier@gentoo.org>
+---
+ gen_package.sh | 5 +----
+ 1 file changed, 1 insertion(+), 4 deletions(-)
+
+diff --git a/gen_package.sh b/gen_package.sh
+index 9dd166b..b08ff03 100755
+--- a/gen_package.sh
++++ b/gen_package.sh
+@@ -45,11 +45,8 @@ gen_minkernpackage() {
+ 	if [ "${KERNCACHE}" != "" ]
+ 	then
+ 		/bin/tar -xj -C ${TEMP}/minkernpackage -f ${KERNCACHE} System.map-${ARCH}-${KV}
+-		mv minkernpackage/{System.map-${ARCH}-${KV},System.map-${KNAME}-${ARCH}-${KV}}
+-		if [ ! -f System.map-${KNAME}-${ARCH}-${KV} ]
+-		then
++		mv minkernpackage/{System.map-${ARCH}-${KV},System.map-${KNAME}-${ARCH}-${KV}} ||
+ 			gen_die 'Could not copy System.map from kerncache for the kernel package!'
+-		fi
+ 	else
+ 		cp "${KERNEL_OUTPUTDIR}/System.map" "${TEMP}/minkernpackage/System.map-${KNAME}-${ARCH}-${KV}" || gen_die 'Could not copy System.map for the kernel package!';
+ 	fi
+-- 
+2.7.4
+

diff --git a/sys-kernel/genkernel/files/genkernel.bash b/sys-kernel/genkernel/files/genkernel.bash
new file mode 100644
index 0000000..ed6b1c1
--- /dev/null
+++ b/sys-kernel/genkernel/files/genkernel.bash
@@ -0,0 +1,73 @@
+# genkernel (8) completion
+# Copyright 2006 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# Written by Aron Griffis <agriffis@gentoo.org>
+
+_genkernel()
+{
+    declare cur prev genkernel_help actions params
+    COMPREPLY=()
+    cur=${COMP_WORDS[COMP_CWORD]}
+    prev=${COMP_WORDS[COMP_CWORD-1]}
+
+    # extract initial list of params/actions from genkernel --help
+    genkernel_help=$(command genkernel --help)
+    actions=( $(<<<"$genkernel_help" sed -n \
+	'/^Available Actions:/,/^$/s/^[[:space:]]\+\([^[:space:]]\+\).*/\1/p') )
+    params=( $(<<<"$genkernel_help" egrep -oe '--[^[:space:]]{2,}') )
+
+    # attempt to complete the current parameter based on the list
+    COMPREPLY=($(compgen -W "${params[*]/=*/=} ${actions[*]}" -- "$cur"))
+
+    # if we don't have a rhs to complete
+    if [[ ${#COMPREPLY[@]} -gt 1 ]]; then
+	return
+    elif [[ ${#COMPREPLY[@]} -eq 0 && $cur != --*=* ]]; then
+	return
+    elif [[ ${#COMPREPLY[@]} -eq 1 && $COMPREPLY != --*= ]]; then
+	# using nospace completion, add an explicit space
+	COMPREPLY="${COMPREPLY} "
+	return
+    fi
+
+    # we have a unique lhs and need to complete the rhs
+    declare args lhs rhs
+    if [[ ${#COMPREPLY[@]} -eq 1 ]]; then
+	lhs=$COMPREPLY
+    else
+	lhs=${cur%%=*}=
+	rhs=${cur#*=}
+    fi
+
+    # genkernel's help gives clues as to what belongs on the rhs.
+    # extract the clue for the current parameter
+    args=" ${params[*]} "
+    args="${args##* $lhs}"
+    args="${args%% *}"
+
+    # generate a list of completions for the argument; this replaces args with
+    # an array of results
+    args=( $(case $args in
+	('<0-5>') compgen -W "$(echo {1..5})" -- "$rhs" ;;
+	('<outfile>'|'<file>') compgen -A file -o plusdirs -- "$rhs" ;;
+	('<dir>') compgen -A directory -S / -- "$rhs" ;;
+	('<tbz2>') compgen -G '*.tbz2' -G '*.tar.bz2' -o plusdirs -- "$rhs" ;;
+	(*) compgen -o bashdefault -- "$rhs" ;; # punt
+    esac) )
+
+    # we're using nospace completion to prevent spaces after paths that aren't
+    # "done" yet.  So do some hacking to the args to add spaces after
+    # non-directories.
+    declare slash=/
+    args=( "${args[@]/%/ }" )			# add space to all
+    args=( "${args[@]/%$slash /$slash}" )	# remove space from dirs
+
+    # recreate COMPREPLY
+    if [[ $cur == "$lhs"* ]]; then
+	COMPREPLY=( "${args[@]}" )
+    elif [[ ${#args[@]} -gt 0 ]]; then
+	COMPREPLY=( "${args[@]/#/$lhs}" )
+    fi
+}
+
+complete -o nospace -F _genkernel genkernel

diff --git a/sys-kernel/genkernel/files/initramfs.mounts b/sys-kernel/genkernel/files/initramfs.mounts
new file mode 100644
index 0000000..b34c675
--- /dev/null
+++ b/sys-kernel/genkernel/files/initramfs.mounts
@@ -0,0 +1,23 @@
+# This specifies which mounts from your fstab should be mounted before
+# switching to the real root. If this file is missing, genkernel's code will
+# default to just "/usr", which will suffice on most systems with a seperate
+# /usr mount.
+#
+# If you have a complex configuration with a bindmount or symlink at /usr, or
+# need some other mountpoints at boot, you should update this file such that
+# /usr and anything else needed will be available after the switch into the
+# real root.
+#
+# The lines without comments in this file are used as exact matches against the
+# second column of your /etc/fstab and the device, fstype and mount options are
+# taken from that line in fstab. If no line matches, the line from this file
+# will be ignored.
+#
+
+/usr
+
+# If you had some need of these:
+#/usr/local
+#/opt
+#/var
+#/home

diff --git a/sys-kernel/genkernel/genkernel-3.4.52.3.ebuild b/sys-kernel/genkernel/genkernel-3.4.52.3.ebuild
new file mode 100644
index 0000000..d68852a
--- /dev/null
+++ b/sys-kernel/genkernel/genkernel-3.4.52.3.ebuild
@@ -0,0 +1,154 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+# genkernel-9999        -> latest Git branch "master"
+# genkernel-VERSION     -> normal genkernel release
+
+EAPI=5 # approved 2012.09.11, required by all profiles since 2014.03.12
+
+inherit bash-completion-r1 epatch
+
+VERSION_BUSYBOX='1.20.2'
+VERSION_DMRAID='1.0.0.rc16-3'
+VERSION_MDADM='3.1.5'
+VERSION_FUSE='2.8.6'
+VERSION_ISCSI='2.0-872'
+VERSION_LVM='2.02.88'
+VERSION_UNIONFS_FUSE='0.24'
+VERSION_GPG='1.4.11'
+
+RH_HOME="ftp://sourceware.org/pub"
+DM_HOME="https://people.redhat.com/~heinzm/sw/dmraid/src"
+BB_HOME="https://busybox.net/downloads"
+
+COMMON_URI="${DM_HOME}/dmraid-${VERSION_DMRAID}.tar.bz2
+		${DM_HOME}/old/dmraid-${VERSION_DMRAID}.tar.bz2
+		mirror://kernel/linux/utils/raid/mdadm/mdadm-${VERSION_MDADM}.tar.bz2
+		${RH_HOME}/lvm2/LVM2.${VERSION_LVM}.tgz
+		${RH_HOME}/lvm2/old/LVM2.${VERSION_LVM}.tgz
+		${BB_HOME}/busybox-${VERSION_BUSYBOX}.tar.bz2
+		http://www.open-iscsi.org/bits/open-iscsi-${VERSION_ISCSI}.tar.gz
+		mirror://gentoo/open-iscsi-${VERSION_ISCSI}.tar.gz
+		mirror://sourceforge/fuse/fuse-${VERSION_FUSE}.tar.gz
+		http://podgorny.cz/unionfs-fuse/releases/unionfs-fuse-${VERSION_UNIONFS_FUSE}.tar.bz2
+		mirror://gentoo/unionfs-fuse-${VERSION_UNIONFS_FUSE}.tar.bz2
+		mirror://gnupg/gnupg/gnupg-${VERSION_GPG}.tar.bz2"
+
+if [[ ${PV} == 9999* ]]
+then
+	EGIT_REPO_URI="https://anongit.gentoo.org/git/proj/${PN}.git"
+	inherit git-r3
+	S="${WORKDIR}/${P}"
+	SRC_URI="${COMMON_URI}"
+else
+	SRC_URI="https://dev.gentoo.org/~zerochaos/distfiles/${P}.tar.xz
+		${COMMON_URI}"
+	KEYWORDS="alpha amd64 arm hppa ia64 ~mips ppc ppc64 s390 sh sparc x86"
+fi
+
+DESCRIPTION="Gentoo automatic kernel building scripts"
+HOMEPAGE="https://www.gentoo.org"
+
+LICENSE="GPL-2"
+SLOT="0"
+RESTRICT=""
+IUSE="cryptsetup ibm selinux"
+
+DEPEND="sys-fs/e2fsprogs
+	selinux? ( sys-libs/libselinux )"
+RDEPEND="${DEPEND}
+	cryptsetup? ( sys-fs/cryptsetup )
+	app-arch/cpio
+	>=app-misc/pax-utils-0.2.1
+	!<sys-apps/openrc-0.9.9"
+# pax-utils is used for lddtree
+
+if [[ ${PV} == 9999* ]]; then
+	DEPEND="${DEPEND} app-text/asciidoc"
+fi
+
+pkg_pretend() {
+	if ! use cryptsetup && has_version "sys-kernel/genkernel[crypt]"; then
+		ewarn "Local use flag 'crypt' has been renamed to 'cryptsetup' (bug #414523)."
+		ewarn "Please set flag 'cryptsetup' for this very package if you would like"
+		ewarn "to have genkernel create an initramfs with LUKS support."
+		ewarn "Sorry for the inconvenience."
+		echo
+	fi
+}
+
+src_prepare() {
+	if [[ ${PV} == 9999* ]] ; then
+		einfo "Producing ChangeLog from Git history..."
+		pushd "${S}/.git" >/dev/null || die
+		git log > "${S}"/ChangeLog || die
+		popd >/dev/null || die
+	fi
+	if use selinux ; then
+		sed -i 's/###//g' "${S}"/gen_compile.sh || die
+	fi
+
+	# Update software.sh
+	sed -i \
+		-e "s:VERSION_BUSYBOX:$VERSION_BUSYBOX:" \
+		-e "s:VERSION_MDADM:$VERSION_MDADM:" \
+		-e "s:VERSION_DMRAID:$VERSION_DMRAID:" \
+		-e "s:VERSION_FUSE:$VERSION_FUSE:" \
+		-e "s:VERSION_ISCSI:$VERSION_ISCSI:" \
+		-e "s:VERSION_LVM:$VERSION_LVM:" \
+		-e "s:VERSION_UNIONFS_FUSE:$VERSION_UNIONFS_FUSE:" \
+		-e "s:VERSION_GPG:$VERSION_GPG:" \
+		"${S}"/defaults/software.sh \
+		|| die "Could not adjust versions"
+
+	epatch_user
+}
+
+src_compile() {
+	if [[ ${PV} == 9999* ]]; then
+		emake
+	fi
+}
+
+src_install() {
+	insinto /etc
+	doins "${S}"/genkernel.conf
+
+	doman genkernel.8
+	dodoc AUTHORS ChangeLog README TODO
+	dobin genkernel
+	rm -f genkernel genkernel.8 AUTHORS ChangeLog README TODO genkernel.conf
+
+	if use ibm ; then
+		cp "${S}"/arch/ppc64/kernel-2.6{-pSeries,} || die
+	else
+		cp "${S}"/arch/ppc64/kernel-2.6{.g5,} || die
+	fi
+	insinto /usr/share/genkernel
+	doins -r "${S}"/*
+
+	newbashcomp "${FILESDIR}"/genkernel.bash "${PN}"
+	insinto /etc
+	doins "${FILESDIR}"/initramfs.mounts
+
+	cd "${DISTDIR}"
+	insinto /usr/share/genkernel/distfiles
+	doins ${A/${P}.tar.xz/}
+}
+
+pkg_postinst() {
+	echo
+	elog 'Documentation is available in the genkernel manual page'
+	elog 'as well as the following URL:'
+	echo
+	elog 'https://wiki.gentoo.org/wiki/Genkernel'
+	echo
+	ewarn "This package is known to not work with reiser4.  If you are running"
+	ewarn "reiser4 and have a problem, do not file a bug.  We know it does not"
+	ewarn "work and we don't plan on fixing it since reiser4 is the one that is"
+	ewarn "broken in this regard.  Try using a sane filesystem like ext4."
+	echo
+	ewarn "The LUKS support has changed from versions prior to 3.4.4.  Now,"
+	ewarn "you use crypt_root=/dev/blah instead of real_root=luks:/dev/blah."
+	echo
+}

diff --git a/sys-kernel/genkernel/genkernel-3.4.52.4-r1.ebuild b/sys-kernel/genkernel/genkernel-3.4.52.4-r1.ebuild
new file mode 100644
index 0000000..c33c583
--- /dev/null
+++ b/sys-kernel/genkernel/genkernel-3.4.52.4-r1.ebuild
@@ -0,0 +1,155 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+# genkernel-9999        -> latest Git branch "master"
+# genkernel-VERSION     -> normal genkernel release
+
+EAPI=5 # approved 2012.09.11, required by all profiles since 2014.03.12
+
+inherit bash-completion-r1 epatch
+
+VERSION_BUSYBOX='1.20.2'
+VERSION_DMRAID='1.0.0.rc16-3'
+VERSION_MDADM='3.1.5'
+VERSION_FUSE='2.8.6'
+VERSION_ISCSI='2.0-872'
+VERSION_LVM='2.02.88'
+VERSION_UNIONFS_FUSE='0.24'
+VERSION_GPG='1.4.11'
+
+RH_HOME="ftp://sourceware.org/pub"
+DM_HOME="https://people.redhat.com/~heinzm/sw/dmraid/src"
+BB_HOME="https://busybox.net/downloads"
+
+COMMON_URI="${DM_HOME}/dmraid-${VERSION_DMRAID}.tar.bz2
+		${DM_HOME}/old/dmraid-${VERSION_DMRAID}.tar.bz2
+		mirror://kernel/linux/utils/raid/mdadm/mdadm-${VERSION_MDADM}.tar.bz2
+		${RH_HOME}/lvm2/LVM2.${VERSION_LVM}.tgz
+		${RH_HOME}/lvm2/old/LVM2.${VERSION_LVM}.tgz
+		${BB_HOME}/busybox-${VERSION_BUSYBOX}.tar.bz2
+		http://www.open-iscsi.org/bits/open-iscsi-${VERSION_ISCSI}.tar.gz
+		mirror://gentoo/open-iscsi-${VERSION_ISCSI}.tar.gz
+		mirror://sourceforge/fuse/fuse-${VERSION_FUSE}.tar.gz
+		http://podgorny.cz/unionfs-fuse/releases/unionfs-fuse-${VERSION_UNIONFS_FUSE}.tar.bz2
+		mirror://gentoo/unionfs-fuse-${VERSION_UNIONFS_FUSE}.tar.bz2
+		mirror://gnupg/gnupg/gnupg-${VERSION_GPG}.tar.bz2"
+
+if [[ ${PV} == 9999* ]]
+then
+	EGIT_REPO_URI="https://anongit.gentoo.org/git/proj/${PN}.git"
+	inherit git-r3
+	S="${WORKDIR}/${P}"
+	SRC_URI="${COMMON_URI}"
+else
+	SRC_URI="https://dev.gentoo.org/~zerochaos/distfiles/${P}.tar.xz
+		${COMMON_URI}"
+	KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 s390 ~sh ~sparc ~x86"
+fi
+
+DESCRIPTION="Gentoo automatic kernel building scripts"
+HOMEPAGE="https://www.gentoo.org"
+
+LICENSE="GPL-2"
+SLOT="0"
+RESTRICT=""
+IUSE="cryptsetup ibm selinux"
+
+DEPEND="sys-fs/e2fsprogs
+	selinux? ( sys-libs/libselinux )"
+RDEPEND="${DEPEND}
+	cryptsetup? ( sys-fs/cryptsetup )
+	app-arch/cpio
+	>=app-misc/pax-utils-0.2.1
+	!<sys-apps/openrc-0.9.9"
+# pax-utils is used for lddtree
+
+if [[ ${PV} == 9999* ]]; then
+	DEPEND="${DEPEND} app-text/asciidoc"
+fi
+
+pkg_pretend() {
+	if ! use cryptsetup && has_version "sys-kernel/genkernel[crypt]"; then
+		ewarn "Local use flag 'crypt' has been renamed to 'cryptsetup' (bug #414523)."
+		ewarn "Please set flag 'cryptsetup' for this very package if you would like"
+		ewarn "to have genkernel create an initramfs with LUKS support."
+		ewarn "Sorry for the inconvenience."
+		echo
+	fi
+}
+
+src_prepare() {
+	if [[ ${PV} == 9999* ]] ; then
+		einfo "Producing ChangeLog from Git history..."
+		pushd "${S}/.git" >/dev/null || die
+		git log > "${S}"/ChangeLog || die
+		popd >/dev/null || die
+	fi
+	if use selinux ; then
+		sed -i 's/###//g' "${S}"/gen_compile.sh || die
+	fi
+
+	# Update software.sh
+	sed -i \
+		-e "s:VERSION_BUSYBOX:$VERSION_BUSYBOX:" \
+		-e "s:VERSION_MDADM:$VERSION_MDADM:" \
+		-e "s:VERSION_DMRAID:$VERSION_DMRAID:" \
+		-e "s:VERSION_FUSE:$VERSION_FUSE:" \
+		-e "s:VERSION_ISCSI:$VERSION_ISCSI:" \
+		-e "s:VERSION_LVM:$VERSION_LVM:" \
+		-e "s:VERSION_UNIONFS_FUSE:$VERSION_UNIONFS_FUSE:" \
+		-e "s:VERSION_GPG:$VERSION_GPG:" \
+		"${S}"/defaults/software.sh \
+		|| die "Could not adjust versions"
+
+	epatch "${FILESDIR}"/${P}-system-map.patch #570822
+	epatch_user
+}
+
+src_compile() {
+	if [[ ${PV} == 9999* ]]; then
+		emake
+	fi
+}
+
+src_install() {
+	insinto /etc
+	doins "${S}"/genkernel.conf
+
+	doman genkernel.8
+	dodoc AUTHORS ChangeLog README TODO
+	dobin genkernel
+	rm -f genkernel genkernel.8 AUTHORS ChangeLog README TODO genkernel.conf
+
+	if use ibm ; then
+		cp "${S}"/arch/ppc64/kernel-2.6{-pSeries,} || die
+	else
+		cp "${S}"/arch/ppc64/kernel-2.6{.g5,} || die
+	fi
+	insinto /usr/share/genkernel
+	doins -r "${S}"/*
+
+	newbashcomp "${FILESDIR}"/genkernel.bash "${PN}"
+	insinto /etc
+	doins "${FILESDIR}"/initramfs.mounts
+
+	cd "${DISTDIR}"
+	insinto /usr/share/genkernel/distfiles
+	doins ${A/${P}.tar.xz/}
+}
+
+pkg_postinst() {
+	echo
+	elog 'Documentation is available in the genkernel manual page'
+	elog 'as well as the following URL:'
+	echo
+	elog 'https://wiki.gentoo.org/wiki/Genkernel'
+	echo
+	ewarn "This package is known to not work with reiser4.  If you are running"
+	ewarn "reiser4 and have a problem, do not file a bug.  We know it does not"
+	ewarn "work and we don't plan on fixing it since reiser4 is the one that is"
+	ewarn "broken in this regard.  Try using a sane filesystem like ext4."
+	echo
+	ewarn "The LUKS support has changed from versions prior to 3.4.4.  Now,"
+	ewarn "you use crypt_root=/dev/blah instead of real_root=luks:/dev/blah."
+	echo
+}

diff --git a/sys-kernel/genkernel/genkernel-3.4.52.4-r2.ebuild b/sys-kernel/genkernel/genkernel-3.4.52.4-r2.ebuild
new file mode 100644
index 0000000..017c88e
--- /dev/null
+++ b/sys-kernel/genkernel/genkernel-3.4.52.4-r2.ebuild
@@ -0,0 +1,156 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+# genkernel-9999        -> latest Git branch "master"
+# genkernel-VERSION     -> normal genkernel release
+
+EAPI=5 # approved 2012.09.11, required by all profiles since 2014.03.12
+
+inherit bash-completion-r1 epatch
+
+VERSION_BUSYBOX='1.20.2'
+VERSION_DMRAID='1.0.0.rc16-3'
+VERSION_MDADM='3.1.5'
+VERSION_FUSE='2.8.6'
+VERSION_ISCSI='2.0-872'
+VERSION_LVM='2.02.88'
+VERSION_UNIONFS_FUSE='0.24'
+VERSION_GPG='1.4.11'
+
+RH_HOME="ftp://sourceware.org/pub"
+DM_HOME="https://people.redhat.com/~heinzm/sw/dmraid/src"
+BB_HOME="https://busybox.net/downloads"
+
+COMMON_URI="${DM_HOME}/dmraid-${VERSION_DMRAID}.tar.bz2
+		${DM_HOME}/old/dmraid-${VERSION_DMRAID}.tar.bz2
+		mirror://kernel/linux/utils/raid/mdadm/mdadm-${VERSION_MDADM}.tar.bz2
+		${RH_HOME}/lvm2/LVM2.${VERSION_LVM}.tgz
+		${RH_HOME}/lvm2/old/LVM2.${VERSION_LVM}.tgz
+		${BB_HOME}/busybox-${VERSION_BUSYBOX}.tar.bz2
+		http://www.open-iscsi.org/bits/open-iscsi-${VERSION_ISCSI}.tar.gz
+		mirror://gentoo/open-iscsi-${VERSION_ISCSI}.tar.gz
+		mirror://sourceforge/fuse/fuse-${VERSION_FUSE}.tar.gz
+		http://podgorny.cz/unionfs-fuse/releases/unionfs-fuse-${VERSION_UNIONFS_FUSE}.tar.bz2
+		mirror://gentoo/unionfs-fuse-${VERSION_UNIONFS_FUSE}.tar.bz2
+		mirror://gnupg/gnupg/gnupg-${VERSION_GPG}.tar.bz2"
+
+if [[ ${PV} == 9999* ]]
+then
+	EGIT_REPO_URI="https://anongit.gentoo.org/git/proj/${PN}.git"
+	inherit git-r3
+	S="${WORKDIR}/${P}"
+	SRC_URI="${COMMON_URI}"
+else
+	SRC_URI="https://dev.gentoo.org/~zerochaos/distfiles/${P}.tar.xz
+		${COMMON_URI}"
+	KEYWORDS="alpha amd64 arm hppa ia64 ~mips ppc ppc64 ~s390 ~sh sparc x86"
+fi
+
+DESCRIPTION="Gentoo automatic kernel building scripts"
+HOMEPAGE="https://www.gentoo.org"
+
+LICENSE="GPL-2"
+SLOT="0"
+RESTRICT=""
+IUSE="cryptsetup ibm selinux"
+
+DEPEND="sys-fs/e2fsprogs
+	selinux? ( sys-libs/libselinux )"
+RDEPEND="${DEPEND}
+	cryptsetup? ( sys-fs/cryptsetup )
+	app-arch/cpio
+	>=app-misc/pax-utils-0.2.1
+	!<sys-apps/openrc-0.9.9"
+# pax-utils is used for lddtree
+
+if [[ ${PV} == 9999* ]]; then
+	DEPEND="${DEPEND} app-text/asciidoc"
+fi
+
+pkg_pretend() {
+	if ! use cryptsetup && has_version "sys-kernel/genkernel[crypt]"; then
+		ewarn "Local use flag 'crypt' has been renamed to 'cryptsetup' (bug #414523)."
+		ewarn "Please set flag 'cryptsetup' for this very package if you would like"
+		ewarn "to have genkernel create an initramfs with LUKS support."
+		ewarn "Sorry for the inconvenience."
+		echo
+	fi
+}
+
+src_prepare() {
+	if [[ ${PV} == 9999* ]] ; then
+		einfo "Producing ChangeLog from Git history..."
+		pushd "${S}/.git" >/dev/null || die
+		git log > "${S}"/ChangeLog || die
+		popd >/dev/null || die
+	fi
+	if use selinux ; then
+		sed -i 's/###//g' "${S}"/gen_compile.sh || die
+	fi
+
+	# Update software.sh
+	sed -i \
+		-e "s:VERSION_BUSYBOX:$VERSION_BUSYBOX:" \
+		-e "s:VERSION_MDADM:$VERSION_MDADM:" \
+		-e "s:VERSION_DMRAID:$VERSION_DMRAID:" \
+		-e "s:VERSION_FUSE:$VERSION_FUSE:" \
+		-e "s:VERSION_ISCSI:$VERSION_ISCSI:" \
+		-e "s:VERSION_LVM:$VERSION_LVM:" \
+		-e "s:VERSION_UNIONFS_FUSE:$VERSION_UNIONFS_FUSE:" \
+		-e "s:VERSION_GPG:$VERSION_GPG:" \
+		"${S}"/defaults/software.sh \
+		|| die "Could not adjust versions"
+
+	epatch "${FILESDIR}"/${P}-system-map.patch #570822
+	epatch "${FILESDIR}"/${P}-grub-mkconfig.patch #591200
+	epatch_user
+}
+
+src_compile() {
+	if [[ ${PV} == 9999* ]]; then
+		emake
+	fi
+}
+
+src_install() {
+	insinto /etc
+	doins "${S}"/genkernel.conf
+
+	doman genkernel.8
+	dodoc AUTHORS ChangeLog README TODO
+	dobin genkernel
+	rm -f genkernel genkernel.8 AUTHORS ChangeLog README TODO genkernel.conf
+
+	if use ibm ; then
+		cp "${S}"/arch/ppc64/kernel-2.6{-pSeries,} || die
+	else
+		cp "${S}"/arch/ppc64/kernel-2.6{.g5,} || die
+	fi
+	insinto /usr/share/genkernel
+	doins -r "${S}"/*
+
+	newbashcomp "${FILESDIR}"/genkernel.bash "${PN}"
+	insinto /etc
+	doins "${FILESDIR}"/initramfs.mounts
+
+	cd "${DISTDIR}"
+	insinto /usr/share/genkernel/distfiles
+	doins ${A/${P}.tar.xz/}
+}
+
+pkg_postinst() {
+	echo
+	elog 'Documentation is available in the genkernel manual page'
+	elog 'as well as the following URL:'
+	echo
+	elog 'https://wiki.gentoo.org/wiki/Genkernel'
+	echo
+	ewarn "This package is known to not work with reiser4.  If you are running"
+	ewarn "reiser4 and have a problem, do not file a bug.  We know it does not"
+	ewarn "work and we don't plan on fixing it since reiser4 is the one that is"
+	ewarn "broken in this regard.  Try using a sane filesystem like ext4."
+	echo
+	ewarn "The LUKS support has changed from versions prior to 3.4.4.  Now,"
+	ewarn "you use crypt_root=/dev/blah instead of real_root=luks:/dev/blah."
+	echo
+}

diff --git a/sys-kernel/genkernel/genkernel-3.4.52.4-r3.ebuild b/sys-kernel/genkernel/genkernel-3.4.52.4-r3.ebuild
new file mode 100644
index 0000000..9228685
--- /dev/null
+++ b/sys-kernel/genkernel/genkernel-3.4.52.4-r3.ebuild
@@ -0,0 +1,157 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+# genkernel-9999        -> latest Git branch "master"
+# genkernel-VERSION     -> normal genkernel release
+
+EAPI=5 # approved 2012.09.11, required by all profiles since 2014.03.12
+
+inherit bash-completion-r1 epatch
+
+VERSION_BUSYBOX='1.20.2'
+VERSION_DMRAID='1.0.0.rc16-3'
+VERSION_MDADM='3.1.5'
+VERSION_FUSE='2.8.6'
+VERSION_ISCSI='2.0-872'
+VERSION_LVM='2.02.88'
+VERSION_UNIONFS_FUSE='0.24'
+VERSION_GPG='1.4.11'
+
+RH_HOME="ftp://sourceware.org/pub"
+DM_HOME="https://people.redhat.com/~heinzm/sw/dmraid/src"
+BB_HOME="https://busybox.net/downloads"
+
+COMMON_URI="${DM_HOME}/dmraid-${VERSION_DMRAID}.tar.bz2
+		${DM_HOME}/old/dmraid-${VERSION_DMRAID}.tar.bz2
+		mirror://kernel/linux/utils/raid/mdadm/mdadm-${VERSION_MDADM}.tar.bz2
+		${RH_HOME}/lvm2/LVM2.${VERSION_LVM}.tgz
+		${RH_HOME}/lvm2/old/LVM2.${VERSION_LVM}.tgz
+		${BB_HOME}/busybox-${VERSION_BUSYBOX}.tar.bz2
+		http://www.open-iscsi.org/bits/open-iscsi-${VERSION_ISCSI}.tar.gz
+		mirror://gentoo/open-iscsi-${VERSION_ISCSI}.tar.gz
+		mirror://sourceforge/fuse/fuse-${VERSION_FUSE}.tar.gz
+		http://podgorny.cz/unionfs-fuse/releases/unionfs-fuse-${VERSION_UNIONFS_FUSE}.tar.bz2
+		mirror://gentoo/unionfs-fuse-${VERSION_UNIONFS_FUSE}.tar.bz2
+		mirror://gnupg/gnupg/gnupg-${VERSION_GPG}.tar.bz2"
+
+if [[ ${PV} == 9999* ]]
+then
+	EGIT_REPO_URI="https://anongit.gentoo.org/git/proj/${PN}.git"
+	inherit git-r3
+	S="${WORKDIR}/${P}"
+	SRC_URI="${COMMON_URI}"
+else
+	SRC_URI="https://dev.gentoo.org/~zerochaos/distfiles/${P}.tar.xz
+		${COMMON_URI}"
+	KEYWORDS="alpha amd64 arm hppa ia64 ~mips ppc ppc64 ~s390 ~sh sparc x86"
+fi
+
+DESCRIPTION="Gentoo automatic kernel building scripts"
+HOMEPAGE="https://www.gentoo.org"
+
+LICENSE="GPL-2"
+SLOT="0"
+RESTRICT=""
+IUSE="cryptsetup ibm selinux"
+
+DEPEND="sys-fs/e2fsprogs
+	selinux? ( sys-libs/libselinux )"
+RDEPEND="${DEPEND}
+	cryptsetup? ( sys-fs/cryptsetup )
+	app-arch/cpio
+	>=app-misc/pax-utils-0.2.1
+	!<sys-apps/openrc-0.9.9"
+# pax-utils is used for lddtree
+
+if [[ ${PV} == 9999* ]]; then
+	DEPEND="${DEPEND} app-text/asciidoc"
+fi
+
+pkg_pretend() {
+	if ! use cryptsetup && has_version "sys-kernel/genkernel[crypt]"; then
+		ewarn "Local use flag 'crypt' has been renamed to 'cryptsetup' (bug #414523)."
+		ewarn "Please set flag 'cryptsetup' for this very package if you would like"
+		ewarn "to have genkernel create an initramfs with LUKS support."
+		ewarn "Sorry for the inconvenience."
+		echo
+	fi
+}
+
+src_prepare() {
+	if [[ ${PV} == 9999* ]] ; then
+		einfo "Producing ChangeLog from Git history..."
+		pushd "${S}/.git" >/dev/null || die
+		git log > "${S}"/ChangeLog || die
+		popd >/dev/null || die
+	fi
+	if use selinux ; then
+		sed -i 's/###//g' "${S}"/gen_compile.sh || die
+	fi
+
+	# Update software.sh
+	sed -i \
+		-e "s:VERSION_BUSYBOX:$VERSION_BUSYBOX:" \
+		-e "s:VERSION_MDADM:$VERSION_MDADM:" \
+		-e "s:VERSION_DMRAID:$VERSION_DMRAID:" \
+		-e "s:VERSION_FUSE:$VERSION_FUSE:" \
+		-e "s:VERSION_ISCSI:$VERSION_ISCSI:" \
+		-e "s:VERSION_LVM:$VERSION_LVM:" \
+		-e "s:VERSION_UNIONFS_FUSE:$VERSION_UNIONFS_FUSE:" \
+		-e "s:VERSION_GPG:$VERSION_GPG:" \
+		"${S}"/defaults/software.sh \
+		|| die "Could not adjust versions"
+
+	epatch "${FILESDIR}"/${P}-system-map.patch #570822
+	epatch "${FILESDIR}"/${P}-grub-mkconfig.patch #591200
+	epatch "${FILESDIR}"/${P}-crc32c.patch #655110
+	epatch_user
+}
+
+src_compile() {
+	if [[ ${PV} == 9999* ]]; then
+		emake
+	fi
+}
+
+src_install() {
+	insinto /etc
+	doins "${S}"/genkernel.conf
+
+	doman genkernel.8
+	dodoc AUTHORS ChangeLog README TODO
+	dobin genkernel
+	rm -f genkernel genkernel.8 AUTHORS ChangeLog README TODO genkernel.conf
+
+	if use ibm ; then
+		cp "${S}"/arch/ppc64/kernel-2.6{-pSeries,} || die
+	else
+		cp "${S}"/arch/ppc64/kernel-2.6{.g5,} || die
+	fi
+	insinto /usr/share/genkernel
+	doins -r "${S}"/*
+
+	newbashcomp "${FILESDIR}"/genkernel.bash "${PN}"
+	insinto /etc
+	doins "${FILESDIR}"/initramfs.mounts
+
+	cd "${DISTDIR}"
+	insinto /usr/share/genkernel/distfiles
+	doins ${A/${P}.tar.xz/}
+}
+
+pkg_postinst() {
+	echo
+	elog 'Documentation is available in the genkernel manual page'
+	elog 'as well as the following URL:'
+	echo
+	elog 'https://wiki.gentoo.org/wiki/Genkernel'
+	echo
+	ewarn "This package is known to not work with reiser4.  If you are running"
+	ewarn "reiser4 and have a problem, do not file a bug.  We know it does not"
+	ewarn "work and we don't plan on fixing it since reiser4 is the one that is"
+	ewarn "broken in this regard.  Try using a sane filesystem like ext4."
+	echo
+	ewarn "The LUKS support has changed from versions prior to 3.4.4.  Now,"
+	ewarn "you use crypt_root=/dev/blah instead of real_root=luks:/dev/blah."
+	echo
+}

diff --git a/sys-kernel/genkernel/genkernel-3.5.1.1.ebuild b/sys-kernel/genkernel/genkernel-3.5.1.1.ebuild
new file mode 100644
index 0000000..7dca692
--- /dev/null
+++ b/sys-kernel/genkernel/genkernel-3.5.1.1.ebuild
@@ -0,0 +1,158 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+# genkernel-9999        -> latest Git branch "master"
+# genkernel-VERSION     -> normal genkernel release
+
+EAPI=5 # approved 2012.09.11, required by all profiles since 2014.03.12
+
+inherit bash-completion-r1 epatch
+
+VERSION_BUSYBOX='1.26.0'
+VERSION_DMRAID='1.0.0.rc16-3'
+VERSION_MDADM='3.1.5'
+VERSION_FUSE='2.8.6'
+VERSION_ISCSI='2.0-872'
+VERSION_LVM='2.02.88'
+VERSION_UNIONFS_FUSE='0.24'
+VERSION_GPG='1.4.11'
+
+RH_HOME="ftp://sourceware.org/pub"
+DM_HOME="https://people.redhat.com/~heinzm/sw/dmraid/src"
+BB_HOME="https://busybox.net/downloads"
+
+COMMON_URI="${DM_HOME}/dmraid-${VERSION_DMRAID}.tar.bz2
+		${DM_HOME}/old/dmraid-${VERSION_DMRAID}.tar.bz2
+		mirror://kernel/linux/utils/raid/mdadm/mdadm-${VERSION_MDADM}.tar.bz2
+		${RH_HOME}/lvm2/LVM2.${VERSION_LVM}.tgz
+		${RH_HOME}/lvm2/old/LVM2.${VERSION_LVM}.tgz
+		${BB_HOME}/busybox-${VERSION_BUSYBOX}.tar.bz2
+		http://www.open-iscsi.org/bits/open-iscsi-${VERSION_ISCSI}.tar.gz
+		mirror://gentoo/open-iscsi-${VERSION_ISCSI}.tar.gz
+		mirror://sourceforge/fuse/fuse-${VERSION_FUSE}.tar.gz
+		http://podgorny.cz/unionfs-fuse/releases/unionfs-fuse-${VERSION_UNIONFS_FUSE}.tar.bz2
+		mirror://gentoo/unionfs-fuse-${VERSION_UNIONFS_FUSE}.tar.bz2
+		mirror://gnupg/gnupg/gnupg-${VERSION_GPG}.tar.bz2"
+
+if [[ ${PV} == 9999* ]]
+then
+	EGIT_REPO_URI="https://anongit.gentoo.org/git/proj/${PN}.git"
+	inherit git-r3
+	S="${WORKDIR}/${P}"
+	SRC_URI="${COMMON_URI}"
+else
+	SRC_URI="mirror://gentoo/${P}.tar.xz
+		${COMMON_URI}"
+	KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
+fi
+
+DESCRIPTION="Gentoo automatic kernel building scripts"
+HOMEPAGE="https://www.gentoo.org"
+
+LICENSE="GPL-2"
+SLOT="0"
+RESTRICT=""
+IUSE="cryptsetup ibm +firmware selinux"
+
+DEPEND="sys-fs/e2fsprogs
+	selinux? ( sys-libs/libselinux )"
+RDEPEND="${DEPEND}
+	cryptsetup? ( sys-fs/cryptsetup )
+	app-arch/cpio
+	>=app-misc/pax-utils-1.2.2
+	firmware? ( sys-kernel/linux-firmware )
+	!<sys-apps/openrc-0.9.9"
+# pax-utils is used for lddtree
+
+if [[ ${PV} == 9999* ]]; then
+	DEPEND="${DEPEND} app-text/asciidoc"
+fi
+
+pkg_pretend() {
+	if ! use cryptsetup && has_version "sys-kernel/genkernel[crypt]"; then
+		ewarn "Local use flag 'crypt' has been renamed to 'cryptsetup' (bug #414523)."
+		ewarn "Please set flag 'cryptsetup' for this very package if you would like"
+		ewarn "to have genkernel create an initramfs with LUKS support."
+		ewarn "Sorry for the inconvenience."
+		echo
+	fi
+}
+
+src_prepare() {
+	if [[ ${PV} == 9999* ]] ; then
+		einfo "Updating version tag"
+		GK_V="$(git describe --tags | sed 's:^v::')-git"
+		sed "/^GK_V/s,=.*,='${GK_V}',g" -i "${S}"/genkernel
+		einfo "Producing ChangeLog from Git history..."
+		pushd "${S}/.git" >/dev/null || die
+		git log > "${S}"/ChangeLog || die
+		popd >/dev/null || die
+	fi
+	if use selinux ; then
+		sed -i 's/###//g' "${S}"/gen_compile.sh || die
+	fi
+
+	# Update software.sh
+	sed -i \
+		-e "s:VERSION_BUSYBOX:$VERSION_BUSYBOX:" \
+		-e "s:VERSION_MDADM:$VERSION_MDADM:" \
+		-e "s:VERSION_DMRAID:$VERSION_DMRAID:" \
+		-e "s:VERSION_FUSE:$VERSION_FUSE:" \
+		-e "s:VERSION_ISCSI:$VERSION_ISCSI:" \
+		-e "s:VERSION_LVM:$VERSION_LVM:" \
+		-e "s:VERSION_UNIONFS_FUSE:$VERSION_UNIONFS_FUSE:" \
+		-e "s:VERSION_GPG:$VERSION_GPG:" \
+		"${S}"/defaults/software.sh \
+		|| die "Could not adjust versions"
+
+	epatch_user
+}
+
+src_compile() {
+	if [[ ${PV} == 9999* ]]; then
+		emake
+	fi
+}
+
+src_install() {
+	insinto /etc
+	doins "${S}"/genkernel.conf
+
+	doman genkernel.8
+	dodoc AUTHORS ChangeLog README TODO
+	dobin genkernel
+	rm -f genkernel genkernel.8 AUTHORS ChangeLog README TODO genkernel.conf
+
+	if use ibm ; then
+		cp "${S}"/arch/ppc64/kernel-2.6{-pSeries,} || die
+	else
+		cp "${S}"/arch/ppc64/kernel-2.6{.g5,} || die
+	fi
+	insinto /usr/share/genkernel
+	doins -r "${S}"/*
+
+	newbashcomp "${FILESDIR}"/genkernel.bash "${PN}"
+	insinto /etc
+	doins "${FILESDIR}"/initramfs.mounts
+
+	cd "${DISTDIR}"
+	insinto /usr/share/genkernel/distfiles
+	doins ${A/${P}.tar.xz/}
+}
+
+pkg_postinst() {
+	echo
+	elog 'Documentation is available in the genkernel manual page'
+	elog 'as well as the following URL:'
+	echo
+	elog 'https://wiki.gentoo.org/wiki/Genkernel'
+	echo
+	ewarn "This package is known to not work with reiser4.  If you are running"
+	ewarn "reiser4 and have a problem, do not file a bug.  We know it does not"
+	ewarn "work and we don't plan on fixing it since reiser4 is the one that is"
+	ewarn "broken in this regard.  Try using a sane filesystem like ext4."
+	echo
+	ewarn "The LUKS support has changed from versions prior to 3.4.4.  Now,"
+	ewarn "you use crypt_root=/dev/blah instead of real_root=luks:/dev/blah."
+	echo
+}

diff --git a/sys-kernel/genkernel/genkernel-3.5.2.0-r1.ebuild b/sys-kernel/genkernel/genkernel-3.5.2.0-r1.ebuild
new file mode 100644
index 0000000..a4053e3
--- /dev/null
+++ b/sys-kernel/genkernel/genkernel-3.5.2.0-r1.ebuild
@@ -0,0 +1,159 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+# genkernel-9999        -> latest Git branch "master"
+# genkernel-VERSION     -> normal genkernel release
+
+EAPI=5 # approved 2012.09.11, required by all profiles since 2014.03.12
+
+inherit bash-completion-r1 epatch
+
+VERSION_BUSYBOX='1.27.2' # warning, be sure to bump patches
+VERSION_DMRAID='1.0.0.rc16-3' # warning, be sure to bump patches
+VERSION_MDADM='4.0' # warning, be sure to bump patches
+VERSION_FUSE='2.8.6' # warning, be sure to bump patches
+VERSION_ISCSI='2.0-872' # warning, be sure to bump patches
+VERSION_LVM='2.02.173' # warning, be sure to bump patches
+VERSION_UNIONFS_FUSE='0.24'
+VERSION_GPG='1.4.22'
+
+RH_HOME="ftp://sourceware.org/pub"
+DM_HOME="https://people.redhat.com/~heinzm/sw/dmraid/src"
+BB_HOME="https://busybox.net/downloads"
+
+COMMON_URI="${DM_HOME}/dmraid-${VERSION_DMRAID}.tar.bz2
+		${DM_HOME}/old/dmraid-${VERSION_DMRAID}.tar.bz2
+		mirror://kernel/linux/utils/raid/mdadm/mdadm-${VERSION_MDADM}.tar.xz
+		${RH_HOME}/lvm2/LVM2.${VERSION_LVM}.tgz
+		${RH_HOME}/lvm2/old/LVM2.${VERSION_LVM}.tgz
+		${BB_HOME}/busybox-${VERSION_BUSYBOX}.tar.bz2
+		http://www.open-iscsi.org/bits/open-iscsi-${VERSION_ISCSI}.tar.gz
+		mirror://gentoo/open-iscsi-${VERSION_ISCSI}.tar.gz
+		mirror://sourceforge/fuse/fuse-${VERSION_FUSE}.tar.gz
+		http://podgorny.cz/unionfs-fuse/releases/unionfs-fuse-${VERSION_UNIONFS_FUSE}.tar.bz2
+		mirror://gentoo/unionfs-fuse-${VERSION_UNIONFS_FUSE}.tar.bz2
+		mirror://gnupg/gnupg/gnupg-${VERSION_GPG}.tar.bz2"
+
+if [[ ${PV} == 9999* ]]
+then
+	EGIT_REPO_URI="https://anongit.gentoo.org/git/proj/${PN}.git"
+	inherit git-r3
+	S="${WORKDIR}/${P}"
+	SRC_URI="${COMMON_URI}"
+else
+	SRC_URI="mirror://gentoo/${P}.tar.xz
+		${COMMON_URI}"
+	KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
+fi
+
+DESCRIPTION="Gentoo automatic kernel building scripts"
+HOMEPAGE="https://www.gentoo.org"
+
+LICENSE="GPL-2"
+SLOT="0"
+RESTRICT=""
+IUSE="cryptsetup ibm +firmware selinux"
+
+DEPEND="sys-fs/e2fsprogs
+	selinux? ( sys-libs/libselinux )"
+RDEPEND="${DEPEND}
+	cryptsetup? ( sys-fs/cryptsetup )
+	app-arch/cpio
+	>=app-misc/pax-utils-1.2.2
+	sys-apps/util-linux[static-libs(+)]
+	firmware? ( sys-kernel/linux-firmware )
+	!<sys-apps/openrc-0.9.9"
+# pax-utils is used for lddtree
+
+if [[ ${PV} == 9999* ]]; then
+	DEPEND="${DEPEND} app-text/asciidoc"
+fi
+
+pkg_pretend() {
+	if ! use cryptsetup && has_version "sys-kernel/genkernel[crypt]"; then
+		ewarn "Local use flag 'crypt' has been renamed to 'cryptsetup' (bug #414523)."
+		ewarn "Please set flag 'cryptsetup' for this very package if you would like"
+		ewarn "to have genkernel create an initramfs with LUKS support."
+		ewarn "Sorry for the inconvenience."
+		echo
+	fi
+}
+
+src_prepare() {
+	if [[ ${PV} == 9999* ]] ; then
+		einfo "Updating version tag"
+		GK_V="$(git describe --tags | sed 's:^v::')-git"
+		sed "/^GK_V/s,=.*,='${GK_V}',g" -i "${S}"/genkernel
+		einfo "Producing ChangeLog from Git history..."
+		pushd "${S}/.git" >/dev/null || die
+		git log > "${S}"/ChangeLog || die
+		popd >/dev/null || die
+	fi
+	if use selinux ; then
+		sed -i 's/###//g' "${S}"/gen_compile.sh || die
+	fi
+
+	# Update software.sh
+	sed -i \
+		-e "s:VERSION_BUSYBOX:$VERSION_BUSYBOX:" \
+		-e "s:VERSION_MDADM:$VERSION_MDADM:" \
+		-e "s:VERSION_DMRAID:$VERSION_DMRAID:" \
+		-e "s:VERSION_FUSE:$VERSION_FUSE:" \
+		-e "s:VERSION_ISCSI:$VERSION_ISCSI:" \
+		-e "s:VERSION_LVM:$VERSION_LVM:" \
+		-e "s:VERSION_UNIONFS_FUSE:$VERSION_UNIONFS_FUSE:" \
+		-e "s:VERSION_GPG:$VERSION_GPG:" \
+		"${S}"/defaults/software.sh \
+		|| die "Could not adjust versions"
+
+	epatch_user
+}
+
+src_compile() {
+	if [[ ${PV} == 9999* ]]; then
+		emake
+	fi
+}
+
+src_install() {
+	insinto /etc
+	doins "${S}"/genkernel.conf
+
+	doman genkernel.8
+	dodoc AUTHORS ChangeLog README TODO
+	dobin genkernel
+	rm -f genkernel genkernel.8 AUTHORS ChangeLog README TODO genkernel.conf
+
+	if use ibm ; then
+		cp "${S}"/arch/ppc64/kernel-2.6{-pSeries,} || die
+	else
+		cp "${S}"/arch/ppc64/kernel-2.6{.g5,} || die
+	fi
+	insinto /usr/share/genkernel
+	doins -r "${S}"/*
+
+	newbashcomp "${FILESDIR}"/genkernel.bash "${PN}"
+	insinto /etc
+	doins "${FILESDIR}"/initramfs.mounts
+
+	cd "${DISTDIR}"
+	insinto /usr/share/genkernel/distfiles
+	doins ${A/${P}.tar.xz/}
+}
+
+pkg_postinst() {
+	echo
+	elog 'Documentation is available in the genkernel manual page'
+	elog 'as well as the following URL:'
+	echo
+	elog 'https://wiki.gentoo.org/wiki/Genkernel'
+	echo
+	ewarn "This package is known to not work with reiser4.  If you are running"
+	ewarn "reiser4 and have a problem, do not file a bug.  We know it does not"
+	ewarn "work and we don't plan on fixing it since reiser4 is the one that is"
+	ewarn "broken in this regard.  Try using a sane filesystem like ext4."
+	echo
+	ewarn "The LUKS support has changed from versions prior to 3.4.4.  Now,"
+	ewarn "you use crypt_root=/dev/blah instead of real_root=luks:/dev/blah."
+	echo
+}

diff --git a/sys-kernel/genkernel/genkernel-3.5.2.1.ebuild b/sys-kernel/genkernel/genkernel-3.5.2.1.ebuild
new file mode 100644
index 0000000..a4053e3
--- /dev/null
+++ b/sys-kernel/genkernel/genkernel-3.5.2.1.ebuild
@@ -0,0 +1,159 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+# genkernel-9999        -> latest Git branch "master"
+# genkernel-VERSION     -> normal genkernel release
+
+EAPI=5 # approved 2012.09.11, required by all profiles since 2014.03.12
+
+inherit bash-completion-r1 epatch
+
+VERSION_BUSYBOX='1.27.2' # warning, be sure to bump patches
+VERSION_DMRAID='1.0.0.rc16-3' # warning, be sure to bump patches
+VERSION_MDADM='4.0' # warning, be sure to bump patches
+VERSION_FUSE='2.8.6' # warning, be sure to bump patches
+VERSION_ISCSI='2.0-872' # warning, be sure to bump patches
+VERSION_LVM='2.02.173' # warning, be sure to bump patches
+VERSION_UNIONFS_FUSE='0.24'
+VERSION_GPG='1.4.22'
+
+RH_HOME="ftp://sourceware.org/pub"
+DM_HOME="https://people.redhat.com/~heinzm/sw/dmraid/src"
+BB_HOME="https://busybox.net/downloads"
+
+COMMON_URI="${DM_HOME}/dmraid-${VERSION_DMRAID}.tar.bz2
+		${DM_HOME}/old/dmraid-${VERSION_DMRAID}.tar.bz2
+		mirror://kernel/linux/utils/raid/mdadm/mdadm-${VERSION_MDADM}.tar.xz
+		${RH_HOME}/lvm2/LVM2.${VERSION_LVM}.tgz
+		${RH_HOME}/lvm2/old/LVM2.${VERSION_LVM}.tgz
+		${BB_HOME}/busybox-${VERSION_BUSYBOX}.tar.bz2
+		http://www.open-iscsi.org/bits/open-iscsi-${VERSION_ISCSI}.tar.gz
+		mirror://gentoo/open-iscsi-${VERSION_ISCSI}.tar.gz
+		mirror://sourceforge/fuse/fuse-${VERSION_FUSE}.tar.gz
+		http://podgorny.cz/unionfs-fuse/releases/unionfs-fuse-${VERSION_UNIONFS_FUSE}.tar.bz2
+		mirror://gentoo/unionfs-fuse-${VERSION_UNIONFS_FUSE}.tar.bz2
+		mirror://gnupg/gnupg/gnupg-${VERSION_GPG}.tar.bz2"
+
+if [[ ${PV} == 9999* ]]
+then
+	EGIT_REPO_URI="https://anongit.gentoo.org/git/proj/${PN}.git"
+	inherit git-r3
+	S="${WORKDIR}/${P}"
+	SRC_URI="${COMMON_URI}"
+else
+	SRC_URI="mirror://gentoo/${P}.tar.xz
+		${COMMON_URI}"
+	KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
+fi
+
+DESCRIPTION="Gentoo automatic kernel building scripts"
+HOMEPAGE="https://www.gentoo.org"
+
+LICENSE="GPL-2"
+SLOT="0"
+RESTRICT=""
+IUSE="cryptsetup ibm +firmware selinux"
+
+DEPEND="sys-fs/e2fsprogs
+	selinux? ( sys-libs/libselinux )"
+RDEPEND="${DEPEND}
+	cryptsetup? ( sys-fs/cryptsetup )
+	app-arch/cpio
+	>=app-misc/pax-utils-1.2.2
+	sys-apps/util-linux[static-libs(+)]
+	firmware? ( sys-kernel/linux-firmware )
+	!<sys-apps/openrc-0.9.9"
+# pax-utils is used for lddtree
+
+if [[ ${PV} == 9999* ]]; then
+	DEPEND="${DEPEND} app-text/asciidoc"
+fi
+
+pkg_pretend() {
+	if ! use cryptsetup && has_version "sys-kernel/genkernel[crypt]"; then
+		ewarn "Local use flag 'crypt' has been renamed to 'cryptsetup' (bug #414523)."
+		ewarn "Please set flag 'cryptsetup' for this very package if you would like"
+		ewarn "to have genkernel create an initramfs with LUKS support."
+		ewarn "Sorry for the inconvenience."
+		echo
+	fi
+}
+
+src_prepare() {
+	if [[ ${PV} == 9999* ]] ; then
+		einfo "Updating version tag"
+		GK_V="$(git describe --tags | sed 's:^v::')-git"
+		sed "/^GK_V/s,=.*,='${GK_V}',g" -i "${S}"/genkernel
+		einfo "Producing ChangeLog from Git history..."
+		pushd "${S}/.git" >/dev/null || die
+		git log > "${S}"/ChangeLog || die
+		popd >/dev/null || die
+	fi
+	if use selinux ; then
+		sed -i 's/###//g' "${S}"/gen_compile.sh || die
+	fi
+
+	# Update software.sh
+	sed -i \
+		-e "s:VERSION_BUSYBOX:$VERSION_BUSYBOX:" \
+		-e "s:VERSION_MDADM:$VERSION_MDADM:" \
+		-e "s:VERSION_DMRAID:$VERSION_DMRAID:" \
+		-e "s:VERSION_FUSE:$VERSION_FUSE:" \
+		-e "s:VERSION_ISCSI:$VERSION_ISCSI:" \
+		-e "s:VERSION_LVM:$VERSION_LVM:" \
+		-e "s:VERSION_UNIONFS_FUSE:$VERSION_UNIONFS_FUSE:" \
+		-e "s:VERSION_GPG:$VERSION_GPG:" \
+		"${S}"/defaults/software.sh \
+		|| die "Could not adjust versions"
+
+	epatch_user
+}
+
+src_compile() {
+	if [[ ${PV} == 9999* ]]; then
+		emake
+	fi
+}
+
+src_install() {
+	insinto /etc
+	doins "${S}"/genkernel.conf
+
+	doman genkernel.8
+	dodoc AUTHORS ChangeLog README TODO
+	dobin genkernel
+	rm -f genkernel genkernel.8 AUTHORS ChangeLog README TODO genkernel.conf
+
+	if use ibm ; then
+		cp "${S}"/arch/ppc64/kernel-2.6{-pSeries,} || die
+	else
+		cp "${S}"/arch/ppc64/kernel-2.6{.g5,} || die
+	fi
+	insinto /usr/share/genkernel
+	doins -r "${S}"/*
+
+	newbashcomp "${FILESDIR}"/genkernel.bash "${PN}"
+	insinto /etc
+	doins "${FILESDIR}"/initramfs.mounts
+
+	cd "${DISTDIR}"
+	insinto /usr/share/genkernel/distfiles
+	doins ${A/${P}.tar.xz/}
+}
+
+pkg_postinst() {
+	echo
+	elog 'Documentation is available in the genkernel manual page'
+	elog 'as well as the following URL:'
+	echo
+	elog 'https://wiki.gentoo.org/wiki/Genkernel'
+	echo
+	ewarn "This package is known to not work with reiser4.  If you are running"
+	ewarn "reiser4 and have a problem, do not file a bug.  We know it does not"
+	ewarn "work and we don't plan on fixing it since reiser4 is the one that is"
+	ewarn "broken in this regard.  Try using a sane filesystem like ext4."
+	echo
+	ewarn "The LUKS support has changed from versions prior to 3.4.4.  Now,"
+	ewarn "you use crypt_root=/dev/blah instead of real_root=luks:/dev/blah."
+	echo
+}

diff --git a/sys-kernel/genkernel/genkernel-3.5.2.2.ebuild b/sys-kernel/genkernel/genkernel-3.5.2.2.ebuild
new file mode 100644
index 0000000..a4053e3
--- /dev/null
+++ b/sys-kernel/genkernel/genkernel-3.5.2.2.ebuild
@@ -0,0 +1,159 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+# genkernel-9999        -> latest Git branch "master"
+# genkernel-VERSION     -> normal genkernel release
+
+EAPI=5 # approved 2012.09.11, required by all profiles since 2014.03.12
+
+inherit bash-completion-r1 epatch
+
+VERSION_BUSYBOX='1.27.2' # warning, be sure to bump patches
+VERSION_DMRAID='1.0.0.rc16-3' # warning, be sure to bump patches
+VERSION_MDADM='4.0' # warning, be sure to bump patches
+VERSION_FUSE='2.8.6' # warning, be sure to bump patches
+VERSION_ISCSI='2.0-872' # warning, be sure to bump patches
+VERSION_LVM='2.02.173' # warning, be sure to bump patches
+VERSION_UNIONFS_FUSE='0.24'
+VERSION_GPG='1.4.22'
+
+RH_HOME="ftp://sourceware.org/pub"
+DM_HOME="https://people.redhat.com/~heinzm/sw/dmraid/src"
+BB_HOME="https://busybox.net/downloads"
+
+COMMON_URI="${DM_HOME}/dmraid-${VERSION_DMRAID}.tar.bz2
+		${DM_HOME}/old/dmraid-${VERSION_DMRAID}.tar.bz2
+		mirror://kernel/linux/utils/raid/mdadm/mdadm-${VERSION_MDADM}.tar.xz
+		${RH_HOME}/lvm2/LVM2.${VERSION_LVM}.tgz
+		${RH_HOME}/lvm2/old/LVM2.${VERSION_LVM}.tgz
+		${BB_HOME}/busybox-${VERSION_BUSYBOX}.tar.bz2
+		http://www.open-iscsi.org/bits/open-iscsi-${VERSION_ISCSI}.tar.gz
+		mirror://gentoo/open-iscsi-${VERSION_ISCSI}.tar.gz
+		mirror://sourceforge/fuse/fuse-${VERSION_FUSE}.tar.gz
+		http://podgorny.cz/unionfs-fuse/releases/unionfs-fuse-${VERSION_UNIONFS_FUSE}.tar.bz2
+		mirror://gentoo/unionfs-fuse-${VERSION_UNIONFS_FUSE}.tar.bz2
+		mirror://gnupg/gnupg/gnupg-${VERSION_GPG}.tar.bz2"
+
+if [[ ${PV} == 9999* ]]
+then
+	EGIT_REPO_URI="https://anongit.gentoo.org/git/proj/${PN}.git"
+	inherit git-r3
+	S="${WORKDIR}/${P}"
+	SRC_URI="${COMMON_URI}"
+else
+	SRC_URI="mirror://gentoo/${P}.tar.xz
+		${COMMON_URI}"
+	KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
+fi
+
+DESCRIPTION="Gentoo automatic kernel building scripts"
+HOMEPAGE="https://www.gentoo.org"
+
+LICENSE="GPL-2"
+SLOT="0"
+RESTRICT=""
+IUSE="cryptsetup ibm +firmware selinux"
+
+DEPEND="sys-fs/e2fsprogs
+	selinux? ( sys-libs/libselinux )"
+RDEPEND="${DEPEND}
+	cryptsetup? ( sys-fs/cryptsetup )
+	app-arch/cpio
+	>=app-misc/pax-utils-1.2.2
+	sys-apps/util-linux[static-libs(+)]
+	firmware? ( sys-kernel/linux-firmware )
+	!<sys-apps/openrc-0.9.9"
+# pax-utils is used for lddtree
+
+if [[ ${PV} == 9999* ]]; then
+	DEPEND="${DEPEND} app-text/asciidoc"
+fi
+
+pkg_pretend() {
+	if ! use cryptsetup && has_version "sys-kernel/genkernel[crypt]"; then
+		ewarn "Local use flag 'crypt' has been renamed to 'cryptsetup' (bug #414523)."
+		ewarn "Please set flag 'cryptsetup' for this very package if you would like"
+		ewarn "to have genkernel create an initramfs with LUKS support."
+		ewarn "Sorry for the inconvenience."
+		echo
+	fi
+}
+
+src_prepare() {
+	if [[ ${PV} == 9999* ]] ; then
+		einfo "Updating version tag"
+		GK_V="$(git describe --tags | sed 's:^v::')-git"
+		sed "/^GK_V/s,=.*,='${GK_V}',g" -i "${S}"/genkernel
+		einfo "Producing ChangeLog from Git history..."
+		pushd "${S}/.git" >/dev/null || die
+		git log > "${S}"/ChangeLog || die
+		popd >/dev/null || die
+	fi
+	if use selinux ; then
+		sed -i 's/###//g' "${S}"/gen_compile.sh || die
+	fi
+
+	# Update software.sh
+	sed -i \
+		-e "s:VERSION_BUSYBOX:$VERSION_BUSYBOX:" \
+		-e "s:VERSION_MDADM:$VERSION_MDADM:" \
+		-e "s:VERSION_DMRAID:$VERSION_DMRAID:" \
+		-e "s:VERSION_FUSE:$VERSION_FUSE:" \
+		-e "s:VERSION_ISCSI:$VERSION_ISCSI:" \
+		-e "s:VERSION_LVM:$VERSION_LVM:" \
+		-e "s:VERSION_UNIONFS_FUSE:$VERSION_UNIONFS_FUSE:" \
+		-e "s:VERSION_GPG:$VERSION_GPG:" \
+		"${S}"/defaults/software.sh \
+		|| die "Could not adjust versions"
+
+	epatch_user
+}
+
+src_compile() {
+	if [[ ${PV} == 9999* ]]; then
+		emake
+	fi
+}
+
+src_install() {
+	insinto /etc
+	doins "${S}"/genkernel.conf
+
+	doman genkernel.8
+	dodoc AUTHORS ChangeLog README TODO
+	dobin genkernel
+	rm -f genkernel genkernel.8 AUTHORS ChangeLog README TODO genkernel.conf
+
+	if use ibm ; then
+		cp "${S}"/arch/ppc64/kernel-2.6{-pSeries,} || die
+	else
+		cp "${S}"/arch/ppc64/kernel-2.6{.g5,} || die
+	fi
+	insinto /usr/share/genkernel
+	doins -r "${S}"/*
+
+	newbashcomp "${FILESDIR}"/genkernel.bash "${PN}"
+	insinto /etc
+	doins "${FILESDIR}"/initramfs.mounts
+
+	cd "${DISTDIR}"
+	insinto /usr/share/genkernel/distfiles
+	doins ${A/${P}.tar.xz/}
+}
+
+pkg_postinst() {
+	echo
+	elog 'Documentation is available in the genkernel manual page'
+	elog 'as well as the following URL:'
+	echo
+	elog 'https://wiki.gentoo.org/wiki/Genkernel'
+	echo
+	ewarn "This package is known to not work with reiser4.  If you are running"
+	ewarn "reiser4 and have a problem, do not file a bug.  We know it does not"
+	ewarn "work and we don't plan on fixing it since reiser4 is the one that is"
+	ewarn "broken in this regard.  Try using a sane filesystem like ext4."
+	echo
+	ewarn "The LUKS support has changed from versions prior to 3.4.4.  Now,"
+	ewarn "you use crypt_root=/dev/blah instead of real_root=luks:/dev/blah."
+	echo
+}

diff --git a/sys-kernel/genkernel/genkernel-3.5.2.3.ebuild b/sys-kernel/genkernel/genkernel-3.5.2.3.ebuild
new file mode 100644
index 0000000..a4053e3
--- /dev/null
+++ b/sys-kernel/genkernel/genkernel-3.5.2.3.ebuild
@@ -0,0 +1,159 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+# genkernel-9999        -> latest Git branch "master"
+# genkernel-VERSION     -> normal genkernel release
+
+EAPI=5 # approved 2012.09.11, required by all profiles since 2014.03.12
+
+inherit bash-completion-r1 epatch
+
+VERSION_BUSYBOX='1.27.2' # warning, be sure to bump patches
+VERSION_DMRAID='1.0.0.rc16-3' # warning, be sure to bump patches
+VERSION_MDADM='4.0' # warning, be sure to bump patches
+VERSION_FUSE='2.8.6' # warning, be sure to bump patches
+VERSION_ISCSI='2.0-872' # warning, be sure to bump patches
+VERSION_LVM='2.02.173' # warning, be sure to bump patches
+VERSION_UNIONFS_FUSE='0.24'
+VERSION_GPG='1.4.22'
+
+RH_HOME="ftp://sourceware.org/pub"
+DM_HOME="https://people.redhat.com/~heinzm/sw/dmraid/src"
+BB_HOME="https://busybox.net/downloads"
+
+COMMON_URI="${DM_HOME}/dmraid-${VERSION_DMRAID}.tar.bz2
+		${DM_HOME}/old/dmraid-${VERSION_DMRAID}.tar.bz2
+		mirror://kernel/linux/utils/raid/mdadm/mdadm-${VERSION_MDADM}.tar.xz
+		${RH_HOME}/lvm2/LVM2.${VERSION_LVM}.tgz
+		${RH_HOME}/lvm2/old/LVM2.${VERSION_LVM}.tgz
+		${BB_HOME}/busybox-${VERSION_BUSYBOX}.tar.bz2
+		http://www.open-iscsi.org/bits/open-iscsi-${VERSION_ISCSI}.tar.gz
+		mirror://gentoo/open-iscsi-${VERSION_ISCSI}.tar.gz
+		mirror://sourceforge/fuse/fuse-${VERSION_FUSE}.tar.gz
+		http://podgorny.cz/unionfs-fuse/releases/unionfs-fuse-${VERSION_UNIONFS_FUSE}.tar.bz2
+		mirror://gentoo/unionfs-fuse-${VERSION_UNIONFS_FUSE}.tar.bz2
+		mirror://gnupg/gnupg/gnupg-${VERSION_GPG}.tar.bz2"
+
+if [[ ${PV} == 9999* ]]
+then
+	EGIT_REPO_URI="https://anongit.gentoo.org/git/proj/${PN}.git"
+	inherit git-r3
+	S="${WORKDIR}/${P}"
+	SRC_URI="${COMMON_URI}"
+else
+	SRC_URI="mirror://gentoo/${P}.tar.xz
+		${COMMON_URI}"
+	KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
+fi
+
+DESCRIPTION="Gentoo automatic kernel building scripts"
+HOMEPAGE="https://www.gentoo.org"
+
+LICENSE="GPL-2"
+SLOT="0"
+RESTRICT=""
+IUSE="cryptsetup ibm +firmware selinux"
+
+DEPEND="sys-fs/e2fsprogs
+	selinux? ( sys-libs/libselinux )"
+RDEPEND="${DEPEND}
+	cryptsetup? ( sys-fs/cryptsetup )
+	app-arch/cpio
+	>=app-misc/pax-utils-1.2.2
+	sys-apps/util-linux[static-libs(+)]
+	firmware? ( sys-kernel/linux-firmware )
+	!<sys-apps/openrc-0.9.9"
+# pax-utils is used for lddtree
+
+if [[ ${PV} == 9999* ]]; then
+	DEPEND="${DEPEND} app-text/asciidoc"
+fi
+
+pkg_pretend() {
+	if ! use cryptsetup && has_version "sys-kernel/genkernel[crypt]"; then
+		ewarn "Local use flag 'crypt' has been renamed to 'cryptsetup' (bug #414523)."
+		ewarn "Please set flag 'cryptsetup' for this very package if you would like"
+		ewarn "to have genkernel create an initramfs with LUKS support."
+		ewarn "Sorry for the inconvenience."
+		echo
+	fi
+}
+
+src_prepare() {
+	if [[ ${PV} == 9999* ]] ; then
+		einfo "Updating version tag"
+		GK_V="$(git describe --tags | sed 's:^v::')-git"
+		sed "/^GK_V/s,=.*,='${GK_V}',g" -i "${S}"/genkernel
+		einfo "Producing ChangeLog from Git history..."
+		pushd "${S}/.git" >/dev/null || die
+		git log > "${S}"/ChangeLog || die
+		popd >/dev/null || die
+	fi
+	if use selinux ; then
+		sed -i 's/###//g' "${S}"/gen_compile.sh || die
+	fi
+
+	# Update software.sh
+	sed -i \
+		-e "s:VERSION_BUSYBOX:$VERSION_BUSYBOX:" \
+		-e "s:VERSION_MDADM:$VERSION_MDADM:" \
+		-e "s:VERSION_DMRAID:$VERSION_DMRAID:" \
+		-e "s:VERSION_FUSE:$VERSION_FUSE:" \
+		-e "s:VERSION_ISCSI:$VERSION_ISCSI:" \
+		-e "s:VERSION_LVM:$VERSION_LVM:" \
+		-e "s:VERSION_UNIONFS_FUSE:$VERSION_UNIONFS_FUSE:" \
+		-e "s:VERSION_GPG:$VERSION_GPG:" \
+		"${S}"/defaults/software.sh \
+		|| die "Could not adjust versions"
+
+	epatch_user
+}
+
+src_compile() {
+	if [[ ${PV} == 9999* ]]; then
+		emake
+	fi
+}
+
+src_install() {
+	insinto /etc
+	doins "${S}"/genkernel.conf
+
+	doman genkernel.8
+	dodoc AUTHORS ChangeLog README TODO
+	dobin genkernel
+	rm -f genkernel genkernel.8 AUTHORS ChangeLog README TODO genkernel.conf
+
+	if use ibm ; then
+		cp "${S}"/arch/ppc64/kernel-2.6{-pSeries,} || die
+	else
+		cp "${S}"/arch/ppc64/kernel-2.6{.g5,} || die
+	fi
+	insinto /usr/share/genkernel
+	doins -r "${S}"/*
+
+	newbashcomp "${FILESDIR}"/genkernel.bash "${PN}"
+	insinto /etc
+	doins "${FILESDIR}"/initramfs.mounts
+
+	cd "${DISTDIR}"
+	insinto /usr/share/genkernel/distfiles
+	doins ${A/${P}.tar.xz/}
+}
+
+pkg_postinst() {
+	echo
+	elog 'Documentation is available in the genkernel manual page'
+	elog 'as well as the following URL:'
+	echo
+	elog 'https://wiki.gentoo.org/wiki/Genkernel'
+	echo
+	ewarn "This package is known to not work with reiser4.  If you are running"
+	ewarn "reiser4 and have a problem, do not file a bug.  We know it does not"
+	ewarn "work and we don't plan on fixing it since reiser4 is the one that is"
+	ewarn "broken in this regard.  Try using a sane filesystem like ext4."
+	echo
+	ewarn "The LUKS support has changed from versions prior to 3.4.4.  Now,"
+	ewarn "you use crypt_root=/dev/blah instead of real_root=luks:/dev/blah."
+	echo
+}

diff --git a/sys-kernel/genkernel/genkernel-3.5.2.4.ebuild b/sys-kernel/genkernel/genkernel-3.5.2.4.ebuild
new file mode 100644
index 0000000..a4053e3
--- /dev/null
+++ b/sys-kernel/genkernel/genkernel-3.5.2.4.ebuild
@@ -0,0 +1,159 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+# genkernel-9999        -> latest Git branch "master"
+# genkernel-VERSION     -> normal genkernel release
+
+EAPI=5 # approved 2012.09.11, required by all profiles since 2014.03.12
+
+inherit bash-completion-r1 epatch
+
+VERSION_BUSYBOX='1.27.2' # warning, be sure to bump patches
+VERSION_DMRAID='1.0.0.rc16-3' # warning, be sure to bump patches
+VERSION_MDADM='4.0' # warning, be sure to bump patches
+VERSION_FUSE='2.8.6' # warning, be sure to bump patches
+VERSION_ISCSI='2.0-872' # warning, be sure to bump patches
+VERSION_LVM='2.02.173' # warning, be sure to bump patches
+VERSION_UNIONFS_FUSE='0.24'
+VERSION_GPG='1.4.22'
+
+RH_HOME="ftp://sourceware.org/pub"
+DM_HOME="https://people.redhat.com/~heinzm/sw/dmraid/src"
+BB_HOME="https://busybox.net/downloads"
+
+COMMON_URI="${DM_HOME}/dmraid-${VERSION_DMRAID}.tar.bz2
+		${DM_HOME}/old/dmraid-${VERSION_DMRAID}.tar.bz2
+		mirror://kernel/linux/utils/raid/mdadm/mdadm-${VERSION_MDADM}.tar.xz
+		${RH_HOME}/lvm2/LVM2.${VERSION_LVM}.tgz
+		${RH_HOME}/lvm2/old/LVM2.${VERSION_LVM}.tgz
+		${BB_HOME}/busybox-${VERSION_BUSYBOX}.tar.bz2
+		http://www.open-iscsi.org/bits/open-iscsi-${VERSION_ISCSI}.tar.gz
+		mirror://gentoo/open-iscsi-${VERSION_ISCSI}.tar.gz
+		mirror://sourceforge/fuse/fuse-${VERSION_FUSE}.tar.gz
+		http://podgorny.cz/unionfs-fuse/releases/unionfs-fuse-${VERSION_UNIONFS_FUSE}.tar.bz2
+		mirror://gentoo/unionfs-fuse-${VERSION_UNIONFS_FUSE}.tar.bz2
+		mirror://gnupg/gnupg/gnupg-${VERSION_GPG}.tar.bz2"
+
+if [[ ${PV} == 9999* ]]
+then
+	EGIT_REPO_URI="https://anongit.gentoo.org/git/proj/${PN}.git"
+	inherit git-r3
+	S="${WORKDIR}/${P}"
+	SRC_URI="${COMMON_URI}"
+else
+	SRC_URI="mirror://gentoo/${P}.tar.xz
+		${COMMON_URI}"
+	KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
+fi
+
+DESCRIPTION="Gentoo automatic kernel building scripts"
+HOMEPAGE="https://www.gentoo.org"
+
+LICENSE="GPL-2"
+SLOT="0"
+RESTRICT=""
+IUSE="cryptsetup ibm +firmware selinux"
+
+DEPEND="sys-fs/e2fsprogs
+	selinux? ( sys-libs/libselinux )"
+RDEPEND="${DEPEND}
+	cryptsetup? ( sys-fs/cryptsetup )
+	app-arch/cpio
+	>=app-misc/pax-utils-1.2.2
+	sys-apps/util-linux[static-libs(+)]
+	firmware? ( sys-kernel/linux-firmware )
+	!<sys-apps/openrc-0.9.9"
+# pax-utils is used for lddtree
+
+if [[ ${PV} == 9999* ]]; then
+	DEPEND="${DEPEND} app-text/asciidoc"
+fi
+
+pkg_pretend() {
+	if ! use cryptsetup && has_version "sys-kernel/genkernel[crypt]"; then
+		ewarn "Local use flag 'crypt' has been renamed to 'cryptsetup' (bug #414523)."
+		ewarn "Please set flag 'cryptsetup' for this very package if you would like"
+		ewarn "to have genkernel create an initramfs with LUKS support."
+		ewarn "Sorry for the inconvenience."
+		echo
+	fi
+}
+
+src_prepare() {
+	if [[ ${PV} == 9999* ]] ; then
+		einfo "Updating version tag"
+		GK_V="$(git describe --tags | sed 's:^v::')-git"
+		sed "/^GK_V/s,=.*,='${GK_V}',g" -i "${S}"/genkernel
+		einfo "Producing ChangeLog from Git history..."
+		pushd "${S}/.git" >/dev/null || die
+		git log > "${S}"/ChangeLog || die
+		popd >/dev/null || die
+	fi
+	if use selinux ; then
+		sed -i 's/###//g' "${S}"/gen_compile.sh || die
+	fi
+
+	# Update software.sh
+	sed -i \
+		-e "s:VERSION_BUSYBOX:$VERSION_BUSYBOX:" \
+		-e "s:VERSION_MDADM:$VERSION_MDADM:" \
+		-e "s:VERSION_DMRAID:$VERSION_DMRAID:" \
+		-e "s:VERSION_FUSE:$VERSION_FUSE:" \
+		-e "s:VERSION_ISCSI:$VERSION_ISCSI:" \
+		-e "s:VERSION_LVM:$VERSION_LVM:" \
+		-e "s:VERSION_UNIONFS_FUSE:$VERSION_UNIONFS_FUSE:" \
+		-e "s:VERSION_GPG:$VERSION_GPG:" \
+		"${S}"/defaults/software.sh \
+		|| die "Could not adjust versions"
+
+	epatch_user
+}
+
+src_compile() {
+	if [[ ${PV} == 9999* ]]; then
+		emake
+	fi
+}
+
+src_install() {
+	insinto /etc
+	doins "${S}"/genkernel.conf
+
+	doman genkernel.8
+	dodoc AUTHORS ChangeLog README TODO
+	dobin genkernel
+	rm -f genkernel genkernel.8 AUTHORS ChangeLog README TODO genkernel.conf
+
+	if use ibm ; then
+		cp "${S}"/arch/ppc64/kernel-2.6{-pSeries,} || die
+	else
+		cp "${S}"/arch/ppc64/kernel-2.6{.g5,} || die
+	fi
+	insinto /usr/share/genkernel
+	doins -r "${S}"/*
+
+	newbashcomp "${FILESDIR}"/genkernel.bash "${PN}"
+	insinto /etc
+	doins "${FILESDIR}"/initramfs.mounts
+
+	cd "${DISTDIR}"
+	insinto /usr/share/genkernel/distfiles
+	doins ${A/${P}.tar.xz/}
+}
+
+pkg_postinst() {
+	echo
+	elog 'Documentation is available in the genkernel manual page'
+	elog 'as well as the following URL:'
+	echo
+	elog 'https://wiki.gentoo.org/wiki/Genkernel'
+	echo
+	ewarn "This package is known to not work with reiser4.  If you are running"
+	ewarn "reiser4 and have a problem, do not file a bug.  We know it does not"
+	ewarn "work and we don't plan on fixing it since reiser4 is the one that is"
+	ewarn "broken in this regard.  Try using a sane filesystem like ext4."
+	echo
+	ewarn "The LUKS support has changed from versions prior to 3.4.4.  Now,"
+	ewarn "you use crypt_root=/dev/blah instead of real_root=luks:/dev/blah."
+	echo
+}

diff --git a/sys-kernel/genkernel/genkernel-3.5.2.5.ebuild b/sys-kernel/genkernel/genkernel-3.5.2.5.ebuild
new file mode 100644
index 0000000..a4053e3
--- /dev/null
+++ b/sys-kernel/genkernel/genkernel-3.5.2.5.ebuild
@@ -0,0 +1,159 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+# genkernel-9999        -> latest Git branch "master"
+# genkernel-VERSION     -> normal genkernel release
+
+EAPI=5 # approved 2012.09.11, required by all profiles since 2014.03.12
+
+inherit bash-completion-r1 epatch
+
+VERSION_BUSYBOX='1.27.2' # warning, be sure to bump patches
+VERSION_DMRAID='1.0.0.rc16-3' # warning, be sure to bump patches
+VERSION_MDADM='4.0' # warning, be sure to bump patches
+VERSION_FUSE='2.8.6' # warning, be sure to bump patches
+VERSION_ISCSI='2.0-872' # warning, be sure to bump patches
+VERSION_LVM='2.02.173' # warning, be sure to bump patches
+VERSION_UNIONFS_FUSE='0.24'
+VERSION_GPG='1.4.22'
+
+RH_HOME="ftp://sourceware.org/pub"
+DM_HOME="https://people.redhat.com/~heinzm/sw/dmraid/src"
+BB_HOME="https://busybox.net/downloads"
+
+COMMON_URI="${DM_HOME}/dmraid-${VERSION_DMRAID}.tar.bz2
+		${DM_HOME}/old/dmraid-${VERSION_DMRAID}.tar.bz2
+		mirror://kernel/linux/utils/raid/mdadm/mdadm-${VERSION_MDADM}.tar.xz
+		${RH_HOME}/lvm2/LVM2.${VERSION_LVM}.tgz
+		${RH_HOME}/lvm2/old/LVM2.${VERSION_LVM}.tgz
+		${BB_HOME}/busybox-${VERSION_BUSYBOX}.tar.bz2
+		http://www.open-iscsi.org/bits/open-iscsi-${VERSION_ISCSI}.tar.gz
+		mirror://gentoo/open-iscsi-${VERSION_ISCSI}.tar.gz
+		mirror://sourceforge/fuse/fuse-${VERSION_FUSE}.tar.gz
+		http://podgorny.cz/unionfs-fuse/releases/unionfs-fuse-${VERSION_UNIONFS_FUSE}.tar.bz2
+		mirror://gentoo/unionfs-fuse-${VERSION_UNIONFS_FUSE}.tar.bz2
+		mirror://gnupg/gnupg/gnupg-${VERSION_GPG}.tar.bz2"
+
+if [[ ${PV} == 9999* ]]
+then
+	EGIT_REPO_URI="https://anongit.gentoo.org/git/proj/${PN}.git"
+	inherit git-r3
+	S="${WORKDIR}/${P}"
+	SRC_URI="${COMMON_URI}"
+else
+	SRC_URI="mirror://gentoo/${P}.tar.xz
+		${COMMON_URI}"
+	KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
+fi
+
+DESCRIPTION="Gentoo automatic kernel building scripts"
+HOMEPAGE="https://www.gentoo.org"
+
+LICENSE="GPL-2"
+SLOT="0"
+RESTRICT=""
+IUSE="cryptsetup ibm +firmware selinux"
+
+DEPEND="sys-fs/e2fsprogs
+	selinux? ( sys-libs/libselinux )"
+RDEPEND="${DEPEND}
+	cryptsetup? ( sys-fs/cryptsetup )
+	app-arch/cpio
+	>=app-misc/pax-utils-1.2.2
+	sys-apps/util-linux[static-libs(+)]
+	firmware? ( sys-kernel/linux-firmware )
+	!<sys-apps/openrc-0.9.9"
+# pax-utils is used for lddtree
+
+if [[ ${PV} == 9999* ]]; then
+	DEPEND="${DEPEND} app-text/asciidoc"
+fi
+
+pkg_pretend() {
+	if ! use cryptsetup && has_version "sys-kernel/genkernel[crypt]"; then
+		ewarn "Local use flag 'crypt' has been renamed to 'cryptsetup' (bug #414523)."
+		ewarn "Please set flag 'cryptsetup' for this very package if you would like"
+		ewarn "to have genkernel create an initramfs with LUKS support."
+		ewarn "Sorry for the inconvenience."
+		echo
+	fi
+}
+
+src_prepare() {
+	if [[ ${PV} == 9999* ]] ; then
+		einfo "Updating version tag"
+		GK_V="$(git describe --tags | sed 's:^v::')-git"
+		sed "/^GK_V/s,=.*,='${GK_V}',g" -i "${S}"/genkernel
+		einfo "Producing ChangeLog from Git history..."
+		pushd "${S}/.git" >/dev/null || die
+		git log > "${S}"/ChangeLog || die
+		popd >/dev/null || die
+	fi
+	if use selinux ; then
+		sed -i 's/###//g' "${S}"/gen_compile.sh || die
+	fi
+
+	# Update software.sh
+	sed -i \
+		-e "s:VERSION_BUSYBOX:$VERSION_BUSYBOX:" \
+		-e "s:VERSION_MDADM:$VERSION_MDADM:" \
+		-e "s:VERSION_DMRAID:$VERSION_DMRAID:" \
+		-e "s:VERSION_FUSE:$VERSION_FUSE:" \
+		-e "s:VERSION_ISCSI:$VERSION_ISCSI:" \
+		-e "s:VERSION_LVM:$VERSION_LVM:" \
+		-e "s:VERSION_UNIONFS_FUSE:$VERSION_UNIONFS_FUSE:" \
+		-e "s:VERSION_GPG:$VERSION_GPG:" \
+		"${S}"/defaults/software.sh \
+		|| die "Could not adjust versions"
+
+	epatch_user
+}
+
+src_compile() {
+	if [[ ${PV} == 9999* ]]; then
+		emake
+	fi
+}
+
+src_install() {
+	insinto /etc
+	doins "${S}"/genkernel.conf
+
+	doman genkernel.8
+	dodoc AUTHORS ChangeLog README TODO
+	dobin genkernel
+	rm -f genkernel genkernel.8 AUTHORS ChangeLog README TODO genkernel.conf
+
+	if use ibm ; then
+		cp "${S}"/arch/ppc64/kernel-2.6{-pSeries,} || die
+	else
+		cp "${S}"/arch/ppc64/kernel-2.6{.g5,} || die
+	fi
+	insinto /usr/share/genkernel
+	doins -r "${S}"/*
+
+	newbashcomp "${FILESDIR}"/genkernel.bash "${PN}"
+	insinto /etc
+	doins "${FILESDIR}"/initramfs.mounts
+
+	cd "${DISTDIR}"
+	insinto /usr/share/genkernel/distfiles
+	doins ${A/${P}.tar.xz/}
+}
+
+pkg_postinst() {
+	echo
+	elog 'Documentation is available in the genkernel manual page'
+	elog 'as well as the following URL:'
+	echo
+	elog 'https://wiki.gentoo.org/wiki/Genkernel'
+	echo
+	ewarn "This package is known to not work with reiser4.  If you are running"
+	ewarn "reiser4 and have a problem, do not file a bug.  We know it does not"
+	ewarn "work and we don't plan on fixing it since reiser4 is the one that is"
+	ewarn "broken in this regard.  Try using a sane filesystem like ext4."
+	echo
+	ewarn "The LUKS support has changed from versions prior to 3.4.4.  Now,"
+	ewarn "you use crypt_root=/dev/blah instead of real_root=luks:/dev/blah."
+	echo
+}

diff --git a/sys-kernel/genkernel/genkernel-3.5.3.2.ebuild b/sys-kernel/genkernel/genkernel-3.5.3.2.ebuild
new file mode 100644
index 0000000..8f31925
--- /dev/null
+++ b/sys-kernel/genkernel/genkernel-3.5.3.2.ebuild
@@ -0,0 +1,159 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+# genkernel-9999        -> latest Git branch "master"
+# genkernel-VERSION     -> normal genkernel release
+
+EAPI=5 # approved 2012.09.11, required by all profiles since 2014.03.12
+
+inherit bash-completion-r1 epatch
+
+VERSION_BUSYBOX='1.27.2' # warning, be sure to bump patches
+VERSION_DMRAID='1.0.0.rc16-3' # warning, be sure to bump patches
+VERSION_MDADM='4.0' # warning, be sure to bump patches
+VERSION_FUSE='2.8.6' # warning, be sure to bump patches
+VERSION_ISCSI='2.0-872' # warning, be sure to bump patches
+VERSION_LVM='2.02.173' # warning, be sure to bump patches
+VERSION_UNIONFS_FUSE='0.24'
+VERSION_GPG='1.4.22'
+
+RH_HOME="ftp://sourceware.org/pub"
+DM_HOME="https://people.redhat.com/~heinzm/sw/dmraid/src"
+BB_HOME="https://busybox.net/downloads"
+
+COMMON_URI="${DM_HOME}/dmraid-${VERSION_DMRAID}.tar.bz2
+		${DM_HOME}/old/dmraid-${VERSION_DMRAID}.tar.bz2
+		mirror://kernel/linux/utils/raid/mdadm/mdadm-${VERSION_MDADM}.tar.xz
+		${RH_HOME}/lvm2/LVM2.${VERSION_LVM}.tgz
+		${RH_HOME}/lvm2/old/LVM2.${VERSION_LVM}.tgz
+		${BB_HOME}/busybox-${VERSION_BUSYBOX}.tar.bz2
+		http://www.open-iscsi.org/bits/open-iscsi-${VERSION_ISCSI}.tar.gz
+		mirror://gentoo/open-iscsi-${VERSION_ISCSI}.tar.gz
+		mirror://sourceforge/fuse/fuse-${VERSION_FUSE}.tar.gz
+		http://podgorny.cz/unionfs-fuse/releases/unionfs-fuse-${VERSION_UNIONFS_FUSE}.tar.bz2
+		mirror://gentoo/unionfs-fuse-${VERSION_UNIONFS_FUSE}.tar.bz2
+		mirror://gnupg/gnupg/gnupg-${VERSION_GPG}.tar.bz2"
+
+if [[ ${PV} == 9999* ]]
+then
+	EGIT_REPO_URI="https://anongit.gentoo.org/git/proj/${PN}.git"
+	inherit git-r3
+	S="${WORKDIR}/${PN}"
+	SRC_URI="${COMMON_URI}"
+else
+	SRC_URI="mirror://gentoo/${P}.tar.xz
+		${COMMON_URI}"
+	KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
+fi
+
+DESCRIPTION="Gentoo automatic kernel building scripts"
+HOMEPAGE="https://www.gentoo.org"
+
+LICENSE="GPL-2"
+SLOT="0"
+RESTRICT=""
+IUSE="cryptsetup ibm +firmware selinux"
+
+DEPEND="sys-fs/e2fsprogs
+	selinux? ( sys-libs/libselinux )"
+RDEPEND="${DEPEND}
+	cryptsetup? ( sys-fs/cryptsetup )
+	app-arch/cpio
+	>=app-misc/pax-utils-1.2.2
+	sys-apps/util-linux[static-libs(+)]
+	firmware? ( sys-kernel/linux-firmware )
+	!<sys-apps/openrc-0.9.9"
+# pax-utils is used for lddtree
+
+if [[ ${PV} == 9999* ]]; then
+	DEPEND="${DEPEND} app-text/asciidoc"
+fi
+
+pkg_pretend() {
+	if ! use cryptsetup && has_version "sys-kernel/genkernel[crypt]"; then
+		ewarn "Local use flag 'crypt' has been renamed to 'cryptsetup' (bug #414523)."
+		ewarn "Please set flag 'cryptsetup' for this very package if you would like"
+		ewarn "to have genkernel create an initramfs with LUKS support."
+		ewarn "Sorry for the inconvenience."
+		echo
+	fi
+}
+
+src_prepare() {
+	if [[ ${PV} == 9999* ]] ; then
+		einfo "Updating version tag"
+		GK_V="$(git describe --tags | sed 's:^v::')-git"
+		sed "/^GK_V/s,=.*,='${GK_V}',g" -i "${S}"/genkernel
+		einfo "Producing ChangeLog from Git history..."
+		pushd "${S}/.git" >/dev/null || die
+		git log > "${S}"/ChangeLog || die
+		popd >/dev/null || die
+	fi
+	if use selinux ; then
+		sed -i 's/###//g' "${S}"/gen_compile.sh || die
+	fi
+
+	# Update software.sh
+	sed -i \
+		-e "s:VERSION_BUSYBOX:$VERSION_BUSYBOX:" \
+		-e "s:VERSION_MDADM:$VERSION_MDADM:" \
+		-e "s:VERSION_DMRAID:$VERSION_DMRAID:" \
+		-e "s:VERSION_FUSE:$VERSION_FUSE:" \
+		-e "s:VERSION_ISCSI:$VERSION_ISCSI:" \
+		-e "s:VERSION_LVM:$VERSION_LVM:" \
+		-e "s:VERSION_UNIONFS_FUSE:$VERSION_UNIONFS_FUSE:" \
+		-e "s:VERSION_GPG:$VERSION_GPG:" \
+		"${S}"/defaults/software.sh \
+		|| die "Could not adjust versions"
+
+	epatch_user
+}
+
+src_compile() {
+	if [[ ${PV} == 9999* ]]; then
+		emake
+	fi
+}
+
+src_install() {
+	insinto /etc
+	doins "${S}"/genkernel.conf
+
+	doman genkernel.8
+	dodoc AUTHORS ChangeLog README TODO
+	dobin genkernel
+	rm -f genkernel genkernel.8 AUTHORS ChangeLog README TODO genkernel.conf
+
+	if use ibm ; then
+		cp "${S}"/arch/ppc64/kernel-2.6{-pSeries,} || die
+	else
+		cp "${S}"/arch/ppc64/kernel-2.6{.g5,} || die
+	fi
+	insinto /usr/share/genkernel
+	doins -r "${S}"/*
+
+	newbashcomp "${FILESDIR}"/genkernel.bash "${PN}"
+	insinto /etc
+	doins "${FILESDIR}"/initramfs.mounts
+
+	cd "${DISTDIR}"
+	insinto /usr/share/genkernel/distfiles
+	doins ${A/${P}.tar.xz/}
+}
+
+pkg_postinst() {
+	echo
+	elog 'Documentation is available in the genkernel manual page'
+	elog 'as well as the following URL:'
+	echo
+	elog 'https://wiki.gentoo.org/wiki/Genkernel'
+	echo
+	ewarn "This package is known to not work with reiser4.  If you are running"
+	ewarn "reiser4 and have a problem, do not file a bug.  We know it does not"
+	ewarn "work and we don't plan on fixing it since reiser4 is the one that is"
+	ewarn "broken in this regard.  Try using a sane filesystem like ext4."
+	echo
+	ewarn "The LUKS support has changed from versions prior to 3.4.4.  Now,"
+	ewarn "you use crypt_root=/dev/blah instead of real_root=luks:/dev/blah."
+	echo
+}

diff --git a/sys-kernel/genkernel/genkernel-3.5.3.3.ebuild b/sys-kernel/genkernel/genkernel-3.5.3.3.ebuild
new file mode 100644
index 0000000..317160e
--- /dev/null
+++ b/sys-kernel/genkernel/genkernel-3.5.3.3.ebuild
@@ -0,0 +1,159 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+# genkernel-9999        -> latest Git branch "master"
+# genkernel-VERSION     -> normal genkernel release
+
+EAPI=5 # approved 2012.09.11, required by all profiles since 2014.03.12
+
+inherit bash-completion-r1 epatch
+
+VERSION_BUSYBOX='1.27.2' # warning, be sure to bump patches
+VERSION_DMRAID='1.0.0.rc16-3' # warning, be sure to bump patches
+VERSION_MDADM='4.0' # warning, be sure to bump patches
+VERSION_FUSE='2.8.6' # warning, be sure to bump patches
+VERSION_ISCSI='2.0-872' # warning, be sure to bump patches
+VERSION_LVM='2.02.173' # warning, be sure to bump patches
+VERSION_UNIONFS_FUSE='0.24'
+VERSION_GPG='1.4.22'
+
+RH_HOME="ftp://sourceware.org/pub"
+DM_HOME="https://people.redhat.com/~heinzm/sw/dmraid/src"
+BB_HOME="https://busybox.net/downloads"
+
+COMMON_URI="${DM_HOME}/dmraid-${VERSION_DMRAID}.tar.bz2
+		${DM_HOME}/old/dmraid-${VERSION_DMRAID}.tar.bz2
+		mirror://kernel/linux/utils/raid/mdadm/mdadm-${VERSION_MDADM}.tar.xz
+		${RH_HOME}/lvm2/LVM2.${VERSION_LVM}.tgz
+		${RH_HOME}/lvm2/old/LVM2.${VERSION_LVM}.tgz
+		${BB_HOME}/busybox-${VERSION_BUSYBOX}.tar.bz2
+		http://www.open-iscsi.org/bits/open-iscsi-${VERSION_ISCSI}.tar.gz
+		mirror://gentoo/open-iscsi-${VERSION_ISCSI}.tar.gz
+		mirror://sourceforge/fuse/fuse-${VERSION_FUSE}.tar.gz
+		http://podgorny.cz/unionfs-fuse/releases/unionfs-fuse-${VERSION_UNIONFS_FUSE}.tar.bz2
+		mirror://gentoo/unionfs-fuse-${VERSION_UNIONFS_FUSE}.tar.bz2
+		mirror://gnupg/gnupg/gnupg-${VERSION_GPG}.tar.bz2"
+
+if [[ ${PV} == 9999* ]]
+then
+	EGIT_REPO_URI="https://anongit.gentoo.org/git/proj/${PN}.git"
+	inherit git-r3
+	S="${WORKDIR}/${PN}"
+	SRC_URI="${COMMON_URI}"
+else
+	SRC_URI="mirror://gentoo/${P}.tar.xz
+		${COMMON_URI}"
+	KEYWORDS="alpha amd64 arm ~hppa ia64 ~mips ppc ppc64 s390 sh sparc x86"
+fi
+
+DESCRIPTION="Gentoo automatic kernel building scripts"
+HOMEPAGE="https://www.gentoo.org"
+
+LICENSE="GPL-2"
+SLOT="0"
+RESTRICT=""
+IUSE="cryptsetup ibm +firmware selinux"
+
+DEPEND="sys-fs/e2fsprogs
+	selinux? ( sys-libs/libselinux )"
+RDEPEND="${DEPEND}
+	cryptsetup? ( sys-fs/cryptsetup )
+	app-arch/cpio
+	>=app-misc/pax-utils-1.2.2
+	sys-apps/util-linux[static-libs(+)]
+	firmware? ( sys-kernel/linux-firmware )
+	!<sys-apps/openrc-0.9.9"
+# pax-utils is used for lddtree
+
+if [[ ${PV} == 9999* ]]; then
+	DEPEND="${DEPEND} app-text/asciidoc"
+fi
+
+pkg_pretend() {
+	if ! use cryptsetup && has_version "sys-kernel/genkernel[crypt]"; then
+		ewarn "Local use flag 'crypt' has been renamed to 'cryptsetup' (bug #414523)."
+		ewarn "Please set flag 'cryptsetup' for this very package if you would like"
+		ewarn "to have genkernel create an initramfs with LUKS support."
+		ewarn "Sorry for the inconvenience."
+		echo
+	fi
+}
+
+src_prepare() {
+	if [[ ${PV} == 9999* ]] ; then
+		einfo "Updating version tag"
+		GK_V="$(git describe --tags | sed 's:^v::')-git"
+		sed "/^GK_V/s,=.*,='${GK_V}',g" -i "${S}"/genkernel
+		einfo "Producing ChangeLog from Git history..."
+		pushd "${S}/.git" >/dev/null || die
+		git log > "${S}"/ChangeLog || die
+		popd >/dev/null || die
+	fi
+	if use selinux ; then
+		sed -i 's/###//g' "${S}"/gen_compile.sh || die
+	fi
+
+	# Update software.sh
+	sed -i \
+		-e "s:VERSION_BUSYBOX:$VERSION_BUSYBOX:" \
+		-e "s:VERSION_MDADM:$VERSION_MDADM:" \
+		-e "s:VERSION_DMRAID:$VERSION_DMRAID:" \
+		-e "s:VERSION_FUSE:$VERSION_FUSE:" \
+		-e "s:VERSION_ISCSI:$VERSION_ISCSI:" \
+		-e "s:VERSION_LVM:$VERSION_LVM:" \
+		-e "s:VERSION_UNIONFS_FUSE:$VERSION_UNIONFS_FUSE:" \
+		-e "s:VERSION_GPG:$VERSION_GPG:" \
+		"${S}"/defaults/software.sh \
+		|| die "Could not adjust versions"
+
+	epatch_user
+}
+
+src_compile() {
+	if [[ ${PV} == 9999* ]]; then
+		emake
+	fi
+}
+
+src_install() {
+	insinto /etc
+	doins "${S}"/genkernel.conf
+
+	doman genkernel.8
+	dodoc AUTHORS ChangeLog README TODO
+	dobin genkernel
+	rm -f genkernel genkernel.8 AUTHORS ChangeLog README TODO genkernel.conf
+
+	if use ibm ; then
+		cp "${S}"/arch/ppc64/kernel-2.6{-pSeries,} || die
+	else
+		cp "${S}"/arch/ppc64/kernel-2.6{.g5,} || die
+	fi
+	insinto /usr/share/genkernel
+	doins -r "${S}"/*
+
+	newbashcomp "${FILESDIR}"/genkernel.bash "${PN}"
+	insinto /etc
+	doins "${FILESDIR}"/initramfs.mounts
+
+	cd "${DISTDIR}"
+	insinto /usr/share/genkernel/distfiles
+	doins ${A/${P}.tar.xz/}
+}
+
+pkg_postinst() {
+	echo
+	elog 'Documentation is available in the genkernel manual page'
+	elog 'as well as the following URL:'
+	echo
+	elog 'https://wiki.gentoo.org/wiki/Genkernel'
+	echo
+	ewarn "This package is known to not work with reiser4.  If you are running"
+	ewarn "reiser4 and have a problem, do not file a bug.  We know it does not"
+	ewarn "work and we don't plan on fixing it since reiser4 is the one that is"
+	ewarn "broken in this regard.  Try using a sane filesystem like ext4."
+	echo
+	ewarn "The LUKS support has changed from versions prior to 3.4.4.  Now,"
+	ewarn "you use crypt_root=/dev/blah instead of real_root=luks:/dev/blah."
+	echo
+}

diff --git a/sys-kernel/genkernel/genkernel-9999.ebuild b/sys-kernel/genkernel/genkernel-9999.ebuild
new file mode 100644
index 0000000..a4053e3
--- /dev/null
+++ b/sys-kernel/genkernel/genkernel-9999.ebuild
@@ -0,0 +1,159 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+# genkernel-9999        -> latest Git branch "master"
+# genkernel-VERSION     -> normal genkernel release
+
+EAPI=5 # approved 2012.09.11, required by all profiles since 2014.03.12
+
+inherit bash-completion-r1 epatch
+
+VERSION_BUSYBOX='1.27.2' # warning, be sure to bump patches
+VERSION_DMRAID='1.0.0.rc16-3' # warning, be sure to bump patches
+VERSION_MDADM='4.0' # warning, be sure to bump patches
+VERSION_FUSE='2.8.6' # warning, be sure to bump patches
+VERSION_ISCSI='2.0-872' # warning, be sure to bump patches
+VERSION_LVM='2.02.173' # warning, be sure to bump patches
+VERSION_UNIONFS_FUSE='0.24'
+VERSION_GPG='1.4.22'
+
+RH_HOME="ftp://sourceware.org/pub"
+DM_HOME="https://people.redhat.com/~heinzm/sw/dmraid/src"
+BB_HOME="https://busybox.net/downloads"
+
+COMMON_URI="${DM_HOME}/dmraid-${VERSION_DMRAID}.tar.bz2
+		${DM_HOME}/old/dmraid-${VERSION_DMRAID}.tar.bz2
+		mirror://kernel/linux/utils/raid/mdadm/mdadm-${VERSION_MDADM}.tar.xz
+		${RH_HOME}/lvm2/LVM2.${VERSION_LVM}.tgz
+		${RH_HOME}/lvm2/old/LVM2.${VERSION_LVM}.tgz
+		${BB_HOME}/busybox-${VERSION_BUSYBOX}.tar.bz2
+		http://www.open-iscsi.org/bits/open-iscsi-${VERSION_ISCSI}.tar.gz
+		mirror://gentoo/open-iscsi-${VERSION_ISCSI}.tar.gz
+		mirror://sourceforge/fuse/fuse-${VERSION_FUSE}.tar.gz
+		http://podgorny.cz/unionfs-fuse/releases/unionfs-fuse-${VERSION_UNIONFS_FUSE}.tar.bz2
+		mirror://gentoo/unionfs-fuse-${VERSION_UNIONFS_FUSE}.tar.bz2
+		mirror://gnupg/gnupg/gnupg-${VERSION_GPG}.tar.bz2"
+
+if [[ ${PV} == 9999* ]]
+then
+	EGIT_REPO_URI="https://anongit.gentoo.org/git/proj/${PN}.git"
+	inherit git-r3
+	S="${WORKDIR}/${P}"
+	SRC_URI="${COMMON_URI}"
+else
+	SRC_URI="mirror://gentoo/${P}.tar.xz
+		${COMMON_URI}"
+	KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
+fi
+
+DESCRIPTION="Gentoo automatic kernel building scripts"
+HOMEPAGE="https://www.gentoo.org"
+
+LICENSE="GPL-2"
+SLOT="0"
+RESTRICT=""
+IUSE="cryptsetup ibm +firmware selinux"
+
+DEPEND="sys-fs/e2fsprogs
+	selinux? ( sys-libs/libselinux )"
+RDEPEND="${DEPEND}
+	cryptsetup? ( sys-fs/cryptsetup )
+	app-arch/cpio
+	>=app-misc/pax-utils-1.2.2
+	sys-apps/util-linux[static-libs(+)]
+	firmware? ( sys-kernel/linux-firmware )
+	!<sys-apps/openrc-0.9.9"
+# pax-utils is used for lddtree
+
+if [[ ${PV} == 9999* ]]; then
+	DEPEND="${DEPEND} app-text/asciidoc"
+fi
+
+pkg_pretend() {
+	if ! use cryptsetup && has_version "sys-kernel/genkernel[crypt]"; then
+		ewarn "Local use flag 'crypt' has been renamed to 'cryptsetup' (bug #414523)."
+		ewarn "Please set flag 'cryptsetup' for this very package if you would like"
+		ewarn "to have genkernel create an initramfs with LUKS support."
+		ewarn "Sorry for the inconvenience."
+		echo
+	fi
+}
+
+src_prepare() {
+	if [[ ${PV} == 9999* ]] ; then
+		einfo "Updating version tag"
+		GK_V="$(git describe --tags | sed 's:^v::')-git"
+		sed "/^GK_V/s,=.*,='${GK_V}',g" -i "${S}"/genkernel
+		einfo "Producing ChangeLog from Git history..."
+		pushd "${S}/.git" >/dev/null || die
+		git log > "${S}"/ChangeLog || die
+		popd >/dev/null || die
+	fi
+	if use selinux ; then
+		sed -i 's/###//g' "${S}"/gen_compile.sh || die
+	fi
+
+	# Update software.sh
+	sed -i \
+		-e "s:VERSION_BUSYBOX:$VERSION_BUSYBOX:" \
+		-e "s:VERSION_MDADM:$VERSION_MDADM:" \
+		-e "s:VERSION_DMRAID:$VERSION_DMRAID:" \
+		-e "s:VERSION_FUSE:$VERSION_FUSE:" \
+		-e "s:VERSION_ISCSI:$VERSION_ISCSI:" \
+		-e "s:VERSION_LVM:$VERSION_LVM:" \
+		-e "s:VERSION_UNIONFS_FUSE:$VERSION_UNIONFS_FUSE:" \
+		-e "s:VERSION_GPG:$VERSION_GPG:" \
+		"${S}"/defaults/software.sh \
+		|| die "Could not adjust versions"
+
+	epatch_user
+}
+
+src_compile() {
+	if [[ ${PV} == 9999* ]]; then
+		emake
+	fi
+}
+
+src_install() {
+	insinto /etc
+	doins "${S}"/genkernel.conf
+
+	doman genkernel.8
+	dodoc AUTHORS ChangeLog README TODO
+	dobin genkernel
+	rm -f genkernel genkernel.8 AUTHORS ChangeLog README TODO genkernel.conf
+
+	if use ibm ; then
+		cp "${S}"/arch/ppc64/kernel-2.6{-pSeries,} || die
+	else
+		cp "${S}"/arch/ppc64/kernel-2.6{.g5,} || die
+	fi
+	insinto /usr/share/genkernel
+	doins -r "${S}"/*
+
+	newbashcomp "${FILESDIR}"/genkernel.bash "${PN}"
+	insinto /etc
+	doins "${FILESDIR}"/initramfs.mounts
+
+	cd "${DISTDIR}"
+	insinto /usr/share/genkernel/distfiles
+	doins ${A/${P}.tar.xz/}
+}
+
+pkg_postinst() {
+	echo
+	elog 'Documentation is available in the genkernel manual page'
+	elog 'as well as the following URL:'
+	echo
+	elog 'https://wiki.gentoo.org/wiki/Genkernel'
+	echo
+	ewarn "This package is known to not work with reiser4.  If you are running"
+	ewarn "reiser4 and have a problem, do not file a bug.  We know it does not"
+	ewarn "work and we don't plan on fixing it since reiser4 is the one that is"
+	ewarn "broken in this regard.  Try using a sane filesystem like ext4."
+	echo
+	ewarn "The LUKS support has changed from versions prior to 3.4.4.  Now,"
+	ewarn "you use crypt_root=/dev/blah instead of real_root=luks:/dev/blah."
+	echo
+}

diff --git a/sys-kernel/genkernel/metadata.xml b/sys-kernel/genkernel/metadata.xml
new file mode 100644
index 0000000..fca8c03
--- /dev/null
+++ b/sys-kernel/genkernel/metadata.xml
@@ -0,0 +1,19 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+	<maintainer type="project">
+		<email>genkernel@gentoo.org</email>
+	</maintainer>
+	<use>
+		<flag name="cryptsetup">Enable support for Luks disk encryption using <pkg>sys-fs/cryptsetup</pkg></flag>
+		<flag name="firmware">Prefer system firmware <pkg>sys-kernel/linux-firmware</pkg> over local copy.</flag>
+	</use>
+	<!--
+	<upstream>
+		<remote-id type="gentoo">git://git.gentoo.org/proj/genkernel</remote-id>
+	</upstream>
+	-->
+	<upstream>
+		<remote-id type="sourceforge">fuse</remote-id>
+	</upstream>
+</pkgmetadata>

diff --git a/sys-kernel/gentoo-sources/gentoo-sources-4.14.52.ebuild b/sys-kernel/gentoo-sources/gentoo-sources-4.14.52.ebuild
new file mode 100644
index 0000000..9e98e3b
--- /dev/null
+++ b/sys-kernel/gentoo-sources/gentoo-sources-4.14.52.ebuild
@@ -0,0 +1,28 @@
+# Copyright 1999-2018 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+ETYPE="sources"
+K_WANT_GENPATCHES="base extras experimental"
+K_GENPATCHES_VER="57"
+
+inherit kernel-2
+detect_version
+detect_arch
+
+KEYWORDS="arm"
+HOMEPAGE="https://dev.gentoo.org/~mpagano/genpatches"
+IUSE="experimental"
+
+DESCRIPTION="Full sources including the Gentoo patchset for the ${KV_MAJOR}.${KV_MINOR} kernel tree"
+SRC_URI="${KERNEL_URI} ${GENPATCHES_URI} ${ARCH_URI}"
+
+pkg_postinst() {
+	kernel-2_pkg_postinst
+	einfo "For more info on this patchset, and how to report problems, see:"
+	einfo "${HOMEPAGE}"
+}
+
+pkg_postrm() {
+	kernel-2_pkg_postrm
+}

diff --git a/sys-kernel/gentoo-sources/gentoo-sources-4.14.65.ebuild b/sys-kernel/gentoo-sources/gentoo-sources-4.14.65.ebuild
new file mode 100644
index 0000000..a09b296
--- /dev/null
+++ b/sys-kernel/gentoo-sources/gentoo-sources-4.14.65.ebuild
@@ -0,0 +1,28 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+ETYPE="sources"
+K_WANT_GENPATCHES="base extras experimental"
+K_GENPATCHES_VER="71"
+
+inherit kernel-2
+detect_version
+detect_arch
+
+KEYWORDS="alpha amd64 ~arm ~arm64 hppa ia64 ~mips ppc ppc64 ~s390 ~sh ~sparc x86"
+HOMEPAGE="https://dev.gentoo.org/~mpagano/genpatches"
+IUSE="experimental"
+
+DESCRIPTION="Full sources including the Gentoo patchset for the ${KV_MAJOR}.${KV_MINOR} kernel tree"
+SRC_URI="${KERNEL_URI} ${GENPATCHES_URI} ${ARCH_URI}"
+
+pkg_postinst() {
+	kernel-2_pkg_postinst
+	einfo "For more info on this patchset, and how to report problems, see:"
+	einfo "${HOMEPAGE}"
+}
+
+pkg_postrm() {
+	kernel-2_pkg_postrm
+}

diff --git a/sys-kernel/gentoo-sources/gentoo-sources-4.14.71.ebuild b/sys-kernel/gentoo-sources/gentoo-sources-4.14.71.ebuild
new file mode 100644
index 0000000..b9bcc7c
--- /dev/null
+++ b/sys-kernel/gentoo-sources/gentoo-sources-4.14.71.ebuild
@@ -0,0 +1,28 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+ETYPE="sources"
+K_WANT_GENPATCHES="base extras experimental"
+K_GENPATCHES_VER="77"
+
+inherit kernel-2
+detect_version
+detect_arch
+
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
+HOMEPAGE="https://dev.gentoo.org/~mpagano/genpatches"
+IUSE="experimental"
+
+DESCRIPTION="Full sources including the Gentoo patchset for the ${KV_MAJOR}.${KV_MINOR} kernel tree"
+SRC_URI="${KERNEL_URI} ${GENPATCHES_URI} ${ARCH_URI}"
+
+pkg_postinst() {
+	kernel-2_pkg_postinst
+	einfo "For more info on this patchset, and how to report problems, see:"
+	einfo "${HOMEPAGE}"
+}
+
+pkg_postrm() {
+	kernel-2_pkg_postrm
+}

diff --git a/sys-kernel/gentoo-sources/gentoo-sources-4.14.72.ebuild b/sys-kernel/gentoo-sources/gentoo-sources-4.14.72.ebuild
new file mode 100644
index 0000000..55da902
--- /dev/null
+++ b/sys-kernel/gentoo-sources/gentoo-sources-4.14.72.ebuild
@@ -0,0 +1,28 @@
+# Copyright 1999-2018 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+ETYPE="sources"
+K_WANT_GENPATCHES="base extras experimental"
+K_GENPATCHES_VER="78"
+
+inherit kernel-2
+detect_version
+detect_arch
+
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
+HOMEPAGE="https://dev.gentoo.org/~mpagano/genpatches"
+IUSE="experimental"
+
+DESCRIPTION="Full sources including the Gentoo patchset for the ${KV_MAJOR}.${KV_MINOR} kernel tree"
+SRC_URI="${KERNEL_URI} ${GENPATCHES_URI} ${ARCH_URI}"
+
+pkg_postinst() {
+	kernel-2_pkg_postinst
+	einfo "For more info on this patchset, and how to report problems, see:"
+	einfo "${HOMEPAGE}"
+}
+
+pkg_postrm() {
+	kernel-2_pkg_postrm
+}

diff --git a/sys-kernel/gentoo-sources/gentoo-sources-4.14.73.ebuild b/sys-kernel/gentoo-sources/gentoo-sources-4.14.73.ebuild
new file mode 100644
index 0000000..0391d2f
--- /dev/null
+++ b/sys-kernel/gentoo-sources/gentoo-sources-4.14.73.ebuild
@@ -0,0 +1,28 @@
+# Copyright 1999-2018 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+ETYPE="sources"
+K_WANT_GENPATCHES="base extras experimental"
+K_GENPATCHES_VER="79"
+
+inherit kernel-2
+detect_version
+detect_arch
+
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
+HOMEPAGE="https://dev.gentoo.org/~mpagano/genpatches"
+IUSE="experimental"
+
+DESCRIPTION="Full sources including the Gentoo patchset for the ${KV_MAJOR}.${KV_MINOR} kernel tree"
+SRC_URI="${KERNEL_URI} ${GENPATCHES_URI} ${ARCH_URI}"
+
+pkg_postinst() {
+	kernel-2_pkg_postinst
+	einfo "For more info on this patchset, and how to report problems, see:"
+	einfo "${HOMEPAGE}"
+}
+
+pkg_postrm() {
+	kernel-2_pkg_postrm
+}

diff --git a/sys-kernel/gentoo-sources/gentoo-sources-4.14.74.ebuild b/sys-kernel/gentoo-sources/gentoo-sources-4.14.74.ebuild
new file mode 100644
index 0000000..1b1b0ef
--- /dev/null
+++ b/sys-kernel/gentoo-sources/gentoo-sources-4.14.74.ebuild
@@ -0,0 +1,28 @@
+# Copyright 1999-2018 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+ETYPE="sources"
+K_WANT_GENPATCHES="base extras experimental"
+K_GENPATCHES_VER="80"
+
+inherit kernel-2
+detect_version
+detect_arch
+
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
+HOMEPAGE="https://dev.gentoo.org/~mpagano/genpatches"
+IUSE="experimental"
+
+DESCRIPTION="Full sources including the Gentoo patchset for the ${KV_MAJOR}.${KV_MINOR} kernel tree"
+SRC_URI="${KERNEL_URI} ${GENPATCHES_URI} ${ARCH_URI}"
+
+pkg_postinst() {
+	kernel-2_pkg_postinst
+	einfo "For more info on this patchset, and how to report problems, see:"
+	einfo "${HOMEPAGE}"
+}
+
+pkg_postrm() {
+	kernel-2_pkg_postrm
+}

diff --git a/sys-kernel/gentoo-sources/gentoo-sources-4.14.75.ebuild b/sys-kernel/gentoo-sources/gentoo-sources-4.14.75.ebuild
new file mode 100644
index 0000000..c387aa4
--- /dev/null
+++ b/sys-kernel/gentoo-sources/gentoo-sources-4.14.75.ebuild
@@ -0,0 +1,28 @@
+# Copyright 1999-2018 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+ETYPE="sources"
+K_WANT_GENPATCHES="base extras experimental"
+K_GENPATCHES_VER="81"
+
+inherit kernel-2
+detect_version
+detect_arch
+
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
+HOMEPAGE="https://dev.gentoo.org/~mpagano/genpatches"
+IUSE="experimental"
+
+DESCRIPTION="Full sources including the Gentoo patchset for the ${KV_MAJOR}.${KV_MINOR} kernel tree"
+SRC_URI="${KERNEL_URI} ${GENPATCHES_URI} ${ARCH_URI}"
+
+pkg_postinst() {
+	kernel-2_pkg_postinst
+	einfo "For more info on this patchset, and how to report problems, see:"
+	einfo "${HOMEPAGE}"
+}
+
+pkg_postrm() {
+	kernel-2_pkg_postrm
+}

diff --git a/sys-kernel/gentoo-sources/gentoo-sources-4.14.76.ebuild b/sys-kernel/gentoo-sources/gentoo-sources-4.14.76.ebuild
new file mode 100644
index 0000000..137c77b
--- /dev/null
+++ b/sys-kernel/gentoo-sources/gentoo-sources-4.14.76.ebuild
@@ -0,0 +1,28 @@
+# Copyright 1999-2018 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+ETYPE="sources"
+K_WANT_GENPATCHES="base extras experimental"
+K_GENPATCHES_VER="82"
+
+inherit kernel-2
+detect_version
+detect_arch
+
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
+HOMEPAGE="https://dev.gentoo.org/~mpagano/genpatches"
+IUSE="experimental"
+
+DESCRIPTION="Full sources including the Gentoo patchset for the ${KV_MAJOR}.${KV_MINOR} kernel tree"
+SRC_URI="${KERNEL_URI} ${GENPATCHES_URI} ${ARCH_URI}"
+
+pkg_postinst() {
+	kernel-2_pkg_postinst
+	einfo "For more info on this patchset, and how to report problems, see:"
+	einfo "${HOMEPAGE}"
+}
+
+pkg_postrm() {
+	kernel-2_pkg_postrm
+}

diff --git a/sys-kernel/gentoo-sources/gentoo-sources-4.14.77.ebuild b/sys-kernel/gentoo-sources/gentoo-sources-4.14.77.ebuild
new file mode 100644
index 0000000..43c2d3f
--- /dev/null
+++ b/sys-kernel/gentoo-sources/gentoo-sources-4.14.77.ebuild
@@ -0,0 +1,28 @@
+# Copyright 1999-2018 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+ETYPE="sources"
+K_WANT_GENPATCHES="base extras experimental"
+K_GENPATCHES_VER="84"
+
+inherit kernel-2
+detect_version
+detect_arch
+
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
+HOMEPAGE="https://dev.gentoo.org/~mpagano/genpatches"
+IUSE="experimental"
+
+DESCRIPTION="Full sources including the Gentoo patchset for the ${KV_MAJOR}.${KV_MINOR} kernel tree"
+SRC_URI="${KERNEL_URI} ${GENPATCHES_URI} ${ARCH_URI}"
+
+pkg_postinst() {
+	kernel-2_pkg_postinst
+	einfo "For more info on this patchset, and how to report problems, see:"
+	einfo "${HOMEPAGE}"
+}
+
+pkg_postrm() {
+	kernel-2_pkg_postrm
+}

diff --git a/sys-kernel/gentoo-sources/gentoo-sources-4.14.78.ebuild b/sys-kernel/gentoo-sources/gentoo-sources-4.14.78.ebuild
new file mode 100644
index 0000000..8df6b81
--- /dev/null
+++ b/sys-kernel/gentoo-sources/gentoo-sources-4.14.78.ebuild
@@ -0,0 +1,28 @@
+# Copyright 1999-2018 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+ETYPE="sources"
+K_WANT_GENPATCHES="base extras experimental"
+K_GENPATCHES_VER="85"
+
+inherit kernel-2
+detect_version
+detect_arch
+
+KEYWORDS="~alpha amd64 ~arm ~arm64 ~hppa ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc x86"
+HOMEPAGE="https://dev.gentoo.org/~mpagano/genpatches"
+IUSE="experimental"
+
+DESCRIPTION="Full sources including the Gentoo patchset for the ${KV_MAJOR}.${KV_MINOR} kernel tree"
+SRC_URI="${KERNEL_URI} ${GENPATCHES_URI} ${ARCH_URI}"
+
+pkg_postinst() {
+	kernel-2_pkg_postinst
+	einfo "For more info on this patchset, and how to report problems, see:"
+	einfo "${HOMEPAGE}"
+}
+
+pkg_postrm() {
+	kernel-2_pkg_postrm
+}

diff --git a/sys-kernel/gentoo-sources/gentoo-sources-4.18.10.ebuild b/sys-kernel/gentoo-sources/gentoo-sources-4.18.10.ebuild
new file mode 100644
index 0000000..62c7ab6
--- /dev/null
+++ b/sys-kernel/gentoo-sources/gentoo-sources-4.18.10.ebuild
@@ -0,0 +1,28 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+ETYPE="sources"
+K_WANT_GENPATCHES="base extras experimental"
+K_GENPATCHES_VER="13"
+
+inherit kernel-2
+detect_version
+detect_arch
+
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
+HOMEPAGE="https://dev.gentoo.org/~mpagano/genpatches"
+IUSE="experimental"
+
+DESCRIPTION="Full sources including the Gentoo patchset for the ${KV_MAJOR}.${KV_MINOR} kernel tree"
+SRC_URI="${KERNEL_URI} ${GENPATCHES_URI} ${ARCH_URI}"
+
+pkg_postinst() {
+	kernel-2_pkg_postinst
+	einfo "For more info on this patchset, and how to report problems, see:"
+	einfo "${HOMEPAGE}"
+}
+
+pkg_postrm() {
+	kernel-2_pkg_postrm
+}

diff --git a/sys-kernel/gentoo-sources/gentoo-sources-4.18.11.ebuild b/sys-kernel/gentoo-sources/gentoo-sources-4.18.11.ebuild
new file mode 100644
index 0000000..baf962f
--- /dev/null
+++ b/sys-kernel/gentoo-sources/gentoo-sources-4.18.11.ebuild
@@ -0,0 +1,28 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+ETYPE="sources"
+K_WANT_GENPATCHES="base extras experimental"
+K_GENPATCHES_VER="14"
+
+inherit kernel-2
+detect_version
+detect_arch
+
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
+HOMEPAGE="https://dev.gentoo.org/~mpagano/genpatches"
+IUSE="experimental"
+
+DESCRIPTION="Full sources including the Gentoo patchset for the ${KV_MAJOR}.${KV_MINOR} kernel tree"
+SRC_URI="${KERNEL_URI} ${GENPATCHES_URI} ${ARCH_URI}"
+
+pkg_postinst() {
+	kernel-2_pkg_postinst
+	einfo "For more info on this patchset, and how to report problems, see:"
+	einfo "${HOMEPAGE}"
+}
+
+pkg_postrm() {
+	kernel-2_pkg_postrm
+}

diff --git a/sys-kernel/gentoo-sources/gentoo-sources-4.18.12.ebuild b/sys-kernel/gentoo-sources/gentoo-sources-4.18.12.ebuild
new file mode 100644
index 0000000..e61f1e6
--- /dev/null
+++ b/sys-kernel/gentoo-sources/gentoo-sources-4.18.12.ebuild
@@ -0,0 +1,28 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+ETYPE="sources"
+K_WANT_GENPATCHES="base extras experimental"
+K_GENPATCHES_VER="15"
+
+inherit kernel-2
+detect_version
+detect_arch
+
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
+HOMEPAGE="https://dev.gentoo.org/~mpagano/genpatches"
+IUSE="experimental"
+
+DESCRIPTION="Full sources including the Gentoo patchset for the ${KV_MAJOR}.${KV_MINOR} kernel tree"
+SRC_URI="${KERNEL_URI} ${GENPATCHES_URI} ${ARCH_URI}"
+
+pkg_postinst() {
+	kernel-2_pkg_postinst
+	einfo "For more info on this patchset, and how to report problems, see:"
+	einfo "${HOMEPAGE}"
+}
+
+pkg_postrm() {
+	kernel-2_pkg_postrm
+}

diff --git a/sys-kernel/gentoo-sources/gentoo-sources-4.18.13.ebuild b/sys-kernel/gentoo-sources/gentoo-sources-4.18.13.ebuild
new file mode 100644
index 0000000..8da04d5
--- /dev/null
+++ b/sys-kernel/gentoo-sources/gentoo-sources-4.18.13.ebuild
@@ -0,0 +1,28 @@
+# Copyright 1999-2018 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+ETYPE="sources"
+K_WANT_GENPATCHES="base extras experimental"
+K_GENPATCHES_VER="16"
+
+inherit kernel-2
+detect_version
+detect_arch
+
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
+HOMEPAGE="https://dev.gentoo.org/~mpagano/genpatches"
+IUSE="experimental"
+
+DESCRIPTION="Full sources including the Gentoo patchset for the ${KV_MAJOR}.${KV_MINOR} kernel tree"
+SRC_URI="${KERNEL_URI} ${GENPATCHES_URI} ${ARCH_URI}"
+
+pkg_postinst() {
+	kernel-2_pkg_postinst
+	einfo "For more info on this patchset, and how to report problems, see:"
+	einfo "${HOMEPAGE}"
+}
+
+pkg_postrm() {
+	kernel-2_pkg_postrm
+}

diff --git a/sys-kernel/gentoo-sources/gentoo-sources-4.18.14.ebuild b/sys-kernel/gentoo-sources/gentoo-sources-4.18.14.ebuild
new file mode 100644
index 0000000..f688943
--- /dev/null
+++ b/sys-kernel/gentoo-sources/gentoo-sources-4.18.14.ebuild
@@ -0,0 +1,28 @@
+# Copyright 1999-2018 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+ETYPE="sources"
+K_WANT_GENPATCHES="base extras experimental"
+K_GENPATCHES_VER="17"
+
+inherit kernel-2
+detect_version
+detect_arch
+
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
+HOMEPAGE="https://dev.gentoo.org/~mpagano/genpatches"
+IUSE="experimental"
+
+DESCRIPTION="Full sources including the Gentoo patchset for the ${KV_MAJOR}.${KV_MINOR} kernel tree"
+SRC_URI="${KERNEL_URI} ${GENPATCHES_URI} ${ARCH_URI}"
+
+pkg_postinst() {
+	kernel-2_pkg_postinst
+	einfo "For more info on this patchset, and how to report problems, see:"
+	einfo "${HOMEPAGE}"
+}
+
+pkg_postrm() {
+	kernel-2_pkg_postrm
+}

diff --git a/sys-kernel/gentoo-sources/gentoo-sources-4.18.15.ebuild b/sys-kernel/gentoo-sources/gentoo-sources-4.18.15.ebuild
new file mode 100644
index 0000000..c44f667
--- /dev/null
+++ b/sys-kernel/gentoo-sources/gentoo-sources-4.18.15.ebuild
@@ -0,0 +1,28 @@
+# Copyright 1999-2018 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+ETYPE="sources"
+K_WANT_GENPATCHES="base extras experimental"
+K_GENPATCHES_VER="18"
+
+inherit kernel-2
+detect_version
+detect_arch
+
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
+HOMEPAGE="https://dev.gentoo.org/~mpagano/genpatches"
+IUSE="experimental"
+
+DESCRIPTION="Full sources including the Gentoo patchset for the ${KV_MAJOR}.${KV_MINOR} kernel tree"
+SRC_URI="${KERNEL_URI} ${GENPATCHES_URI} ${ARCH_URI}"
+
+pkg_postinst() {
+	kernel-2_pkg_postinst
+	einfo "For more info on this patchset, and how to report problems, see:"
+	einfo "${HOMEPAGE}"
+}
+
+pkg_postrm() {
+	kernel-2_pkg_postrm
+}

diff --git a/sys-kernel/gentoo-sources/gentoo-sources-4.18.16.ebuild b/sys-kernel/gentoo-sources/gentoo-sources-4.18.16.ebuild
new file mode 100644
index 0000000..b608e8d
--- /dev/null
+++ b/sys-kernel/gentoo-sources/gentoo-sources-4.18.16.ebuild
@@ -0,0 +1,28 @@
+# Copyright 1999-2018 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+ETYPE="sources"
+K_WANT_GENPATCHES="base extras experimental"
+K_GENPATCHES_VER="19"
+
+inherit kernel-2
+detect_version
+detect_arch
+
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
+HOMEPAGE="https://dev.gentoo.org/~mpagano/genpatches"
+IUSE="experimental"
+
+DESCRIPTION="Full sources including the Gentoo patchset for the ${KV_MAJOR}.${KV_MINOR} kernel tree"
+SRC_URI="${KERNEL_URI} ${GENPATCHES_URI} ${ARCH_URI}"
+
+pkg_postinst() {
+	kernel-2_pkg_postinst
+	einfo "For more info on this patchset, and how to report problems, see:"
+	einfo "${HOMEPAGE}"
+}
+
+pkg_postrm() {
+	kernel-2_pkg_postrm
+}

diff --git a/sys-kernel/gentoo-sources/gentoo-sources-4.18.9.ebuild b/sys-kernel/gentoo-sources/gentoo-sources-4.18.9.ebuild
new file mode 100644
index 0000000..5c9caf4
--- /dev/null
+++ b/sys-kernel/gentoo-sources/gentoo-sources-4.18.9.ebuild
@@ -0,0 +1,28 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+ETYPE="sources"
+K_WANT_GENPATCHES="base extras experimental"
+K_GENPATCHES_VER="12"
+
+inherit kernel-2
+detect_version
+detect_arch
+
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
+HOMEPAGE="https://dev.gentoo.org/~mpagano/genpatches"
+IUSE="experimental"
+
+DESCRIPTION="Full sources including the Gentoo patchset for the ${KV_MAJOR}.${KV_MINOR} kernel tree"
+SRC_URI="${KERNEL_URI} ${GENPATCHES_URI} ${ARCH_URI}"
+
+pkg_postinst() {
+	kernel-2_pkg_postinst
+	einfo "For more info on this patchset, and how to report problems, see:"
+	einfo "${HOMEPAGE}"
+}
+
+pkg_postrm() {
+	kernel-2_pkg_postrm
+}

diff --git a/sys-kernel/gentoo-sources/gentoo-sources-4.19.0.ebuild b/sys-kernel/gentoo-sources/gentoo-sources-4.19.0.ebuild
new file mode 100644
index 0000000..04abf29
--- /dev/null
+++ b/sys-kernel/gentoo-sources/gentoo-sources-4.19.0.ebuild
@@ -0,0 +1,28 @@
+# Copyright 1999-2018 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+ETYPE="sources"
+K_WANT_GENPATCHES="base extras experimental"
+K_GENPATCHES_VER="1"
+
+inherit kernel-2
+detect_version
+detect_arch
+
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
+HOMEPAGE="https://dev.gentoo.org/~mpagano/genpatches"
+IUSE="experimental"
+
+DESCRIPTION="Full sources including the Gentoo patchset for the ${KV_MAJOR}.${KV_MINOR} kernel tree"
+SRC_URI="${KERNEL_URI} ${GENPATCHES_URI} ${ARCH_URI}"
+
+pkg_postinst() {
+	kernel-2_pkg_postinst
+	einfo "For more info on this patchset, and how to report problems, see:"
+	einfo "${HOMEPAGE}"
+}
+
+pkg_postrm() {
+	kernel-2_pkg_postrm
+}

diff --git a/sys-kernel/gentoo-sources/gentoo-sources-4.4.150.ebuild b/sys-kernel/gentoo-sources/gentoo-sources-4.4.150.ebuild
new file mode 100644
index 0000000..ea00a19
--- /dev/null
+++ b/sys-kernel/gentoo-sources/gentoo-sources-4.4.150.ebuild
@@ -0,0 +1,28 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+ETYPE="sources"
+K_WANT_GENPATCHES="base extras experimental"
+K_GENPATCHES_VER="151"
+
+inherit kernel-2
+detect_version
+detect_arch
+
+KEYWORDS="alpha amd64 ~arm ~arm64 hppa ia64 ~mips ppc ppc64 ~s390 ~sh ~sparc x86"
+HOMEPAGE="https://dev.gentoo.org/~mpagano/genpatches"
+IUSE="experimental"
+
+DESCRIPTION="Full sources including the Gentoo patchset for the ${KV_MAJOR}.${KV_MINOR} kernel tree"
+SRC_URI="${KERNEL_URI} ${GENPATCHES_URI} ${ARCH_URI}"
+
+pkg_postinst() {
+	kernel-2_pkg_postinst
+	einfo "For more info on this patchset, and how to report problems, see:"
+	einfo "${HOMEPAGE}"
+}
+
+pkg_postrm() {
+	kernel-2_pkg_postrm
+}

diff --git a/sys-kernel/gentoo-sources/gentoo-sources-4.4.157.ebuild b/sys-kernel/gentoo-sources/gentoo-sources-4.4.157.ebuild
new file mode 100644
index 0000000..e27b216
--- /dev/null
+++ b/sys-kernel/gentoo-sources/gentoo-sources-4.4.157.ebuild
@@ -0,0 +1,28 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+ETYPE="sources"
+K_WANT_GENPATCHES="base extras experimental"
+K_GENPATCHES_VER="158"
+
+inherit kernel-2
+detect_version
+detect_arch
+
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
+HOMEPAGE="https://dev.gentoo.org/~mpagano/genpatches"
+IUSE="experimental"
+
+DESCRIPTION="Full sources including the Gentoo patchset for the ${KV_MAJOR}.${KV_MINOR} kernel tree"
+SRC_URI="${KERNEL_URI} ${GENPATCHES_URI} ${ARCH_URI}"
+
+pkg_postinst() {
+	kernel-2_pkg_postinst
+	einfo "For more info on this patchset, and how to report problems, see:"
+	einfo "${HOMEPAGE}"
+}
+
+pkg_postrm() {
+	kernel-2_pkg_postrm
+}

diff --git a/sys-kernel/gentoo-sources/gentoo-sources-4.4.159.ebuild b/sys-kernel/gentoo-sources/gentoo-sources-4.4.159.ebuild
new file mode 100644
index 0000000..f7efc0c
--- /dev/null
+++ b/sys-kernel/gentoo-sources/gentoo-sources-4.4.159.ebuild
@@ -0,0 +1,28 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+ETYPE="sources"
+K_WANT_GENPATCHES="base extras experimental"
+K_GENPATCHES_VER="160"
+
+inherit kernel-2
+detect_version
+detect_arch
+
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
+HOMEPAGE="https://dev.gentoo.org/~mpagano/genpatches"
+IUSE="experimental"
+
+DESCRIPTION="Full sources including the Gentoo patchset for the ${KV_MAJOR}.${KV_MINOR} kernel tree"
+SRC_URI="${KERNEL_URI} ${GENPATCHES_URI} ${ARCH_URI}"
+
+pkg_postinst() {
+	kernel-2_pkg_postinst
+	einfo "For more info on this patchset, and how to report problems, see:"
+	einfo "${HOMEPAGE}"
+}
+
+pkg_postrm() {
+	kernel-2_pkg_postrm
+}

diff --git a/sys-kernel/gentoo-sources/gentoo-sources-4.4.160.ebuild b/sys-kernel/gentoo-sources/gentoo-sources-4.4.160.ebuild
new file mode 100644
index 0000000..1f07dac
--- /dev/null
+++ b/sys-kernel/gentoo-sources/gentoo-sources-4.4.160.ebuild
@@ -0,0 +1,28 @@
+# Copyright 1999-2018 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+ETYPE="sources"
+K_WANT_GENPATCHES="base extras experimental"
+K_GENPATCHES_VER="161"
+
+inherit kernel-2
+detect_version
+detect_arch
+
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
+HOMEPAGE="https://dev.gentoo.org/~mpagano/genpatches"
+IUSE="experimental"
+
+DESCRIPTION="Full sources including the Gentoo patchset for the ${KV_MAJOR}.${KV_MINOR} kernel tree"
+SRC_URI="${KERNEL_URI} ${GENPATCHES_URI} ${ARCH_URI}"
+
+pkg_postinst() {
+	kernel-2_pkg_postinst
+	einfo "For more info on this patchset, and how to report problems, see:"
+	einfo "${HOMEPAGE}"
+}
+
+pkg_postrm() {
+	kernel-2_pkg_postrm
+}

diff --git a/sys-kernel/gentoo-sources/gentoo-sources-4.4.161.ebuild b/sys-kernel/gentoo-sources/gentoo-sources-4.4.161.ebuild
new file mode 100644
index 0000000..831ed34
--- /dev/null
+++ b/sys-kernel/gentoo-sources/gentoo-sources-4.4.161.ebuild
@@ -0,0 +1,28 @@
+# Copyright 1999-2018 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+ETYPE="sources"
+K_WANT_GENPATCHES="base extras experimental"
+K_GENPATCHES_VER="162"
+
+inherit kernel-2
+detect_version
+detect_arch
+
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
+HOMEPAGE="https://dev.gentoo.org/~mpagano/genpatches"
+IUSE="experimental"
+
+DESCRIPTION="Full sources including the Gentoo patchset for the ${KV_MAJOR}.${KV_MINOR} kernel tree"
+SRC_URI="${KERNEL_URI} ${GENPATCHES_URI} ${ARCH_URI}"
+
+pkg_postinst() {
+	kernel-2_pkg_postinst
+	einfo "For more info on this patchset, and how to report problems, see:"
+	einfo "${HOMEPAGE}"
+}
+
+pkg_postrm() {
+	kernel-2_pkg_postrm
+}

diff --git a/sys-kernel/gentoo-sources/gentoo-sources-4.4.162.ebuild b/sys-kernel/gentoo-sources/gentoo-sources-4.4.162.ebuild
new file mode 100644
index 0000000..41ccae5
--- /dev/null
+++ b/sys-kernel/gentoo-sources/gentoo-sources-4.4.162.ebuild
@@ -0,0 +1,28 @@
+# Copyright 1999-2018 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+ETYPE="sources"
+K_WANT_GENPATCHES="base extras experimental"
+K_GENPATCHES_VER="163"
+
+inherit kernel-2
+detect_version
+detect_arch
+
+KEYWORDS="~alpha amd64 ~arm ~arm64 ~hppa ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc x86"
+HOMEPAGE="https://dev.gentoo.org/~mpagano/genpatches"
+IUSE="experimental"
+
+DESCRIPTION="Full sources including the Gentoo patchset for the ${KV_MAJOR}.${KV_MINOR} kernel tree"
+SRC_URI="${KERNEL_URI} ${GENPATCHES_URI} ${ARCH_URI}"
+
+pkg_postinst() {
+	kernel-2_pkg_postinst
+	einfo "For more info on this patchset, and how to report problems, see:"
+	einfo "${HOMEPAGE}"
+}
+
+pkg_postrm() {
+	kernel-2_pkg_postrm
+}

diff --git a/sys-kernel/gentoo-sources/gentoo-sources-4.9.122.ebuild b/sys-kernel/gentoo-sources/gentoo-sources-4.9.122.ebuild
new file mode 100644
index 0000000..85771c7
--- /dev/null
+++ b/sys-kernel/gentoo-sources/gentoo-sources-4.9.122.ebuild
@@ -0,0 +1,28 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+ETYPE="sources"
+K_WANT_GENPATCHES="base extras experimental"
+K_GENPATCHES_VER="126"
+
+inherit kernel-2
+detect_version
+detect_arch
+
+KEYWORDS="alpha amd64 ~arm ~arm64 hppa ia64 ~mips ppc ppc64 ~s390 ~sh ~sparc x86"
+HOMEPAGE="https://dev.gentoo.org/~mpagano/genpatches"
+IUSE="experimental"
+
+DESCRIPTION="Full sources including the Gentoo patchset for the ${KV_MAJOR}.${KV_MINOR} kernel tree"
+SRC_URI="${KERNEL_URI} ${GENPATCHES_URI} ${ARCH_URI}"
+
+pkg_postinst() {
+	kernel-2_pkg_postinst
+	einfo "For more info on this patchset, and how to report problems, see:"
+	einfo "${HOMEPAGE}"
+}
+
+pkg_postrm() {
+	kernel-2_pkg_postrm
+}

diff --git a/sys-kernel/gentoo-sources/gentoo-sources-4.9.132.ebuild b/sys-kernel/gentoo-sources/gentoo-sources-4.9.132.ebuild
new file mode 100644
index 0000000..f59eab6
--- /dev/null
+++ b/sys-kernel/gentoo-sources/gentoo-sources-4.9.132.ebuild
@@ -0,0 +1,28 @@
+# Copyright 1999-2018 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+ETYPE="sources"
+K_WANT_GENPATCHES="base extras experimental"
+K_GENPATCHES_VER="136"
+
+inherit kernel-2
+detect_version
+detect_arch
+
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
+HOMEPAGE="https://dev.gentoo.org/~mpagano/genpatches"
+IUSE="experimental"
+
+DESCRIPTION="Full sources including the Gentoo patchset for the ${KV_MAJOR}.${KV_MINOR} kernel tree"
+SRC_URI="${KERNEL_URI} ${GENPATCHES_URI} ${ARCH_URI}"
+
+pkg_postinst() {
+	kernel-2_pkg_postinst
+	einfo "For more info on this patchset, and how to report problems, see:"
+	einfo "${HOMEPAGE}"
+}
+
+pkg_postrm() {
+	kernel-2_pkg_postrm
+}

diff --git a/sys-kernel/gentoo-sources/gentoo-sources-4.9.133.ebuild b/sys-kernel/gentoo-sources/gentoo-sources-4.9.133.ebuild
new file mode 100644
index 0000000..11b40a4
--- /dev/null
+++ b/sys-kernel/gentoo-sources/gentoo-sources-4.9.133.ebuild
@@ -0,0 +1,28 @@
+# Copyright 1999-2018 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+ETYPE="sources"
+K_WANT_GENPATCHES="base extras experimental"
+K_GENPATCHES_VER="137"
+
+inherit kernel-2
+detect_version
+detect_arch
+
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
+HOMEPAGE="https://dev.gentoo.org/~mpagano/genpatches"
+IUSE="experimental"
+
+DESCRIPTION="Full sources including the Gentoo patchset for the ${KV_MAJOR}.${KV_MINOR} kernel tree"
+SRC_URI="${KERNEL_URI} ${GENPATCHES_URI} ${ARCH_URI}"
+
+pkg_postinst() {
+	kernel-2_pkg_postinst
+	einfo "For more info on this patchset, and how to report problems, see:"
+	einfo "${HOMEPAGE}"
+}
+
+pkg_postrm() {
+	kernel-2_pkg_postrm
+}

diff --git a/sys-kernel/gentoo-sources/gentoo-sources-4.9.134.ebuild b/sys-kernel/gentoo-sources/gentoo-sources-4.9.134.ebuild
new file mode 100644
index 0000000..1b730e9
--- /dev/null
+++ b/sys-kernel/gentoo-sources/gentoo-sources-4.9.134.ebuild
@@ -0,0 +1,28 @@
+# Copyright 1999-2018 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+ETYPE="sources"
+K_WANT_GENPATCHES="base extras experimental"
+K_GENPATCHES_VER="138"
+
+inherit kernel-2
+detect_version
+detect_arch
+
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
+HOMEPAGE="https://dev.gentoo.org/~mpagano/genpatches"
+IUSE="experimental"
+
+DESCRIPTION="Full sources including the Gentoo patchset for the ${KV_MAJOR}.${KV_MINOR} kernel tree"
+SRC_URI="${KERNEL_URI} ${GENPATCHES_URI} ${ARCH_URI}"
+
+pkg_postinst() {
+	kernel-2_pkg_postinst
+	einfo "For more info on this patchset, and how to report problems, see:"
+	einfo "${HOMEPAGE}"
+}
+
+pkg_postrm() {
+	kernel-2_pkg_postrm
+}

diff --git a/sys-kernel/gentoo-sources/gentoo-sources-4.9.135.ebuild b/sys-kernel/gentoo-sources/gentoo-sources-4.9.135.ebuild
new file mode 100644
index 0000000..cac7b12
--- /dev/null
+++ b/sys-kernel/gentoo-sources/gentoo-sources-4.9.135.ebuild
@@ -0,0 +1,28 @@
+# Copyright 1999-2018 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+ETYPE="sources"
+K_WANT_GENPATCHES="base extras experimental"
+K_GENPATCHES_VER="139"
+
+inherit kernel-2
+detect_version
+detect_arch
+
+KEYWORDS="~alpha amd64 ~arm ~arm64 ~hppa ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc x86"
+HOMEPAGE="https://dev.gentoo.org/~mpagano/genpatches"
+IUSE="experimental"
+
+DESCRIPTION="Full sources including the Gentoo patchset for the ${KV_MAJOR}.${KV_MINOR} kernel tree"
+SRC_URI="${KERNEL_URI} ${GENPATCHES_URI} ${ARCH_URI}"
+
+pkg_postinst() {
+	kernel-2_pkg_postinst
+	einfo "For more info on this patchset, and how to report problems, see:"
+	einfo "${HOMEPAGE}"
+}
+
+pkg_postrm() {
+	kernel-2_pkg_postrm
+}

diff --git a/sys-kernel/gentoo-sources/gentoo-sources-4.9.49-r1.ebuild b/sys-kernel/gentoo-sources/gentoo-sources-4.9.49-r1.ebuild
new file mode 100644
index 0000000..2d7ca65
--- /dev/null
+++ b/sys-kernel/gentoo-sources/gentoo-sources-4.9.49-r1.ebuild
@@ -0,0 +1,28 @@
+# Copyright 1999-2018 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+ETYPE="sources"
+K_WANT_GENPATCHES="base extras experimental"
+K_GENPATCHES_VER="51"
+
+inherit kernel-2
+detect_version
+detect_arch
+
+KEYWORDS="sparc"
+HOMEPAGE="https://dev.gentoo.org/~mpagano/genpatches"
+IUSE="experimental"
+
+DESCRIPTION="Full sources including the Gentoo patchset for the ${KV_MAJOR}.${KV_MINOR} kernel tree"
+SRC_URI="${KERNEL_URI} ${GENPATCHES_URI} ${ARCH_URI}"
+
+pkg_postinst() {
+	kernel-2_pkg_postinst
+	einfo "For more info on this patchset, and how to report problems, see:"
+	einfo "${HOMEPAGE}"
+}
+
+pkg_postrm() {
+	kernel-2_pkg_postrm
+}

diff --git a/sys-kernel/gentoo-sources/metadata.xml b/sys-kernel/gentoo-sources/metadata.xml
new file mode 100644
index 0000000..93b88c1
--- /dev/null
+++ b/sys-kernel/gentoo-sources/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="project">
+  <email>kernel@gentoo.org</email>
+  <name>Gentoo Kernel Project</name>
+</maintainer>
+<use>
+  <flag name="experimental">Apply experimental patches; for more information, see "https://wiki.gentoo.org/wiki/Project:Kernel/Experimental".</flag>
+</use>
+<upstream>
+  <remote-id type="cpe">cpe:/o:linux:linux_kernel</remote-id>
+</upstream>
+</pkgmetadata>

diff --git a/sys-kernel/git-sources/git-sources-4.19_rc1.ebuild b/sys-kernel/git-sources/git-sources-4.19_rc1.ebuild
new file mode 100644
index 0000000..d03b0ba
--- /dev/null
+++ b/sys-kernel/git-sources/git-sources-4.19_rc1.ebuild
@@ -0,0 +1,40 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+UNIPATCH_STRICTORDER="yes"
+K_NOUSENAME="yes"
+K_NOSETEXTRAVERSION="yes"
+K_NOUSEPR="yes"
+K_SECURITY_UNSUPPORTED="1"
+K_BASE_VER="4.18"
+K_EXP_GENPATCHES_NOUSE="1"
+K_FROM_GIT="yes"
+ETYPE="sources"
+CKV="${PVR/-r/-git}"
+
+# only use this if it's not an _rc/_pre release
+[ "${PV/_pre}" == "${PV}" ] && [ "${PV/_rc}" == "${PV}" ] && OKV="${PV}"
+inherit kernel-2
+detect_version
+
+DESCRIPTION="The very latest -git version of the Linux kernel"
+HOMEPAGE="https://www.kernel.org"
+SRC_URI="${KERNEL_URI}"
+
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
+IUSE=""
+
+K_EXTRAEINFO="This kernel is not supported by Gentoo due to its unstable and
+experimental nature. If you have any issues, try a matching vanilla-sources
+ebuild -- if the problem is not there, please contact the upstream kernel
+developers at https://bugzilla.kernel.org and on the linux-kernel mailing list to
+report the problem so it can be fixed in time for the next kernel release."
+
+RDEPEND=""
+DEPEND="${RDEPEND}
+	>=sys-devel/patch-2.7.5"
+
+pkg_postinst() {
+	postinst_sources
+}

diff --git a/sys-kernel/git-sources/git-sources-4.19_rc2.ebuild b/sys-kernel/git-sources/git-sources-4.19_rc2.ebuild
new file mode 100644
index 0000000..d03b0ba
--- /dev/null
+++ b/sys-kernel/git-sources/git-sources-4.19_rc2.ebuild
@@ -0,0 +1,40 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+UNIPATCH_STRICTORDER="yes"
+K_NOUSENAME="yes"
+K_NOSETEXTRAVERSION="yes"
+K_NOUSEPR="yes"
+K_SECURITY_UNSUPPORTED="1"
+K_BASE_VER="4.18"
+K_EXP_GENPATCHES_NOUSE="1"
+K_FROM_GIT="yes"
+ETYPE="sources"
+CKV="${PVR/-r/-git}"
+
+# only use this if it's not an _rc/_pre release
+[ "${PV/_pre}" == "${PV}" ] && [ "${PV/_rc}" == "${PV}" ] && OKV="${PV}"
+inherit kernel-2
+detect_version
+
+DESCRIPTION="The very latest -git version of the Linux kernel"
+HOMEPAGE="https://www.kernel.org"
+SRC_URI="${KERNEL_URI}"
+
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
+IUSE=""
+
+K_EXTRAEINFO="This kernel is not supported by Gentoo due to its unstable and
+experimental nature. If you have any issues, try a matching vanilla-sources
+ebuild -- if the problem is not there, please contact the upstream kernel
+developers at https://bugzilla.kernel.org and on the linux-kernel mailing list to
+report the problem so it can be fixed in time for the next kernel release."
+
+RDEPEND=""
+DEPEND="${RDEPEND}
+	>=sys-devel/patch-2.7.5"
+
+pkg_postinst() {
+	postinst_sources
+}

diff --git a/sys-kernel/git-sources/git-sources-4.19_rc3.ebuild b/sys-kernel/git-sources/git-sources-4.19_rc3.ebuild
new file mode 100644
index 0000000..d03b0ba
--- /dev/null
+++ b/sys-kernel/git-sources/git-sources-4.19_rc3.ebuild
@@ -0,0 +1,40 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+UNIPATCH_STRICTORDER="yes"
+K_NOUSENAME="yes"
+K_NOSETEXTRAVERSION="yes"
+K_NOUSEPR="yes"
+K_SECURITY_UNSUPPORTED="1"
+K_BASE_VER="4.18"
+K_EXP_GENPATCHES_NOUSE="1"
+K_FROM_GIT="yes"
+ETYPE="sources"
+CKV="${PVR/-r/-git}"
+
+# only use this if it's not an _rc/_pre release
+[ "${PV/_pre}" == "${PV}" ] && [ "${PV/_rc}" == "${PV}" ] && OKV="${PV}"
+inherit kernel-2
+detect_version
+
+DESCRIPTION="The very latest -git version of the Linux kernel"
+HOMEPAGE="https://www.kernel.org"
+SRC_URI="${KERNEL_URI}"
+
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
+IUSE=""
+
+K_EXTRAEINFO="This kernel is not supported by Gentoo due to its unstable and
+experimental nature. If you have any issues, try a matching vanilla-sources
+ebuild -- if the problem is not there, please contact the upstream kernel
+developers at https://bugzilla.kernel.org and on the linux-kernel mailing list to
+report the problem so it can be fixed in time for the next kernel release."
+
+RDEPEND=""
+DEPEND="${RDEPEND}
+	>=sys-devel/patch-2.7.5"
+
+pkg_postinst() {
+	postinst_sources
+}

diff --git a/sys-kernel/git-sources/git-sources-4.19_rc4.ebuild b/sys-kernel/git-sources/git-sources-4.19_rc4.ebuild
new file mode 100644
index 0000000..d03b0ba
--- /dev/null
+++ b/sys-kernel/git-sources/git-sources-4.19_rc4.ebuild
@@ -0,0 +1,40 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+UNIPATCH_STRICTORDER="yes"
+K_NOUSENAME="yes"
+K_NOSETEXTRAVERSION="yes"
+K_NOUSEPR="yes"
+K_SECURITY_UNSUPPORTED="1"
+K_BASE_VER="4.18"
+K_EXP_GENPATCHES_NOUSE="1"
+K_FROM_GIT="yes"
+ETYPE="sources"
+CKV="${PVR/-r/-git}"
+
+# only use this if it's not an _rc/_pre release
+[ "${PV/_pre}" == "${PV}" ] && [ "${PV/_rc}" == "${PV}" ] && OKV="${PV}"
+inherit kernel-2
+detect_version
+
+DESCRIPTION="The very latest -git version of the Linux kernel"
+HOMEPAGE="https://www.kernel.org"
+SRC_URI="${KERNEL_URI}"
+
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
+IUSE=""
+
+K_EXTRAEINFO="This kernel is not supported by Gentoo due to its unstable and
+experimental nature. If you have any issues, try a matching vanilla-sources
+ebuild -- if the problem is not there, please contact the upstream kernel
+developers at https://bugzilla.kernel.org and on the linux-kernel mailing list to
+report the problem so it can be fixed in time for the next kernel release."
+
+RDEPEND=""
+DEPEND="${RDEPEND}
+	>=sys-devel/patch-2.7.5"
+
+pkg_postinst() {
+	postinst_sources
+}

diff --git a/sys-kernel/git-sources/git-sources-4.19_rc5.ebuild b/sys-kernel/git-sources/git-sources-4.19_rc5.ebuild
new file mode 100644
index 0000000..d03b0ba
--- /dev/null
+++ b/sys-kernel/git-sources/git-sources-4.19_rc5.ebuild
@@ -0,0 +1,40 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+UNIPATCH_STRICTORDER="yes"
+K_NOUSENAME="yes"
+K_NOSETEXTRAVERSION="yes"
+K_NOUSEPR="yes"
+K_SECURITY_UNSUPPORTED="1"
+K_BASE_VER="4.18"
+K_EXP_GENPATCHES_NOUSE="1"
+K_FROM_GIT="yes"
+ETYPE="sources"
+CKV="${PVR/-r/-git}"
+
+# only use this if it's not an _rc/_pre release
+[ "${PV/_pre}" == "${PV}" ] && [ "${PV/_rc}" == "${PV}" ] && OKV="${PV}"
+inherit kernel-2
+detect_version
+
+DESCRIPTION="The very latest -git version of the Linux kernel"
+HOMEPAGE="https://www.kernel.org"
+SRC_URI="${KERNEL_URI}"
+
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
+IUSE=""
+
+K_EXTRAEINFO="This kernel is not supported by Gentoo due to its unstable and
+experimental nature. If you have any issues, try a matching vanilla-sources
+ebuild -- if the problem is not there, please contact the upstream kernel
+developers at https://bugzilla.kernel.org and on the linux-kernel mailing list to
+report the problem so it can be fixed in time for the next kernel release."
+
+RDEPEND=""
+DEPEND="${RDEPEND}
+	>=sys-devel/patch-2.7.5"
+
+pkg_postinst() {
+	postinst_sources
+}

diff --git a/sys-kernel/git-sources/git-sources-4.19_rc6.ebuild b/sys-kernel/git-sources/git-sources-4.19_rc6.ebuild
new file mode 100644
index 0000000..d03b0ba
--- /dev/null
+++ b/sys-kernel/git-sources/git-sources-4.19_rc6.ebuild
@@ -0,0 +1,40 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+UNIPATCH_STRICTORDER="yes"
+K_NOUSENAME="yes"
+K_NOSETEXTRAVERSION="yes"
+K_NOUSEPR="yes"
+K_SECURITY_UNSUPPORTED="1"
+K_BASE_VER="4.18"
+K_EXP_GENPATCHES_NOUSE="1"
+K_FROM_GIT="yes"
+ETYPE="sources"
+CKV="${PVR/-r/-git}"
+
+# only use this if it's not an _rc/_pre release
+[ "${PV/_pre}" == "${PV}" ] && [ "${PV/_rc}" == "${PV}" ] && OKV="${PV}"
+inherit kernel-2
+detect_version
+
+DESCRIPTION="The very latest -git version of the Linux kernel"
+HOMEPAGE="https://www.kernel.org"
+SRC_URI="${KERNEL_URI}"
+
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
+IUSE=""
+
+K_EXTRAEINFO="This kernel is not supported by Gentoo due to its unstable and
+experimental nature. If you have any issues, try a matching vanilla-sources
+ebuild -- if the problem is not there, please contact the upstream kernel
+developers at https://bugzilla.kernel.org and on the linux-kernel mailing list to
+report the problem so it can be fixed in time for the next kernel release."
+
+RDEPEND=""
+DEPEND="${RDEPEND}
+	>=sys-devel/patch-2.7.5"
+
+pkg_postinst() {
+	postinst_sources
+}

diff --git a/sys-kernel/git-sources/git-sources-4.19_rc7.ebuild b/sys-kernel/git-sources/git-sources-4.19_rc7.ebuild
new file mode 100644
index 0000000..73fcf5f
--- /dev/null
+++ b/sys-kernel/git-sources/git-sources-4.19_rc7.ebuild
@@ -0,0 +1,40 @@
+# Copyright 1999-2018 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+UNIPATCH_STRICTORDER="yes"
+K_NOUSENAME="yes"
+K_NOSETEXTRAVERSION="yes"
+K_NOUSEPR="yes"
+K_SECURITY_UNSUPPORTED="1"
+K_BASE_VER="4.18"
+K_EXP_GENPATCHES_NOUSE="1"
+K_FROM_GIT="yes"
+ETYPE="sources"
+CKV="${PVR/-r/-git}"
+
+# only use this if it's not an _rc/_pre release
+[ "${PV/_pre}" == "${PV}" ] && [ "${PV/_rc}" == "${PV}" ] && OKV="${PV}"
+inherit kernel-2
+detect_version
+
+DESCRIPTION="The very latest -git version of the Linux kernel"
+HOMEPAGE="https://www.kernel.org"
+SRC_URI="${KERNEL_URI}"
+
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
+IUSE=""
+
+K_EXTRAEINFO="This kernel is not supported by Gentoo due to its unstable and
+experimental nature. If you have any issues, try a matching vanilla-sources
+ebuild -- if the problem is not there, please contact the upstream kernel
+developers at https://bugzilla.kernel.org and on the linux-kernel mailing list to
+report the problem so it can be fixed in time for the next kernel release."
+
+RDEPEND=""
+DEPEND="${RDEPEND}
+	>=sys-devel/patch-2.7.5"
+
+pkg_postinst() {
+	postinst_sources
+}

diff --git a/sys-kernel/git-sources/git-sources-4.19_rc8.ebuild b/sys-kernel/git-sources/git-sources-4.19_rc8.ebuild
new file mode 100644
index 0000000..73fcf5f
--- /dev/null
+++ b/sys-kernel/git-sources/git-sources-4.19_rc8.ebuild
@@ -0,0 +1,40 @@
+# Copyright 1999-2018 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+UNIPATCH_STRICTORDER="yes"
+K_NOUSENAME="yes"
+K_NOSETEXTRAVERSION="yes"
+K_NOUSEPR="yes"
+K_SECURITY_UNSUPPORTED="1"
+K_BASE_VER="4.18"
+K_EXP_GENPATCHES_NOUSE="1"
+K_FROM_GIT="yes"
+ETYPE="sources"
+CKV="${PVR/-r/-git}"
+
+# only use this if it's not an _rc/_pre release
+[ "${PV/_pre}" == "${PV}" ] && [ "${PV/_rc}" == "${PV}" ] && OKV="${PV}"
+inherit kernel-2
+detect_version
+
+DESCRIPTION="The very latest -git version of the Linux kernel"
+HOMEPAGE="https://www.kernel.org"
+SRC_URI="${KERNEL_URI}"
+
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
+IUSE=""
+
+K_EXTRAEINFO="This kernel is not supported by Gentoo due to its unstable and
+experimental nature. If you have any issues, try a matching vanilla-sources
+ebuild -- if the problem is not there, please contact the upstream kernel
+developers at https://bugzilla.kernel.org and on the linux-kernel mailing list to
+report the problem so it can be fixed in time for the next kernel release."
+
+RDEPEND=""
+DEPEND="${RDEPEND}
+	>=sys-devel/patch-2.7.5"
+
+pkg_postinst() {
+	postinst_sources
+}

diff --git a/sys-kernel/git-sources/metadata.xml b/sys-kernel/git-sources/metadata.xml
new file mode 100644
index 0000000..11fe6b1
--- /dev/null
+++ b/sys-kernel/git-sources/metadata.xml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+  <maintainer type="person">
+    <email>mpagano@gentoo.org</email>
+    <name>Mike Pagano</name>
+  </maintainer>
+  <maintainer type="project">
+    <email>kernel@gentoo.org</email>
+    <name>Gentoo Kernel Project</name>
+  </maintainer>
+  <longdescription>
+    -git sources sources, for people who like to have the absolute latest kernel available
+  </longdescription>
+  <upstream>
+    <remote-id type="cpe">cpe:/o:linux:linux_kernel</remote-id>
+  </upstream>
+</pkgmetadata>

diff --git a/sys-kernel/hardened-sources/hardened-sources-4.8.17-r2.ebuild b/sys-kernel/hardened-sources/hardened-sources-4.8.17-r2.ebuild
new file mode 100644
index 0000000..5d34dcc
--- /dev/null
+++ b/sys-kernel/hardened-sources/hardened-sources-4.8.17-r2.ebuild
@@ -0,0 +1,44 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+ETYPE="sources"
+K_WANT_GENPATCHES="base"
+K_GENPATCHES_VER="18"
+K_DEBLOB_AVAILABLE="1"
+
+inherit kernel-2
+detect_version
+
+HGPV="${KV_MAJOR}.${KV_MINOR}.${KV_PATCH}-3"
+HGPV_URI="https://dev.gentoo.org/~blueness/hardened-sources/hardened-patches/hardened-patches-${HGPV}.extras.tar.bz2"
+SRC_URI="${KERNEL_URI} ${HGPV_URI} ${GENPATCHES_URI} ${ARCH_URI}"
+
+UNIPATCH_LIST="${DISTDIR}/hardened-patches-${HGPV}.extras.tar.bz2"
+UNIPATCH_EXCLUDE="
+	1500_XATTR_USER_PREFIX.patch
+	2900_dev-root-proc-mount-fix.patch"
+
+DESCRIPTION="Hardened kernel sources (kernel series ${KV_MAJOR}.${KV_MINOR})"
+HOMEPAGE="https://www.gentoo.org/proj/en/hardened/"
+IUSE="deblob"
+
+KEYWORDS="~alpha amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~sparc x86"
+
+RDEPEND=">=sys-devel/gcc-4.5"
+
+pkg_postinst() {
+	kernel-2_pkg_postinst
+
+	local GRADM_COMPAT="sys-apps/gradm-3.1*"
+
+	ewarn
+	ewarn "Users of grsecurity's RBAC system must ensure they are using"
+	ewarn "${GRADM_COMPAT}, which is compatible with ${PF}."
+	ewarn "It is strongly recommended that the following command is issued"
+	ewarn "prior to booting a ${PF} kernel for the first time:"
+	ewarn
+	ewarn "emerge -na =${GRADM_COMPAT}"
+	ewarn
+}

diff --git a/sys-kernel/hardened-sources/hardened-sources-4.9.21.ebuild b/sys-kernel/hardened-sources/hardened-sources-4.9.21.ebuild
new file mode 100644
index 0000000..4193a24
--- /dev/null
+++ b/sys-kernel/hardened-sources/hardened-sources-4.9.21.ebuild
@@ -0,0 +1,45 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+ETYPE="sources"
+K_WANT_GENPATCHES="base"
+K_GENPATCHES_VER="21"
+K_DEBLOB_AVAILABLE="1"
+
+inherit kernel-2
+detect_version
+
+HGPV="${KV_MAJOR}.${KV_MINOR}.${KV_PATCH}-1"
+HGPV_URI="https://dev.gentoo.org/~blueness/hardened-sources/hardened-patches/hardened-patches-${HGPV}.extras.tar.bz2"
+SRC_URI="${KERNEL_URI} ${HGPV_URI} ${GENPATCHES_URI} ${ARCH_URI}"
+
+UNIPATCH_LIST="${DISTDIR}/hardened-patches-${HGPV}.extras.tar.bz2"
+UNIPATCH_EXCLUDE="
+	1500_XATTR_USER_PREFIX.patch
+	1520_CVE-2017-6074-dccp-skb-freeing-fix.patch
+	2900_dev-root-proc-mount-fix.patch"
+
+DESCRIPTION="Hardened kernel sources (kernel series ${KV_MAJOR}.${KV_MINOR})"
+HOMEPAGE="https://www.gentoo.org/proj/en/hardened/"
+IUSE="deblob"
+
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86"
+
+RDEPEND=">=sys-devel/gcc-4.5"
+
+pkg_postinst() {
+	kernel-2_pkg_postinst
+
+	local GRADM_COMPAT="sys-apps/gradm-3.1*"
+
+	ewarn
+	ewarn "Users of grsecurity's RBAC system must ensure they are using"
+	ewarn "${GRADM_COMPAT}, which is compatible with ${PF}."
+	ewarn "It is strongly recommended that the following command is issued"
+	ewarn "prior to booting a ${PF} kernel for the first time:"
+	ewarn
+	ewarn "emerge -na =${GRADM_COMPAT}"
+	ewarn
+}

diff --git a/sys-kernel/hardened-sources/hardened-sources-4.9.22.ebuild b/sys-kernel/hardened-sources/hardened-sources-4.9.22.ebuild
new file mode 100644
index 0000000..61595d9
--- /dev/null
+++ b/sys-kernel/hardened-sources/hardened-sources-4.9.22.ebuild
@@ -0,0 +1,45 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+ETYPE="sources"
+K_WANT_GENPATCHES="base"
+K_GENPATCHES_VER="23"
+K_DEBLOB_AVAILABLE="1"
+
+inherit kernel-2
+detect_version
+
+HGPV="${KV_MAJOR}.${KV_MINOR}.${KV_PATCH}-1"
+HGPV_URI="https://dev.gentoo.org/~blueness/hardened-sources/hardened-patches/hardened-patches-${HGPV}.extras.tar.bz2"
+SRC_URI="${KERNEL_URI} ${HGPV_URI} ${GENPATCHES_URI} ${ARCH_URI}"
+
+UNIPATCH_LIST="${DISTDIR}/hardened-patches-${HGPV}.extras.tar.bz2"
+UNIPATCH_EXCLUDE="
+	1500_XATTR_USER_PREFIX.patch
+	1520_CVE-2017-6074-dccp-skb-freeing-fix.patch
+	2900_dev-root-proc-mount-fix.patch"
+
+DESCRIPTION="Hardened kernel sources (kernel series ${KV_MAJOR}.${KV_MINOR})"
+HOMEPAGE="https://www.gentoo.org/proj/en/hardened/"
+IUSE="deblob"
+
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86"
+
+RDEPEND=">=sys-devel/gcc-4.5"
+
+pkg_postinst() {
+	kernel-2_pkg_postinst
+
+	local GRADM_COMPAT="sys-apps/gradm-3.1*"
+
+	ewarn
+	ewarn "Users of grsecurity's RBAC system must ensure they are using"
+	ewarn "${GRADM_COMPAT}, which is compatible with ${PF}."
+	ewarn "It is strongly recommended that the following command is issued"
+	ewarn "prior to booting a ${PF} kernel for the first time:"
+	ewarn
+	ewarn "emerge -na =${GRADM_COMPAT}"
+	ewarn
+}

diff --git a/sys-kernel/hardened-sources/hardened-sources-4.9.23.ebuild b/sys-kernel/hardened-sources/hardened-sources-4.9.23.ebuild
new file mode 100644
index 0000000..61595d9
--- /dev/null
+++ b/sys-kernel/hardened-sources/hardened-sources-4.9.23.ebuild
@@ -0,0 +1,45 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+ETYPE="sources"
+K_WANT_GENPATCHES="base"
+K_GENPATCHES_VER="23"
+K_DEBLOB_AVAILABLE="1"
+
+inherit kernel-2
+detect_version
+
+HGPV="${KV_MAJOR}.${KV_MINOR}.${KV_PATCH}-1"
+HGPV_URI="https://dev.gentoo.org/~blueness/hardened-sources/hardened-patches/hardened-patches-${HGPV}.extras.tar.bz2"
+SRC_URI="${KERNEL_URI} ${HGPV_URI} ${GENPATCHES_URI} ${ARCH_URI}"
+
+UNIPATCH_LIST="${DISTDIR}/hardened-patches-${HGPV}.extras.tar.bz2"
+UNIPATCH_EXCLUDE="
+	1500_XATTR_USER_PREFIX.patch
+	1520_CVE-2017-6074-dccp-skb-freeing-fix.patch
+	2900_dev-root-proc-mount-fix.patch"
+
+DESCRIPTION="Hardened kernel sources (kernel series ${KV_MAJOR}.${KV_MINOR})"
+HOMEPAGE="https://www.gentoo.org/proj/en/hardened/"
+IUSE="deblob"
+
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86"
+
+RDEPEND=">=sys-devel/gcc-4.5"
+
+pkg_postinst() {
+	kernel-2_pkg_postinst
+
+	local GRADM_COMPAT="sys-apps/gradm-3.1*"
+
+	ewarn
+	ewarn "Users of grsecurity's RBAC system must ensure they are using"
+	ewarn "${GRADM_COMPAT}, which is compatible with ${PF}."
+	ewarn "It is strongly recommended that the following command is issued"
+	ewarn "prior to booting a ${PF} kernel for the first time:"
+	ewarn
+	ewarn "emerge -na =${GRADM_COMPAT}"
+	ewarn
+}

diff --git a/sys-kernel/hardened-sources/hardened-sources-4.9.24.ebuild b/sys-kernel/hardened-sources/hardened-sources-4.9.24.ebuild
new file mode 100644
index 0000000..a4ff537
--- /dev/null
+++ b/sys-kernel/hardened-sources/hardened-sources-4.9.24.ebuild
@@ -0,0 +1,45 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+ETYPE="sources"
+K_WANT_GENPATCHES="base"
+K_GENPATCHES_VER="24"
+K_DEBLOB_AVAILABLE="1"
+
+inherit kernel-2
+detect_version
+
+HGPV="${KV_MAJOR}.${KV_MINOR}.${KV_PATCH}-1"
+HGPV_URI="https://dev.gentoo.org/~blueness/hardened-sources/hardened-patches/hardened-patches-${HGPV}.extras.tar.bz2"
+SRC_URI="${KERNEL_URI} ${HGPV_URI} ${GENPATCHES_URI} ${ARCH_URI}"
+
+UNIPATCH_LIST="${DISTDIR}/hardened-patches-${HGPV}.extras.tar.bz2"
+UNIPATCH_EXCLUDE="
+	1500_XATTR_USER_PREFIX.patch
+	1520_CVE-2017-6074-dccp-skb-freeing-fix.patch
+	2900_dev-root-proc-mount-fix.patch"
+
+DESCRIPTION="Hardened kernel sources (kernel series ${KV_MAJOR}.${KV_MINOR})"
+HOMEPAGE="https://www.gentoo.org/proj/en/hardened/"
+IUSE="deblob"
+
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86"
+
+RDEPEND=">=sys-devel/gcc-4.5"
+
+pkg_postinst() {
+	kernel-2_pkg_postinst
+
+	local GRADM_COMPAT="sys-apps/gradm-3.1*"
+
+	ewarn
+	ewarn "Users of grsecurity's RBAC system must ensure they are using"
+	ewarn "${GRADM_COMPAT}, which is compatible with ${PF}."
+	ewarn "It is strongly recommended that the following command is issued"
+	ewarn "prior to booting a ${PF} kernel for the first time:"
+	ewarn
+	ewarn "emerge -na =${GRADM_COMPAT}"
+	ewarn
+}

diff --git a/sys-kernel/hardened-sources/metadata.xml b/sys-kernel/hardened-sources/metadata.xml
new file mode 100644
index 0000000..ac63d4d
--- /dev/null
+++ b/sys-kernel/hardened-sources/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>blueness@gentoo.org</email>
+		<name>Anthony G. Basile</name>
+	</maintainer>
+	<maintainer type="project">
+		<email>kernel@gentoo.org</email>
+		<name>Gentoo Kernel Project</name>
+	</maintainer>
+	<maintainer type="project">
+		<email>hardened@gentoo.org</email>
+		<name>Gentoo Hardened</name>
+	</maintainer>
+	<longdescription>
+		hardened-sources is based upon genpatches, and adds the grsecurity
+		patch from https://www.grsecurity.net, which also includes PaX.
+	</longdescription>
+	<use>
+		<flag name="deblob">Remove binary blobs from kernel sources to provide libre license compliance.</flag>
+	</use>
+</pkgmetadata>

diff --git a/sys-kernel/kergen/kergen-0.1.3.ebuild b/sys-kernel/kergen/kergen-0.1.3.ebuild
new file mode 100644
index 0000000..2f948cd
--- /dev/null
+++ b/sys-kernel/kergen/kergen-0.1.3.ebuild
@@ -0,0 +1,17 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+PYTHON_COMPAT=( python3_4 )
+
+inherit distutils-r1
+
+DESCRIPTION="Kernel config generator"
+HOMEPAGE="https://github.com/nichoski/kergen"
+SRC_URI="http://whatishacking.org/${PN}/downloads/${P}.tar.gz"
+
+LICENSE="Apache-2.0"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""

diff --git a/sys-kernel/kergen/kergen-0.1.4.ebuild b/sys-kernel/kergen/kergen-0.1.4.ebuild
new file mode 100644
index 0000000..5cc81c8
--- /dev/null
+++ b/sys-kernel/kergen/kergen-0.1.4.ebuild
@@ -0,0 +1,17 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+PYTHON_COMPAT=( python3_{4,5,6} )
+
+inherit distutils-r1
+
+DESCRIPTION="Kernel config generator"
+HOMEPAGE="https://github.com/nichoski/kergen"
+SRC_URI="http://whatishacking.org/${PN}/downloads/${P}.tar.gz"
+
+LICENSE="Apache-2.0"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""

diff --git a/sys-kernel/kergen/metadata.xml b/sys-kernel/kergen/metadata.xml
new file mode 100644
index 0000000..fcfb75e
--- /dev/null
+++ b/sys-kernel/kergen/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>jlec@gentoo.org</email>
+    <name>Justin Lecher</name>
+  </maintainer>
+  <upstream>
+    <remote-id type="github">nichoski/kergen</remote-id>
+  </upstream>
+</pkgmetadata>

diff --git a/sys-kernel/kpatch/kpatch-0.4.0-r1.ebuild b/sys-kernel/kpatch/kpatch-0.4.0-r1.ebuild
new file mode 100644
index 0000000..2dae0d7
--- /dev/null
+++ b/sys-kernel/kpatch/kpatch-0.4.0-r1.ebuild
@@ -0,0 +1,76 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+
+inherit linux-info linux-mod flag-o-matic
+
+if [[ "${PV}" == "9999" ]]; then
+	inherit git-r3
+	EGIT_REPO_URI="https://github.com/dynup/${PN}.git"
+else
+	SRC_URI="https://github.com/dynup/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+	KEYWORDS="~amd64"
+fi
+
+DESCRIPTION="Dynamic kernel patching for Linux"
+HOMEPAGE="https://github.com/dynup/kpatch"
+
+LICENSE="GPL-2+"
+SLOT="0"
+IUSE="examples +modules test"
+
+RDEPEND="
+	app-crypt/pesign
+	dev-libs/openssl:0=
+	sys-libs/zlib
+	sys-apps/pciutils
+"
+
+DEPEND="
+	${RDEPEND}
+	dev-libs/elfutils
+	sys-devel/bison
+"
+
+pkg_pretend() {
+	if kernel_is gt 3 9 0; then
+		if ! linux_config_exists; then
+			eerror "Unable to check the currently running kernel for kpatch support"
+			eerror "Please be sure a .config file is available in the kernel src dir"
+			eerror "and ensure the kernel has been built."
+		else
+			# Fail to build if these kernel options are not enabled (see kpatch/kmod/core/Makefile)
+			CONFIG_CHECK="FUNCTION_TRACER HAVE_FENTRY MODULES SYSFS KALLSYMS_ALL"
+			ERROR_FUNCTION_TRACER="CONFIG_FUNCTION_TRACER must be enabled in the kernel's config file"
+			ERROR_HAVE_FENTRY="CONFIG_HAVE_FENTRY must be enabled in the kernel's config file"
+			ERROR_MODULES="CONFIG_MODULES must be enabled in the kernel's config file"
+			ERROR_SYSFS="CONFIG_SYSFS must be enabled in the kernel's config file"
+			ERROR_KALLSYMS_ALL="CONFIG_KALLSYMS_ALL must be enabled in the kernel's config file"
+		fi
+	else
+		eerror
+		eerror "kpatch is not available for Linux kernels below 4.0.0"
+		eerror
+		die "Upgrade the kernel sources before installing kpatch."
+	fi
+
+	check_extra_config
+}
+
+src_prepare() {
+	replace-flags '-O?' '-O1'
+	default
+}
+
+src_compile() {
+	set_arch_to_kernel
+	emake all
+}
+
+src_install() {
+	set_arch_to_kernel
+	emake DESTDIR="${D}" PREFIX="/usr" install
+
+	einstalldocs
+}

diff --git a/sys-kernel/kpatch/kpatch-0.6.0.ebuild b/sys-kernel/kpatch/kpatch-0.6.0.ebuild
new file mode 100644
index 0000000..e9cdeb7
--- /dev/null
+++ b/sys-kernel/kpatch/kpatch-0.6.0.ebuild
@@ -0,0 +1,76 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+
+inherit linux-info linux-mod flag-o-matic
+
+if [[ "${PV}" == "9999" ]]; then
+	inherit git-r3
+	EGIT_REPO_URI="https://github.com/dynup/${PN}.git"
+else
+	SRC_URI="https://github.com/dynup/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+	KEYWORDS="~amd64"
+fi
+
+DESCRIPTION="Dynamic kernel patching for Linux"
+HOMEPAGE="https://github.com/dynup/kpatch"
+
+LICENSE="GPL-2+"
+SLOT="0"
+IUSE="examples +modules test"
+
+RDEPEND="
+	app-crypt/pesign
+	dev-libs/openssl:0=
+	sys-libs/zlib
+	sys-apps/pciutils
+"
+
+DEPEND="
+	${RDEPEND}
+	dev-libs/elfutils
+	sys-devel/bison
+"
+
+pkg_pretend() {
+	if kernel_is gt 3 9 0; then
+		if ! linux_config_exists; then
+			eerror "Unable to check the currently running kernel for kpatch support"
+			eerror "Please be sure a .config file is available in the kernel src dir"
+			eerror "and ensure the kernel has been built."
+		else
+			# Fail to build if these kernel options are not enabled (see kpatch/kmod/core/Makefile)
+			CONFIG_CHECK="FUNCTION_TRACER HAVE_FENTRY MODULES SYSFS KALLSYMS_ALL"
+			ERROR_FUNCTION_TRACER="CONFIG_FUNCTION_TRACER must be enabled in the kernel's config file"
+			ERROR_HAVE_FENTRY="CONFIG_HAVE_FENTRY must be enabled in the kernel's config file"
+			ERROR_MODULES="CONFIG_MODULES must be enabled in the kernel's config file"
+			ERROR_SYSFS="CONFIG_SYSFS must be enabled in the kernel's config file"
+			ERROR_KALLSYMS_ALL="CONFIG_KALLSYMS_ALL must be enabled in the kernel's config file"
+		fi
+	else
+		eerror
+		eerror "kpatch is not available for Linux kernels below 4.0.0"
+		eerror
+		die "Upgrade the kernel sources before installing kpatch."
+	fi
+
+	check_extra_config
+}
+
+src_prepare() {
+	replace-flags '-O?' '-O1'
+	default
+}
+
+src_compile() {
+	set_arch_to_kernel
+	emake all
+}
+
+src_install() {
+	set_arch_to_kernel
+	emake DESTDIR="${D}" PREFIX="/usr" install
+
+	einstalldocs
+}

diff --git a/sys-kernel/kpatch/kpatch-0.6.2.ebuild b/sys-kernel/kpatch/kpatch-0.6.2.ebuild
new file mode 100644
index 0000000..e9cdeb7
--- /dev/null
+++ b/sys-kernel/kpatch/kpatch-0.6.2.ebuild
@@ -0,0 +1,76 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+
+inherit linux-info linux-mod flag-o-matic
+
+if [[ "${PV}" == "9999" ]]; then
+	inherit git-r3
+	EGIT_REPO_URI="https://github.com/dynup/${PN}.git"
+else
+	SRC_URI="https://github.com/dynup/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+	KEYWORDS="~amd64"
+fi
+
+DESCRIPTION="Dynamic kernel patching for Linux"
+HOMEPAGE="https://github.com/dynup/kpatch"
+
+LICENSE="GPL-2+"
+SLOT="0"
+IUSE="examples +modules test"
+
+RDEPEND="
+	app-crypt/pesign
+	dev-libs/openssl:0=
+	sys-libs/zlib
+	sys-apps/pciutils
+"
+
+DEPEND="
+	${RDEPEND}
+	dev-libs/elfutils
+	sys-devel/bison
+"
+
+pkg_pretend() {
+	if kernel_is gt 3 9 0; then
+		if ! linux_config_exists; then
+			eerror "Unable to check the currently running kernel for kpatch support"
+			eerror "Please be sure a .config file is available in the kernel src dir"
+			eerror "and ensure the kernel has been built."
+		else
+			# Fail to build if these kernel options are not enabled (see kpatch/kmod/core/Makefile)
+			CONFIG_CHECK="FUNCTION_TRACER HAVE_FENTRY MODULES SYSFS KALLSYMS_ALL"
+			ERROR_FUNCTION_TRACER="CONFIG_FUNCTION_TRACER must be enabled in the kernel's config file"
+			ERROR_HAVE_FENTRY="CONFIG_HAVE_FENTRY must be enabled in the kernel's config file"
+			ERROR_MODULES="CONFIG_MODULES must be enabled in the kernel's config file"
+			ERROR_SYSFS="CONFIG_SYSFS must be enabled in the kernel's config file"
+			ERROR_KALLSYMS_ALL="CONFIG_KALLSYMS_ALL must be enabled in the kernel's config file"
+		fi
+	else
+		eerror
+		eerror "kpatch is not available for Linux kernels below 4.0.0"
+		eerror
+		die "Upgrade the kernel sources before installing kpatch."
+	fi
+
+	check_extra_config
+}
+
+src_prepare() {
+	replace-flags '-O?' '-O1'
+	default
+}
+
+src_compile() {
+	set_arch_to_kernel
+	emake all
+}
+
+src_install() {
+	set_arch_to_kernel
+	emake DESTDIR="${D}" PREFIX="/usr" install
+
+	einstalldocs
+}

diff --git a/sys-kernel/kpatch/kpatch-9999.ebuild b/sys-kernel/kpatch/kpatch-9999.ebuild
new file mode 100644
index 0000000..0d6aa6e
--- /dev/null
+++ b/sys-kernel/kpatch/kpatch-9999.ebuild
@@ -0,0 +1,77 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+
+inherit linux-info linux-mod flag-o-matic
+
+if [[ "${PV}" == "9999" ]]; then
+	inherit git-r3
+	EGIT_REPO_URI="https://github.com/dynup/${PN}.git"
+else
+	SRC_URI="https://github.com/dynup/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+	KEYWORDS="~amd64"
+fi
+
+DESCRIPTION="Dynamic kernel patching for Linux"
+HOMEPAGE="https://github.com/dynup/kpatch"
+
+LICENSE="GPL-2+"
+SLOT="0"
+IUSE="examples +modules test"
+
+RDEPEND="
+	app-crypt/pesign
+	dev-libs/openssl:0=
+	sys-libs/zlib
+	sys-apps/pciutils
+"
+
+DEPEND="
+	${RDEPEND}
+	test? ( dev-util/shellcheck )
+	dev-libs/elfutils
+	sys-devel/bison
+"
+
+pkg_pretend() {
+	if kernel_is gt 3 9 0; then
+		if ! linux_config_exists; then
+			eerror "Unable to check the currently running kernel for kpatch support"
+			eerror "Please be sure a .config file is available in the kernel src dir"
+			eerror "and ensure the kernel has been built."
+		else
+			# Fail to build if these kernel options are not enabled (see kpatch/kmod/core/Makefile)
+			CONFIG_CHECK="FUNCTION_TRACER HAVE_FENTRY MODULES SYSFS KALLSYMS_ALL"
+			ERROR_FUNCTION_TRACER="CONFIG_FUNCTION_TRACER must be enabled in the kernel's config file"
+			ERROR_HAVE_FENTRY="CONFIG_HAVE_FENTRY must be enabled in the kernel's config file"
+			ERROR_MODULES="CONFIG_MODULES must be enabled in the kernel's config file"
+			ERROR_SYSFS="CONFIG_SYSFS must be enabled in the kernel's config file"
+			ERROR_KALLSYMS_ALL="CONFIG_KALLSYMS_ALL must be enabled in the kernel's config file"
+		fi
+	else
+		eerror
+		eerror "kpatch is not available for Linux kernels below 4.0.0"
+		eerror
+		die "Upgrade the kernel sources before installing kpatch."
+	fi
+
+	check_extra_config
+}
+
+src_prepare() {
+	replace-flags '-O?' '-O1'
+	default
+}
+
+src_compile() {
+	set_arch_to_kernel
+	emake all
+}
+
+src_install() {
+	set_arch_to_kernel
+	emake DESTDIR="${D}" PREFIX="/usr" install
+
+	einstalldocs
+}

diff --git a/sys-kernel/kpatch/metadata.xml b/sys-kernel/kpatch/metadata.xml
new file mode 100644
index 0000000..b393adb
--- /dev/null
+++ b/sys-kernel/kpatch/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>alicef@gentoo.org</email>
+	</maintainer>
+	<longdescription lang="en">Dynamic kernel patching for the Linux kernel</longdescription>
+</pkgmetadata>

diff --git a/sys-kernel/linux-docs/linux-docs-4.1.ebuild b/sys-kernel/linux-docs/linux-docs-4.1.ebuild
new file mode 100644
index 0000000..5101722
--- /dev/null
+++ b/sys-kernel/linux-docs/linux-docs-4.1.ebuild
@@ -0,0 +1,64 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+inherit toolchain-funcs
+
+MY_P=linux-${PV}
+S=${WORKDIR}/${MY_P}
+
+DESCRIPTION="Developer documentation generated from the Linux kernel"
+HOMEPAGE="https://www.kernel.org/"
+SRC_URI="mirror://kernel/linux/kernel/v3.x/${MY_P}.tar.xz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
+
+IUSE="html"
+DEPEND="app-text/docbook-sgml-utils
+		app-text/xmlto
+		sys-apps/sed
+		~app-text/docbook-xml-dtd-4.1.2"
+RDEPEND=""
+
+src_prepare() {
+
+	sed -i \
+		-e "s:db2:docbook2:g" \
+		-e "s:/usr/local/man:${D}/usr/share/man:g" \
+		"${S}"/Documentation/DocBook/Makefile
+
+	# fix for parallel build as per bug #248337
+	sed -i \
+		-e "s:\$(Q)\$(MAKE) \$(build)=Documentation\/DocBook \$@:+\$(Q)\$(MAKE) \$(build)=Documentation\/DocBook \$@:" \
+		"${S}"/Makefile
+}
+
+src_compile() {
+	local ARCH=$(tc-arch-kernel)
+	unset KBUILD_OUTPUT
+
+	emake mandocs || die "make mandocs failed"
+
+	if use html; then
+		emake htmldocs || die "make htmldocs failed"
+	fi
+}
+
+src_install() {
+	local file
+	local ARCH=$(tc-arch-kernel)
+	unset KBUILD_OUTPUT
+
+	make installmandocs || die "make installmandocs failed"
+
+	if use html; then
+		# There is no subdirectory named "index"
+		dohtml Documentation/DocBook/index.html
+		rm Documentation/DocBook/index.html
+		for file in Documentation/DocBook/*.html; do
+			dohtml -r ${file/\.html/}
+		done
+	fi
+}

diff --git a/sys-kernel/linux-docs/linux-docs-4.4.ebuild b/sys-kernel/linux-docs/linux-docs-4.4.ebuild
new file mode 100644
index 0000000..5101722
--- /dev/null
+++ b/sys-kernel/linux-docs/linux-docs-4.4.ebuild
@@ -0,0 +1,64 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+inherit toolchain-funcs
+
+MY_P=linux-${PV}
+S=${WORKDIR}/${MY_P}
+
+DESCRIPTION="Developer documentation generated from the Linux kernel"
+HOMEPAGE="https://www.kernel.org/"
+SRC_URI="mirror://kernel/linux/kernel/v3.x/${MY_P}.tar.xz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
+
+IUSE="html"
+DEPEND="app-text/docbook-sgml-utils
+		app-text/xmlto
+		sys-apps/sed
+		~app-text/docbook-xml-dtd-4.1.2"
+RDEPEND=""
+
+src_prepare() {
+
+	sed -i \
+		-e "s:db2:docbook2:g" \
+		-e "s:/usr/local/man:${D}/usr/share/man:g" \
+		"${S}"/Documentation/DocBook/Makefile
+
+	# fix for parallel build as per bug #248337
+	sed -i \
+		-e "s:\$(Q)\$(MAKE) \$(build)=Documentation\/DocBook \$@:+\$(Q)\$(MAKE) \$(build)=Documentation\/DocBook \$@:" \
+		"${S}"/Makefile
+}
+
+src_compile() {
+	local ARCH=$(tc-arch-kernel)
+	unset KBUILD_OUTPUT
+
+	emake mandocs || die "make mandocs failed"
+
+	if use html; then
+		emake htmldocs || die "make htmldocs failed"
+	fi
+}
+
+src_install() {
+	local file
+	local ARCH=$(tc-arch-kernel)
+	unset KBUILD_OUTPUT
+
+	make installmandocs || die "make installmandocs failed"
+
+	if use html; then
+		# There is no subdirectory named "index"
+		dohtml Documentation/DocBook/index.html
+		rm Documentation/DocBook/index.html
+		for file in Documentation/DocBook/*.html; do
+			dohtml -r ${file/\.html/}
+		done
+	fi
+}

diff --git a/sys-kernel/linux-docs/linux-docs-4.9.ebuild b/sys-kernel/linux-docs/linux-docs-4.9.ebuild
new file mode 100644
index 0000000..5101722
--- /dev/null
+++ b/sys-kernel/linux-docs/linux-docs-4.9.ebuild
@@ -0,0 +1,64 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+inherit toolchain-funcs
+
+MY_P=linux-${PV}
+S=${WORKDIR}/${MY_P}
+
+DESCRIPTION="Developer documentation generated from the Linux kernel"
+HOMEPAGE="https://www.kernel.org/"
+SRC_URI="mirror://kernel/linux/kernel/v3.x/${MY_P}.tar.xz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
+
+IUSE="html"
+DEPEND="app-text/docbook-sgml-utils
+		app-text/xmlto
+		sys-apps/sed
+		~app-text/docbook-xml-dtd-4.1.2"
+RDEPEND=""
+
+src_prepare() {
+
+	sed -i \
+		-e "s:db2:docbook2:g" \
+		-e "s:/usr/local/man:${D}/usr/share/man:g" \
+		"${S}"/Documentation/DocBook/Makefile
+
+	# fix for parallel build as per bug #248337
+	sed -i \
+		-e "s:\$(Q)\$(MAKE) \$(build)=Documentation\/DocBook \$@:+\$(Q)\$(MAKE) \$(build)=Documentation\/DocBook \$@:" \
+		"${S}"/Makefile
+}
+
+src_compile() {
+	local ARCH=$(tc-arch-kernel)
+	unset KBUILD_OUTPUT
+
+	emake mandocs || die "make mandocs failed"
+
+	if use html; then
+		emake htmldocs || die "make htmldocs failed"
+	fi
+}
+
+src_install() {
+	local file
+	local ARCH=$(tc-arch-kernel)
+	unset KBUILD_OUTPUT
+
+	make installmandocs || die "make installmandocs failed"
+
+	if use html; then
+		# There is no subdirectory named "index"
+		dohtml Documentation/DocBook/index.html
+		rm Documentation/DocBook/index.html
+		for file in Documentation/DocBook/*.html; do
+			dohtml -r ${file/\.html/}
+		done
+	fi
+}

diff --git a/sys-kernel/linux-docs/metadata.xml b/sys-kernel/linux-docs/metadata.xml
new file mode 100644
index 0000000..029e497
--- /dev/null
+++ b/sys-kernel/linux-docs/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>mpagano@gentoo.org</email>
+	</maintainer>
+	<use>
+		<flag name="html">Install HTML documentation</flag>
+	</use>
+</pkgmetadata>

diff --git a/sys-kernel/linux-firmware/linux-firmware-20181026.ebuild b/sys-kernel/linux-firmware/linux-firmware-20181026.ebuild
new file mode 100644
index 0000000..ef69aff
--- /dev/null
+++ b/sys-kernel/linux-firmware/linux-firmware-20181026.ebuild
@@ -0,0 +1,114 @@
+# Copyright 1999-2018 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+inherit savedconfig
+
+if [[ ${PV} == 99999999* ]]; then
+	inherit git-r3
+	SRC_URI=""
+	EGIT_REPO_URI="https://git.kernel.org/pub/scm/linux/kernel/git/firmware/${PN}.git"
+else
+	GIT_COMMIT="1cb4e51018293c14642f115b5868cda92b879161"
+	SRC_URI="https://git.kernel.org/cgit/linux/kernel/git/firmware/linux-firmware.git/snapshot/linux-firmware-${GIT_COMMIT}.tar.gz -> ${P}.tar.gz"
+	KEYWORDS="alpha amd64 arm arm64 hppa ia64 mips ppc ppc64 s390 sh sparc x86"
+fi
+
+DESCRIPTION="Linux firmware files"
+HOMEPAGE="https://git.kernel.org/?p=linux/kernel/git/firmware/linux-firmware.git"
+
+LICENSE="linux-firmware ( BSD ISC MIT no-source-code ) GPL-2 GPL-2+ freedist"
+SLOT="0"
+IUSE="savedconfig"
+
+DEPEND=""
+RDEPEND="!savedconfig? (
+		!sys-firmware/alsa-firmware[alsa_cards_ca0132]
+		!sys-firmware/alsa-firmware[alsa_cards_korg1212]
+		!sys-firmware/alsa-firmware[alsa_cards_maestro3]
+		!sys-firmware/alsa-firmware[alsa_cards_sb16]
+		!sys-firmware/alsa-firmware[alsa_cards_ymfpci]
+		!media-tv/cx18-firmware
+		!<sys-firmware/ivtv-firmware-20080701-r1
+		!media-tv/linuxtv-dvb-firmware[dvb_cards_cx231xx]
+		!media-tv/linuxtv-dvb-firmware[dvb_cards_cx23885]
+		!media-tv/linuxtv-dvb-firmware[dvb_cards_usb-dib0700]
+		!net-dialup/ueagle-atm
+		!net-dialup/ueagle4-atm
+		!net-wireless/ar9271-firmware
+		!net-wireless/i2400m-fw
+		!net-wireless/libertas-firmware
+		!sys-firmware/rt61-firmware
+		!net-wireless/rt73-firmware
+		!net-wireless/rt2860-firmware
+		!net-wireless/rt2870-firmware
+		!sys-block/qla-fc-firmware
+		!sys-firmware/amd-ucode
+		!sys-firmware/iwl1000-ucode
+		!sys-firmware/iwl2000-ucode
+		!sys-firmware/iwl2030-ucode
+		!sys-firmware/iwl3945-ucode
+		!sys-firmware/iwl4965-ucode
+		!sys-firmware/iwl5000-ucode
+		!sys-firmware/iwl5150-ucode
+		!sys-firmware/iwl6000-ucode
+		!sys-firmware/iwl6005-ucode
+		!sys-firmware/iwl6030-ucode
+		!sys-firmware/iwl6050-ucode
+		!sys-firmware/iwl3160-ucode
+		!sys-firmware/iwl7260-ucode
+		!sys-firmware/iwl7265-ucode
+		!sys-firmware/iwl3160-7260-bt-ucode
+		!sys-firmware/radeon-ucode
+	)"
+#add anything else that collides to this
+
+RESTRICT="binchecks strip"
+
+src_unpack() {
+	if [[ ${PV} == 99999999* ]]; then
+		git-r3_src_unpack
+	else
+		default
+		# rename directory from git snapshot tarball
+		mv ${PN}-*/ ${P} || die
+	fi
+}
+
+src_prepare() {
+	default
+
+	echo "# Remove files that shall not be installed from this list." > ${PN}.conf
+	find * \( \! -type d -and \! -name ${PN}.conf \) >> ${PN}.conf
+
+	if use savedconfig; then
+		restore_config ${PN}.conf
+		ebegin "Removing all files not listed in config"
+		find * \( \! -type d -and \! -name ${PN}.conf \) \
+			| sort ${PN}.conf ${PN}.conf - \
+			| uniq -u | xargs -r rm
+		eend $? || die
+		# remove empty directories, bug #396073
+		find -type d -empty -delete || die
+	fi
+}
+
+src_install() {
+	if use !savedconfig; then
+		save_config ${PN}.conf
+	fi
+	rm ${PN}.conf || die
+	insinto /lib/firmware/
+	doins -r *
+}
+
+pkg_preinst() {
+	if use savedconfig; then
+		ewarn "USE=savedconfig is active. You must handle file collisions manually."
+	fi
+}
+
+pkg_postinst() {
+	elog "If you are only interested in particular firmware files, edit the saved"
+	elog "configfile and remove those that you do not want."
+}

diff --git a/sys-kernel/linux-firmware/linux-firmware-99999999.ebuild b/sys-kernel/linux-firmware/linux-firmware-99999999.ebuild
new file mode 100644
index 0000000..e7b169e
--- /dev/null
+++ b/sys-kernel/linux-firmware/linux-firmware-99999999.ebuild
@@ -0,0 +1,114 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+inherit savedconfig
+
+if [[ ${PV} == 99999999* ]]; then
+	inherit git-r3
+	SRC_URI=""
+	EGIT_REPO_URI="https://git.kernel.org/pub/scm/linux/kernel/git/firmware/${PN}.git"
+else
+	GIT_COMMIT=""
+	SRC_URI="https://git.kernel.org/cgit/linux/kernel/git/firmware/linux-firmware.git/snapshot/linux-firmware-${GIT_COMMIT}.tar.gz -> ${P}.tar.gz"
+	KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
+fi
+
+DESCRIPTION="Linux firmware files"
+HOMEPAGE="https://git.kernel.org/?p=linux/kernel/git/firmware/linux-firmware.git"
+
+LICENSE="linux-firmware ( BSD ISC MIT no-source-code ) GPL-2 GPL-2+ freedist"
+SLOT="0"
+IUSE="savedconfig"
+
+DEPEND=""
+RDEPEND="!savedconfig? (
+		!sys-firmware/alsa-firmware[alsa_cards_ca0132]
+		!sys-firmware/alsa-firmware[alsa_cards_korg1212]
+		!sys-firmware/alsa-firmware[alsa_cards_maestro3]
+		!sys-firmware/alsa-firmware[alsa_cards_sb16]
+		!sys-firmware/alsa-firmware[alsa_cards_ymfpci]
+		!media-tv/cx18-firmware
+		!<sys-firmware/ivtv-firmware-20080701-r1
+		!media-tv/linuxtv-dvb-firmware[dvb_cards_cx231xx]
+		!media-tv/linuxtv-dvb-firmware[dvb_cards_cx23885]
+		!media-tv/linuxtv-dvb-firmware[dvb_cards_usb-dib0700]
+		!net-dialup/ueagle-atm
+		!net-dialup/ueagle4-atm
+		!net-wireless/ar9271-firmware
+		!net-wireless/i2400m-fw
+		!net-wireless/libertas-firmware
+		!sys-firmware/rt61-firmware
+		!net-wireless/rt73-firmware
+		!net-wireless/rt2860-firmware
+		!net-wireless/rt2870-firmware
+		!sys-block/qla-fc-firmware
+		!sys-firmware/amd-ucode
+		!sys-firmware/iwl1000-ucode
+		!sys-firmware/iwl2000-ucode
+		!sys-firmware/iwl2030-ucode
+		!sys-firmware/iwl3945-ucode
+		!sys-firmware/iwl4965-ucode
+		!sys-firmware/iwl5000-ucode
+		!sys-firmware/iwl5150-ucode
+		!sys-firmware/iwl6000-ucode
+		!sys-firmware/iwl6005-ucode
+		!sys-firmware/iwl6030-ucode
+		!sys-firmware/iwl6050-ucode
+		!sys-firmware/iwl3160-ucode
+		!sys-firmware/iwl7260-ucode
+		!sys-firmware/iwl7265-ucode
+		!sys-firmware/iwl3160-7260-bt-ucode
+		!sys-firmware/radeon-ucode
+	)"
+#add anything else that collides to this
+
+RESTRICT="binchecks strip"
+
+src_unpack() {
+	if [[ ${PV} == 99999999* ]]; then
+		git-r3_src_unpack
+	else
+		default
+		# rename directory from git snapshot tarball
+		mv ${PN}-*/ ${P} || die
+	fi
+}
+
+src_prepare() {
+	default
+
+	echo "# Remove files that shall not be installed from this list." > ${PN}.conf
+	find * \( \! -type d -and \! -name ${PN}.conf \) >> ${PN}.conf
+
+	if use savedconfig; then
+		restore_config ${PN}.conf
+		ebegin "Removing all files not listed in config"
+		find * \( \! -type d -and \! -name ${PN}.conf \) \
+			| sort ${PN}.conf ${PN}.conf - \
+			| uniq -u | xargs -r rm
+		eend $? || die
+		# remove empty directories, bug #396073
+		find -type d -empty -delete || die
+	fi
+}
+
+src_install() {
+	if use !savedconfig; then
+		save_config ${PN}.conf
+	fi
+	rm ${PN}.conf || die
+	insinto /lib/firmware/
+	doins -r *
+}
+
+pkg_preinst() {
+	if use savedconfig; then
+		ewarn "USE=savedconfig is active. You must handle file collisions manually."
+	fi
+}
+
+pkg_postinst() {
+	elog "If you are only interested in particular firmware files, edit the saved"
+	elog "configfile and remove those that you do not want."
+}

diff --git a/sys-kernel/linux-firmware/metadata.xml b/sys-kernel/linux-firmware/metadata.xml
new file mode 100644
index 0000000..c662ac9
--- /dev/null
+++ b/sys-kernel/linux-firmware/metadata.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<maintainer type="person">
+	<email>chithanh@gentoo.org</email>
+	<name>Chí-Thanh Christopher Nguyễn</name>
+</maintainer>
+<maintainer type="person">
+	<email>zerochaos@gentoo.org</email>
+	<name>Rick Farina</name>
+</maintainer>
+<maintainer type="project">
+	<email>kernel@gentoo.org</email>
+	<name>Gentoo Kernel Project</name>
+</maintainer>
+<use>
+	<flag name="savedconfig">Allows individual selection of firmware files</flag>
+</use>
+</pkgmetadata>

diff --git a/sys-kernel/linux-headers/linux-headers-3.18.ebuild b/sys-kernel/linux-headers/linux-headers-3.18.ebuild
new file mode 100644
index 0000000..b3b0981
--- /dev/null
+++ b/sys-kernel/linux-headers/linux-headers-3.18.ebuild
@@ -0,0 +1,53 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="4"
+
+ETYPE="headers"
+H_SUPPORTEDARCH="alpha amd64 arc arm arm64 avr32 bfin cris frv hexagon hppa ia64 m32r m68k metag microblaze mips mn10300 openrisc ppc ppc64 s390 score sh sparc tile x86 xtensa"
+inherit kernel-2
+detect_version
+
+PATCH_VER="1"
+SRC_URI="mirror://gentoo/gentoo-headers-base-${PV}.tar.xz
+	${PATCH_VER:+mirror://gentoo/gentoo-headers-${PV}-${PATCH_VER}.tar.xz}"
+
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~amd64-linux ~x86-linux"
+
+DEPEND="app-arch/xz-utils
+	dev-lang/perl"
+RDEPEND="!!media-sound/alsa-headers"
+
+S=${WORKDIR}/gentoo-headers-base-${PV}
+
+src_unpack() {
+	unpack ${A}
+}
+
+src_prepare() {
+	[[ -n ${PATCH_VER} ]] && EPATCH_SUFFIX="patch" epatch "${WORKDIR}"/${PV}
+}
+
+src_install() {
+	kernel-2_src_install
+
+	# hrm, build system sucks
+	find "${ED}" '(' -name '.install' -o -name '*.cmd' ')' -delete
+	find "${ED}" -depth -type d -delete 2>/dev/null
+
+	# provided by libdrm (for now?)
+	rm -rf "${ED}"/$(kernel_header_destdir)/drm
+}
+
+src_test() {
+	einfo "Possible unescaped attribute/type usage"
+	egrep -r \
+		-e '(^|[[:space:](])(asm|volatile|inline)[[:space:](]' \
+		-e '\<([us](8|16|32|64))\>' \
+		.
+
+	einfo "Missing linux/types.h include"
+	egrep -l -r -e '__[us](8|16|32|64)' "${ED}" | xargs grep -L linux/types.h
+
+	emake ARCH=$(tc-arch-kernel) headers_check
+}

diff --git a/sys-kernel/linux-headers/linux-headers-4.13.ebuild b/sys-kernel/linux-headers/linux-headers-4.13.ebuild
new file mode 100644
index 0000000..6d6eaf8
--- /dev/null
+++ b/sys-kernel/linux-headers/linux-headers-4.13.ebuild
@@ -0,0 +1,55 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+ETYPE="headers"
+H_SUPPORTEDARCH="alpha amd64 arc arm arm64 avr32 bfin cris frv hexagon hppa ia64 m32r m68k metag microblaze mips mn10300 nios2 openrisc ppc ppc64 s390 score sh sparc tile x86 xtensa"
+inherit kernel-2
+detect_version
+
+PATCH_VER="1"
+SRC_URI="mirror://gentoo/gentoo-headers-base-${PV}.tar.xz
+	${PATCH_VER:+mirror://gentoo/gentoo-headers-${PV}-${PATCH_VER}.tar.xz}"
+
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~amd64-linux ~x86-linux"
+
+DEPEND="app-arch/xz-utils
+	dev-lang/perl"
+RDEPEND="!!media-sound/alsa-headers"
+
+S=${WORKDIR}/gentoo-headers-base-${PV}
+
+src_unpack() {
+	unpack ${A}
+}
+
+src_prepare() {
+	[[ -n ${PATCH_VER} ]] && EPATCH_SUFFIX="patch" epatch "${WORKDIR}"/${PV}
+}
+
+src_install() {
+	kernel-2_src_install
+
+	# hrm, build system sucks
+	find "${ED}" '(' -name '.install' -o -name '*.cmd' ')' -delete
+	find "${ED}" -depth -type d -delete 2>/dev/null
+}
+
+src_test() {
+	# Make sure no uapi/ include paths are used by accident.
+	egrep -r \
+		-e '# *include.*["<]uapi/' \
+		"${D}" && die "#include uapi/xxx detected"
+
+	einfo "Possible unescaped attribute/type usage"
+	egrep -r \
+		-e '(^|[[:space:](])(asm|volatile|inline)[[:space:](]' \
+		-e '\<([us](8|16|32|64))\>' \
+		.
+
+	einfo "Missing linux/types.h include"
+	egrep -l -r -e '__[us](8|16|32|64)' "${ED}" | xargs grep -L linux/types.h
+
+	emake ARCH=$(tc-arch-kernel) headers_check
+}

diff --git a/sys-kernel/linux-headers/linux-headers-4.14-r1.ebuild b/sys-kernel/linux-headers/linux-headers-4.14-r1.ebuild
new file mode 100644
index 0000000..48f732f
--- /dev/null
+++ b/sys-kernel/linux-headers/linux-headers-4.14-r1.ebuild
@@ -0,0 +1,57 @@
+# Copyright 1999-2018 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+ETYPE="headers"
+H_SUPPORTEDARCH="alpha amd64 arc arm arm64 avr32 bfin cris frv hexagon hppa ia64 m32r m68k metag microblaze mips mn10300 nios2 openrisc ppc ppc64 s390 score sh sparc tile x86 xtensa"
+inherit kernel-2
+detect_version
+
+PATCH_VER="1"
+SRC_URI="mirror://gentoo/gentoo-headers-base-${PV}.tar.xz
+	${PATCH_VER:+mirror://gentoo/gentoo-headers-${PV}-${PATCH_VER}.tar.xz}"
+
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-linux ~x86-linux"
+
+DEPEND="app-arch/xz-utils
+	dev-lang/perl"
+RDEPEND="!!media-sound/alsa-headers"
+
+S=${WORKDIR}/gentoo-headers-base-${PV}
+
+src_unpack() {
+	unpack ${A}
+}
+
+src_prepare() {
+	default
+
+	[[ -n ${PATCH_VER} ]] && eapply "${WORKDIR}/${PV}"/*.patch
+}
+
+src_install() {
+	kernel-2_src_install
+
+	# hrm, build system sucks
+	find "${ED}" '(' -name '.install' -o -name '*.cmd' ')' -delete
+	find "${ED}" -depth -type d -delete 2>/dev/null
+}
+
+src_test() {
+	# Make sure no uapi/ include paths are used by accident.
+	egrep -r \
+		-e '# *include.*["<]uapi/' \
+		"${D}" && die "#include uapi/xxx detected"
+
+	einfo "Possible unescaped attribute/type usage"
+	egrep -r \
+		-e '(^|[[:space:](])(asm|volatile|inline)[[:space:](]' \
+		-e '\<([us](8|16|32|64))\>' \
+		.
+
+	einfo "Missing linux/types.h include"
+	egrep -l -r -e '__[us](8|16|32|64)' "${ED}" | xargs grep -L linux/types.h
+
+	emake ARCH=$(tc-arch-kernel) headers_check
+}

diff --git a/sys-kernel/linux-headers/linux-headers-4.15-r1.ebuild b/sys-kernel/linux-headers/linux-headers-4.15-r1.ebuild
new file mode 100644
index 0000000..40da92c
--- /dev/null
+++ b/sys-kernel/linux-headers/linux-headers-4.15-r1.ebuild
@@ -0,0 +1,57 @@
+# Copyright 1999-2018 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+
+ETYPE="headers"
+H_SUPPORTEDARCH="alpha amd64 arc arm arm64 avr32 bfin cris frv hexagon hppa ia64 m32r m68k metag microblaze mips mn10300 nios2 openrisc ppc ppc64 riscv s390 score sh sparc tile x86 xtensa"
+inherit kernel-2
+detect_version
+
+PATCH_VER="1"
+SRC_URI="mirror://gentoo/gentoo-headers-base-${PV}.tar.xz
+	${PATCH_VER:+mirror://gentoo/gentoo-headers-${PV}-${PATCH_VER}.tar.xz}"
+
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-linux ~x86-linux"
+
+DEPEND="app-arch/xz-utils
+	dev-lang/perl"
+RDEPEND="!!media-sound/alsa-headers"
+
+S=${WORKDIR}/gentoo-headers-base-${PV}
+
+src_unpack() {
+	unpack ${A}
+}
+
+src_prepare() {
+	default
+
+	[[ -n ${PATCH_VER} ]] && eapply "${WORKDIR}/${PV}"/*.patch
+}
+
+src_install() {
+	kernel-2_src_install
+
+	# hrm, build system sucks
+	find "${ED}" '(' -name '.install' -o -name '*.cmd' ')' -delete
+	find "${ED}" -depth -type d -delete 2>/dev/null
+}
+
+src_test() {
+	# Make sure no uapi/ include paths are used by accident.
+	egrep -r \
+		-e '# *include.*["<]uapi/' \
+		"${D}" && die "#include uapi/xxx detected"
+
+	einfo "Possible unescaped attribute/type usage"
+	egrep -r \
+		-e '(^|[[:space:](])(asm|volatile|inline)[[:space:](]' \
+		-e '\<([us](8|16|32|64))\>' \
+		.
+
+	einfo "Missing linux/types.h include"
+	egrep -l -r -e '__[us](8|16|32|64)' "${ED}" | xargs grep -L linux/types.h
+
+	emake ARCH=$(tc-arch-kernel) headers_check
+}

diff --git a/sys-kernel/linux-headers/linux-headers-4.16-r2.ebuild b/sys-kernel/linux-headers/linux-headers-4.16-r2.ebuild
new file mode 100644
index 0000000..a8906fa
--- /dev/null
+++ b/sys-kernel/linux-headers/linux-headers-4.16-r2.ebuild
@@ -0,0 +1,60 @@
+# Copyright 1999-2018 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+
+ETYPE="headers"
+H_SUPPORTEDARCH="alpha amd64 arc arm arm64 avr32 bfin cris frv hexagon hppa ia64 m32r m68k metag microblaze mips mn10300 nios2 openrisc ppc ppc64 riscv s390 score sh sparc tile x86 xtensa"
+inherit kernel-2
+detect_version
+
+PATCH_VER="1"
+SRC_URI="mirror://gentoo/gentoo-headers-base-${PV}-r1.tar.xz
+	${PATCH_VER:+mirror://gentoo/gentoo-headers-${PV}-${PATCH_VER}.tar.xz}
+	https://dev.gentoo.org/~slyfox/distfiles/gentoo-headers-base-${PV}-r1.tar.xz
+	${PATCH_VER:+https://dev.gentoo.org/~slyfox/distfiles/gentoo-headers-${PV}-${PATCH_VER}.tar.xz}
+"
+
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-linux ~x86-linux"
+
+DEPEND="app-arch/xz-utils
+	dev-lang/perl"
+RDEPEND="!!media-sound/alsa-headers"
+
+S=${WORKDIR}/gentoo-headers-base-${PV}
+
+src_unpack() {
+	unpack ${A}
+}
+
+src_prepare() {
+	default
+
+	[[ -n ${PATCH_VER} ]] && eapply "${WORKDIR}/${PV}"/*.patch
+}
+
+src_install() {
+	kernel-2_src_install
+
+	# hrm, build system sucks
+	find "${ED}" '(' -name '.install' -o -name '*.cmd' ')' -delete
+	find "${ED}" -depth -type d -delete 2>/dev/null
+}
+
+src_test() {
+	# Make sure no uapi/ include paths are used by accident.
+	egrep -r \
+		-e '# *include.*["<]uapi/' \
+		"${D}" && die "#include uapi/xxx detected"
+
+	einfo "Possible unescaped attribute/type usage"
+	egrep -r \
+		-e '(^|[[:space:](])(asm|volatile|inline)[[:space:](]' \
+		-e '\<([us](8|16|32|64))\>' \
+		.
+
+	einfo "Missing linux/types.h include"
+	egrep -l -r -e '__[us](8|16|32|64)' "${ED}" | xargs grep -L linux/types.h
+
+	emake ARCH=$(tc-arch-kernel) headers_check
+}

diff --git a/sys-kernel/linux-headers/linux-headers-4.16.ebuild b/sys-kernel/linux-headers/linux-headers-4.16.ebuild
new file mode 100644
index 0000000..d8d375b
--- /dev/null
+++ b/sys-kernel/linux-headers/linux-headers-4.16.ebuild
@@ -0,0 +1,60 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+
+ETYPE="headers"
+H_SUPPORTEDARCH="alpha amd64 arc arm arm64 avr32 bfin cris frv hexagon hppa ia64 m32r m68k metag microblaze mips mn10300 nios2 openrisc ppc ppc64 riscv s390 score sh sparc tile x86 xtensa"
+inherit kernel-2
+detect_version
+
+PATCH_VER="1"
+SRC_URI="mirror://gentoo/gentoo-headers-base-${PV}.tar.xz
+	${PATCH_VER:+mirror://gentoo/gentoo-headers-${PV}-${PATCH_VER}.tar.xz}
+	https://dev.gentoo.org/~slyfox/distfiles/gentoo-headers-base-${PV}.tar.xz
+	${PATCH_VER:+https://dev.gentoo.org/~slyfox/distfiles/gentoo-headers-${PV}-${PATCH_VER}.tar.xz}
+"
+
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-linux ~x86-linux"
+
+DEPEND="app-arch/xz-utils
+	dev-lang/perl"
+RDEPEND="!!media-sound/alsa-headers"
+
+S=${WORKDIR}/gentoo-headers-base-${PV}
+
+src_unpack() {
+	unpack ${A}
+}
+
+src_prepare() {
+	default
+
+	[[ -n ${PATCH_VER} ]] && EPATCH_SUFFIX="patch" epatch "${WORKDIR}"/${PV}
+}
+
+src_install() {
+	kernel-2_src_install
+
+	# hrm, build system sucks
+	find "${ED}" '(' -name '.install' -o -name '*.cmd' ')' -delete
+	find "${ED}" -depth -type d -delete 2>/dev/null
+}
+
+src_test() {
+	# Make sure no uapi/ include paths are used by accident.
+	egrep -r \
+		-e '# *include.*["<]uapi/' \
+		"${D}" && die "#include uapi/xxx detected"
+
+	einfo "Possible unescaped attribute/type usage"
+	egrep -r \
+		-e '(^|[[:space:](])(asm|volatile|inline)[[:space:](]' \
+		-e '\<([us](8|16|32|64))\>' \
+		.
+
+	einfo "Missing linux/types.h include"
+	egrep -l -r -e '__[us](8|16|32|64)' "${ED}" | xargs grep -L linux/types.h
+
+	emake ARCH=$(tc-arch-kernel) headers_check
+}

diff --git a/sys-kernel/linux-headers/linux-headers-4.17.ebuild b/sys-kernel/linux-headers/linux-headers-4.17.ebuild
new file mode 100644
index 0000000..e8a6194
--- /dev/null
+++ b/sys-kernel/linux-headers/linux-headers-4.17.ebuild
@@ -0,0 +1,57 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+
+ETYPE="headers"
+H_SUPPORTEDARCH="alpha amd64 arc arm arm64 avr32 cris frv hexagon hppa ia64 m32r m68k metag microblaze mips mn10300 nios2 openrisc ppc ppc64 riscv s390 score sh sparc x86 xtensa"
+inherit kernel-2
+detect_version
+
+PATCH_VER="1"
+SRC_URI="mirror://gentoo/gentoo-headers-base-${PV}.tar.xz
+	${PATCH_VER:+mirror://gentoo/gentoo-headers-${PV}-${PATCH_VER}.tar.xz}"
+
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-linux ~x86-linux"
+
+DEPEND="app-arch/xz-utils
+	dev-lang/perl"
+RDEPEND="!!media-sound/alsa-headers"
+
+S=${WORKDIR}/gentoo-headers-base-${PV}
+
+src_unpack() {
+	unpack ${A}
+}
+
+src_prepare() {
+	default
+
+	[[ -n ${PATCH_VER} ]] && eapply "${WORKDIR}"/${PV}/*.patch
+}
+
+src_install() {
+	kernel-2_src_install
+
+	# hrm, build system sucks
+	find "${ED}" '(' -name '.install' -o -name '*.cmd' ')' -delete
+	find "${ED}" -depth -type d -delete 2>/dev/null
+}
+
+src_test() {
+	# Make sure no uapi/ include paths are used by accident.
+	egrep -r \
+		-e '# *include.*["<]uapi/' \
+		"${D}" && die "#include uapi/xxx detected"
+
+	einfo "Possible unescaped attribute/type usage"
+	egrep -r \
+		-e '(^|[[:space:](])(asm|volatile|inline)[[:space:](]' \
+		-e '\<([us](8|16|32|64))\>' \
+		.
+
+	einfo "Missing linux/types.h include"
+	egrep -l -r -e '__[us](8|16|32|64)' "${ED}" | xargs grep -L linux/types.h
+
+	emake ARCH=$(tc-arch-kernel) headers_check
+}

diff --git a/sys-kernel/linux-headers/linux-headers-4.18.ebuild b/sys-kernel/linux-headers/linux-headers-4.18.ebuild
new file mode 100644
index 0000000..1d8f8e6
--- /dev/null
+++ b/sys-kernel/linux-headers/linux-headers-4.18.ebuild
@@ -0,0 +1,60 @@
+# Copyright 1999-2018 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+
+ETYPE="headers"
+H_SUPPORTEDARCH="alpha amd64 arc arm arm64 avr32 cris frv hexagon hppa ia64 m32r m68k metag microblaze mips mn10300 nios2 openrisc ppc ppc64 riscv s390 score sh sparc x86 xtensa"
+inherit kernel-2
+detect_version
+
+PATCH_VER="1"
+SRC_URI="mirror://gentoo/gentoo-headers-base-${PV}.tar.xz
+	https://dev.gentoo.org/~slyfox/distfiles/gentoo-headers-base-${PV}.tar.xz
+	${PATCH_VER:+mirror://gentoo/gentoo-headers-${PV}-${PATCH_VER}.tar.xz}
+	${PATCH_VER:+https://dev.gentoo.org/~slyfox/distfiles/gentoo-headers-${PV}-${PATCH_VER}.tar.xz}
+"
+
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-linux ~x86-linux"
+
+DEPEND="app-arch/xz-utils
+	dev-lang/perl"
+RDEPEND=""
+
+S=${WORKDIR}/gentoo-headers-base-${PV}
+
+src_unpack() {
+	unpack ${A}
+}
+
+src_prepare() {
+	default
+
+	[[ -n ${PATCH_VER} ]] && eapply "${WORKDIR}"/${PV}/*.patch
+}
+
+src_install() {
+	kernel-2_src_install
+
+	# hrm, build system sucks
+	find "${ED}" '(' -name '.install' -o -name '*.cmd' ')' -delete
+	find "${ED}" -depth -type d -delete 2>/dev/null
+}
+
+src_test() {
+	# Make sure no uapi/ include paths are used by accident.
+	egrep -r \
+		-e '# *include.*["<]uapi/' \
+		"${D}" && die "#include uapi/xxx detected"
+
+	einfo "Possible unescaped attribute/type usage"
+	egrep -r \
+		-e '(^|[[:space:](])(asm|volatile|inline)[[:space:](]' \
+		-e '\<([us](8|16|32|64))\>' \
+		.
+
+	einfo "Missing linux/types.h include"
+	egrep -l -r -e '__[us](8|16|32|64)' "${ED}" | xargs grep -L linux/types.h
+
+	emake ARCH=$(tc-arch-kernel) headers_check
+}

diff --git a/sys-kernel/linux-headers/linux-headers-4.19.ebuild b/sys-kernel/linux-headers/linux-headers-4.19.ebuild
new file mode 100644
index 0000000..1d8f8e6
--- /dev/null
+++ b/sys-kernel/linux-headers/linux-headers-4.19.ebuild
@@ -0,0 +1,60 @@
+# Copyright 1999-2018 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+
+ETYPE="headers"
+H_SUPPORTEDARCH="alpha amd64 arc arm arm64 avr32 cris frv hexagon hppa ia64 m32r m68k metag microblaze mips mn10300 nios2 openrisc ppc ppc64 riscv s390 score sh sparc x86 xtensa"
+inherit kernel-2
+detect_version
+
+PATCH_VER="1"
+SRC_URI="mirror://gentoo/gentoo-headers-base-${PV}.tar.xz
+	https://dev.gentoo.org/~slyfox/distfiles/gentoo-headers-base-${PV}.tar.xz
+	${PATCH_VER:+mirror://gentoo/gentoo-headers-${PV}-${PATCH_VER}.tar.xz}
+	${PATCH_VER:+https://dev.gentoo.org/~slyfox/distfiles/gentoo-headers-${PV}-${PATCH_VER}.tar.xz}
+"
+
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-linux ~x86-linux"
+
+DEPEND="app-arch/xz-utils
+	dev-lang/perl"
+RDEPEND=""
+
+S=${WORKDIR}/gentoo-headers-base-${PV}
+
+src_unpack() {
+	unpack ${A}
+}
+
+src_prepare() {
+	default
+
+	[[ -n ${PATCH_VER} ]] && eapply "${WORKDIR}"/${PV}/*.patch
+}
+
+src_install() {
+	kernel-2_src_install
+
+	# hrm, build system sucks
+	find "${ED}" '(' -name '.install' -o -name '*.cmd' ')' -delete
+	find "${ED}" -depth -type d -delete 2>/dev/null
+}
+
+src_test() {
+	# Make sure no uapi/ include paths are used by accident.
+	egrep -r \
+		-e '# *include.*["<]uapi/' \
+		"${D}" && die "#include uapi/xxx detected"
+
+	einfo "Possible unescaped attribute/type usage"
+	egrep -r \
+		-e '(^|[[:space:](])(asm|volatile|inline)[[:space:](]' \
+		-e '\<([us](8|16|32|64))\>' \
+		.
+
+	einfo "Missing linux/types.h include"
+	egrep -l -r -e '__[us](8|16|32|64)' "${ED}" | xargs grep -L linux/types.h
+
+	emake ARCH=$(tc-arch-kernel) headers_check
+}

diff --git a/sys-kernel/linux-headers/linux-headers-4.4.ebuild b/sys-kernel/linux-headers/linux-headers-4.4.ebuild
new file mode 100644
index 0000000..bcde8d8
--- /dev/null
+++ b/sys-kernel/linux-headers/linux-headers-4.4.ebuild
@@ -0,0 +1,55 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="4"
+
+ETYPE="headers"
+H_SUPPORTEDARCH="alpha amd64 arc arm arm64 avr32 bfin cris frv hexagon hppa ia64 m32r m68k metag microblaze mips mn10300 nios2 openrisc ppc ppc64 s390 score sh sparc tile x86 xtensa"
+inherit kernel-2
+detect_version
+
+PATCH_VER="1"
+SRC_URI="mirror://gentoo/gentoo-headers-base-${PV}.tar.xz
+	${PATCH_VER:+mirror://gentoo/gentoo-headers-${PV}-${PATCH_VER}.tar.xz}"
+
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~amd64-linux ~x86-linux"
+
+DEPEND="app-arch/xz-utils
+	dev-lang/perl"
+RDEPEND="!!media-sound/alsa-headers"
+
+S=${WORKDIR}/gentoo-headers-base-${PV}
+
+src_unpack() {
+	unpack ${A}
+}
+
+src_prepare() {
+	[[ -n ${PATCH_VER} ]] && EPATCH_SUFFIX="patch" epatch "${WORKDIR}"/${PV}
+}
+
+src_install() {
+	kernel-2_src_install
+
+	# hrm, build system sucks
+	find "${ED}" '(' -name '.install' -o -name '*.cmd' ')' -delete
+	find "${ED}" -depth -type d -delete 2>/dev/null
+}
+
+src_test() {
+	# Make sure no uapi/ include paths are used by accident.
+	egrep -r \
+		-e '# *include.*["<]uapi/' \
+		"${D}" && die "#include uapi/xxx detected"
+
+	einfo "Possible unescaped attribute/type usage"
+	egrep -r \
+		-e '(^|[[:space:](])(asm|volatile|inline)[[:space:](]' \
+		-e '\<([us](8|16|32|64))\>' \
+		.
+
+	einfo "Missing linux/types.h include"
+	egrep -l -r -e '__[us](8|16|32|64)' "${ED}" | xargs grep -L linux/types.h
+
+	emake ARCH=$(tc-arch-kernel) headers_check
+}

diff --git a/sys-kernel/linux-headers/linux-headers-4.9.ebuild b/sys-kernel/linux-headers/linux-headers-4.9.ebuild
new file mode 100644
index 0000000..8bf0071
--- /dev/null
+++ b/sys-kernel/linux-headers/linux-headers-4.9.ebuild
@@ -0,0 +1,55 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+ETYPE="headers"
+H_SUPPORTEDARCH="alpha amd64 arc arm arm64 avr32 bfin cris frv hexagon hppa ia64 m32r m68k metag microblaze mips mn10300 nios2 openrisc ppc ppc64 s390 score sh sparc tile x86 xtensa"
+inherit kernel-2
+detect_version
+
+PATCH_VER="1"
+SRC_URI="mirror://gentoo/gentoo-headers-base-${PV}.tar.xz
+	${PATCH_VER:+mirror://gentoo/gentoo-headers-${PV}-${PATCH_VER}.tar.xz}"
+
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-linux ~x86-linux"
+
+DEPEND="app-arch/xz-utils
+	dev-lang/perl"
+RDEPEND="!!media-sound/alsa-headers"
+
+S=${WORKDIR}/gentoo-headers-base-${PV}
+
+src_unpack() {
+	unpack ${A}
+}
+
+src_prepare() {
+	[[ -n ${PATCH_VER} ]] && EPATCH_SUFFIX="patch" epatch "${WORKDIR}"/${PV}
+}
+
+src_install() {
+	kernel-2_src_install
+
+	# hrm, build system sucks
+	find "${ED}" '(' -name '.install' -o -name '*.cmd' ')' -delete
+	find "${ED}" -depth -type d -delete 2>/dev/null
+}
+
+src_test() {
+	# Make sure no uapi/ include paths are used by accident.
+	egrep -r \
+		-e '# *include.*["<]uapi/' \
+		"${D}" && die "#include uapi/xxx detected"
+
+	einfo "Possible unescaped attribute/type usage"
+	egrep -r \
+		-e '(^|[[:space:](])(asm|volatile|inline)[[:space:](]' \
+		-e '\<([us](8|16|32|64))\>' \
+		.
+
+	einfo "Missing linux/types.h include"
+	egrep -l -r -e '__[us](8|16|32|64)' "${ED}" | xargs grep -L linux/types.h
+
+	emake ARCH=$(tc-arch-kernel) headers_check
+}

diff --git a/sys-kernel/linux-headers/metadata.xml b/sys-kernel/linux-headers/metadata.xml
new file mode 100644
index 0000000..fcf3f04
--- /dev/null
+++ b/sys-kernel/linux-headers/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>toolchain@gentoo.org</email>
+  <name>Gentoo Toolchain Project</name>
+</maintainer>
+<upstream>
+  <remote-id type="cpe">cpe:/o:linux:linux_kernel</remote-id>
+</upstream>
+</pkgmetadata>

diff --git a/sys-kernel/metadata.xml b/sys-kernel/metadata.xml
new file mode 100644
index 0000000..16c8a6d
--- /dev/null
+++ b/sys-kernel/metadata.xml
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE catmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<catmetadata>
+	<longdescription lang="en">
+		The sys-kernel category contains kernel source ebuilds and
+		kernel-related tools.
+	</longdescription>
+	<longdescription lang="es">
+		La categoría sys-kernel contiene las fuentes del núcleo y herramientas
+		relacionadas con este.
+	</longdescription>
+	<longdescription lang="de">
+		Die Kategorie sys-kernel enthält Ebuilds für Kernelquellen
+		sowie damit in Zusammenhang stehende Pakete.
+	</longdescription>
+	<longdescription lang="ja">
+		sys-kernelカテゴリにはカーネルソースebuildとカーネル関連ツールが含まれます。
+	</longdescription>
+	<longdescription lang="nl">
+		De sys-kernel categorie bevat ebuilds voor kernelbroncode en gerelateerde
+		hulpmiddelen.
+	</longdescription>
+	<longdescription lang="vi">
+		Nhóm sys-kernel chứa ebuild mã nguồn kernel và các công cụ
+		liên quan đến kernel.
+	</longdescription>
+	<longdescription lang="it">
+		La categoria sys-kernel contiene i sorgenti del kernel e alcuni programmi
+		per la sua gestione come genkernel.
+	</longdescription>
+	<longdescription lang="pt">
+		A categoria sys-kernel contém ebuilds de fonte de kernel e
+		ferramentas relacionadas a kernel.
+	</longdescription>
+	<longdescription lang="pl">
+		Kategoria sys-kernel zawiera źródła jądra oraz związane z nimi narzędzia.
+	</longdescription>
+</catmetadata>
+

diff --git a/sys-kernel/mips-sources/metadata.xml b/sys-kernel/mips-sources/metadata.xml
new file mode 100644
index 0000000..eaa2cd0
--- /dev/null
+++ b/sys-kernel/mips-sources/metadata.xml
@@ -0,0 +1,21 @@
+<?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>
+		mips-sources are git snapshots from the linux-mips.org git server for MIPS-Based machines
+	</longdescription>
+	<use>
+		<flag name="ip27">Enables additional support for SGI Origin (IP27)</flag>
+		<flag name="ip28">Enables additional support for SGI Indigo2 Impact R10000 (IP28)</flag>
+		<flag name="ip30">Enables support for SGI Octane (IP30, 'Speedracer')</flag>
+		<flag name="experimental">Apply experimental (80xx) patches.</flag>
+	</use>
+	<upstream>
+		<remote-id type="cpe">cpe:/o:linux:linux_kernel</remote-id>
+	</upstream>
+</pkgmetadata>

diff --git a/sys-kernel/mips-sources/mips-sources-4.14.67.ebuild b/sys-kernel/mips-sources/mips-sources-4.14.67.ebuild
new file mode 100644
index 0000000..4162d7a
--- /dev/null
+++ b/sys-kernel/mips-sources/mips-sources-4.14.67.ebuild
@@ -0,0 +1,346 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+# EAPI Version
+EAPI="6"
+
+#//------------------------------------------------------------------------------
+
+# Version Data
+GITDATE="20180128"			# Date of diff between kernel.org and lmo GIT
+GENPATCHREV="1"				# Tarball revision for patches
+
+# Directories
+S="${WORKDIR}/linux-${OKV}-${GITDATE}"
+MIPS_PATCHES="${WORKDIR}/mips-patches"
+
+# Kernel-2 Vars
+K_SECURITY_UNSUPPORTED="yes"
+K_NOUSENAME="yes"
+K_NOSETEXTRAVERSION="yes"
+K_NOUSEPR="yes"
+K_BASE_VER="4.13"
+K_FROM_GIT="yes"
+ETYPE="sources"
+
+# Inherit Eclasses
+inherit kernel-2 eutils eapi7-ver
+detect_version
+
+# Version Data
+F_KV="${PVR}"
+BASE_KV="$(ver_cut 1-2).0"
+[[ "${EXTRAVERSION}" = -rc* ]] && KVE="${EXTRAVERSION}"
+
+# Portage Vars
+HOMEPAGE="https://www.linux-mips.org/ https://www.gentoo.org/"
+KEYWORDS="-* ~mips"
+IUSE="experimental ip27 ip28 ip30"
+RDEPEND=""
+DEPEND="${RDEPEND}
+	>=sys-devel/gcc-4.7.0
+	>=sys-devel/patch-2.7.4"
+
+# Specify any patches or patch familes to NOT apply here.
+# Use only the 4-digit number followed by a '*'.
+P_EXCLUDE=""
+
+# Machine Support Control Variables
+DO_IP22="test"				# If "yes", enable IP22 support		(SGI Indy, Indigo2 R4x00)
+DO_IP27="yes"				# 		   IP27 support		(SGI Origin)
+DO_IP28="test"				# 		   IP28 support		(SGI Indigo2 Impact R10000)
+DO_IP30="yes"				# 		   IP30 support		(SGI Octane)
+DO_IP32="yes"				# 		   IP32 support		(SGI O2, R5000/RM5200 Only)
+
+# Machine Stable Version Variables
+SV_IP22=""				# If set && DO_IP22 == "no", indicates last "good" IP22 version
+SV_IP27=""				# 	    DO_IP27 == "no", 			   IP27
+SV_IP28=""				# 	    DO_IP28 == "no", 			   IP28
+SV_IP30=""				# 	    DO_IP30 == "no", 			   IP30
+SV_IP32=""				# 	    DO_IP32 == "no", 			   IP32
+
+DESCRIPTION="Linux-Mips GIT sources for MIPS-based machines, dated ${GITDATE}"
+SRC_URI="${KERNEL_URI}
+	 mirror://gentoo/mipsgit-${BASE_KV}${KVE}-${GITDATE}.diff.xz
+	 mirror://gentoo/${PN}-${BASE_KV}-patches-v${GENPATCHREV}.tar.xz"
+
+UNIPATCH_STRICTORDER="yes"
+UNIPATCH_LIST="${DISTDIR}/mipsgit-${BASE_KV}${KVE}-${GITDATE}.diff.xz"
+
+#//------------------------------------------------------------------------------
+
+err_disabled_mach() {
+	# Get args
+	local m_name="${1}"
+	local m_abbr="${2}"
+	local m_use="${3}"
+	local is_test="${4}"
+
+	# Get stable version, if exists
+	local stable_ver="SV_${m_abbr}"
+	stable_ver="${!stable_ver}"
+
+	# See if this machine needs a USE passed or skip dying
+	local has_use
+	[ ! -z "${m_use}" -a "${m_use}" != "skip" ] && has_use="USE=\"${m_use}\" "
+
+	# Print error && (maybe) die
+	echo -e ""
+	if [ "${is_test}" != "test" ]; then
+		eerror "${m_name} Support has been disabled in this ebuild"
+		eerror "revision.  If you wish to merge ${m_name} sources, then"
+		eerror "run ${has_use}emerge =mips-sources-${stable_ver}"
+		[ "${m_use}" != "skip" ] && die "${m_name} Support disabled."
+	else
+		ewarn "${m_name} Support has been marked as needing testing in this"
+		ewarn "ebuild revision.  This usually means that any patches to support"
+		ewarn "${m_name} have been forward ported and maybe even compile-tested,"
+		ewarn "but not yet booted on real hardware, possibly due to a lack of access"
+		ewarn "to such hardware.  If you happen to boot this kernel and have no"
+		ewarn "problems at all, then please inform the maintainer.  Otherwise, if"
+		ewarn "experience a bug, an oops/panic, or some other oddity, then please"
+		ewarn "file a bug at bugs.gentoo.org, and assign it to the mips team."
+	fi
+
+	return 0
+}
+
+err_only_one_mach_allowed() {
+	echo -e ""
+	eerror "A patchset for a specific machine-type has already been selected."
+	eerror "No other patches for machines-types are permitted.  You will need a"
+	eerror "separate copy of the kernel sources for each different machine-type"
+	eerror "you want to build a kernel for."
+	die "Only one machine-type patchset allowed"
+}
+
+pkg_postinst() {
+	# Symlink /usr/src/linux as appropriate
+	local my_ksrc="${S##*/}"
+	for x in {ip27,ip28,ip30}; do
+		use ${x} && my_ksrc="${my_ksrc}.${x}"
+	done
+
+	if [ ! -e "${ROOT}usr/src/linux" ]; then
+		rm -f "${ROOT}usr/src/linux"
+		ln -sf "${my_ksrc}" "${ROOT}/usr/src/linux"
+	fi
+}
+
+pkg_setup() {
+	local arch_is_selected="no"
+	local m_ip m_enable m_name
+
+	# Exclusive machine patchsets
+	# These are not allowed to be mixed together, thus only one of them may be applied
+	# to a tree per merge.
+	for x in									\
+		"ip27 SGI Origin 200/2000"						\
+		"ip28 SGI Indigo2 Impact R10000"					\
+		"ip30 SGI Octane"
+	do
+		set -- ${x}		# Set positional params
+		m_ip="${1}"		# Grab the first param (HW IP for SGI)
+		shift			# Shift the positions
+		m_name="${*}"		# Get the rest (Name)
+
+		if use ${m_ip}; then
+			# Fetch the value indiciating if the machine is enabled or not
+			m_enable="DO_${m_ip/ip/IP}"
+			m_enable="${!m_enable}"
+
+			# Make sure only one of these exclusive machine patches is selected
+			[ "${arch_is_selected}" = "no" ]				\
+				&& arch_is_selected="yes"				\
+				|| err_only_one_mach_allowed
+
+			# Is the machine support disabled or marked as needing testing?
+			[ "${m_enable}" = "test" ]					\
+				&& err_disabled_mach "${m_name}" "${m_ip/ip/IP}" "${m_ip}" "test"
+			[ "${m_enable}" = "no" ]					\
+				&& err_disabled_mach "${m_name}" "${m_ip/ip/IP}" "${m_ip}"
+
+			# Show relevant information about the machine
+			show_${m_ip}_info
+		fi
+	done
+
+	# All other systems that don't have a USE flag go here
+	# These systems have base-line support included in linux-mips git, so
+	# instead of failing, if disabled, we simply warn the user
+	if [ "${arch_is_selected}" = "no" ]; then
+		[ "${DO_IP22}" = "no" ]							\
+			&& err_disabled_mach "SGI Indy/Indigo2 R4x00" "IP22" "skip"	\
+			|| show_ip22_info
+		[ "${DO_IP32}" = "no" ]							\
+			&& err_disabled_mach "SGI O2" "IP32" "skip"			\
+			|| show_ip32_info
+
+	fi
+}
+
+show_ip22_info() {
+	echo -e ""
+	einfo "IP22 systems with an R5000 processor should work with this release."
+	einfo "The R4x00 series of processors tend to be rather flaky, especially the"
+	einfo "R4600.  If you have to run an R4x00 processor, then try to use an R4400."
+	einfo ""
+	einfo "Some Notes:"
+	einfo "\t- Supported graphics card right now is Newport (XL)."
+	einfo "\t- A driver for Extreme (XZ) does not exist at present."
+	echo -e ""
+}
+
+show_ip27_info() {
+	echo -e ""
+	ewarn "Heavy disk I/O on recent kernels may randomly trigger a VM_BUG_ON_PAGE()"
+	ewarn "in move_freepages() in mm/page_alloc.c.  The exact trigger cause is"
+	ewarn "unknown at this time.  Please report any oops messages from this"
+	ewarn "bug to bugs.gentoo.org (assign to mips@gentoo.org)"
+	echo -e ""
+}
+
+show_ip28_info() {
+	echo -e ""
+	einfo "Support for the Indigo2 Impact R10000 is now in the mainline kernel.  However,"
+	einfo "due to the R10000 Speculative Execution issue that exists with this machine,"
+	einfo "nothing is guaranteed to work correctly.  Consider enabling ${HILITE}CONFIG_KALLSYMS${NORMAL}"
+	einfo "in your kernel so that if the machine Oopes, you'll be able to provide valuable"
+	einfo "feedback that can be used to trace down the crash."
+	echo -e ""
+}
+
+show_ip30_info() {
+	echo -e ""
+	eerror "Things that DON'T work:"
+	eerror "\t- Do not use CONFIG_SLUB, otherwise, you'll get errors when booting"
+	eerror "\t\040\040regarding duplicate /sys/kernel/slab/* entries in sysfs."
+	eerror "\t- Impact (MGRAS) Xorg driver no longer functions due to severe bitrot."
+	eerror "\t- Octane is limited to a maximum of 2GB of memory right now due to a"
+	eerror "\t\040\040hardware quirk in the BRIDGE PCI chip that limits BRIDGE DMA"
+	eerror "\t\040\040addresses to 31-bits when converted into physical addresses."
+	eerror "\t\040\040Patches that attempt to fix the issue are highly welcome."
+	echo -e ""
+	ewarn "Things that might work, but have problems, or are unknown:"
+	ewarn "\t- CONFIG_TRANSPARENT_HUGEPAGE should work now, but there may still be"
+	ewarn "\t\040\040intermittent issues.  Additionally, CONFIG_HUGETLBFS must also be"
+	ewarn "\t\040\040selected for hugepages to work.  If use of this feature continues"
+	ewarn "\t\040\040to trigger random Instruction Bus Errors (IBEs), then it is best to"
+	ewarn "\t\040\040disable the functionality and perform a cold reset of the machine"
+	ewarn "\t\040\040after powering it down for at least 30 seconds."
+	ewarn "\t- Serial support on the Octane uses a very basic UART driver that drives"
+	ewarn "\t\040\040the 16550A chip on the IOC3 directly.  It does not use interrupts,"
+	ewarn "\t\040\040only a polling routine on a timer, which makes it slow and CPU-"
+	ewarn "\t\040\040intensive.  The baud rate is limited to no more than 38.4kbps on"
+	ewarn "\t\040\040this driver.  Patches for getting the Altix IOC3 serial driver to"
+	ewarn "\t\040\040work (which uses DMA and supports faster baud rates) are welcome."
+	ewarn "\t- UHCI Cards are known to have issues, but should still function."
+	ewarn "\t\040\040This issue primarily manifests itself when using pl2303 USB->Serial"
+	ewarn "\t\040\040adapters."
+	ewarn "\t- MENET boards appear to have the four ethernet ports detected, however"
+	ewarn "\t\040\040the six serial ports don't appear to get picked up by the IOC3"
+	ewarn "\t\040\040UART driver.  The NIC part number is also not read correctly"
+	ewarn "\t\040\040from the four Number-In-a-Cans.  Additional testing would be"
+	ewarn "\t\040\040appreciated and patches welcome."
+	ewarn "\t- Other XIO-based devices, like various Impact addons, remain untested"
+	ewarn "\t\040\040and are not guaranteed to work.  This applies to various digital"
+	ewarn "\t\040\040video conversion boards as well."
+	echo -e ""
+	einfo "Things that DO work:"
+	einfo "\t- SMP works again, celebrate!"
+	einfo "\t- Impact (MGRAS) console only."
+	einfo "\t- VPro (Odyssey) console only (no X driver exists yet)."
+	einfo "\t- PCI Card Cages should work for many devices, except certain types like"
+	einfo "\t\040\040PCI-to-PCI bridges (USB hubs, USB flash card readers for example)."
+	einfo "\t- SCSI, RTC, basic PCI, IOC3 Ethernet, keyboard, and mouse.  Please"
+	einfo "\t\040\040report any problems with these devices."
+	echo -e ""
+}
+
+show_ip32_info() {
+	echo -e ""
+	einfo "IP32 systems function well, however there are some notes:"
+	einfo "\t- A sound driver now exists for IP32.  Celebrate!"
+	einfo "\t- Framebuffer console is limited to 4MB.  Anything greater"
+	einfo "\t\040\040specified when building the kernel will likely oops"
+	einfo "\t\040\040or panic the kernel."
+	einfo "\t- X support is limited to the generic fbdev driver.  No X"
+	einfo "\t\040\040gbefb driver exists for O2 yet.  Feel free to submit"
+	einfo "\t\040\040patches!"
+	echo -e ""
+
+	einfo "To Build 64bit kernels for SGI O2 (IP32) or SGI Indy/Indigo2 R4x00 (IP22)"
+	einfo "systems, you need to use the ${GOOD}vmlinux.32${NORMAL} make target."
+	einfo "Once done, boot the ${GOOD}vmlinux.32${NORMAL} file (NOT vmlinux)."
+}
+
+src_unpack() {
+	# Unpack the kernel sources, update to the latest rev (if needed),
+	# and apply the latest patch from linux-mips git.
+	kernel-2_src_unpack
+
+	# Unpack the mips-sources patchset to ${WORKDIR}/mips-patches-${BASE_KV}.
+	echo -e ""
+	cd "${WORKDIR}"
+	unpack "${PN}-${BASE_KV}-patches-v${GENPATCHREV}.tar.xz"
+
+	# Create a new folder called 'patch-symlinks' and create symlinks to
+	# all mips-patches in there.  If we want to exclude a patch, we'll
+	# just delete the symlink instead of the actual patch.
+	local psym="patch-symlinks"
+	mkdir "${psym}"
+	cd "${psym}"
+	for x in ../mips-patches-${BASE_KV}/*.patch; do
+		ln -s "${x}" "${x##../mips-patches-*/}"
+	done
+
+	# With symlinks created, setup the variables referencing external
+	# machine patches and if a machine USE flag is enabled, then unset
+	# its corresponding variable.
+	# See 0000_README for the patch numbers and their meanings.
+	local p_generic="51*"
+	local p_ip27="52*" p_ip28="53*" p_ip30="54*"
+	local p_xp="80*"
+	use ip27 && unset p_generic p_ip27
+	use ip28 && unset p_ip28
+	use ip30 && unset p_generic p_ip30
+	use experimental && unset p_xp
+
+	# Remove symlinks for any patches that we don't want applied.  We
+	# do this by looping through all the above variables, and deleting
+	# matching symlinks that point to the corresponding patches.
+	# The remaining symlinks will be applied to the kernel source.
+	#
+	# $P_EXCLUDE is a new var that can be set in an ebuild to exclude
+	# specific patches by wildcarding the patch number.
+	local patchlist="${p_generic} ${p_ip27} ${p_ip28} ${p_ip30} ${p_xp} ${P_EXCLUDE}"
+	for x in $patchlist;
+		do rm -f "./${x}"
+	done
+
+	# Rename the source tree to match the linux-mips git checkout date and
+	# machine type.
+	local fkv="${F_KV%-*}"
+	local v="${fkv}-${GITDATE}"
+	for x in {ip27,ip28,ip30}; do
+		use ${x} && v="${v}.${x}" && break
+	done
+	mv "${WORKDIR}/linux-${fkv/_/-}" "${WORKDIR}/linux-${v}" || die
+	S="${WORKDIR}/linux-${v}"
+
+	# Set the EXTRAVERSION to linux-VERSION-mipsgit-GITDATE
+	EXTRAVERSION="${EXTRAVERSION}-mipsgit-${GITDATE}"
+	unpack_set_extraversion
+}
+
+src_prepare() {
+	local psym="patch-symlinks"
+
+	# Now go into the kernel source and patch it.
+	cd "${S}"
+	epatch -p1 "${WORKDIR}/${psym}"/*.patch
+
+	eapply_user
+}
+
+#//------------------------------------------------------------------------------

diff --git a/sys-kernel/mips-sources/mips-sources-4.17.19.ebuild b/sys-kernel/mips-sources/mips-sources-4.17.19.ebuild
new file mode 100644
index 0000000..cd1ccaa
--- /dev/null
+++ b/sys-kernel/mips-sources/mips-sources-4.17.19.ebuild
@@ -0,0 +1,346 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+# EAPI Version
+EAPI="6"
+
+#//------------------------------------------------------------------------------
+
+# Version Data
+GITDATE="20180705"			# Date of diff between kernel.org and lmo GIT
+GENPATCHREV="1"				# Tarball revision for patches
+
+# Directories
+S="${WORKDIR}/linux-${OKV}-${GITDATE}"
+MIPS_PATCHES="${WORKDIR}/mips-patches"
+
+# Kernel-2 Vars
+K_SECURITY_UNSUPPORTED="yes"
+K_NOUSENAME="yes"
+K_NOSETEXTRAVERSION="yes"
+K_NOUSEPR="yes"
+K_BASE_VER="4.16"
+K_FROM_GIT="yes"
+ETYPE="sources"
+
+# Inherit Eclasses
+inherit kernel-2 eutils eapi7-ver
+detect_version
+
+# Version Data
+F_KV="${PVR}"
+BASE_KV="$(ver_cut 1-2).0"
+[[ "${EXTRAVERSION}" = -rc* ]] && KVE="${EXTRAVERSION}"
+
+# Portage Vars
+HOMEPAGE="https://www.linux-mips.org/ https://www.gentoo.org/"
+KEYWORDS="-* ~mips"
+IUSE="experimental ip27 ip28 ip30"
+RDEPEND=""
+DEPEND="${RDEPEND}
+	>=sys-devel/gcc-4.7.0
+	>=sys-devel/patch-2.7.4"
+
+# Specify any patches or patch familes to NOT apply here.
+# Use only the 4-digit number followed by a '*'.
+P_EXCLUDE=""
+
+# Machine Support Control Variables
+DO_IP22="test"				# If "yes", enable IP22 support		(SGI Indy, Indigo2 R4x00)
+DO_IP27="yes"				# 		   IP27 support		(SGI Origin)
+DO_IP28="test"				# 		   IP28 support		(SGI Indigo2 Impact R10000)
+DO_IP30="yes"				# 		   IP30 support		(SGI Octane)
+DO_IP32="yes"				# 		   IP32 support		(SGI O2, R5000/RM5200 Only)
+
+# Machine Stable Version Variables
+SV_IP22=""				# If set && DO_IP22 == "no", indicates last "good" IP22 version
+SV_IP27=""				# 	    DO_IP27 == "no", 			   IP27
+SV_IP28=""				# 	    DO_IP28 == "no", 			   IP28
+SV_IP30=""				# 	    DO_IP30 == "no", 			   IP30
+SV_IP32=""				# 	    DO_IP32 == "no", 			   IP32
+
+DESCRIPTION="Linux-Mips GIT sources for MIPS-based machines, dated ${GITDATE}"
+SRC_URI="${KERNEL_URI}
+	 mirror://gentoo/mipsgit-${BASE_KV}${KVE}-${GITDATE}.diff.xz
+	 mirror://gentoo/${PN}-${BASE_KV}-patches-v${GENPATCHREV}.tar.xz"
+
+UNIPATCH_STRICTORDER="yes"
+UNIPATCH_LIST="${DISTDIR}/mipsgit-${BASE_KV}${KVE}-${GITDATE}.diff.xz"
+
+#//------------------------------------------------------------------------------
+
+err_disabled_mach() {
+	# Get args
+	local m_name="${1}"
+	local m_abbr="${2}"
+	local m_use="${3}"
+	local is_test="${4}"
+
+	# Get stable version, if exists
+	local stable_ver="SV_${m_abbr}"
+	stable_ver="${!stable_ver}"
+
+	# See if this machine needs a USE passed or skip dying
+	local has_use
+	[ ! -z "${m_use}" -a "${m_use}" != "skip" ] && has_use="USE=\"${m_use}\" "
+
+	# Print error && (maybe) die
+	echo -e ""
+	if [ "${is_test}" != "test" ]; then
+		eerror "${m_name} Support has been disabled in this ebuild"
+		eerror "revision.  If you wish to merge ${m_name} sources, then"
+		eerror "run ${has_use}emerge =mips-sources-${stable_ver}"
+		[ "${m_use}" != "skip" ] && die "${m_name} Support disabled."
+	else
+		ewarn "${m_name} Support has been marked as needing testing in this"
+		ewarn "ebuild revision.  This usually means that any patches to support"
+		ewarn "${m_name} have been forward ported and maybe even compile-tested,"
+		ewarn "but not yet booted on real hardware, possibly due to a lack of access"
+		ewarn "to such hardware.  If you happen to boot this kernel and have no"
+		ewarn "problems at all, then please inform the maintainer.  Otherwise, if"
+		ewarn "experience a bug, an oops/panic, or some other oddity, then please"
+		ewarn "file a bug at bugs.gentoo.org, and assign it to the mips team."
+	fi
+
+	return 0
+}
+
+err_only_one_mach_allowed() {
+	echo -e ""
+	eerror "A patchset for a specific machine-type has already been selected."
+	eerror "No other patches for machines-types are permitted.  You will need a"
+	eerror "separate copy of the kernel sources for each different machine-type"
+	eerror "you want to build a kernel for."
+	die "Only one machine-type patchset allowed"
+}
+
+pkg_postinst() {
+	# Symlink /usr/src/linux as appropriate
+	local my_ksrc="${S##*/}"
+	for x in {ip27,ip28,ip30}; do
+		use ${x} && my_ksrc="${my_ksrc}.${x}"
+	done
+
+	if [ ! -e "${ROOT}usr/src/linux" ]; then
+		rm -f "${ROOT}usr/src/linux"
+		ln -sf "${my_ksrc}" "${ROOT}/usr/src/linux"
+	fi
+}
+
+pkg_setup() {
+	local arch_is_selected="no"
+	local m_ip m_enable m_name
+
+	# Exclusive machine patchsets
+	# These are not allowed to be mixed together, thus only one of them may be applied
+	# to a tree per merge.
+	for x in									\
+		"ip27 SGI Origin 200/2000"						\
+		"ip28 SGI Indigo2 Impact R10000"					\
+		"ip30 SGI Octane"
+	do
+		set -- ${x}		# Set positional params
+		m_ip="${1}"		# Grab the first param (HW IP for SGI)
+		shift			# Shift the positions
+		m_name="${*}"		# Get the rest (Name)
+
+		if use ${m_ip}; then
+			# Fetch the value indiciating if the machine is enabled or not
+			m_enable="DO_${m_ip/ip/IP}"
+			m_enable="${!m_enable}"
+
+			# Make sure only one of these exclusive machine patches is selected
+			[ "${arch_is_selected}" = "no" ]				\
+				&& arch_is_selected="yes"				\
+				|| err_only_one_mach_allowed
+
+			# Is the machine support disabled or marked as needing testing?
+			[ "${m_enable}" = "test" ]					\
+				&& err_disabled_mach "${m_name}" "${m_ip/ip/IP}" "${m_ip}" "test"
+			[ "${m_enable}" = "no" ]					\
+				&& err_disabled_mach "${m_name}" "${m_ip/ip/IP}" "${m_ip}"
+
+			# Show relevant information about the machine
+			show_${m_ip}_info
+		fi
+	done
+
+	# All other systems that don't have a USE flag go here
+	# These systems have base-line support included in linux-mips git, so
+	# instead of failing, if disabled, we simply warn the user
+	if [ "${arch_is_selected}" = "no" ]; then
+		[ "${DO_IP22}" = "no" ]							\
+			&& err_disabled_mach "SGI Indy/Indigo2 R4x00" "IP22" "skip"	\
+			|| show_ip22_info
+		[ "${DO_IP32}" = "no" ]							\
+			&& err_disabled_mach "SGI O2" "IP32" "skip"			\
+			|| show_ip32_info
+
+	fi
+}
+
+show_ip22_info() {
+	echo -e ""
+	einfo "IP22 systems with an R5000 processor should work with this release."
+	einfo "The R4x00 series of processors tend to be rather flaky, especially the"
+	einfo "R4600.  If you have to run an R4x00 processor, then try to use an R4400."
+	einfo ""
+	einfo "Some Notes:"
+	einfo "\t- Supported graphics card right now is Newport (XL)."
+	einfo "\t- A driver for Extreme (XZ) does not exist at present."
+	echo -e ""
+}
+
+show_ip27_info() {
+	echo -e ""
+	ewarn "Heavy disk I/O on recent kernels may randomly trigger a VM_BUG_ON_PAGE()"
+	ewarn "in move_freepages() in mm/page_alloc.c.  The exact trigger cause is"
+	ewarn "unknown at this time.  Please report any oops messages from this"
+	ewarn "bug to bugs.gentoo.org (assign to mips@gentoo.org)"
+	echo -e ""
+}
+
+show_ip28_info() {
+	echo -e ""
+	einfo "Support for the Indigo2 Impact R10000 is now in the mainline kernel.  However,"
+	einfo "due to the R10000 Speculative Execution issue that exists with this machine,"
+	einfo "nothing is guaranteed to work correctly.  Consider enabling ${HILITE}CONFIG_KALLSYMS${NORMAL}"
+	einfo "in your kernel so that if the machine Oopes, you'll be able to provide valuable"
+	einfo "feedback that can be used to trace down the crash."
+	echo -e ""
+}
+
+show_ip30_info() {
+	echo -e ""
+	eerror "Things that DON'T work:"
+	eerror "\t- Do not use CONFIG_SLUB, otherwise, you'll get errors when booting"
+	eerror "\t\040\040regarding duplicate /sys/kernel/slab/* entries in sysfs."
+	eerror "\t- Impact (MGRAS) Xorg driver no longer functions due to severe bitrot."
+	eerror "\t- Octane is limited to a maximum of 2GB of memory right now due to a"
+	eerror "\t\040\040hardware quirk in the BRIDGE PCI chip that limits BRIDGE DMA"
+	eerror "\t\040\040addresses to 31-bits when converted into physical addresses."
+	eerror "\t\040\040Patches that attempt to fix the issue are highly welcome."
+	echo -e ""
+	ewarn "Things that might work, but have problems, or are unknown:"
+	ewarn "\t- CONFIG_TRANSPARENT_HUGEPAGE should work now, but there may still be"
+	ewarn "\t\040\040intermittent issues.  Additionally, CONFIG_HUGETLBFS must also be"
+	ewarn "\t\040\040selected for hugepages to work.  If use of this feature continues"
+	ewarn "\t\040\040to trigger random Instruction Bus Errors (IBEs), then it is best to"
+	ewarn "\t\040\040disable the functionality and perform a cold reset of the machine"
+	ewarn "\t\040\040after powering it down for at least 30 seconds."
+	ewarn "\t- Serial support on the Octane uses a very basic UART driver that drives"
+	ewarn "\t\040\040the 16550A chip on the IOC3 directly.  It does not use interrupts,"
+	ewarn "\t\040\040only a polling routine on a timer, which makes it slow and CPU-"
+	ewarn "\t\040\040intensive.  The baud rate is limited to no more than 38.4kbps on"
+	ewarn "\t\040\040this driver.  Patches for getting the Altix IOC3 serial driver to"
+	ewarn "\t\040\040work (which uses DMA and supports faster baud rates) are welcome."
+	ewarn "\t- UHCI Cards are known to have issues, but should still function."
+	ewarn "\t\040\040This issue primarily manifests itself when using pl2303 USB->Serial"
+	ewarn "\t\040\040adapters."
+	ewarn "\t- MENET boards appear to have the four ethernet ports detected, however"
+	ewarn "\t\040\040the six serial ports don't appear to get picked up by the IOC3"
+	ewarn "\t\040\040UART driver.  The NIC part number is also not read correctly"
+	ewarn "\t\040\040from the four Number-In-a-Cans.  Additional testing would be"
+	ewarn "\t\040\040appreciated and patches welcome."
+	ewarn "\t- Other XIO-based devices, like various Impact addons, remain untested"
+	ewarn "\t\040\040and are not guaranteed to work.  This applies to various digital"
+	ewarn "\t\040\040video conversion boards as well."
+	echo -e ""
+	einfo "Things that DO work:"
+	einfo "\t- SMP works again, celebrate!"
+	einfo "\t- Impact (MGRAS) console only."
+	einfo "\t- VPro (Odyssey) console only (no X driver exists yet)."
+	einfo "\t- PCI Card Cages should work for many devices, except certain types like"
+	einfo "\t\040\040PCI-to-PCI bridges (USB hubs, USB flash card readers for example)."
+	einfo "\t- SCSI, RTC, basic PCI, IOC3 Ethernet, keyboard, and mouse.  Please"
+	einfo "\t\040\040report any problems with these devices."
+	echo -e ""
+}
+
+show_ip32_info() {
+	echo -e ""
+	einfo "IP32 systems function well, however there are some notes:"
+	einfo "\t- A sound driver now exists for IP32.  Celebrate!"
+	einfo "\t- Framebuffer console is limited to 4MB.  Anything greater"
+	einfo "\t\040\040specified when building the kernel will likely oops"
+	einfo "\t\040\040or panic the kernel."
+	einfo "\t- X support is limited to the generic fbdev driver.  No X"
+	einfo "\t\040\040gbefb driver exists for O2 yet.  Feel free to submit"
+	einfo "\t\040\040patches!"
+	echo -e ""
+
+	einfo "To Build 64bit kernels for SGI O2 (IP32) or SGI Indy/Indigo2 R4x00 (IP22)"
+	einfo "systems, you need to use the ${GOOD}vmlinux.32${NORMAL} make target."
+	einfo "Once done, boot the ${GOOD}vmlinux.32${NORMAL} file (NOT vmlinux)."
+}
+
+src_unpack() {
+	# Unpack the kernel sources, update to the latest rev (if needed),
+	# and apply the latest patch from linux-mips git.
+	kernel-2_src_unpack
+
+	# Unpack the mips-sources patchset to ${WORKDIR}/mips-patches-${BASE_KV}.
+	echo -e ""
+	cd "${WORKDIR}"
+	unpack "${PN}-${BASE_KV}-patches-v${GENPATCHREV}.tar.xz"
+
+	# Create a new folder called 'patch-symlinks' and create symlinks to
+	# all mips-patches in there.  If we want to exclude a patch, we'll
+	# just delete the symlink instead of the actual patch.
+	local psym="patch-symlinks"
+	mkdir "${psym}"
+	cd "${psym}"
+	for x in ../mips-patches-${BASE_KV}/*.patch; do
+		ln -s "${x}" "${x##../mips-patches-*/}"
+	done
+
+	# With symlinks created, setup the variables referencing external
+	# machine patches and if a machine USE flag is enabled, then unset
+	# its corresponding variable.
+	# See 0000_README for the patch numbers and their meanings.
+	local p_generic="51*"
+	local p_ip27="52*" p_ip28="53*" p_ip30="54*"
+	local p_xp="80*"
+	use ip27 && unset p_generic p_ip27
+	use ip28 && unset p_ip28
+	use ip30 && unset p_generic p_ip30
+	use experimental && unset p_xp
+
+	# Remove symlinks for any patches that we don't want applied.  We
+	# do this by looping through all the above variables, and deleting
+	# matching symlinks that point to the corresponding patches.
+	# The remaining symlinks will be applied to the kernel source.
+	#
+	# $P_EXCLUDE is a new var that can be set in an ebuild to exclude
+	# specific patches by wildcarding the patch number.
+	local patchlist="${p_generic} ${p_ip27} ${p_ip28} ${p_ip30} ${p_xp} ${P_EXCLUDE}"
+	for x in $patchlist;
+		do rm -f "./${x}"
+	done
+
+	# Rename the source tree to match the linux-mips git checkout date and
+	# machine type.
+	local fkv="${F_KV%-*}"
+	local v="${fkv}-${GITDATE}"
+	for x in {ip27,ip28,ip30}; do
+		use ${x} && v="${v}.${x}" && break
+	done
+	mv "${WORKDIR}/linux-${fkv/_/-}" "${WORKDIR}/linux-${v}" || die
+	S="${WORKDIR}/linux-${v}"
+
+	# Set the EXTRAVERSION to linux-VERSION-mipsgit-GITDATE
+	EXTRAVERSION="${EXTRAVERSION}-mipsgit-${GITDATE}"
+	unpack_set_extraversion
+}
+
+src_prepare() {
+	local psym="patch-symlinks"
+
+	# Now go into the kernel source and patch it.
+	cd "${S}"
+	epatch -p1 "${WORKDIR}/${psym}"/*.patch
+
+	eapply_user
+}
+
+#//------------------------------------------------------------------------------

diff --git a/sys-kernel/mips-sources/mips-sources-4.4.152.ebuild b/sys-kernel/mips-sources/mips-sources-4.4.152.ebuild
new file mode 100644
index 0000000..9d25a5d
--- /dev/null
+++ b/sys-kernel/mips-sources/mips-sources-4.4.152.ebuild
@@ -0,0 +1,350 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+# EAPI Version
+EAPI="6"
+
+#//------------------------------------------------------------------------------
+
+# Version Data
+GITDATE="20160123"			# Date of diff between kernel.org and lmo GIT
+GENPATCHREV="2"				# Tarball revision for patches
+
+# Directories
+S="${WORKDIR}/linux-${OKV}-${GITDATE}"
+MIPS_PATCHES="${WORKDIR}/mips-patches"
+
+# Kernel-2 Vars
+K_SECURITY_UNSUPPORTED="yes"
+K_NOUSENAME="yes"
+K_NOSETEXTRAVERSION="yes"
+K_NOUSEPR="yes"
+K_BASE_VER="4.3"
+K_FROM_GIT="yes"
+ETYPE="sources"
+
+# Inherit Eclasses
+inherit kernel-2 eutils eapi7-ver
+detect_version
+
+# EPATCH Vars
+# XXX: Required to properly apply Impact/Odyssey driver patches.
+EPATCH_OPTS="-F3"
+
+# Version Data
+F_KV="${PVR}"
+BASE_KV="$(ver_cut 1-2).0"
+[[ "${EXTRAVERSION}" = -rc* ]] && KVE="${EXTRAVERSION}"
+
+# Portage Vars
+HOMEPAGE="https://www.linux-mips.org/ https://www.gentoo.org/"
+KEYWORDS="-* ~mips"
+IUSE="experimental ip27 ip28 ip30"
+RDEPEND=""
+DEPEND="${RDEPEND}
+	>=sys-devel/gcc-4.7.0
+	>=sys-devel/patch-2.7.4"
+
+# Specify any patches or patch familes to NOT apply here.
+# Use only the 4-digit number followed by a '*'.
+P_EXCLUDE=""
+
+# Machine Support Control Variables
+DO_IP22="test"				# If "yes", enable IP22 support		(SGI Indy, Indigo2 R4x00)
+DO_IP27="yes"				# 		   IP27 support		(SGI Origin)
+DO_IP28="test"				# 		   IP28 support		(SGI Indigo2 Impact R10000)
+DO_IP30="yes"				# 		   IP30 support		(SGI Octane)
+DO_IP32="yes"				# 		   IP32 support		(SGI O2, R5000/RM5200 Only)
+
+# Machine Stable Version Variables
+SV_IP22=""				# If set && DO_IP22 == "no", indicates last "good" IP22 version
+SV_IP27=""				# 	    DO_IP27 == "no", 			   IP27
+SV_IP28=""				# 	    DO_IP28 == "no", 			   IP28
+SV_IP30=""				# 	    DO_IP30 == "no", 			   IP30
+SV_IP32=""				# 	    DO_IP32 == "no", 			   IP32
+
+DESCRIPTION="Linux-Mips GIT sources for MIPS-based machines, dated ${GITDATE}"
+SRC_URI="${KERNEL_URI}
+	 mirror://gentoo/mipsgit-${BASE_KV}${KVE}-${GITDATE}.diff.xz
+	 mirror://gentoo/${PN}-${BASE_KV}-patches-v${GENPATCHREV}.tar.xz"
+
+UNIPATCH_STRICTORDER="yes"
+UNIPATCH_LIST="${DISTDIR}/mipsgit-${BASE_KV}${KVE}-${GITDATE}.diff.xz"
+
+#//------------------------------------------------------------------------------
+
+err_disabled_mach() {
+	# Get args
+	local m_name="${1}"
+	local m_abbr="${2}"
+	local m_use="${3}"
+	local is_test="${4}"
+
+	# Get stable version, if exists
+	local stable_ver="SV_${m_abbr}"
+	stable_ver="${!stable_ver}"
+
+	# See if this machine needs a USE passed or skip dying
+	local has_use
+	[ ! -z "${m_use}" -a "${m_use}" != "skip" ] && has_use="USE=\"${m_use}\" "
+
+	# Print error && (maybe) die
+	echo -e ""
+	if [ "${is_test}" != "test" ]; then
+		eerror "${m_name} Support has been disabled in this ebuild"
+		eerror "revision.  If you wish to merge ${m_name} sources, then"
+		eerror "run ${has_use}emerge =mips-sources-${stable_ver}"
+		[ "${m_use}" != "skip" ] && die "${m_name} Support disabled."
+	else
+		ewarn "${m_name} Support has been marked as needing testing in this"
+		ewarn "ebuild revision.  This usually means that any patches to support"
+		ewarn "${m_name} have been forward ported and maybe even compile-tested,"
+		ewarn "but not yet booted on real hardware, possibly due to a lack of access"
+		ewarn "to such hardware.  If you happen to boot this kernel and have no"
+		ewarn "problems at all, then please inform the maintainer.  Otherwise, if"
+		ewarn "experience a bug, an oops/panic, or some other oddity, then please"
+		ewarn "file a bug at bugs.gentoo.org, and assign it to the mips team."
+	fi
+
+	return 0
+}
+
+err_only_one_mach_allowed() {
+	echo -e ""
+	eerror "A patchset for a specific machine-type has already been selected."
+	eerror "No other patches for machines-types are permitted.  You will need a"
+	eerror "separate copy of the kernel sources for each different machine-type"
+	eerror "you want to build a kernel for."
+	die "Only one machine-type patchset allowed"
+}
+
+pkg_postinst() {
+	# Symlink /usr/src/linux as appropriate
+	local my_ksrc="${S##*/}"
+	for x in {ip27,ip28,ip30}; do
+		use ${x} && my_ksrc="${my_ksrc}.${x}"
+	done
+
+	if [ ! -e "${ROOT}usr/src/linux" ]; then
+		rm -f "${ROOT}usr/src/linux"
+		ln -sf "${my_ksrc}" "${ROOT}/usr/src/linux"
+	fi
+}
+
+pkg_setup() {
+	local arch_is_selected="no"
+	local m_ip m_enable m_name
+
+	# Exclusive machine patchsets
+	# These are not allowed to be mixed together, thus only one of them may be applied
+	# to a tree per merge.
+	for x in									\
+		"ip27 SGI Origin 200/2000"						\
+		"ip28 SGI Indigo2 Impact R10000"					\
+		"ip30 SGI Octane"
+	do
+		set -- ${x}		# Set positional params
+		m_ip="${1}"		# Grab the first param (HW IP for SGI)
+		shift			# Shift the positions
+		m_name="${*}"		# Get the rest (Name)
+
+		if use ${m_ip}; then
+			# Fetch the value indiciating if the machine is enabled or not
+			m_enable="DO_${m_ip/ip/IP}"
+			m_enable="${!m_enable}"
+
+			# Make sure only one of these exclusive machine patches is selected
+			[ "${arch_is_selected}" = "no" ]				\
+				&& arch_is_selected="yes"				\
+				|| err_only_one_mach_allowed
+
+			# Is the machine support disabled or marked as needing testing?
+			[ "${m_enable}" = "test" ]					\
+				&& err_disabled_mach "${m_name}" "${m_ip/ip/IP}" "${m_ip}" "test"
+			[ "${m_enable}" = "no" ]					\
+				&& err_disabled_mach "${m_name}" "${m_ip/ip/IP}" "${m_ip}"
+
+			# Show relevant information about the machine
+			show_${m_ip}_info
+		fi
+	done
+
+	# All other systems that don't have a USE flag go here
+	# These systems have base-line support included in linux-mips git, so
+	# instead of failing, if disabled, we simply warn the user
+	if [ "${arch_is_selected}" = "no" ]; then
+		[ "${DO_IP22}" = "no" ]							\
+			&& err_disabled_mach "SGI Indy/Indigo2 R4x00" "IP22" "skip"	\
+			|| show_ip22_info
+		[ "${DO_IP32}" = "no" ]							\
+			&& err_disabled_mach "SGI O2" "IP32" "skip"			\
+			|| show_ip32_info
+
+	fi
+}
+
+show_ip22_info() {
+	echo -e ""
+	einfo "IP22 systems with an R5000 processor should work with this release."
+	einfo "The R4x00 series of processors tend to be rather flaky, especially the"
+	einfo "R4600.  If you have to run an R4x00 processor, then try to use an R4400."
+	einfo ""
+	einfo "Some Notes:"
+	einfo "\t- Supported graphics card right now is Newport (XL)."
+	einfo "\t- A driver for Extreme (XZ) does not exist at present."
+	echo -e ""
+}
+
+show_ip27_info() {
+	echo -e ""
+	ewarn "Heavy disk I/O on recent kernels may randomly trigger a VM_BUG_ON_PAGE()"
+	ewarn "in move_freepages() in mm/page_alloc.c.  The exact trigger cause is"
+	ewarn "unknown at this time.  Please report any oops messages from this"
+	ewarn "bug to bugs.gentoo.org (assign to mips@gentoo.org)"
+	echo -e ""
+}
+
+show_ip28_info() {
+	echo -e ""
+	einfo "Support for the Indigo2 Impact R10000 is now in the mainline kernel.  However,"
+	einfo "due to the R10000 Speculative Execution issue that exists with this machine,"
+	einfo "nothing is guaranteed to work correctly.  Consider enabling ${HILITE}CONFIG_KALLSYMS${NORMAL}"
+	einfo "in your kernel so that if the machine Oopes, you'll be able to provide valuable"
+	einfo "feedback that can be used to trace down the crash."
+	echo -e ""
+}
+
+show_ip30_info() {
+	echo -e ""
+	eerror "Things that DON'T work:"
+	eerror "\t- Do not use CONFIG_SLUB, otherwise, you'll get errors when booting"
+	eerror "\t\040\040regarding duplicate /sys/kernel/slab/* entries in sysfs."
+	eerror "\t- Impact (MGRAS) Xorg driver no longer functions due to severe bitrot."
+	eerror "\t- Octane is limited to a maximum of 2GB of memory right now due to a"
+	eerror "\t\040\040hardware quirk in the BRIDGE PCI chip that limits BRIDGE DMA"
+	eerror "\t\040\040addresses to 31-bits when converted into physical addresses."
+	eerror "\t\040\040Patches that attempt to fix the issue are highly welcome."
+	echo -e ""
+	ewarn "Things that might work, but have problems, or are unknown:"
+	ewarn "\t- CONFIG_TRANSPARENT_HUGEPAGE should work now, but there may still be"
+	ewarn "\t\040\040intermittent issues.  Additionally, CONFIG_HUGETLBFS must also be"
+	ewarn "\t\040\040selected for hugepages to work.  If use of this feature continues"
+	ewarn "\t\040\040to trigger random Instruction Bus Errors (IBEs), then it is best to"
+	ewarn "\t\040\040disable the functionality and perform a cold reset of the machine"
+	ewarn "\t\040\040after powering it down for at least 30 seconds."
+	ewarn "\t- Serial support on the Octane uses a very basic UART driver that drives"
+	ewarn "\t\040\040the 16550A chip on the IOC3 directly.  It does not use interrupts,"
+	ewarn "\t\040\040only a polling routine on a timer, which makes it slow and CPU-"
+	ewarn "\t\040\040intensive.  The baud rate is limited to no more than 38.4kbps on"
+	ewarn "\t\040\040this driver.  Patches for getting the Altix IOC3 serial driver to"
+	ewarn "\t\040\040work (which uses DMA and supports faster baud rates) are welcome."
+	ewarn "\t- UHCI Cards are known to have issues, but should still function."
+	ewarn "\t\040\040This issue primarily manifests itself when using pl2303 USB->Serial"
+	ewarn "\t\040\040adapters."
+	ewarn "\t- MENET boards appear to have the four ethernet ports detected, however"
+	ewarn "\t\040\040the six serial ports don't appear to get picked up by the IOC3"
+	ewarn "\t\040\040UART driver.  The NIC part number is also not read correctly"
+	ewarn "\t\040\040from the four Number-In-a-Cans.  Additional testing would be"
+	ewarn "\t\040\040appreciated and patches welcome."
+	ewarn "\t- Other XIO-based devices, like various Impact addons, remain untested"
+	ewarn "\t\040\040and are not guaranteed to work.  This applies to various digital"
+	ewarn "\t\040\040video conversion boards as well."
+	echo -e ""
+	einfo "Things that DO work:"
+	einfo "\t- SMP works again, celebrate!"
+	einfo "\t- Impact (MGRAS) console only."
+	einfo "\t- VPro (Odyssey) console only (no X driver exists yet)."
+	einfo "\t- PCI Card Cages should work for many devices, except certain types like"
+	einfo "\t\040\040PCI-to-PCI bridges (USB hubs, USB flash card readers for example)."
+	einfo "\t- SCSI, RTC, basic PCI, IOC3 Ethernet, keyboard, and mouse.  Please"
+	einfo "\t\040\040report any problems with these devices."
+	echo -e ""
+}
+
+show_ip32_info() {
+	echo -e ""
+	einfo "IP32 systems function well, however there are some notes:"
+	einfo "\t- A sound driver now exists for IP32.  Celebrate!"
+	einfo "\t- Framebuffer console is limited to 4MB.  Anything greater"
+	einfo "\t\040\040specified when building the kernel will likely oops"
+	einfo "\t\040\040or panic the kernel."
+	einfo "\t- X support is limited to the generic fbdev driver.  No X"
+	einfo "\t\040\040gbefb driver exists for O2 yet.  Feel free to submit"
+	einfo "\t\040\040patches!"
+	echo -e ""
+
+	einfo "To Build 64bit kernels for SGI O2 (IP32) or SGI Indy/Indigo2 R4x00 (IP22)"
+	einfo "systems, you need to use the ${GOOD}vmlinux.32${NORMAL} make target."
+	einfo "Once done, boot the ${GOOD}vmlinux.32${NORMAL} file (NOT vmlinux)."
+}
+
+src_unpack() {
+	# Unpack the kernel sources, update to the latest rev (if needed),
+	# and apply the latest patch from linux-mips git.
+	kernel-2_src_unpack
+
+	# Unpack the mips-sources patchset to ${WORKDIR}/mips-patches-${BASE_KV}.
+	echo -e ""
+	cd "${WORKDIR}"
+	unpack "${PN}-${BASE_KV}-patches-v${GENPATCHREV}.tar.xz"
+
+	# Create a new folder called  'patch-symlinks' and create symlinks to
+	# all mips-patches in there.  If we want to exclude a patch, we'll
+	# just delete the symlink instead of the actual patch.
+	local psym="patch-symlinks"
+	mkdir "${psym}"
+	cd "${psym}"
+	for x in ../mips-patches-${BASE_KV}/*.patch; do
+		ln -s "${x}" "${x##../mips-patches-*/}"
+	done
+
+	# With symlinks created, setup the variables referencing external
+	# machine patches and if a machine USE flag is enabled, then unset
+	# its corresponding variable.
+	# See 0000_README for the patch numbers and their meanings.
+	local p_generic="51*"
+	local p_ip27="52*" p_ip28="53*" p_ip30="54*"
+	local p_xp="80*"
+	use ip27 && unset p_generic p_ip27
+	use ip28 && unset p_ip28
+	use ip30 && unset p_generic p_ip30
+	use experimental && unset p_xp
+
+	# Remove symlinks for any patches that we don't want applied.  We
+	# do this by looping through all the above variables, and deleting
+	# matching symlinks that point to the corresponding patches.
+	# The remaining symlinks will be applied to the kernel source.
+	#
+	# $P_EXCLUDE is a new var that can be set in an ebuild to exclude
+	# specific patches by wildcarding the patch number.
+	local patchlist="${p_generic} ${p_ip27} ${p_ip28} ${p_ip30} ${p_xp} ${P_EXCLUDE}"
+	for x in $patchlist;
+		do rm -f "./${x}"
+	done
+
+	# Rename the source tree to match the linux-mips git checkout date and
+	# machine type.
+	local fkv="${F_KV%-*}"
+	local v="${fkv}-${GITDATE}"
+	for x in {ip27,ip28,ip30}; do
+		use ${x} && v="${v}.${x}" && break
+	done
+	mv "${WORKDIR}/linux-${fkv/_/-}" "${WORKDIR}/linux-${v}" || die
+	S="${WORKDIR}/linux-${v}"
+
+	# Set the EXTRAVERSION to linux-VERSION-mipsgit-GITDATE
+	EXTRAVERSION="${EXTRAVERSION}-mipsgit-${GITDATE}"
+	unpack_set_extraversion
+}
+
+src_prepare() {
+	local psym="patch-symlinks"
+
+	# Now go into the kernel source and patch it.
+	cd "${S}"
+	epatch "${WORKDIR}/${psym}"/*.patch
+
+	eapply_user
+}
+
+#//------------------------------------------------------------------------------

diff --git a/sys-kernel/mips-sources/mips-sources-4.9.124.ebuild b/sys-kernel/mips-sources/mips-sources-4.9.124.ebuild
new file mode 100644
index 0000000..3670893
--- /dev/null
+++ b/sys-kernel/mips-sources/mips-sources-4.9.124.ebuild
@@ -0,0 +1,346 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+# EAPI Version
+EAPI="6"
+
+#//------------------------------------------------------------------------------
+
+# Version Data
+GITDATE="20161216"			# Date of diff between kernel.org and lmo GIT
+GENPATCHREV="1"				# Tarball revision for patches
+
+# Directories
+S="${WORKDIR}/linux-${OKV}-${GITDATE}"
+MIPS_PATCHES="${WORKDIR}/mips-patches"
+
+# Kernel-2 Vars
+K_SECURITY_UNSUPPORTED="yes"
+K_NOUSENAME="yes"
+K_NOSETEXTRAVERSION="yes"
+K_NOUSEPR="yes"
+K_BASE_VER="4.8"
+K_FROM_GIT="yes"
+ETYPE="sources"
+
+# Inherit Eclasses
+inherit kernel-2 eutils eapi7-ver
+detect_version
+
+# Version Data
+F_KV="${PVR}"
+BASE_KV="$(ver_cut 1-2).0"
+[[ "${EXTRAVERSION}" = -rc* ]] && KVE="${EXTRAVERSION}"
+
+# Portage Vars
+HOMEPAGE="https://www.linux-mips.org/ https://www.gentoo.org/"
+KEYWORDS="-* ~mips"
+IUSE="experimental ip27 ip28 ip30"
+RDEPEND=""
+DEPEND="${RDEPEND}
+	>=sys-devel/gcc-4.7.0
+	>=sys-devel/patch-2.7.4"
+
+# Specify any patches or patch familes to NOT apply here.
+# Use only the 4-digit number followed by a '*'.
+P_EXCLUDE=""
+
+# Machine Support Control Variables
+DO_IP22="test"				# If "yes", enable IP22 support		(SGI Indy, Indigo2 R4x00)
+DO_IP27="yes"				# 		   IP27 support		(SGI Origin)
+DO_IP28="test"				# 		   IP28 support		(SGI Indigo2 Impact R10000)
+DO_IP30="yes"				# 		   IP30 support		(SGI Octane)
+DO_IP32="yes"				# 		   IP32 support		(SGI O2, R5000/RM5200 Only)
+
+# Machine Stable Version Variables
+SV_IP22=""				# If set && DO_IP22 == "no", indicates last "good" IP22 version
+SV_IP27=""				# 	    DO_IP27 == "no", 			   IP27
+SV_IP28=""				# 	    DO_IP28 == "no", 			   IP28
+SV_IP30=""				# 	    DO_IP30 == "no", 			   IP30
+SV_IP32=""				# 	    DO_IP32 == "no", 			   IP32
+
+DESCRIPTION="Linux-Mips GIT sources for MIPS-based machines, dated ${GITDATE}"
+SRC_URI="${KERNEL_URI}
+	 mirror://gentoo/mipsgit-${BASE_KV}${KVE}-${GITDATE}.diff.xz
+	 mirror://gentoo/${PN}-${BASE_KV}-patches-v${GENPATCHREV}.tar.xz"
+
+UNIPATCH_STRICTORDER="yes"
+UNIPATCH_LIST="${DISTDIR}/mipsgit-${BASE_KV}${KVE}-${GITDATE}.diff.xz"
+
+#//------------------------------------------------------------------------------
+
+err_disabled_mach() {
+	# Get args
+	local m_name="${1}"
+	local m_abbr="${2}"
+	local m_use="${3}"
+	local is_test="${4}"
+
+	# Get stable version, if exists
+	local stable_ver="SV_${m_abbr}"
+	stable_ver="${!stable_ver}"
+
+	# See if this machine needs a USE passed or skip dying
+	local has_use
+	[ ! -z "${m_use}" -a "${m_use}" != "skip" ] && has_use="USE=\"${m_use}\" "
+
+	# Print error && (maybe) die
+	echo -e ""
+	if [ "${is_test}" != "test" ]; then
+		eerror "${m_name} Support has been disabled in this ebuild"
+		eerror "revision.  If you wish to merge ${m_name} sources, then"
+		eerror "run ${has_use}emerge =mips-sources-${stable_ver}"
+		[ "${m_use}" != "skip" ] && die "${m_name} Support disabled."
+	else
+		ewarn "${m_name} Support has been marked as needing testing in this"
+		ewarn "ebuild revision.  This usually means that any patches to support"
+		ewarn "${m_name} have been forward ported and maybe even compile-tested,"
+		ewarn "but not yet booted on real hardware, possibly due to a lack of access"
+		ewarn "to such hardware.  If you happen to boot this kernel and have no"
+		ewarn "problems at all, then please inform the maintainer.  Otherwise, if"
+		ewarn "experience a bug, an oops/panic, or some other oddity, then please"
+		ewarn "file a bug at bugs.gentoo.org, and assign it to the mips team."
+	fi
+
+	return 0
+}
+
+err_only_one_mach_allowed() {
+	echo -e ""
+	eerror "A patchset for a specific machine-type has already been selected."
+	eerror "No other patches for machines-types are permitted.  You will need a"
+	eerror "separate copy of the kernel sources for each different machine-type"
+	eerror "you want to build a kernel for."
+	die "Only one machine-type patchset allowed"
+}
+
+pkg_postinst() {
+	# Symlink /usr/src/linux as appropriate
+	local my_ksrc="${S##*/}"
+	for x in {ip27,ip28,ip30}; do
+		use ${x} && my_ksrc="${my_ksrc}.${x}"
+	done
+
+	if [ ! -e "${ROOT}usr/src/linux" ]; then
+		rm -f "${ROOT}usr/src/linux"
+		ln -sf "${my_ksrc}" "${ROOT}/usr/src/linux"
+	fi
+}
+
+pkg_setup() {
+	local arch_is_selected="no"
+	local m_ip m_enable m_name
+
+	# Exclusive machine patchsets
+	# These are not allowed to be mixed together, thus only one of them may be applied
+	# to a tree per merge.
+	for x in									\
+		"ip27 SGI Origin 200/2000"						\
+		"ip28 SGI Indigo2 Impact R10000"					\
+		"ip30 SGI Octane"
+	do
+		set -- ${x}		# Set positional params
+		m_ip="${1}"		# Grab the first param (HW IP for SGI)
+		shift			# Shift the positions
+		m_name="${*}"		# Get the rest (Name)
+
+		if use ${m_ip}; then
+			# Fetch the value indiciating if the machine is enabled or not
+			m_enable="DO_${m_ip/ip/IP}"
+			m_enable="${!m_enable}"
+
+			# Make sure only one of these exclusive machine patches is selected
+			[ "${arch_is_selected}" = "no" ]				\
+				&& arch_is_selected="yes"				\
+				|| err_only_one_mach_allowed
+
+			# Is the machine support disabled or marked as needing testing?
+			[ "${m_enable}" = "test" ]					\
+				&& err_disabled_mach "${m_name}" "${m_ip/ip/IP}" "${m_ip}" "test"
+			[ "${m_enable}" = "no" ]					\
+				&& err_disabled_mach "${m_name}" "${m_ip/ip/IP}" "${m_ip}"
+
+			# Show relevant information about the machine
+			show_${m_ip}_info
+		fi
+	done
+
+	# All other systems that don't have a USE flag go here
+	# These systems have base-line support included in linux-mips git, so
+	# instead of failing, if disabled, we simply warn the user
+	if [ "${arch_is_selected}" = "no" ]; then
+		[ "${DO_IP22}" = "no" ]							\
+			&& err_disabled_mach "SGI Indy/Indigo2 R4x00" "IP22" "skip"	\
+			|| show_ip22_info
+		[ "${DO_IP32}" = "no" ]							\
+			&& err_disabled_mach "SGI O2" "IP32" "skip"			\
+			|| show_ip32_info
+
+	fi
+}
+
+show_ip22_info() {
+	echo -e ""
+	einfo "IP22 systems with an R5000 processor should work with this release."
+	einfo "The R4x00 series of processors tend to be rather flaky, especially the"
+	einfo "R4600.  If you have to run an R4x00 processor, then try to use an R4400."
+	einfo ""
+	einfo "Some Notes:"
+	einfo "\t- Supported graphics card right now is Newport (XL)."
+	einfo "\t- A driver for Extreme (XZ) does not exist at present."
+	echo -e ""
+}
+
+show_ip27_info() {
+	echo -e ""
+	ewarn "Heavy disk I/O on recent kernels may randomly trigger a VM_BUG_ON_PAGE()"
+	ewarn "in move_freepages() in mm/page_alloc.c.  The exact trigger cause is"
+	ewarn "unknown at this time.  Please report any oops messages from this"
+	ewarn "bug to bugs.gentoo.org (assign to mips@gentoo.org)"
+	echo -e ""
+}
+
+show_ip28_info() {
+	echo -e ""
+	einfo "Support for the Indigo2 Impact R10000 is now in the mainline kernel.  However,"
+	einfo "due to the R10000 Speculative Execution issue that exists with this machine,"
+	einfo "nothing is guaranteed to work correctly.  Consider enabling ${HILITE}CONFIG_KALLSYMS${NORMAL}"
+	einfo "in your kernel so that if the machine Oopes, you'll be able to provide valuable"
+	einfo "feedback that can be used to trace down the crash."
+	echo -e ""
+}
+
+show_ip30_info() {
+	echo -e ""
+	eerror "Things that DON'T work:"
+	eerror "\t- Do not use CONFIG_SLUB, otherwise, you'll get errors when booting"
+	eerror "\t\040\040regarding duplicate /sys/kernel/slab/* entries in sysfs."
+	eerror "\t- Impact (MGRAS) Xorg driver no longer functions due to severe bitrot."
+	eerror "\t- Octane is limited to a maximum of 2GB of memory right now due to a"
+	eerror "\t\040\040hardware quirk in the BRIDGE PCI chip that limits BRIDGE DMA"
+	eerror "\t\040\040addresses to 31-bits when converted into physical addresses."
+	eerror "\t\040\040Patches that attempt to fix the issue are highly welcome."
+	echo -e ""
+	ewarn "Things that might work, but have problems, or are unknown:"
+	ewarn "\t- CONFIG_TRANSPARENT_HUGEPAGE should work now, but there may still be"
+	ewarn "\t\040\040intermittent issues.  Additionally, CONFIG_HUGETLBFS must also be"
+	ewarn "\t\040\040selected for hugepages to work.  If use of this feature continues"
+	ewarn "\t\040\040to trigger random Instruction Bus Errors (IBEs), then it is best to"
+	ewarn "\t\040\040disable the functionality and perform a cold reset of the machine"
+	ewarn "\t\040\040after powering it down for at least 30 seconds."
+	ewarn "\t- Serial support on the Octane uses a very basic UART driver that drives"
+	ewarn "\t\040\040the 16550A chip on the IOC3 directly.  It does not use interrupts,"
+	ewarn "\t\040\040only a polling routine on a timer, which makes it slow and CPU-"
+	ewarn "\t\040\040intensive.  The baud rate is limited to no more than 38.4kbps on"
+	ewarn "\t\040\040this driver.  Patches for getting the Altix IOC3 serial driver to"
+	ewarn "\t\040\040work (which uses DMA and supports faster baud rates) are welcome."
+	ewarn "\t- UHCI Cards are known to have issues, but should still function."
+	ewarn "\t\040\040This issue primarily manifests itself when using pl2303 USB->Serial"
+	ewarn "\t\040\040adapters."
+	ewarn "\t- MENET boards appear to have the four ethernet ports detected, however"
+	ewarn "\t\040\040the six serial ports don't appear to get picked up by the IOC3"
+	ewarn "\t\040\040UART driver.  The NIC part number is also not read correctly"
+	ewarn "\t\040\040from the four Number-In-a-Cans.  Additional testing would be"
+	ewarn "\t\040\040appreciated and patches welcome."
+	ewarn "\t- Other XIO-based devices, like various Impact addons, remain untested"
+	ewarn "\t\040\040and are not guaranteed to work.  This applies to various digital"
+	ewarn "\t\040\040video conversion boards as well."
+	echo -e ""
+	einfo "Things that DO work:"
+	einfo "\t- SMP works again, celebrate!"
+	einfo "\t- Impact (MGRAS) console only."
+	einfo "\t- VPro (Odyssey) console only (no X driver exists yet)."
+	einfo "\t- PCI Card Cages should work for many devices, except certain types like"
+	einfo "\t\040\040PCI-to-PCI bridges (USB hubs, USB flash card readers for example)."
+	einfo "\t- SCSI, RTC, basic PCI, IOC3 Ethernet, keyboard, and mouse.  Please"
+	einfo "\t\040\040report any problems with these devices."
+	echo -e ""
+}
+
+show_ip32_info() {
+	echo -e ""
+	einfo "IP32 systems function well, however there are some notes:"
+	einfo "\t- A sound driver now exists for IP32.  Celebrate!"
+	einfo "\t- Framebuffer console is limited to 4MB.  Anything greater"
+	einfo "\t\040\040specified when building the kernel will likely oops"
+	einfo "\t\040\040or panic the kernel."
+	einfo "\t- X support is limited to the generic fbdev driver.  No X"
+	einfo "\t\040\040gbefb driver exists for O2 yet.  Feel free to submit"
+	einfo "\t\040\040patches!"
+	echo -e ""
+
+	einfo "To Build 64bit kernels for SGI O2 (IP32) or SGI Indy/Indigo2 R4x00 (IP22)"
+	einfo "systems, you need to use the ${GOOD}vmlinux.32${NORMAL} make target."
+	einfo "Once done, boot the ${GOOD}vmlinux.32${NORMAL} file (NOT vmlinux)."
+}
+
+src_unpack() {
+	# Unpack the kernel sources, update to the latest rev (if needed),
+	# and apply the latest patch from linux-mips git.
+	kernel-2_src_unpack
+
+	# Unpack the mips-sources patchset to ${WORKDIR}/mips-patches-${BASE_KV}.
+	echo -e ""
+	cd "${WORKDIR}"
+	unpack "${PN}-${BASE_KV}-patches-v${GENPATCHREV}.tar.xz"
+
+	# Create a new folder called  'patch-symlinks' and create symlinks to
+	# all mips-patches in there.  If we want to exclude a patch, we'll
+	# just delete the symlink instead of the actual patch.
+	local psym="patch-symlinks"
+	mkdir "${psym}"
+	cd "${psym}"
+	for x in ../mips-patches-${BASE_KV}/*.patch; do
+		ln -s "${x}" "${x##../mips-patches-*/}"
+	done
+
+	# With symlinks created, setup the variables referencing external
+	# machine patches and if a machine USE flag is enabled, then unset
+	# its corresponding variable.
+	# See 0000_README for the patch numbers and their meanings.
+	local p_generic="51*"
+	local p_ip27="52*" p_ip28="53*" p_ip30="54*"
+	local p_xp="80*"
+	use ip27 && unset p_generic p_ip27
+	use ip28 && unset p_ip28
+	use ip30 && unset p_generic p_ip30
+	use experimental && unset p_xp
+
+	# Remove symlinks for any patches that we don't want applied.  We
+	# do this by looping through all the above variables, and deleting
+	# matching symlinks that point to the corresponding patches.
+	# The remaining symlinks will be applied to the kernel source.
+	#
+	# $P_EXCLUDE is a new var that can be set in an ebuild to exclude
+	# specific patches by wildcarding the patch number.
+	local patchlist="${p_generic} ${p_ip27} ${p_ip28} ${p_ip30} ${p_xp} ${P_EXCLUDE}"
+	for x in $patchlist;
+		do rm -f "./${x}"
+	done
+
+	# Rename the source tree to match the linux-mips git checkout date and
+	# machine type.
+	local fkv="${F_KV%-*}"
+	local v="${fkv}-${GITDATE}"
+	for x in {ip27,ip28,ip30}; do
+		use ${x} && v="${v}.${x}" && break
+	done
+	mv "${WORKDIR}/linux-${fkv/_/-}" "${WORKDIR}/linux-${v}" || die
+	S="${WORKDIR}/linux-${v}"
+
+	# Set the EXTRAVERSION to linux-VERSION-mipsgit-GITDATE
+	EXTRAVERSION="${EXTRAVERSION}-mipsgit-${GITDATE}"
+	unpack_set_extraversion
+}
+
+src_prepare() {
+	local psym="patch-symlinks"
+
+	# Now go into the kernel source and patch it.
+	cd "${S}"
+	epatch "${WORKDIR}/${psym}"/*.patch
+
+	eapply_user
+}
+
+#//------------------------------------------------------------------------------

diff --git a/sys-kernel/pf-sources/metadata.xml b/sys-kernel/pf-sources/metadata.xml
new file mode 100644
index 0000000..82f3039
--- /dev/null
+++ b/sys-kernel/pf-sources/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="cpe">cpe:/o:linux:linux_kernel</remote-id>
+	</upstream>
+</pkgmetadata>

diff --git a/sys-kernel/pf-sources/pf-sources-4.10_p3.ebuild b/sys-kernel/pf-sources/pf-sources-4.10_p3.ebuild
new file mode 100644
index 0000000..7736474
--- /dev/null
+++ b/sys-kernel/pf-sources/pf-sources-4.10_p3.ebuild
@@ -0,0 +1,77 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+inherit readme.gentoo-r1 toolchain-funcs versionator
+
+COMPRESSTYPE=".xz"
+K_USEPV="yes"
+UNIPATCH_STRICTORDER="yes"
+K_SECURITY_UNSUPPORTED="1"
+
+CKV="$(get_version_component_range 1-2)"
+ETYPE="sources"
+inherit kernel-2
+detect_version
+K_NOSETEXTRAVERSION="don't_set_it"
+
+DESCRIPTION="Linux kernel fork with new features (-ck patchset (BFS), BFQ, TuxOnIce and UKSM)"
+HOMEPAGE="https://pf.natalenko.name/"
+
+PF_VERS="1"
+PF_FILE="patch-${PV/_p*/}-pf${PV/*_p/}${COMPRESSTYPE}"
+PF_URI="https://pf.natalenko.name/sources/$(get_version_component_range 1-2)/${PF_FILE}"
+SRC_URI="${KERNEL_URI} ${PF_URI}" # \${EXPERIMENTAL_URI}
+
+KEYWORDS="-* ~amd64 ~ppc ~ppc64 ~x86"
+IUSE=""
+
+KV_FULL="${PVR}-pf"
+S="${WORKDIR}/linux-${KV_FULL}"
+
+DISABLE_AUTOFORMATTING="yes"
+DOC_CONTENTS="
+${P} has the following optional runtime dependencies:
+- sys-apps/tuxonice-userui: provides minimal userspace progress
+information related to suspending and resuming process.
+- sys-power/hibernate-script or sys-power/pm-utils: runtime utilities
+for hibernating and suspending your computer."
+
+pkg_pretend() {
+	# 547868
+	if [[ $(gcc-version) < 4.9 ]]; then
+			eerror ""
+			eerror "${P} needs an active GCC 4.9+ compiler"
+			eerror ""
+			die "${P} needs an active sys-devel/gcc >= 4.9"
+	fi
+}
+
+pkg_setup(){
+	ewarn
+	ewarn "${PN} is *not* supported by the Gentoo Kernel Project in any way."
+	ewarn "If you need support, please contact the pf developers directly."
+	ewarn "Do *not* open bugs in Gentoo's bugzilla unless you have issues with"
+	ewarn "the ebuilds. Thank you."
+	ewarn
+	kernel-2_pkg_setup
+}
+
+src_prepare(){
+	epatch "${DISTDIR}/${PF_FILE}"
+
+	default
+}
+
+src_install() {
+	kernel-2_src_install
+	readme.gentoo_create_doc
+}
+
+pkg_postinst() {
+	kernel-2_pkg_postinst
+	readme.gentoo_print_elog
+}
+
+K_EXTRAEINFO="For more info on pf-sources and details on how to report problems,
+see: ${HOMEPAGE}."

diff --git a/sys-kernel/pf-sources/pf-sources-4.11_p3.ebuild b/sys-kernel/pf-sources/pf-sources-4.11_p3.ebuild
new file mode 100644
index 0000000..7736474
--- /dev/null
+++ b/sys-kernel/pf-sources/pf-sources-4.11_p3.ebuild
@@ -0,0 +1,77 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+inherit readme.gentoo-r1 toolchain-funcs versionator
+
+COMPRESSTYPE=".xz"
+K_USEPV="yes"
+UNIPATCH_STRICTORDER="yes"
+K_SECURITY_UNSUPPORTED="1"
+
+CKV="$(get_version_component_range 1-2)"
+ETYPE="sources"
+inherit kernel-2
+detect_version
+K_NOSETEXTRAVERSION="don't_set_it"
+
+DESCRIPTION="Linux kernel fork with new features (-ck patchset (BFS), BFQ, TuxOnIce and UKSM)"
+HOMEPAGE="https://pf.natalenko.name/"
+
+PF_VERS="1"
+PF_FILE="patch-${PV/_p*/}-pf${PV/*_p/}${COMPRESSTYPE}"
+PF_URI="https://pf.natalenko.name/sources/$(get_version_component_range 1-2)/${PF_FILE}"
+SRC_URI="${KERNEL_URI} ${PF_URI}" # \${EXPERIMENTAL_URI}
+
+KEYWORDS="-* ~amd64 ~ppc ~ppc64 ~x86"
+IUSE=""
+
+KV_FULL="${PVR}-pf"
+S="${WORKDIR}/linux-${KV_FULL}"
+
+DISABLE_AUTOFORMATTING="yes"
+DOC_CONTENTS="
+${P} has the following optional runtime dependencies:
+- sys-apps/tuxonice-userui: provides minimal userspace progress
+information related to suspending and resuming process.
+- sys-power/hibernate-script or sys-power/pm-utils: runtime utilities
+for hibernating and suspending your computer."
+
+pkg_pretend() {
+	# 547868
+	if [[ $(gcc-version) < 4.9 ]]; then
+			eerror ""
+			eerror "${P} needs an active GCC 4.9+ compiler"
+			eerror ""
+			die "${P} needs an active sys-devel/gcc >= 4.9"
+	fi
+}
+
+pkg_setup(){
+	ewarn
+	ewarn "${PN} is *not* supported by the Gentoo Kernel Project in any way."
+	ewarn "If you need support, please contact the pf developers directly."
+	ewarn "Do *not* open bugs in Gentoo's bugzilla unless you have issues with"
+	ewarn "the ebuilds. Thank you."
+	ewarn
+	kernel-2_pkg_setup
+}
+
+src_prepare(){
+	epatch "${DISTDIR}/${PF_FILE}"
+
+	default
+}
+
+src_install() {
+	kernel-2_src_install
+	readme.gentoo_create_doc
+}
+
+pkg_postinst() {
+	kernel-2_pkg_postinst
+	readme.gentoo_print_elog
+}
+
+K_EXTRAEINFO="For more info on pf-sources and details on how to report problems,
+see: ${HOMEPAGE}."

diff --git a/sys-kernel/pf-sources/pf-sources-4.11_p4.ebuild b/sys-kernel/pf-sources/pf-sources-4.11_p4.ebuild
new file mode 100644
index 0000000..7736474
--- /dev/null
+++ b/sys-kernel/pf-sources/pf-sources-4.11_p4.ebuild
@@ -0,0 +1,77 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+inherit readme.gentoo-r1 toolchain-funcs versionator
+
+COMPRESSTYPE=".xz"
+K_USEPV="yes"
+UNIPATCH_STRICTORDER="yes"
+K_SECURITY_UNSUPPORTED="1"
+
+CKV="$(get_version_component_range 1-2)"
+ETYPE="sources"
+inherit kernel-2
+detect_version
+K_NOSETEXTRAVERSION="don't_set_it"
+
+DESCRIPTION="Linux kernel fork with new features (-ck patchset (BFS), BFQ, TuxOnIce and UKSM)"
+HOMEPAGE="https://pf.natalenko.name/"
+
+PF_VERS="1"
+PF_FILE="patch-${PV/_p*/}-pf${PV/*_p/}${COMPRESSTYPE}"
+PF_URI="https://pf.natalenko.name/sources/$(get_version_component_range 1-2)/${PF_FILE}"
+SRC_URI="${KERNEL_URI} ${PF_URI}" # \${EXPERIMENTAL_URI}
+
+KEYWORDS="-* ~amd64 ~ppc ~ppc64 ~x86"
+IUSE=""
+
+KV_FULL="${PVR}-pf"
+S="${WORKDIR}/linux-${KV_FULL}"
+
+DISABLE_AUTOFORMATTING="yes"
+DOC_CONTENTS="
+${P} has the following optional runtime dependencies:
+- sys-apps/tuxonice-userui: provides minimal userspace progress
+information related to suspending and resuming process.
+- sys-power/hibernate-script or sys-power/pm-utils: runtime utilities
+for hibernating and suspending your computer."
+
+pkg_pretend() {
+	# 547868
+	if [[ $(gcc-version) < 4.9 ]]; then
+			eerror ""
+			eerror "${P} needs an active GCC 4.9+ compiler"
+			eerror ""
+			die "${P} needs an active sys-devel/gcc >= 4.9"
+	fi
+}
+
+pkg_setup(){
+	ewarn
+	ewarn "${PN} is *not* supported by the Gentoo Kernel Project in any way."
+	ewarn "If you need support, please contact the pf developers directly."
+	ewarn "Do *not* open bugs in Gentoo's bugzilla unless you have issues with"
+	ewarn "the ebuilds. Thank you."
+	ewarn
+	kernel-2_pkg_setup
+}
+
+src_prepare(){
+	epatch "${DISTDIR}/${PF_FILE}"
+
+	default
+}
+
+src_install() {
+	kernel-2_src_install
+	readme.gentoo_create_doc
+}
+
+pkg_postinst() {
+	kernel-2_pkg_postinst
+	readme.gentoo_print_elog
+}
+
+K_EXTRAEINFO="For more info on pf-sources and details on how to report problems,
+see: ${HOMEPAGE}."

diff --git a/sys-kernel/pf-sources/pf-sources-4.13_p4.ebuild b/sys-kernel/pf-sources/pf-sources-4.13_p4.ebuild
new file mode 100644
index 0000000..7736474
--- /dev/null
+++ b/sys-kernel/pf-sources/pf-sources-4.13_p4.ebuild
@@ -0,0 +1,77 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+inherit readme.gentoo-r1 toolchain-funcs versionator
+
+COMPRESSTYPE=".xz"
+K_USEPV="yes"
+UNIPATCH_STRICTORDER="yes"
+K_SECURITY_UNSUPPORTED="1"
+
+CKV="$(get_version_component_range 1-2)"
+ETYPE="sources"
+inherit kernel-2
+detect_version
+K_NOSETEXTRAVERSION="don't_set_it"
+
+DESCRIPTION="Linux kernel fork with new features (-ck patchset (BFS), BFQ, TuxOnIce and UKSM)"
+HOMEPAGE="https://pf.natalenko.name/"
+
+PF_VERS="1"
+PF_FILE="patch-${PV/_p*/}-pf${PV/*_p/}${COMPRESSTYPE}"
+PF_URI="https://pf.natalenko.name/sources/$(get_version_component_range 1-2)/${PF_FILE}"
+SRC_URI="${KERNEL_URI} ${PF_URI}" # \${EXPERIMENTAL_URI}
+
+KEYWORDS="-* ~amd64 ~ppc ~ppc64 ~x86"
+IUSE=""
+
+KV_FULL="${PVR}-pf"
+S="${WORKDIR}/linux-${KV_FULL}"
+
+DISABLE_AUTOFORMATTING="yes"
+DOC_CONTENTS="
+${P} has the following optional runtime dependencies:
+- sys-apps/tuxonice-userui: provides minimal userspace progress
+information related to suspending and resuming process.
+- sys-power/hibernate-script or sys-power/pm-utils: runtime utilities
+for hibernating and suspending your computer."
+
+pkg_pretend() {
+	# 547868
+	if [[ $(gcc-version) < 4.9 ]]; then
+			eerror ""
+			eerror "${P} needs an active GCC 4.9+ compiler"
+			eerror ""
+			die "${P} needs an active sys-devel/gcc >= 4.9"
+	fi
+}
+
+pkg_setup(){
+	ewarn
+	ewarn "${PN} is *not* supported by the Gentoo Kernel Project in any way."
+	ewarn "If you need support, please contact the pf developers directly."
+	ewarn "Do *not* open bugs in Gentoo's bugzilla unless you have issues with"
+	ewarn "the ebuilds. Thank you."
+	ewarn
+	kernel-2_pkg_setup
+}
+
+src_prepare(){
+	epatch "${DISTDIR}/${PF_FILE}"
+
+	default
+}
+
+src_install() {
+	kernel-2_src_install
+	readme.gentoo_create_doc
+}
+
+pkg_postinst() {
+	kernel-2_pkg_postinst
+	readme.gentoo_print_elog
+}
+
+K_EXTRAEINFO="For more info on pf-sources and details on how to report problems,
+see: ${HOMEPAGE}."

diff --git a/sys-kernel/pf-sources/pf-sources-4.4_p8.ebuild b/sys-kernel/pf-sources/pf-sources-4.4_p8.ebuild
new file mode 100644
index 0000000..8e67712
--- /dev/null
+++ b/sys-kernel/pf-sources/pf-sources-4.4_p8.ebuild
@@ -0,0 +1,77 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+inherit readme.gentoo-r1 toolchain-funcs versionator
+
+COMPRESSTYPE=".xz"
+K_USEPV="yes"
+UNIPATCH_STRICTORDER="yes"
+K_SECURITY_UNSUPPORTED="1"
+
+CKV="$(get_version_component_range 1-2)"
+ETYPE="sources"
+inherit kernel-2
+detect_version
+K_NOSETEXTRAVERSION="don't_set_it"
+
+DESCRIPTION="Linux kernel fork with new features (-ck patchset (BFS), BFQ, TuxOnIce and UKSM)"
+HOMEPAGE="https://pf.natalenko.name/"
+
+PF_VERS="1"
+PF_FILE="patch-${PV/_p*/}-pf${PV/*_p/}${COMPRESSTYPE}"
+PF_URI="https://pf.natalenko.name/sources/$(get_version_component_range 1-2)/${PF_FILE}"
+SRC_URI="${KERNEL_URI} ${PF_URI}" # \${EXPERIMENTAL_URI}
+
+KEYWORDS="-* ~amd64 ~ppc ~ppc64 ~x86"
+IUSE=""
+
+KV_FULL="${PVR}-pf"
+S="${WORKDIR}/linux-${KV_FULL}"
+
+DISABLE_AUTOFORMATTING="yes"
+DOC_CONTENTS="
+${P} has the following optional runtime dependencies:
+- sys-apps/tuxonice-userui: provides minimal userspace progress
+information related to suspending and resuming process.
+- sys-power/hibernate-script or sys-power/pm-utils: runtime utilities
+for hibernating and suspending your computer."
+
+pkg_pretend() {
+	# 547868
+	if [[ $(gcc-version) < 4.9 ]]; then
+			eerror ""
+			eerror "${P} needs an active GCC 4.9+ compiler"
+			eerror ""
+			die "${P} needs an active sys-devel/gcc >= 4.9"
+	fi
+}
+
+pkg_setup(){
+	ewarn
+	ewarn "${PN} is *not* supported by the Gentoo Kernel Project in any way."
+	ewarn "If you need support, please contact the pf developers directly."
+	ewarn "Do *not* open bugs in Gentoo's bugzilla unless you have issues with"
+	ewarn "the ebuilds. Thank you."
+	ewarn
+	kernel-2_pkg_setup
+}
+
+src_prepare(){
+	epatch "${DISTDIR}/${PF_FILE}"
+
+	default
+}
+
+src_install() {
+	kernel-2_src_install
+	readme.gentoo_create_doc
+}
+
+pkg_postinst() {
+	kernel-2_pkg_postinst
+	readme.gentoo_print_elog
+}
+
+K_EXTRAEINFO="For more info on pf-sources and details on how to report problems,
+see: ${HOMEPAGE}."

diff --git a/sys-kernel/pf-sources/pf-sources-4.5_p4.ebuild b/sys-kernel/pf-sources/pf-sources-4.5_p4.ebuild
new file mode 100644
index 0000000..8e67712
--- /dev/null
+++ b/sys-kernel/pf-sources/pf-sources-4.5_p4.ebuild
@@ -0,0 +1,77 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+inherit readme.gentoo-r1 toolchain-funcs versionator
+
+COMPRESSTYPE=".xz"
+K_USEPV="yes"
+UNIPATCH_STRICTORDER="yes"
+K_SECURITY_UNSUPPORTED="1"
+
+CKV="$(get_version_component_range 1-2)"
+ETYPE="sources"
+inherit kernel-2
+detect_version
+K_NOSETEXTRAVERSION="don't_set_it"
+
+DESCRIPTION="Linux kernel fork with new features (-ck patchset (BFS), BFQ, TuxOnIce and UKSM)"
+HOMEPAGE="https://pf.natalenko.name/"
+
+PF_VERS="1"
+PF_FILE="patch-${PV/_p*/}-pf${PV/*_p/}${COMPRESSTYPE}"
+PF_URI="https://pf.natalenko.name/sources/$(get_version_component_range 1-2)/${PF_FILE}"
+SRC_URI="${KERNEL_URI} ${PF_URI}" # \${EXPERIMENTAL_URI}
+
+KEYWORDS="-* ~amd64 ~ppc ~ppc64 ~x86"
+IUSE=""
+
+KV_FULL="${PVR}-pf"
+S="${WORKDIR}/linux-${KV_FULL}"
+
+DISABLE_AUTOFORMATTING="yes"
+DOC_CONTENTS="
+${P} has the following optional runtime dependencies:
+- sys-apps/tuxonice-userui: provides minimal userspace progress
+information related to suspending and resuming process.
+- sys-power/hibernate-script or sys-power/pm-utils: runtime utilities
+for hibernating and suspending your computer."
+
+pkg_pretend() {
+	# 547868
+	if [[ $(gcc-version) < 4.9 ]]; then
+			eerror ""
+			eerror "${P} needs an active GCC 4.9+ compiler"
+			eerror ""
+			die "${P} needs an active sys-devel/gcc >= 4.9"
+	fi
+}
+
+pkg_setup(){
+	ewarn
+	ewarn "${PN} is *not* supported by the Gentoo Kernel Project in any way."
+	ewarn "If you need support, please contact the pf developers directly."
+	ewarn "Do *not* open bugs in Gentoo's bugzilla unless you have issues with"
+	ewarn "the ebuilds. Thank you."
+	ewarn
+	kernel-2_pkg_setup
+}
+
+src_prepare(){
+	epatch "${DISTDIR}/${PF_FILE}"
+
+	default
+}
+
+src_install() {
+	kernel-2_src_install
+	readme.gentoo_create_doc
+}
+
+pkg_postinst() {
+	kernel-2_pkg_postinst
+	readme.gentoo_print_elog
+}
+
+K_EXTRAEINFO="For more info on pf-sources and details on how to report problems,
+see: ${HOMEPAGE}."

diff --git a/sys-kernel/pf-sources/pf-sources-4.8_p8.ebuild b/sys-kernel/pf-sources/pf-sources-4.8_p8.ebuild
new file mode 100644
index 0000000..8e67712
--- /dev/null
+++ b/sys-kernel/pf-sources/pf-sources-4.8_p8.ebuild
@@ -0,0 +1,77 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+inherit readme.gentoo-r1 toolchain-funcs versionator
+
+COMPRESSTYPE=".xz"
+K_USEPV="yes"
+UNIPATCH_STRICTORDER="yes"
+K_SECURITY_UNSUPPORTED="1"
+
+CKV="$(get_version_component_range 1-2)"
+ETYPE="sources"
+inherit kernel-2
+detect_version
+K_NOSETEXTRAVERSION="don't_set_it"
+
+DESCRIPTION="Linux kernel fork with new features (-ck patchset (BFS), BFQ, TuxOnIce and UKSM)"
+HOMEPAGE="https://pf.natalenko.name/"
+
+PF_VERS="1"
+PF_FILE="patch-${PV/_p*/}-pf${PV/*_p/}${COMPRESSTYPE}"
+PF_URI="https://pf.natalenko.name/sources/$(get_version_component_range 1-2)/${PF_FILE}"
+SRC_URI="${KERNEL_URI} ${PF_URI}" # \${EXPERIMENTAL_URI}
+
+KEYWORDS="-* ~amd64 ~ppc ~ppc64 ~x86"
+IUSE=""
+
+KV_FULL="${PVR}-pf"
+S="${WORKDIR}/linux-${KV_FULL}"
+
+DISABLE_AUTOFORMATTING="yes"
+DOC_CONTENTS="
+${P} has the following optional runtime dependencies:
+- sys-apps/tuxonice-userui: provides minimal userspace progress
+information related to suspending and resuming process.
+- sys-power/hibernate-script or sys-power/pm-utils: runtime utilities
+for hibernating and suspending your computer."
+
+pkg_pretend() {
+	# 547868
+	if [[ $(gcc-version) < 4.9 ]]; then
+			eerror ""
+			eerror "${P} needs an active GCC 4.9+ compiler"
+			eerror ""
+			die "${P} needs an active sys-devel/gcc >= 4.9"
+	fi
+}
+
+pkg_setup(){
+	ewarn
+	ewarn "${PN} is *not* supported by the Gentoo Kernel Project in any way."
+	ewarn "If you need support, please contact the pf developers directly."
+	ewarn "Do *not* open bugs in Gentoo's bugzilla unless you have issues with"
+	ewarn "the ebuilds. Thank you."
+	ewarn
+	kernel-2_pkg_setup
+}
+
+src_prepare(){
+	epatch "${DISTDIR}/${PF_FILE}"
+
+	default
+}
+
+src_install() {
+	kernel-2_src_install
+	readme.gentoo_create_doc
+}
+
+pkg_postinst() {
+	kernel-2_pkg_postinst
+	readme.gentoo_print_elog
+}
+
+K_EXTRAEINFO="For more info on pf-sources and details on how to report problems,
+see: ${HOMEPAGE}."

diff --git a/sys-kernel/raspberrypi-image/metadata.xml b/sys-kernel/raspberrypi-image/metadata.xml
new file mode 100644
index 0000000..97bc254
--- /dev/null
+++ b/sys-kernel/raspberrypi-image/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-kernel/raspberrypi-image/raspberrypi-image-4.1.17_p20160209.ebuild b/sys-kernel/raspberrypi-image/raspberrypi-image-4.1.17_p20160209.ebuild
new file mode 100644
index 0000000..daf784d
--- /dev/null
+++ b/sys-kernel/raspberrypi-image/raspberrypi-image-4.1.17_p20160209.ebuild
@@ -0,0 +1,62 @@
+# 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"
+MY_PV="1.20160209"
+SRC_URI="https://github.com/raspberrypi/firmware/archive/${MY_PV} -> raspberrypi-firmware-${MY_PV}.tar.gz"
+
+LICENSE="GPL-2 raspberrypi-videocore-bin"
+SLOT="${PVR}"
+KEYWORDS="~arm -*"
+IUSE=""
+
+DEPEND=""
+RDEPEND=""
+
+S=${WORKDIR}/firmware-${MY_PV}
+
+RESTRICT=""
+
+pkg_preinst() {
+	if [ -z "${REPLACING_VERSIONS}" ] ; then
+		local msg=""
+		if [ -e "${D}"/boot/cmdline.txt -a -e "${ROOT}"/boot/cmdline.txt ] ; then
+			msg+="/boot/cmdline.txt "
+		fi
+		if [ -e "${D}"/boot/config.txt -a -e "${ROOT}"/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 during install"
+			msg="${msg} and merge settings afterwards."
+			msg="${msg} Further updates will be CONFIG_PROTECTed."
+			die "${msg}"
+		fi
+	fi
+
+	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() {
+	insinto /lib/modules
+	doins -r modules/*
+	insinto /boot
+	newins boot/kernel.img kernel-${PV}.img
+	newins boot/kernel7.img kernel7-${PV}.img
+
+	readme.gentoo_create_doc
+}
+
+DOC_CONTENTS="Please configure your ram setup by editing /boot/config.txt"

diff --git a/sys-kernel/raspberrypi-image/raspberrypi-image-4.1.19_p20160309.ebuild b/sys-kernel/raspberrypi-image/raspberrypi-image-4.1.19_p20160309.ebuild
new file mode 100644
index 0000000..550713f
--- /dev/null
+++ b/sys-kernel/raspberrypi-image/raspberrypi-image-4.1.19_p20160309.ebuild
@@ -0,0 +1,62 @@
+# 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"
+MY_PV="1.20160309"
+SRC_URI="https://github.com/raspberrypi/firmware/archive/${MY_PV} -> raspberrypi-firmware-${MY_PV}.tar.gz"
+
+LICENSE="GPL-2 raspberrypi-videocore-bin"
+SLOT="${PVR}"
+KEYWORDS="~arm -*"
+IUSE=""
+
+DEPEND=""
+RDEPEND=""
+
+S=${WORKDIR}/firmware-${MY_PV}
+
+RESTRICT=""
+
+pkg_preinst() {
+	if [ -z "${REPLACING_VERSIONS}" ] ; then
+		local msg=""
+		if [ -e "${D}"/boot/cmdline.txt -a -e "${ROOT}"/boot/cmdline.txt ] ; then
+			msg+="/boot/cmdline.txt "
+		fi
+		if [ -e "${D}"/boot/config.txt -a -e "${ROOT}"/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 during install"
+			msg="${msg} and merge settings afterwards."
+			msg="${msg} Further updates will be CONFIG_PROTECTed."
+			die "${msg}"
+		fi
+	fi
+
+	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() {
+	insinto /lib/modules
+	doins -r modules/*
+	insinto /boot
+	newins boot/kernel.img kernel-${PV}.img
+	newins boot/kernel7.img kernel7-${PV}.img
+
+	readme.gentoo_create_doc
+}
+
+DOC_CONTENTS="Please configure your ram setup by editing /boot/config.txt"

diff --git a/sys-kernel/raspberrypi-image/raspberrypi-image-9999.ebuild b/sys-kernel/raspberrypi-image/raspberrypi-image-9999.ebuild
new file mode 100644
index 0000000..0e6d2da
--- /dev/null
+++ b/sys-kernel/raspberrypi-image/raspberrypi-image-9999.ebuild
@@ -0,0 +1,57 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+inherit git-r3 readme.gentoo-r1
+
+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=""
+
+EGIT_REPO_URI="https://github.com/raspberrypi/firmware"
+DOC_CONTENTS="Please configure your ram setup by editing /boot/config.txt"
+
+RESTRICT="binchecks strip"
+
+pkg_preinst() {
+	if [ -z "${REPLACING_VERSIONS}" ] ; then
+		local msg=""
+		if [ -e "${D}"/boot/cmdline.txt -a -e "${ROOT}"/boot/cmdline.txt ] ; then
+			msg+="/boot/cmdline.txt "
+		fi
+		if [ -e "${D}"/boot/config.txt -a -e "${ROOT}"/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 during install"
+			msg="${msg} and merge settings afterwards."
+			msg="${msg} Further updates will be CONFIG_PROTECTed."
+			die "${msg}"
+		fi
+	fi
+
+	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() {
+	insinto /lib/modules
+	doins -r modules/*
+	insinto /boot
+	newins boot/kernel.img kernel.img
+	newins boot/kernel7.img kernel7.img
+
+	readme.gentoo_create_doc
+}

diff --git a/sys-kernel/raspberrypi-sources/metadata.xml b/sys-kernel/raspberrypi-sources/metadata.xml
new file mode 100644
index 0000000..5ffcbcc
--- /dev/null
+++ b/sys-kernel/raspberrypi-sources/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/linux</remote-id>
+	</upstream>
+</pkgmetadata>

diff --git a/sys-kernel/raspberrypi-sources/raspberrypi-sources-4.10.9999.ebuild b/sys-kernel/raspberrypi-sources/raspberrypi-sources-4.10.9999.ebuild
new file mode 100644
index 0000000..11c6e6a
--- /dev/null
+++ b/sys-kernel/raspberrypi-sources/raspberrypi-sources-4.10.9999.ebuild
@@ -0,0 +1,27 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+ETYPE=sources
+K_DEFCONFIG="bcmrpi_defconfig"
+K_SECURITY_UNSUPPORTED=1
+EXTRAVERSION="-${PN}/-*"
+inherit kernel-2
+detect_version
+detect_arch
+
+inherit git-r3 versionator
+EGIT_REPO_URI="https://github.com/raspberrypi/linux.git -> raspberrypi-linux.git"
+EGIT_BRANCH="rpi-$(get_version_component_range 1-2).y"
+EGIT_CHECKOUT_DIR="${WORKDIR}/linux-${PV}-raspberrypi"
+
+DESCRIPTION="Raspberry PI kernel sources"
+HOMEPAGE="https://github.com/raspberrypi/linux"
+
+KEYWORDS=""
+
+src_unpack() {
+	git-r3_src_unpack
+	unpack_set_extraversion
+}

diff --git a/sys-kernel/raspberrypi-sources/raspberrypi-sources-4.11.9999.ebuild b/sys-kernel/raspberrypi-sources/raspberrypi-sources-4.11.9999.ebuild
new file mode 100644
index 0000000..11c6e6a
--- /dev/null
+++ b/sys-kernel/raspberrypi-sources/raspberrypi-sources-4.11.9999.ebuild
@@ -0,0 +1,27 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+ETYPE=sources
+K_DEFCONFIG="bcmrpi_defconfig"
+K_SECURITY_UNSUPPORTED=1
+EXTRAVERSION="-${PN}/-*"
+inherit kernel-2
+detect_version
+detect_arch
+
+inherit git-r3 versionator
+EGIT_REPO_URI="https://github.com/raspberrypi/linux.git -> raspberrypi-linux.git"
+EGIT_BRANCH="rpi-$(get_version_component_range 1-2).y"
+EGIT_CHECKOUT_DIR="${WORKDIR}/linux-${PV}-raspberrypi"
+
+DESCRIPTION="Raspberry PI kernel sources"
+HOMEPAGE="https://github.com/raspberrypi/linux"
+
+KEYWORDS=""
+
+src_unpack() {
+	git-r3_src_unpack
+	unpack_set_extraversion
+}

diff --git a/sys-kernel/raspberrypi-sources/raspberrypi-sources-4.12.9999.ebuild b/sys-kernel/raspberrypi-sources/raspberrypi-sources-4.12.9999.ebuild
new file mode 100644
index 0000000..11c6e6a
--- /dev/null
+++ b/sys-kernel/raspberrypi-sources/raspberrypi-sources-4.12.9999.ebuild
@@ -0,0 +1,27 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+ETYPE=sources
+K_DEFCONFIG="bcmrpi_defconfig"
+K_SECURITY_UNSUPPORTED=1
+EXTRAVERSION="-${PN}/-*"
+inherit kernel-2
+detect_version
+detect_arch
+
+inherit git-r3 versionator
+EGIT_REPO_URI="https://github.com/raspberrypi/linux.git -> raspberrypi-linux.git"
+EGIT_BRANCH="rpi-$(get_version_component_range 1-2).y"
+EGIT_CHECKOUT_DIR="${WORKDIR}/linux-${PV}-raspberrypi"
+
+DESCRIPTION="Raspberry PI kernel sources"
+HOMEPAGE="https://github.com/raspberrypi/linux"
+
+KEYWORDS=""
+
+src_unpack() {
+	git-r3_src_unpack
+	unpack_set_extraversion
+}

diff --git a/sys-kernel/raspberrypi-sources/raspberrypi-sources-4.13.9999.ebuild b/sys-kernel/raspberrypi-sources/raspberrypi-sources-4.13.9999.ebuild
new file mode 100644
index 0000000..11c6e6a
--- /dev/null
+++ b/sys-kernel/raspberrypi-sources/raspberrypi-sources-4.13.9999.ebuild
@@ -0,0 +1,27 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+ETYPE=sources
+K_DEFCONFIG="bcmrpi_defconfig"
+K_SECURITY_UNSUPPORTED=1
+EXTRAVERSION="-${PN}/-*"
+inherit kernel-2
+detect_version
+detect_arch
+
+inherit git-r3 versionator
+EGIT_REPO_URI="https://github.com/raspberrypi/linux.git -> raspberrypi-linux.git"
+EGIT_BRANCH="rpi-$(get_version_component_range 1-2).y"
+EGIT_CHECKOUT_DIR="${WORKDIR}/linux-${PV}-raspberrypi"
+
+DESCRIPTION="Raspberry PI kernel sources"
+HOMEPAGE="https://github.com/raspberrypi/linux"
+
+KEYWORDS=""
+
+src_unpack() {
+	git-r3_src_unpack
+	unpack_set_extraversion
+}

diff --git a/sys-kernel/raspberrypi-sources/raspberrypi-sources-4.14.9999.ebuild b/sys-kernel/raspberrypi-sources/raspberrypi-sources-4.14.9999.ebuild
new file mode 100644
index 0000000..11c6e6a
--- /dev/null
+++ b/sys-kernel/raspberrypi-sources/raspberrypi-sources-4.14.9999.ebuild
@@ -0,0 +1,27 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+ETYPE=sources
+K_DEFCONFIG="bcmrpi_defconfig"
+K_SECURITY_UNSUPPORTED=1
+EXTRAVERSION="-${PN}/-*"
+inherit kernel-2
+detect_version
+detect_arch
+
+inherit git-r3 versionator
+EGIT_REPO_URI="https://github.com/raspberrypi/linux.git -> raspberrypi-linux.git"
+EGIT_BRANCH="rpi-$(get_version_component_range 1-2).y"
+EGIT_CHECKOUT_DIR="${WORKDIR}/linux-${PV}-raspberrypi"
+
+DESCRIPTION="Raspberry PI kernel sources"
+HOMEPAGE="https://github.com/raspberrypi/linux"
+
+KEYWORDS=""
+
+src_unpack() {
+	git-r3_src_unpack
+	unpack_set_extraversion
+}

diff --git a/sys-kernel/raspberrypi-sources/raspberrypi-sources-4.4.9999.ebuild b/sys-kernel/raspberrypi-sources/raspberrypi-sources-4.4.9999.ebuild
new file mode 100644
index 0000000..11c6e6a
--- /dev/null
+++ b/sys-kernel/raspberrypi-sources/raspberrypi-sources-4.4.9999.ebuild
@@ -0,0 +1,27 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+ETYPE=sources
+K_DEFCONFIG="bcmrpi_defconfig"
+K_SECURITY_UNSUPPORTED=1
+EXTRAVERSION="-${PN}/-*"
+inherit kernel-2
+detect_version
+detect_arch
+
+inherit git-r3 versionator
+EGIT_REPO_URI="https://github.com/raspberrypi/linux.git -> raspberrypi-linux.git"
+EGIT_BRANCH="rpi-$(get_version_component_range 1-2).y"
+EGIT_CHECKOUT_DIR="${WORKDIR}/linux-${PV}-raspberrypi"
+
+DESCRIPTION="Raspberry PI kernel sources"
+HOMEPAGE="https://github.com/raspberrypi/linux"
+
+KEYWORDS=""
+
+src_unpack() {
+	git-r3_src_unpack
+	unpack_set_extraversion
+}

diff --git a/sys-kernel/raspberrypi-sources/raspberrypi-sources-4.9.9999.ebuild b/sys-kernel/raspberrypi-sources/raspberrypi-sources-4.9.9999.ebuild
new file mode 100644
index 0000000..11c6e6a
--- /dev/null
+++ b/sys-kernel/raspberrypi-sources/raspberrypi-sources-4.9.9999.ebuild
@@ -0,0 +1,27 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+ETYPE=sources
+K_DEFCONFIG="bcmrpi_defconfig"
+K_SECURITY_UNSUPPORTED=1
+EXTRAVERSION="-${PN}/-*"
+inherit kernel-2
+detect_version
+detect_arch
+
+inherit git-r3 versionator
+EGIT_REPO_URI="https://github.com/raspberrypi/linux.git -> raspberrypi-linux.git"
+EGIT_BRANCH="rpi-$(get_version_component_range 1-2).y"
+EGIT_CHECKOUT_DIR="${WORKDIR}/linux-${PV}-raspberrypi"
+
+DESCRIPTION="Raspberry PI kernel sources"
+HOMEPAGE="https://github.com/raspberrypi/linux"
+
+KEYWORDS=""
+
+src_unpack() {
+	git-r3_src_unpack
+	unpack_set_extraversion
+}

diff --git a/sys-kernel/rt-sources/files/rt-sources-posix-printf.patch b/sys-kernel/rt-sources/files/rt-sources-posix-printf.patch
new file mode 100644
index 0000000..81ebcaf
--- /dev/null
+++ b/sys-kernel/rt-sources/files/rt-sources-posix-printf.patch
@@ -0,0 +1,40 @@
+From 651e54953b5d4ad103f0efa54fc6b380807fca3a Mon Sep 17 00:00:00 2001
+From: Thomas Schneider <qsx@qsx.re>
+Date: Fri, 14 Oct 2016 21:29:49 +0200
+Subject: security/apparmor: Use POSIX-compatible "printf '%s'"
+
+When using a strictly POSIX-compliant shell, "-n #define ..." gets
+written into the file.  Use "printf '%s'" to avoid this.
+
+Signed-off-by: Thomas Schneider <qsx@qsx.re>
+Signed-off-by: John Johansen <john.johansen@canonical.com>
+---
+ security/apparmor/Makefile | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+(limited to 'security/apparmor')
+
+diff --git a/security/apparmor/Makefile b/security/apparmor/Makefile
+index ad369a7..2ded2f1 100644
+--- a/security/apparmor/Makefile
++++ b/security/apparmor/Makefile
+@@ -20,7 +20,7 @@ cmd_make-caps = echo "static const char *const capability_names[] = {" > $@ ;\
+ 	sed $< >>$@ -r -n -e '/CAP_FS_MASK/d' \
+ 	-e 's/^\#define[ \t]+CAP_([A-Z0-9_]+)[ \t]+([0-9]+)/[\2] = "\L\1",/p';\
+ 	echo "};" >> $@ ;\
+-	echo -n '\#define AA_FS_CAPS_MASK "' >> $@ ;\
++	printf '%s' '\#define AA_FS_CAPS_MASK "' >> $@ ;\
+ 	sed $< -r -n -e '/CAP_FS_MASK/d' \
+ 	    -e 's/^\#define[ \t]+CAP_([A-Z0-9_]+)[ \t]+([0-9]+)/\L\1/p' | \
+ 	     tr '\n' ' ' | sed -e 's/ $$/"\n/' >> $@
+@@ -56,7 +56,7 @@ cmd_make-rlim = echo "static const char *const rlim_names[RLIM_NLIMITS] = {" \
+ 	echo "static const int rlim_map[RLIM_NLIMITS] = {" >> $@ ;\
+ 	sed -r -n "s/^\# ?define[ \t]+(RLIMIT_[A-Z0-9_]+).*/\1,/p" $< >> $@ ;\
+ 	echo "};" >> $@ ; \
+-	echo -n '\#define AA_FS_RLIMIT_MASK "' >> $@ ;\
++	printf '%s' '\#define AA_FS_RLIMIT_MASK "' >> $@ ;\
+ 	sed -r -n 's/^\# ?define[ \t]+RLIMIT_([A-Z0-9_]+).*/\L\1/p' $< | \
+ 	    tr '\n' ' ' | sed -e 's/ $$/"\n/' >> $@
+ 
+-- 
+cgit v1.1

diff --git a/sys-kernel/rt-sources/metadata.xml b/sys-kernel/rt-sources/metadata.xml
new file mode 100644
index 0000000..0791a2c
--- /dev/null
+++ b/sys-kernel/rt-sources/metadata.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+	<maintainer type="person">
+		<email>karl.j.linden@gmail.com</email>
+		<name>Karl Linden</name>
+	</maintainer>
+	<maintainer type="project">
+		<email>proxy-maint@gentoo.org</email>
+		<name>Proxy Maintainers</name>
+	</maintainer>
+	<longdescription>
+		Real-time patchset for the Linux Kernel
+	</longdescription>
+	<use>
+		<flag name="deblob">Remove binary blobs from kernel sources to provide libre license compliance.</flag>
+	</use>
+	<upstream>
+		<remote-id type="cpe">cpe:/o:linux:linux_kernel</remote-id>
+	</upstream>
+</pkgmetadata>

diff --git a/sys-kernel/rt-sources/rt-sources-3.18.121_p106.ebuild b/sys-kernel/rt-sources/rt-sources-3.18.121_p106.ebuild
new file mode 100644
index 0000000..6ec80f7
--- /dev/null
+++ b/sys-kernel/rt-sources/rt-sources-3.18.121_p106.ebuild
@@ -0,0 +1,58 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+ETYPE="sources"
+KEYWORDS="~amd64"
+
+HOMEPAGE="https://www.kernel.org/pub/linux/kernel/projects/rt/"
+
+inherit eapi7-ver
+
+CKV="$(ver_cut 1-3)"
+K_SECURITY_UNSUPPORTED="1"
+K_DEBLOB_AVAILABLE="1"
+RT_PATCHSET="${PV/*_p}"
+
+inherit kernel-2
+detect_version
+
+K_BRANCH_ID="${KV_MAJOR}.${KV_MINOR}"
+RT_FILE="patch-${K_BRANCH_ID}.${KV_PATCH}-rt${RT_PATCHSET}.patch.xz"
+RT_URI="mirror://kernel/linux/kernel/projects/rt/${K_BRANCH_ID}/${RT_FILE} \
+		mirror://kernel/linux/kernel/projects/rt/${K_BRANCH_ID}/older/${RT_FILE}"
+
+DESCRIPTION="Full Linux ${K_BRANCH_ID} kernel sources with the CONFIG_PREEMPT_RT patch"
+SRC_URI="${KERNEL_URI} ${RT_URI}"
+
+KV_FULL="${PVR/_p/-rt}"
+S="${WORKDIR}/linux-${KV_FULL}"
+
+UNIPATCH_LIST="${DISTDIR}/${RT_FILE}"
+UNIPATCH_STRICTORDER="yes"
+
+PATCHES=(
+	"${FILESDIR}"/rt-sources-posix-printf.patch # 627068
+)
+
+src_prepare() {
+	default
+
+	# 627796
+	sed \
+		"s/default PREEMPT_NONE/default PREEMPT_RT_FULL/g" \
+		-i "${S}/kernel/Kconfig.preempt"
+}
+
+pkg_postinst() {
+	kernel-2_pkg_postinst
+	ewarn
+	ewarn "${PN} are *not* supported by the Gentoo Kernel Project in any way."
+	ewarn "If you need support, please contact the RT project developers directly."
+	ewarn "Do *not* open bugs in Gentoo's bugzilla unless you have issues with"
+	ewarn "the ebuilds."
+	ewarn
+}
+
+K_EXTRAEINFO="For more info on rt-sources and details on how to report problems, see: \
+${HOMEPAGE}."

diff --git a/sys-kernel/rt-sources/rt-sources-3.18.123_p107.ebuild b/sys-kernel/rt-sources/rt-sources-3.18.123_p107.ebuild
new file mode 100644
index 0000000..14daca2
--- /dev/null
+++ b/sys-kernel/rt-sources/rt-sources-3.18.123_p107.ebuild
@@ -0,0 +1,58 @@
+# Copyright 1999-2018 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+ETYPE="sources"
+KEYWORDS="~amd64"
+
+HOMEPAGE="https://www.kernel.org/pub/linux/kernel/projects/rt/"
+
+inherit eapi7-ver
+
+CKV="$(ver_cut 1-3)"
+K_SECURITY_UNSUPPORTED="1"
+K_DEBLOB_AVAILABLE="1"
+RT_PATCHSET="${PV/*_p}"
+
+inherit kernel-2
+detect_version
+
+K_BRANCH_ID="${KV_MAJOR}.${KV_MINOR}"
+RT_FILE="patch-${K_BRANCH_ID}.${KV_PATCH}-rt${RT_PATCHSET}.patch.xz"
+RT_URI="mirror://kernel/linux/kernel/projects/rt/${K_BRANCH_ID}/${RT_FILE} \
+		mirror://kernel/linux/kernel/projects/rt/${K_BRANCH_ID}/older/${RT_FILE}"
+
+DESCRIPTION="Full Linux ${K_BRANCH_ID} kernel sources with the CONFIG_PREEMPT_RT patch"
+SRC_URI="${KERNEL_URI} ${RT_URI}"
+
+KV_FULL="${PVR/_p/-rt}"
+S="${WORKDIR}/linux-${KV_FULL}"
+
+UNIPATCH_LIST="${DISTDIR}/${RT_FILE}"
+UNIPATCH_STRICTORDER="yes"
+
+PATCHES=(
+	"${FILESDIR}"/rt-sources-posix-printf.patch # 627068
+)
+
+src_prepare() {
+	default
+
+	# 627796
+	sed \
+		"s/default PREEMPT_NONE/default PREEMPT_RT_FULL/g" \
+		-i "${S}/kernel/Kconfig.preempt" || die "sed failed"
+}
+
+pkg_postinst() {
+	kernel-2_pkg_postinst
+	ewarn
+	ewarn "${PN} are *not* supported by the Gentoo Kernel Project in any way."
+	ewarn "If you need support, please contact the RT project developers directly."
+	ewarn "Do *not* open bugs in Gentoo's bugzilla unless you have issues with"
+	ewarn "the ebuilds."
+	ewarn
+}
+
+K_EXTRAEINFO="For more info on rt-sources and details on how to report problems, see: \
+${HOMEPAGE}."

diff --git a/sys-kernel/rt-sources/rt-sources-4.14.69_p43.ebuild b/sys-kernel/rt-sources/rt-sources-4.14.69_p43.ebuild
new file mode 100644
index 0000000..d65a86c
--- /dev/null
+++ b/sys-kernel/rt-sources/rt-sources-4.14.69_p43.ebuild
@@ -0,0 +1,54 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+ETYPE="sources"
+KEYWORDS="~amd64"
+
+HOMEPAGE="https://www.kernel.org/pub/linux/kernel/projects/rt/"
+
+inherit eapi7-ver
+
+CKV="$(ver_cut 1-3)"
+K_SECURITY_UNSUPPORTED="1"
+K_DEBLOB_AVAILABLE="1"
+RT_PATCHSET="${PV/*_p}"
+
+inherit kernel-2
+detect_version
+
+K_BRANCH_ID="${KV_MAJOR}.${KV_MINOR}"
+RT_FILE="patch-${K_BRANCH_ID}.${KV_PATCH}-rt${RT_PATCHSET}.patch.xz"
+RT_URI="mirror://kernel/linux/kernel/projects/rt/${K_BRANCH_ID}/${RT_FILE} \
+		mirror://kernel/linux/kernel/projects/rt/${K_BRANCH_ID}/older/${RT_FILE}"
+
+DESCRIPTION="Full Linux ${K_BRANCH_ID} kernel sources with the CONFIG_PREEMPT_RT patch"
+SRC_URI="${KERNEL_URI} ${RT_URI}"
+
+KV_FULL="${PVR/_p/-rt}"
+S="${WORKDIR}/linux-${KV_FULL}"
+
+UNIPATCH_LIST="${DISTDIR}/${RT_FILE}"
+UNIPATCH_STRICTORDER="yes"
+
+src_prepare() {
+	default
+
+	# 627796
+	sed \
+		"s/default PREEMPT_NONE/default PREEMPT_RT_FULL/g" \
+		-i "${S}/kernel/Kconfig.preempt"
+}
+
+pkg_postinst() {
+	kernel-2_pkg_postinst
+	ewarn
+	ewarn "${PN} are *not* supported by the Gentoo Kernel Project in any way."
+	ewarn "If you need support, please contact the RT project developers directly."
+	ewarn "Do *not* open bugs in Gentoo's bugzilla unless you have issues with"
+	ewarn "the ebuilds."
+	ewarn
+}
+
+K_EXTRAEINFO="For more info on rt-sources and details on how to report problems, see: \
+${HOMEPAGE}."

diff --git a/sys-kernel/rt-sources/rt-sources-4.14.71_p44.ebuild b/sys-kernel/rt-sources/rt-sources-4.14.71_p44.ebuild
new file mode 100644
index 0000000..18034a5
--- /dev/null
+++ b/sys-kernel/rt-sources/rt-sources-4.14.71_p44.ebuild
@@ -0,0 +1,54 @@
+# Copyright 1999-2018 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+ETYPE="sources"
+KEYWORDS="~amd64"
+
+HOMEPAGE="https://www.kernel.org/pub/linux/kernel/projects/rt/"
+
+inherit eapi7-ver
+
+CKV="$(ver_cut 1-3)"
+K_SECURITY_UNSUPPORTED="1"
+K_DEBLOB_AVAILABLE="1"
+RT_PATCHSET="${PV/*_p}"
+
+inherit kernel-2
+detect_version
+
+K_BRANCH_ID="${KV_MAJOR}.${KV_MINOR}"
+RT_FILE="patch-${K_BRANCH_ID}.${KV_PATCH}-rt${RT_PATCHSET}.patch.xz"
+RT_URI="mirror://kernel/linux/kernel/projects/rt/${K_BRANCH_ID}/${RT_FILE} \
+		mirror://kernel/linux/kernel/projects/rt/${K_BRANCH_ID}/older/${RT_FILE}"
+
+DESCRIPTION="Full Linux ${K_BRANCH_ID} kernel sources with the CONFIG_PREEMPT_RT patch"
+SRC_URI="${KERNEL_URI} ${RT_URI}"
+
+KV_FULL="${PVR/_p/-rt}"
+S="${WORKDIR}/linux-${KV_FULL}"
+
+UNIPATCH_LIST="${DISTDIR}/${RT_FILE}"
+UNIPATCH_STRICTORDER="yes"
+
+src_prepare() {
+	default
+
+	# 627796
+	sed \
+		"s/default PREEMPT_NONE/default PREEMPT_RT_FULL/g" \
+		-i "${S}/kernel/Kconfig.preempt" || die "sed failed"
+}
+
+pkg_postinst() {
+	kernel-2_pkg_postinst
+	ewarn
+	ewarn "${PN} are *not* supported by the Gentoo Kernel Project in any way."
+	ewarn "If you need support, please contact the RT project developers directly."
+	ewarn "Do *not* open bugs in Gentoo's bugzilla unless you have issues with"
+	ewarn "the ebuilds."
+	ewarn
+}
+
+K_EXTRAEINFO="For more info on rt-sources and details on how to report problems, see: \
+${HOMEPAGE}."

diff --git a/sys-kernel/rt-sources/rt-sources-4.16.18_p12.ebuild b/sys-kernel/rt-sources/rt-sources-4.16.18_p12.ebuild
new file mode 100644
index 0000000..18034a5
--- /dev/null
+++ b/sys-kernel/rt-sources/rt-sources-4.16.18_p12.ebuild
@@ -0,0 +1,54 @@
+# Copyright 1999-2018 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+ETYPE="sources"
+KEYWORDS="~amd64"
+
+HOMEPAGE="https://www.kernel.org/pub/linux/kernel/projects/rt/"
+
+inherit eapi7-ver
+
+CKV="$(ver_cut 1-3)"
+K_SECURITY_UNSUPPORTED="1"
+K_DEBLOB_AVAILABLE="1"
+RT_PATCHSET="${PV/*_p}"
+
+inherit kernel-2
+detect_version
+
+K_BRANCH_ID="${KV_MAJOR}.${KV_MINOR}"
+RT_FILE="patch-${K_BRANCH_ID}.${KV_PATCH}-rt${RT_PATCHSET}.patch.xz"
+RT_URI="mirror://kernel/linux/kernel/projects/rt/${K_BRANCH_ID}/${RT_FILE} \
+		mirror://kernel/linux/kernel/projects/rt/${K_BRANCH_ID}/older/${RT_FILE}"
+
+DESCRIPTION="Full Linux ${K_BRANCH_ID} kernel sources with the CONFIG_PREEMPT_RT patch"
+SRC_URI="${KERNEL_URI} ${RT_URI}"
+
+KV_FULL="${PVR/_p/-rt}"
+S="${WORKDIR}/linux-${KV_FULL}"
+
+UNIPATCH_LIST="${DISTDIR}/${RT_FILE}"
+UNIPATCH_STRICTORDER="yes"
+
+src_prepare() {
+	default
+
+	# 627796
+	sed \
+		"s/default PREEMPT_NONE/default PREEMPT_RT_FULL/g" \
+		-i "${S}/kernel/Kconfig.preempt" || die "sed failed"
+}
+
+pkg_postinst() {
+	kernel-2_pkg_postinst
+	ewarn
+	ewarn "${PN} are *not* supported by the Gentoo Kernel Project in any way."
+	ewarn "If you need support, please contact the RT project developers directly."
+	ewarn "Do *not* open bugs in Gentoo's bugzilla unless you have issues with"
+	ewarn "the ebuilds."
+	ewarn
+}
+
+K_EXTRAEINFO="For more info on rt-sources and details on how to report problems, see: \
+${HOMEPAGE}."

diff --git a/sys-kernel/rt-sources/rt-sources-4.18.12_p7.ebuild b/sys-kernel/rt-sources/rt-sources-4.18.12_p7.ebuild
new file mode 100644
index 0000000..18034a5
--- /dev/null
+++ b/sys-kernel/rt-sources/rt-sources-4.18.12_p7.ebuild
@@ -0,0 +1,54 @@
+# Copyright 1999-2018 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+ETYPE="sources"
+KEYWORDS="~amd64"
+
+HOMEPAGE="https://www.kernel.org/pub/linux/kernel/projects/rt/"
+
+inherit eapi7-ver
+
+CKV="$(ver_cut 1-3)"
+K_SECURITY_UNSUPPORTED="1"
+K_DEBLOB_AVAILABLE="1"
+RT_PATCHSET="${PV/*_p}"
+
+inherit kernel-2
+detect_version
+
+K_BRANCH_ID="${KV_MAJOR}.${KV_MINOR}"
+RT_FILE="patch-${K_BRANCH_ID}.${KV_PATCH}-rt${RT_PATCHSET}.patch.xz"
+RT_URI="mirror://kernel/linux/kernel/projects/rt/${K_BRANCH_ID}/${RT_FILE} \
+		mirror://kernel/linux/kernel/projects/rt/${K_BRANCH_ID}/older/${RT_FILE}"
+
+DESCRIPTION="Full Linux ${K_BRANCH_ID} kernel sources with the CONFIG_PREEMPT_RT patch"
+SRC_URI="${KERNEL_URI} ${RT_URI}"
+
+KV_FULL="${PVR/_p/-rt}"
+S="${WORKDIR}/linux-${KV_FULL}"
+
+UNIPATCH_LIST="${DISTDIR}/${RT_FILE}"
+UNIPATCH_STRICTORDER="yes"
+
+src_prepare() {
+	default
+
+	# 627796
+	sed \
+		"s/default PREEMPT_NONE/default PREEMPT_RT_FULL/g" \
+		-i "${S}/kernel/Kconfig.preempt" || die "sed failed"
+}
+
+pkg_postinst() {
+	kernel-2_pkg_postinst
+	ewarn
+	ewarn "${PN} are *not* supported by the Gentoo Kernel Project in any way."
+	ewarn "If you need support, please contact the RT project developers directly."
+	ewarn "Do *not* open bugs in Gentoo's bugzilla unless you have issues with"
+	ewarn "the ebuilds."
+	ewarn
+}
+
+K_EXTRAEINFO="For more info on rt-sources and details on how to report problems, see: \
+${HOMEPAGE}."

diff --git a/sys-kernel/rt-sources/rt-sources-4.18.16_p9.ebuild b/sys-kernel/rt-sources/rt-sources-4.18.16_p9.ebuild
new file mode 100644
index 0000000..18034a5
--- /dev/null
+++ b/sys-kernel/rt-sources/rt-sources-4.18.16_p9.ebuild
@@ -0,0 +1,54 @@
+# Copyright 1999-2018 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+ETYPE="sources"
+KEYWORDS="~amd64"
+
+HOMEPAGE="https://www.kernel.org/pub/linux/kernel/projects/rt/"
+
+inherit eapi7-ver
+
+CKV="$(ver_cut 1-3)"
+K_SECURITY_UNSUPPORTED="1"
+K_DEBLOB_AVAILABLE="1"
+RT_PATCHSET="${PV/*_p}"
+
+inherit kernel-2
+detect_version
+
+K_BRANCH_ID="${KV_MAJOR}.${KV_MINOR}"
+RT_FILE="patch-${K_BRANCH_ID}.${KV_PATCH}-rt${RT_PATCHSET}.patch.xz"
+RT_URI="mirror://kernel/linux/kernel/projects/rt/${K_BRANCH_ID}/${RT_FILE} \
+		mirror://kernel/linux/kernel/projects/rt/${K_BRANCH_ID}/older/${RT_FILE}"
+
+DESCRIPTION="Full Linux ${K_BRANCH_ID} kernel sources with the CONFIG_PREEMPT_RT patch"
+SRC_URI="${KERNEL_URI} ${RT_URI}"
+
+KV_FULL="${PVR/_p/-rt}"
+S="${WORKDIR}/linux-${KV_FULL}"
+
+UNIPATCH_LIST="${DISTDIR}/${RT_FILE}"
+UNIPATCH_STRICTORDER="yes"
+
+src_prepare() {
+	default
+
+	# 627796
+	sed \
+		"s/default PREEMPT_NONE/default PREEMPT_RT_FULL/g" \
+		-i "${S}/kernel/Kconfig.preempt" || die "sed failed"
+}
+
+pkg_postinst() {
+	kernel-2_pkg_postinst
+	ewarn
+	ewarn "${PN} are *not* supported by the Gentoo Kernel Project in any way."
+	ewarn "If you need support, please contact the RT project developers directly."
+	ewarn "Do *not* open bugs in Gentoo's bugzilla unless you have issues with"
+	ewarn "the ebuilds."
+	ewarn
+}
+
+K_EXTRAEINFO="For more info on rt-sources and details on how to report problems, see: \
+${HOMEPAGE}."

diff --git a/sys-kernel/rt-sources/rt-sources-4.18.7_p5.ebuild b/sys-kernel/rt-sources/rt-sources-4.18.7_p5.ebuild
new file mode 100644
index 0000000..d65a86c
--- /dev/null
+++ b/sys-kernel/rt-sources/rt-sources-4.18.7_p5.ebuild
@@ -0,0 +1,54 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+ETYPE="sources"
+KEYWORDS="~amd64"
+
+HOMEPAGE="https://www.kernel.org/pub/linux/kernel/projects/rt/"
+
+inherit eapi7-ver
+
+CKV="$(ver_cut 1-3)"
+K_SECURITY_UNSUPPORTED="1"
+K_DEBLOB_AVAILABLE="1"
+RT_PATCHSET="${PV/*_p}"
+
+inherit kernel-2
+detect_version
+
+K_BRANCH_ID="${KV_MAJOR}.${KV_MINOR}"
+RT_FILE="patch-${K_BRANCH_ID}.${KV_PATCH}-rt${RT_PATCHSET}.patch.xz"
+RT_URI="mirror://kernel/linux/kernel/projects/rt/${K_BRANCH_ID}/${RT_FILE} \
+		mirror://kernel/linux/kernel/projects/rt/${K_BRANCH_ID}/older/${RT_FILE}"
+
+DESCRIPTION="Full Linux ${K_BRANCH_ID} kernel sources with the CONFIG_PREEMPT_RT patch"
+SRC_URI="${KERNEL_URI} ${RT_URI}"
+
+KV_FULL="${PVR/_p/-rt}"
+S="${WORKDIR}/linux-${KV_FULL}"
+
+UNIPATCH_LIST="${DISTDIR}/${RT_FILE}"
+UNIPATCH_STRICTORDER="yes"
+
+src_prepare() {
+	default
+
+	# 627796
+	sed \
+		"s/default PREEMPT_NONE/default PREEMPT_RT_FULL/g" \
+		-i "${S}/kernel/Kconfig.preempt"
+}
+
+pkg_postinst() {
+	kernel-2_pkg_postinst
+	ewarn
+	ewarn "${PN} are *not* supported by the Gentoo Kernel Project in any way."
+	ewarn "If you need support, please contact the RT project developers directly."
+	ewarn "Do *not* open bugs in Gentoo's bugzilla unless you have issues with"
+	ewarn "the ebuilds."
+	ewarn
+}
+
+K_EXTRAEINFO="For more info on rt-sources and details on how to report problems, see: \
+${HOMEPAGE}."

diff --git a/sys-kernel/rt-sources/rt-sources-4.4.148_p165.ebuild b/sys-kernel/rt-sources/rt-sources-4.4.148_p165.ebuild
new file mode 100644
index 0000000..6ec80f7
--- /dev/null
+++ b/sys-kernel/rt-sources/rt-sources-4.4.148_p165.ebuild
@@ -0,0 +1,58 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+ETYPE="sources"
+KEYWORDS="~amd64"
+
+HOMEPAGE="https://www.kernel.org/pub/linux/kernel/projects/rt/"
+
+inherit eapi7-ver
+
+CKV="$(ver_cut 1-3)"
+K_SECURITY_UNSUPPORTED="1"
+K_DEBLOB_AVAILABLE="1"
+RT_PATCHSET="${PV/*_p}"
+
+inherit kernel-2
+detect_version
+
+K_BRANCH_ID="${KV_MAJOR}.${KV_MINOR}"
+RT_FILE="patch-${K_BRANCH_ID}.${KV_PATCH}-rt${RT_PATCHSET}.patch.xz"
+RT_URI="mirror://kernel/linux/kernel/projects/rt/${K_BRANCH_ID}/${RT_FILE} \
+		mirror://kernel/linux/kernel/projects/rt/${K_BRANCH_ID}/older/${RT_FILE}"
+
+DESCRIPTION="Full Linux ${K_BRANCH_ID} kernel sources with the CONFIG_PREEMPT_RT patch"
+SRC_URI="${KERNEL_URI} ${RT_URI}"
+
+KV_FULL="${PVR/_p/-rt}"
+S="${WORKDIR}/linux-${KV_FULL}"
+
+UNIPATCH_LIST="${DISTDIR}/${RT_FILE}"
+UNIPATCH_STRICTORDER="yes"
+
+PATCHES=(
+	"${FILESDIR}"/rt-sources-posix-printf.patch # 627068
+)
+
+src_prepare() {
+	default
+
+	# 627796
+	sed \
+		"s/default PREEMPT_NONE/default PREEMPT_RT_FULL/g" \
+		-i "${S}/kernel/Kconfig.preempt"
+}
+
+pkg_postinst() {
+	kernel-2_pkg_postinst
+	ewarn
+	ewarn "${PN} are *not* supported by the Gentoo Kernel Project in any way."
+	ewarn "If you need support, please contact the RT project developers directly."
+	ewarn "Do *not* open bugs in Gentoo's bugzilla unless you have issues with"
+	ewarn "the ebuilds."
+	ewarn
+}
+
+K_EXTRAEINFO="For more info on rt-sources and details on how to report problems, see: \
+${HOMEPAGE}."

diff --git a/sys-kernel/rt-sources/rt-sources-4.4.157_p174.ebuild b/sys-kernel/rt-sources/rt-sources-4.4.157_p174.ebuild
new file mode 100644
index 0000000..14daca2
--- /dev/null
+++ b/sys-kernel/rt-sources/rt-sources-4.4.157_p174.ebuild
@@ -0,0 +1,58 @@
+# Copyright 1999-2018 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+ETYPE="sources"
+KEYWORDS="~amd64"
+
+HOMEPAGE="https://www.kernel.org/pub/linux/kernel/projects/rt/"
+
+inherit eapi7-ver
+
+CKV="$(ver_cut 1-3)"
+K_SECURITY_UNSUPPORTED="1"
+K_DEBLOB_AVAILABLE="1"
+RT_PATCHSET="${PV/*_p}"
+
+inherit kernel-2
+detect_version
+
+K_BRANCH_ID="${KV_MAJOR}.${KV_MINOR}"
+RT_FILE="patch-${K_BRANCH_ID}.${KV_PATCH}-rt${RT_PATCHSET}.patch.xz"
+RT_URI="mirror://kernel/linux/kernel/projects/rt/${K_BRANCH_ID}/${RT_FILE} \
+		mirror://kernel/linux/kernel/projects/rt/${K_BRANCH_ID}/older/${RT_FILE}"
+
+DESCRIPTION="Full Linux ${K_BRANCH_ID} kernel sources with the CONFIG_PREEMPT_RT patch"
+SRC_URI="${KERNEL_URI} ${RT_URI}"
+
+KV_FULL="${PVR/_p/-rt}"
+S="${WORKDIR}/linux-${KV_FULL}"
+
+UNIPATCH_LIST="${DISTDIR}/${RT_FILE}"
+UNIPATCH_STRICTORDER="yes"
+
+PATCHES=(
+	"${FILESDIR}"/rt-sources-posix-printf.patch # 627068
+)
+
+src_prepare() {
+	default
+
+	# 627796
+	sed \
+		"s/default PREEMPT_NONE/default PREEMPT_RT_FULL/g" \
+		-i "${S}/kernel/Kconfig.preempt" || die "sed failed"
+}
+
+pkg_postinst() {
+	kernel-2_pkg_postinst
+	ewarn
+	ewarn "${PN} are *not* supported by the Gentoo Kernel Project in any way."
+	ewarn "If you need support, please contact the RT project developers directly."
+	ewarn "Do *not* open bugs in Gentoo's bugzilla unless you have issues with"
+	ewarn "the ebuilds."
+	ewarn
+}
+
+K_EXTRAEINFO="For more info on rt-sources and details on how to report problems, see: \
+${HOMEPAGE}."

diff --git a/sys-kernel/rt-sources/rt-sources-4.4.162_p175.ebuild b/sys-kernel/rt-sources/rt-sources-4.4.162_p175.ebuild
new file mode 100644
index 0000000..14daca2
--- /dev/null
+++ b/sys-kernel/rt-sources/rt-sources-4.4.162_p175.ebuild
@@ -0,0 +1,58 @@
+# Copyright 1999-2018 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+ETYPE="sources"
+KEYWORDS="~amd64"
+
+HOMEPAGE="https://www.kernel.org/pub/linux/kernel/projects/rt/"
+
+inherit eapi7-ver
+
+CKV="$(ver_cut 1-3)"
+K_SECURITY_UNSUPPORTED="1"
+K_DEBLOB_AVAILABLE="1"
+RT_PATCHSET="${PV/*_p}"
+
+inherit kernel-2
+detect_version
+
+K_BRANCH_ID="${KV_MAJOR}.${KV_MINOR}"
+RT_FILE="patch-${K_BRANCH_ID}.${KV_PATCH}-rt${RT_PATCHSET}.patch.xz"
+RT_URI="mirror://kernel/linux/kernel/projects/rt/${K_BRANCH_ID}/${RT_FILE} \
+		mirror://kernel/linux/kernel/projects/rt/${K_BRANCH_ID}/older/${RT_FILE}"
+
+DESCRIPTION="Full Linux ${K_BRANCH_ID} kernel sources with the CONFIG_PREEMPT_RT patch"
+SRC_URI="${KERNEL_URI} ${RT_URI}"
+
+KV_FULL="${PVR/_p/-rt}"
+S="${WORKDIR}/linux-${KV_FULL}"
+
+UNIPATCH_LIST="${DISTDIR}/${RT_FILE}"
+UNIPATCH_STRICTORDER="yes"
+
+PATCHES=(
+	"${FILESDIR}"/rt-sources-posix-printf.patch # 627068
+)
+
+src_prepare() {
+	default
+
+	# 627796
+	sed \
+		"s/default PREEMPT_NONE/default PREEMPT_RT_FULL/g" \
+		-i "${S}/kernel/Kconfig.preempt" || die "sed failed"
+}
+
+pkg_postinst() {
+	kernel-2_pkg_postinst
+	ewarn
+	ewarn "${PN} are *not* supported by the Gentoo Kernel Project in any way."
+	ewarn "If you need support, please contact the RT project developers directly."
+	ewarn "Do *not* open bugs in Gentoo's bugzilla unless you have issues with"
+	ewarn "the ebuilds."
+	ewarn
+}
+
+K_EXTRAEINFO="For more info on rt-sources and details on how to report problems, see: \
+${HOMEPAGE}."

diff --git a/sys-kernel/rt-sources/rt-sources-4.9.115_p93.ebuild b/sys-kernel/rt-sources/rt-sources-4.9.115_p93.ebuild
new file mode 100644
index 0000000..14daca2
--- /dev/null
+++ b/sys-kernel/rt-sources/rt-sources-4.9.115_p93.ebuild
@@ -0,0 +1,58 @@
+# Copyright 1999-2018 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+ETYPE="sources"
+KEYWORDS="~amd64"
+
+HOMEPAGE="https://www.kernel.org/pub/linux/kernel/projects/rt/"
+
+inherit eapi7-ver
+
+CKV="$(ver_cut 1-3)"
+K_SECURITY_UNSUPPORTED="1"
+K_DEBLOB_AVAILABLE="1"
+RT_PATCHSET="${PV/*_p}"
+
+inherit kernel-2
+detect_version
+
+K_BRANCH_ID="${KV_MAJOR}.${KV_MINOR}"
+RT_FILE="patch-${K_BRANCH_ID}.${KV_PATCH}-rt${RT_PATCHSET}.patch.xz"
+RT_URI="mirror://kernel/linux/kernel/projects/rt/${K_BRANCH_ID}/${RT_FILE} \
+		mirror://kernel/linux/kernel/projects/rt/${K_BRANCH_ID}/older/${RT_FILE}"
+
+DESCRIPTION="Full Linux ${K_BRANCH_ID} kernel sources with the CONFIG_PREEMPT_RT patch"
+SRC_URI="${KERNEL_URI} ${RT_URI}"
+
+KV_FULL="${PVR/_p/-rt}"
+S="${WORKDIR}/linux-${KV_FULL}"
+
+UNIPATCH_LIST="${DISTDIR}/${RT_FILE}"
+UNIPATCH_STRICTORDER="yes"
+
+PATCHES=(
+	"${FILESDIR}"/rt-sources-posix-printf.patch # 627068
+)
+
+src_prepare() {
+	default
+
+	# 627796
+	sed \
+		"s/default PREEMPT_NONE/default PREEMPT_RT_FULL/g" \
+		-i "${S}/kernel/Kconfig.preempt" || die "sed failed"
+}
+
+pkg_postinst() {
+	kernel-2_pkg_postinst
+	ewarn
+	ewarn "${PN} are *not* supported by the Gentoo Kernel Project in any way."
+	ewarn "If you need support, please contact the RT project developers directly."
+	ewarn "Do *not* open bugs in Gentoo's bugzilla unless you have issues with"
+	ewarn "the ebuilds."
+	ewarn
+}
+
+K_EXTRAEINFO="For more info on rt-sources and details on how to report problems, see: \
+${HOMEPAGE}."

diff --git a/sys-kernel/spl/metadata.xml b/sys-kernel/spl/metadata.xml
new file mode 100644
index 0000000..b51664d
--- /dev/null
+++ b/sys-kernel/spl/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>ryao@gentoo.org</email>
+		<name>Richard Yao</name>
+	</maintainer>
+	<maintainer type="person">
+		<email>gyakovlev@gentoo.org</email>
+		<name>Georgy Yakovlev</name>
+	</maintainer>
+	<upstream>
+		<remote-id type="github">zfsonlinux/spl</remote-id>
+	</upstream>
+</pkgmetadata>

diff --git a/sys-kernel/spl/spl-0.6.5.11.ebuild b/sys-kernel/spl/spl-0.6.5.11.ebuild
new file mode 100644
index 0000000..d527d29
--- /dev/null
+++ b/sys-kernel/spl/spl-0.6.5.11.ebuild
@@ -0,0 +1,112 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+if [[ ${PV} == "9999" ]] ; then
+	AUTOTOOLS_AUTORECONF="1"
+	EGIT_REPO_URI="https://github.com/zfsonlinux/${PN}.git"
+	inherit git-r3
+else
+	SRC_URI="https://github.com/zfsonlinux/zfs/releases/download/zfs-${PV}/${P}.tar.gz"
+	KEYWORDS="amd64"
+fi
+
+inherit flag-o-matic linux-info linux-mod autotools-utils
+
+DESCRIPTION="The Solaris Porting Layer provides many of the Solaris kernel APIs"
+HOMEPAGE="http://zfsonlinux.org/"
+
+LICENSE="GPL-2"
+SLOT="0"
+IUSE="custom-cflags debug"
+RESTRICT="debug? ( strip ) test"
+
+COMMON_DEPEND="
+	dev-lang/perl
+	virtual/awk"
+
+DEPEND="${COMMON_DEPEND}"
+
+RDEPEND="${COMMON_DEPEND}
+	!sys-devel/spl"
+
+AT_M4DIR="config"
+AUTOTOOLS_IN_SOURCE_BUILD="1"
+DOCS=( AUTHORS DISCLAIMER )
+
+pkg_setup() {
+	linux-info_pkg_setup
+	CONFIG_CHECK="
+		!DEBUG_LOCK_ALLOC
+		!CONFIG_REISER4_FS
+		MODULES
+		KALLSYMS
+		!PAX_KERNEXEC_PLUGIN_METHOD_OR
+		!PAX_SIZE_OVERFLOW
+		ZLIB_DEFLATE
+		ZLIB_INFLATE
+	"
+
+	use debug && CONFIG_CHECK="${CONFIG_CHECK}
+		FRAME_POINTER
+		DEBUG_INFO
+		!DEBUG_INFO_REDUCED
+	"
+
+	kernel_is ge 2 6 32 || die "Linux 2.6.32 or newer required"
+
+	[ ${PV} != "9999" ] && \
+		{ kernel_is le 4 12 || die "Linux 4.12 is the latest supported version."; }
+
+	check_extra_config
+}
+
+src_prepare() {
+	# Workaround for hard coded path
+	sed -i "s|/sbin/lsmod|/bin/lsmod|" "${S}/scripts/check.sh" || \
+		die "Cannot patch check.sh"
+
+	# splat is unnecessary unless we are debugging
+	use debug || { sed -e 's/^subdir-m += splat$//' -i "${S}/module/Makefile.in" || die ; }
+
+	# Set module revision number
+	[ ${PV} != "9999" ] && \
+		{ sed -i "s/\(Release:\)\(.*\)1/\1\2${PR}-gentoo/" "${S}/META" || die "Could not set Gentoo release"; }
+
+	autotools-utils_src_prepare
+}
+
+src_configure() {
+	use custom-cflags || strip-flags
+	filter-ldflags -Wl,*
+
+	set_arch_to_kernel
+	local myeconfargs=(
+		--bindir="${EPREFIX}/bin"
+		--sbindir="${EPREFIX}/sbin"
+		--with-config=all
+		--with-linux="${KV_DIR}"
+		--with-linux-obj="${KV_OUT_DIR}"
+		$(use_enable debug)
+	)
+	autotools-utils_src_configure
+}
+
+src_install() {
+	autotools-utils_src_install INSTALL_MOD_PATH="${INSTALL_MOD_PATH:-$EROOT}"
+}
+
+pkg_postinst() {
+	linux-mod_pkg_postinst
+
+	# Remove old modules
+	if [ -d "${EROOT}lib/modules/${KV_FULL}/addon/spl" ]
+	then
+		ewarn "${PN} now installs modules in ${EROOT}lib/modules/${KV_FULL}/extra/spl"
+		ewarn "Old modules were detected in ${EROOT}lib/modules/${KV_FULL}/addon/spl"
+		ewarn "Automatically removing old modules to avoid problems."
+		rm -r "${EROOT}lib/modules/${KV_FULL}/addon/spl" || die "Cannot remove modules"
+		rmdir --ignore-fail-on-non-empty "${EROOT}lib/modules/${KV_FULL}/addon"
+	fi
+}

diff --git a/sys-kernel/spl/spl-0.7.11.ebuild b/sys-kernel/spl/spl-0.7.11.ebuild
new file mode 100644
index 0000000..59fcff4
--- /dev/null
+++ b/sys-kernel/spl/spl-0.7.11.ebuild
@@ -0,0 +1,111 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+if [[ ${PV} == "9999" ]] ; then
+	AUTOTOOLS_AUTORECONF="1"
+	EGIT_REPO_URI="https://github.com/zfsonlinux/${PN}.git"
+	inherit git-r3
+else
+	SRC_URI="https://github.com/zfsonlinux/zfs/releases/download/zfs-${PV}/${P}.tar.gz"
+	KEYWORDS="~amd64"
+fi
+
+inherit flag-o-matic linux-info linux-mod autotools-utils
+
+DESCRIPTION="The Solaris Porting Layer provides many of the Solaris kernel APIs"
+HOMEPAGE="http://zfsonlinux.org/"
+
+LICENSE="GPL-2"
+SLOT="0"
+IUSE="custom-cflags debug"
+RESTRICT="debug? ( strip ) test"
+
+COMMON_DEPEND="
+	dev-lang/perl
+	virtual/awk"
+
+DEPEND="${COMMON_DEPEND}"
+
+RDEPEND="${COMMON_DEPEND}
+	!sys-devel/spl"
+
+AT_M4DIR="config"
+AUTOTOOLS_IN_SOURCE_BUILD="1"
+DOCS=( AUTHORS DISCLAIMER )
+
+pkg_setup() {
+	linux-info_pkg_setup
+	CONFIG_CHECK="
+		!DEBUG_LOCK_ALLOC
+		MODULES
+		KALLSYMS
+		!PAX_KERNEXEC_PLUGIN_METHOD_OR
+		!PAX_SIZE_OVERFLOW
+		ZLIB_DEFLATE
+		ZLIB_INFLATE
+	"
+
+	use debug && CONFIG_CHECK="${CONFIG_CHECK}
+		FRAME_POINTER
+		DEBUG_INFO
+		!DEBUG_INFO_REDUCED
+	"
+
+	kernel_is ge 2 6 32 || die "Linux 2.6.32 or newer required"
+
+	[ ${PV} != "9999" ] && \
+		{ kernel_is le 4 18 || die "Linux 4.18 is the latest supported version."; }
+
+	check_extra_config
+}
+
+src_prepare() {
+	# Workaround for hard coded path
+	sed -i "s|/sbin/lsmod|/bin/lsmod|" "${S}/scripts/check.sh" || \
+		die "Cannot patch check.sh"
+
+	# splat is unnecessary unless we are debugging
+	use debug || { sed -e 's/^subdir-m += splat$//' -i "${S}/module/Makefile.in" || die ; }
+
+	# Set module revision number
+	[ ${PV} != "9999" ] && \
+		{ sed -i "s/\(Release:\)\(.*\)1/\1\2${PR}-gentoo/" "${S}/META" || die "Could not set Gentoo release"; }
+
+	autotools-utils_src_prepare
+}
+
+src_configure() {
+	use custom-cflags || strip-flags
+	filter-ldflags -Wl,*
+
+	set_arch_to_kernel
+	local myeconfargs=(
+		--bindir="${EPREFIX}/bin"
+		--sbindir="${EPREFIX}/sbin"
+		--with-config=all
+		--with-linux="${KV_DIR}"
+		--with-linux-obj="${KV_OUT_DIR}"
+		$(use_enable debug)
+	)
+	autotools-utils_src_configure
+}
+
+src_install() {
+	autotools-utils_src_install INSTALL_MOD_PATH="${INSTALL_MOD_PATH:-$EROOT}"
+}
+
+pkg_postinst() {
+	linux-mod_pkg_postinst
+
+	# Remove old modules
+	if [ -d "${EROOT}lib/modules/${KV_FULL}/addon/spl" ]
+	then
+		ewarn "${PN} now installs modules in ${EROOT}lib/modules/${KV_FULL}/extra/spl"
+		ewarn "Old modules were detected in ${EROOT}lib/modules/${KV_FULL}/addon/spl"
+		ewarn "Automatically removing old modules to avoid problems."
+		rm -r "${EROOT}lib/modules/${KV_FULL}/addon/spl" || die "Cannot remove modules"
+		rmdir --ignore-fail-on-non-empty "${EROOT}lib/modules/${KV_FULL}/addon"
+	fi
+}

diff --git a/sys-kernel/spl/spl-0.7.8.ebuild b/sys-kernel/spl/spl-0.7.8.ebuild
new file mode 100644
index 0000000..871dba5
--- /dev/null
+++ b/sys-kernel/spl/spl-0.7.8.ebuild
@@ -0,0 +1,111 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+if [[ ${PV} == "9999" ]] ; then
+	AUTOTOOLS_AUTORECONF="1"
+	EGIT_REPO_URI="https://github.com/zfsonlinux/${PN}.git"
+	inherit git-r3
+else
+	SRC_URI="https://github.com/zfsonlinux/zfs/releases/download/zfs-${PV}/${P}.tar.gz"
+	KEYWORDS="amd64"
+fi
+
+inherit flag-o-matic linux-info linux-mod autotools-utils
+
+DESCRIPTION="The Solaris Porting Layer provides many of the Solaris kernel APIs"
+HOMEPAGE="http://zfsonlinux.org/"
+
+LICENSE="GPL-2"
+SLOT="0"
+IUSE="custom-cflags debug"
+RESTRICT="debug? ( strip ) test"
+
+COMMON_DEPEND="
+	dev-lang/perl
+	virtual/awk"
+
+DEPEND="${COMMON_DEPEND}"
+
+RDEPEND="${COMMON_DEPEND}
+	!sys-devel/spl"
+
+AT_M4DIR="config"
+AUTOTOOLS_IN_SOURCE_BUILD="1"
+DOCS=( AUTHORS DISCLAIMER )
+
+pkg_setup() {
+	linux-info_pkg_setup
+	CONFIG_CHECK="
+		!DEBUG_LOCK_ALLOC
+		MODULES
+		KALLSYMS
+		!PAX_KERNEXEC_PLUGIN_METHOD_OR
+		!PAX_SIZE_OVERFLOW
+		ZLIB_DEFLATE
+		ZLIB_INFLATE
+	"
+
+	use debug && CONFIG_CHECK="${CONFIG_CHECK}
+		FRAME_POINTER
+		DEBUG_INFO
+		!DEBUG_INFO_REDUCED
+	"
+
+	kernel_is ge 2 6 32 || die "Linux 2.6.32 or newer required"
+
+	[ ${PV} != "9999" ] && \
+		{ kernel_is le 4 16 || die "Linux 4.16 is the latest supported version."; }
+
+	check_extra_config
+}
+
+src_prepare() {
+	# Workaround for hard coded path
+	sed -i "s|/sbin/lsmod|/bin/lsmod|" "${S}/scripts/check.sh" || \
+		die "Cannot patch check.sh"
+
+	# splat is unnecessary unless we are debugging
+	use debug || { sed -e 's/^subdir-m += splat$//' -i "${S}/module/Makefile.in" || die ; }
+
+	# Set module revision number
+	[ ${PV} != "9999" ] && \
+		{ sed -i "s/\(Release:\)\(.*\)1/\1\2${PR}-gentoo/" "${S}/META" || die "Could not set Gentoo release"; }
+
+	autotools-utils_src_prepare
+}
+
+src_configure() {
+	use custom-cflags || strip-flags
+	filter-ldflags -Wl,*
+
+	set_arch_to_kernel
+	local myeconfargs=(
+		--bindir="${EPREFIX}/bin"
+		--sbindir="${EPREFIX}/sbin"
+		--with-config=all
+		--with-linux="${KV_DIR}"
+		--with-linux-obj="${KV_OUT_DIR}"
+		$(use_enable debug)
+	)
+	autotools-utils_src_configure
+}
+
+src_install() {
+	autotools-utils_src_install INSTALL_MOD_PATH="${INSTALL_MOD_PATH:-$EROOT}"
+}
+
+pkg_postinst() {
+	linux-mod_pkg_postinst
+
+	# Remove old modules
+	if [ -d "${EROOT}lib/modules/${KV_FULL}/addon/spl" ]
+	then
+		ewarn "${PN} now installs modules in ${EROOT}lib/modules/${KV_FULL}/extra/spl"
+		ewarn "Old modules were detected in ${EROOT}lib/modules/${KV_FULL}/addon/spl"
+		ewarn "Automatically removing old modules to avoid problems."
+		rm -r "${EROOT}lib/modules/${KV_FULL}/addon/spl" || die "Cannot remove modules"
+		rmdir --ignore-fail-on-non-empty "${EROOT}lib/modules/${KV_FULL}/addon"
+	fi
+}

diff --git a/sys-kernel/spl/spl-0.7.9-r1.ebuild b/sys-kernel/spl/spl-0.7.9-r1.ebuild
new file mode 100644
index 0000000..8d4bead
--- /dev/null
+++ b/sys-kernel/spl/spl-0.7.9-r1.ebuild
@@ -0,0 +1,120 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+AUTOTOOLS_AUTORECONF="1"
+if [[ ${PV} == "9999" ]] ; then
+	EGIT_REPO_URI="https://github.com/zfsonlinux/${PN}.git"
+	inherit git-r3
+else
+	SRC_URI="https://github.com/zfsonlinux/zfs/releases/download/zfs-${PV}/${P}.tar.gz
+		https://dev.gentoo.org/~ryao/dist/${PF}-patches.tar.xz"
+	KEYWORDS="~amd64"
+fi
+
+inherit flag-o-matic linux-info linux-mod autotools-utils
+
+DESCRIPTION="The Solaris Porting Layer provides many of the Solaris kernel APIs"
+HOMEPAGE="http://zfsonlinux.org/"
+
+LICENSE="GPL-2"
+SLOT="0"
+IUSE="custom-cflags debug"
+RESTRICT="debug? ( strip ) test"
+
+COMMON_DEPEND="
+	dev-lang/perl
+	virtual/awk"
+
+DEPEND="${COMMON_DEPEND}"
+
+RDEPEND="${COMMON_DEPEND}
+	!sys-devel/spl"
+
+AT_M4DIR="config"
+AUTOTOOLS_IN_SOURCE_BUILD="1"
+DOCS=( AUTHORS DISCLAIMER )
+
+pkg_setup() {
+	linux-info_pkg_setup
+	CONFIG_CHECK="
+		!DEBUG_LOCK_ALLOC
+		MODULES
+		KALLSYMS
+		!PAX_KERNEXEC_PLUGIN_METHOD_OR
+		!PAX_SIZE_OVERFLOW
+		ZLIB_DEFLATE
+		ZLIB_INFLATE
+	"
+
+	use debug && CONFIG_CHECK="${CONFIG_CHECK}
+		FRAME_POINTER
+		DEBUG_INFO
+		!DEBUG_INFO_REDUCED
+	"
+
+	kernel_is ge 2 6 32 || die "Linux 2.6.32 or newer required"
+
+	[ ${PV} != "9999" ] && \
+		{ kernel_is le 4 18 || die "Linux 4.18 is the latest supported version."; }
+
+	check_extra_config
+}
+
+src_prepare() {
+	if [ ${PV} != "9999" ]
+	then
+		# Apply patch set
+		EPATCH_SUFFIX="patch" \
+		EPATCH_FORCE="yes" \
+		epatch "${WORKDIR}/${PF}-patches"
+	fi
+
+	# Workaround for hard coded path
+	sed -i "s|/sbin/lsmod|/bin/lsmod|" "${S}/scripts/check.sh" || \
+		die "Cannot patch check.sh"
+
+	# splat is unnecessary unless we are debugging
+	use debug || { sed -e 's/^subdir-m += splat$//' -i "${S}/module/Makefile.in" || die ; }
+
+	# Set module revision number
+	[ ${PV} != "9999" ] && \
+		{ sed -i "s/\(Release:\)\(.*\)1/\1\2${PR}-gentoo/" "${S}/META" || die "Could not set Gentoo release"; }
+
+	autotools-utils_src_prepare
+}
+
+src_configure() {
+	use custom-cflags || strip-flags
+	filter-ldflags -Wl,*
+
+	set_arch_to_kernel
+	local myeconfargs=(
+		--bindir="${EPREFIX}/bin"
+		--sbindir="${EPREFIX}/sbin"
+		--with-config=all
+		--with-linux="${KV_DIR}"
+		--with-linux-obj="${KV_OUT_DIR}"
+		$(use_enable debug)
+	)
+	autotools-utils_src_configure
+}
+
+src_install() {
+	autotools-utils_src_install INSTALL_MOD_PATH="${INSTALL_MOD_PATH:-$EROOT}"
+}
+
+pkg_postinst() {
+	linux-mod_pkg_postinst
+
+	# Remove old modules
+	if [ -d "${EROOT}lib/modules/${KV_FULL}/addon/spl" ]
+	then
+		ewarn "${PN} now installs modules in ${EROOT}lib/modules/${KV_FULL}/extra/spl"
+		ewarn "Old modules were detected in ${EROOT}lib/modules/${KV_FULL}/addon/spl"
+		ewarn "Automatically removing old modules to avoid problems."
+		rm -r "${EROOT}lib/modules/${KV_FULL}/addon/spl" || die "Cannot remove modules"
+		rmdir --ignore-fail-on-non-empty "${EROOT}lib/modules/${KV_FULL}/addon"
+	fi
+}

diff --git a/sys-kernel/spl/spl-0.7.9.ebuild b/sys-kernel/spl/spl-0.7.9.ebuild
new file mode 100644
index 0000000..5295e9d
--- /dev/null
+++ b/sys-kernel/spl/spl-0.7.9.ebuild
@@ -0,0 +1,111 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+if [[ ${PV} == "9999" ]] ; then
+	AUTOTOOLS_AUTORECONF="1"
+	EGIT_REPO_URI="https://github.com/zfsonlinux/${PN}.git"
+	inherit git-r3
+else
+	SRC_URI="https://github.com/zfsonlinux/zfs/releases/download/zfs-${PV}/${P}.tar.gz"
+	KEYWORDS="amd64"
+fi
+
+inherit flag-o-matic linux-info linux-mod autotools-utils
+
+DESCRIPTION="The Solaris Porting Layer provides many of the Solaris kernel APIs"
+HOMEPAGE="http://zfsonlinux.org/"
+
+LICENSE="GPL-2"
+SLOT="0"
+IUSE="custom-cflags debug"
+RESTRICT="debug? ( strip ) test"
+
+COMMON_DEPEND="
+	dev-lang/perl
+	virtual/awk"
+
+DEPEND="${COMMON_DEPEND}"
+
+RDEPEND="${COMMON_DEPEND}
+	!sys-devel/spl"
+
+AT_M4DIR="config"
+AUTOTOOLS_IN_SOURCE_BUILD="1"
+DOCS=( AUTHORS DISCLAIMER )
+
+pkg_setup() {
+	linux-info_pkg_setup
+	CONFIG_CHECK="
+		!DEBUG_LOCK_ALLOC
+		MODULES
+		KALLSYMS
+		!PAX_KERNEXEC_PLUGIN_METHOD_OR
+		!PAX_SIZE_OVERFLOW
+		ZLIB_DEFLATE
+		ZLIB_INFLATE
+	"
+
+	use debug && CONFIG_CHECK="${CONFIG_CHECK}
+		FRAME_POINTER
+		DEBUG_INFO
+		!DEBUG_INFO_REDUCED
+	"
+
+	kernel_is ge 2 6 32 || die "Linux 2.6.32 or newer required"
+
+	[ ${PV} != "9999" ] && \
+		{ kernel_is le 4 17 || die "Linux 4.17 is the latest supported version."; }
+
+	check_extra_config
+}
+
+src_prepare() {
+	# Workaround for hard coded path
+	sed -i "s|/sbin/lsmod|/bin/lsmod|" "${S}/scripts/check.sh" || \
+		die "Cannot patch check.sh"
+
+	# splat is unnecessary unless we are debugging
+	use debug || { sed -e 's/^subdir-m += splat$//' -i "${S}/module/Makefile.in" || die ; }
+
+	# Set module revision number
+	[ ${PV} != "9999" ] && \
+		{ sed -i "s/\(Release:\)\(.*\)1/\1\2${PR}-gentoo/" "${S}/META" || die "Could not set Gentoo release"; }
+
+	autotools-utils_src_prepare
+}
+
+src_configure() {
+	use custom-cflags || strip-flags
+	filter-ldflags -Wl,*
+
+	set_arch_to_kernel
+	local myeconfargs=(
+		--bindir="${EPREFIX}/bin"
+		--sbindir="${EPREFIX}/sbin"
+		--with-config=all
+		--with-linux="${KV_DIR}"
+		--with-linux-obj="${KV_OUT_DIR}"
+		$(use_enable debug)
+	)
+	autotools-utils_src_configure
+}
+
+src_install() {
+	autotools-utils_src_install INSTALL_MOD_PATH="${INSTALL_MOD_PATH:-$EROOT}"
+}
+
+pkg_postinst() {
+	linux-mod_pkg_postinst
+
+	# Remove old modules
+	if [ -d "${EROOT}lib/modules/${KV_FULL}/addon/spl" ]
+	then
+		ewarn "${PN} now installs modules in ${EROOT}lib/modules/${KV_FULL}/extra/spl"
+		ewarn "Old modules were detected in ${EROOT}lib/modules/${KV_FULL}/addon/spl"
+		ewarn "Automatically removing old modules to avoid problems."
+		rm -r "${EROOT}lib/modules/${KV_FULL}/addon/spl" || die "Cannot remove modules"
+		rmdir --ignore-fail-on-non-empty "${EROOT}lib/modules/${KV_FULL}/addon"
+	fi
+}

diff --git a/sys-kernel/spl/spl-0.7.9999.ebuild b/sys-kernel/spl/spl-0.7.9999.ebuild
new file mode 100644
index 0000000..69d32ec
--- /dev/null
+++ b/sys-kernel/spl/spl-0.7.9999.ebuild
@@ -0,0 +1,113 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+if [[ ${PV} == *"9999" ]] ; then
+	AUTOTOOLS_AUTORECONF="1"
+	EGIT_REPO_URI="https://github.com/zfsonlinux/${PN}.git"
+	EGIT_BRANCH="spl-0.7-release"
+	inherit git-r3
+else
+	SRC_URI="https://github.com/zfsonlinux/zfs/releases/download/zfs-${PV}/${P}.tar.gz"
+	KEYWORDS="~amd64 ~arm ~ppc ~ppc64"
+fi
+
+inherit flag-o-matic linux-info linux-mod autotools-utils
+
+DESCRIPTION="The Solaris Porting Layer provides many of the Solaris kernel APIs"
+HOMEPAGE="http://zfsonlinux.org/"
+
+LICENSE="GPL-2"
+SLOT="0"
+IUSE="custom-cflags debug"
+RESTRICT="debug? ( strip ) test"
+
+COMMON_DEPEND="
+	dev-lang/perl
+	virtual/awk"
+
+DEPEND="${COMMON_DEPEND}"
+
+RDEPEND="${COMMON_DEPEND}
+	!sys-devel/spl"
+
+AT_M4DIR="config"
+AUTOTOOLS_IN_SOURCE_BUILD="1"
+DOCS=( AUTHORS DISCLAIMER README.markdown )
+
+pkg_setup() {
+	linux-info_pkg_setup
+	CONFIG_CHECK="
+		!DEBUG_LOCK_ALLOC
+		!CONFIG_REISER4_FS
+		!GRKERNSEC_RANDSTRUCT
+		KALLSYMS
+		MODULES
+		!PAX_KERNEXEC_PLUGIN_METHOD_OR
+		ZLIB_DEFLATE
+		ZLIB_INFLATE
+	"
+
+	use debug && CONFIG_CHECK="${CONFIG_CHECK}
+		FRAME_POINTER
+		DEBUG_INFO
+		!DEBUG_INFO_REDUCED
+	"
+
+	kernel_is ge 2 6 32 || die "Linux 2.6.32 or newer required"
+
+	[ ${PV} != *"9999" ] && \
+		{ kernel_is le 4 17 || die "Linux 4.17 is the latest supported version."; }
+
+	check_extra_config
+}
+
+src_prepare() {
+	# Workaround for hard coded path
+	sed -i "s|/sbin/lsmod|/bin/lsmod|" "${S}/scripts/check.sh" || \
+		die "Cannot patch check.sh"
+
+	# splat is unnecessary unless we are debugging
+	use debug || { sed -e 's/^subdir-m += splat$//' -i "${S}/module/Makefile.in" || die ; }
+
+	# Set module revision number
+	[ ${PV} != *"9999" ] && \
+		{ sed -i "s/\(Release:\)\(.*\)1/\1\2${PR}-gentoo/" "${S}/META" || die "Could not set Gentoo release"; }
+
+	autotools-utils_src_prepare
+}
+
+src_configure() {
+	use custom-cflags || strip-flags
+	filter-ldflags -Wl,*
+
+	set_arch_to_kernel
+	local myeconfargs=(
+		--bindir="${EPREFIX}/bin"
+		--sbindir="${EPREFIX}/sbin"
+		--with-config=all
+		--with-linux="${KV_DIR}"
+		--with-linux-obj="${KV_OUT_DIR}"
+		$(use_enable debug)
+	)
+	autotools-utils_src_configure
+}
+
+src_install() {
+	autotools-utils_src_install INSTALL_MOD_PATH="${INSTALL_MOD_PATH:-$EROOT}"
+}
+
+pkg_postinst() {
+	linux-mod_pkg_postinst
+
+	# Remove old modules
+	if [ -d "${EROOT}lib/modules/${KV_FULL}/addon/spl" ]
+	then
+		ewarn "${PN} now installs modules in ${EROOT}lib/modules/${KV_FULL}/extra/spl"
+		ewarn "Old modules were detected in ${EROOT}lib/modules/${KV_FULL}/addon/spl"
+		ewarn "Automatically removing old modules to avoid problems."
+		rm -r "${EROOT}lib/modules/${KV_FULL}/addon/spl" || die "Cannot remove modules"
+		rmdir --ignore-fail-on-non-empty "${EROOT}lib/modules/${KV_FULL}/addon"
+	fi
+}

diff --git a/sys-kernel/spl/spl-9999.ebuild b/sys-kernel/spl/spl-9999.ebuild
new file mode 100644
index 0000000..b39cb38
--- /dev/null
+++ b/sys-kernel/spl/spl-9999.ebuild
@@ -0,0 +1,112 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+if [[ ${PV} == "9999" ]] ; then
+	AUTOTOOLS_AUTORECONF="1"
+	EGIT_REPO_URI="https://github.com/zfsonlinux/${PN}.git"
+	inherit git-r3
+else
+	SRC_URI="https://github.com/zfsonlinux/zfs/releases/download/zfs-${PV}/${P}.tar.gz"
+	KEYWORDS="~amd64 ~arm ~ppc ~ppc64"
+fi
+
+inherit flag-o-matic linux-info linux-mod autotools-utils
+
+DESCRIPTION="The Solaris Porting Layer provides many of the Solaris kernel APIs"
+HOMEPAGE="http://zfsonlinux.org/"
+
+LICENSE="GPL-2"
+SLOT="0"
+IUSE="custom-cflags debug"
+RESTRICT="debug? ( strip ) test"
+
+COMMON_DEPEND="
+	dev-lang/perl
+	virtual/awk"
+
+DEPEND="${COMMON_DEPEND}"
+
+RDEPEND="${COMMON_DEPEND}
+	!sys-devel/spl"
+
+AT_M4DIR="config"
+AUTOTOOLS_IN_SOURCE_BUILD="1"
+DOCS=( AUTHORS DISCLAIMER README.markdown )
+
+pkg_setup() {
+	linux-info_pkg_setup
+	CONFIG_CHECK="
+		!DEBUG_LOCK_ALLOC
+		!CONFIG_REISER4_FS
+		!GRKERNSEC_RANDSTRUCT
+		KALLSYMS
+		MODULES
+		!PAX_KERNEXEC_PLUGIN_METHOD_OR
+		ZLIB_DEFLATE
+		ZLIB_INFLATE
+	"
+
+	use debug && CONFIG_CHECK="${CONFIG_CHECK}
+		FRAME_POINTER
+		DEBUG_INFO
+		!DEBUG_INFO_REDUCED
+	"
+
+	kernel_is ge 2 6 32 || die "Linux 2.6.32 or newer required"
+
+	[ ${PV} != "9999" ] && \
+		{ kernel_is le 4 17 || die "Linux 4.17 is the latest supported version."; }
+
+	check_extra_config
+}
+
+src_prepare() {
+	# Workaround for hard coded path
+	sed -i "s|/sbin/lsmod|/bin/lsmod|" "${S}/scripts/check.sh" || \
+		die "Cannot patch check.sh"
+
+	# splat is unnecessary unless we are debugging
+	use debug || { sed -e 's/^subdir-m += splat$//' -i "${S}/module/Makefile.in" || die ; }
+
+	# Set module revision number
+	[ ${PV} != "9999" ] && \
+		{ sed -i "s/\(Release:\)\(.*\)1/\1\2${PR}-gentoo/" "${S}/META" || die "Could not set Gentoo release"; }
+
+	autotools-utils_src_prepare
+}
+
+src_configure() {
+	use custom-cflags || strip-flags
+	filter-ldflags -Wl,*
+
+	set_arch_to_kernel
+	local myeconfargs=(
+		--bindir="${EPREFIX}/bin"
+		--sbindir="${EPREFIX}/sbin"
+		--with-config=all
+		--with-linux="${KV_DIR}"
+		--with-linux-obj="${KV_OUT_DIR}"
+		$(use_enable debug)
+	)
+	autotools-utils_src_configure
+}
+
+src_install() {
+	autotools-utils_src_install INSTALL_MOD_PATH="${INSTALL_MOD_PATH:-$EROOT}"
+}
+
+pkg_postinst() {
+	linux-mod_pkg_postinst
+
+	# Remove old modules
+	if [ -d "${EROOT}lib/modules/${KV_FULL}/addon/spl" ]
+	then
+		ewarn "${PN} now installs modules in ${EROOT}lib/modules/${KV_FULL}/extra/spl"
+		ewarn "Old modules were detected in ${EROOT}lib/modules/${KV_FULL}/addon/spl"
+		ewarn "Automatically removing old modules to avoid problems."
+		rm -r "${EROOT}lib/modules/${KV_FULL}/addon/spl" || die "Cannot remove modules"
+		rmdir --ignore-fail-on-non-empty "${EROOT}lib/modules/${KV_FULL}/addon"
+	fi
+}

diff --git a/sys-kernel/vanilla-sources/metadata.xml b/sys-kernel/vanilla-sources/metadata.xml
new file mode 100644
index 0000000..23dc092
--- /dev/null
+++ b/sys-kernel/vanilla-sources/metadata.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+	<maintainer type="project">
+		<email>kernel@gentoo.org</email>
+		<name>Gentoo kernel team</name>
+	</maintainer>
+	<maintainer type="person">
+		<email>ago@gentoo.org</email>
+		<name>Agostino Sarubbo</name>
+		<description>CC/Assign to me the version bump request</description>
+	</maintainer>
+	<longdescription>
+		Vanilla prepatch/rc sources, for people who like to have the latest kernel available
+	</longdescription>
+	<upstream>
+		<remote-id type="cpe">cpe:/o:linux:linux_kernel</remote-id>
+	</upstream>
+</pkgmetadata>

diff --git a/sys-kernel/vanilla-sources/vanilla-sources-3.16.60.ebuild b/sys-kernel/vanilla-sources/vanilla-sources-3.16.60.ebuild
new file mode 100644
index 0000000..4d8a280
--- /dev/null
+++ b/sys-kernel/vanilla-sources/vanilla-sources-3.16.60.ebuild
@@ -0,0 +1,16 @@
+# Copyright 1999-2018 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+K_NOUSENAME="yes"
+K_NOSETEXTRAVERSION="yes"
+K_SECURITY_UNSUPPORTED="1"
+ETYPE="sources"
+inherit kernel-2
+detect_version
+
+DESCRIPTION="Full sources for the Linux kernel"
+HOMEPAGE="https://www.kernel.org"
+SRC_URI="${KERNEL_URI}"
+
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"

diff --git a/sys-kernel/vanilla-sources/vanilla-sources-4.14.78.ebuild b/sys-kernel/vanilla-sources/vanilla-sources-4.14.78.ebuild
new file mode 100644
index 0000000..4d8a280
--- /dev/null
+++ b/sys-kernel/vanilla-sources/vanilla-sources-4.14.78.ebuild
@@ -0,0 +1,16 @@
+# Copyright 1999-2018 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+K_NOUSENAME="yes"
+K_NOSETEXTRAVERSION="yes"
+K_SECURITY_UNSUPPORTED="1"
+ETYPE="sources"
+inherit kernel-2
+detect_version
+
+DESCRIPTION="Full sources for the Linux kernel"
+HOMEPAGE="https://www.kernel.org"
+SRC_URI="${KERNEL_URI}"
+
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"

diff --git a/sys-kernel/vanilla-sources/vanilla-sources-4.18.16.ebuild b/sys-kernel/vanilla-sources/vanilla-sources-4.18.16.ebuild
new file mode 100644
index 0000000..4d8a280
--- /dev/null
+++ b/sys-kernel/vanilla-sources/vanilla-sources-4.18.16.ebuild
@@ -0,0 +1,16 @@
+# Copyright 1999-2018 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+K_NOUSENAME="yes"
+K_NOSETEXTRAVERSION="yes"
+K_SECURITY_UNSUPPORTED="1"
+ETYPE="sources"
+inherit kernel-2
+detect_version
+
+DESCRIPTION="Full sources for the Linux kernel"
+HOMEPAGE="https://www.kernel.org"
+SRC_URI="${KERNEL_URI}"
+
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"

diff --git a/sys-kernel/vanilla-sources/vanilla-sources-4.19.0.ebuild b/sys-kernel/vanilla-sources/vanilla-sources-4.19.0.ebuild
new file mode 100644
index 0000000..4d8a280
--- /dev/null
+++ b/sys-kernel/vanilla-sources/vanilla-sources-4.19.0.ebuild
@@ -0,0 +1,16 @@
+# Copyright 1999-2018 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+K_NOUSENAME="yes"
+K_NOSETEXTRAVERSION="yes"
+K_SECURITY_UNSUPPORTED="1"
+ETYPE="sources"
+inherit kernel-2
+detect_version
+
+DESCRIPTION="Full sources for the Linux kernel"
+HOMEPAGE="https://www.kernel.org"
+SRC_URI="${KERNEL_URI}"
+
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"

diff --git a/sys-kernel/vanilla-sources/vanilla-sources-4.4.162.ebuild b/sys-kernel/vanilla-sources/vanilla-sources-4.4.162.ebuild
new file mode 100644
index 0000000..4d8a280
--- /dev/null
+++ b/sys-kernel/vanilla-sources/vanilla-sources-4.4.162.ebuild
@@ -0,0 +1,16 @@
+# Copyright 1999-2018 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+K_NOUSENAME="yes"
+K_NOSETEXTRAVERSION="yes"
+K_SECURITY_UNSUPPORTED="1"
+ETYPE="sources"
+inherit kernel-2
+detect_version
+
+DESCRIPTION="Full sources for the Linux kernel"
+HOMEPAGE="https://www.kernel.org"
+SRC_URI="${KERNEL_URI}"
+
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"

diff --git a/sys-kernel/vanilla-sources/vanilla-sources-4.9.135.ebuild b/sys-kernel/vanilla-sources/vanilla-sources-4.9.135.ebuild
new file mode 100644
index 0000000..4d8a280
--- /dev/null
+++ b/sys-kernel/vanilla-sources/vanilla-sources-4.9.135.ebuild
@@ -0,0 +1,16 @@
+# Copyright 1999-2018 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+K_NOUSENAME="yes"
+K_NOSETEXTRAVERSION="yes"
+K_SECURITY_UNSUPPORTED="1"
+ETYPE="sources"
+inherit kernel-2
+detect_version
+
+DESCRIPTION="Full sources for the Linux kernel"
+HOMEPAGE="https://www.kernel.org"
+SRC_URI="${KERNEL_URI}"
+
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"

diff --git a/sys-kernel/xbox-sources/metadata.xml b/sys-kernel/xbox-sources/metadata.xml
new file mode 100644
index 0000000..dbad95c
--- /dev/null
+++ b/sys-kernel/xbox-sources/metadata.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+	<maintainer type="project">
+		<email>kernel@gentoo.org</email>
+		<name>Gentoo Kernel Project</name>
+	</maintainer>
+	<longdescription>Full sources for the Xbox Linux kernel</longdescription>
+	<upstream>
+		<remote-id type="cpe">cpe:/o:linux:linux_kernel</remote-id>
+		<remote-id type="sourceforge">xbox-linux</remote-id>
+	</upstream>
+</pkgmetadata>

diff --git a/sys-kernel/xbox-sources/xbox-sources-2.6.16.26.ebuild b/sys-kernel/xbox-sources/xbox-sources-2.6.16.26.ebuild
new file mode 100644
index 0000000..9abd75e
--- /dev/null
+++ b/sys-kernel/xbox-sources/xbox-sources-2.6.16.26.ebuild
@@ -0,0 +1,24 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+K_NOUSENAME="yes"
+K_NOSETEXTRAVERSION="yes"
+ETYPE='sources'
+K_SECURITY_UNSUPPORTED="1"
+inherit kernel-2
+detect_arch
+detect_version
+
+# version of gentoo patchset
+XBOX_PATCHES=linux-2.6.16-xbox.patch.gz
+
+KEYWORDS="~x86 -*"
+UNIPATCH_LIST="
+	${ARCH_PATCH}
+	${DISTDIR}/${XBOX_PATCHES}"
+DESCRIPTION="Full sources for the Xbox Linux kernel"
+SRC_URI="${KERNEL_URI}
+	${ARCH_URI}
+	mirror://sourceforge/xbox-linux/${XBOX_PATCHES}"

diff --git a/sys-kernel/zen-sources/metadata.xml b/sys-kernel/zen-sources/metadata.xml
new file mode 100644
index 0000000..fafe9a5
--- /dev/null
+++ b/sys-kernel/zen-sources/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="cpe">cpe:/o:linux:linux_kernel</remote-id>
+</upstream>
+</pkgmetadata>

diff --git a/sys-kernel/zen-sources/zen-sources-4.14.9999.ebuild b/sys-kernel/zen-sources/zen-sources-4.14.9999.ebuild
new file mode 100644
index 0000000..07a3edb
--- /dev/null
+++ b/sys-kernel/zen-sources/zen-sources-4.14.9999.ebuild
@@ -0,0 +1,39 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+K_PREPATCHED="yes"
+UNIPATCH_STRICTORDER="yes"
+K_SECURITY_UNSUPPORTED="1"
+K_DEBLOB_AVAILABLE=0
+CKV="${PV/99/}"
+
+ETYPE="sources"
+
+EGIT_BRANCH="${PV/.9999/}/master"
+EGIT_REPO_URI="https://github.com/zen-kernel/zen-kernel.git"
+
+inherit kernel-2 git-r3
+detect_version
+
+K_NOSETEXTRAVERSION="don't_set_it"
+DESCRIPTION="The Zen Kernel Live Sources"
+HOMEPAGE="https://github.com/zen-kernel"
+
+IUSE=""
+
+KEYWORDS=""
+
+EGIT_CHECKOUT_DIR="${WORKDIR}/linux-${KV_FULL}"
+
+K_EXTRAEINFO="For more info on zen-sources, and for how to report problems, see: \
+${HOMEPAGE}, also go to #zen-sources on freenode"
+
+pkg_setup(){
+	ewarn "Be carefull!! You are about to install live kernel sources."
+	ewarn "Git zen-sources are extremely unsupported, even from the upstream"
+	ewarn "developers. Use them at your own risk and don't bite us if your"
+	ewarn "system explodes"
+	kernel-2_pkg_setup
+}

diff --git a/sys-kernel/zen-sources/zen-sources-4.15.9999.ebuild b/sys-kernel/zen-sources/zen-sources-4.15.9999.ebuild
new file mode 100644
index 0000000..07a3edb
--- /dev/null
+++ b/sys-kernel/zen-sources/zen-sources-4.15.9999.ebuild
@@ -0,0 +1,39 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+K_PREPATCHED="yes"
+UNIPATCH_STRICTORDER="yes"
+K_SECURITY_UNSUPPORTED="1"
+K_DEBLOB_AVAILABLE=0
+CKV="${PV/99/}"
+
+ETYPE="sources"
+
+EGIT_BRANCH="${PV/.9999/}/master"
+EGIT_REPO_URI="https://github.com/zen-kernel/zen-kernel.git"
+
+inherit kernel-2 git-r3
+detect_version
+
+K_NOSETEXTRAVERSION="don't_set_it"
+DESCRIPTION="The Zen Kernel Live Sources"
+HOMEPAGE="https://github.com/zen-kernel"
+
+IUSE=""
+
+KEYWORDS=""
+
+EGIT_CHECKOUT_DIR="${WORKDIR}/linux-${KV_FULL}"
+
+K_EXTRAEINFO="For more info on zen-sources, and for how to report problems, see: \
+${HOMEPAGE}, also go to #zen-sources on freenode"
+
+pkg_setup(){
+	ewarn "Be carefull!! You are about to install live kernel sources."
+	ewarn "Git zen-sources are extremely unsupported, even from the upstream"
+	ewarn "developers. Use them at your own risk and don't bite us if your"
+	ewarn "system explodes"
+	kernel-2_pkg_setup
+}

diff --git a/sys-kernel/zen-sources/zen-sources-4.16.9999.ebuild b/sys-kernel/zen-sources/zen-sources-4.16.9999.ebuild
new file mode 100644
index 0000000..07a3edb
--- /dev/null
+++ b/sys-kernel/zen-sources/zen-sources-4.16.9999.ebuild
@@ -0,0 +1,39 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+K_PREPATCHED="yes"
+UNIPATCH_STRICTORDER="yes"
+K_SECURITY_UNSUPPORTED="1"
+K_DEBLOB_AVAILABLE=0
+CKV="${PV/99/}"
+
+ETYPE="sources"
+
+EGIT_BRANCH="${PV/.9999/}/master"
+EGIT_REPO_URI="https://github.com/zen-kernel/zen-kernel.git"
+
+inherit kernel-2 git-r3
+detect_version
+
+K_NOSETEXTRAVERSION="don't_set_it"
+DESCRIPTION="The Zen Kernel Live Sources"
+HOMEPAGE="https://github.com/zen-kernel"
+
+IUSE=""
+
+KEYWORDS=""
+
+EGIT_CHECKOUT_DIR="${WORKDIR}/linux-${KV_FULL}"
+
+K_EXTRAEINFO="For more info on zen-sources, and for how to report problems, see: \
+${HOMEPAGE}, also go to #zen-sources on freenode"
+
+pkg_setup(){
+	ewarn "Be carefull!! You are about to install live kernel sources."
+	ewarn "Git zen-sources are extremely unsupported, even from the upstream"
+	ewarn "developers. Use them at your own risk and don't bite us if your"
+	ewarn "system explodes"
+	kernel-2_pkg_setup
+}


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2018-11-02  7:24 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-11-02  7:24 [gentoo-commits] repo/proj/kernel:master commit in: sys-kernel/dracut-crypt-ssh/, sys-kernel/linux-headers/, sys-kernel/rt-sources/, Alice Ferrazzi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox