Gentoo Archives: gentoo-commits

From: Thomas Deutschmann <whissi@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/genkernel:master commit in: /
Date: Thu, 30 Sep 2021 21:17:46
Message-Id: 1633036372.c869ac450ae286908cfed582b0c51fe327555833.whissi@gentoo
1 commit: c869ac450ae286908cfed582b0c51fe327555833
2 Author: Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
3 AuthorDate: Thu Sep 30 21:12:52 2021 +0000
4 Commit: Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
5 CommitDate: Thu Sep 30 21:12:52 2021 +0000
6 URL: https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=c869ac45
7
8 gen_initramfs.sh: append_modprobed(): Adopt changes from sys-apps/baselayout-2.8
9
10 In >=sys-apps/baselayout-2.8, /etc/modprobe.d was moved to /lib/modprobe.d.
11
12 This commit will try to copy /etc/modprobe.d and /lib/modprobe.d but will
13 no longer fail if one directory is missing.
14
15 Signed-off-by: Thomas Deutschmann <whissi <AT> gentoo.org>
16
17 gen_initramfs.sh | 15 ++++++++++++---
18 1 file changed, 12 insertions(+), 3 deletions(-)
19
20 diff --git a/gen_initramfs.sh b/gen_initramfs.sh
21 index 8f11127..56d6a03 100755
22 --- a/gen_initramfs.sh
23 +++ b/gen_initramfs.sh
24 @@ -1832,10 +1832,19 @@ append_modprobed() {
25 mkdir "${TDIR}" || gen_die "Failed to create '${TDIR}'!"
26 cd "${TDIR}" || gen_die "Failed to chdir to '${TDIR}'!"
27
28 - mkdir -p "${TDIR}"/etc || gen_die "Failed to create '${TDIR}/etc'!"
29 + local modprobe_dir
30 + for modprobe_dir in /etc/modprobe.d /lib/modprobe.d
31 + do
32 + if [[ ! -e "${modprobe_dir}" ]]; then
33 + print_info 5 "'${modprobe_dir}' does not exist; Skipping ..."
34 + continue
35 + fi
36 +
37 + mkdir -p "${TDIR}${modprobe_dir}" || gen_die "Failed to create '${TDIR}${modprobe_dir}'!"
38
39 - cp -rL "/etc/modprobe.d" "${TDIR}"/etc/ 2>/dev/null \
40 - || gen_die "Failed to copy '/etc/modprobe.d'!"
41 + cp -aL "${modprobe_dir}"/. "${TDIR}${modprobe_dir}" 2>/dev/null \
42 + || gen_die "Failed to copy '${modprobe_dir}'!"
43 + done
44
45 cd "${TDIR}" || gen_die "Failed to chdir to '${TDIR}'!"
46 log_future_cpio_content