From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 3F895158090 for ; Mon, 16 May 2022 05:34:22 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 4DE24E08FC; Mon, 16 May 2022 05:34:21 +0000 (UTC) Received: from smtp.gentoo.org (mail.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 3325FE08FC for ; Mon, 16 May 2022 05:34:21 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 54D3E341978 for ; Mon, 16 May 2022 05:34:20 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id B467746D for ; Mon, 16 May 2022 05:34:18 +0000 (UTC) From: "Robin H. Johnson" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Robin H. Johnson" Message-ID: <1652652607.110cffbf0a10a6dabe902eecb9c139663ad737af.robbat2@gentoo> Subject: [gentoo-commits] proj/genkernel:master commit in: / X-VCS-Repository: proj/genkernel X-VCS-Files: gen_funcs.sh gen_initramfs.sh X-VCS-Directories: / X-VCS-Committer: robbat2 X-VCS-Committer-Name: Robin H. Johnson X-VCS-Revision: 110cffbf0a10a6dabe902eecb9c139663ad737af X-VCS-Branch: master Date: Mon, 16 May 2022 05:34:18 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: c7f098cc-f521-4f0e-8cf2-3ca99e19d47f X-Archives-Hash: 9736a4c9512a3db6be47e4b099b5343c commit: 110cffbf0a10a6dabe902eecb9c139663ad737af Author: Mike Gilbert gentoo org> AuthorDate: Sun May 15 16:37:51 2022 +0000 Commit: Robin H. Johnson gentoo org> CommitDate: Sun May 15 22:10:07 2022 +0000 URL: https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=110cffbf gen_initramfs.sh: append devicemanager only for specific modules dmraid luks lvm multipath Bug: https://bugs.gentoo.org/749957 Signed-off-by: Mike Gilbert gentoo.org> gen_funcs.sh | 9 +++++++++ gen_initramfs.sh | 11 +++++++---- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/gen_funcs.sh b/gen_funcs.sh index 500caf2..db396e3 100755 --- a/gen_funcs.sh +++ b/gen_funcs.sh @@ -22,6 +22,15 @@ isTrue() { return 1 } +anyTrue() { + local x + for x + do + isTrue "${x}" && return 0 + done + return 1 +} + set_color_vars() { if ! isTrue "${NOCOLOR}" then diff --git a/gen_initramfs.sh b/gen_initramfs.sh index 4ec296e..0b74f4c 100755 --- a/gen_initramfs.sh +++ b/gen_initramfs.sh @@ -2007,11 +2007,14 @@ append_auxiliary() { } append_data() { - local name=$1 var=$2 + [ $# -eq 0 ] && gen_die "append_data() called with zero arguments" + + local name=$1 local func="append_${name}" - [ $# -eq 0 ] && gen_die "append_data() called with zero arguments" - if [ $# -eq 1 ] || isTrue "${var}" + shift + + if [ $# -eq 0 ] || anyTrue "$@" then print_info 1 "$(get_indent 1)>> Appending ${name} cpio data ..." ${func} || gen_die "${func}() failed!" @@ -2037,7 +2040,7 @@ create_initramfs() { append_data 'base_layout' append_data 'util-linux' append_data 'eudev' - append_data 'devicemanager' + append_data 'devicemanager' "${DMRAID}" "${LVM}" "${LUKS}" "${MULTIPATH}" append_data 'auxiliary' "${BUSYBOX}" append_data 'busybox' "${BUSYBOX}" append_data 'b2sum' "${B2SUM}"