diff --git a/elements/opensuse/README.rst b/elements/opensuse/README.rst index 48adc40e..5ca0da5e 100644 --- a/elements/opensuse/README.rst +++ b/elements/opensuse/README.rst @@ -13,6 +13,19 @@ For example, the images of openSUSE 13.2 can be found here: These images should be considered experimental. There are curently only x86_64 images. +Environment Variables +--------------------- + +DIB_RELEASE + :Required: No + :Default: 13.1 + :Description: Set the desired openSUSE release. + +DIB_CLOUD_IMAGES + :Required: No + :Default: http://download.opensuse.org/repositories/Cloud:/Images:/(openSUSE|Leap)_${DIB_RELEASE} + :Description: Set the desired URL to fetch the images from. + Notes: * There are very frequently new automated builds that include changes that @@ -21,8 +34,3 @@ Notes: point to the latest image, but will frequently change its content. The versioned one will never change content, but will frequently be deleted and replaced by a newer build with a higher version-release number. - -* Building with DIB\_EXTLINUX=1 doesn't work. It fails with: - /tmp/in\_target.d/finalise.d/51-bootloader: line 14: 16286 Segmentation fault - extlinux --install /boot/syslinux - (https://bugzilla.novell.com/show_bug.cgi?id=852856) diff --git a/elements/opensuse/environment.d/10-opensuse-distro-name.bash b/elements/opensuse/environment.d/10-opensuse-distro-name.bash index 22db6c1c..38efb86f 100644 --- a/elements/opensuse/environment.d/10-opensuse-distro-name.bash +++ b/elements/opensuse/environment.d/10-opensuse-distro-name.bash @@ -1 +1,9 @@ export DISTRO_NAME=opensuse +export DIB_RELEASE=${DIB_RELEASE:-13.1} +case ${DIB_RELEASE} in + # Old openSUSE releases + 13*) export OPENSUSE_REPO_DIR=openSUSE_${DIB_RELEASE} ;; + # New Leap releases + 42*) export OPENSUSE_REPO_DIR=openSUSE_Leap_${DIB_RELEASE} ;; + *) echo "Unsupported openSUSE release: ${DIB_RELEASE}"; exit 1 ;; +esac diff --git a/elements/opensuse/pre-install.d/00-opensuse-setup b/elements/opensuse/pre-install.d/00-opensuse-setup index ecc7efc2..b681dfee 100755 --- a/elements/opensuse/pre-install.d/00-opensuse-setup +++ b/elements/opensuse/pre-install.d/00-opensuse-setup @@ -7,4 +7,4 @@ fi set -eu set -o pipefail -zypper ar -f http://download.opensuse.org/repositories/X11:/Bumblebee/openSUSE_13.1/X11:Bumblebee.repo +zypper ar -f http://download.opensuse.org/repositories/X11:/Bumblebee/${OPENSUSE_REPO_DIR}/X11:Bumblebee.repo diff --git a/elements/opensuse/root.d/10-opensuse-cloud-image b/elements/opensuse/root.d/10-opensuse-cloud-image index a6734b92..dc56e536 100755 --- a/elements/opensuse/root.d/10-opensuse-cloud-image +++ b/elements/opensuse/root.d/10-opensuse-cloud-image @@ -18,11 +18,24 @@ if ! [ 'x86_64' = "$ARCH" ] ; then exit 1 fi -DIB_RELEASE=${DIB_RELEASE:-13.1} +# Set some image defaults +case ${DIB_RELEASE} in + # Old openSUSE releases + 13*) + OPENSUSE_IMAGE_BASEDIR=openSUSE + OPENSUSE_IMAGE_FILE=openSUSE-${DIB_RELEASE}-OS + ;; + # New Leap releases + 42*) + OPENSUSE_IMAGE_BASEDIR=Leap + OPENSUSE_IMAGE_FILE=openSUSE-Leap-${DIB_RELEASE}-OpenStack + ;; + # We handle unknown cases in environment.d/10-opensuse-distro-name.bash +esac # NOTE(toabctl): if something changes here on the buildservice side, please # first ask in #opensuse-cloud on freenode before you change the format here! -DIB_CLOUD_IMAGES=${DIB_CLOUD_IMAGES:-http://download.opensuse.org/repositories/Cloud:/Images:/openSUSE_${DIB_RELEASE}/images/} -BASE_IMAGE_FILE=${BASE_IMAGE_FILE:-openSUSE-${DIB_RELEASE}-OS-rootfs.${ARCH}.tbz} +DIB_CLOUD_IMAGES=${DIB_CLOUD_IMAGES:-http://download.opensuse.org/repositories/Cloud:/Images:/${OPENSUSE_IMAGE_BASEDIR}_${DIB_RELEASE}/images/} +BASE_IMAGE_FILE=${BASE_IMAGE_FILE:-${OPENSUSE_IMAGE_FILE}-rootfs.${ARCH}.tbz} SHA256SUMS_FILE=${SHA256SUMS_FILE:-${BASE_IMAGE_FILE}.sha256} CACHED_FILE=$DIB_IMAGE_CACHE/$BASE_IMAGE_FILE