diff --git a/xbps-src/shutils/chroot.sh.in b/xbps-src/shutils/chroot.sh.in index d19a7031f9..505fb25d73 100644 --- a/xbps-src/shutils/chroot.sh.in +++ b/xbps-src/shutils/chroot.sh.in @@ -93,7 +93,7 @@ echo "# End of configuration file." >> $XBPSSRC_CF if [ -d $XBPS_MASTERDIR/tmp ]; then if [ ! -f $XBPS_MASTERDIR/.xbps_mount_bind_done ]; then msg_normal "Cleaning up /tmp...\n" - rm -rf $XBPS_MASTERDIR/tmp/* + [ -h ${XBPS_MASTERDIR}/tmp ] || rm -rf $XBPS_MASTERDIR/tmp/* fi fi @@ -101,6 +101,14 @@ prepare_chroot() { local f= + if [ -h ${XBPS_MASTERDIR}/tmp ]; then + rm -f ${XBPS_MASTERDIR}/tmp + mkdir ${XBPS_MASTERDIR}/tmp + fi + if [ -h ${XBPS_MASTERDIR}/var/run ]; then + rm -f ${XBPS_MASTERDIR}/var/run + mkdir -p ${XBPS_MASTERDIR}/var/run + fi # Create some required files. cp -f /etc/mtab $XBPS_MASTERDIR/etc cp -f /etc/resolv.conf $XBPS_MASTERDIR/etc