Skip to content

Commit d4d2655

Browse files
committed
Add integration test build for retain feature
1 parent 293828e commit d4d2655

File tree

2 files changed

+41
-1
lines changed

2 files changed

+41
-1
lines changed

build-tests/x86/tumbleweed/test-image-disk/appliance.kiwi

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
2+
<!-- OBS-Profiles: @BUILD_FLAVOR@ -->
33
<image schemaversion="7.5" name="kiwi-test-image-disk">
44
<description type="system">
55
<author>Marcus Schäfer</author>
66
<contact>[email protected]</contact>
77
<specification>Disk test build</specification>
88
</description>
9+
<profiles>
10+
<profile name="Standard" description="Standard Disk"/>
11+
<profile name="Retain" description="Retain Last Partition"/>
12+
</profiles>
913
<preferences>
1014
<version>1.42.1</version>
1115
<packagemanager>zypper</packagemanager>
@@ -16,10 +20,13 @@
1620
<rpm-check-signatures>false</rpm-check-signatures>
1721
<bootsplash-theme>breeze</bootsplash-theme>
1822
<bootloader-theme>openSUSE</bootloader-theme>
23+
</preferences>
24+
<preferences profiles="Standard">
1925
<type image="oem" filesystem="btrfs" kernelcmdline="console=ttyS0" firmware="efi" installiso="true" bootpartition="false" btrfs_root_is_snapshot="true" installboot="install">
2026
<bootloader name="grub2" console="serial" timeout="10"/>
2127
<oemconfig>
2228
<oem-unattended>true</oem-unattended>
29+
<oem-swap>true</oem-swap>
2330
<oem-swapsize>1024</oem-swapsize>
2431
<oem-multipath-scan>false</oem-multipath-scan>
2532
</oemconfig>
@@ -28,8 +35,28 @@
2835
</systemdisk>
2936
</type>
3037
</preferences>
38+
<preferences profiles="Retain">
39+
<type image="oem" filesystem="btrfs" kernelcmdline="console=ttyS0 rd.kiwi.install.systemsize=all rd.kiwi.install.retain_last" firmware="efi" installiso="true" bootpartition="false" btrfs_root_is_snapshot="true" installboot="install" spare_part="0" spare_part_fs="ext4" spare_part_mountpoint="/home" spare_part_is_last="true">
40+
<bootloader name="grub2" console="serial" timeout="10"/>
41+
<oemconfig>
42+
<oem-unattended>true</oem-unattended>
43+
<oem-swap>true</oem-swap>
44+
<oem-swapsize>512</oem-swapsize>
45+
<!-- set root partition to a fixed value to keep address consistent -->
46+
<oem-systemsize>2048</oem-systemsize>
47+
<oem-multipath-scan>false</oem-multipath-scan>
48+
<oem-resize>true</oem-resize>
49+
</oemconfig>
50+
<systemdisk>
51+
<volume name="root"/>
52+
</systemdisk>
53+
<!-- whole disk must be big enough for fixed root + other -->
54+
<size unit="G">3</size>
55+
</type>
56+
</preferences>
3157
<users>
3258
<user password="$1$wYJUgpM5$RXMMeASDc035eX.NbYWFl0" home="/root" name="root" groups="root"/>
59+
<user password="$1$wYJUgpM5$RXMMeASDc035eX.NbYWFl0" home="/home/test-user" name="test-user" groups="users"/>
3360
</users>
3461
<repository type="rpm-md">
3562
<source path="obsrepositories:/"/>
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,22 @@
11
#!/bin/bash
22
set -ex
33

4+
declare kiwi_profiles=${kiwi_profiles}
5+
46
#======================================
57
# Activate services
68
#--------------------------------------
79
systemctl enable sshd
810
systemctl enable grub_config
911
systemctl enable dracut_hostonly
12+
13+
# Just in case the kiwi resizer is disabled in the system and
14+
# gets dropped from the initrd by the customer for some reason
15+
for profile in ${kiwi_profiles//,/ }; do
16+
if [ "${profile}" = "Retain" ]; then
17+
cat > /etc/fstab.script <<-EOF
18+
sed -ie "s@/home ext4 defaults@/home ext4 x-systemd.growfs,defaults@" /etc/fstab
19+
rm /etc/fstabe
20+
EOF
21+
fi
22+
done

0 commit comments

Comments
 (0)