RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 2134629 - backport support for embedded container whiteouts
Summary: backport support for embedded container whiteouts
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: ostree
Version: 8.7
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Colin Walters
QA Contact: HuijingHei
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-10-13 19:45 UTC by Colin Walters
Modified: 2023-05-16 09:23 UTC (History)
2 users (show)

Fixed In Version: ostree-2022.2-6.el8
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2023-05-16 08:26:47 UTC
Type: Bug
Target Upstream Version:
Embargoed:
pm-rhel: mirror+


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker RHELPLAN-136440 0 None None None 2022-10-13 19:53:49 UTC
Red Hat Product Errata RHBA-2023:2774 0 None None None 2023-05-16 08:26:48 UTC

Description Colin Walters 2022-10-13 19:45:45 UTC
Backport https://github.com/ostreedev/ostree/pull/2717 for Microshift enablement.

Comment 1 HuijingHei 2022-10-17 13:21:21 UTC
Test with ostree-2022.2-6.el8.x86_64, the result is the same as https://github.com/ostreedev/ostree/issues/2712, not sure my steps are correct, could you help to confirm? Thanks!

[core@cosa-devsh ~]$ rpm -q ostree
ostree-2022.2-6.el8.x86_64

[core@cosa-devsh ~]$ rm -rf rootfs test
[core@cosa-devsh ~]$ ostree --repo=./test init --mode=bare-user
[core@cosa-devsh ~]$ mkdir rootfs
[core@cosa-devsh ~]$ mknod -m 0 rootfs/whiteout c 0 0
[core@cosa-devsh ~]$ ostree commit --repo=./test ./rootfs --branch test/stable/x86_64
error: Not a regular file or symlink: whiteout

Comment 2 HuijingHei 2022-10-18 14:30:42 UTC
Look more about https://github.com/ostreedev/ostree/pull/2717, do the testing like following, any suggestions are appreciated, thanks!

1) Upgrade ostree to fixed version
$ sudo rpm-ostree override replace ostree-2022.2-6.el8.x86_64.rpm ostree-grub2-2022.2-6.el8.x86_64.rpm ostree-libs-2022.2-6.el8.x86_64.rpm

$ sudo rpm-ostree ex apply-live --allow-replacement
$ rpm -q ostree
ostree-2022.2-6.el8.x86_64


2) Prepare repo with whiteout files
$rm -rf *
$mkdir -p test/usr/container/layers/abcd

$touch test/usr/container/layers/abcd/.ostree-wh.whiteout
$chmod 400 test/usr/container/layers/abcd/.ostree-wh.whiteout

$touch test/usr/container/layers/abcd/.ostree-wh.whiteout2
$chmod 777 test/usr/container/layers/abcd/.ostree-wh.whiteout2

$ostree --repo=test-repo init --mode=archive
$ostree --repo=test-repo commit --branch=foo test


3) Run checkout with `--process-passthrough-whiteouts` option and check whiteout files are character device with 0/0 device number
[core@cosa-devsh ~]$ ostree --repo=test-repo checkout --process-passthrough-whiteouts foo checkout-repo/
[core@cosa-devsh ~]$ ls checkout-repo/usr/container/layers/abcd/ -alh
total 0
drwxrwxr-x. 2 core core   39 Jan  1  1970 .
drwxrwxr-x. 3 core core   18 Jan  1  1970 ..
cr--------. 1 core core 0, 0 Oct 18 14:23 whiteout
crwxrwxrwx. 1 core core 0, 0 Oct 18 14:23 whiteout2

Comment 3 Colin Walters 2022-10-18 15:12:38 UTC
Yep, this looks right to me!

Comment 4 HuijingHei 2022-10-19 08:54:17 UTC
Thanks Colin for the confirmation about Comment 2. One silly question, what about Comment 1?

Comment 5 Colin Walters 2022-10-19 13:49:17 UTC
> [core@cosa-devsh ~]$ ostree commit --repo=./test ./rootfs --branch test/stable/x86_64
> error: Not a regular file or symlink: whiteout

Yeah, we for now kind of decided to punt on having "ostree commit" do the right thing automatically here.
So the logic for this lives in rpm-ostree today (but it can live elsewhere too).

Comment 6 HuijingHei 2022-10-19 13:59:32 UTC
Get it, thanks Colin for the confirmation. Set Verified to Tested

Comment 9 HuijingHei 2022-10-25 06:41:59 UTC
Verify passed with ostree-2022.2-6.el8.x86_64

[core@cosa-devsh ~]$ rpm -q ostree
ostree-2022.2-5.el8.x86_64
[core@cosa-devsh ~]$ sudo rpm-ostree override replace ostree-2022.2-6.el8.x86_64.rpm ostree-grub2-2022.2-6.el8.x86_64.rpm ostree-libs-2022.2-6.el8.x86_64.rpm
...
Checking out tree 6420705... done
No enabled rpm-md repositories.
Importing rpm-md... done
Resolving dependencies... done
Applying 3 overrides
Processing packages... done
Running pre scripts... done
Running post scripts... done
Running posttrans scripts... done
Writing rpmdb... done
Writing OSTree commit... done
Staging deployment... done
Upgraded:
  ostree 2022.2-5.el8 -> 2022.2-6.el8
  ostree-grub2 2022.2-5.el8 -> 2022.2-6.el8
  ostree-libs 2022.2-5.el8 -> 2022.2-6.el8
Use "rpm-ostree override reset" to undo overrides
Run "systemctl reboot" to start a reboot
[core@cosa-devsh ~]$ sudo rpm-ostree ex apply-live --allow-replacement
NOTICE: Experimental commands are subject to change.
Computing /etc diff to preserve... done
Updating /usr... done
Updating /etc... done
Running systemd-tmpfiles for /run and /var... done
Upgraded:
  ostree 2022.2-5.el8 -> 2022.2-6.el8
  ostree-grub2 2022.2-5.el8 -> 2022.2-6.el8
  ostree-libs 2022.2-5.el8 -> 2022.2-6.el8
Successfully updated running filesystem tree; some services may need to be restarted.
[core@cosa-devsh ~]$ rpm -q ostree
ostree-2022.2-6.el8.x86_64
[core@cosa-devsh ~]$ mkdir -p test/usr/container/layers/abcd
[core@cosa-devsh ~]$ touch test/usr/container/layers/abcd/.ostree-wh.whiteout
[core@cosa-devsh ~]$ chmod 400 test/usr/container/layers/abcd/.ostree-wh.whiteout
[core@cosa-devsh ~]$ touch test/usr/container/layers/abcd/.ostree-wh.whiteout2
[core@cosa-devsh ~]$ chmod 777 test/usr/container/layers/abcd/.ostree-wh.whiteout2
[core@cosa-devsh ~]$ ostree --repo=test-repo init --mode=archive
[core@cosa-devsh ~]$ ostree --repo=test-repo commit --branch=foo test
4bf43bcc0137d5eb7a9fcd19c4992828762f48a6ce4be0082c8e950162c03f03
[core@cosa-devsh ~]$ ostree --repo=test-repo checkout --process-passthrough-whiteouts foo checkout-repo/
[core@cosa-devsh ~]$ ls checkout-repo/usr/container/layers/abcd/ -alh
total 0
drwxrwxr-x. 2 core core   39 Jan  1  1970 .
drwxrwxr-x. 3 core core   18 Jan  1  1970 ..
cr--------. 1 core core 0, 0 Oct 25 06:39 whiteout
crwxrwxrwx. 1 core core 0, 0 Oct 25 06:39 whiteout2

Comment 12 errata-xmlrpc 2023-05-16 08:26:47 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 (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:2774


Note You need to log in before you can comment on or make changes to this bug.