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: Sat, 14 Dec 2019 00:26:54
Message-Id: 1576281933.7d7d95509fcecd86476e705bc52fa147452139c3.whissi@gentoo
1 commit: 7d7d95509fcecd86476e705bc52fa147452139c3
2 Author: Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
3 AuthorDate: Fri Dec 13 20:56:40 2019 +0000
4 Commit: Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
5 CommitDate: Sat Dec 14 00:05:33 2019 +0000
6 URL: https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=7d7d9550
7
8 gen_funcs.sh: get_chost_libdir(): Use libc.a to determine CHOST libdir
9
10 libc.a is required for almost every package in initramfs whereas
11 libnss_files.so isn't available in musl for example.
12
13 Signed-off-by: Thomas Deutschmann <whissi <AT> gentoo.org>
14
15 gen_funcs.sh | 7 +++++--
16 gen_initramfs.sh | 6 +++---
17 2 files changed, 8 insertions(+), 5 deletions(-)
18
19 diff --git a/gen_funcs.sh b/gen_funcs.sh
20 index f5dd0cd..32d367e 100755
21 --- a/gen_funcs.sh
22 +++ b/gen_funcs.sh
23 @@ -860,10 +860,13 @@ debug_breakpoint() {
24 get_chost_libdir() {
25 local cc=$(tc-getCC)
26
27 - local test_file=$(${cc} -print-file-name=libnss_files.so 2>/dev/null)
28 + local test_file=$(${cc} -print-file-name=libc.a 2>/dev/null)
29 if [ -z "${test_file}" ]
30 then
31 - gen_die "$(get_useful_function_stack "${FUNCNAME}")Unable to determine CHOST's libdir: '${cc} -print-file-name=libnss_files.so' returned nothing!"
32 + gen_die "$(get_useful_function_stack "${FUNCNAME}")Unable to determine CHOST's libdir: '${cc} -print-file-name=libc.a' returned nothing!"
33 + elif [[ "${test_file}" == "libc.a" ]]
34 + then
35 + gen_die "$(get_useful_function_stack "${FUNCNAME}")Unable to determine CHOST's libdir: '${cc} -print-file-name=libc.a' returned no path!"
36 fi
37
38 local test_file_realpath=$(realpath "${test_file}" 2>/dev/null)
39
40 diff --git a/gen_initramfs.sh b/gen_initramfs.sh
41 index 6150cba..ab7b151 100755
42 --- a/gen_initramfs.sh
43 +++ b/gen_initramfs.sh
44 @@ -461,7 +461,7 @@ append_busybox() {
45 # allow for DNS resolution
46 local libdir=$(get_chost_libdir)
47 mkdir -p "${TDIR}"/lib || gen_die "Failed to create '${TDIR}/lib'!"
48 - copy_system_binaries "${TDIR}"/lib "${libdir}"/libnss_dns.so.2
49 + copy_system_binaries "${TDIR}"/lib "${libdir}"/libnss_dns.so
50
51 log_future_cpio_content
52 find . -print0 | "${CPIO_COMMAND}" ${CPIO_ARGS} --append -F "${CPIO_ARCHIVE}" \
53 @@ -955,7 +955,7 @@ append_linker() {
54 mkdir -p "${TDIR}"/sbin || gen_die "Failed to create '${TDIR}/sbin'!"
55
56 local libdir=$(get_chost_libdir)
57 - copy_system_binaries "${TDIR}/sbin" "${libdir}/../sbin/ldconfig"
58 + copy_system_binaries "${TDIR}/sbin" "${libdir}/../../sbin/ldconfig"
59 else
60 # Only copy /etc/ld.so.conf.d -- /etc/ld.so.conf was already
61 # added to CPIO via append_base_layout() and because we only
62 @@ -1323,7 +1323,7 @@ append_dropbear() {
63
64 local libdir=$(get_chost_libdir)
65 mkdir -p "${TDIR}"/lib || gen_die "Failed to create '${TDIR}/lib'!"
66 - copy_system_binaries "${TDIR}"/lib "${libdir}"/libnss_files.so.2
67 + copy_system_binaries "${TDIR}"/lib "${libdir}"/libnss_files.so
68
69 cd "${TDIR}" || gen_die "Failed to chdir to '${TDIR}'!"