lxc-fedora.in revision 29e18143a07ffab7e85cb8db4dc39d394f0c6ea0
696ecfbf968bc780c60af3e5a01691be7fa6792bEugen Kuksa# template script for generating fedora container for LXC
696ecfbf968bc780c60af3e5a01691be7fa6792bEugen Kuksa# lxc: linux Container library
696ecfbf968bc780c60af3e5a01691be7fa6792bEugen Kuksa# Daniel Lezcano <daniel.lezcano@free.fr>
696ecfbf968bc780c60af3e5a01691be7fa6792bEugen Kuksa# Ramez Hanna <rhanna@informatiq.org>
696ecfbf968bc780c60af3e5a01691be7fa6792bEugen Kuksa# This library is free software; you can redistribute it and/or
echo 0 > $rootfs_path/selinux/enforce
chroot ${rootfs_path} yum --releasever=${release} -y install fedora-release
touch ${rootfs_path}/etc/fstab
touch ${rootfs_path}/etc/fstab
chroot ${rootfs_path} ln -s /dev/null //etc/systemd/system/udev.service
chroot ${rootfs_path} ln -s /lib/systemd/system/multi-user.target /etc/systemd/system/default.target
if [ $? -ne 0 ]; then
PKG_LIST="yum initscripts passwd rsyslog vim-minimal dhclient chkconfig rootfiles policycoreutils fedora-release"
if [ $? -ne 0 ]; then
if [ $DOWNLOAD_OK != yes ]; then
mkdir -p $INSTALL_ROOT/var/lib/rpm
rpm --root $INSTALL_ROOT --initdb
if [ $? -ne 0 ]; then
mkdir -p @LOCALSTATEDIR@/lock/subsys/
flock -x 200
if [ $? -ne 0 ]; then
if [ $? -ne 0 ]; then
if [ $? -ne 0 ]; then
if [ $? -ne 0 ]; then
grep -q "^lxc.rootfs" $config_path/config 2>/dev/null || echo "lxc.rootfs = $rootfs_path" >> $config_path/config
if [ $? -ne 0 ]; then
if [ ! -e $cache ]; then
flock -x 200
cat <<EOF
-p,--path path to where the container rootfs will be created, defaults to @LXCPATH@. The container config will go under @LXCPATH@ in that case
-R,--release Fedora release for the new container. if the host is Fedora, then it will defaultto the host's release.
eval set -- "$options"
if [ -n "$needed_pkgs" ]; then
echo "Missing commands: $needed_pkgs"
echo "Please install these using \"sudo apt-get install $needed_pkgs\""
if [ -z "$path" ]; then
if [ -z "$release" ]; then
if [ "$is_fedora" ]; then
echo "This is not a fedora host and release missing, defaulting to 14. use -R|--release to specify release"
# check for 'lxc.rootfs' passed in through default config by lxc-create
if [ ! -z $clean ]; then