diff options
author | Karel Kočí <karel.koci@nic.cz> | 2017-06-27 09:17:32 +0200 |
---|---|---|
committer | Karel Kočí <karel.koci@nic.cz> | 2017-06-27 09:17:32 +0200 |
commit | 5637ad796aed84edff94d112698ac68d979487b4 (patch) | |
tree | ad895ee5a3bb9434fa2c8219b74cb9b9aed9cbea | |
parent | c2342cc83945e6d2a592c6007f9062fefe62b157 (diff) | |
download | gentoo-personal-overlay-5637ad796aed84edff94d112698ac68d979487b4.tar.gz gentoo-personal-overlay-5637ad796aed84edff94d112698ac68d979487b4.tar.bz2 gentoo-personal-overlay-5637ad796aed84edff94d112698ac68d979487b4.zip |
Linux 4.11.7
-rw-r--r-- | sys-kernel/linux/Manifest | 1 | ||||
-rw-r--r-- | sys-kernel/linux/linux-4.11.7-r1.ebuild | 74 |
2 files changed, 75 insertions, 0 deletions
diff --git a/sys-kernel/linux/Manifest b/sys-kernel/linux/Manifest index e0d7326..346153b 100644 --- a/sys-kernel/linux/Manifest +++ b/sys-kernel/linux/Manifest @@ -1 +1,2 @@ DIST linux-4.11.6.tar.gz 147169967 SHA256 ddab77cf00eb6f439366f9373b34181d1fcdc9a72fe2155af572ff832ba55441 SHA512 d8ae8c51878120e713a9bec7938463ffcdc53d2c8a05bfd90e7db3f405f6aa972c61a1b0639afc5c9a5b3f90cc316e5a2bf0e3e68f5d01b4d7aa84561d09091c WHIRLPOOL 66737c48e1aa23d733cdc29f4b3a2dafa2e6b01398ff7d253bb0746cb55f2d1b57bb7a3673df64b4972216e5ed7addb22ae2707aeb33dcc7a23ed7b36d5a0f8b +DIST linux-4.11.7.tar.gz 147164713 SHA256 7004ad0746f5e27de3aff68ca0db316bf95d2903da09d0eb86c357069887448f SHA512 1dc3643bc1949fc3833336931e0f28d4e5aabc0bdd0e8e37a1ae383597a9dbd1634c40bf98f8438ce6bac00db39bdd7d211274fe091182b687ad274942894931 WHIRLPOOL 839338c1b15b74166d779fe2314708e6b83a95b116f196d4df711948c03c86c8010661d7b43bc051be1461dc890f0e195f0fee6f3e1d54f8278a9f24ad8e835d diff --git a/sys-kernel/linux/linux-4.11.7-r1.ebuild b/sys-kernel/linux/linux-4.11.7-r1.ebuild new file mode 100644 index 0000000..0dcdd3e --- /dev/null +++ b/sys-kernel/linux/linux-4.11.7-r1.ebuild @@ -0,0 +1,74 @@ +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 + +VER="${PV%-r*}" +REV="r${PV##*-r}" + +DESCRIPTION="Linux kernel" +HOMEPAGE="http://kernel.org/" +SRC_URI="https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git/snapshot/linux-stable-${VER}.tar.gz -> ${P}.tar.gz" +S="${WORKDIR}/linux-stable-${VER}" + +LICENSE="GPLv2" +SLOT="${PV}" +KEYWORDS="amd64 ~x86" +IUSE="" + +DEPEND="" +RDEPEND="${DEPEND} + sys-boot/myinitramfs" + +src_configure() { + # Fix ARCH variable + [ "$ARCH" = "amd64" ] && ARCH="x86" + + "${FILESDIR}"/config_prepare.sh || die "Configuration application failed" +} + +src_install() { + emake modules_install INSTALL_MOD_PATH="${D}" INSTALL_FW_PATH="${D}/lib/firmware/${PV}" + + dodir /boot + insinto /boot + newins "${S}/arch/$ARCH/boot/bzImage" "bzlinux-${PV}" + + # Package source (kind of annoying because of some packages expecting it) + emake clean + dodir /usr/src + cp -a "${S}" "${D}/usr/src/linux-${PV}" +} + +# Link /usr/src/linux to newest kernel +src_link() { + ( + cd "${ROOT}/usr/src" + rm -f linux + ln -s $(ls | grep "linux-" | sort | tail -1) linux + ) +} + +pkg_postinst() { + # Add label to syslinux config if there is non yet + SYSLINUX="${ROOT}/boot/syslinux/syslinux.cfg" + if ! grep -q "^LABEL gentoo-${PV}$" "${SYSLINUX}"; then + ARGS="$(grep -E "^# ARGS: " "${SYSLINUX}" | sed 's/^# ARGS: //')" + if [ -n "$ARGS" ]; then + sed -i "/^## Dynamic labels ##$/a LABEL gentoo-${PV}\n\tMENU LABEL Gentoo ${PV}\n\tLINUX ../bzlinux-${PV}\n\tAPPEND ${ARGS}\n\tINITRD ../initramfs-gentoo\n" "${SYSLINUX}" || eerror "Adding label to syslinux configuration failed!" + sed -i "/^## Dynamic recovery labels ##$/a LABEL gentoo-${PV}\n\tMENU LABEL Gentoo ${PV} - Recovery\n\tLINUX ../bzlinux-${PV}\n\tAPPEND ${ARGS} recovery\n\tINITRD ../initramfs-gentoo\n" "${SYSLINUX}" || eerror "Adding recovery label to syslinux configuration failed!" + else + eerror "Adding label to syslinux configuration failed as there are no arguments" + fi + fi + src_link +} + +pkg_prerm() { + # Remove label from syslinux config + sed -i "/^LABEL gentoo-${PV}(|-recovery)$/,/^$/d" /boot/syslinux/syslinux.cfg || eerror "Removing label from syslinux fonfiguration failed!" +} + +pkg_postrm() { + src_link +} |