diff options
author | Karel Kočí <cynerd@email.cz> | 2017-05-03 22:25:20 +0200 |
---|---|---|
committer | Karel Kočí <cynerd@email.cz> | 2017-05-03 22:25:20 +0200 |
commit | 46708439932f125a5f573b7e44bf6d9f41c2765f (patch) | |
tree | bfa7476b005461e37026bfd760ef089cb81eb6fd | |
parent | a00e4726def27f21bba7aa9e94242087337a66f0 (diff) | |
download | gentoo-personal-overlay-46708439932f125a5f573b7e44bf6d9f41c2765f.tar.gz gentoo-personal-overlay-46708439932f125a5f573b7e44bf6d9f41c2765f.tar.bz2 gentoo-personal-overlay-46708439932f125a5f573b7e44bf6d9f41c2765f.zip |
Fix linux postinst script
-rw-r--r-- | sys-kernel/linux/linux-4.10.13.ebuild | 7 |
1 files changed, 6 insertions, 1 deletions
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 } |