Skip to content

Commit 0b36d14

Browse files
authored
Merge pull request #2825 from OSInside/fix_s390_GPT_disk_type
Fix disk_type validation for zipl loader
2 parents 29400c8 + 266430a commit 0b36d14

File tree

6 files changed

+15
-15
lines changed

6 files changed

+15
-15
lines changed

build-tests/s390/tumbleweed/test-image-MicroOS/appliance.kiwi

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
<oem-unattended>true</oem-unattended>
3737
<oem-resize>true</oem-resize>
3838
</oemconfig>
39-
<bootloader name="zipl" timeout="10"/>
39+
<bootloader name="zipl" timeout="10" targettype="GPT"/>
4040
<systemdisk>
4141
<volume name="home"/>
4242
<volume name="root"/>
@@ -165,17 +165,20 @@
165165
<package name="cloud-init"/>
166166
<package name="cloud-init-config-suse"/>
167167
<package name="systemd-network"/>
168+
<package name="systemd-resolved"/>
168169
</packages>
169170
<packages type="image" profiles="IBM-Cloud-Standard">
170171
<package name="cloud-init"/>
171172
<package name="cloud-init-config-suse"/>
172173
<package name="systemd-network"/>
174+
<package name="systemd-resolved"/>
173175
</packages>
174176
<packages type="image" profiles="SUSE-Infra">
175177
<package name="ibm-se-certificates"/>
176178
<package name="ibm-se-revocation-lists"/>
177179
<package name="suse-se-host-certificates"/>
178180
<package name="systemd-network"/>
181+
<package name="systemd-resolved"/>
179182
</packages>
180183
<packages type="image">
181184
<package name="patterns-base-bootloader"/>
@@ -203,6 +206,7 @@
203206
<package name="curl"/>
204207
<package name="cryptsetup"/>
205208
<package name="procps"/>
209+
<package name="zlib-devel"/>
206210
</packages>
207211
<packages type="bootstrap">
208212
<package name="gawk"/>
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/bash
2+
set -euxo pipefail
3+
4+
/usr/libexec/setup-etc-subvol

build-tests/s390/tumbleweed/test-image-MicroOS/root/etc/fstab.script

Lines changed: 0 additions & 9 deletions
This file was deleted.

kiwi/bootloader/config/zipl.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,7 @@ def _get_template_parameters(
190190
self, default_entry: str = ''
191191
) -> Dict[str, str]:
192192
disk_type = self.disk_type or 'SCSI'
193+
disk_type = disk_type if disk_type != 'GPT' else 'SCSI'
193194
blocksize = self.disk_blocksize or 512
194195
unsupported_for_target_geometry = ['FBA', 'SCSI']
195196
targetbase = f'targetbase={self.custom_args.get("targetbase")}'
@@ -204,7 +205,7 @@ def _get_template_parameters(
204205
'boot_timeout': self.timeout,
205206
'bootpath': self.get_boot_path(),
206207
'targetbase': targetbase,
207-
'targettype': disk_type if disk_type != 'GPT' else 'SCSI',
208+
'targettype': disk_type,
208209
'targetblocksize': format(blocksize),
209210
'targetoffset': self._get_partition_start(),
210211
'targetgeometry': geometry,

kiwi/builder/disk.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1133,7 +1133,7 @@ def _build_and_map_disk_partitions(
11331133
)
11341134
partition_mbsize = self.disk_setup.boot_partition_size()
11351135
disk.create_boot_partition(
1136-
partition_mbsize, self.boot_clone_count
1136+
format(partition_mbsize), self.boot_clone_count
11371137
)
11381138
disksize_used_mbytes += \
11391139
(self.boot_clone_count + 1) * partition_mbsize if \

test/unit/builder/disk_test.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ def test_create_disk_standard_root_with_kiwi_initrd(
321321
self.firmware.get_efi_partition_size()
322322
)
323323
disk.create_boot_partition.assert_called_once_with(
324-
self.disk_setup.boot_partition_size(), 0
324+
format(self.disk_setup.boot_partition_size()), 0
325325
)
326326
disk.create_swap_partition.assert_called_once_with(
327327
'128'
@@ -567,7 +567,7 @@ def test_create_disk_standard_root_with_clone(
567567
self.disk_builder.create_disk()
568568

569569
disk.create_boot_partition.assert_called_once_with(
570-
self.disk_setup.boot_partition_size(), 1
570+
format(self.disk_setup.boot_partition_size()), 1
571571
)
572572
disk.create_root_partition.assert_called_once_with(
573573
'clone:458:458', 1
@@ -833,7 +833,7 @@ def test_create_disk_standard_root_with_dracut_initrd(
833833
self.firmware.get_efi_partition_size()
834834
)
835835
disk.create_boot_partition.assert_called_once_with(
836-
self.disk_setup.boot_partition_size(), 0
836+
format(self.disk_setup.boot_partition_size()), 0
837837
)
838838
disk.create_prep_partition.assert_called_once_with(
839839
self.firmware.get_prep_partition_size()

0 commit comments

Comments
 (0)