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

ofono: load configuration from outside the nix store #109109

Merged
merged 1 commit into from Jan 12, 2021
Merged

Conversation

Mic92
Copy link
Member

@Mic92 Mic92 commented Jan 12, 2021

Motivation for this change
Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • 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 nixpkgs-review --run "nixpkgs-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.

@SuperSandro2000
Copy link
Member

This is a semi-automatic executed nixpkgs-review which does not build all packages (e.g. lumo, tensorflow or pytorch)
If you find some bugs or got suggestions for further things to search or run please reach out to SuperSandro2000 on IRC.

Result of nixpkgs-review pr 109109 run on x86_64-linux 1

2 packages built:
  • modem-manager-gui
  • ofono

@Mic92 Mic92 merged commit 2678743 into NixOS:master Jan 12, 2021
@Mic92 Mic92 deleted the ofono branch January 12, 2021 15:05
@jtojnar
Copy link
Contributor

jtojnar commented Jan 12, 2021

Did someone check ofono works without /etc/ofono/phonesim.conf existing? Sometimes projects crash if they cannot find their configuration file but they work fine when empty file is there.

Also this issue is typically fixed by the following for autotools projects:

configureFlags = [ "--sysconfdir=/etc" ];
installFlags = [ "SYSCONFDIR=${placeholder "out"}/etc" ];

@Mic92
Copy link
Member Author

Mic92 commented Jan 13, 2021

This seems to work fine without configuration: sudo ofonod -n -d

@Mic92
Copy link
Member Author

Mic92 commented Jan 13, 2021

The proposed workaround does not work:

  libtool: install: /nix/store/87ipxqn2ah5ba282cnip9z4mm3dbczjc-coreutils-8.32/bin/install -c src/ofonod /nix/store/16yqn13rld3d2d76f8kxn4jbzp13dlm5-ofono-1.31/sbin/ofonod
   /nix/store/87ipxqn2ah5ba282cnip9z4mm3dbczjc-coreutils-8.32/bin/mkdir -p '/etc/ofono'
  /nix/store/87ipxqn2ah5ba282cnip9z4mm3dbczjc-coreutils-8.32/bin/mkdir: cannot create directory '/etc/ofono': Permission denied
  make[2]: *** [Makefile:4149: install-dist_confDATA] Error 1
  make[1]: *** [Makefile:4777: install-am] Error 2
  make: *** [Makefile:4770: install] Error 2
diff --git a/pkgs/tools/networking/ofono/default.nix b/pkgs/tools/networking/ofono/default.nix
index 5dafb1e5639..289df6e4b6c 100644
--- a/pkgs/tools/networking/ofono/default.nix
+++ b/pkgs/tools/networking/ofono/default.nix
@@ -42,14 +42,12 @@ stdenv.mkDerivation rec {
 
   configureFlags = [
     "--with-dbusconfdir=${placeholder "out"}/share"
+    "--sysconfdir=/etc"
     "--with-systemdunitdir=${placeholder "out"}/lib/systemd/system"
     "--enable-external-ell"
   ];
 
-  postInstall = ''
-    rm -r $out/etc/ofono
-    ln -s /etc/ofono $out/etc/ofono
-  '';
+  installFlags = [ "SYSCONFDIR=${placeholder "out"}/etc" ];
 
   enableParallelBuilding = true;
   enableParallelChecking = false;

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

3 participants