Commit Graph

31 Commits

Author SHA1 Message Date
Daniel Lezcano
eb960fea58 busybox template
This script builds a busybox rootfs and provides the associated
configuration to run the busybox.

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2009-12-27 22:36:09 +01:00
Daniel Lezcano
418c73ad12 adapt lxc-sshd to be a template
Cleanup the script, simplify it and pass the arguments to this
script to be callable by lxc-create template logic.

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2009-12-27 22:36:09 +01:00
Daniel Lezcano
fb7460fe60 cleanup lxc-debian script
The lxc-debian is epurated and consolidated with a better
error handling.

This script is no longer interactive but it installs in a specified
place the debian rootfs.

This script is not supposed to be called directly so it will fall in
libexec path very soon. This script is called by lxc-create
as a template with the right option and the right place.

The debian network configuration is by dhcp.

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2009-12-27 22:36:09 +01:00
Michel Normand
0079c6c0da lxc lxc-sshd using new lxc.mount.entry keyword
Signed-off-by: Michel Normand <michel_mno@laposte.net>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2009-11-13 11:48:29 +01:00
Michel Normand
70dd139727 lxc: remove lxc.mount setting in lxc-fedora script
This script do not use extract fstab (as done by lxc-debian)
so there is no reason to set the lxc.mount key in config file.

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
Signed-off-by: Michel Normand <michel_mno@laposte.net>
2009-11-13 11:48:29 +01:00
Michel Normand
3f4a86bf0f lxc-debian using new lxc.mount.entry keyword
Fix script to not add a fstab file.

Signed-off-by: Michel Normand <michel_mno@laposte.net>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2009-11-13 11:48:29 +01:00
Michel Normand
1846e71a27 lxc-debian to not use empty mount table
lxc should not save in config generated file the name of an
empty file if no additionnal mount point specified by user.

Signed-off-by: Michel Normand <michel_mno@laposte.net>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2009-11-13 11:48:29 +01:00
Daniel Lezcano
cd830f336a Specify in the debian script an extra fstab file
Allow the user to specify an extra fstab file to be added in the
debian configuration. So some optimisations can be done for sharing
objects.

eg: /var/cache/apt/archives mounted in <rootfs>/var/cache/apt/archives

Signed-of-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2009-07-22 19:39:18 +02:00
Matty
4f3f0d4b01 lxc-fedora fixes
Howdy,

I was playing around with LXC containers this past weekend, and
noticed a couple of issues with the lxc-fedora script:

#1: Line 96 should be ${ROOTFS}/etc/sysconfig/network instead of
${ROOTFS}/sysconfig/network

#2 Line 249 contains a reference to $PKG, which isn't used in the
program. I adjusted the variable to point to the correct package, and
use this in the calls to yumdownloader:

    PKG="${DISTRO}-release.noarch.rpm"
                   .....
    yumdownloader --destdir="${CACHE}/partial" "${PKG}"

#3 The $CACHE/partial path is escaped unnecessarily:

   RPM="rpm --root \"${CACHE}/partial\""

#4 The program assumes yumdownloader will work, which isn't always the
case. I added an if statement to check the return code:


   echo "Downloading distribution release file ${PKG}"
   yumdownloader --destdir="${CACHE}/partial" "${PKG}"
   RESULT=$?

   if [ "${RESULT}" != "0" ]; then
       echo "Enable to download the distribution release file"
       exit 1
   fi

#5 The package name passed to yumdownloader is incorrect:

   yumdownloader --destdir="${CACHE}/partial" "${DISTRO}-release.noarch.rpm"

   On Fedora 10 and 11, this evaluates to:

   fedora-release.noarch.rpm

   When we need it to evaluate to:

   fedora-{RELEASE_VER}.release.noarch

   This is fixed in the PKG variable listed above.

A patch that addresses these issues is attached.

Thanks,
- Ryan

Signed-off-by: Matty <matty91@gmail.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2009-06-24 13:13:18 +02:00
Ryousei Takano
e65b846976 Use 'uname -m' instead of arch
'uname -m' seems to be more general to get the machine's architecture
type.  Ubunbu 8.10 (and also all debian based distros?) does not have
arch(1).

Signed-off-by: Ryousei Takano <takano-ryousei@aist.go.jp>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2009-03-27 11:12:45 +01:00
Ryousei Takano
b44cb779a1 Add mtu option setting for lxc-fedora
This patch adds the mtu option setting for the lxc-fedora script.

Signed-off-by: Ryousei Takano <takano-ryousei@aist.go.jp>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2009-03-26 11:39:19 +01:00
Ryousei Takano
81f6a40acf Add mtu option setting for lxc-debian
This patch adds the mtu option setting for the lxc-debian script.

Signed-off-by: Ryousei Takano <takano-ryousei@aist.go.jp>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2009-03-26 11:39:19 +01:00
Matt Helsley
54b1eb6860 liblxc: create a fedore template container
On Mon, 2009-02-09 at 15:43 -0800, Dan Smith wrote:
> DL> It may be possible to use yum like debootstrap for an minbase
> DL> fedora install.
> 
> Yep, something like the following should work:
> 
>   root=/path/to/tmproot
>   mkdir -p $root/var/lib/rpm
>   rpm --root $root --initdb
>   rpm --root $root -Uvfh --nodeps http://fedora.osuosl.org/linux/releases/10/Fedora/i386/os/Packages/fedora-release-10-1.noarch.rpm
>   yum --installroot=$root -y groupinstall Base

Looks familiar! ;) I was intrigued by this idea last weekend so I
started such a script. However I only tested it as far as creating a
semi-correct rootfs. With the exception of network configs most of the
configs are still written as for debian. For example I know the selinux
policy enforcement settings need to move, the inittab needs to be
replaced by the proper upstart configs, etc.

Of course it's based heavily on Daniel's excellent lxc-debian script.

Signed-off-by: Matt Helsley <matthltc@us.ibm.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2009-03-08 17:09:27 +01:00
dlezcano
1e648e6539 Add the pts configuration for lxc-debian
From: Daniel Lezcano <dlezcano@fr.ibm.com>

Add the pts configuration when creating a debian container.

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2009-02-20 14:13:37 +00:00
dlezcano
c952d1b915 Remove some pointless debian services
From: Daniel Lezcano <daniel.lezcano@free.fr>

Remove some debian services because they don't have sense in a container,
like the hw clock or the unmount of the file systems.

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2009-02-16 10:11:03 +00:00
dlezcano
45e2df30c1 add missing ifupdown package to debootstrap
From: Daniel Lezcano <dlezcano@fr.ibm.com>

Add the ifupdown missing package.

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2009-02-09 17:11:24 +00:00
dlezcano
2f997019d0 Update lxc-debian to use the lenny release
From: Matt Helsley <matthltc@us.ibm.com>

With the release of lenny nearing this patch may soon be useful.

Signed-off-by: Matt Helsley <matthltc@us.ibm.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2009-02-09 17:10:52 +00:00
dlezcano
8524810714 handle interruption/failure of lxc-debian more gracefully
From: Matt Helsley <matthltc@us.ibm.com>

If lxc-debian fails or is interrupted during debootstrap then the next
invocation of lxc-debian breaks because it only checks for the existence
of the directory. This forces the user to remove the cache by hand to
retry the create step.

Let's allow the user to re-run lxc-debian to resume/retry. Store the
cache in a partial-$ARCH directory until debootstrap succeeds. Then move
the valid cache to its final destination.

Signed-off-by: Matt Helsley <matthltc@us.ibm.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2009-02-05 12:03:47 +00:00
dlezcano
dc21287c4d Complete use of autoconf prefix in lxc-debian
From: Matt Helsley <matthltc@us.ibm.com>

The lxc-debian script does not consistently address the lxc lock as
@LOCALSTATEDIR@/lock/subsys/lxc. Make consistent use of the autotools
substitution to completely enable configure --prefixes.

I also added a comment explaining why some of the paths didn't need
autoconf substitutions for anyone who wants to understand the script.
Also, to separate it from the container contents proper, I moved the
CACHE variable initialization above the container-internal path
variables.

Signed-off-by: Matt Helsley <matthltc@us.ibm.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2009-01-29 10:50:28 +00:00
dlezcano
b0a33c1eb6 From: Daniel Lezcano <daniel.lezcano@free.fr>
Console support for the system container.

Signed-off-by: Daniel Lezcano <daniel.lezcano@free.fr>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2009-01-25 21:52:38 +00:00
dlezcano
80a992f719 Comment out the script debug mode
From: Daniel Lezcano <daniel.lezcano@free.fr>

Suppress debug mode in the script

Signed-off-by: Daniel Lezcano <daniel.lezcano@free.fr>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2009-01-18 21:47:55 +00:00
dlezcano
a340b3fc00 Add more to cvsignore
From: Michel Normand <michel_mno@laposte.net>

Add more files to .cvsignore, especially the new created files.

Signed-off-by: Michel Normand <michel_mno@laposte.net>
Signed-off-by: Daniel Lezcano <daniel.lezcano@free.fr>
2008-12-13 12:32:11 +00:00
dlezcano
7afc269d0e Enforce selinux to disabled
From: Daniel Lezcano <dlezcano@fr.ibm.com>

Enforce selinux to disabled

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2008-12-09 17:58:29 +00:00
dlezcano
063880115c Improve the lxc-debian script
From: Daniel Lezcano <dlezcano@fr.ibm.com>

Changed the lxc-debian script to accept empty password for
ssh connection, and to not share the /dev directory with the
system.

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2008-12-09 17:39:58 +00:00
dlezcano
719c46e12b Allow to use /dev/ptmx
From: Daniel Lezcano <dlezcano@fr.ibm.com>

Added /dev/ptmx to the devices.allow list.

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2008-12-09 10:35:37 +00:00
dlezcano
85cbaa06f9 Add cgroup devices whitelist for the debian
From: Daniel Lezcano <dlezcano@fr.ibm.com>

Added thed cgroup whitelist configuration for a debian container.

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2008-12-09 09:39:49 +00:00
dlezcano
7ad641d5bf Expand the configure directory
From: Daniel Lezcano <dlezcano@fr.ibm.com>

Expand the configure variable specifying the directories in order to use
them directly in the scripts.

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2008-12-01 11:50:43 +00:00
dlezcano
bad691583c *** empty log message *** 2008-11-30 15:33:10 +00:00
dlezcano
ea39e0c296 *** empty log message *** 2008-11-30 08:10:47 +00:00
dlezcano
6b96cf76c0 Added Makefile file 2008-11-30 08:08:31 +00:00
dlezcano
c9844b8733 Added a script directory for containers creation helper scripts
From: Daniel Lezcano <dlezcano@fr.ibm.com>

Added a directory called 'scripts' where is stored two helpers.
The first one allows to create a mini debian container and the
second one to create a sshd container.

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2008-11-28 15:36:51 +00:00