From 90536dbab3e425d71a626f534307304389a2b7fd Mon Sep 17 00:00:00 2001 From: Markos Chandras Date: Mon, 3 Oct 2016 15:51:18 +0100 Subject: [PATCH] Add opensuse-minimal element Add a new opensuse-minimal element to build small and highly configurable openSUSE based images using the zypper-minimal element as the main building mechanism Change-Id: Iebfc4ad4aff763e511b093f1607b55851ccbddcb --- elements/opensuse-minimal/README.rst | 28 +++++++++++++++++++ elements/opensuse-minimal/element-deps | 1 + elements/opensuse-minimal/element-provides | 1 + .../10-opensuse-distro-name.bash | 20 +++++++++++++ .../install.d/01-ccache-symlinks | 0 .../install.d/01-login-defs | 0 .../opensuse-minimal-45267f5be1112c22.yaml | 6 ++++ 7 files changed, 56 insertions(+) create mode 100644 elements/opensuse-minimal/README.rst create mode 100644 elements/opensuse-minimal/element-deps create mode 100644 elements/opensuse-minimal/element-provides create mode 100644 elements/opensuse-minimal/environment.d/10-opensuse-distro-name.bash rename elements/{opensuse => zypper}/install.d/01-ccache-symlinks (100%) rename elements/{opensuse => zypper}/install.d/01-login-defs (100%) create mode 100644 releasenotes/notes/opensuse-minimal-45267f5be1112c22.yaml diff --git a/elements/opensuse-minimal/README.rst b/elements/opensuse-minimal/README.rst new file mode 100644 index 00000000..46df3c17 --- /dev/null +++ b/elements/opensuse-minimal/README.rst @@ -0,0 +1,28 @@ +================ +opensuse-minimal +================ + +This element will build a minimal openSUSE image. It requires 'zypper' to be +installed on the host. + +These images should be considered experimental. There are curently only x86_64 +images. + +Environment Variables +--------------------- + +DIB_RELEASE + :Required: No + :Default: 42.1 + :Description: Set the desired openSUSE release. + +DIB_OPENSUSE_MIRROR: + :Required: No + :Default: http://download.opensuse.org + :Description: To use a specific openSUSE mirror, set this variable to the + mirror URL before running bin/disk-image-create. This URL + should point to the root directory as indicated in the + http://mirrors.opensuse.org/ webpage. You normally + don't want to change that since the default setting will + pick the mirror closest to you. + :Example: ``DIB_OPENSUSE_MIRROR=http://ftp.cc.uoc.gr/mirrors/linux/opensuse/opensuse/`` diff --git a/elements/opensuse-minimal/element-deps b/elements/opensuse-minimal/element-deps new file mode 100644 index 00000000..ac6b190d --- /dev/null +++ b/elements/opensuse-minimal/element-deps @@ -0,0 +1 @@ +zypper-minimal diff --git a/elements/opensuse-minimal/element-provides b/elements/opensuse-minimal/element-provides new file mode 100644 index 00000000..a72e0496 --- /dev/null +++ b/elements/opensuse-minimal/element-provides @@ -0,0 +1 @@ +operating-system diff --git a/elements/opensuse-minimal/environment.d/10-opensuse-distro-name.bash b/elements/opensuse-minimal/environment.d/10-opensuse-distro-name.bash new file mode 100644 index 00000000..58fff6d2 --- /dev/null +++ b/elements/opensuse-minimal/environment.d/10-opensuse-distro-name.bash @@ -0,0 +1,20 @@ +export DISTRO_NAME=opensuse +export DIB_RELEASE=${DIB_RELEASE:-42.1} +export DIB_OPENSUSE_MIRROR=${DIB_OPENSUSE_MIRROR:-http://download.opensuse.org} +case ${DIB_RELEASE} in + # We are using "=>" as the assignment symbol since "@" "=" etc could be used in the URI itself. + # Remember, we can't export an array in bash so we use a string instead. + # Repo format: {name}=>{uri} + # Old openSUSE releases + 13*) + ZYPPER_REPOS="update=>${DIB_OPENSUSE_MIRROR}/update/${DIB_RELEASE}/ " + ZYPPER_REPOS+="oss=>${DIB_OPENSUSE_MIRROR}/distribution/${DIB_RELEASE}/repo/oss/" + ;; + # New Leap releases + 42*) + ZYPPER_REPOS="update=>${DIB_OPENSUSE_MIRROR}/update/leap/${DIB_RELEASE}/oss/ " + ZYPPER_REPOS+="oss=>${DIB_OPENSUSE_MIRROR}/distribution/leap/${DIB_RELEASE}/repo/oss/" + ;; + *) echo "Unsupported openSUSE release: ${DIB_RELEASE}"; exit 1 ;; +esac +export ZYPPER_REPOS diff --git a/elements/opensuse/install.d/01-ccache-symlinks b/elements/zypper/install.d/01-ccache-symlinks similarity index 100% rename from elements/opensuse/install.d/01-ccache-symlinks rename to elements/zypper/install.d/01-ccache-symlinks diff --git a/elements/opensuse/install.d/01-login-defs b/elements/zypper/install.d/01-login-defs similarity index 100% rename from elements/opensuse/install.d/01-login-defs rename to elements/zypper/install.d/01-login-defs diff --git a/releasenotes/notes/opensuse-minimal-45267f5be1112c22.yaml b/releasenotes/notes/opensuse-minimal-45267f5be1112c22.yaml new file mode 100644 index 00000000..4480aedd --- /dev/null +++ b/releasenotes/notes/opensuse-minimal-45267f5be1112c22.yaml @@ -0,0 +1,6 @@ +--- +features: + - New zypper-minimal and opensuse-minimal elements to create basic + openSUSE images. These two new elements are also making use of the + existing zypper element which has been extended to include the + functionality previously present in the opensuse element.