[suse] Build openSUSE Leap 42.1 OpenStack Magnum image

Add information on how to build openSUSE Leap 42.1 image for
OpenStack Magnum with Kubernetes packages.

Change-Id: Ia53b79f14cb5f70b10d81bc13cae32232adca2a9
Partial-Bug: #1622949
This commit is contained in:
Michal Jura 2016-11-15 14:07:00 +01:00 committed by Spyros Trigazis (strigazi)
parent 6a12c83697
commit 902f77a4ae
4 changed files with 357 additions and 0 deletions

View File

@ -0,0 +1,39 @@
Build openSUSE Leap 42.1 image for OpenStack Magnum
===================================================
This instruction describes how to build manually openSUSE Leap 42.1 image
for OpenStack Magnum with Kubernetes packages.
Link to the image:
http://download.opensuse.org/repositories/Cloud:/Images:/Leap_42.1/images/openSUSE-Leap-42.1-JeOS-for-OpenStack-Magnum-K8s.x86_64.qcow2
## Requirements
Please install openSUSE (https://www.opensuse.org/) on physical or virtual machine.
## Install packages
Install `kiwi` package on openSUSE node, where do you want to build your image
`zypper install kiwi`
Create destination directory, where image will be build
`mkdir /tmp/openSUSE-Leap-42.1-JeOS-for-OpenStack-Magnum-K8s`
## Build image
Run in current directory with `openSUSE-Leap-42.1-JeOS-for-OpenStack-Magnum-K8s` kiwi template
`kiwi --verbose 3 --logfile terminal --build . --destdir /tmp/openSUSE-Leap-42.1-JeOS-for-OpenStack-Magnum-K8s`
## Get image
After `kiwi` will finish, image can be found in `/tmp/openSUSE-Leap-42.1-JeOS-for-OpenStack-Magnum-K8s`
directory with name `openSUSE-Leap-42.1-JeOS-for-OpenStack-Magnum-K8s.x86_64-1.1.1.qcow2`.
Full path
`/tmp/openSUSE-Leap-42.1-JeOS-for-OpenStack-Magnum-K8s/openSUSE-Leap-42.1-JeOS-for-OpenStack-Magnum-K8s.x86_64-1.1.1.qcow2`
Have fun !!!

View File

@ -0,0 +1,119 @@
#!/bin/bash
#================
# FILE : config.sh
#----------------
# PROJECT : openSUSE KIWI Image System
# COPYRIGHT : (c) 2006 SUSE LINUX Products GmbH. All rights reserved
# :
# AUTHOR : Marcus Schaefer <ms@suse.de>
# :
# BELONGS TO : Operating System images
# :
# DESCRIPTION : configuration script for SUSE based
# : operating systems
# :
# :
# STATUS : BETA
#----------------
#======================================
# Functions...
#--------------------------------------
test -f /.kconfig && . /.kconfig
test -f /.profile && . /.profile
mkdir /var/lib/misc/reconfig_system
#======================================
# Greeting...
#--------------------------------------
echo "Configure image: [$name]..."
#======================================
# add missing fonts
#--------------------------------------
CONSOLE_FONT="lat9w-16.psfu"
#======================================
# prepare for setting root pw, timezone
#--------------------------------------
echo ** "reset machine settings"
sed -i 's/^root:[^:]*:/root:*:/' /etc/shadow
rm /etc/machine-id
rm /etc/localtime
rm /var/lib/zypp/AnonymousUniqueId
rm /var/lib/systemd/random-seed
#======================================
# SuSEconfig
#--------------------------------------
echo "** Running suseConfig..."
suseConfig
echo "** Running ldconfig..."
/sbin/ldconfig
#======================================
# Setup baseproduct link
#--------------------------------------
suseSetupProduct
#======================================
# Specify default runlevel
#--------------------------------------
baseSetRunlevel 3
#======================================
# Add missing gpg keys to rpm
#--------------------------------------
suseImportBuildKey
#======================================
# Firewall Configuration
#--------------------------------------
echo '** Configuring firewall...'
chkconfig SuSEfirewall2_init on
chkconfig SuSEfirewall2_setup on
#======================================
# Enable sshd
#--------------------------------------
chkconfig sshd on
#======================================
# Remove doc files
#--------------------------------------
baseStripDocs
#======================================
# remove rpms defined in config.xml in the image type=delete section
#--------------------------------------
baseStripRPM
#======================================
# Sysconfig Update
#--------------------------------------
echo '** Update sysconfig entries...'
baseUpdateSysConfig /etc/sysconfig/SuSEfirewall2 FW_CONFIGURATIONS_EXT sshd
baseUpdateSysConfig /etc/sysconfig/console CONSOLE_FONT "$CONSOLE_FONT"
# baseUpdateSysConfig /etc/sysconfig/snapper SNAPPER_CONFIGS root
if [[ "${kiwi_iname}" != *"OpenStack"* ]]; then
baseUpdateSysConfig /etc/sysconfig/network/dhcp DHCLIENT_SET_HOSTNAME yes
fi
# true
#======================================
# SSL Certificates Configuration
#--------------------------------------
echo '** Rehashing SSL Certificates...'
update-ca-certificates
if [ ! -s /var/log/zypper.log ]; then
> /var/log/zypper.log
fi
# only for debugging
#systemctl enable debug-shell.service
baseCleanMount
exit 0

View File

@ -0,0 +1,39 @@
#!/bin/bash
#================
# FILE : image.sh
#----------------
# PROJECT : openSUSE KIWI Image System
# COPYRIGHT : (c) 2006 SUSE LINUX Products GmbH. All rights reserved
# :
# AUTHOR : Marcus Schaefer <ms@suse.de>
# :
# BELONGS TO : Operating System images
# :
# DESCRIPTION : configuration script for SUSE based
# : operating systems
# :
# :
# STATUS : BETA
#----------------
test -f /.kconfig && . /.kconfig
test -f /.profile && . /.profile
if [[ "${kiwi_iname}" = *"OpenStack"* ]]; then
# disable jeos-firstboot service
# We need to install it because it provides files required in the
# overlay for the image. However, the service itself is something that
# requires interaction on boot, which is not good for OpenStack, and the
# interaction actually doesn't bring any benefit in OpenStack.
systemctl mask jeos-firstboot.service
# enable cloud-init services
suseInsertService cloud-init-local
suseInsertService cloud-init
suseInsertService cloud-config
suseInsertService cloud-final
echo '*** adjusting cloud.cfg for openstack'
sed -i -e '/mount_default_fields/{adatasource_list: [ NoCloud, OpenStack, None ]
}' /etc/cloud/cloud.cfg
fi

View File

@ -0,0 +1,160 @@
<?xml version="1.0" encoding="utf-8"?>
<image schemaversion="6.1" name="openSUSE-Leap-42.1-JeOS-for-OpenStack-Magnum-K8s">
<description type="system">
<author>SUSE Containers Team</author>
<contact>docker-devel@suse.de</contact>
<specification>Kubernetes openSUSE Leap 42.1 image for OpenStack Magnum</specification>
</description>
<preferences>
<version>1.1.1</version>
<packagemanager>zypper</packagemanager>
<bootsplash-theme>openSUSE</bootsplash-theme>
<bootloader-theme>openSUSE</bootloader-theme>
<rpm-excludedocs>true</rpm-excludedocs>
<!-- temporary filesystem change to ext4, btrfs is just a nightmare on steroids for aarch64 -->
<type
image="vmx"
filesystem="ext4"
boot="vmxboot/suse-leap42.1"
format="qcow2"
vga="normal"
boottimeout="1"
bootloader="grub2"
firmware="uefi"
kernelcmdline="console=tty1 console=ttyS0,115200n8 console=ttyAMA0,115200n8 plymouth.enable=0 net.ifnames=0"
bootpartition="false"
bootkernel="custom"
devicepersistency="by-label"
/>
</preferences>
<repository type="rpm-md">
<source path="obs://Virtualization:containers/openSUSE_Leap_42.1"/>
</repository>
<repository type="rpm-md">
<source path="obs://Virtualization/openSUSE_Leap_42.1"/>
</repository>
<repository type="rpm-md">
<source path="obs://openSUSE:Leap:42.1:Update/standard"/>
</repository>
<repository type="rpm-md">
<source path="obs://openSUSE:Leap:42.1/standard"/>
</repository>
<repository type="rpm-md">
<source path="obs://openSUSE:Leap:42.1:Images/standard"/>
</repository>
<packages type="image">
<!-- jeos server -->
<package name="patterns-openSUSE-minimal_base"/>
<package name="aaa_base-extras"/>
<package name="acl"/>
<package name="curl"/>
<package name="dracut"/>
<package name="fipscheck"/>
<package name="grub2-branding-openSUSE" bootinclude="true"/>
<package name="iputils"/>
<package name="jeos-firstboot"/>
<package name="vim"/>
<package name="which"/>
<package name="gettext-runtime"/>
<package name="shim" arch="x86_64"/>
<package name="grub2"/>
<package name="grub2-x86_64-efi" arch="x86_64"/>
<package name="syslinux" arch="i586,x86_64"/>
<package name="fontconfig"/>
<package name="fonts-config"/>
<package name="haveged"/>
<package name="less" />
<package name="openslp"/>
<package name="tar"/>
<package name="parted"/>
<!-- <package name="SuSEfirewall2"/> not needed for JeOS and OpenStack Cloud-->
<package name="systemd"/>
<package name="systemd-sysvinit"/>
<package name="timezone"/>
<package name="wicked"/>
<package name="iproute2"/>
<package name="openssh"/>
<package name="elfutils"/>
<!-- kernel-default-base doesn't include kernel module tun.ko required by flanneld -->
<!-- <package name="kernel-default-base" bootinclude="true" replaces="kernel-default"/> -->
<package name="kernel-default" bootinclude="true"/>
<package name="python-base"/>
<package name="rsync"/>
<package name="libyui-ncurses-pkg7"/>
<package name="salt-minion"/>
<!-- packages required by file provides, BS can't resolve them -->
<package name="openSUSE-build-key"/>
<package name="pkg-config"/>
<package name="sg3_utils"/>
<package name="ncurses-utils"/>
<package name="krb5"/>
<package name="xfsprogs" />
<!-- cloud specific packages -->
<package name="cloud-init" />
<!-- kubernetes -->
<package name='docker'/>
<package name='etcd'/>
<package name='etcdctl'/>
<package name='flannel'/>
<package name='kubernetes-client'/>
<package name='kubernetes-master'/>
<package name='kubernetes-node'/>
</packages>
<packages type="bootstrap">
<package name="udev"/>
<package name="filesystem"/>
<package name="glibc-locale"/>
<package name="cracklib-dict-small"/>
<package name="ca-certificates"/>
<package name="openSUSE-release"/>
</packages>
<packages type="delete">
<package name="mtools"/>
<package name="initviocons"/>
<package name="cryptsetup"/>
<package name="autoyast2-installation"/>
<package name="bind-utils"/>
<package name="Mesa" />
<package name="Mesa-libGL1"/>
<package name="Mesa-libglapi0"/>
<package name="Mesa-EGL1"/>
<package name="Mesa-libEGL1"/>
<package name="lvm2"/>
<package name="sg3_utils"/>
<package name="libcairo2"/>
<package name="libcxb-dri2-0"/>
<package name="libgbm1"/>
<package name="libgio-2_0-0"/>
<package name="libharfbuzz0"/>
<package name="libpango-1_0-0"/>
<package name="libpixman-1-0"/>
<package name="libply-splash-graphics2"/>
<package name="libX11-6"/>
<package name="libX11-xcb1"/>
<package name="libxcb1"/>
<package name="libX11-data"/>
<package name="libXdamage1"/>
<package name="libXext6"/>
<package name="libXfixes3"/>
<package name="libXft2" />
<package name="libXrender1"/>
<package name="libXxf86vm1"/>
<package name="libpng16-16"/>
<package name="os-prober"/>
<package name="pango-modules"/>
<package name="plymouth"/>
<package name="plymouth-plugin-label"/>
<package name="plymouth-plugin-script"/>
<package name="plymouth-scripts"/>
<package name="plymouth-branding-openSUSE"/>
<package name="fontconfig"/>
<package name="fonts-config"/>
<package name="gnu-unifont-bitmap-fonts"/>
<package name="gio-branding-upstream"/>
<package name="libXau6"/>
<package name="libfreetype6"/>
<package name="shared-mime-info"/>
</packages>
</image>