Home > linfati.cl > pbuilder and chroot

pbuilder and chroot

Build a Chroot with debootstrap, example a Ubuntu lucid

sudo debootstrap lucid /opt/chroots/lucid.linfati.cl/

now, create a /usr/local/bin/go-chroot file with

#/bin/sh

case "$1" in
  sethost)
	echo virtu-$2 | sudo tee /opt/chroots/$2.linfati.cl/etc/debian_chroot
	;;
  run)
	sudo pbuilder --execute \
	--aptcache "" \
	--no-targz \
	--buildplace /opt/chroots/$2.linfati.cl \
	-- /bin/su -
	;;
  *)
	$0 sethost $1
	$0 run $1
	;;
esac

exit 0

and run

go-chroot lucid
Categories: linfati.cl Tags: , , , , ,
  1. No comments yet.
  1. No trackbacks yet.