-
Notifications
You must be signed in to change notification settings - Fork 11
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
Recreate /var #143
Recreate /var #143
Conversation
This is a draft because the build now fails later on while running
|
5973ac8
to
aaa5698
Compare
Alright after creating a load of random files I now get this far:
|
Since a8d0732 we create the buildroot with ostree, not mmdebstrap. https://phabricator.endlessm.com/T4482
aaa5698
to
0172f66
Compare
This is effectively the same change as https://github.com/endlessm/eos-container-builder/pull/26 |
# update-catalog requires /var/lib/sgml-base to exist | ||
os.makedirs(os.path.join(self.builddir, 'var/lib/sgml-base')) | ||
|
||
# update-xmlcatalog requires /var/lib/xml-core to exist | ||
os.makedirs(os.path.join(self.builddir, 'var/lib/xml-core')) |
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.
The comment in run-build
seems prescient:
# Pull the ostree. Ideally the eosminbase ostree would be used to
# minimize the buildroot, but that's not released and would fail with
# --use-production-ostree.
These packages are not part of eosminbase; so I believe these steps would not be necessary if we used that for the buildroot.
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.
Actually I have a vague memory of seeing errors from sgml-base
in my toolboxes.
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.
Are the errors fatal? Ideally those would have tmpfiles snippets so we didn't need to do anything like this. Or the scripts would, you know, attempt to create the directories instead of assuming they exist? But meh, this is fine.
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.
Yeah, unfortunately they are fatal, and a trigger failing is in turn fatal to the apt-get install
invocation.
I agree that ideally they would have tmpfiles snippets – though I think the Way of the Future in OSTree is to put it in /usr/share/factory
or whatever it's called?
0172f66
to
b3059c0
Compare
We recently merged a change to completely wipe `/var` in the ostree, replacing it with an empty directory. This is because on a real system, `/var` from the ostree is not used: instead a persistent, read-write directory is mounted over it. It turns out that `apt update` is happy to create its own directory hierarchy below `/var/lib`, but if that directory does not exist it fails with: E: List directory /var/lib/apt/lists/partial is missing. - Acquire (2: No such file or directory) Similarly, installing packages requires /var/lib/dpkg to exist, but we have moved this to /usr E: Could not open lock file /var/lib/dpkg/lock-frontend - open (2: No such file or directory) E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), are you root? On a real Endless OS system, `/var/lib` is initialised at boot by `systemd-tmpfiles`. Do the same here. Move the dpkg database back to its rightful home. Remove the tmpfiles snippet that eos-ostree-builder adds to deal with the changes we are undoing. https://phabricator.endlessm.com/T4482
Installing an sgml catalog causes update-catalog to be run. This Perl script requires var/lib/sgml-base to exist. This directory is part of the sgml-base package but of course is deleted with the rest of /var. https://phabricator.endlessm.com/T4482
Installing, I guess, an XML DTD causes update-xmlcatalog to be run. This Perl script requires `/var/lib/xml-core` to exist. This directory is part of the `xml-core` package but of course is deleted with the rest of `/var`. https://phabricator.endlessm.com/T4482
b3059c0
to
e38381b
Compare
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.
Thanks for this. I did not anticipate this fallout even though I should have since I worked through it in the container builder and this is basically the same thing.
A future improvement would be to actually use the containers instead of bespoke chroot
setups. Then the container builder would be the one place where you'd do the conversion from immutable OS to mutable OS.
# update-catalog requires /var/lib/sgml-base to exist | ||
os.makedirs(os.path.join(self.builddir, 'var/lib/sgml-base')) | ||
|
||
# update-xmlcatalog requires /var/lib/xml-core to exist | ||
os.makedirs(os.path.join(self.builddir, 'var/lib/xml-core')) |
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.
Are the errors fatal? Ideally those would have tmpfiles snippets so we didn't need to do anything like this. Or the scripts would, you know, attempt to create the directories instead of assuming they exist? But meh, this is fine.
That would indeed be good! |
Sadly https://github.com/endlessm/eos-ostree-builder/pull/189 broke the image builder, because we create the buildroot by deploying an ostree, and the various things that set up
/var
on a fresh system are not all done here.https://phabricator.endlessm.com/T4482