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

make-disk-image: create directories images in out path #911

Merged
merged 2 commits into from
Dec 13, 2024
Merged

Conversation

Mic92
Copy link
Member

@Mic92 Mic92 commented Dec 5, 2024

In case we are crossing some filesystem boundary (i.e. /tmp -> /nix/store), this is faster. Also tmpfs might be probelemantic regarding memory usage.

@Mic92 Mic92 force-pushed the avoid-mv branch 4 times, most recently from ac22d37 to 3ad3e60 Compare December 5, 2024 07:50
Copy link
Contributor

@iFreilicht iFreilicht left a comment

Choose a reason for hiding this comment

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

I don't quite understand why this is faster, but I'll trust you tried it out. However, changing the output directory should be considered a breaking change, right?
How do we deal with this? I don't want to break people's automation scripts that rely on the disk images being created in the current directory instead of out.

disko-install Outdated Show resolved Hide resolved
@Mic92
Copy link
Member Author

Mic92 commented Dec 5, 2024

If you do a mv across different filesystems, it's actually a copy. It depends a bit on the build machine if this is the case. If both build directory and nix store are on the same FS than it's a cheap operation.

@Mic92
Copy link
Member Author

Mic92 commented Dec 5, 2024

However, changing the output directory should be considered a breaking change, right?

No this change is not visible to the end-user. cfg.extraPostVM was called after the mv happened. And it shouldn't matter what qemu uses at runtime.

Mic92 added 2 commits December 5, 2024 13:05
In case we are crossing some filesystem boundary (i.e. /tmp -> /nix/store),
this is faster. Also tmpfs might be probelemantic regarding memory usage.
since we initialize the database last, it's safe to use the database as
a sentinel path
@Mic92 Mic92 requested a review from Lassulus December 12, 2024 15:38
@Mic92 Mic92 merged commit 825605c into master Dec 13, 2024
3 checks passed
@Mic92 Mic92 deleted the avoid-mv branch December 13, 2024 10:16
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