From: Kosta Pribić Date: Fri, 16 Oct 2009 13:00:11 +0000 (+0200) Subject: normalne poruke o napretku; strace u default set za debugging; rc.local relative... X-Git-Url: https://git.entuzijast.net/?a=commitdiff_plain;h=dafdc208622000c30907a241e781812afa4fd5f4;p=imunes.git normalne poruke o napretku; strace u default set za debugging; rc.local relative location handling --- diff --git a/linux/gen-vz-template.sh b/linux/gen-vz-template.sh index 3d2fe03..acf1992 100755 --- a/linux/gen-vz-template.sh +++ b/linux/gen-vz-template.sh @@ -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.