Bug 2137905

Summary: backport support for embedded container whiteouts [rhel-8.7.0.z]
Product: Red Hat Enterprise Linux 8 Reporter: RHEL Program Management Team <pgm-rhel-tools>
Component: rpm-ostreeAssignee: Colin Walters <walters>
Status: CLOSED ERRATA QA Contact: Aashish Radhakrishnan <aaradhak>
Severity: medium Docs Contact:
Priority: high    
Version: 8.7CC: aaradhak, bgilbert, dhellmann, dornelas, ggiguash, hhei, qzhang, smilner
Target Milestone: rcKeywords: Triaged, ZStream
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: rpm-ostree-2022.10.90.g4abaf4b4-5.el8_7 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 2134630 Environment:
Last Closed: 2023-02-21 09:30:32 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 2134630    
Bug Blocks:    

Comment 10 Aashish Radhakrishnan 2023-01-19 15:18:39 UTC
Ignore comment 9:



Reserved RHEL-8.7.0-updates-20230117.12 in Beaker and installed the rpm-ostree-2022.10.90.g4abaf4b4-5.el8_7 package.
Steps followed for the test:

a) Check the rpm-ostree and ostree versions, 
b) Do the following tests, 
c) Run `rpm-ostree compose commit` with character device with 0/0 device number works. 

Open to any review or suggestions regarding the test procedure.

1) Check ostree and rpm-ostree versions,
[root@kvm-07-guest25 ~]# rpm -q ostree rpm-ostree
ostree-2022.2-5.el8.x86_64
rpm-ostree-2022.10.90.g4abaf4b4-5.el8_7.x86_64


2) Run `whiteout.sh` to prepare data
$ cat whiteout.sh

#!/bin/bash
mkdir test
pushd test
sudo rm -rf mkdir cache sysroot
cat > manifest.yaml << 'EOF'
ref: foo
boot-location: modules
releasever: 36
packages:
  - bash
  - rpm
  - coreutils
  - selinux-policy-targeted
  - kernel
  - ostree
repos:
  - fedora  # Intentially using frozen GA repo
EOF

cat > fedora.repo << 'EOF'
[fedora]
name=Fedora $releasever - $basearch
baseurl=https://dl.fedoraproject.org/pub/fedora/linux/releases/$releasever/Everything/$basearch/os/
        https://dl.fedoraproject.org/pub/fedora-secondary/releases/$releasever/Everything/$basearch/os/
enabled=1
repo_gpgcheck=0
type=rpm
gpgcheck=0
skip_if_unavailable=False
EOF

mkdir cache sysroot
ostree --repo=build-repo init --mode=archive

sudo rpm-ostree compose install --unified-core --cachedir=cache --repo=build-repo manifest.yaml ./sysroot

sudo mknod -m 000 sysroot/rootfs/usr/share/foowhiteout c 0 0
sudo touch sysroot/rootfs/usr/share/rpm-ostree-composetest-split.txt
sudo rpm-ostree compose postprocess ./sysroot/rootfs manifest.yaml

$ sh -x whiteout.sh
......
+ sudo rpm-ostree compose postprocess ./sysroot/rootfs manifest.yaml
Processed 1 embedded whiteouts

3) Run `rpm-ostree compose commit` and check
[root@kvm-07-guest25 ~]# sudo rpm-ostree compose commit --repo=build-repo manifest.yaml ./sysroot/rootfs

[root@kvm-07-guest25 ~]# ostree --repo=build-repo ls foo /usr/bin/bash
-00755 0 0 1390064 /usr/bin/bash
[root@kvm-07-guest25 ~]# ostree --repo=build-repo ls foo /usr/share/rpm-ostree-composetest-split.txt
-00644 0 0      0 /usr/share/rpm-ostree-composetest-split.txt
[root@kvm-07-guest25 ~]# ostree --repo=build-repo ls foo /usr/share/.ostree-wh.foowhiteout
-00000 0 0      0 /usr/share/.ostree-wh.foowhiteout

Comment 14 errata-xmlrpc 2023-02-21 09:30:32 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 (rpm-ostree bug fix and enhancement update), 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/RHEA-2023:0844