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

unixtools.modprobe: fix #38860

Merged
merged 1 commit into from Apr 12, 2018
Merged

unixtools.modprobe: fix #38860

merged 1 commit into from Apr 12, 2018

Conversation

pbogdan
Copy link
Member

@pbogdan pbogdan commented Apr 12, 2018

Motivation for this change

There's no modprobe in utillinux.

/cc @matthewbauer

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

@dezgeg
Copy link
Contributor

dezgeg commented Apr 12, 2018

Isn't modprobe a Linux-specific binary anyways? It shouldn't need any abstraction.

@matthewbauer matthewbauer merged commit 55e6561 into NixOS:master Apr 12, 2018
@matthewbauer
Copy link
Member

Thanks!

@matthewbauer
Copy link
Member

matthewbauer commented Apr 12, 2018

@dezgeg

Isn't modprobe a Linux-specific binary anyways? It shouldn't need any abstraction

Right now that's mostly true. It is still useful for shell scripts, etc. that only need "modprobe" or other tools. Also, most people don't know that "kmod" provides userspace modprobe - so having it here is an easy way for users to fix "modprobe not found" errors. Definitely will wait before these commands make sense tree wide.

@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: unixtools.modprobe

Partial log (click to expand)

these derivations will be built:
  /nix/store/pbnv94ssxyk6kb9hgbgxdghji190cfsk-modprobe.drv
building path(s) ‘/nix/store/h91p1774xsmcqramrrrrscwn4mv51yv2-modprobe’
/nix/store/h91p1774xsmcqramrrrrscwn4mv51yv2-modprobe

@7c6f434c
Copy link
Member

I think adding Linux-only commands to unixtools somewhat defeats the purpose of unixtools: it becomes easy again to write something Linux-only without explicitly specifying it.

@GrahamcOfBorg
Copy link

Success on aarch64-linux (full log)

Attempted: unixtools.modprobe

Partial log (click to expand)

these derivations will be built:
  /nix/store/58rjik2ykcryldb4m2f9l4xxjqfi5gvi-modprobe.drv
building '/nix/store/58rjik2ykcryldb4m2f9l4xxjqfi5gvi-modprobe.drv'...
/nix/store/8dnpl9z79ljjbn56qg2b4qja64rf8l54-modprobe

@matthewbauer
Copy link
Member

matthewbauer commented Apr 12, 2018

I somewhat agree- although there are some binaries where it's not exactly clear if they are truly Linux-only. For instance, all of these only have Linux versions:

  • eject
  • logger
  • modprobe
  • mount
  • umount
  • wall

I think modprobe is the only one that is truly Linux only.

@7c6f434c
Copy link
Member

And of course modprobe also has analogs on other platforms.

But what is the point of having unixtools at all? I thought the idea was precisely to make the scripts that fail on other unix platforms break on linux in the same way,

@matthewbauer
Copy link
Member

matthewbauer commented Apr 12, 2018

I guess the main point of unixtools is to just provide Unix-standardized tools that should be available in every Unixy platform. Mostly, I want to get rid of all of the if stdenv.isDarwin then darwin.x else utillinux stuff.

Right now, everything in Linux should stay the same. "utillinux", "nettools", and "procps" will have all of the binaries they have always had (in Linux at least- Darwin uses unixtools versions) . Eventually I want to break some of these scripts, but the initial PR was just to provide the above. I was probably too quick in adding modprobe. I didn't realize that Linux was the only system that had it.

@7c6f434c
Copy link
Member

7c6f434c commented Apr 12, 2018 via email

@matthewbauer
Copy link
Member

matthewbauer commented Apr 12, 2018

Interestingly, autofs had always taken modprobe from utillinux: 3e84cbc

@dezgeg
Copy link
Contributor

dezgeg commented Apr 12, 2018

logger, mount, umount and wall are all specified in POSIX, so I'm pretty certain there will be other implementations of those :).

@7c6f434c
Copy link
Member

Which is why it is bad to add them to unixtools but only in Linux flavour: it is easy to assume that referring to them doesn't hurt portability…

@pbogdan pbogdan deleted the unixtools-modprobe branch December 3, 2019 17:17
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

5 participants