From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <gentoo-commits+bounces-1193796-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 0D43D138359
	for <garchives@archives.gentoo.org>; Wed,  5 Aug 2020 01:57:00 +0000 (UTC)
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id 2CED5E08E0;
	Wed,  5 Aug 2020 01:56:59 +0000 (UTC)
Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183])
	(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 123DCE08E0
	for <gentoo-commits@lists.gentoo.org>; Wed,  5 Aug 2020 01:56:59 +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 BF23934EBFB
	for <gentoo-commits@lists.gentoo.org>; Wed,  5 Aug 2020 01:56:57 +0000 (UTC)
Received: from localhost.localdomain (localhost [IPv6:::1])
	by oystercatcher.gentoo.org (Postfix) with ESMTP id 303192F5
	for <gentoo-commits@lists.gentoo.org>; Wed,  5 Aug 2020 01:56:56 +0000 (UTC)
From: "Thomas Deutschmann" <whissi@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, "Thomas Deutschmann" <whissi@gentoo.org>
Message-ID: <1596592611.61c03ffab76740c0420e3c8a3185d047d461f7a7.whissi@gentoo>
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-apps/kexec-tools/
X-VCS-Repository: repo/gentoo
X-VCS-Files: sys-apps/kexec-tools/kexec-tools-2.0.20-r2.ebuild sys-apps/kexec-tools/kexec-tools-2.0.20-r3.ebuild sys-apps/kexec-tools/kexec-tools-9999.ebuild
X-VCS-Directories: sys-apps/kexec-tools/
X-VCS-Committer: whissi
X-VCS-Committer-Name: Thomas Deutschmann
X-VCS-Revision: 61c03ffab76740c0420e3c8a3185d047d461f7a7
X-VCS-Branch: master
Date: Wed,  5 Aug 2020 01:56:56 +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: b1edaa7b-63ad-447b-acea-b72165f0d3ec
X-Archives-Hash: 033b47ae7677690b834e65875d7fa492

commit:     61c03ffab76740c0420e3c8a3185d047d461f7a7
Author:     Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
AuthorDate: Wed Aug  5 01:54:10 2020 +0000
Commit:     Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
CommitDate: Wed Aug  5 01:56:51 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=61c03ffa

sys-apps/kexec-tools: rev bump to force ewarn

Package-Manager: Portage-3.0.1, Repoman-2.3.23
Signed-off-by: Thomas Deutschmann <whissi <AT> gentoo.org>

 ...ols-2.0.20-r2.ebuild => kexec-tools-2.0.20-r3.ebuild} | 16 ++++++++++++++++
 sys-apps/kexec-tools/kexec-tools-9999.ebuild             | 16 ++++++++++++++++
 2 files changed, 32 insertions(+)

diff --git a/sys-apps/kexec-tools/kexec-tools-2.0.20-r2.ebuild b/sys-apps/kexec-tools/kexec-tools-2.0.20-r3.ebuild
similarity index 80%
rename from sys-apps/kexec-tools/kexec-tools-2.0.20-r2.ebuild
rename to sys-apps/kexec-tools/kexec-tools-2.0.20-r3.ebuild
index 3a25aced9f0..4d758da9aad 100644
--- a/sys-apps/kexec-tools/kexec-tools-2.0.20-r2.ebuild
+++ b/sys-apps/kexec-tools/kexec-tools-2.0.20-r3.ebuild
@@ -107,4 +107,20 @@ pkg_postinst() {
 		elog "   /etc/kexec.conf"
 		elog "Please adopt it to your needs as there is no autoconfig anymore"
 	fi
+
+	local n_root_args=$(grep -o -- '\<root=' /proc/cmdline 2>/dev/null | wc -l)
+	local has_rootpart_set=no
+	if [[ -f "${EROOT}/etc/conf.d/kexec" ]]; then
+		if grep -q -E -- '^ROOTPART=' "${EROOT}/etc/conf.d/kexec" 2>/dev/null; then
+			has_rootpart_set=yes
+		fi
+	fi
+
+	if [[ ${n_root_args} > 1 && "${has_rootpart_set}" == "no"  ]]; then
+		ewarn "WARNING: Multiple root arguments (root=) on kernel command-line detected!"
+		ewarn "This was probably caused by a previous version of ${PN}."
+		ewarn "Please reboot system once *without* kexec to avoid boot problems"
+		ewarn "in case running system and initramfs do not agree on detected"
+		ewarn "root device name!"
+	fi
 }

diff --git a/sys-apps/kexec-tools/kexec-tools-9999.ebuild b/sys-apps/kexec-tools/kexec-tools-9999.ebuild
index cb3f3b6f1c4..86b8d9fc978 100644
--- a/sys-apps/kexec-tools/kexec-tools-9999.ebuild
+++ b/sys-apps/kexec-tools/kexec-tools-9999.ebuild
@@ -105,4 +105,20 @@ pkg_postinst() {
 		elog "   /etc/kexec.conf"
 		elog "Please adopt it to your needs as there is no autoconfig anymore"
 	fi
+
+	local n_root_args=$(grep -o -- '\<root=' /proc/cmdline 2>/dev/null | wc -l)
+	local has_rootpart_set=no
+	if [[ -f "${EROOT}/etc/conf.d/kexec" ]]; then
+		if grep -q -E -- '^ROOTPART=' "${EROOT}/etc/conf.d/kexec" 2>/dev/null; then
+			has_rootpart_set=yes
+		fi
+	fi
+
+	if [[ ${n_root_args} > 1 && "${has_rootpart_set}" == "no"  ]]; then
+		ewarn "WARNING: Multiple root arguments (root=) on kernel command-line detected!"
+		ewarn "This was probably caused by a previous version of ${PN}."
+		ewarn "Please reboot system once *without* kexec to avoid boot problems"
+		ewarn "in case running system and initramfs do not agree on detected"
+		ewarn "root device name!"
+	fi
 }