-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
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
Add OverlayFs Multiple lower layers support #118573
base: master
Are you sure you want to change the base?
Conversation
I marked this as stale due to inactivity. → More info |
This commit is really simple to review |
I have no knowledge of overlayfs. While it may be simple to review the contents of the change, it's not as simple to verify functionality. Do we have an overlayfs test in NixOS? If not, maybe it would be a good idea to write one? (Otherwise, a simple but explicit "I ran this and it works fine" would satisfy me, at least.) |
I'm missing a test, an example configuration or scenario to test this. |
One scenario is a cluster where the nodes are booting from the network with the base system being in ramdisk and an nfs shared nix store is added (this additional layer revealed this issue). |
Can a NixOS test be added to this so we can merge it? |
Motivation for this change
OverlayFs Multiple lower layers is incorrectly addressed by the prefixing (add /mnt-root) step in stage-1-init.sh:
Things done
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
./result/bin/
)nix path-info -S
before and after)OverlayFs Multiple lower layers is incorrectly addressed by the prefixing (add /mnt-root) step in stage-1-init.sh:
Example:
optionsFiltered=lowerdir=/mnt1:/mnt2,upperdir=/mnt3,workdir=/mnt4
Actual prefix command (in nixos/modules/system/boot/stage-1-init.sh:):
echo "$optionsFiltered" | sed -E 's#\<(lowerdir|upperdir|workdir)=#\1=/mnt-root#g'
Obtained WRONG prefix:
lowerdir=/mnt-root/mnt1:/mnt2:/mnt3,upperdir=/mnt-root/mnt3,workdir=/mnt-root/mnt4
Proposed prefix command:
echo "$optionsFiltered" | sed -E 's#\<(lowerdir|upperdir|workdir)=#\1=/mnt-root#g; s#:#:/mnt-root#g'
Correct and EXPECTED prefix
lowerdir=/mnt-root/mnt1:/mnt-root/mnt2:/mnt-root/mnt3,upperdir=/mnt-root/mnt3,workdir=/mnt-root/mnt4
Added
if [ "$fsType" = overlay ]
to guard this prefixing step@FRidh I'll apprecitate your opinion/review