Commit Graph

155 Commits

Author SHA1 Message Date
Purcareata Bogdan-B43198
c94e60d16b Add Dropbear SSH support for lxc-busybox template
Dropbear implements lightweight SSH2 server and client functionality and
is likely to be included in embedded Linux distros.

Signed-off-by: Purcareata Bogdan <B43198@freescale.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2013-01-15 12:18:36 -05:00
Alexander Vladimirov
1483153487 Add 'config' option to lxc-archlinux template and fix getopt string
This option allows user to control installation repository and options
using alternative pacman configuration file.
Also remove unnecessary sed invocation during container configuration.

Signed-off-by: Alexander Vladimirov <alexander.idkfa.vladimirov@gmail.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2013-01-11 12:45:35 -05:00
Dwight Engen
ed34a67d01 oracle template: fix lxc-shutdown with upstart SIGPWR handler
OL6 uses upstart init and needs a handler for the SIGPWR that
lxc-shutdown sends it so that a container can shut down cleanly.

Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2013-01-09 15:12:39 -05:00
Dwight Engen
c5b908a262 oracle template: use url arg to wget repo file
Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
2013-01-08 12:06:59 -05:00
Dwight Engen
d378aebe3d oracle template: drop additional capabilities
Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
2013-01-08 12:06:57 -05:00
Maximilian Seesslen
29e18143a0 fixed RELEASE_URL for fedora releases higher than 16
The Url for the fedora-release RPM changed in release 17.

Signed-off-by: Maximilian Seesslen <mes@seesslen.net>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
2013-01-04 12:22:14 -05:00
Dwight Engen
e35cb41b8c oracle template: add support for creating ol4 container from ovm template
Also: disable the interactive part of ovmd so ol5,6 containers won't
hang if started for the first time with -d. Don't let containers do rawio,
or have access to /dev/rtc0, they can mess up the hosts system clock among
other things.

Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2013-01-03 18:12:41 -05:00
Natanael Copa
670c6ab8ca lxc-alpine: add support for installing optional packages
Let users append a list of packages they want install in the container

Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2013-01-02 13:13:15 -05:00
Natanael Copa
2b49de9a3f lxc-alpine: add support for setting arch from command line
This allows us to lxc-create 32 bit guests on x86_64 hosts.

Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2013-01-02 13:11:31 -05:00
Natanael Copa
e5846a6f89 lxc-alpine: add --repository option
This allows specifying what repository to use for the container.

Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2013-01-02 13:06:43 -05:00
Natanael Copa
b1aa0624ba lxc-alpine: indent fixes
Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2013-01-02 13:05:23 -05:00
Natanael Copa
8410c48507 templates: install lxc-alpine
Make sure we actually install lxc-alpine

Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2013-01-02 13:04:48 -05:00
Alexander Vladimirov
f3849d01d8 Update lxc-archlinux template to work with systemd
Use arch-install-scripts for installation.

Signed-off-by: Alexander Vladimirov <alexander.idkfa.vladimirov@gmail.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2013-01-02 12:42:26 -05:00
Natanael Copa
2a9a0a0807 templates: initial support for Alpine Linux
Requires apk-tools (http://git.alpinelinux.org/cgit/apk-tools)

Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2012-12-25 12:59:36 +01: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
75350ec8c7 lxc-archlinux: Don't hardcode /var/lib/lxc in help
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
2012-12-06 09:43:26 -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
14d9c0f09d Update for consistent indent
This commit updates all scripts using mixed indent to a consistent
4 spaces indent.

In the past quite a few of those scripts used tabs to instead of 8 spaces or
instead of 4 spaces, sometimes mixing those in the same line and sometimes
changing the tab width within the same file.

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
2012-12-06 00:04:27 -05:00
Stéphane Graber
eba7df9ee0 templates: Make generated config consistent
This updates all the templates and the configuration files to consistently
use "key = value" everywhere.

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
2012-12-06 00:02:40 -05:00
Stéphane Graber
483d21ff46 oracle template: fixes when using fedora host
Let oracle template work when host is fedora or oracle and the lsb_release
command is not present. Verify the arch given is valid. Don't add lxc.network
section again if already present.

Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2012-12-05 17:07:01 -05:00
Stéphane Graber
f8ddeaa5be lxc-archlinux.in: Apply same LXCPATH/LOCALSTATEDIR
lxc-archlinux was apparently left out of the last change, apply
the same modification as the other templates.

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2012-12-05 13:33:03 -05:00
Dwight Engen
e29bf450ca Use LXCPATH and LOCALSTATEDIR instead of hardcoded /var
Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2012-12-05 13:31:06 -05:00
Serge Hallyn
44d397891e templates: use hardlink detection in rsync
I'm not sure whether we want this:  is -H ubiquitous?

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Acked-by: Michael H. Warfield <mhw@WittsEnd.com>
Acked-by: Dwight Engen <dwight.engen@oracle.com>
2012-12-04 10:10:24 -06:00
Dwight Engen
6902a6c664 Create busybox commands as symlinks instead of hardlinks
I was getting a "Too many links" error when creating a busybox container on
a btrfs file system. This change has the template create the links as
symlinks instead. It also generates the list of commands to be symlinked from
busybox itself instead of a hardcoded list in the template.

Also set the root password to root, to match what other templates do.

Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2012-12-03 10:00:30 -05:00
Dwight Engen
cc423c6739 Include lxc-ubuntu when doing make dist
Removing templates/lxc-ubuntu from configure.ac makes it so that it is
not included in the tarball that make dist builds (and therefore also
breaks the rpm build).

Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2012-11-29 13:32:34 -05:00
Stéphane Graber
89573feb5b lxc-ubuntu: Fix wrong variable name
$LANGPACK_LIST was renamed to $langpacks but not all the code was updated.

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
2012-11-29 10:26:54 -05:00
Stéphane Graber
1e1f8eeb14 lxc-ubuntu: Fix mixed indent
Replace all remaining tabs by 8 spaces, to properly indent by 4 spaces.

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
2012-11-29 10:26:29 -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
Dwight Engen
e62fa3f9ce Fix busybox template to not have extra aa_profile hunk
Both 69d66f1e and f02ce27d added the aa_profile = unconfined hunk, but only
the first was needed, maybe a merge error? The second one causes the
template to get an error on the EOF line. This essentially reverts
f02ce27d.

Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2012-11-29 10:18:41 -05:00
Dwight Engen
000559b5de Oracle template: make container also boot under libvirt
This allows containers created with lxc-create to also boot under
libvirt/Virtual Machine Monitor

Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2012-11-27 15:00:30 -05:00
Serge Hallyn
6b1a07ba08 fix lxc-ubuntu-cloud option parsing bugs
The -u shortopt matching --userdata was not specified, and when -L
is found shift should have been by 1 not 2 since there is no optarg.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2012-11-26 15:12:26 -05:00
Stéphane Graber
f79d43bbe7 Remove all trailing whitespaces.
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2012-11-26 12:08:13 -05:00
Serge Hallyn
ca0a33644a lxc-ssh: fix message about ssh key insertion
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
2012-11-13 17:19:13 -06:00
Dwight Engen
b1dc05fde9 Honor network type and link from lxc-create -f
Make the oracle template honor the lxc.network.type and
lxc.network.link configuration items if a "base" configuration file is
passed to lxc-create. If no configuration file is passed and the host
system is Oracle or Fedora, the template assumes a type of veth and
the default name created by libvirt.

Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
2012-11-12 13:18:32 -05:00
Dwight Engen
7060353a08 Fix removal of unneeded startup/shutdown scripts
Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
2012-11-12 13:18:32 -05:00
Dwight Engen
b88d7bb629 Always rebuild rpm database
Always rebuild the rpm database with the guest's rpm so there are no
db version mismatches when you boot the guest and run rpm or yum.

Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
2012-11-12 13:18:32 -05:00
Dwight Engen
b90270a5a3 Better rpm database downgrade logic
Use the file command to see if the rpm database version needs to
be downgraded. Use the lsb_release command to determine the host
system, which is then used to set the commands needed to do the
conversion, and lets us move the rpm database to the correct location
if the host rpm doesn't put it where the guest expects it to be.

Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
2012-11-12 13:18:32 -05:00
Serge Hallyn
708f4a80ea add oracle template (From: Dwight Engen)
This is a new template to create containers based on Oracle Linux. A version
such as 5.8, 6.3, or 6.latest can be specified with -R in which case a rootfs
will be created from rpms downloaded from the Oracle public-yum repo.
Alternatively the path to an existing rootfs of Oracle 5 or 6 may be given to
the template with the -t option.

The architecture of the downloaded rpms installed in the container can be
specified with the -a template option.

Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
2012-11-12 13:18:32 -05:00
Stéphane Graber
69d66f1e72 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-11-12 13:16:50 -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
Dwight Engen
a1bd64823c display warning when yum missing in fedora template
This early exit is preventing the warning message that follows it from
being shown.

Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
2012-10-25 10:36:49 +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
Stéphane Graber
06a1e1db99 lxc-debian: replace isc-dhcp-server by isc-dhcp-client
The DHCP client should be isc-dhcp-client, not isc-dhcp-server.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2012-10-25 10:36:07 +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
3f16e26c70 lxc-debian: specify isc-dhcp-server in package list
dhcp3-client does not exist in testing.

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

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
2012-10-25 10:35:32 +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