From 8188f83d664dd0b6d1a14a5424ca91a992024554 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20S=C3=89RIE?= Date: Thu, 13 Feb 2014 11:10:30 +0100 Subject: [PATCH] Added a check of release to use the good path for libnss. --- chroot-bincopy.sh | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/chroot-bincopy.sh b/chroot-bincopy.sh index 76e5ffa..f16af4e 100755 --- a/chroot-bincopy.sh +++ b/chroot-bincopy.sh @@ -6,7 +6,18 @@ chrootdir=$1 # TODO: better detection of amd64 arch cp -f /lib/ld-linux.so.2 $chrootdir/lib/ 2>/dev/null \ || cp -f /lib64/ld-linux-x86-64.so.2 $chrootdir/lib64/ -cp /lib/x86_64-linux-gnu/libnss* $chrootdir/lib/x86_64-linux-gnu/ + +release=$(lsb_release -s -c) +if [ "$release" = "squeeze" ]; then + cp /lib/libnss* $chrootdir/lib/ +else + if [ "$release" = "wheezy" ]; then + cp /lib/x86_64-linux-gnu/libnss* $chrootdir/lib/x86_64-linux-gnu/ + else + # Others? Not tested... + cp /lib/x86_64-linux-gnu/libnss* $chrootdir/lib/x86_64-linux-gnu/ + fi +fi for dbin in /bin/bash /bin/cat /bin/chown /bin/mknod /bin/rm \ /bin/sed /bin/sh /bin/uname /bin/mount /usr/bin/rsync /usr/sbin/sshd \