kiwi-el8/test/data/example_config.xml
Marcus Schäfer ca75086128
Prevent swap partition to be the last one
In an OEM deployment that requested the creation of a swap
partition via <oem-swap> that swap partition was created
at first boot and was always the last partition on the disk.
This was required because it could not be placed before
any other partition without destroying those partition
contents. This process leaves the system in an inflexible
condition if the storage device can change its geometry
dynamicly as it's the case for SAN systems. The typical
deployment target for OEM images are SAN storage clusters
and it's cumbersome to resize the root partition if swap
is last.

This commit Fixes #1231 and changes the handling of swap if
requested via <oem-swap> as follows:

1. The swap space is created as part of the image build process
   and no longer on first boot of the image via dracut code.
   This increases the size of the non compressed .raw disk image
   by the configured swap space size or the default. The
   compressed versions are not affected since zero initialized
   swap space compresses to almost no space. Deployment of
   the image however also deploys the swap partition which
   increases deployment time. For big swap configurations
   it's advisable to switch off image verification via
   oem-skip-verify. For very big swap configurations it's
   also recommended to prevent kiwi from adding them as part
   of the image and let them be created on first boot via
   a systemd service that e.g places a swap file, or creates
   a swap volume when possible such that the fexibility to
   resize the rootfs is still available.

2. The setup of the swap space is now explicit. It's no longer
   calculated by twice times RAM size because on newer machines
   this could lead to huge numbers. Either the kiwi encoded
   default swap size applies or the user configured value.

3. LVM based oem disks creates the swap space as logical volume.
   The volume is created as part of the image build process
   and no longer on first boot. The swap volume at build time
   of the image is of a minimal size and gets resized on first
   boot.

4. The move of the swap creation into the builder code also
   handles swap per configured device persistency schema like
   any other devices. This means by default swap is mounted
   via by-uuid name and thus also Fixes #1259
2019-11-25 12:05:57 +01:00

207 lines
9.1 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<image schemaversion="7.1" name="LimeJeOS-openSUSE-13.2" displayname="Bob">
<drivers>
<file name="crypto/*"/>
<file name="drivers/acpi/*"/>
<file name="bar"/>
</drivers>
<strip type="delete">
<file name="del-a"/>
<file name="del-b"/>
</strip>
<strip type="tools">
<file name="tool-a"/>
<file name="tool-b"/>
</strip>
<strip type="libs">
<file name="lib-a"/>
<file name="lib-b"/>
</strip>
<description type="system">
<author>Marcus</author>
<contact>ms@suse.com</contact>
<specification>
openSUSE 13.2 JeOS, is a small text based image
</specification>
</description>
<profiles>
<profile name="xenFlavour" description="VMX with Xen kernel"/>
<profile name="ec2Flavour" description="VMX with EC2/Xen kernel"/>
<profile name="vmxFlavour" description="VMX with default kernel" import="true"/>
<profile name="derivedContainer" description="Container built on top of a base issue"/>
<profile name="composedProfile" description="Composed profile">
<requires profile="vmxFlavour"/>
<requires profile="xenFlavour"/>
</profile>
</profiles>
<preferences>
<locale>en_US,de_DE</locale>
<rpm-locale-filtering>true</rpm-locale-filtering>
</preferences>
<preferences>
<type bootloader="grub2" image="oem" primary="true" boot="oemboot/example-distribution" firmware="efi" kernelcmdline="splash" vga="0x303" editbootconfig="my_edit_boot_script" editbootinstall="/absolute/path/to/my_edit_boot_install" fsmountoptions="async" fscreateoptions="-O ^has_journal" btrfs_root_is_snapshot="true" spare_part="200M" xen_server="true" formatoptions="force_size,super=man" filesystem="ext4">
<size unit="G" additive="true">1</size>
<systemdisk name="mydisk"/>
<machine memory="512" xen_loader="hvmloader">
<vmdisk id="0" device="/dev/xvda" controller="ide"/>
<vmnic interface=""/>
<vmdvd id="0" controller="scsi"/>
</machine>
<oemconfig>
<oem-systemsize>2048</oem-systemsize>
<oem-swap>true</oem-swap>
<oem-swapsize>42</oem-swapsize>
<oem-recovery>false</oem-recovery>
</oemconfig>
<vagrantconfig provider="libvirt" virtualsize="42"/>
</type>
<version>1.13.2</version>
<packagemanager>zypper</packagemanager>
<locale>en_US</locale>
<keytable>us.map.gz</keytable>
<timezone>Europe/Berlin</timezone>
<rpm-excludedocs>true</rpm-excludedocs>
<rpm-check-signatures>true</rpm-check-signatures>
<bootsplash-theme>openSUSE</bootsplash-theme>
<bootloader-theme>openSUSE</bootloader-theme>
</preferences>
<preferences profiles="ec2Flavour">
<type image="vmx" filesystem="ext3" bootprofile="ec2" bootkernel="ec2k" bootloader="grub2" kernelcmdline="xencons=xvc0 console=xvc0 multipath=off splash" firmware="ec2"/>
</preferences>
<preferences profiles="xenFlavour">
<type image="vmx" filesystem="ext3" bootprofile="xen" bootkernel="xenk" bootloader="grub2" kernelcmdline="splash">
<machine memory="512" xen_loader="hvmloader">
<vmdisk id="0" device="/dev/xvda" controller="ide"/>
<vmnic interface=""/>
</machine>
<size>10</size>
</type>
<type image="oem" filesystem="ext3" boot="oemboot/example-distribution" bootprofile="xen" bootkernel="xenk" installiso="true" bootloader="grub2" kernelcmdline="splash">
<oemconfig>
<oem-systemsize>2048</oem-systemsize>
<oem-swap>true</oem-swap>
</oemconfig>
</type>
<type image="docker"/>
</preferences>
<preferences profiles="vmxFlavour">
<type image="vmx" filesystem="ext3" format="vmdk" bootloader="grub2" kernelcmdline="splash" bootpartition="false">
<size unit="G" unpartitioned="1">4</size>
<systemdisk name="systemVG"/>
<machine memory="512" guestOS="suse" HWversion="4">
<vmdisk id="0" controller="ide"/>
<vmnic driver="e1000" interface="0" mode="bridged"/>
<vmconfig-entry>numvcpus = "4"</vmconfig-entry>
<vmconfig-entry>cpuid.coresPerSocket = "2"</vmconfig-entry>
</machine>
</type>
<type image="oem" filesystem="ext3" boot="oemboot/example-distribution" installiso="true" bootloader="grub2" kernelcmdline="splash">
<oemconfig>
<oem-systemsize>2048</oem-systemsize>
<oem-swap>true</oem-swap>
</oemconfig>
<machine memory="512" guestOS="suse" HWversion="4">
<vmdisk id="0" controller="ide"/>
<vmnic driver="e1000" interface="0" mode="bridged"/>
</machine>
</type>
<type image="docker">
<containerconfig name="container_name" maintainer="tux" user="root" workingdir="/root" tag="container_tag" additionaltags="current,foobar">
<entrypoint execute="/bin/bash">
<argument name="-x"/>
</entrypoint>
<subcommand execute="ls">
<argument name="-l"/>
</subcommand>
<expose>
<port number="80"/>
<port number="8080"/>
</expose>
<volumes>
<volume name="/tmp"/>
<volume name="/var/log"/>
</volumes>
<environment>
<env name="PATH" value="/bin:/usr/bin:/home/user/bin"/>
<env name="SOMEVAR" value="somevalue"/>
</environment>
<labels>
<label name="somelabel" value="labelvalue"/>
<label name="someotherlabel" value="anotherlabelvalue"/>
</labels>
<history author="history author" created_by="created by text">This is a comment</history>
</containerconfig>
</type>
<type image="iso" mediacheck="true"/>
</preferences>
<preferences profiles="derivedContainer">
<type image="docker" derived_from="obs://project/repo/image#mytag">
<containerconfig name="container_name" maintainer="tux" user="root" workingdir="/root" tag="container_tag">
<entrypoint clear="true"/>
<subcommand clear="true"/>
</containerconfig>
</type>
</preferences>
<users>
<user pwdformat="plain" password="mypwd" shell="/bin/bash" id="815" realname="Bob" home="/root" name="root"/>
<user groups="users" pwdformat="plain" password="mypwd" home="/home/tux" name="tux"/>
<user groups="kiwi,admin,users" pwdformat="plain" password="mypwd" name="kiwi"/>
</users>
<repository priority="42" sourcetype="baseurl">
<source path="iso:///image/CDs/dvd.iso"/>
</repository>
<repository type="rpm-md" imageinclude="true">
<source path="obs://Devel:PubCloud:AmazonEC2/SLE_12_GA"/>
</repository>
<repository type="rpm-md" imageonly="true">
<source path="obs://Devel:Docker:Images:SLE12SP2/SLE_12_SP2_Docker"/>
</repository>
<packages type="image" patternType="plusRecommended">
<namedCollection name="base"/>
<product name="openSUSE"/>
<package name="plymouth-branding-openSUSE" bootinclude="true"/>
<package name="grub2-branding-openSUSE" bootinclude="true"/>
<package name="ifplugd"/>
<package name="iputils"/>
<package name="vim" bootdelete="true"/>
<package name="openssh"/>
<archive name="/absolute/path/to/image.tgz" bootinclude="true"/>
<package name="foo" arch="s390,aarch64"/>
</packages>
<packages type="iso">
<package name="gfxboot-branding-openSUSE" bootinclude="true" bootdelete="true"/>
</packages>
<packages type="oem">
<package name="gfxboot-branding-openSUSE" bootinclude="true" bootdelete="true"/>
</packages>
<packages type="image" profiles="ec2Flavour">
<package name="kernel-ec2"/>
<package name="xen-tools" arch="x86_64"/>
<package name="xen" arch="x86_64"/>
</packages>
<packages type="image" profiles="xenFlavour">
<package name="kernel-xen"/>
<package name="xen-tools" arch="x86_64"/>
<package name="xen" arch="x86_64"/>
</packages>
<packages type="image" profiles="vmxFlavour">
<package name="kernel-default"/>
<ignore name="foo" arch="x86_64,aarch64"/>
<ignore name="bar" arch="x86_64"/>
<ignore name="baz"/>
</packages>
<packages type="bootstrap">
<package name="filesystem"/>
<namedCollection name="bootstrap-collection"/>
<product name="kiwi"/>
<archive name="bootstrap.tgz"/>
</packages>
<packages type="delete">
<package name="kernel-debug"/>
</packages>
<packages type="uninstall">
<package name="shadow"/>
</packages>
</image>