Diff zfs-kmod-2.1.13 with a zfs-kmod-2.2.0_rc3

/usr/portage/sys-fs/zfs-kmod/zfs-kmod-2.2.0_rc3.ebuild 2023-10-09 14:52:35.528368502 +0300
8 8
DESCRIPTION="Linux ZFS kernel module for sys-fs/zfs"
9 9
HOMEPAGE="https://github.com/openzfs/zfs"
10 10

  
11
MODULES_KERNEL_MAX=6.5
11
MODULES_KERNEL_MAX=6.4
12 12
MODULES_KERNEL_MIN=3.10
13 13

  
14 14
if [[ ${PV} == 9999 ]] ; then
......
22 22
	MY_PV=${PV/_rc/-rc}
23 23
	SRC_URI="https://github.com/openzfs/zfs/releases/download/zfs-${MY_PV}/zfs-${MY_PV}.tar.gz"
24 24
	SRC_URI+=" verify-sig? ( https://github.com/openzfs/zfs/releases/download/zfs-${MY_PV}/zfs-${MY_PV}.tar.gz.asc )"
25
	S="${WORKDIR}/zfs-${PV%_rc?}"
25
	S="${WORKDIR}/zfs-${MY_PV}"
26 26

  
27 27
	ZFS_KERNEL_COMPAT="${MODULES_KERNEL_MAX}"
28 28
	# Increments minor eg 5.14 -> 5.15, and still supports override.
......
40 40
RESTRICT="test"
41 41

  
42 42
BDEPEND="
43
	dev-lang/perl
44 43
	app-alternatives/awk
44
	dev-lang/perl
45 45
"
46 46

  
47 47
if [[ ${PV} != 9999 ]] ; then
......
149 149
	dodoc AUTHORS COPYRIGHT META README.md
150 150
}
151 151

  
152
_old_layout_cleanup() {
153
	# new files are just extra/{spl,zfs}.ko with no subdirs.
154
	local olddir=(
155
		avl/zavl
156
		icp/icp
157
		lua/zlua
158
		nvpair/znvpair
159
		spl/spl
160
		unicode/zunicode
161
		zcommon/zcommon
162
		zfs/zfs
163
		zstd/zzstd
164
	)
165

  
166
	# kernel/module/Kconfig contains possible compressed extentions.
167
	local kext kextfiles
168
		for kext in .ko{,.{gz,xz,zst}}; do
169
		kextfiles+=( "${olddir[@]/%/${kext}}" )
170
	done
171

  
172
	local oldfile oldpath
173
	for oldfile in "${kextfiles[@]}"; do
174
		oldpath="${EROOT}/lib/modules/${KV_FULL}/extra/${oldfile}"
175
		if [[ -f "${oldpath}" ]]; then
176
			ewarn "Found obsolete zfs module ${oldfile} for current kernel ${KV_FULL}, removing."
177
			rm -rv "${oldpath}" || die
178
			# we do not remove non-empty directories just for safety in case there's something else.
179
			# also it may fail if there are both compressed and uncompressed modules installed.
180
			rmdir -v --ignore-fail-on-non-empty "${oldpath%/*.*}" || die
181
		fi
182
	done
183
}
184

  
152 185
pkg_postinst() {
186
	# Check for old module layout before doing anything else.
187
	# only attempt layout cleanup if new .ko location is used.
188
	local newko=( "${EROOT}/lib/modules/${KV_FULL}/extra"/{zfs,spl}.ko* )
189
	# We check first array member, if glob above did not exand, it will be "zfs.ko*" and -f will return false.
190
	# if glob expanded -f will do correct file precense check.
191
	[[ -f ${newko[0]} ]] && _old_layout_cleanup
192

  
153 193
	linux-mod-r1_pkg_postinst
154 194

  
155 195
	if [[ -z ${ROOT} ]] && use dist-kernel ; then
Thank you!