From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <gentoo-commits+bounces-1298513-garchives=archives.gentoo.org@lists.gentoo.org>
Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(No client certificate requested)
	by finch.gentoo.org (Postfix) with ESMTPS id 0627113933E
	for <garchives@archives.gentoo.org>; Fri,  2 Jul 2021 19:30:53 +0000 (UTC)
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id D06CCE090F;
	Fri,  2 Jul 2021 19:30:51 +0000 (UTC)
Received: from smtp.gentoo.org (dev.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4])
	(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
	(No client certificate requested)
	by pigeon.gentoo.org (Postfix) with ESMTPS id AE02EE090F
	for <gentoo-commits@lists.gentoo.org>; Fri,  2 Jul 2021 19:30:51 +0000 (UTC)
Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52])
	(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
	(No client certificate requested)
	by smtp.gentoo.org (Postfix) with ESMTPS id 4C20D33BF51
	for <gentoo-commits@lists.gentoo.org>; Fri,  2 Jul 2021 19:30:50 +0000 (UTC)
Received: from localhost.localdomain (localhost [IPv6:::1])
	by oystercatcher.gentoo.org (Postfix) with ESMTP id 948747A1
	for <gentoo-commits@lists.gentoo.org>; Fri,  2 Jul 2021 19:30:48 +0000 (UTC)
From: "Georgy Yakovlev" <gyakovlev@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Content-Transfer-Encoding: 8bit
Content-type: text/plain; charset=UTF-8
Reply-To: gentoo-dev@lists.gentoo.org, "Georgy Yakovlev" <gyakovlev@gentoo.org>
Message-ID: <1625253773.8efdd74ac4ff2008f3f7e67be92a892ebe31c00c.gyakovlev@gentoo>
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-fs/zfs-kmod/
X-VCS-Repository: repo/gentoo
X-VCS-Files: sys-fs/zfs-kmod/zfs-kmod-2.1.0.ebuild
X-VCS-Directories: sys-fs/zfs-kmod/
X-VCS-Committer: gyakovlev
X-VCS-Committer-Name: Georgy Yakovlev
X-VCS-Revision: 8efdd74ac4ff2008f3f7e67be92a892ebe31c00c
X-VCS-Branch: master
Date: Fri,  2 Jul 2021 19:30:48 +0000 (UTC)
Precedence: bulk
List-Post: <mailto:gentoo-commits@lists.gentoo.org>
List-Help: <mailto:gentoo-commits+help@lists.gentoo.org>
List-Unsubscribe: <mailto:gentoo-commits+unsubscribe@lists.gentoo.org>
List-Subscribe: <mailto:gentoo-commits+subscribe@lists.gentoo.org>
List-Id: Gentoo Linux mail <gentoo-commits.gentoo.org>
X-BeenThere: gentoo-commits@lists.gentoo.org
X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply
X-Archives-Salt: 8a87586d-0b97-4cb3-8218-291f668fc351
X-Archives-Hash: 4bc75a6f9261aeba57ea850b72524219

commit:     8efdd74ac4ff2008f3f7e67be92a892ebe31c00c
Author:     Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org>
AuthorDate: Fri Jul  2 19:22:53 2021 +0000
Commit:     Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org>
CommitDate: Fri Jul  2 19:22:53 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8efdd74a

sys-fs/zfs-kmod: adjust postinst phase

remove old migration code, it was needed for migration from
0.6x versions.

make grub section conditional and mention new compat filag

zpool create -o compatibility=grub2 ...

https://github.com/openzfs/zfs/pull/11468

Signed-off-by: Georgy Yakovlev <gyakovlev <AT> gentoo.org>

 sys-fs/zfs-kmod/zfs-kmod-2.1.0.ebuild | 40 ++++++++++++-----------------------
 1 file changed, 13 insertions(+), 27 deletions(-)

diff --git a/sys-fs/zfs-kmod/zfs-kmod-2.1.0.ebuild b/sys-fs/zfs-kmod/zfs-kmod-2.1.0.ebuild
index 9306651ee82..1bb0a99b0c6 100644
--- a/sys-fs/zfs-kmod/zfs-kmod-2.1.0.ebuild
+++ b/sys-fs/zfs-kmod/zfs-kmod-2.1.0.ebuild
@@ -165,15 +165,6 @@ src_install() {
 pkg_postinst() {
 	linux-mod_pkg_postinst
 
-	# Remove old modules
-	if [[ -d "${EROOT}/lib/modules/${KV_FULL}/addon/zfs" ]]; then
-		ewarn "${PN} now installs modules in ${EROOT}/lib/modules/${KV_FULL}/extra/zfs"
-		ewarn "Old modules were detected in ${EROOT}/lib/modules/${KV_FULL}/addon/zfs"
-		ewarn "Automatically removing old modules to avoid problems."
-		rm -r "${EROOT}/lib/modules/${KV_FULL}/addon/zfs" || die "Cannot remove modules"
-		rmdir --ignore-fail-on-non-empty "${EROOT}/lib/modules/${KV_FULL}/addon"
-	fi
-
 	if [[ -z ${ROOT} ]] && use dist-kernel; then
 		set_arch_to_portage
 		dist-kernel_reinstall_initramfs "${KV_DIR}" "${KV_FULL}"
@@ -184,22 +175,17 @@ pkg_postinst() {
 		ewarn "at least 256M and decreasing zfs_arc_max to some value less than that."
 	fi
 
-	ewarn "This version of OpenZFS includes support for new feature flags"
-	ewarn "that are incompatible with previous versions. GRUB2 support for"
-	ewarn "/boot with the new feature flags is not yet available."
-	ewarn "Do *NOT* upgrade root pools to use the new feature flags."
-	ewarn "Any new pools will be created with the new feature flags by default"
-	ewarn "and will not be compatible with older versions of ZFSOnLinux. To"
-	ewarn "create a newpool that is backward compatible wih GRUB2, use "
-	ewarn
-	ewarn "zpool create -d -o feature@async_destroy=enabled "
-	ewarn "	-o feature@empty_bpobj=enabled -o feature@lz4_compress=enabled"
-	ewarn "	-o feature@spacemap_histogram=enabled"
-	ewarn "	-o feature@enabled_txg=enabled "
-	ewarn "	-o feature@extensible_dataset=enabled -o feature@bookmarks=enabled"
-	ewarn "	..."
-	ewarn
-	ewarn "GRUB2 support will be updated as soon as either the GRUB2"
-	ewarn "developers do a tag or the Gentoo developers find time to backport"
-	ewarn "support from GRUB2 HEAD."
+	if has_version sys-boot/grub; then
+		ewarn "This version of OpenZFS includes support for new feature flags"
+		ewarn "that are incompatible with previous versions. GRUB2 support for"
+		ewarn "/boot with the new feature flags is not yet available."
+		ewarn "Do *NOT* upgrade root pools to use the new feature flags."
+		ewarn "Any new pools will be created with the new feature flags by default"
+		ewarn "and will not be compatible with older versions of ZFSOnLinux. To"
+		ewarn "create a newpool that is backward compatible wih GRUB2, use "
+		ewarn
+		ewarn "zpool create -o compatibility=grub2 ..."
+		ewarn
+		ewarn "Refer to /etc/zfs/compatibility.d/grub2 for list of features."
+	fi
 }