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

sdImage: add option to enable bzip2 compression #69865

Merged
merged 1 commit into from Sep 30, 2019

Conversation

AmineChikhaoui
Copy link
Member

@AmineChikhaoui AmineChikhaoui commented Sep 28, 2019

Fixes issues with output size such as: https://hydra.nixos.org/build/102163603

Motivation for this change
Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nix-review --run "nix-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.
Notify maintainers

cc @

Copy link
Member

@samueldr samueldr left a comment

Choose a reason for hiding this comment

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

Thanks for the contribution! Good execution, minor things:

I think we may as well default to compressing the image. The existing images are already close to hitting the limits.

Without compression:

-r--r--r-- 1 root root 2.0G Jan  1  1970 nixos-sd-image-20.03pre56789.gfedcba-aarch64-linux.img

With compression:

-r--r--r-- 1 root root 552M Jan  1  1970 nixos-sd-image-20.03pre56789.gfedcba-aarch64-linux.img.bz2

This will not only give us some headroom, this may also reduce the download time. I say "may" since I figure there may be compression going on when you download it already, I'm not sure.

In addition, always compressing will make it less confusing to provide instructions. Instead of "uncompress if it's compress", you could easily have the instructions be bzcat *.img.bz2 | dd of=$device. This will also reduce space consumption for end-users; at the cost of some CPU computations.

Finally, I figure that since we're changing the images to always compress, a simple release note addition would be warranted here. Just something stating that the sd images are now compressed.

Thanks!

Tasks

A recap:

  • Always compress by default
  • Release note stating we always compress by default

also make SD image compression the default setup.
Fixes issues with output size such as: https://hydra.nixos.org/build/102163603
@AmineChikhaoui
Copy link
Member Author

@samueldr Thanks sounds good. I pushed the requested changes, let me know if I need to change the wording of the release notes ;)

@samueldr
Copy link
Member

I don't think we need to backport this; 19.09 has, I think, around 200MiB of headroom. It's unlikely to receive changes using up the slack.

In the event that it does, and that it's not an error, then I guess we may as well backport it. The only reason not to backport it is that it's not a needed change.

@samueldr samueldr merged commit ece3eba into NixOS:master Sep 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
NixOS on ARM
Awaiting triage
Development

Successfully merging this pull request may close these issues.

None yet

2 participants