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,75 @@
{ lib, stdenv
, fetchpatch
, fetchFromGitHub
, ncurses
, python3
, cunit
, dpdk
, libaio
, libbsd
, libuuid
, numactl
, openssl
, fetchurl
}:
let
# The old version has some CVEs howver they should not affect SPDK's usage of the framework: https://github.com/NixOS/nixpkgs/pull/171648#issuecomment-1121964568
dpdk' = dpdk.overrideAttrs (old: rec {
name = "dpdk-21.11";
src = fetchurl {
url = "https://fast.dpdk.org/rel/${name}.tar.xz";
sha256 = "sha256-Mkbj7WjuKzaaXYviwGzxCKZp4Vf01Bxby7sha/Wr06E=";
};
});
in stdenv.mkDerivation rec {
pname = "spdk";
version = "21.10";
src = fetchFromGitHub {
owner = "spdk";
repo = "spdk";
rev = "v${version}";
sha256 = "sha256-pFynTbbSF1g58VD9bOhe3c4oCozeqE+35kECTQwDBDM=";
};
patches = [
# Backport of upstream patch for ncurses-6.3 support.
# Will be in next release after 21.10.
./ncurses-6.3.patch
# DPDK 21.11 compatibility.
(fetchpatch {
url = "https://github.com/spdk/spdk/commit/f72cab94dd35d7b45ec5a4f35967adf3184ca616.patch";
sha256 = "sha256-sSetvyNjlM/hSOUsUO3/dmPzAliVcteNDvy34yM5d4A=";
})
];
nativeBuildInputs = [
python3
];
buildInputs = [
cunit dpdk' libaio libbsd libuuid numactl openssl ncurses
];
postPatch = ''
patchShebangs .
'';
enableParallelBuilding = true;
configureFlags = [ "--with-dpdk=${dpdk'}" ];
NIX_CFLAGS_COMPILE = "-mssse3"; # Necessary to compile.
# otherwise does not find strncpy when compiling
NIX_LDFLAGS = "-lbsd";
meta = with lib; {
description = "Set of libraries for fast user-mode storage";
homepage = "https://spdk.io/";
license = licenses.bsd3;
platforms = [ "x86_64-linux" ];
maintainers = with maintainers; [ orivej ];
};
}

View file

@ -0,0 +1,48 @@
Backport of upstream https://review.spdk.io/gerrit/c/spdk/spdk/+/10300
--- a/app/spdk_top/spdk_top.c
+++ b/app/spdk_top/spdk_top.c
@@ -1012 +1012 @@ print_max_len(WINDOW *win, int row, uint16_t col, uint16_t max_len, enum str_ali
- mvwprintw(win, row, col, tmp_str);
+ mvwprintw(win, row, col, "%s", tmp_str);
@@ -1944 +1944 @@ display_thread(struct rpc_thread_info *thread_info)
- mvwprintw(thread_win, 3, THREAD_WIN_FIRST_COL + 6, "%" PRIu64,
+ mvwprintw(thread_win, 3, THREAD_WIN_FIRST_COL + 6, "%d",
@@ -1949 +1949 @@ display_thread(struct rpc_thread_info *thread_info)
- mvwprintw(thread_win, 3, THREAD_WIN_FIRST_COL + 32, idle_time);
+ mvwprintw(thread_win, 3, THREAD_WIN_FIRST_COL + 32, "%s", idle_time);
@@ -1951 +1951 @@ display_thread(struct rpc_thread_info *thread_info)
- mvwprintw(thread_win, 3, THREAD_WIN_FIRST_COL + 54, busy_time);
+ mvwprintw(thread_win, 3, THREAD_WIN_FIRST_COL + 54, "%s", busy_time);
@@ -1954 +1954 @@ display_thread(struct rpc_thread_info *thread_info)
- mvwprintw(thread_win, 3, THREAD_WIN_FIRST_COL + 32, idle_time);
+ mvwprintw(thread_win, 3, THREAD_WIN_FIRST_COL + 32, "%s", idle_time);
@@ -1956 +1956 @@ display_thread(struct rpc_thread_info *thread_info)
- mvwprintw(thread_win, 3, THREAD_WIN_FIRST_COL + 54, busy_time);
+ mvwprintw(thread_win, 3, THREAD_WIN_FIRST_COL + 54, "%s", busy_time);
@@ -2111 +2111 @@ show_core(uint8_t current_page)
- mvwprintw(core_win, 5, CORE_WIN_FIRST_COL + 20, idle_time);
+ mvwprintw(core_win, 5, CORE_WIN_FIRST_COL + 20, "%s", idle_time);
@@ -2118 +2118 @@ show_core(uint8_t current_page)
- mvwprintw(core_win, 7, CORE_WIN_FIRST_COL + 20, busy_time);
+ mvwprintw(core_win, 7, CORE_WIN_FIRST_COL + 20, "%s", busy_time);
@@ -2124 +2124 @@ show_core(uint8_t current_page)
- mvwprintw(core_win, i + 10, 1, core_info->threads.thread[i].name);
+ mvwprintw(core_win, i + 10, 1, "%s", core_info->threads.thread[i].name);
@@ -2137 +2137 @@ show_core(uint8_t current_page)
- mvwprintw(core_win, i + 10, 1, core_info->threads.thread[i].name);
+ mvwprintw(core_win, i + 10, 1, "%s", core_info->threads.thread[i].name);
@@ -2214 +2214 @@ show_poller(uint8_t current_page)
- mvwprintw(poller_win, 3, POLLER_WIN_FIRST_COL,
+ mvwprintw(poller_win, 3, POLLER_WIN_FIRST_COL, "%s",
@@ -2216 +2216 @@ show_poller(uint8_t current_page)
- mvwprintw(poller_win, 3, POLLER_WIN_FIRST_COL + 23, poller->thread_name);
+ mvwprintw(poller_win, 3, POLLER_WIN_FIRST_COL + 23, "%s", poller->thread_name);
@@ -2231 +2231 @@ show_poller(uint8_t current_page)
- mvwprintw(poller_win, 4, POLLER_WIN_FIRST_COL + 23, poller_period);
+ mvwprintw(poller_win, 4, POLLER_WIN_FIRST_COL + 23, "%s", poller_period);
@@ -2264 +2264 @@ print_bottom_error_message(char *msg)
- mvprintw(g_max_row - 1, g_max_col - strlen(msg) - 2, msg);
+ mvprintw(g_max_row - 1, g_max_col - strlen(msg) - 2, "%s", msg);
@@ -2434 +2434 @@ show_stats(pthread_t *data_thread)
- mvprintw(g_max_row - 1, 1, current_page_str);
+ mvprintw(g_max_row - 1, 1, "%s", current_page_str);