uboot: (firmwareOdroidC2/C4) don't invoke patch tool, use patches = [] instead

https://github.com/NixOS/nixpkgs/blob/master/pkgs/stdenv/generic/setup.sh#L948
this can do it nicely.

Signed-off-by: Anton Arapov <anton@deadbeef.mx>
This commit is contained in:
Anton Arapov 2021-04-03 12:58:10 +02:00 committed by Alan Daniels
commit 56de2bcd43
30691 changed files with 3076956 additions and 0 deletions

View file

@ -0,0 +1,43 @@
From 01e793163231c5085afced37471df32b94a313f5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= <joerg@thalheim.io>
Date: Thu, 30 Dec 2021 06:34:41 +0100
Subject: [PATCH] absolute ausyscall
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Signed-off-by: Jörg Thalheim <joerg@thalheim.io>
---
libbpf-tools/syscall_helpers.c | 2 +-
src/python/bcc/syscall.py | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/libbpf-tools/syscall_helpers.c b/libbpf-tools/syscall_helpers.c
index e114a08f..62adea78 100644
--- a/libbpf-tools/syscall_helpers.c
+++ b/libbpf-tools/syscall_helpers.c
@@ -47,7 +47,7 @@ void init_syscall_names(void)
int err;
FILE *f;
- f = popen("ausyscall --dump 2>/dev/null", "r");
+ f = popen("@ausyscall@ --dump 2>/dev/null", "r");
if (!f) {
warn("popen: ausyscall --dump: %s\n", strerror(errno));
return;
diff --git a/src/python/bcc/syscall.py b/src/python/bcc/syscall.py
index 1346b4e8..e7e29a11 100644
--- a/src/python/bcc/syscall.py
+++ b/src/python/bcc/syscall.py
@@ -376,7 +376,7 @@ def _parse_syscall(line):
try:
# Skip the first line, which is a header. The rest of the lines are simply
# SYSCALL_NUM\tSYSCALL_NAME pairs.
- out = subprocess.check_output(['ausyscall', '--dump'], stderr=subprocess.STDOUT)
+ out = subprocess.check_output(['@ausyscall@', '--dump'], stderr=subprocess.STDOUT)
# remove the first line of expected output
out = out.split(b'\n',1)[1]
syscalls = dict(map(_parse_syscall, out.strip().split(b'\n')))
--
2.34.0

View file

@ -0,0 +1,90 @@
{ lib, stdenv, fetchFromGitHub
, makeWrapper, cmake, llvmPackages
, flex, bison, elfutils, python, luajit, netperf, iperf, libelf
, bash, libbpf, nixosTests
, audit
}:
python.pkgs.buildPythonApplication rec {
pname = "bcc";
version = "0.24.0";
disabled = !stdenv.isLinux;
src = fetchFromGitHub {
owner = "iovisor";
repo = "bcc";
rev = "v${version}";
sha256 = "sha256-5Nq6LmphiyiiIyru/P2rCCmA25cwJIWn08oK1+eM3cQ=";
};
format = "other";
buildInputs = with llvmPackages; [
llvm llvm.dev libclang
elfutils luajit netperf iperf
flex bash libbpf
];
patches = [
# This is needed until we fix
# https://github.com/NixOS/nixpkgs/issues/40427
./fix-deadlock-detector-import.patch
];
propagatedBuildInputs = [ python.pkgs.netaddr ];
nativeBuildInputs = [ makeWrapper cmake flex bison llvmPackages.llvm.dev ];
cmakeFlags = [
"-DBCC_KERNEL_MODULES_DIR=/run/booted-system/kernel-modules/lib/modules"
"-DREVISION=${version}"
"-DENABLE_USDT=ON"
"-DENABLE_CPP_API=ON"
"-DCMAKE_USE_LIBBPF_PACKAGE=ON"
];
# to replace this executable path:
# https://github.com/iovisor/bcc/blob/master/src/python/bcc/syscall.py#L384
ausyscall = "${audit}/bin/ausyscall";
postPatch = ''
substituteAll ${./libbcc-path.patch} ./libbcc-path.patch
patch -p1 < libbcc-path.patch
substituteAll ${./absolute-ausyscall.patch} ./absolute-ausyscall.patch
patch -p1 < absolute-ausyscall.patch
'';
postInstall = ''
mkdir -p $out/bin $out/share
rm -r $out/share/bcc/tools/old
mv $out/share/bcc/tools/doc $out/share
mv $out/share/bcc/man $out/share/
find $out/share/bcc/tools -type f -executable -print0 | \
while IFS= read -r -d ''$'\0' f; do
bin=$out/bin/$(basename $f)
if [ ! -e $bin ]; then
ln -s $f $bin
fi
substituteInPlace "$f" \
--replace '$(dirname $0)/lib' "$out/share/bcc/tools/lib"
done
sed -i -e "s!lib=.*!lib=$out/bin!" $out/bin/{java,ruby,node,python}gc
'';
postFixup = ''
wrapPythonProgramsIn "$out/share/bcc/tools" "$out $pythonPath"
'';
passthru.tests = {
bpf = nixosTests.bpf;
};
meta = with lib; {
description = "Dynamic Tracing Tools for Linux";
homepage = "https://iovisor.github.io/bcc/";
license = licenses.asl20;
maintainers = with maintainers; [ ragge mic92 thoughtpolice martinetd ];
};
}

View file

@ -0,0 +1,14 @@
--- source.org/tools/deadlock.py 1980-01-02 00:00:00.000000000 +0000
+++ source/tools/deadlock.py 2018-05-29 13:57:11.807126673 +0100
@@ -44,9 +44,8 @@
#
# 01-Feb-2017 Kenny Yu Created this.
-from __future__ import (
- absolute_import, division, unicode_literals, print_function
-)
+from __future__ import absolute_import, division, unicode_literals, print_function
+
from bcc import BPF
from collections import defaultdict
import argparse

View file

@ -0,0 +1,11 @@
--- source.org/src/python/bcc/libbcc.py 2018-05-13 08:35:06.850522883 +0100
+++ source/src/python/bcc/libbcc.py 2018-05-13 08:36:24.602733151 +0100
@@ -14,7 +14,7 @@
import ctypes as ct
-lib = ct.CDLL("libbcc.so.0", use_errno=True)
+lib = ct.CDLL("@out@/lib/libbcc.so.0", use_errno=True)
# keep in sync with bpf_common.h
lib.bpf_module_create_b.restype = ct.c_void_p