test -d $dir || mkdir -p $dir
if [ ! -x $dir/sbin/init ]; then
+ echo Running debootstrap $rel $dir $mirror...
test -f /var/lib/dpkg/info/debootstrap.list || apt-get install debootstrap
debootstrap --variant=minbase $rel $dir $mirror
+else
+ echo Default package set already installed.
fi
-for p in iproute net-tools iputils-ping mtr-tiny quagga; do
- test -f $dir/var/lib/dpkg/info/$p.list || chroot $dir apt-get install $p --no-install-recommends
+for p in iproute net-tools iputils-ping mtr-tiny quagga strace; do
+ if [ ! -f $dir/var/lib/dpkg/info/$p.list ]; then
+ echo Installing package $p...
+ chroot $dir apt-get install $p --no-install-recommends
+ else
+ echo Package $p already installed.
+ fi
done
+
+echo Cleaning up template dir...
rm -f $dir/etc/rc?.d/???cron # quagga povlaci cron koji ne trebamo
rm -f $dir/etc/rc?.d/???ondemand
# dodajemo touch da tocno znamo kad se VE bootao
-cp rc.local $dir/etc/rc.local
+echo Adding boot-done indicator...
+rclocal=rc.local
+test -f $rclocal || rclocal="linux/rc.local"
+test -f $rclocal || { echo rc.local file missing; exit 1; }
+cp $rclocal $dir/etc/rc.local
+echo Creating template cache archive file...
cd $dir
tar czf ../imunes-openvz.tar.gz *
mv ../imunes-openvz.tar.gz /var/lib/vz/template/cache/
+echo Linking $dist.conf as imunes-openvz.conf...
ln -sf $dist.conf /etc/vz/dists/imunes-openvz.conf
+
+echo All is well.