-
-
Notifications
You must be signed in to change notification settings - Fork 120
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
The new tarballBuilder trap fails when trying to remove /var/empty
.
#337
Labels
bug
Something isn't working
Comments
I got it working like this: diff --git a/modules/build-tarball.nix b/modules/build-tarball.nix
index 8341f7f..4cdd3e5 100644
--- a/modules/build-tarball.nix
+++ b/modules/build-tarball.nix
@@ -64,7 +64,7 @@ in
root=$(mktemp -p "''${TMPDIR:-/tmp}" -d nixos-wsl-tarball.XXXXXXXXXX)
# FIXME: fails in CI for some reason, but we don't really care because it's CI
- trap 'rm -rf "$root" || true' INT TERM EXIT
+ trap 'chattr -Rf -i "$root" || true && rm -rf "$root" || true' INT TERM EXIT
chmod o+rx "$root" or diff --git a/modules/build-tarball.nix b/modules/build-tarball.nix
index 8341f7f..3d787ab 100644
--- a/modules/build-tarball.nix
+++ b/modules/build-tarball.nix
@@ -64,7 +64,7 @@ in
root=$(mktemp -p "''${TMPDIR:-/tmp}" -d nixos-wsl-tarball.XXXXXXXXXX)
# FIXME: fails in CI for some reason, but we don't really care because it's CI
- trap 'rm -rf "$root" || true' INT TERM EXIT
+ trap 'chattr -i "$root/var/empty" || true && rm -rf "$root" || true' INT TERM EXIT
chmod o+rx "$root" |
Can you make this, as well as #338 into a PR? |
Sure, I will do |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Bug description
I recently tried migrating over to the new
tarballBuilder
. However when I try to execute the script I get the following error:Apparently that folder is marked as immutable, even preventing root from removing it, however it can be solved by:
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Not failing on the trap after script execution.
Logs
...
installing the boot loader...
setting up /etc...
setting up /bin...
setting up /bin/login...
setting up /sbin/init shim...
installation finished!
[NixOS-WSL] Adding channel...
setting up /etc...
setting up /bin...
setting up /bin/login...
setting up /sbin/init shim...
[NixOS-WSL] Adding default config...
[NixOS-WSL] Compressing...
rm: cannot remove '/tmp/nixos-wsl-tarball.xXcwgyysE7/var/empty': Operation not permitted
The text was updated successfully, but these errors were encountered: