Minor clean up for debian base boxes scripts
This commit is contained in:
parent
1fe6537c93
commit
4759adf143
2 changed files with 8 additions and 12 deletions
|
@ -1,7 +1,5 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# -*- mode:shell-mode;tab-width:2;indent-tabs-mode:nil;coding:utf-8 -*-
|
|
||||||
# vim: ft=shell syn=shell fileencoding=utf-8 sw=2 ts=2 ai eol et si
|
|
||||||
#
|
|
||||||
# This is the code extracted from /usr/share/lxc/templates/lxc-debian
|
# This is the code extracted from /usr/share/lxc/templates/lxc-debian
|
||||||
# that comes with Ubuntu 12.10 which is responsible for downloading the
|
# that comes with Ubuntu 12.10 which is responsible for downloading the
|
||||||
# rootfs files / packages
|
# rootfs files / packages
|
||||||
|
@ -27,7 +25,7 @@ write_sourceslist()
|
||||||
rootfs=$1
|
rootfs=$1
|
||||||
arch=$2
|
arch=$2
|
||||||
release=$3
|
release=$3
|
||||||
|
|
||||||
MIRROR=${MIRROR:-http://ftp.debian.org/debian}
|
MIRROR=${MIRROR:-http://ftp.debian.org/debian}
|
||||||
SECURITY_MIRROR=${SECURITY_MIRROR:-http://security.debian.org/debian-security}
|
SECURITY_MIRROR=${SECURITY_MIRROR:-http://security.debian.org/debian-security}
|
||||||
|
|
||||||
|
@ -64,7 +62,7 @@ download_debian()
|
||||||
cache=$1
|
cache=$1
|
||||||
arch=$2
|
arch=$2
|
||||||
release=$3
|
release=$3
|
||||||
|
|
||||||
packages=\
|
packages=\
|
||||||
sudo,\
|
sudo,\
|
||||||
ifupdown,\
|
ifupdown,\
|
||||||
|
@ -97,7 +95,7 @@ ca-certificates
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "installing packages: ${packages}"
|
echo "installing packages: ${packages}"
|
||||||
|
|
||||||
trap cleanup EXIT SIGHUP SIGINT SIGTERM
|
trap cleanup EXIT SIGHUP SIGINT SIGTERM
|
||||||
# check the mini debian was not already downloaded
|
# check the mini debian was not already downloaded
|
||||||
partial=${cache}/partial-${release}-${arch}
|
partial=${cache}/partial-${release}-${arch}
|
||||||
|
@ -106,7 +104,7 @@ ca-certificates
|
||||||
echo "Failed to create '${partial}' directory"
|
echo "Failed to create '${partial}' directory"
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# download a mini debian into a cache
|
# download a mini debian into a cache
|
||||||
echo "Downloading debian ${release} minimal ..."
|
echo "Downloading debian ${release} minimal ..."
|
||||||
debootstrap \
|
debootstrap \
|
||||||
|
@ -115,7 +113,7 @@ ca-certificates
|
||||||
--components=main,contrib,non-free \
|
--components=main,contrib,non-free \
|
||||||
--arch=${arch} \
|
--arch=${arch} \
|
||||||
--include=${packages} ${release} ${partial} ${MIRROR}
|
--include=${packages} ${release} ${partial} ${MIRROR}
|
||||||
|
|
||||||
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
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# -*- mode:shell-mode;tab-width:2;indent-tabs-mode:nil;coding:utf-8 -*-
|
|
||||||
# vim: ft=shell syn=shell fileencoding=utf-8 sw=2 ts=2 ai eol et si
|
|
||||||
|
|
||||||
# This is a modified version of /usr/share/lxc/templates/lxc-debian
|
# This is a modified version of /usr/share/lxc/templates/lxc-debian
|
||||||
# that comes with Ubuntu 12.10 changed to suit vagrant-lxc needs
|
# that comes with Ubuntu 12.10 changed to suit vagrant-lxc needs
|
||||||
|
@ -139,7 +137,7 @@ EOF
|
||||||
chroot $rootfs /usr/sbin/update-rc.d -f $service remove > /dev/null 2>&1
|
chroot $rootfs /usr/sbin/update-rc.d -f $service remove > /dev/null 2>&1
|
||||||
echo "service ${service} removed from init"
|
echo "service ${service} removed from init"
|
||||||
done
|
done
|
||||||
|
|
||||||
# suppress log level output for udev
|
# suppress log level output for udev
|
||||||
#sed -i "s/=\"err\"/=0/" $rootfs/etc/udev/udev.conf
|
#sed -i "s/=\"err\"/=0/" $rootfs/etc/udev/udev.conf
|
||||||
|
|
||||||
|
@ -276,7 +274,7 @@ lxc.cgroup.memory.limit_in_bytes = 1024M
|
||||||
|
|
||||||
# CPUs
|
# CPUs
|
||||||
# assign first CPU to this container:
|
# assign first CPU to this container:
|
||||||
#lxc.cgroup.cpuset.cpus = 0
|
#lxc.cgroup.cpuset.cpus = 0
|
||||||
# assign the first, the second and the last CPU
|
# assign the first, the second and the last CPU
|
||||||
#lxc.cgroup.cpuset.cpus = 0-1,3
|
#lxc.cgroup.cpuset.cpus = 0-1,3
|
||||||
# assign the first and the last CPU
|
# assign the first and the last CPU
|
||||||
|
|
Loading…
Reference in a new issue