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

cloud-utils: fix build recipe #28007

Closed
wants to merge 1 commit into from

Conversation

alexandergall
Copy link
Contributor

Motivation for this change

The substitutions of sed and awk are unnecessary. The symlink for
gnused is actually broken. This has also been discussed in #23024.

Things done

Please check what applies. Note that these are not hard requirements but merely serve as information for reviewers.

  • Tested using sandboxing
    (nix.useSandbox on NixOS,
    or option build-use-sandbox in nix.conf
    on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • Linux
  • 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 nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

The substitutions of sed and awk are unnecessary.  The symlink for
gnused is actually broken.
@mention-bot
Copy link

@alexandergall, thanks for your PR! By analyzing the history of the files in this pull request, we identified @domenkozar and @dezgeg to be potential reviewers.

@domenkozar
Copy link
Member

Have you tried making an initrd with this? Afaik it can not depend on external nix store paths except $out

@alexandergall
Copy link
Contributor Author

My understanding was that with the current cloud-init, growpart is not intended to be run from initrd. IIRC, that was necessary up to kernel 3.8. So, unless it is expected to work for old kernels, this should be a non-issue, but I admit that I don't know whether that's the case or whether this version of growpart actually still supports that method.

@alexandergall
Copy link
Contributor Author

Note that this fix is required for #28008, which has already been merged. How can I progress this PR?

@domenkozar
Copy link
Member

It gets called from https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/virtualisation/grow-partition.nix#L36 if you are have autoResize option turned on for a filesystem.

I still think it's needed there, so we should fix the symlink if it's broken.

@alexandergall
Copy link
Contributor Author

This stuff is pretty convoluted :/ But I think this patch is still fine. The module you refer to arranges that all dependencies are copied to the bin directory for the extra-utils in the initrd. It explicitly copies the original growpart, not the one with the wrapper from the cloud-utils package. So, the $out/bin I have removed here doesn't matter for the grow-partition.nix module.

The symlink is clearly not needed here (and broken for this package) and neither is it needed for growpart to work in grow-partition.nix.

Am I missing something?

@domenkozar
Copy link
Member

domenkozar commented Aug 22, 2017

To me it seems that the growpart is patched before the wrapper is made. So it uses the unwrapped patched growpart.

But I agree that full Nix paths should be used in the package and then sed-ed out for the initrd.

A good way to test is to run $ nix-build nixos/tests/ec2.nix -A boot-ec2-nixops

@alexandergall
Copy link
Contributor Author

What I'm trying to say is that the patching of growpart seems utterly pointless. The gnused package only contains the command sed and the gawk package contains gawk as well as awk (as a symlink), so the original growpart is perfectly fine as a regular package and also as part of the initrd, because the same dependencies are present there. I don't understand the purpose of the de-tour via gnused, which is not in the gnused package. Maybe this is a relic of the past?

So, no sed-ing and sym-linking is necessary in either case (at least not for growpart).

I ran that test and growpart completes without error

...
machine# NOCHANGE: partition 1 is size 20969439. it cannot be grown
...

At that point, it has used both, sed and awk AFAICT.

@alexandergall
Copy link
Contributor Author

Is that sufficient? I don't know what the expected result of the test is.

@alexandergall
Copy link
Contributor Author

Can you please advise how to proceed? I would really like to get this into 17.09.

@domenkozar
Copy link
Member

domenkozar commented Sep 26, 2017

@alexandergall mostly because my lack of time. I'll help you get it to 17.09. Sorry!

@domenkozar
Copy link
Member

@alexandergall I'll check over the weekend.

@domenkozar
Copy link
Member

@alexandergall this is now supedseeded by #30018 - does it look ok to you?

@alexandergall
Copy link
Contributor Author

@domenkozar yes, that solves my issue. This PR can be closed. Thanks.

@domenkozar
Copy link
Member

Sorry for taking so long :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants