-
-
Notifications
You must be signed in to change notification settings - Fork 177
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: move /etc/ to /usr/etc/ #434
Conversation
This looks good to me but considering the change let's get a few more eyeballs on this. Thanks! |
Looks good to me too. @castrojo I'm good with merging |
these build errors are from the mutter-vrr package, unrelated to this PR |
Containerfile
Outdated
COPY usr/etc/systemd /etc/systemd | ||
COPY usr/etc/yum.repos.d /etc/yum.repos.d |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it be worth keeping both the /etc/
and /usr/
directories in the repo for easier management and understanding?
We're chucking files into /usr/etc
in the repo but that's not where they end up in the image. It could be confusing when debugging issues or referencing this repo for custom images.
Or if the use-case is to store a local readonly copy of these configurations, simply:
COPY usr /usr
COPY etc /etc
COPY etc /usr/etc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the idea of having them in /usr/etc
is that we can reset for a fresh start. So they have to be there for that operation. When you have them in /etc/
in the repo, chances may be that they don't end up in /usr/etc/
.
They are available from that location on boot, but while building the container they are not. That is why I copy them in there explicit.
I have to let you all decide what is best, because I am not comfortable enough to make a good descision on this point. But I appreciate all the feedback. Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Jorge and others are happy with the way you've proposed, so I'm ok with it.
I just wasn't too sure of how this would be used.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe this ostree deployment is where the idea also came from. In cominbation with the config reset to get a fresh start.
Besides the exceptions of /var and /etc then, the rest of the contents of the tree are checked out as hard links into the repository. It’s strongly recommended that operating systems ship all of their content in /usr, but this is not a hard requirement.
But let's see what the others have to say about. Maybe you have a very good point.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since the build is busted anyway, would it help if we document how it should be used? I'm thinking something like "we'll ship the configs in /usr/etc so you have a copy, here's how you override a few of them, like your distrobox.ini, etc?"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe this ostree deployment is where the idea also came from. In cominbation with the config reset to get a fresh start.
I think the more relevant part of the link is: https://ostreedev.github.io/ostree/deployment/#contents-of-a-deployment
The deployment should not have a traditional UNIX /etc; instead, it should include /usr/etc. This is the “default configuration”. When OSTree creates a deployment, it performs a 3-way merge using the old default configuration, the active system’s /etc, and the new default configuration. In the final filesystem tree for a deployment then, /etc is a regular writable directory.
TLDR: The idea of this PR seems good, but after moving files (in repo) from etc
to usr/etc
, I think it's contrary to the goal to copy any files back to /etc/*
during the build.
Specifically I'm referring to lines like:
COPY usr/etc/systemd /etc/systemd
COPY dx/usr/etc/yum.repos.d /etc/yum.repos.d
COPY framework/usr/etc/systemd /etc/systemd
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So maybe after all the best way for now is just leave the repo structure in place and just add a COPY /etc /usr/etc
instead like @p5 suggested? This way we don't have to think which file goes where when doing both /etc
and /usr/etc
at repo level.
Or maybe even ignore this PR all together because it seems that the files we never put in /usr/etc/
at this moment are all there to have the original version of the file. Which was our first reason for doing this if i'm correct.
I'll work on documenting this, holding this until then (or someone else beats me to it). |
I've just noticed that even without this pr there is already a copy of the file in |
OK what am I doing here? Do we have concensus? 😄 I've PR'ed the docs and that's merged. |
I can make some specific requests to change the PR in a way which is compatible with what has been discussed and you put on the website. |
Containerfile
Outdated
COPY usr /usr | ||
COPY usr/etc/systemd /etc/systemd |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove these 2 lines:
COPY usr/etc/systemd /etc/systemd
COPY usr/etc/yum.repos.d /etc/yum.repos.d
Containerfile
Outdated
COPY dx/usr /usr | ||
COPY dx/usr/etc/yum.repos.d /etc/yum.repos.d |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove this line:
COPY dx/usr/etc/yum.repos.d /etc/yum.repos.d
Containerfile
Outdated
COPY framework/usr /usr | ||
COPY framework/usr/etc/systemd /etc/systemd |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove this line:
COPY framework/usr/etc/systemd /etc/systemd
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have 3 comments which are requested changes which should bring things in line with what I believe was discussed and which was published to the website.
Also, this needs to be updated from main branch.
Then I think should be good to go.
Oh boy I think officially messed everything up now. So sorry 😢 I did run a build on my branch and getting build errors after removing those line. That was why the repo file was copied back in.
|
No worries! With git and pull requests, there is rarely an unrecoverable issue. I have a suggestion for the current situation though. Since your PR included moving a lot of files, it's harder to merge in changes made to those files. I suggest making a fresh new fork of I'll try to approve quickly assuming it's what I expect from the last set of comments here. |
I've created a fresh one. Lets continue this PR in #441 |
Fixes #428
This moves all the
/etc/
directories to their corresponding/usr/etc
directory. We still need copy back a few files to make the builds work. Like systemd service files or repo files.I hope this is the correct approach.