Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.

Bug 1778771

Summary: 20-zipl-kernel.install deletes /tmp when kernel-core is installed in s390x container image
Product: Red Hat Enterprise Linux 8 Reporter: Dan Horák <dhorak>
Component: s390utilsAssignee: Dan Horák <dhorak>
Status: CLOSED ERRATA QA Contact: Vilém Maršík <vmarsik>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 8.0CC: extras-qa, fmartine, jcajka, rvr
Target Milestone: rc   
Target Release: 8.0   
Hardware: s390x   
OS: Linux   
Whiteboard:
Fixed In Version: s390utils-2.6.0-24.el8 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 1726286 Environment:
Last Closed: 2020-04-28 16:49:37 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Dan Horák 2019-12-02 13:24:48 UTC
We want to merge the Fedora container related change to RHEL-8 too.

+++ This bug was initially created as a clone of Bug #1726286 +++

Description of problem:
20-zipl-kernel.install deletes /tmp when kernel-core is installed in s390x container image after it gets invoked by kernel-install with 3rd parameter in format of /tmp/kernel-install.5GcCL

Version-Release number of selected component (if applicable):
s390utils-base-2.8.0-3.fc30.s390x

How reproducible:
Always

Steps to Reproduce:
1.Run fedora:30 container(podman run --rm -ti registry.fedoraproject.org/fedora:30 /bin/bash)
2.Run "dnf update" or "dnf distro-sync" in it
3.Run "dnf install kernel-core" in it
4.Run "mktemp" in it

Actual results:
$mktemp
mktemp: failed to create file via template ‘/tmp/tmp.XXXXXXXXXX’: No such file or directory
$ls /
bin  boot  dev  etc  home  lib  lib64  lost+found  media  mnt  opt  proc  root  run  sbin  srv  sys  usr  var

Expected results:
$mktemp
/tmp/tmp.c0aVsVxDMe
$ls /
bin  boot  dev  etc  home  lib  lib64  lost+found  media  mnt  opt  proc  root  run  sbin  srv  sys  tmp  usr  var

--- Additional comment from Dan Horák on 2019-07-02 13:53:24 UTC ---

the offending line is https://src.fedoraproject.org/rpms/s390utils/blob/master/f/20-zipl-kernel.install#_15

--- Additional comment from Javier Martinez Canillas on 2019-07-02 14:21:52 UTC ---

I've provided a patch to fix this issue. Could you please test it?

There's also a s390utils-2.8.0-4.fc30 scratch build here:

http://koji.fedoraproject.org/koji/taskinfo?taskID=36003888

--- Additional comment from Jakub Čajka on 2019-07-02 14:41:49 UTC ---

(In reply to Javier Martinez Canillas from comment #2)
> Created attachment 1586726 [details]
> [PATCH] - fix /tmp being deleted when kernel-core is installed in a 
> container (#1726286)
> 
> I've provided a patch to fix this issue. Could you please test it?
> 
> There's also a s390utils-2.8.0-4.fc30 scratch build here:
> 
> http://koji.fedoraproject.org/koji/taskinfo?taskID=36003888

Works for me in the container. Thanks for quick fix :).

Comment 2 Vilém Maršík 2020-02-06 23:11:02 UTC
How should I reproduce this? You probably did not mean to install a s390utils.fc30 on the RHEL8 host, but the Fedora container runs without s390utils-base package. Even if I installed it inside, I still could not reproduce the problem. So what RHEL on & what s390utils do I need on the host to see the problem?

Comment 3 Dan Horák 2020-02-14 12:55:53 UTC
The host shouldn't matter, the problem will be inside the container. Here it will be a RHEL-8 "base" container for the step #1 in the "Steps to reproduce". I don't think it can be reproduced without the container (on plain rhel8 machine).

Comment 4 Vilém Maršík 2020-03-11 15:02:36 UTC
Cannot reproduce with RHEL-8.1 as host and F30 as guest:
# cat /etc/redhat-release
Red Hat Enterprise Linux release 8.1 (Ootpa)
# podman run --rm -ti registry.fedoraproject.org/fedora:30 /bin/bash
(...)
[root@73e536f5bf76 /]# dnf update
(...)
Complete!
[root@73e536f5bf76 /]# dnf install kernel-core
(...)
Complete!
[root@73e536f5bf76 /]# mktemp
/tmp/tmp.s0RWkmRjIY
[root@73e536f5bf76 /]#

Did you mean I should try RHEL-8 as guest? What would the "-ti" parameter be in that case?

Comment 5 Javier Martinez Canillas 2020-03-11 15:41:04 UTC
Hello Vilém,

(In reply to Vilém Maršík from comment #4)
> Cannot reproduce with RHEL-8.1 as host and F30 as guest:
> # cat /etc/redhat-release
> Red Hat Enterprise Linux release 8.1 (Ootpa)
> # podman run --rm -ti registry.fedoraproject.org/fedora:30 /bin/bash

It's the other way around, you need a RHEL8 container to reproduce this. The example command in Comment 1 uses a Fedora container image because the bug was originally reported in Fedora and then cloned for RHEL8.

Comment 6 Vilém Maršík 2020-03-11 23:57:48 UTC
I would have tried, but could not find a registry record for RHEL-8 (for the "-ti" switch). Do you know where to find it?

Comment 7 Vilém Maršík 2020-03-30 19:31:34 UTC
Patch ef56cfef7ac631273ef82ba0fc3c9b58d72ee9d7 in rhel-8.2.0 branch of s390utils.git seems to fix this. Could not find a RHEL8 registry for podman, but rather confident that this simple fix will behave the same way as in Fedora. Setting Verified/Sanityonly.

Comment 9 errata-xmlrpc 2020-04-28 16:49:37 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2020:1826