c4cc8d83618fe141c5bdbd4795445ccebf7bedf8
[live-boot-grml.git] / debian / patches / 30_support_multiarch_dns.patch
1 commit 6666658535b255cb71d48ddeb415aeb3023e1251
2 Author: Michael Prokop <mika@grml.org>
3 Date:   Tue Jun 7 10:15:52 2011 +0200
4
5     Do not fail in multiarch environment when installing libnss_dns.so.
6     
7     Updating initramfs fails with:
8     
9     | live-boot: core filesystems devices utils:memdisk udev wget blockdevE: /usr/share/initramfs-tools/hooks/live failed with return 1.
10     
11     with multiarch libc because the filename is no longer necessarily
12     /lib/libnss_dns.so.* but could also be e.g.
13     /lib/x86_64-linux-gnu/libnss_dns.so.*.
14
15 diff --git a/hooks/live b/hooks/live
16 index 3862a60..b3de1e5 100755
17 --- a/hooks/live
18 +++ b/hooks/live
19 @@ -254,7 +254,16 @@ fi
20  
21  # DNS for initramfs
22  #copy_exec /lib/libnss_files.so.*      /lib  # /etc/hosts and /etc/passwd
23 -copy_exec /lib/libnss_dns.so.*      /lib  # DNS server
24 +# DNS server:
25 +if ls /lib/libnss_dns.so.* >/dev/null 2>&1 ; then # non-multiarch libc
26 +        copy_exec /lib/libnss_dns.so.*      /lib
27 +elif ls /lib/*/libnss_dns.so.* >/dev/null 2>&1 ; then # multiarch libc
28 +        for libnss in /lib/*/libnss_dns.so.* ; do
29 +                copy_exec "$libnss"
30 +        done
31 +else
32 +        echo "Warning: libnss_dns.so.* not found. DNS in initramfs not functional."
33 +fi
34  #copy_exec /lib/libnss_compat.so.*      /lib  # /etc/passwd
35  
36  # Configuration file - may be needed if /etc/hosts is used.