From 6efdcb6a3cc4d06bf64af69b08bc95335f02b79f Mon Sep 17 00:00:00 2001 From: Dwight Engen Date: Wed, 3 Apr 2013 17:08:32 -0400 Subject: [PATCH] debian template: set arch when dpkg doesn't exist on host Signed-off-by: Dwight Engen Acked-by: Serge E. Hallyn --- templates/lxc-debian.in | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/templates/lxc-debian.in b/templates/lxc-debian.in index 7bbc46b94..e36523c26 100644 --- a/templates/lxc-debian.in +++ b/templates/lxc-debian.in @@ -172,7 +172,18 @@ install_debian() return 1 fi - arch=$(dpkg --print-architecture) + if which dpkg >/dev/null 2>&1 ; then + arch=$(dpkg --print-architecture) + else + arch=$(arch) + if [ "$arch" = "i686" ]; then + arch="i386" + elif [ "$arch" = "x86_64" ]; then + arch="amd64" + elif [ "$arch" = "armv7l" ]; then + arch="armhf" + fi + fi echo "Checking cache download in $cache/rootfs-$SUITE-$arch ... " if [ ! -e "$cache/rootfs-$SUITE-$arch" ]; then -- 2.47.2