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,10 @@
--- a/atop.service
+++ b/atop.service
@@ -9,5 +9,6 @@
Environment=LOGPATH=/var/log/atop
-EnvironmentFile=/etc/default/atop
+EnvironmentFile=-/etc/default/atop
ExecStartPre=/bin/sh -c 'test -n "$LOGINTERVAL" -a "$LOGINTERVAL" -eq "$LOGINTERVAL"'
ExecStartPre=/bin/sh -c 'test -n "$LOGGENERATIONS" -a "$LOGGENERATIONS" -eq "$LOGGENERATIONS"'
+ExecStartPre=/bin/sh -c 'mkdir -p "${LOGPATH}"'
ExecStart=/bin/sh -c 'exec @out@/bin/atop ${LOGOPTS} -w "${LOGPATH}/atop_$(date +%%Y%%m%%d)" ${LOGINTERVAL}'

View file

@ -0,0 +1,7 @@
--- a/atopacct.service
+++ b/atopacct.service
@@ -9,3 +9,3 @@
Type=forking
-PIDFile=/var/run/atopacctd.pid
+PIDFile=/run/atopacctd.pid
ExecStart=@out@/bin/atopacctd

View file

@ -0,0 +1,95 @@
{ lib
, stdenv
, fetchurl
, zlib
, ncurses
, findutils
, systemd
, python3
# makes the package unfree via pynvml
, withAtopgpu ? false
}:
stdenv.mkDerivation rec {
pname = "atop";
version = "2.7.1";
src = fetchurl {
url = "https://www.atoptool.nl/download/atop-${version}.tar.gz";
sha256 = "sha256-ykjS8X4HHe6tXm6cyeOIv2oycNaV5hl2s3lNTZJ7XE4=";
};
nativeBuildInputs = lib.optionals withAtopgpu [
python3.pkgs.wrapPython
];
buildInputs = [
zlib
ncurses
] ++ lib.optionals withAtopgpu [
python3
];
pythonPath = lib.optionals withAtopgpu [
python3.pkgs.pynvml
];
makeFlags = [
"DESTDIR=$(out)"
"BINPATH=/bin"
"SBINPATH=/bin"
"MAN1PATH=/share/man/man1"
"MAN5PATH=/share/man/man5"
"MAN8PATH=/share/man/man8"
"SYSDPATH=/lib/systemd/system"
"PMPATHD=/lib/systemd/system-sleep"
];
patches = [
# Fix paths in atop.service, atop-rotate.service, atopgpu.service, atopacct.service,
# and atop-pm.sh
./fix-paths.patch
# Don't fail on missing /etc/default/atop, make sure /var/log/atop exists pre-start
./atop.service.patch
# Specify PIDFile in /run, not /var/run to silence systemd warning
./atopacct.service.patch
];
preConfigure = ''
for f in *.{sh,service}; do
findutils=${findutils} systemd=${systemd} substituteAllInPlace "$f"
done
substituteInPlace Makefile --replace 'chown' 'true'
substituteInPlace Makefile --replace 'chmod 04711' 'chmod 0711'
'';
preInstall = ''
mkdir -p $out/bin
'';
postInstall = ''
# Remove extra files we don't need
rm -r $out/{var,etc} $out/bin/atop{sar,}-${version}
'' + (if withAtopgpu then ''
wrapPythonPrograms
'' else ''
rm $out/lib/systemd/system/atopgpu.service $out/bin/atopgpud $out/share/man/man8/atopgpud.8
'');
meta = with lib; {
platforms = platforms.linux;
maintainers = with maintainers; [ raskin ];
description = "Console system performance monitor";
longDescription = ''
Atop is an ASCII full-screen performance monitor that is capable of reporting the activity of
all processes (even if processes have finished during the interval), daily logging of system
and process activity for long-term analysis, highlighting overloaded system resources by using
colors, etc. At regular intervals, it shows system-level activity related to the CPU, memory,
swap, disks and network layers, and for every active process it shows the CPU utilization,
memory growth, disk utilization, priority, username, state, and exit code.
'';
license = licenses.gpl2Plus;
downloadPage = "http://atoptool.nl/downloadatop.php";
};
}

View file

@ -0,0 +1,48 @@
--- a/atop.service
+++ b/atop.service
@@ -12,4 +12,4 @@
ExecStartPre=/bin/sh -c 'test -n "$LOGGENERATIONS" -a "$LOGGENERATIONS" -eq "$LOGGENERATIONS"'
-ExecStart=/bin/sh -c 'exec /usr/bin/atop ${LOGOPTS} -w "${LOGPATH}/atop_$(date +%%Y%%m%%d)" ${LOGINTERVAL}'
-ExecStartPost=/usr/bin/find "${LOGPATH}" -name "atop_*" -mtime +${LOGGENERATIONS} -exec rm -v {} \;
+ExecStart=/bin/sh -c 'exec @out@/bin/atop ${LOGOPTS} -w "${LOGPATH}/atop_$(date +%%Y%%m%%d)" ${LOGINTERVAL}'
+ExecStartPost=@findutils@/bin/find "${LOGPATH}" -name "atop_*" -mtime +${LOGGENERATIONS} -exec rm -v {} \;
KillSignal=SIGUSR2
--- a/atop-rotate.service
+++ b/atop-rotate.service
@@ -4,3 +4,3 @@
[Service]
Type=oneshot
-ExecStart=/usr/bin/systemctl try-restart atop.service
+ExecStart=@systemd@/bin/systemctl try-restart atop.service
--- a/atopgpu.service
+++ b/atopgpu.service
@@ -6,5 +6,5 @@
[Service]
-ExecStart=/usr/sbin/atopgpud
+ExecStart=@out@/bin/atopgpud
Type=oneshot
RemainAfterExit=yes
--- a/atopacct.service
+++ b/atopacct.service
@@ -10,3 +10,3 @@
PIDFile=/var/run/atopacctd.pid
-ExecStart=/usr/sbin/atopacctd
+ExecStart=@out@/bin/atopacctd
--- a/atop-pm.sh
+++ b/atop-pm.sh
@@ -2,8 +2,8 @@
case "$1" in
- pre) /usr/bin/systemctl stop atop
+ pre) @systemd@/bin/systemctl stop atop
exit 0
;;
- post) /usr/bin/systemctl start atop
+ post) @systemd@/bin/systemctl start atop
exit 0
;;