diff options
author | Michał Górny <mgorny@gentoo.org> | 2020-01-02 14:14:29 +0100 |
---|---|---|
committer | Michał Górny <mgorny@gentoo.org> | 2020-01-02 14:19:42 +0100 |
commit | b26cada012ec1134770f90e79990d10ccb2744cc (patch) | |
tree | ace3da03cbcd72d220452e69142a0de16747046b | |
parent | sys-kernel/installkernel-gentoo: Bump to v2 (diff) | |
download | gentoo-b26cada012ec1134770f90e79990d10ccb2744cc.tar.gz gentoo-b26cada012ec1134770f90e79990d10ccb2744cc.tar.bz2 gentoo-b26cada012ec1134770f90e79990d10ccb2744cc.zip |
sys-kernel/vanilla-kernel-bin: Create linux symlink when none
Signed-off-by: Michał Górny <mgorny@gentoo.org>
-rw-r--r-- | sys-kernel/vanilla-kernel-bin/vanilla-kernel-bin-5.4.7.ebuild | 30 |
1 files changed, 18 insertions, 12 deletions
diff --git a/sys-kernel/vanilla-kernel-bin/vanilla-kernel-bin-5.4.7.ebuild b/sys-kernel/vanilla-kernel-bin/vanilla-kernel-bin-5.4.7.ebuild index c7f50b935aa9..998f07ed5e9b 100644 --- a/sys-kernel/vanilla-kernel-bin/vanilla-kernel-bin-5.4.7.ebuild +++ b/sys-kernel/vanilla-kernel-bin/vanilla-kernel-bin-5.4.7.ebuild @@ -147,19 +147,25 @@ pkg_postinst() { eend ${?} || die "Installing the kernel failed" fi - local symlink_target=$(readlink "${EROOT}"/usr/src/linux) - local symlink_ver=${symlink_target#linux-} - if [[ ${symlink_target} == linux-* && -z ${symlink_ver//[0-9.]/} ]] - then - local symlink_pkg=${CATEGORY}/${PN}-${symlink_ver} - # if the current target is either being replaced, or still - # installed (probably depclean candidate), update the symlink - if has "${symlink_ver}" ${REPLACING_VERSIONS} || - has_version -r "~${symlink_pkg}" + if [[ ! -e ${EROOT}/usr/src/linux ]]; then + ebegin "Creating /usr/src/linux symlink" + ln -f -n -s linux-${PV} "${EROOT}"/usr/src/linux + eend ${?} + else + local symlink_target=$(readlink "${EROOT}"/usr/src/linux) + local symlink_ver=${symlink_target#linux-} + if [[ ${symlink_target} == linux-* && -z ${symlink_ver//[0-9.]/} ]] then - ebegin "Updating /usr/src/linux symlink" - ln -f -n -s linux-${PV} "${EROOT}"/usr/src/linux - eend ${?} + local symlink_pkg=${CATEGORY}/${PN}-${symlink_ver} + # if the current target is either being replaced, or still + # installed (probably depclean candidate), update the symlink + if has "${symlink_ver}" ${REPLACING_VERSIONS} || + has_version -r "~${symlink_pkg}" + then + ebegin "Updating /usr/src/linux symlink" + ln -f -n -s linux-${PV} "${EROOT}"/usr/src/linux + eend ${?} + fi fi fi } |