File lxc-opensuse-12.3.patch of Package lxc
Index: lxc-0.8.0/templates/lxc-opensuse.in
===================================================================
--- lxc-0.8.0.orig/templates/lxc-opensuse.in
+++ lxc-0.8.0/templates/lxc-opensuse.in
@@ -25,7 +25,7 @@
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-DISTRO=12.2
+DISTRO=12.3
configure_opensuse()
{
@@ -58,7 +58,6 @@ EOF
127.0.0.1 localhost $hostname
EOF
- # disable various services
# disable yast->bootloader in container
cat <<EOF > $rootfs/etc/sysconfig/bootloader
LOADER_TYPE=none
@@ -81,7 +80,14 @@ EOF
ln -s /dev/null $rootfs/etc/systemd/system/proc-sys-fs-binfmt_misc.automount
ln -s /dev/null $rootfs/etc/systemd/system/console-shell.service
ln -s /dev/null $rootfs/etc/systemd/system/systemd-vconsole-setup.service
- ln -s /lib/systemd/system/getty@.service $rootfs/etc/systemd/system/getty.target.wants/getty@console.service
+ sed -e 's/ConditionPathExists=.*//' /usr/lib/systemd/system/getty@.service > $rootfs/etc/systemd/system/getty@.service
+ ln -s getty@.service $rootfs/etc/systemd/system/getty@tty1.service
+ ln -s ../getty@.service $rootfs/etc/systemd/system/getty.target.wants/getty@console.service
+ ln -s -f ../getty@.service $rootfs/etc/systemd/system/getty.target.wants/getty@tty1.service
+ ln -s ../getty@.service $rootfs/etc/systemd/system/getty.target.wants/getty@tty2.service
+ ln -s ../getty@.service $rootfs/etc/systemd/system/getty.target.wants/getty@tty3.service
+ ln -s ../getty@.service $rootfs/etc/systemd/system/getty.target.wants/getty@tty4.service
+
touch $rootfs/etc/sysconfig/kernel
@@ -113,15 +119,19 @@ download_opensuse()
# download a mini opensuse into a cache
echo "Downloading opensuse minimal ..."
mkdir -p "$cache/partial-$arch-packages"
- zypper --quiet --root $cache/partial-$arch-packages --non-interactive ar http://download.opensuse.org/distribution/$DISTRO/repo/oss/ repo-oss || return 1
- zypper --quiet --root $cache/partial-$arch-packages --non-interactive ar http://download.opensuse.org/update/$DISTRO/ update || return 1
+ if [[ ! -f $cache/partial-$arch-packages/etc/zypp/repos.d/repo-oss.repo ]]; then
+ zypper --quiet --root $cache/partial-$arch-packages --non-interactive ar http://download.opensuse.org/distribution/$DISTRO/repo/oss/ repo-oss || return 1
+ fi
+ if [[ ! -f $cache/partial-$arch-packages/etc/zypp/repos.d/update.repo ]]; then
+ zypper --quiet --root $cache/partial-$arch-packages --non-interactive ar http://download.opensuse.org/update/$DISTRO/ update || return 1
+ fi
zypper --quiet --root $cache/partial-$arch-packages --non-interactive --gpg-auto-import-keys update || return 1
- zypper --root $cache/partial-$arch-packages --non-interactive in --auto-agree-with-licenses --download-only zypper lxc patterns-openSUSE-base bash iputils sed tar || return 1
+ zypper --root $cache/partial-$arch-packages --non-interactive in --auto-agree-with-licenses --download-only zypper lxc patterns-openSUSE-base bash iputils sed tar rsyslog || return 1
cat > $cache/partial-$arch-packages/opensuse.conf << EOF
Preinstall: aaa_base bash coreutils diffutils
-Preinstall: filesystem fillup glibc grep insserv
-Preinstall: libbz2-1 libgcc47 libncurses5 pam
-Preinstall: permissions libreadline6 rpm sed tar zlib libselinux1
+Preinstall: filesystem fillup glibc grep insserv-compat
+Preinstall: libbz2-1 libgcc_s1 libncurses5 pam
+Preinstall: permissions libreadline6 rpm sed tar libz1 libselinux1
Preinstall: liblzma5 libcap2 libacl1 libattr1
Preinstall: libpopt0 libelf1 liblua5_1
Preinstall: libpcre1
@@ -135,8 +145,8 @@ Support: ncurses-utils
Support: iputils
Support: udev
Support: netcfg
-Support: dhcpcd hwinfo insserv module-init-tools openSUSE-release openssh
-Support: pwdutils rpcbind sysconfig rsyslog
+Support: dhcpcd hwinfo insserv-compat module-init-tools openSUSE-release openssh
+Support: pwdutils rpcbind sysconfig
Ignore: rpm:suse-build-key,build-key
Ignore: systemd:systemd-presets-branding
@@ -208,6 +218,15 @@ install_opensuse()
arch=$(arch)
+ if [[ -f $cache/rootfs-$arch/etc/os-release ]]; then
+ source $cache/rootfs-$arch/etc/os-release
+ if [[ ${DISTRO} != ${VERSION_ID} ]]; then
+ echo "openSUSE version in template don't match with cached system"
+ echo "Cleaning cache ..."
+ rm -rf "$cache/rootfs-$arch"
+ fi
+ fi
+
echo "Checking cache download in $cache/rootfs-$arch ... "
if [ ! -e "$cache/rootfs-$arch" ]; then
download_opensuse $cache $arch