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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 7E5E4158017 for ; Thu, 30 Sep 2021 21:17:46 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 9CD9CE08F4; Thu, 30 Sep 2021 21:17:45 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 81DECE08F4 for ; Thu, 30 Sep 2021 21:17:45 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 319B0342CDD for ; Thu, 30 Sep 2021 21:17:44 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 99D3D105 for ; Thu, 30 Sep 2021 21:17:38 +0000 (UTC) From: "Thomas Deutschmann" 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" Message-ID: <1633036372.c869ac450ae286908cfed582b0c51fe327555833.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: c869ac450ae286908cfed582b0c51fe327555833 X-VCS-Branch: master Date: Thu, 30 Sep 2021 21:17:38 +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: d9594ecf-4dbb-45e3-8595-c330480b6f0b X-Archives-Hash: d36f79e32124159060d63ca70ccf40a6 commit: c869ac450ae286908cfed582b0c51fe327555833 Author: Thomas Deutschmann gentoo org> AuthorDate: Thu Sep 30 21:12:52 2021 +0000 Commit: Thomas Deutschmann gentoo org> CommitDate: Thu Sep 30 21:12:52 2021 +0000 URL: https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=c869ac45 gen_initramfs.sh: append_modprobed(): Adopt changes from sys-apps/baselayout-2.8 In >=sys-apps/baselayout-2.8, /etc/modprobe.d was moved to /lib/modprobe.d. This commit will try to copy /etc/modprobe.d and /lib/modprobe.d but will no longer fail if one directory is missing. Signed-off-by: Thomas Deutschmann gentoo.org> gen_initramfs.sh | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/gen_initramfs.sh b/gen_initramfs.sh index 8f11127..56d6a03 100755 --- a/gen_initramfs.sh +++ b/gen_initramfs.sh @@ -1832,10 +1832,19 @@ append_modprobed() { mkdir "${TDIR}" || gen_die "Failed to create '${TDIR}'!" cd "${TDIR}" || gen_die "Failed to chdir to '${TDIR}'!" - mkdir -p "${TDIR}"/etc || gen_die "Failed to create '${TDIR}/etc'!" + local modprobe_dir + for modprobe_dir in /etc/modprobe.d /lib/modprobe.d + do + if [[ ! -e "${modprobe_dir}" ]]; then + print_info 5 "'${modprobe_dir}' does not exist; Skipping ..." + continue + fi + + mkdir -p "${TDIR}${modprobe_dir}" || gen_die "Failed to create '${TDIR}${modprobe_dir}'!" - cp -rL "/etc/modprobe.d" "${TDIR}"/etc/ 2>/dev/null \ - || gen_die "Failed to copy '/etc/modprobe.d'!" + cp -aL "${modprobe_dir}"/. "${TDIR}${modprobe_dir}" 2>/dev/null \ + || gen_die "Failed to copy '${modprobe_dir}'!" + done cd "${TDIR}" || gen_die "Failed to chdir to '${TDIR}'!" log_future_cpio_content