From 676d91998d2e43a2dcf74a655ef1481fd1e38c92 Mon Sep 17 00:00:00 2001 From: positiveEV <50848762+positiveEV@users.noreply.github.com> Date: Wed, 1 Jan 2025 16:30:21 +0100 Subject: [PATCH] ovn: fix missing scripts and wrong paths Add missing ovs-appctl and ovs-vsctl scripts used by ovn-ctl. ovs-ctl is looking for ${bindir}/ovs-appctl but I did not find a configure flag for bindir and sbindir in OVS, which default to /usr/local/{bin,sbin}, so I fixed it with sed. We need to set the --with-dbdir configure flag so that ovn_dbdir does not default to ${ pkgs.ovn }/etc/ovn and is not in the Nix store, as ovn_dbdir contains stateful information. "--enable-ssl" is the default if I did not misread the autoconf files, but it does not hurt to add it. --- pkgs/by-name/ov/ovn/package.nix | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/pkgs/by-name/ov/ovn/package.nix b/pkgs/by-name/ov/ovn/package.nix index 2f8512778db7..627a62f85d53 100644 --- a/pkgs/by-name/ov/ovn/package.nix +++ b/pkgs/by-name/ov/ovn/package.nix @@ -52,7 +52,11 @@ stdenv.mkDerivation rec { popd ''; - configureFlags = [ "--localstatedir=/var" ]; + configureFlags = [ + "--localstatedir=/var" + "--with-dbdir=/var/lib/ovn" + "--enable-ssl" + ]; enableParallelBuilding = true; @@ -66,7 +70,13 @@ stdenv.mkDerivation rec { postInstall = '' mkdir -vp $out/share/openvswitch/scripts + mkdir -vp $out/etc/ovn + cp ovs/utilities/ovs-appctl $out/share/openvswitch/scripts + cp ovs/utilities/ovs-vsctl $out/share/openvswitch/scripts cp ovs/utilities/ovs-lib $out/share/openvswitch/scripts + sed -i "s#/usr/local/bin#$out/share/openvswitch/scripts#g" $out/share/openvswitch/scripts/ovs-lib + sed -i "s#/usr/local/sbin#$out/share/openvswitch/scripts#g" $out/share/openvswitch/scripts/ovs-lib + sed -i '/chown -R $INSTALL_USER:$INSTALL_GROUP $ovn_etcdir/d' $out/share/ovn/scripts/ovn-ctl ''; # https://docs.ovn.org/en/latest/topics/testing.html