The following pull request was submitted through Github.
It can be accessed and reviewed at: https://github.com/lxc/lxc/pull/1354

This e-mail was sent by the LXC bot, direct replies will not reach the author
unless they happen to be subscribed to this list.

=== Description (from pull-request) ===
This updates lxc-opensuse template to include Leap 42.2 and changes the default release to 42.2. Some checks related to `[ $DISTRO == "leap/42.1 ]"` to `[[ $DISTRO == "leap/4"* ]]`  were changed so it can accomodate future releases a little bit better.

I'm not exactly sure if the following should be in separate pull requests:
* 3ddfde2 uncomments `lxc.aa_profile = unconfined` by default to resolve startup failures on openSUSE based containers
  - Sorry, I don't know any other way to fix this without compromising security.
* e080c49 removes libgcc_s1 from preinstalled packages as this was causing container creation to fail
  - Related: opensuse/obs-build#188.
From 76a8633817792fe74828ca0b6e50734e265afac9 Mon Sep 17 00:00:00 2001
From: "Terzeus S. Dominguez" <[email protected]>
Date: Tue, 13 Dec 2016 00:56:35 +0800
Subject: [PATCH 1/4] Update openSUSE template for Leap 42.2

Aside from adding a 42.2 option, $DISTRO comparisons for Leap have been
changed [ exp ] => [[ exp ]] to accomodate pattern matching for future
releases.

Signed-off-by: Terzeus S. Dominguez <[email protected]>
---
 templates/lxc-opensuse.in | 17 ++++++++++++-----
 1 file changed, 12 insertions(+), 5 deletions(-)

diff --git a/templates/lxc-opensuse.in b/templates/lxc-opensuse.in
index ad75e10..a2b984f 100644
--- a/templates/lxc-opensuse.in
+++ b/templates/lxc-opensuse.in
@@ -145,7 +145,7 @@ download_opensuse()
     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
     # Leap update repos were rearranged
-    if [ $DISTRO == "leap/42.1" ]; then
+    if [[ $DISTRO == "leap/4"* ]]; then
         zypper --quiet --root $cache/partial-$arch-packages --non-interactive 
ar http://download.opensuse.org/update/$DISTRO/oss/ update || return 1
     else
         zypper --quiet --root $cache/partial-$arch-packages --non-interactive 
ar http://download.opensuse.org/update/$DISTRO/ update || return 1
@@ -182,14 +182,14 @@ EOF
        echo "Support: python3-base" >> 
$cache/partial-$arch-packages/opensuse.conf
     fi
 
-    # dhcpcd is not in the default repos with Leap 42.1
-    if [ $DISTRO != "leap/42.1" ]
+    # dhcpcd is not in the default repos since Leap 42.1
+    if [[ $DISTRO != "leap/4"* ]]
     then
     echo "Support: dhcpcd" >> $cache/partial-$arch-packages/opensuse.conf
     fi
 
     # Leap doesn't seem to have iproute2 utils installed
-    if [ $DISTRO == "leap/42.1" ]
+    if [[ $DISTRO == "leap/4"* ]]
     then
     echo "Support: net-tools iproute2" >> 
$cache/partial-$arch-packages/opensuse.conf
     fi
@@ -210,11 +210,13 @@ EOF
 
     CLEAN_BUILD=1 BUILD_ARCH="$arch" BUILD_ROOT="$cache/partial-$arch" 
BUILD_DIST="$cache/partial-$arch-packages/opensuse.conf" 
PATH="$PATH:$BUILD_DIR" $BUILD_DIR/init_buildsystem  --clean --configdir 
$BUILD_DIR/configs --cachedir $cache/partial-$arch-cache --repository 
$cache/partial-$arch-packages/var/cache/zypp/packages/repo-oss/suse/$arch 
--repository 
$cache/partial-$arch-packages/var/cache/zypp/packages/repo-oss/suse/noarch 
--repository $cache/partial-$arch-packages/var/cache/zypp/packages/update/$arch 
--repository 
$cache/partial-$arch-packages/var/cache/zypp/packages/update/noarch || return 1
     chroot $cache/partial-$arch /usr/bin/zypper --quiet --non-interactive ar 
http://download.opensuse.org/distribution/$DISTRO/repo/oss repo-oss || return 1
-    if [ $DISTRO == "leap/42.1" ]; then
+
+    if [[ $DISTRO == "leap/4"* ]]; then
         chroot $cache/partial-$arch /usr/bin/zypper --quiet --non-interactive 
ar http://download.opensuse.org/update/$DISTRO/oss update || return 1
     else
         chroot $cache/partial-$arch /usr/bin/zypper --quiet --non-interactive 
ar http://download.opensuse.org/update/$DISTRO/ update || return 1
     fi
+
 #   really clean the image
     rm -fr $cache/partial-$arch/{.build,.guessed_dist,.srcfiles*,installed-pkg}
     rm -fr $cache/partial-$arch/dev
@@ -478,6 +480,11 @@ else
            DISTRO="leap/42.1"
            ;;
 
+        42.2|leap/42.2|422)
+            echo "Selected openSUSE Leap 42.2"
+            DISTRO="leap/42.2"
+            ;; 
+
        *)
            echo "You have chosen an invalid release, quitting..."
            exit 1

From e783e4bd745944aefd21638c66e3d73a0e44825a Mon Sep 17 00:00:00 2001
From: "Terzeus S. Dominguez" <[email protected]>
Date: Tue, 13 Dec 2016 01:04:31 +0800
Subject: [PATCH 2/4] Change openSUSE default release to Leap 42.2

Signed-off-by: Terzeus S. Dominguez <[email protected]>
---
 templates/lxc-opensuse.in | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/templates/lxc-opensuse.in b/templates/lxc-opensuse.in
index a2b984f..29702fb 100644
--- a/templates/lxc-opensuse.in
+++ b/templates/lxc-opensuse.in
@@ -407,7 +407,7 @@ usage()
     cat <<EOF
 $1 -h|--help -p|--path=<path> -r|--release nn.n --clean
 Please give the release as 13.1, 13.2 etc.
-If no release is given, openSUSE 13.1 is installed.
+If no release is given, openSUSE Leap 42.2 is installed.
 EOF
     return 0
 }
@@ -462,8 +462,8 @@ fi
 
 if [ -z "$DISTRO" ]; then
     echo ""
-    echo "No release selected, using openSUSE 13.1"
-    DISTRO=13.1
+    echo "No release selected, using openSUSE Leap 42.2"
+    DISTRO=42.2
 else
     echo ""
     case "$DISTRO" in

From 3ddfde2ad1f927a18498e27338a864de074a026b Mon Sep 17 00:00:00 2001
From: "Terzeus S. Dominguez" <[email protected]>
Date: Tue, 13 Dec 2016 03:51:18 +0800
Subject: [PATCH 3/4] Set openSUSE to be unconfined by AppArmor

Uncommented lxc.aa_profile = unconfined. Otherwise, container fails to
start up.

Signed-off-by: Terzeus S. Dominguez <[email protected]>
---
 templates/lxc-opensuse.in | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/templates/lxc-opensuse.in b/templates/lxc-opensuse.in
index 29702fb..d1c7853 100644
--- a/templates/lxc-opensuse.in
+++ b/templates/lxc-opensuse.in
@@ -356,7 +356,7 @@ lxc.utsname = $name
 lxc.mount.auto = cgroup:mixed proc:mixed sys:mixed
 
 # When using LXC with apparmor, uncomment the next line to run unconfined:
-#lxc.aa_profile = unconfined
+lxc.aa_profile = unconfined
 
 # example simple networking setup, uncomment to enable
 #lxc.network.type = $lxc_network_type

From e080c49ab03f3ae38c896bde7e92e4fce63d217f Mon Sep 17 00:00:00 2001
From: "Terzeus S. Dominguez" <[email protected]>
Date: Tue, 13 Dec 2016 05:01:05 +0800
Subject: [PATCH 4/4] Remove libgcc_s1 from openSUSE template

Removed libgcc_s1 because it breaks container building for openSUSE.

Related: openSUSE/obs-build#188

Signed-off-by: Terzeus S. Dominguez <[email protected]>
---
 templates/lxc-opensuse.in | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/templates/lxc-opensuse.in b/templates/lxc-opensuse.in
index d1c7853..0774397 100644
--- a/templates/lxc-opensuse.in
+++ b/templates/lxc-opensuse.in
@@ -155,7 +155,7 @@ download_opensuse()
     cat > $cache/partial-$arch-packages/opensuse.conf << EOF
 Preinstall: aaa_base bash coreutils diffutils
 Preinstall: filesystem fillup glibc grep insserv-compat perl-base
-Preinstall: libbz2-1 libgcc_s1 libncurses5 pam
+Preinstall: libbz2-1 libncurses5 pam
 Preinstall: permissions libreadline6 rpm sed tar libz1 libselinux1
 Preinstall: liblzma5 libcap2 libacl1 libattr1
 Preinstall: libpopt0 libelf1 liblua5_1
_______________________________________________
lxc-devel mailing list
[email protected]
http://lists.linuxcontainers.org/listinfo/lxc-devel

Reply via email to