From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <gentoo-commits+bounces-1078648-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 8B324138334
	for <garchives@archives.gentoo.org>; Wed, 20 Mar 2019 23:26:48 +0000 (UTC)
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id 65B9EE08AD;
	Wed, 20 Mar 2019 23:26:47 +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 37476E08AD
	for <gentoo-commits@lists.gentoo.org>; Wed, 20 Mar 2019 23:26:46 +0000 (UTC)
Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84])
	(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 31D7F335C29
	for <gentoo-commits@lists.gentoo.org>; Wed, 20 Mar 2019 23:26:45 +0000 (UTC)
Received: from localhost.localdomain (localhost [IPv6:::1])
	by oystercatcher.gentoo.org (Postfix) with ESMTP id E366C452
	for <gentoo-commits@lists.gentoo.org>; Wed, 20 Mar 2019 23:26:42 +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: <1553124352.65207ce9470fe81d94450e453765af9633fedc4e.whissi@gentoo>
Subject: [gentoo-commits] proj/genkernel:master commit in: /
X-VCS-Repository: proj/genkernel
X-VCS-Files: gen_initramfs.sh
X-VCS-Directories: /
X-VCS-Committer: whissi
X-VCS-Committer-Name: Thomas Deutschmann
X-VCS-Revision: 65207ce9470fe81d94450e453765af9633fedc4e
X-VCS-Branch: master
Date: Wed, 20 Mar 2019 23:26:42 +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: bdcf08e6-6d68-42ec-9dee-1f10e56a7b50
X-Archives-Hash: 57858e558e9f62b33da6a223f2baef7c

commit:     65207ce9470fe81d94450e453765af9633fedc4e
Author:     Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
AuthorDate: Wed Mar 20 23:25:52 2019 +0000
Commit:     Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
CommitDate: Wed Mar 20 23:25:52 2019 +0000
URL:        https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=65207ce9

gen_initramfs: catch lddtree failure for real.

Fixes: https://bugs.gentoo.org/618056
Signed-off-by: Thomas Deutschmann <whissi <AT> gentoo.org>

 gen_initramfs.sh | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/gen_initramfs.sh b/gen_initramfs.sh
index 420e9fe..9c50179 100755
--- a/gen_initramfs.sh
+++ b/gen_initramfs.sh
@@ -972,6 +972,13 @@ append_data() {
 }
 
 create_initramfs() {
+	local lddtree_testfile=`which cpio 2>/dev/null`
+	if [[ -z "${lddtree_testfile}" || ! -e "${lddtree_testfile}" ]]; then
+		print_warning 1 "cpio binary not found -- cannot check if lddtree is working!"
+	elif ! lddtree "${lddtree_testfile}" 1>/dev/null 2>&1; then
+		gen_die "'lddtree ${lddtree_testfile}' failed -- cannot generate initramfs without working lddtree!"
+	fi
+
 	local compress_ext=""
 	print_info 1 "initramfs: >> Initializing..."