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

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

Revision 1.10, Tue Sep 16 22:13:21 2008 UTC (15 years, 8 months ago) by andrew
Branch: MAIN
Changes since 1.9: +51 -19 lines

use pax instead of cp.
lots of changes to add stuff that is needed.
and of course, some cleanup.

#!/bin/sh
# $RedRiver: fill_chroot,v 1.9 2008/09/12 23:07:59 andrew Exp $

CHROOT=${CHROOT:=/home/andrew/www}
export CHROOT

_find="-name '*.so.*' -o -name '*.so' -o ( -name perl -a -type f )"

install -d -m 1750 -o www -g bin ${CHROOT}/tmp
for d in ${CHROOT}/{bin,sbin,usr,var,dev}/ \
	${CHROOT}/var/run/ \
	${CHROOT}/usr/{lib,bin,sbin,libexec,local}/ \
	${CHROOT}/usr/local/{lib,bin,sbin,share}/\
; do
	install -d -m 0555 -o root -g wheel $d
done

echo Installing ld.so
echo pax -r -w -L -p e /usr/libexec/ld.so ${CHROOT}
pax -r -w -L -p e /usr/libexec/ld.so ${CHROOT}

echo Making devices
cd ${CHROOT}/dev
/dev/MAKEDEV std
cd ${OLDPWD}

echo Installing perl
perl_to_chroot

if [ -e /usr/local/sbin/femail ]; then 
	echo Installing femail
	echo pax -r -w -L -p e /usr/local/sbin/femail ${CHROOT}
	pax -r -w -L -p e /usr/local/sbin/femail ${CHROOT}
else
	echo femail not installed!  Please install it and link it to 
	echo "    ${CHROOT}/usr/sbin/sendmail"
fi

if [ -e ${CHROOT}/usr/local/sbin/femail ]; then
	echo Installing sendmail symlink to femail
	cd ${CHROOT}/usr/sbin/
	ln -sf ../local/sbin/femail sendmail
	cd ${OLDPWD}
fi

if [ -e /usr/local/bin/aspell ]; then
	echo Installing aspell
	for d in \
		/usr/local/bin/aspell \
		/usr/local/lib/aspell \
		/usr/local/share/aspell \
	; do 
		echo pax -r -w -L -p e $d ${CHROOT}
		pax -r -w -L -p e $d ${CHROOT}
	done

	_find="${_find} -o ( -name aspell -a -type f )"
fi

echo Installing dependencies
for d in `find ${CHROOT}/usr ${_find} | \
     xargs find_depends | \
     sort -u `; do

    echo pax -r -w -L -p e $d ${CHROOT}
    pax -r -w -L -p e $d ${CHROOT}
done

echo Fixing ldconfig (/var/run/ld.so.hints)
fix_ldconfig