lttng-tools: use absolute path to modprobe

Instead of relying on it being available in $PATH.
This commit is contained in:
Bjørn Forsman 2014-02-02 13:47:43 +01:00
parent cbb856cb94
commit 662039802a
2 changed files with 5 additions and 55 deletions

View File

@ -1,4 +1,4 @@
{ stdenv, fetchurl, popt, libuuid, liburcu, lttngUst }:
{ stdenv, fetchurl, popt, libuuid, liburcu, lttngUst, kmod }:
stdenv.mkDerivation rec {
name = "lttng-tools-2.3.0";
@ -10,7 +10,10 @@ stdenv.mkDerivation rec {
buildInputs = [ popt libuuid liburcu lttngUst ];
patches = [ ./lttng-change-modprobe-path-from-sbin-modprobe-to-modprobe.patch ];
prePatch = ''
sed -e "s|/sbin/modprobe|${kmod}/sbin/modprobe|g" \
-i src/bin/lttng-sessiond/modprobe.c
'';
meta = with stdenv.lib; {
description = "Tracing tools (kernel + user space) for Linux";

View File

@ -1,53 +0,0 @@
From daba2e936571a236817022b760d91c48b730c30b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bj=C3=B8rn=20Forsman?= <bjorn.forsman@gmail.com>
Date: Tue, 9 Jul 2013 23:47:47 +0200
Subject: [PATCH] Change modprobe path from "/sbin/modprobe" to "modprobe"
(rely on PATH lookup)
---
src/bin/lttng-sessiond/modprobe.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/bin/lttng-sessiond/modprobe.c b/src/bin/lttng-sessiond/modprobe.c
index 7e06dad..4075efe 100644
--- a/src/bin/lttng-sessiond/modprobe.c
+++ b/src/bin/lttng-sessiond/modprobe.c
@@ -90,7 +90,7 @@ void modprobe_remove_lttng_control(void)
for (i = ARRAY_SIZE(kern_modules_control) - 1; i >= 0; i--) {
ret = snprintf(modprobe, sizeof(modprobe),
- "/sbin/modprobe -r -q %s",
+ "modprobe -r -q %s",
kern_modules_control[i].name);
if (ret < 0) {
PERROR("snprintf modprobe -r");
@@ -125,7 +125,7 @@ void modprobe_remove_lttng_data(void)
for (i = ARRAY_SIZE(kern_modules_list) - 1; i >= 0; i--) {
ret = snprintf(modprobe, sizeof(modprobe),
- "/sbin/modprobe -r -q %s",
+ "modprobe -r -q %s",
kern_modules_list[i].name);
if (ret < 0) {
PERROR("snprintf modprobe -r");
@@ -169,7 +169,7 @@ int modprobe_lttng_control(void)
for (i = 0; i < ARRAY_SIZE(kern_modules_control); i++) {
ret = snprintf(modprobe, sizeof(modprobe),
- "/sbin/modprobe %s%s",
+ "modprobe %s%s",
kern_modules_control[i].required ? "" : "-q ",
kern_modules_control[i].name);
if (ret < 0) {
@@ -205,7 +205,7 @@ int modprobe_lttng_data(void)
for (i = 0; i < ARRAY_SIZE(kern_modules_list); i++) {
ret = snprintf(modprobe, sizeof(modprobe),
- "/sbin/modprobe %s%s",
+ "modprobe %s%s",
kern_modules_list[i].required ? "" : "-q ",
kern_modules_list[i].name);
if (ret < 0) {
--
1.8.2.3