Commit Graph

450 Commits

Author SHA1 Message Date
José Martínez
654bf1af09 lxc-ubuntu: use btrfs subvolumes and snapshots
Try to create the cache rootfs as a btrfs subvolume, and use btrfs
snapshots to copy the rootfs if btrfs is selected as backing store.

Signed-off-by: José Martínez <xosemp@gmail.com>
2014-06-17 23:01:33 +02:00
Stéphane Graber
809a1539a3 lxc-download: Attempt to get the GPG key 3 times
This is to deal with the GPG pool occasionaly yielding broken servers.

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
2014-06-03 15:52:43 -04:00
Michael H. Warfield
e5469dadd9 lxc-fedora.in: Correct some systemd target setups.
Set the halt.target action to be sigpwr.target.  This allows
SIGPWR to properly shut the container down from lxc-stop.

Renable the systemd-journald.service.

Signed-off-by: Michael H. Warfield <mhw@WittsEnd.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2014-06-03 15:06:35 -04:00
TAMUKI Shoichi
aadd458215 lxc-plamo: fix for configuring network interface
Fix configure_plamo so as not to configure wireless network interface
in containers even if the host uses wireless network interface.

Signed-off-by: TAMUKI Shoichi <tamuki@linet.gr.jp>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2014-06-03 11:11:51 -04:00
Dwight Engen
5b457f7bd8 lxc-oracle: fix ssh login under libvirt-lxc
Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2014-05-20 17:09:27 -04:00
Dwight Engen
fd4d297dd6 lxc-oracle: set hostname with systemd
Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2014-05-20 10:49:18 -04:00
Dwight Engen
7e4ca1a21d lxc-oracle: export upstart environment variable for maygetty
This is a fix to commit 5f2ea8cfcb.
Sorry, not sure how I missed this in testing the original patch.

Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
2014-05-16 09:56:03 -04:00
Edvinas Klovas
44464003ee archlinux template: fix lxc.root for btrfs backend
when using btrfs backend lxc-create first creates rootfs in /usr/lib/lxc/rootfs
directory before moving it to /var/lib/lxc or other directory supplied by the
command line. Archlinux template relied in $rootfs_path which made containers
created with btrfs backend have lxc.rootfs set to /usr/lib/lxc/rootfs. By using
$path instead of $rootfs_path we make sure that lxc.rootfs is always correct.

Signed-off-by: Edvinas Klovas <edvinas@pnd.io>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
2014-05-13 15:28:22 -04:00
Dwight Engen
5f2ea8cfcb lxc-oracle: add pts/[1-4] to securetty for libvirt-lxc
Don't spawn a getty on /dev/console when running under libvirt-lxc

Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
2014-05-12 22:59:47 -04:00
Edvinas Klovas
31efc34cff archlinux template: added sigpwr handling to systemd (lxc-stop)
archlinux is using systemd and systemd's configuration does not have any
services setup to handle sigpwr hook which is sent by lxc-stop command. By
enabling sigpwr service we make sure that lxc-stop will work.

Signed-off-by: Edvinas Klovas <edvinas@pnd.io>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2014-05-07 08:38:36 -05:00
Nikolay Martynov
8a2fdf50ad use correct lxc-init path in sshd template
lxc-init got moved into SBINDIR/init.lxc recently.
This broke sshd template because path wasn't updated there.
This patch should fix this issue.

Signed-off-by: Nikolay Martynov <mar.kolya@gmail.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2014-05-01 10:38:12 -04:00
Carlo Landmeter
91828b0e1f alpinelinux: set correct lxc_arch for x86
Signed-off-by: Carlo Landmeter <clandmeter@gmail.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2014-04-30 16:28:59 -04:00
Dwight Engen
9e607c2f35 lxc-oracle: fix warnings/errors from some rpm scriptlets
- Some scriptlets expect fstab to exist so create it before doing the
  yum install

- Set the rootfs selinux label same as the hosts or else the PREIN script
  from initscripts will fail when running groupadd utmp, which prevents
  creation of OL4.x containers on hosts > OL6.x.

- Move creation of devices into a separate function

Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
2014-04-30 10:39:09 -05:00
Dwight Engen
f6d5cecc19 lxc-oracle: use db_load from container
This makes it so that the host doesn't need to have an old, compat
version of db43_load installed by using the db_load from the just
installed container. Some newer distributions do not even have an old
enough compat-db4 package available.

Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
2014-04-09 14:30:15 -05:00
Dwight Engen
30ecf66929 lxc-oracle: only create media repo when --baseurl is specified
Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
2014-04-09 14:30:08 -05:00
Dwight Engen
c937991e1f lxc-oracle: update to support OL7
Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
2014-04-09 10:34:33 -05:00
Dwight Engen
e120d0575b lxc-oracle: allow installing from arbitrary yum repo
With this change, you can install a container from a mounted .iso, or any
yum repo with the necessary packages. Unlike the --url option, the repo
does not need to be a mirror of public-yum, but the arch and release must
be specified. For example to install OL6.5 from an .iso image:

mount -o loop OracleLinux-R6-U5-Server-x86_64-dvd.iso /mnt
lxc-create -n OL6.5 -t oracle -- --baseurl=file:///mnt -a x86_64 -R 6.5

The template will create two yum .repo files within the container such that
additional packages can be installed from local media, or the container can
be updated from public-yum, whichever is available. Local media must be bind
mounted from the host onto the containers' /mnt for the former .repo to work:

mount --bind /mnt $LXCPATH/OL6.5/rootfs/mnt

Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
2014-04-09 10:34:32 -05:00
Ryan Mulligan
8dac6e74c4 archlinux: add debugging info for missing network link
Signed-off-by: Ryan Mulligan <ryan@ryantm.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2014-04-07 17:05:35 -04:00
Leonid Isaev
21ca73b980 archlinux: Code cleanups (v2)
Cleanups:
1. Do not modify container's /etc/hosts (archlinux uses /etc/nsswitch.conf)
2. Remove duplicate lines from config
3. Print a nicer final message
4. Get rid of some grep's

Signed-off-by: Leonid Isaev <lisaev@umail.iu.edu>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2014-04-04 19:29:58 -04:00
Stéphane Graber
6ee795d2e3 Revert "archlinux: Code cleanups"
This reverts commit 34fd08f87b.
2014-04-04 19:27:18 -04:00
Leonid Isaev
34fd08f87b archlinux: Code cleanups
Cleanups:
1. Do not modify container's /etc/hosts (archlinux uses /etc/nsswitch.conf)
2. Remove duplicate lines from config
3. Print a nicer final message
4. Get rid of some grep's in favor of bash regex

Signed-off-by: Leonid Isaev <lisaev@umail.iu.edu>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2014-04-04 19:04:34 -04:00
Leonid Isaev
44b036309b archlinux: Create per-container pacman host key
Do not copy the pacman master key from the host, as this opens it to
attacks; generate a new secret hostkey.

Signed-off-by: Leonid Isaev <lisaev@umail.iu.edu>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2014-04-04 19:04:30 -04:00
Leonid Isaev
b7b7d3884e archlinux: Fix default package selection
Do not cherry-pick packages for the default install to avoid dependency
issues. Instead, install the base group modulo blacklisted packages.

Signed-off-by: Leonid Isaev <lisaev@umail.iu.edu>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2014-04-04 19:04:23 -04:00
Michael H. Warfield
e13923c711 Added lxc.arch to configuration files for CentOS and Fedora
Added lxc.arch to the resulting container configuration files
to support i686 on x86_64 cross arch containers.

Signed-off-by: Michael H. Warfield <mhw@WittsEnd.com>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
2014-04-02 18:07:45 -05:00
Guillaume ZITTA
84ad17ede0 enable sshd by default like other templates
Signed-off-by: Guillaume ZITTA <lxc@zitta.fr>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2014-04-02 10:53:13 -04:00
Guillaume ZITTA
3a74e9097a lxc-gentoo, fix lack of any generated locale
fix lack of any generated locale

Signed-off-by: Guillaume ZITTA <lxc@zitta.fr>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2014-04-02 10:50:59 -04:00
Guillaume ZITTA
982b59592e fix lxc-console not working by default
fix lxc-console not working by default

Signed-off-by: Guillaume ZITTA <lxc@zitta.fr>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
2014-04-01 14:58:39 -05:00
Stéphane Graber
e6ee584a15 download: Set a 30s timeout for wget request
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
2014-04-01 09:54:37 -05:00
Dwight Engen
7ceebfd12a add yum plugin to repatch rootfs on yum update
oracle-template: Split patching rootfs vs one time setup into separate
shell functions so the template can be run with --patch.

oracle-template: Update to install the yum plugin and itself (as lxc-patch)
into a container. The plugin just runs lxc-patch --patch <path> so it is
fairly generic, but in this case it is running a copy of the template inside
the container.

Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
2014-03-29 10:37:48 -05:00
Bogdan Purcareata
50dbb8209b lxc-busybox: follow symlinks when inspecting busybox binary
Signed-off-by: Bogdan Purcareata <bogdan.purcareata@freescale.com>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
2014-03-24 14:19:27 -05:00
Michael H. Warfield
826cde7c21 Added root_password_expired password control tuning knob.
Added the environment variable "root_password_expired" to
control if the initial, temporary, root password is initially
set up as "expired".  If set to "yes" (default), the root password
is set as "expired" and the user must change it at first login.

Signed-off-by: Michael H. Warfield <mhw@WittsEnd.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2014-03-22 20:58:08 -04:00
Michael H. Warfield
779b47fdca Support SIGPWR in Fedora and Centos containers.
Added code to catch SIGPWR for Upstart in Fedora and CentOS
containers as well as for Systemd in Fedora containers.

Signed-off-by: Michael H. Warfield <mhw@WittsEnd.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2014-03-22 20:58:03 -04:00
Michael H. Warfield
f5067ecbcc Set timezone for new container if not previously defined.
If the container does not already contain an /etc/localtime
timezone definition, then copy a definition from the host to
the container.  This is often a symlink to an appropriate
system timezone definition files and is presumed to exist in

Signed-off-by: Michael H. Warfield <mhw@WittsEnd.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2014-03-22 20:57:57 -04:00
Michael H. Warfield
dfb2291eca Fix arch cross-build when running distro cross-build.
Corner case existed when building a cross-arch container (i686 on x86_64)
on a cross-distro host (Fedora container on Ubuntu host).  Fixed the
arch "fixup" code to do the right thing when running from the bootstrap.

Signed-off-by: Michael H. Warfield <mhw@WittsEnd.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2014-03-22 20:57:49 -04:00
Holger Amann
23e880832b debian: Symlink /etc/mtab
/etc/mtab doesn’t exist after bootstrapping a debian container, and will
be created as regular file after first start.

That leads to at least two errors:
- output of `mount` is wrong and get messed up the more often you
  start/stop the container
- /dev/pts/ptmx has wrong permissions

Signed-off-by: Holger Amann <holger@sauspiel.de>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2014-03-21 10:36:34 -04:00
Stéphane Graber
ef53625fe1 lxc-debian: Don't eat the argument after -c
Reported-by: Robie Basak <robie.basak@canonical.com>
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
2014-03-21 10:25:02 -04:00
Stéphane Graber
1bc1269ba5
lxc-opensuse: Fix syntax error
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2014-03-10 17:33:12 -04:00
Stéphane Graber
9f15e86afa lxc-download: Fix in_userns again
The use of a subshell was causing various failures, re-arrange not to
use one.

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2014-02-28 19:13:50 -05:00
Stéphane Graber
fda03e44e6
lxc-download: Ignore return code from subshell
The previous change fixed parsing of multiple uid/gid ranges by using a
while loop, however a failure in that loop will cause the script to exit
(due to -e), so we need to ignore the return value of the commands
inside that loop.

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2014-02-27 15:46:23 -05:00
Stéphane Graber
a1b6244eb5 lxc-download: Detect unpriv created by real root
This adds yet another case in the in_userns function detecting the case
where an unprivileged container is created by the real uid 0, in which
case we want to share the system wide cache but still use the
unprivileged templates and unpack method.

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
2014-02-26 14:53:54 -05:00
Natanael Copa
0e18cacab5 lxc-alpine: add support for architecture arm
Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2014-02-20 10:22:25 -05:00
Stéphane Graber
96283b5460
templates: Fix bashisms in common code
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2014-02-19 10:45:14 -05:00
Natanael Copa
6460d3c5f0 lxc-alpine: add checksums for musl libc build server pubkeys
We have added 3 new build servers for Alpine Linux musl libc x86, x86_64
and arm. Add the sha256sum for those keys.

Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2014-02-19 10:39:30 -05:00
Natanael Copa
d2b2911c55 lxc-alpine: fixes for checkbashism
Fix the issues reported by checkbashisms and change back to #!/bin/sh

Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2014-02-19 10:39:26 -05:00
Stéphane Graber
f74e080cf7 download: Support nested containers in unpriv
This adds detection for the case where we are root in an unprivileged
container and then run LXC from there. In this case, we want to download
to the system location, ignore the missing uid/gid ranges and run
templates that are userns-ready.

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
2014-02-17 11:59:10 -05:00
TAMUKI Shoichi
ffeb76b460 lxc-plamo: various small changes
- Change redirection of fd 200 to 9 (greater than 9 may conflict with
  fd the shell uses internally)
- Replace numeric line addressing of ed to regular expression to avoid
  correcting the line addressing at each modification of init scripts
- Correct the option order (trivial)

Signed-off-by: TAMUKI Shoichi <tamuki@linet.gr.jp>
Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
2014-02-10 13:14:09 -06:00
Stéphane Graber
ef9512b491
download: Use port-80 pool for gpg over http
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2014-02-06 17:34:12 -05:00
Stéphane Graber
207bf0e475 templates: Make sure usual locations are in PATH
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
2014-02-06 17:14:03 -05:00
Stéphane Graber
4eb706b3ce
download: Fix previous change
The previous change to support http proxies only worked when http_proxy
was set... Instead add some detection code and only use :80 when using
http_proxy.

That's a bit of a workaround, but it's the only way I could find to get
GPG to work with http_proxy.

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2014-02-06 17:11:51 -05:00
Stéphane Graber
2262880d63
download: Force hkp on port 80 (for http proxies)
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2014-02-06 12:24:58 -05:00
TAMUKI Shoichi
c63c04fcaf templates: improve refusing to run unprivileged
For all templates except lxc-ubuntu-cloud and lxc-download, detect not
only --mapped-uid but also --mapped-gid and error out.  Detecting will
not be done after -- parameter because of non-option parameters.

Also, change the mode of lxc-archlinux.in 100755 to 100644.

Signed-off-by: TAMUKI Shoichi <tamuki@linet.gr.jp>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2014-02-06 11:05:20 -05:00
gza
cf261d584e gentoo: fix portage rw problem
Signed-off-by: Guillaume Zitta <github.guillaume@zitta.fr>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2014-02-05 13:44:11 -05:00
Serge Hallyn
2133f58c66 create: pass --mapped-gid to templates next to --mapped-uid
That way templates can fix group ownership alongside uid ownership.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2014-02-04 16:31:37 -05:00
Stéphane Graber
8ec981fc8b templates: Refuse to run unprivileged
Only the download and ubuntu-cloud templates work with unprivileged
containers, for all others, detect --mapped-uid and error out as early
as possible, recommending the use of the download template.

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Acked-by: Serge Hallyn <serge.hallyn@ubuntu.com>
2014-02-04 14:30:51 -05:00
Harald Dunkel
3a6ef65aa2 support a custom CentOS repository
This change introduces a flag --repo to the lxc-centos template
to allow using a local repository (e.g. a loop mounted installer
iso on your web server).

Signed-off-by: Harald Dunkel <harri@afaics.de>
Acked-by: Michael H. Warfield <mhw@WittsEnd.com>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
2014-02-04 07:49:09 -06:00
Stéphane Graber
d46417540f lxc-ubuntu-cloud: Update arm* cross
| host arch | arm64 | armhf | armel |
-------------------------------------
| arm64     |   X   |   X   |   X   |
| armhf     |       |   X   |   X   |
| armel     |       |   X   |   X   |
-------------------------------------

Although optional, all existing arm64 silicon supports 32bit instructions.
armel/armhf is only a userspace change, so they are interchangeable.
However armhf isn't supported on all armel platforms (e.g. armv6) but
all those we support have hard-float.

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2014-01-31 09:38:32 +00:00
Scott Moser
ad3f14ab58 lxc-ubuntu-cloud: various small changes
* ppc64el images now exist and generally function.
   Instead of failing because an arch isnt in the list,
   let that check happen by ability to download something.
 * update the hard coded ubuntu releases to know about 'trusty'
   and drop no longer supported releases (consistent with behavior
   when distro-info is available)
 * shorten the logic that decides if host and container arch
   are supported.
 * support skipping "invalid arch" check entirely via undocumented
   variable UCTEMPLATE_SKIP_ARCH_CHECK.
 * update usage to reference 'tryreleased' as the default 'stream'
 * give good error message if user tries 'released' and there
   is no released version available.

Signed-off-by: Scott Moser <smoser@ubuntu.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2014-01-31 09:38:29 +00:00
Bogdan Purcareata
1d1774b1ac use susv3 head arguments
Without enabling INCLUDE_SUSv2 in busybox, we need to use head's -n argument,
rather than -#.

Signed-off-by: Christopher Larson <kergoth@gmail.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2014-01-31 09:38:23 +00:00
Natanael Copa
6ff9f8ec1c lxc-alpine: disable sys_admin by default
It is normally not needed.

Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2014-01-29 13:43:52 +00:00
Stéphane Graber
8a3c76b24d ubuntu/ubuntu-cloud: Add support for arm64 and ppc64el
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
2014-01-29 11:43:22 +00:00
Kaarle Ritvanen
1bdedfacc2 lxc-alpine: mount tmpfs on /dev/shm
Signed-off-by: Kaarle Ritvanen <kaarle.ritvanen@datakunkku.fi>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2014-01-29 11:42:43 +00:00
Stéphane Graber
9749441a0e
gentoo: Fix /dev/tun generation
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2014-01-28 12:22:06 +00:00
gza
cae3584efc gentoo: template rework
Now splited config 2 settings available
* common
** featureful oriented settings
* moresecure
** security oriented

Signed-off-by: gza <github.guillaume@zitta.fr>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2014-01-28 09:57:39 +00:00
gza
2562784e95 gentoo: fix typo, may break host init system
Signed-off-by: gza <github.guillaume@zitta.fr>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2014-01-28 09:57:36 +00:00
Stéphane Graber
b56661fead lxc-download: Tweak cache location
- Also include the variant in the path
 - Fix invalid LXC_CACHE_BASE
 - Drop redundant code

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
2014-01-27 09:43:56 +00:00
Kaarle Ritvanen
691ac4a339 lxc-alpine: copy /etc/TZ to container if present
Signed-off-by: Kaarle Ritvanen <kaarle.ritvanen@datakunkku.fi>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2014-01-25 18:04:46 -05:00
Stéphane Graber
843a58743e
lxc-download: Fix to work without mktemp
mktemp isn't always available in busybox.

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2014-01-24 18:23:28 -05:00
Michael H. Warfield
08754f305b Update CentOS and Fedora templates to support archtectures option.
Added code to the CentOS and Fedora templates so that x86 32 bit containers
may be built on x86_64 platforms.  Like archectectures may also be trivially
used as well.

Option added is "-a {arch}".

Additionally cleaned up some bash specific logic.

Signed-off-by: Michael H. Warfield <mhw@WittsEnd.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2014-01-24 12:36:40 -05:00
KATOH Yasufumi
8c3a756ed4 plamo: Improve template
allow not to specify a variable that is related installed packages

Signed-off-by: TAMUKI Shoichi <tamuki@linet.gr.jp>
Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2014-01-22 19:57:53 -05:00
Stéphane Graber
b0f0932a94 lxc-download: Add interactive mode
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
2014-01-22 14:52:34 -05:00
Michael H. Warfield
1ecee40b7d Update Fedora and CentOS templates for common conf includes.
This updates the Fedora and CentOS templates to utilize a common
included config.  This is largely based on the changes in the Oracle
template with some exceptions.

Dropping of setpcap (present in the Oracle template) is commented out in
the Fedora template.  It seems to cause problems, such as large login
delays with Fedora 20 containers (but not Fedora 19 - strange).

The Fedora template is further modified to disable systemd-journald.service
as it is unnecessary in a container and causes serious problems when
running in a Fedora 20 container.

The Fedora template is also updated to default to Fedora 20 when running
on a non-Fedora host.

Regards,
Mike

Signed-off-by: Michael H. Warfield <mhw@WittsEnd.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2014-01-21 20:25:55 -05:00
KATOH Yasufumi
adf4b40833 plamo: Improve template
Allow to specify additional packages

Signed-off-by: TAMUKI Shoichi <tamuki@linet.gr.jp>
Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2014-01-21 09:51:25 -05:00
Dimitri John Ledkov
4b954f1217 lxc-ubuntu-cloud: Default to trying released channel
This adds a fallback to the daily channel if an image couldn't be found
in the released one.

Signed-off-by: Dimitri John Ledkov <dimitri.ledkov@canonical.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2014-01-20 22:00:32 -05:00
KATOH Yasufumi
7a49a081dd plamo: Improve template
* make simple
* change default download site to http://ftp.ring.gr.jp

Signed-off-by: TAMUKI Shoichi <tamuki@linet.gr.jp>
Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2014-01-18 10:17:33 -05:00
Stéphane Graber
9cde0368fb lxc-ubuntu-cloud: Fix cache and lock location
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
2014-01-15 23:49:02 -05:00
Stéphane Graber
3fefd6e6d5 ubuntu: Don't fail on invalid locale
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
2014-01-15 23:48:59 -05:00
Stéphane Graber
00fe5e1d19 debian: Switch to config includes
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
2014-01-15 15:57:31 -05:00
Dwight Engen
563476727b oracle template: default to 6.5 when no release given or detected
Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2014-01-15 12:29:55 -05:00
Dwight Engen
91bcb2dd78 oracle template: don't sed /etc/init/tty.conf on older releases
Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2014-01-15 12:29:19 -05:00
Dwight Engen
9e69977fa6 oracle template: convert to common.conf style
Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2014-01-15 12:28:55 -05:00
KATOH Yasufumi
8adef7614d plamo: Update template to use wget when download packages
Signed-off-by: TAMUKI Shoichi <tamuki@linet.gr.jp>
Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2014-01-15 12:20:46 -05:00
Stéphane Graber
b408e70daf
Trailing whitespace
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2014-01-15 10:33:04 -05:00
Stéphane Graber
41670b35b0 lxc-download: Fix undefined DOWNLOAD_FORCE_CACHE
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
2014-01-15 10:05:46 -05:00
Stéphane Graber
c1becef2d2 lxc-download: Fix wrong option parsing
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
2014-01-15 10:05:40 -05:00
Stéphane Graber
0d656b0549 lxc-download: POSIX doesn't specify -f for chown
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
2014-01-15 10:05:19 -05:00
Stéphane Graber
07219a02df ubuntu: Fix path to openssh-server's postinst
The path isn't relative to @LOCALSTATEDIR@

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
2014-01-15 10:04:40 -05:00
Stéphane Graber
ce68d5b481 debian: Support ssh host keys regeneration
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
2014-01-15 10:04:30 -05:00
Stéphane Graber
b335cf8d4b lxc-archlinux: Cleanup fstab
It's been brought to my attention that the read-only mount of /proc/sys
is causing problems to archlinux users, so instead just have LXC mount
proc and sysfs normally (read-write).

Reported-by: John Lane <john@lane.uk.net>
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2014-01-14 17:29:28 -05:00
John Lane
d0800999b2 lxc-archlinux: optional --root_passwd argument
Signed-off-by: John Lane <john@lane.uk.net>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2014-01-14 17:29:24 -05:00
John Lane
012f591a7d lxc-archlinux: support enabling systemd units
Signed-off-by: John Lane <john@lane.uk.net>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2014-01-14 17:28:46 -05:00
John Lane
734d0bed55 lxc-archlinux: support different architectures
Signed-off-by: John Lane <john@lane.uk.net>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2014-01-14 17:22:38 -05:00
John Lane
d8c77af0ae lxc-archlinux: don't drop mknod capability
Signed-off-by: John Lane <john@lane.uk.net>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2014-01-14 17:22:38 -05:00
Michael H. Warfield
b4f7af7a52 Modify lxc-fedora and lxc-centos for multiple issues...
This is a reissue of two previous patches along with some additional
changes for hardening the root password process based on discussions
on-list.

--
This patch modifies the lxc-fedora and lxc-centos templates for 3 things.

1) Extensively modifies root password generation, storage, and management
    based on discussions on the devel list.

  Root passwords are hardened and have advanced configurability.
    A static password may be provided.
    A password based on a template may be generated, including ${RANDOM}.
    A password may be generated through mktmp using a template with X's.
    Root passwords default to expired, initially.
    Passwords may optionally be echoed to stdout at container creation. (no)
    Passwords may optionally be stored in ${rootfs_path}/tmp_root_pass. (yes)
    Users may be optionally forced to change the password at creation time. (no)
    Default is to generate a pattern based password and store, no force change.
    All of this may be overridden by environment variables through
      conditional assignment.

2) Random static hardware addresses are generated for all configured
    interfaces.

3) Add code to create sysv init style scripts to intercept shutdown and
    reboot to prevent init restart and hang for CentOS and legacy Fedora
    systems on shutdown, reboot, init 0, and init 6.  This solves a variety
    of hang conditions but only affects newly created containers.  Does
    not have any impact on systemd based containers.

Signed-off-by: Michael H. Warfield <mhw@WittsEnd.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2014-01-14 17:01:28 -05:00
lxc@zitta.fr
f8d0243a78 gentoo: Initial template
Signed-off-by: gza <lxc@zitta.fr>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2014-01-14 16:45:51 -05:00
Chris Glass
4213a747e8 Make ubuntu templates squid-deb-proxy-client aware
This makes the ubuntu and ubuntu-cloud templates automatically aware of apt
proxy settings when the LXC host has "squid-deb-proxy-client" installed. This
makes installations *much* faster when a suitable squid-deb-proxy is
found on the network (or installed on the host).

Signed-off-by: Chris Glass <tribaal@gmail.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2014-01-14 16:20:52 -05:00
Elan Ruusamäe
17abf2784d handle simple bashisms:
- [[ ]] -> [ ]
- == -> =
- source -> .
- redirect of fd 200 is error in mksh, use fd 9
- &> /dev/null -> > /dev/null 2>&1
- useless function keyword
- echo -e -> printf

still left bash shebang which did not validate with checkbashism, mostly
due 'type' being reported as bashism

Signed-Off-By: Elan Ruusamäe <glen@delfi.ee>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2014-01-14 16:16:00 -05:00
Stéphane Graber
9accc2efea download: Improve cache handling
This adds a new --force-cache parameter which will force use of the
cache even for expired images.

An expired image is now only flushed from the cache once a new one is
successfuly downloaded (to avoid destroying the local cache when the
host doesn't have internet connectivity).

The ID of the build in cache is also tracked so that we don't
re-download something we already have (should only happen if we don't
have a new build published by the time the previous one expires).

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
2014-01-14 15:58:03 -05:00
Stéphane Graber
10a5fab6f3 download: Support listing available images
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
2014-01-14 15:58:01 -05:00
Stéphane Graber
fecf101cc4 download: Don't use an hardcoded exclude list
Instead of hardcoding --exclude=./dev/*, use a new metadata file
"excludes" which lists all the paths or patterns to exclude during
extraction (one per line).

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
2014-01-14 15:57:59 -05:00
Stéphane Graber
33aa351ac1 download: Fix download_sig logic
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
2014-01-14 15:57:51 -05:00