From 8c092a1940272f31246929ab42c2296920f14f5b Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Tue, 11 Mar 2008 16:50:53 +0000 Subject: [PATCH] * Support setting the path to smbd (we can't put it in /usr/sbin/smbd on NixOS). svn path=/nixpkgs/trunk/; revision=11061 --- pkgs/os-specific/linux/kvm/57.nix | 5 +++++ pkgs/os-specific/linux/kvm/smbd-path.patch | 26 ++++++++++++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 pkgs/os-specific/linux/kvm/smbd-path.patch diff --git a/pkgs/os-specific/linux/kvm/57.nix b/pkgs/os-specific/linux/kvm/57.nix index 8b25a9a6ae3..ccbd2d353b1 100644 --- a/pkgs/os-specific/linux/kvm/57.nix +++ b/pkgs/os-specific/linux/kvm/57.nix @@ -10,6 +10,11 @@ stdenv.mkDerivation { sha256 = "016h5pf59fyz7skzsaprii2mdpxpb8hfnnr1w475qcfyy6ccr9r0"; }; + patches = [ + # Allow setting the path to Samba through $QEMU_SMBD_COMMAND. + ./smbd-path.patch + ]; + configureFlags = "--with-patched-kernel --kerneldir=${kernelHeaders}"; # e2fsprogs is needed for libuuid. diff --git a/pkgs/os-specific/linux/kvm/smbd-path.patch b/pkgs/os-specific/linux/kvm/smbd-path.patch new file mode 100644 index 00000000000..45e9a4bacce --- /dev/null +++ b/pkgs/os-specific/linux/kvm/smbd-path.patch @@ -0,0 +1,26 @@ +diff -rc kvm-57-orig/qemu/vl.c kvm-57/qemu/vl.c +*** kvm-57-orig/qemu/vl.c 2007-12-18 16:57:46.000000000 +0100 +--- kvm-57/qemu/vl.c 2008-03-11 16:17:26.000000000 +0100 +*************** +*** 3865,3872 **** + fclose(f); + atexit(smb_exit); + + snprintf(smb_cmdline, sizeof(smb_cmdline), "%s -s %s", +! SMBD_COMMAND, smb_conf); + + slirp_add_exec(0, smb_cmdline, 4, 139); + } +--- 3865,3875 ---- + fclose(f); + atexit(smb_exit); + ++ char *smbd_command = getenv("QEMU_SMBD_COMMAND"); ++ if (!smbd_command) smbd_command = SMBD_COMMAND; ++ + snprintf(smb_cmdline, sizeof(smb_cmdline), "%s -s %s", +! smbd_command, smb_conf); + + slirp_add_exec(0, smb_cmdline, 4, 139); + } +Only in kvm-57/qemu: vl.c~