From 543e0d506123f6c92614bfcab28cf79735ad0cd3 Mon Sep 17 00:00:00 2001 From: Kevin Gallagher Date: Mon, 10 Oct 2016 19:50:07 -0700 Subject: [PATCH] Check existence of lxc-init before cp to init.lxc --- bin/make-base-vm | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/bin/make-base-vm b/bin/make-base-vm index 55b7b31..a7c182b 100755 --- a/bin/make-base-vm +++ b/bin/make-base-vm @@ -193,9 +193,15 @@ if [ $LXC = "1" ]; then else if [ $ARCH = "amd64" ] then - sudo cp $OUT-bootstrap/usr/lib/x86_64-linux-gnu/lxc/lxc-init $OUT-bootstrap/usr/sbin/init.lxc + if [ -f $OUT-bootstrap/usr/lib/x86_64-linux-gnu/lxc/lxc-init ] + then + sudo cp $OUT-bootstrap/usr/lib/x86_64-linux-gnu/lxc/lxc-init $OUT-bootstrap/usr/sbin/init.lxc + fi else - sudo cp $OUT-bootstrap/usr/lib/i386-linux-gnu/lxc/lxc-init $OUT-bootstrap/usr/sbin/init.lxc + if [ -f $OUT-bootstrap/usr/lib/i386-linux-gnu/lxc/lxc-init ] + then + sudo cp $OUT-bootstrap/usr/lib/i386-linux-gnu/lxc/lxc-init $OUT-bootstrap/usr/sbin/init.lxc + fi fi fi dd if=/dev/zero of=$OUT-lxc bs=1M count=1 seek=10240