Commit Graph

114 Commits

Author SHA1 Message Date
Dwight Engen
169bf5e07e use which instead of type
This is for consistency with the rest of lxc, and also because type checks for
shell builtins, a behavior that we do not want in these cases. Ensure stderr
for which is redirected to /dev/null also.

Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2013-01-22 17:51:59 -05:00
Stéphane Graber
fe253caa8b templates: Consistent use of locking
Move to per-template lock (except for oracle that's per-container).
Also ensure that the path used for the lock is relative to LOCALSTATEDIR.

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
2012-12-06 09:43:29 -05:00
Stéphane Graber
7c38257226 lxc-ubuntu: Don't hardcode path to cache
Use LOCALSTATEDIR to generate the path to the cache.

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
2012-12-06 09:43:23 -05:00
Stéphane Graber
8e100cef8b lxc-ubuntu: Rename from lxc-ubuntu.in
lxc-ubuntu no longer uses any build time variables, therefore it can
now be simply copied to the target without any autoconf magic.

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
2012-11-29 10:26:26 -05:00
Stéphane Graber
fade719ed9 lxc-ubuntu: Guess a list of langpacks to install
In addition to creating the current locale in the container, also
try to scan the host and extra the list of langpacks installed there,
then pass that list to debootstrap as additional packages to install.

On distros that don't have dpkg, only language-pack-en will be installed.
The code will always ensure that language-pack-en is ALWAYS installed in the
target, similar to what Ubuntu does with its various media.

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
2012-11-29 10:26:23 -05:00
Stéphane Graber
18f823c1ca lxc-ubuntu: Always create the needed locales
Move some old code from the trim() function into the main configure_ubuntu
function so that we always create a locale in the container.

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
2012-11-29 10:26:20 -05:00
Serge Hallyn
1881820ae4 lxc-create: Make location of container rootfs configurable
Make 'dir' an explicit backing store type, which accepts '--dir rootfs'
as an option to specify a custom location for the container rootfs.  Also
update lxc-destroy to now remove the rootfs separately, as removing
@LXCPATH@/$name may not hit it.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
2012-11-12 13:13:52 -05:00
Serge Hallyn
192df6e2eb revert devtmpfs in ubuntu templates
devtmpfs is shared between host and containers, and it messes up
lucid containers too.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
2012-10-25 10:37:59 +02:00
Stéphane Graber
c215bff6df lxc-ubuntu{-cloud}: Fix missing "fi" in new devtmpfs code
The "if" statement to add devtmpfs was missing a matching "fi" causing parsing
error when using the template.

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2012-10-25 10:37:54 +02:00
Serge Hallyn
bf7d76cf3a templates: mount devtmpfs in ubuntu containers
That way /dev/disk/ exists, and update-grub can succeed.

Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/grub2/+bug/1060404
2012-10-25 10:36:42 +02:00
Serge Hallyn
c6ed4d048d lxc-ubuntu: fix printing of default user
If a user is bound into the container, don't claim the default user is
ubuntu.

Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/lxc/+bug/1052315

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
2012-10-25 10:35:47 +02:00
Serge Hallyn
91a5df88ad try to better handle out of date container caches.
For a lucid container, apt-get update before installing the source package for
add-apt-repository, so that apt-get does not fail.

If apt-get dist-upgrade fails, suggest running lxc-create with -F.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
2012-10-25 10:35:22 +02:00
Stéphane Graber
f02ce27d4b Add lxc.aa_profile example to all templates
LXC has optional apparmor support, default profile is lxc-container-default.
This change adds a commented "lxc.aa_profile = default" line to all templates,
uncommenting this will bypass apparmor for the container.

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2012-10-25 10:16:23 +02:00
Stéphane Graber
e470cba076 Use lxc_putold as the pivot_root put dir in the ubuntu templates
By default we use mnt, but that means that lxc fstab entries do not work
when placed under the container's /mnt/.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2012-10-25 10:09:30 +02:00
Stéphane Graber
542939c31b Fix lxc-ubuntu and lxc-ubuntu-cloud to properly deal with /dev/shm.
Now that initscripts in Debian and Ubuntu has been updated to no longer
do silly things with /dev/shm and /run/shm on installation/update, the
check needs updating to detect any remaining broken case and fix it.

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2012-10-25 10:09:25 +02:00
Serge Hallyn
06f5c6328b ubuntu template: apt-get clean after debootstrapping a cache
This saves quite a bit of space in the cache and containers.

See https://bugs.launchpad.net/ubuntu/+source/lxc/+bug/1037626 for the
original bug report.

Reported-by: Fajar A. Nugraha <list@fajar.net>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
2012-10-25 10:07:16 +02:00
Serge Hallyn
f1ccde27c0 ubuntu and debian templates: Clean up cache if cache build is interrupted
Otherwise the next lxc-create may rsync a bad cache.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
2012-10-25 10:07:04 +02:00
Serge Hallyn
40f6ee0088 lxc-ubuntu: Use dpkg --add-architecture
When a container has dpkg >= 1.16.2, use dpkg --add-architecture
for multi-arch configuration on foreign architecture containers.

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2012-07-31 16:07:18 +02:00
Serge Hallyn
add1d11833 templates: don't fail on busy flock
Just wait until the lock is available.  That is a nicer behavior
for concurrent lxc-creates.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2012-07-31 16:07:18 +02:00
Serge Hallyn
09595b86de lxc-ubuntu.in: drop duplicate code
Commits 15da01b393 and
2e44ed1e64 conflicted and resulted in
some duplicate functionality.  Drop the poorer version of that block.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2012-07-31 16:07:18 +02:00
Serge Hallyn
adca854310 Simplify the Ubuntu template a bit
- Update list of extra packages for debootstrap to only include vim
       and ssh. The others were only relevant when we were still using the
       minbase variant. (LP: #996839)
     - Drop any hardcoded Ubuntu version check and replace by feature
       checks instead.
     - Format lxc-ubuntu to consistently use 4-spaces indent instead of
       mixed spaces/tabs.
     - Update default /etc/network/interfaces to include the header.
     - Update default /etc/hosts to match that of a regular Ubuntu system.
     - Drop support for end-of-life releases (gutsy on sparc).
     - Make sure /etc/resolv.conf is valid before running any apt command.
     - Update template help message for release and arch parameters.
     - Switch default Ubuntu version from lucid to precise.

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2012-07-31 16:07:18 +02:00
Serge Hallyn
f876c22399 lxc-ubuntu: fix non-native architectures
When installing a non-native architecture, the template
installs a bunch of packages of the native architecture to work around
existing limitations of qemu-user-static, mostly related to netlink.

The current code would install upstart of the host architecture but
force the amd64 version of the others. This was just a mistake done
while testing/developping the code. Fixing now to always install
the native architecture version of all of them.

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2012-07-31 16:04:33 +02:00
Serge Hallyn
f34ff29683 ubuntu templates: remove maverick as it is end-of-life
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2012-07-31 16:04:33 +02:00
Serge Hallyn
b8bced69a8 Update Ubuntu templates for quantal
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2012-07-31 16:04:33 +02:00
Serge Hallyn
42ff5f0f87 lxc-ubuntu*: in precise, make /dev/shm a symbolic link to /run/shm
This would be done (though done wrongly) by mounted-dev.conf, but
that doesn't run because we don't mount /dev.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2012-07-31 16:04:33 +02:00
Serge Hallyn
b08ee0ce9a Minor lxc config template layout fix
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2012-07-31 16:04:33 +02:00
Serge Hallyn
e4208a1995 lxc-ubuntu: use relative path as target for bind mount
An absolute path will be interpreted as absolute with respect to the
parent's namespace.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2012-07-31 16:04:33 +02:00
Serge Hallyn
80a881b232 templates: use relative paths when creating containers
At the same time, allow lxc.mount.entry to specify an absolute target
path relative to /var/lib/lxc/CN/rootfs, even if rootfs is a blockdev.
Otherwise all such entries are ignored for blockdev-backed containers.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2012-07-31 16:04:33 +02:00
Serge Hallyn
9db1aba4bc lxc-ubuntu.in: fix up the logic adding group for bound users
1. 'getent group $user' assumes user's group is named $user.
 2. if 'getent group' returns error, just ignore the group in container
 3. (misc) while it happens to all work out fine anyway, don't do
    getent passwd $bindhome if $bindhome isn't defined.  (it will
    successfully return all password entries)

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2012-07-31 16:03:30 +02:00
Serge Hallyn
ce5dbd8275 ubuntu template: if a user is bound in, don't define ubuntu user
It might have a conflicting uid, and isn't needed.  Also put the bound user
into sudo group.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2012-07-31 16:03:30 +02:00
Stéphane Graber
96bd45c823 ubuntu template: add sudo group and cleanup minor devttydir issue
Always add the user to the 'sudo' group as it's been around
since at least Ubuntu 10.04. In addition make the user part
of the admin group until 12.04 where it's been removed.
Also fix a minor layout issue with devttydir.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2012-07-31 16:01:28 +02:00
Serge Hallyn
39aa5856f0 ubuntu template: install bound user's shell
If a host user is bound into the container (-b), make sure that his
shell is installed in the container.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2012-07-31 16:01:28 +02:00
Serge Hallyn
12170cf8e7 ubuntu template: handle /etc/resolv.conf being a symlink
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2012-07-31 16:01:28 +02:00
Serge Hallyn
1d61e5b908 ubuntu template: set -e to return error on failures.
Otherwise callers can get bad containers without knowing it.

Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/lxc/+bug/922645

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2012-07-31 16:01:28 +02:00
Serge Hallyn
52c8f624b5 ubuntu templates cleanups
1. fix inconsistent use of '--auth-key' (not --auth_key) which broke their
   usage
2. add --debug option to lxc-ubuntu (which does set -x to show what broke)
   (idea from Idea from lifeless and benji)
3. fix incorrect assumption about group with -b option.  User's default group
   may not be the same as username.
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2012-03-19 00:31:40 +01:00
Serge Hallyn
4759162d07 update ubuntu templates to provide macaddr and more
Add a macaddr if precisely one veth is specified but no hwaddr.  Allow
specifying ssh authkeys.  In cloud template, copy locales by default and allow
a tarball to be specified.

Signed-off-by: Ben Howard <ben.howard@canonical.com>
Signed-off-by: Serge Hallyn <serge@hallyn.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2012-02-26 10:44:41 +01:00
Serge Hallyn
bb59e07809 lxc-ubuntu: fix obscure arguments
1. --path is meant to be passed by lxc-create, but should not be passed
 in by users.  Don't advertise it in --help.
 2. --clean syntax ends up not making much sense.  Get rid of it, and
 add '--flush-cache' option instead.

Signed-off-by: Serge Hallyn <serge@hallyn.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2012-02-26 10:44:41 +01:00
Serge Hallyn
f6144f0cba ubuntu template changes
Author: Stéphane Graber <stgraber@ubuntu.com>

Use ubuntu/ubuntu instead of root/root by default.  Stop
removing tty[56].conf in Precise.  Stop messing with dhclient.conf.
Set devttydir on Precise to /dev/lxc to allow for clean upgrades.

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Signed-off-by: Serge Hallyn <serge@hallyn.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2012-02-26 10:44:41 +01:00
Serge Hallyn
6880563d9d Don't install lxcguest in precise (and higher) releases
lxcguest is no longer needed, as precise should boot in a container
un-modified.

Signed-off-by: Serge Hallyn <serge.hallyn@canonical.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2012-02-26 10:44:40 +01:00
Serge Hallyn
5a50e09a43 lxc-ubuntu: Support for building a container of a foreign architecture
Support building a container of a foreign architecture if
qemu-user-static is installed.  This is done by installing some packages
of the host architecture in the container using multi-arch.

Author: Stéphane Graber <stgraber@ubuntu.com>
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Signed-off-by: Serge Hallyn <serge.hallyn@canonical.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2012-02-26 10:44:40 +01:00
Serge Hallyn
6d8ac56b65 add lvm support to lxc-create
1. Some templates copy the cached pristine rootfs using 'cp a b' where b is
$lxc_path/$name/rootfs.  That doesn't do the right thing if rootfs already
exists, as it will when it is an lvm or other mount.  So switch to
'rsync a/ b/'.  (cp can be made to work too of course).

2. Update lxc-create to support backing stores.  For now only lvm is
implemented.

Signed-off-by: Serge Hallyn <serge.hallyn@canonical.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2012-02-26 10:44:40 +01:00
Serge Hallyn
2e44ed1e64 lxc-ubuntu: use release-updates and release-security
Particularly for LTS releases, which many people will want to use in
their containers, it is not wise to not use -security and -updates.
Furthermore the fix allowing ssh to allow the container to shut down
is in lucid-updates only.

With this patch, after debootstrapping a container, we add -updates
and -security to sources.list and do an apt-get upgrade under chroot.
Unfortunately we need to do this because debootstrap doesn't know how
to.

Signed-off-by: Serge Hallyn <serge.hallyn@canonical.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2012-02-26 10:44:40 +01:00
Serge Hallyn
2407e68ef2 lxc-ubuntu: add /dev/full, /dev/hpet, and /dev/kvm to devices whitelist
Thanks for Scott Moser for these, which allows qemu to run inside a container.

Signed-off-by: Serge Hallyn <serge.hallyn@canonical.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2012-02-26 10:44:40 +01:00
Serge Hallyn
e226883316 drop mac_admin and mac_override
mac_admin stops the container from loading LSM policy.  Neither
selinux nor apparmor currently will do well with automatic namespacing
of policy (though it's coming in apparmor, after which we can re-enable
this).

Signed-off-by: Serge Hallyn <serge.hallyn@canonical.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2012-02-26 10:44:40 +01:00
Serge Hallyn
fdcde5b653 Add new 'precise' release to ubuntu template
Signed-off-by: Serge Hallyn <serge.hallyn@canonical.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2012-02-26 10:44:40 +01:00
Serge Hallyn
15da01b393 ubuntu template: use -updates and -security (v3)
Particularly for LTS releases, which many people will want to use in
their containers, it is not wise to not use release-security and
release-updates.  Furthermore the fix allowing ssh to allow the container
to shut down is in lucid-updates only.

With this patch, after debootstrapping a container, we add -updates and
-security to sources.list and do an upgrade under chroot.  Unfortunately
we need to do this because debootstrap doesn't know how to.

Changelog:
	Nov 14: as Stéphane Graber suggested, make sure no daemons start on
		the host while doing dist-upgrade from chroot.
	Nov 15: use security.ubuntu.com, not mirror. (stgraber)

Signed-off-by: Serge Hallyn <serge.hallyn@canonical.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2012-01-05 23:34:46 +01:00
Stéphane Graber
5ddd950537 Ubuntu template: some tweaks
Allow mknod (fixing udev upgrades) and drop mac_override and mac_admin 
from lxc.cap.drop as apparmor has/will have support for namespaces

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2011-11-10 09:45:52 +01:00
Serge E. Hallyn
5fe95ad112 Drop resolvconf from oneiric container package list
It prevents containers from getting a good resolv.conf without doing
ifdown eth0; ifup eth0.

(see pad.lv/880020)

Signed-off-by: Serge Hallyn <serge.hallyn@canonical.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2011-10-25 00:02:33 +02:00
Serge E. Hallyn
8565ea1c6f lxc-ubuntu: stop early if a bad user is specified in -b option
Otherwise we end up with a bad container fstab and a container
that won't boot.  See
https://bugs.launchpad.net/ubuntu/+source/lxc/+bug/879052

Signed-off-by: Serge Hallyn <serge.hallyn@canonical.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2011-10-24 14:47:58 +02:00
Serge E. Hallyn
b145c6ef5e ubuntu template: allow containers to create tap devices
Thought I had sent this before, but I don't find it anywhere.

Signed-off-by: Serge Hallyn <serge.hallyn@canonical.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2011-10-24 14:38:30 +02:00
Serge E. Hallyn
cdcee3c7ff ubuntu template: disallow cap_sys_module (by popular demand)
This isn't particularly reassuring, and will be moot with user
namespaces, but as people are asking for it, turn off sys_module.
While we're at it, turn off mac_admin and mac_override.

Signed-off-by: Serge Hallyn <serge.hallyn@canonical.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2011-10-24 14:38:30 +02:00
Daniel Lezcano
e6238180c6 remove minimal install for ubuntu template
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2011-08-12 21:47:55 +02:00
Serge E. Hallyn
3e9c97c17a add ubuntu-keyring to the packagelist for oneiric containers.
Otherwise apt fails during and after debootstrap.

Signed-off-by: Serge Hallyn <serge.hallyn@canonical.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2011-08-07 12:25:07 +02:00
Serge E. Hallyn
9e4fcfa115 Don't try to add host user's groups in container
When '-b user' is specified to lxc-ubuntu container creation template, do
not automatically add all the groups of which user is a member on the host,
to user's groups in the container.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2011-07-27 16:34:58 +02:00
Serge Hallyn
623f98d8cc lxc-ubuntu: Allow /dev/fuse to be used in a container
As people seem to want it, i.e.
https://bugs.launchpad.net/ubuntu/+source/lxc/+bug/800886

Signed-off-by: Serge Hallyn <serge.hallyn@canonical.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2011-07-25 00:22:50 +02:00
Serge Hallyn
c440536e7c lxc-ubuntu: don't put devpts in $confdir/container/fstab
src/lxc/conf.c will explicitly mount it anyway.  Furthermore, the fstab
entry, which is getting processed first, did not specify -o newinstance.
This can cause the host's devpts entry mount options to change, as in
https://bugs.launchpad.net/ubuntu/+source/libvirt/+bug/607636.

Note - I messed up.  This was applied upstream, but I dropped it in
subsequent conversion to lxc-ubuntu template.  It therefore needs to
be reapplied.

Signed-off-by: Serge Hallyn <serge.hallyn@canonical.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2011-07-25 00:22:50 +02:00
Serge Hallyn
c6992ecf0d lxc-ubuntu: Default to current ubuntu release.
If can't match any valid release, use lucid.

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2011-06-25 15:17:47 +02:00
Serge Hallyn
8339b4c86a lxc-ubuntu: Base arch detection code on debootstrap's with some additions when we don't have dpkg or udpkg
Changelog: [seh] Don't take arch from environment

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2011-06-25 15:17:47 +02:00
Serge Hallyn
e2b4064f94 consolidate ubuntu templates
Consolidate lucid, maverick, natty, and oneiric templates into one 'ubuntu'
template.

Add support for specifying architecture.

Add support for '--trim|-x' option, which removes services like the lucid
template used to.  This creates smaller, faster-booting containers, but they
will not be safe with certain upgrades, like mountall or udev.  When -x is
not specified for lucid or maverick container, then install lxcguest from
the ubuntu-virt ppa, since it does not exist in the official archives, and
the container is not safe to boot without lxcguest.

Add support for '--bindhome <user>' option, which will cause /home/<user>
to be bind-mounted into the container, and create the user with his
original password, shell, and group memberships in the container.

changelog:
  june 23:
    lxc-ubuntu template: set lxc.arch in config
    install lxcguest when NOT trimming the container
    lxc-ubuntu: always install lxcguest in postprocess

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2011-06-25 15:17:47 +02:00
Serge Hallyn
27b39fd49d Update ubuntu templates
Rename 'ubuntu' template to 'lucid'

Add new maverick and natty templates, which do much less tweaking
of the environment.  These should only be used on a kernel which
supports sysfs tagging for /sys/class/net, as udev will be running
in the container.

The natty template needed to slightly change the installed packages
for dhclient to be correclty installed.

Signed-off-by: Serge Hallyn <serge.hallyn@canonical.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2011-01-22 21:59:40 +01:00
Daniel Lezcano
78bdcd081e remove bad default console option in ubuntu template
Remove this options as by default container console goes to the tty
or /dev/null if not available.

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2010-06-24 09:47:14 +02:00
Daniel Lezcano
5bad66ba56 ubunutu - fix ssh runlevel stop condition
The default ssh upstart configuration makes the daemon to respawn
either if we are shutdowning.

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2010-06-07 11:33:55 +02:00
Wilhelm Meier
bc24fe4d8a few enhancement on the ubuntu template
Improved and cleanup the ubuntu template.

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
Signed-off-by: Wilhelm Meier <wilhelm.meier@fh-kl.de>
2010-06-07 11:33:55 +02:00
Daniel Lezcano
c01d62f21b move script templates to an adequate place
At present the lxc-{template} scripts are installed in the $bindir.
This is not the right place as specified by the FHS, so they go to
$libdir/lxc/templates.

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2010-06-07 11:33:55 +02:00