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 \