diff options
author | Karel Kočí <karel.koci@nic.cz> | 2017-09-13 14:11:41 +0200 |
---|---|---|
committer | Karel Kočí <karel.koci@nic.cz> | 2017-09-13 14:11:41 +0200 |
commit | 499125fb8ef9daf31c62258a0b62d0e5daf424fe (patch) | |
tree | 01f114531dc113098161a769e485a43150296038 /sys-kernel | |
parent | aa48715facdf6d24cf2a00a9af1884e44e7a636f (diff) | |
download | gentoo-personal-overlay-499125fb8ef9daf31c62258a0b62d0e5daf424fe.tar.gz gentoo-personal-overlay-499125fb8ef9daf31c62258a0b62d0e5daf424fe.tar.bz2 gentoo-personal-overlay-499125fb8ef9daf31c62258a0b62d0e5daf424fe.zip |
Linux add support for sylinux in EFI/BOOT path
Diffstat (limited to 'sys-kernel')
-rw-r--r-- | sys-kernel/linux/linux-4.12.12-r2.ebuild (renamed from sys-kernel/linux/linux-4.12.12-r1.ebuild) | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/sys-kernel/linux/linux-4.12.12-r1.ebuild b/sys-kernel/linux/linux-4.12.12-r2.ebuild index 47e48ea..f1df147 100644 --- a/sys-kernel/linux/linux-4.12.12-r1.ebuild +++ b/sys-kernel/linux/linux-4.12.12-r2.ebuild @@ -49,14 +49,26 @@ src_link() { ) } +sysfile() { + if [ -f "${ROOT}/boot/syslinux/syslinux.cfg" ]; then + SYSLINUX="${ROOT}/boot/syslinux/syslinux.cfg" + PFIX=".." + elseif [ -f "${ROOT}/boot/EFI/BOOT/syslinux.cfg" ]; then + SYSLINUX="${ROOT}/boot/EFI/BOOT/syslinux.cfg" + PFIX="../../.." + else + eerror "Can't locate syslinux configuration!" + fi +} + pkg_postinst() { + sysfile # 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}-recovery\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!" + sed -i "/^## Dynamic labels ##$/a LABEL gentoo-${PV}\n\tMENU LABEL Gentoo ${PV}\n\tLINUX ${PFIX}/bzlinux-${PV}\n\tAPPEND ${ARGS}\n\tINITRD ${PFIX}/initramfs-gentoo\n" "${SYSLINUX}" || eerror "Adding label to syslinux configuration failed!" + sed -i "/^## Dynamic recovery labels ##$/a LABEL gentoo-${PV}-recovery\n\tMENU LABEL Gentoo ${PV} - Recovery\n\tLINUX ${PFIX}/bzlinux-${PV}\n\tAPPEND ${ARGS} recovery\n\tINITRD ${PFIX}/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 @@ -65,8 +77,9 @@ pkg_postinst() { } pkg_prerm() { + sysfile # Remove label from syslinux config - sed -i "/^LABEL gentoo-${PV}\(\|-recovery\)$/,/^$/d" /boot/syslinux/syslinux.cfg || eerror "Removing label from syslinux fonfiguration failed!" + sed -i "/^LABEL gentoo-${PV}\(\|-recovery\)$/,/^$/d" "${SYSLINUX}" || eerror "Removing label from syslinux fonfiguration failed!" } pkg_postrm() { |