]> git.entuzijast.net Git - imunes.git/commitdiff
normalne poruke o napretku; strace u default set za debugging; rc.local relative...
authorKosta Pribić <kosta.pribic@gmail.com>
Fri, 16 Oct 2009 13:00:11 +0000 (15:00 +0200)
committerKosta Pribić <kosta.pribic@gmail.com>
Fri, 16 Oct 2009 13:00:11 +0000 (15:00 +0200)
linux/gen-vz-template.sh

index 3d2fe03430d1198070e5bc9d30281c6a9140d07a..acf199265f0d31a9734370ebe51367b3d7b08bf4 100755 (executable)
@@ -42,13 +42,23 @@ fi
 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
 
@@ -62,11 +72,19 @@ rm -f $dir/etc/event.d/tty?
 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.