Skip to content

main/s390-tools: fix creating merged image post linux-lts update to 6.6

Amyspark requested to merge amyspark/aports:fix-s390tools-linux-lts into master

Hi all,

Linux kernels post 6.1 go beyond the 8MB offset which has been hardcoded in many alternative implementations of IBM's s390-tools's mk-s390image.

This is a known issue from over at Fedora: https://bugzilla.redhat.com/show_bug.cgi?id=1891778

I tried switching over to the official script, and amend it to set the correct LPSW (patch: mk-s390image.diff), but that image caused the following kernel panic:

KASLR disabled: CPU has no PRNG
KASLR disabled: CPU has no PRNG
[    1.863539] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(1,0)
[    1.864887] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 6.6.43-0-lts #1-Alpine
[    1.865167] Hardware name: QEMU 8561 QEMU (KVM/Linux)
[    1.865346] Call Trace:
[    1.865437]  [<0000000000b46892>] dump_stack_lvl+0x62/0x88
[    1.865944]  [<000000000018d6c8>] panic+0x320/0x338
[    1.866000]  [<00000000014401d6>] mount_root_generic+0x20e/0x4a0
[    1.866045]  [<000000000144090c>] prepare_namespace+0xc4/0x3f8
[    1.866084]  [<000000000143f23a>] kernel_init_freeable+0x5ba/0x698
[    1.866142]  [<0000000000b73026>] kernel_init+0x2e/0x1f0
[    1.866191]  [<00000000001034a4>] __ret_from_fork+0x3c/0x50
[    1.866232]  [<0000000000b885da>] ret_from_fork+0xa/0x30

The approach taken here is to just preserve the fixed offset if the compressed kernel image is < 8MB, and adjust it otherwise. A future FIXME would be to migrate to the official script altogether and investigate why the image it produces is invalid.

This MR would need to be backported to 3.20, 3.19, and 3.18 if linux-lts 6.6 is slipstreamed there too.

Fixes #16310 (closed)

Merge request reports