summaryrefslogtreecommitdiff
path: root/sys-kernel
diff options
context:
space:
mode:
authorKarel Kočí <cynerd@email.cz>2017-05-04 00:22:11 +0200
committerKarel Kočí <cynerd@email.cz>2017-05-04 00:22:11 +0200
commit8d234aa74d7a6bcf0e025ae47934642155092f17 (patch)
treeff00d0a52a493a1b99fef49a24e64f7bdd6859ab /sys-kernel
parent5c18bae82d302bb70230475fde409b19c5aecd64 (diff)
downloadgentoo-personal-overlay-8d234aa74d7a6bcf0e025ae47934642155092f17.tar.gz
gentoo-personal-overlay-8d234aa74d7a6bcf0e025ae47934642155092f17.tar.bz2
gentoo-personal-overlay-8d234aa74d7a6bcf0e025ae47934642155092f17.zip
linux: add sources to package
Diffstat (limited to 'sys-kernel')
-rw-r--r--sys-kernel/linux/linux-4.10.13.ebuild28
1 files changed, 24 insertions, 4 deletions
diff --git a/sys-kernel/linux/linux-4.10.13.ebuild b/sys-kernel/linux/linux-4.10.13.ebuild
index b299aa3..f171af7 100644
--- a/sys-kernel/linux/linux-4.10.13.ebuild
+++ b/sys-kernel/linux/linux-4.10.13.ebuild
@@ -14,7 +14,8 @@ KEYWORDS="amd64 ~x86"
IUSE=""
DEPEND=""
-RDEPEND="${DEPEND}"
+RDEPEND="${DEPEND}
+ sys-boot/myinitramfs"
src_configure() {
# Fix ARCH variable
@@ -29,21 +30,40 @@ src_install() {
dodir /boot
insinto /boot
newins "${S}/arch/$ARCH/boot/bzImage" "bzlinux-${PV}"
+
+ # Package build fragment (kind of annoying because of some packages expecting it)
+ 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
- if ! grep -q "^LABEL gentoo-${PV}$" /boot/syslinux/syslinux.cfg; then
- ARGS="$(grep -E "^# ARGS: " /boot/syslinux/syslinux.cfg | sed 's/^# ARGS: //')"
+ 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" /boot/syslinux/syslinux.cfg || eerror "Adding label to syslinux configuration failed!"
+ 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!"
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}$/,/^$/d" /boot/syslinux/syslinux.cfg || eerror "Removing label from syslinux fonfiguration failed!"
}
+
+pkg_postrm() {
+ src_link
+}