sys-fs/zfs-kmod: improve new module check in live ebuild

Closes: https://github.com/gentoo/gentoo/pull/28498
Signed-off-by: Georgy Yakovlev <gyakovlev@gentoo.org>
This commit is contained in:
Georgy Yakovlev
2022-12-03 13:55:42 -08:00
parent 40e35a1b20
commit 2d475f8a7b

View File

@@ -210,8 +210,10 @@ _old_layout_cleanup() {
pkg_postinst() {
# check for old module layout before doing anything else.
# only attempt layout cleanup if new .ko location is used.
[[ -f "${EROOT}/lib/modules/${KV_FULL}/extra/zfs.ko" ]] && _old_layout_cleanup
local newko=( "${EROOT}/lib/modules/${KV_FULL}/extra"/{zfs,spl}.ko* )
# we check first array member, if glob above did not exand, it will be "zfs.ko*" and -f will return false.
# if glob expanded -f will do correct file precense check.
[[ -f ${newko[0]} ]] && _old_layout_cleanup
linux-mod_pkg_postinst
if [[ -z ${ROOT} ]] && use dist-kernel; then