Commit 2a7c16dc by Daniel Lezcano Committed by Daniel Lezcano

improve lxc-debian template to specify the suite

The attached patch adds a variable at the top of lxc-debian to change the SUITE. Currently tested suites are lenny, squeeze, sid. Also, the patch uses the dhcp3-client package instead of dhcp-client which is deprecated in lenny and removed in squeeze. Patch initialy from Mathieu Parent. Signed-off-by: 's avatarDaniel Lezcano <dlezcano@fr.ibm.com>
parent a52455f2
...@@ -20,6 +20,8 @@ ...@@ -20,6 +20,8 @@
# License along with this library; if not, write to the Free Software # License along with this library; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
SUITE=${SUITE:-lenny}
configure_debian() configure_debian()
{ {
rootfs=$1 rootfs=$1
...@@ -90,7 +92,7 @@ ifupdown,\ ...@@ -90,7 +92,7 @@ ifupdown,\
locales,\ locales,\
libui-dialog-perl,\ libui-dialog-perl,\
dialog,\ dialog,\
dhcp-client,\ dhcp3-client,\
netbase,\ netbase,\
net-tools,\ net-tools,\
iproute,\ iproute,\
...@@ -100,9 +102,9 @@ openssh-server ...@@ -100,9 +102,9 @@ openssh-server
arch=$2 arch=$2
# check the mini debian was not already downloaded # check the mini debian was not already downloaded
mkdir -p "$cache/partial-$arch" mkdir -p "$cache/partial-$SUITE-$arch"
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
echo "Failed to create '$cache/partial-$arch' directory" echo "Failed to create '$cache/partial-$SUITE-$arch' directory"
return 1 return 1
fi fi
...@@ -110,13 +112,13 @@ openssh-server ...@@ -110,13 +112,13 @@ openssh-server
echo "Downloading debian minimal ..." echo "Downloading debian minimal ..."
debootstrap --verbose --variant=minbase --arch=$arch \ debootstrap --verbose --variant=minbase --arch=$arch \
--include $packages \ --include $packages \
lenny $cache/partial-$arch http://ftp.debian.org/debian "$SUITE" "$cache/partial-$SUITE-$arch" http://ftp.debian.org/debian
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
echo "Failed to download the rootfs, aborting." echo "Failed to download the rootfs, aborting."
return 1 return 1
fi fi
mv "$1/partial-$arch" "$1/rootfs-$arch" mv "$1/partial-$SUITE-$arch" "$1/rootfs-$SUITE-$arch"
echo "Download complete." echo "Download complete."
return 0 return 0
...@@ -130,7 +132,7 @@ copy_debian() ...@@ -130,7 +132,7 @@ copy_debian()
# make a local copy of the minidebian # make a local copy of the minidebian
echo -n "Copying rootfs to $rootfs..." echo -n "Copying rootfs to $rootfs..."
cp -a $cache/rootfs-$arch $rootfs || return 1 cp -a "$cache/rootfs-$SUITE-$arch" $rootfs || return 1
return 0 return 0
} }
...@@ -155,8 +157,8 @@ install_debian() ...@@ -155,8 +157,8 @@ install_debian()
arch=i386 arch=i386
fi fi
echo "Checking cache download in $cache/rootfs-$arch ... " echo "Checking cache download in $cache/rootfs-$SUITE-$arch ... "
if [ ! -e "$cache/rootfs-$arch" ]; then if [ ! -e "$cache/rootfs-$SUITE-$arch" ]; then
download_debian $cache $arch download_debian $cache $arch
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
echo "Failed to download 'debian base'" echo "Failed to download 'debian base'"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment