Skip to content
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

mnt fixes #214

Merged
merged 3 commits into from
Nov 21, 2023
Merged

mnt fixes #214

merged 3 commits into from
Nov 21, 2023

Conversation

wkz
Copy link
Contributor

@wkz wkz commented Nov 20, 2023

No description provided.

wkz added 3 commits November 20, 2023 23:29
Before this change, the following would happen in /lib/infix/mnt if a
factory-reset was performed:

1. Copy the contents of /var from Squash into /mnt/var and bind mount
   /mnt/var over /var
2. Check for factory-reset
3. Clear /mnt/cfg/* and /mnt/var/*
4. Mount overlays

This ordering leaves the system with a completely empty /var on the
boot when a factory-reset is executed. Finit will fixup some of this
via its tmpfiles scripts, but we want the ability to ship files under
/var as part of the Squash and have these be available after the bind
mount, just like what happens at every other boot, when we don't
perform a factory-reset.

We solve this by delaying the bind mount (1) until after the reset has
been performed, together with all the overlays (4). While we're here,
make the fallback case, where no persistent /var is available, use a
bind mount as well. This should allow containers to be tested on such
setups, and it's one less flavor to test.

New order:

1. Check for factory-reset
2. Clear /mnt/cfg/* and /mnt/var/*
3. Mount overlays
4. Copy the contents of /var from Squash into /mnt/var and bind mount
   /mnt/var over /var

Now the only difference between a regular boot and a
"factory-reset-boot" is whether (2) executed or not.
@wkz wkz requested a review from troglobit November 20, 2023 22:38
Copy link
Contributor

@troglobit troglobit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work, this change also makes it more readable! 👍

(Had to go to the office, have some coffee, then it was much easier to understand this :-)

@troglobit troglobit merged commit 7e7d25d into main Nov 21, 2023
2 checks passed
@troglobit troglobit deleted the mnt-fixes branch November 21, 2023 07:05
@troglobit troglobit added this to the Infix v23.11 milestone Nov 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants