Bug 2134630

Summary: backport support for embedded container whiteouts
Product: Red Hat Enterprise Linux 8 Reporter: Colin Walters <walters>
Component: rpm-ostreeAssignee: Colin Walters <walters>
Status: CLOSED ERRATA QA Contact: HuijingHei <hhei>
Severity: unspecified Docs Contact:
Priority: urgent    
Version: 8.7CC: aaradhak, bgilbert, dornelas, ggiguash, hhei, qzhang
Target Milestone: rcKeywords: Triaged, ZStream
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: rpm-ostree-2022.10.99.g0049dbdd-3.el8 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 2137905 (view as bug list) Environment:
Last Closed: 2023-05-16 08:24:00 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:
Bug Depends On:    
Bug Blocks: 2137905    

Description Colin Walters 2022-10-13 19:48:26 UTC
Backport https://github.com/coreos/rpm-ostree/pull/4088

Comment 1 HuijingHei 2022-10-19 13:33:09 UTC
Upgrade rpm-ostree and ostree, do the following tests, run `rpm-ostree compose commit` with character device with 0/0 device number works. Any review and suggestions are appreciated, thanks!

1) Upgrade ostree and rpm-ostree, run `whiteout.sh` to prepare data
[core@cosa-devsh ~]$ rpm -q ostree rpm-ostree
ostree-2022.2-6.el8.x86_64
rpm-ostree-2022.10.99.g0049dbdd-3.el8.x86_64

$ 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
[core@cosa-devsh test]$ sudo rpm-ostree compose commit --repo=build-repo manifest.yaml ./sysroot/rootfs

[core@cosa-devsh test]$ ostree --repo=build-repo ls foo /usr/bin/bash
-00755 0 0 1390064 /usr/bin/bash
[core@cosa-devsh test]$ ostree --repo=build-repo ls foo /usr/share/rpm-ostree-composetest-split.txt
-00644 0 0      0 /usr/share/rpm-ostree-composetest-split.txt
[core@cosa-devsh test]$ ostree --repo=build-repo ls foo /usr/share/.ostree-wh.foowhiteout
-00000 0 0      0 /usr/share/.ostree-wh.foowhiteout

Comment 2 HuijingHei 2022-10-21 13:31:22 UTC
Set status to Verified: Tested according to comment 1

Comment 8 HuijingHei 2022-10-28 07:57:28 UTC
Verify passed with rpm-ostree-2022.10.99.g0049dbdd-3.el8.x86_64 on RHCOS 412.86.202210280001-0

Comment 10 errata-xmlrpc 2023-05-16 08:24:00 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/RHBA-2023:2759