centos-bootc icon indicating copy to clipboard operation
centos-bootc copied to clipboard

`dnf -y install rootfiles` fails

Open cgwalters opened this issue 2 years ago • 10 comments

$ podman run --rm -ti quay.io/centos-bootc/centos-bootc:stream9 dnf -y install rootfiles
...
  Installing       : rootfiles-8.1-31.el9.noarch                                                                                                                                                                                                                                       1/1 
error: failed to open dir root of /root/: File exists

One can work around this right now with a RUN mkdir -p /var/roothome; but we should try to fix that package to use systemd-tmpfiles instead probably.

cgwalters avatar Jan 24 '24 00:01 cgwalters

this happened to me too when also running rpm-ostree compose image with a yaml for a base image

runcom avatar Jan 24 '24 08:01 runcom

https://bugzilla.redhat.com/show_bug.cgi?id=2260104

rhatdan avatar Jan 24 '24 13:01 rhatdan

Do we have a specific location where this content should exists? /usr/rootskel?

rhatdan avatar Jan 24 '24 13:01 rhatdan

/etc/rootskel

rhatdan avatar Jan 24 '24 13:01 rhatdan

I think it'd be better to use tmpfiles.d snippets to write these instead.

cgwalters avatar Jan 24 '24 15:01 cgwalters

Here is what I have so far:

rootfiles.patch

rhatdan avatar Jan 24 '24 16:01 rhatdan

Looks ok to me

cgwalters avatar Jan 24 '24 22:01 cgwalters

Will see what maintainer says.

rhatdan avatar Jan 24 '24 22:01 rhatdan

Still seeing this in Rawhide and F40, was able to get past it with the work around.

It looks like the patch got stalled , I'll ping on the bug

pcdubs avatar Apr 24 '24 13:04 pcdubs

It's so complicated and messy because in practice, we don't run systemd-tmpfiles in container builds, so anyone who wants to write to e.g. /root/.ssh will end up needing to make /var/roothome too.

I've concluded the real fix is to pre-create that directory in /var even without systemd-tmpfiles...which hits the same issue as https://github.com/CentOS/centos-bootc/issues/354#issuecomment-2012979516

And with e.g. https://gitlab.com/bootc-org/fedora-bootc/base-images-experimental we don't need to depend on any changes to rpm-ostree for anything, we can just...RUN mkdir -m 0700 /var/roothome after the tmpfiles.d generation if we want.

cgwalters avatar Apr 24 '24 13:04 cgwalters