From 46708439932f125a5f573b7e44bf6d9f41c2765f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Wed, 3 May 2017 22:25:20 +0200 Subject: Fix linux postinst script --- sys-kernel/linux/linux-4.10.13.ebuild | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'sys-kernel/linux/linux-4.10.13.ebuild') diff --git a/sys-kernel/linux/linux-4.10.13.ebuild b/sys-kernel/linux/linux-4.10.13.ebuild index c1c88a8..b299aa3 100644 --- a/sys-kernel/linux/linux-4.10.13.ebuild +++ b/sys-kernel/linux/linux-4.10.13.ebuild @@ -34,7 +34,12 @@ src_install() { pkg_postinst() { # Add label to syslinux config if there is non yet if ! grep -q "^LABEL gentoo-${PV}$" /boot/syslinux/syslinux.cfg; then - sed -i "/^## Dynamic labels ##$/a LABEL gentoo-${PV}\n\tMENU LABEL Gentoo${PV}\n\tLINUX ../bzlinux-${PV}\n\tAPPEND root=/dev/sda2 rootflags=subvol=@gentoo\n\tINITRD ../initramfs-gentoo\n" /boot/syslinux/syslinux.cfg || eerror "Adding label to syslinux configuration failed!" + ARGS="$(grep -E "^# ARGS: " /boot/syslinux/syslinux.cfg | 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!" + else + eerror "Adding label to syslinux configuration failed as there are no arguments" + fi fi } -- cgit v1.2.3