[BACK]Return to fix_ldconfig CVS log [TXT][DIR] Up to [local] / openbsd / fill_chroot

File: [local] / openbsd / fill_chroot / fix_ldconfig (download)

Revision 1.9, Tue Sep 30 21:55:57 2008 UTC (15 years, 7 months ago) by andrew
Branch: MAIN
Changes since 1.8: +2 -2 lines

Just steal the ldconfig search directiories from the ldconfig that we have, rather than hardcoding them.

#!/bin/sh
# $RedRiver: fix_ldconfig,v 1.8 2008/09/16 22:44:51 andrew Exp $

if [ X"${CHROOT}" == X"" ]; then
  echo No CHROOT Specified!
  exit 255
fi

mkdir -p ${CHROOT}/var/run

for p in `ldconfig -r | awk '/search directories:/ { gsub(":", " ", $3); print $3 }'` ; do
	if [ -d ${CHROOT}${p} ]; then
		LD_PATH="${LD_PATH} ${p}"
	fi
done

if [ ! X"${LD_PATH}" == X"" ]; then
	cp /sbin/ldconfig ${CHROOT}
	echo running: ldconfig ${LD_PATH}
	chroot ${CHROOT} ldconfig ${LD_PATH}
	#chroot ${CHROOT} ldconfig -r
	rm -f ${CHROOT}/ldconfig
fi