lxc-cirros.in revision 207bf0e475f1dc6e9a2dac2cee3a209b56427855
198b363fff1de9afcee2f26b9aa847316f589afeSerge Hallyn# template script for generating ubuntu container for LXC
198b363fff1de9afcee2f26b9aa847316f589afeSerge Hallyn# This script consolidates and extends the existing lxc ubuntu scripts
198b363fff1de9afcee2f26b9aa847316f589afeSerge Hallyn# Copyright © 2013 Canonical Ltd.
8da250dad4b11c4983031742a83fb8f358044fe0Stéphane Graber# Author: Scott Moser <scott.moser@canonical.com>
8da250dad4b11c4983031742a83fb8f358044fe0Stéphane Graber# This program is free software; you can redistribute it and/or modify
8da250dad4b11c4983031742a83fb8f358044fe0Stéphane Graber# it under the terms of the GNU General Public License version 2, as
8da250dad4b11c4983031742a83fb8f358044fe0Stéphane Graber# published by the Free Software Foundation.
198b363fff1de9afcee2f26b9aa847316f589afeSerge Hallyn# This program is distributed in the hope that it will be useful,
8da250dad4b11c4983031742a83fb8f358044fe0Stéphane Graber# but WITHOUT ANY WARRANTY; without even the implied warranty of
8da250dad4b11c4983031742a83fb8f358044fe0Stéphane Graber# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
8da250dad4b11c4983031742a83fb8f358044fe0Stéphane Graber# GNU General Public License for more details.
8da250dad4b11c4983031742a83fb8f358044fe0Stéphane Graber# You should have received a copy of the GNU General Public License along
a5c28c86f56835fa3e0915558e05390dd0a79580Aleksandr Mezin# with this program; if not, write to the Free Software Foundation, Inc.,
a5c28c86f56835fa3e0915558e05390dd0a79580Aleksandr Mezin# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
a5c28c86f56835fa3e0915558e05390dd0a79580Aleksandr Mezin# Detect use under userns (unsupported)
a5c28c86f56835fa3e0915558e05390dd0a79580Aleksandr Mezin if [ "$arg" == "--mapped-uid" -o "$arg" == "--mapped-gid" ]; then
a5c28c86f56835fa3e0915558e05390dd0a79580Aleksandr Mezin echo "This template can't be used for unprivileged containers." 1>&2
8da250dad4b11c4983031742a83fb8f358044fe0Stéphane Graber echo "You may want to try the \"download\" template instead." 1>&2
8da250dad4b11c4983031742a83fb8f358044fe0Stéphane Graber# Make sure the usual locations are in PATH
8da250dad4b11c4983031742a83fb8f358044fe0Stéphane GraberDOWNLOAD_URL="http://download.cirros-cloud.net/"
cat <<EOF
local level=${1}; shift;
while [ $# -ne 0 ]; do
cur=$1; next=$2;