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:
commit
56de2bcd43
30691 changed files with 3076956 additions and 0 deletions
|
|
@ -0,0 +1,41 @@
|
|||
commit af5fa3623bb9a73052f9154be4a0f38c60ea42a2
|
||||
Author: Kjetil Orbekk <kjetil.orbekk@gmail.com>
|
||||
Date: Thu Nov 23 21:21:36 2017 -0500
|
||||
|
||||
node: add --sconfdir to set plugin configuration dir
|
||||
|
||||
diff --git a/node/sbin/munin-node b/node/sbin/munin-node
|
||||
index 909c8c4e..0ccf3941 100755
|
||||
--- a/node/sbin/munin-node
|
||||
+++ b/node/sbin/munin-node
|
||||
@@ -100,9 +100,11 @@ sub parse_args
|
||||
my @ORIG_ARGV = @ARGV;
|
||||
|
||||
my $servicedir_cmdline;
|
||||
+ my $sconfdir_cmdline;
|
||||
print_usage_and_exit() unless GetOptions(
|
||||
"config=s" => \$conffile,
|
||||
"servicedir=s" => \$servicedir_cmdline,
|
||||
+ "sconfdir=s" => \$sconfdir_cmdline,
|
||||
"debug!" => \$DEBUG,
|
||||
"pidebug!" => \$PIDEBUG,
|
||||
"paranoia!" => \$paranoia,
|
||||
@@ -112,6 +114,7 @@ sub parse_args
|
||||
|
||||
# We untaint the args brutally, since the sysadm should know what he does
|
||||
$servicedir = $1 if defined $servicedir_cmdline && $servicedir_cmdline =~ m/(.*)/;
|
||||
+ $sconfdir = $1 if defined $sconfdir_cmdline && $sconfdir_cmdline =~ m/(.*)/;
|
||||
|
||||
# Reset ARGV (for HUPing)
|
||||
@ARGV = @ORIG_ARGV;
|
||||
@@ -175,6 +178,10 @@ Use E<lt>fileE<gt> as configuration file. [@@CONFDIR@@/munin-node.conf]
|
||||
|
||||
Override plugin directory [@@CONFDIR@@/plugins/]
|
||||
|
||||
+=item B<< --sconfdir <dir> >>
|
||||
+
|
||||
+Override plugin configuration directory [@@CONFDIR@@/plugin-conf.d/]
|
||||
+
|
||||
=item B< --[no]paranoia >
|
||||
|
||||
Only run plugins owned by root. Check permissions as well. [--noparanoia]
|
||||
|
|
@ -0,0 +1,84 @@
|
|||
From 75a3ec48814e7b9a9b22259a04009076363be3f1 Mon Sep 17 00:00:00 2001
|
||||
From: Igor Kolar <igor.kolar@gmail.com>
|
||||
Date: Thu, 17 Oct 2013 00:48:23 +0200
|
||||
Subject: [PATCH 1/2] node: added --servicedir switch to munin-node
|
||||
|
||||
This code is copied over from munin-node-config, that already does the same
|
||||
---
|
||||
node/sbin/munin-node | 7 ++++++-
|
||||
1 file changed, 6 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/node/sbin/munin-node b/node/sbin/munin-node
|
||||
index 7b2e180..0a93450 100755
|
||||
--- a/node/sbin/munin-node
|
||||
+++ b/node/sbin/munin-node
|
||||
@@ -35,7 +35,7 @@ use Munin::Node::OS;
|
||||
use Munin::Node::Service;
|
||||
use Munin::Node::Server;
|
||||
|
||||
-my $servicedir;
|
||||
+my $servicedir = "$Munin::Common::Defaults::MUNIN_CONFDIR/plugins";
|
||||
my $sconfdir = "$Munin::Common::Defaults::MUNIN_CONFDIR/plugin-conf.d";
|
||||
my $conffile = "$Munin::Common::Defaults::MUNIN_CONFDIR/munin-node.conf";
|
||||
my $DEBUG = 0;
|
||||
@@ -101,6 +101,7 @@ sub parse_args
|
||||
|
||||
print_usage_and_exit() unless GetOptions(
|
||||
"config=s" => \$conffile,
|
||||
+ "servicedir=s" => \$servicedir,
|
||||
"debug!" => \$DEBUG,
|
||||
"pidebug!" => \$PIDEBUG,
|
||||
"paranoia!" => \$paranoia,
|
||||
@@ -166,6 +167,10 @@ and returning the output they produce.
|
||||
|
||||
Use E<lt>fileE<gt> as configuration file. [@@CONFDIR@@/munin-node.conf]
|
||||
|
||||
+=item B<< --servicedir <dir> >>
|
||||
+
|
||||
+Override plugin directory [@@CONFDIR@@/plugins/]
|
||||
+
|
||||
=item B< --[no]paranoia >
|
||||
|
||||
Only run plugins owned by root. Check permissions as well. [--noparanoia]
|
||||
--
|
||||
1.8.4
|
||||
|
||||
|
||||
From b8e17cbe73ae4c71b93ff5687ba86db1d0c1f5bd Mon Sep 17 00:00:00 2001
|
||||
From: Steve Schnepp <steve.schnepp@pwkf.org>
|
||||
Date: Thu, 17 Oct 2013 11:52:10 +0200
|
||||
Subject: [PATCH 2/2] node: untaint the service-dir args
|
||||
|
||||
---
|
||||
node/sbin/munin-node | 6 +++++-
|
||||
1 file changed, 5 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/node/sbin/munin-node b/node/sbin/munin-node
|
||||
index 0a93450..909c8c4 100755
|
||||
--- a/node/sbin/munin-node
|
||||
+++ b/node/sbin/munin-node
|
||||
@@ -99,9 +99,10 @@ sub parse_args
|
||||
{
|
||||
my @ORIG_ARGV = @ARGV;
|
||||
|
||||
+ my $servicedir_cmdline;
|
||||
print_usage_and_exit() unless GetOptions(
|
||||
"config=s" => \$conffile,
|
||||
- "servicedir=s" => \$servicedir,
|
||||
+ "servicedir=s" => \$servicedir_cmdline,
|
||||
"debug!" => \$DEBUG,
|
||||
"pidebug!" => \$PIDEBUG,
|
||||
"paranoia!" => \$paranoia,
|
||||
@@ -109,6 +110,9 @@ sub parse_args
|
||||
"help" => \&print_usage_and_exit,
|
||||
);
|
||||
|
||||
+ # We untaint the args brutally, since the sysadm should know what he does
|
||||
+ $servicedir = $1 if defined $servicedir_cmdline && $servicedir_cmdline =~ m/(.*)/;
|
||||
+
|
||||
# Reset ARGV (for HUPing)
|
||||
@ARGV = @ORIG_ARGV;
|
||||
|
||||
--
|
||||
1.8.4
|
||||
|
||||
149
pkgs/servers/monitoring/munin/default.nix
Normal file
149
pkgs/servers/monitoring/munin/default.nix
Normal file
|
|
@ -0,0 +1,149 @@
|
|||
{ lib, stdenv, fetchFromGitHub, makeWrapper, which, coreutils, rrdtool, perlPackages
|
||||
, python3, ruby, jre, nettools, bc
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
version = "2.0.69";
|
||||
pname = "munin";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "munin-monitoring";
|
||||
repo = "munin";
|
||||
rev = version;
|
||||
sha256 = "sha256-p273O5JLFX1dA2caV3lVVL9YNTcGMSrC7DWieUfUmqI=";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [
|
||||
makeWrapper
|
||||
];
|
||||
|
||||
buildInputs = [
|
||||
which
|
||||
coreutils
|
||||
rrdtool
|
||||
nettools
|
||||
perlPackages.perl
|
||||
perlPackages.ModuleBuild
|
||||
perlPackages.HTMLTemplate
|
||||
perlPackages.NetCIDR
|
||||
perlPackages.NetSSLeay
|
||||
perlPackages.NetServer
|
||||
perlPackages.LogLog4perl
|
||||
perlPackages.IOSocketInet6
|
||||
perlPackages.Socket6
|
||||
perlPackages.URI
|
||||
perlPackages.DBFile
|
||||
perlPackages.DateManip
|
||||
perlPackages.FileCopyRecursive
|
||||
perlPackages.FCGI
|
||||
perlPackages.NetSNMP
|
||||
perlPackages.NetServer
|
||||
perlPackages.ListMoreUtils
|
||||
perlPackages.LWP
|
||||
perlPackages.DBDPg
|
||||
python3
|
||||
ruby
|
||||
jre
|
||||
# tests
|
||||
perlPackages.TestLongString
|
||||
perlPackages.TestDifferences
|
||||
perlPackages.TestDeep
|
||||
perlPackages.TestMockModule
|
||||
perlPackages.TestMockObject
|
||||
perlPackages.FileSlurp
|
||||
perlPackages.IOStringy
|
||||
];
|
||||
|
||||
# needs to find a local perl module during build
|
||||
PERL_USE_UNSAFE_INC = "1";
|
||||
|
||||
# TODO: tests are failing https://munin-monitoring.org/ticket/1390#comment:1
|
||||
# NOTE: important, test command always exits with 0, think of a way to abort the build once tests pass
|
||||
doCheck = false;
|
||||
|
||||
checkPhase = ''
|
||||
export PERL5LIB="$PERL5LIB:${rrdtool}/${perlPackages.perl.libPrefix}"
|
||||
LC_ALL=C make -j1 test
|
||||
'';
|
||||
|
||||
patches = [
|
||||
# https://rt.cpan.org/Public/Bug/Display.html?id=75112
|
||||
./dont_preserve_source_dir_permissions.patch
|
||||
|
||||
# https://github.com/munin-monitoring/munin/pull/134
|
||||
./adding_servicedir_munin-node.patch
|
||||
|
||||
./adding_sconfdir_munin-node.patch
|
||||
./preserve_environment.patch
|
||||
];
|
||||
|
||||
preBuild = ''
|
||||
echo "${version}" > RELEASE
|
||||
substituteInPlace "Makefile" \
|
||||
--replace "/bin/pwd" "pwd" \
|
||||
--replace "HTMLOld.3pm" "HTMLOld.3"
|
||||
|
||||
# munin checks at build time if user/group exists, unpure
|
||||
sed -i '/CHECKUSER/d' Makefile
|
||||
sed -i '/CHOWN/d' Makefile
|
||||
sed -i '/CHECKGROUP/d' Makefile
|
||||
|
||||
# munin hardcodes PATH, we need it to obey $PATH
|
||||
sed -i '/ENV{PATH}/d' node/lib/Munin/Node/Service.pm
|
||||
'';
|
||||
|
||||
# Disable parallel build, errors:
|
||||
# Can't locate Munin/Common/Defaults.pm in @INC ...
|
||||
enableParallelBuilding = false;
|
||||
|
||||
# DESTDIR shouldn't be needed (and shouldn't have worked), but munin
|
||||
# developers have forgotten to use PREFIX everywhere, so we use DESTDIR to
|
||||
# ensure that everything is installed in $out.
|
||||
makeFlags = [
|
||||
"PREFIX=$(out)"
|
||||
"DESTDIR=$(out)"
|
||||
"PERLLIB=$(out)/${perlPackages.perl.libPrefix}"
|
||||
"PERL=${perlPackages.perl.outPath}/bin/perl"
|
||||
"PYTHON=${python3.interpreter}"
|
||||
"RUBY=${ruby.outPath}/bin/ruby"
|
||||
"JAVARUN=${jre.outPath}/bin/java"
|
||||
"PLUGINUSER=munin"
|
||||
];
|
||||
|
||||
postFixup = ''
|
||||
echo "Removing references to /usr/{bin,sbin}/ from munin plugins..."
|
||||
find "$out/lib/plugins" -type f -print0 | xargs -0 -L1 \
|
||||
sed -i -e "s|/usr/bin/||g" -e "s|/usr/sbin/||g" -e "s|\<bc\>|${bc}/bin/bc|g"
|
||||
|
||||
if test -e $out/nix-support/propagated-build-inputs; then
|
||||
ln -s $out/nix-support/propagated-build-inputs $out/nix-support/propagated-user-env-packages
|
||||
fi
|
||||
|
||||
for file in "$out"/bin/munindoc "$out"/sbin/munin-* "$out"/lib/munin-* "$out"/www/cgi/*; do
|
||||
# don't wrap .jar files
|
||||
case "$file" in
|
||||
*.jar) continue;;
|
||||
esac
|
||||
wrapProgram "$file" \
|
||||
--set PERL5LIB "$out/${perlPackages.perl.libPrefix}:${with perlPackages; makePerlPath [
|
||||
LogLog4perl IOSocketInet6 Socket6 URI DBFile DateManip
|
||||
HTMLTemplate FileCopyRecursive FCGI NetCIDR NetSNMP NetServer
|
||||
ListMoreUtils DBDPg LWP rrdtool
|
||||
]}"
|
||||
done
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
description = "Networked resource monitoring tool";
|
||||
longDescription = ''
|
||||
Munin is a monitoring tool that surveys all your computers and remembers
|
||||
what it saw. It presents all the information in graphs through a web
|
||||
interface. Munin can help analyze resource trends and 'what just happened
|
||||
to kill our performance?' problems.
|
||||
'';
|
||||
homepage = "https://munin-monitoring.org/";
|
||||
license = licenses.gpl2;
|
||||
maintainers = [ maintainers.bjornfor ];
|
||||
platforms = platforms.linux;
|
||||
};
|
||||
}
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
# https://rt.cpan.org/Public/Bug/Display.html?id=75112
|
||||
diff --git a/master/lib/Munin/Master/HTMLOld.pm b/master/lib/Munin/Master/HTMLOld.pm
|
||||
index 2b6e71f..c0aa2c0 100644
|
||||
--- a/master/lib/Munin/Master/HTMLOld.pm
|
||||
+++ b/master/lib/Munin/Master/HTMLOld.pm
|
||||
@@ -711,10 +711,12 @@ sub emit_main_index {
|
||||
|
||||
sub copy_web_resources {
|
||||
my ($staticdir, $htmldir) = @_;
|
||||
+ local $File::Copy::Recursive::KeepMode = 0;
|
||||
unless(dircopy($staticdir, "$htmldir/static")){
|
||||
ERROR "[ERROR] Could not copy contents from $staticdir to $htmldir";
|
||||
die "[ERROR] Could not copy contents from $staticdir to $htmldir";
|
||||
}
|
||||
+ local $File::Copy::Recursive::KeepMode = 1;
|
||||
}
|
||||
|
||||
sub instanciate_comparison_templates {
|
||||
41
pkgs/servers/monitoring/munin/preserve_environment.patch
Normal file
41
pkgs/servers/monitoring/munin/preserve_environment.patch
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
commit d94c29b7397362857b81d8c877a989fdb28490d8
|
||||
Author: Kjetil Orbekk <kjetil.orbekk@gmail.com>
|
||||
Date: Tue Nov 21 15:37:42 2017 -0500
|
||||
|
||||
Keep environment variables instead of overwriting them.
|
||||
|
||||
diff --git a/common/lib/Munin/Common/Defaults.pm b/common/lib/Munin/Common/Defaults.pm
|
||||
index 131f52c0..bbf42697 100644
|
||||
--- a/common/lib/Munin/Common/Defaults.pm
|
||||
+++ b/common/lib/Munin/Common/Defaults.pm
|
||||
@@ -71,7 +71,7 @@ sub export_to_environment {
|
||||
|
||||
my %defaults = %{$class->get_defaults()};
|
||||
while (my ($k, $v) = each %defaults) {
|
||||
- $ENV{$k} = $v;
|
||||
+ $ENV{$k} = $ENV{$k} || $v;
|
||||
}
|
||||
|
||||
return
|
||||
diff --git a/node/lib/Munin/Node/Service.pm b/node/lib/Munin/Node/Service.pm
|
||||
index 1b4f6114..be58bd77 100644
|
||||
--- a/node/lib/Munin/Node/Service.pm
|
||||
+++ b/node/lib/Munin/Node/Service.pm
|
||||
@@ -122,7 +122,7 @@ sub export_service_environment {
|
||||
# We append the USER to the MUNIN_PLUGSTATE, to avoid CVE-2012-3512
|
||||
my $uid = $self->_resolve_uid($service);
|
||||
my $user = getpwuid($uid);
|
||||
- $ENV{MUNIN_PLUGSTATE} = "$Munin::Common::Defaults::MUNIN_PLUGSTATE/$user";
|
||||
+ $ENV{MUNIN_PLUGSTATE} = "$ENV{MUNIN_PLUGSTATE}/$user";
|
||||
|
||||
# Provide a consistent default state-file.
|
||||
$ENV{MUNIN_STATEFILE} = "$ENV{MUNIN_PLUGSTATE}/$service-$ENV{MUNIN_MASTER_IP}";
|
||||
@@ -243,7 +243,7 @@ sub exec_service
|
||||
|
||||
# XXX - Create the statedir for the user
|
||||
my $uid = $self->_resolve_uid($service);
|
||||
- Munin::Node::OS->mkdir_subdir("$Munin::Common::Defaults::MUNIN_PLUGSTATE", $uid);
|
||||
+ Munin::Node::OS->mkdir_subdir("$ENV{MUNIN_PLUGSTATE}", $uid);
|
||||
|
||||
$self->change_real_and_effective_user_and_group($service);
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue