#!/bin/sh PATH=$PATH:/sbin:/usr/sbin #test=$( lvs $VM |grep -c "ao" ) test=0 echo $test if [ "$test" -eq 1 ] then echo "VM in use - must exit" exit 0 fi # /var/cache/pbuilder RT=/tmp/${1-"jammy"} echo "rt=$RT" #exit 0 # below for partitioned block device #mount $VM $RT -o offset=1048576 ## --------- end control ------- # bindmount #BM=home/mockbuild/pbdeps for i in dev dev/pts proc sys run ; do mount -o bind /$i $RT/$i echo "mount $i" done LC_ALL=C chroot $RT /bin/bash for i in run dev/pts dev proc sys ; do umount $RT/$i echo "umount $i" done exit 0