From a0746c81eb538ba011cdfcca1a535e2bd41dc044 Mon Sep 17 00:00:00 2001 From: Daniel Lange Date: Mon, 15 Feb 2021 11:07:27 +0100 Subject: Add patches for btime=0 on embedded systems and ZFS meter coloring --- debian/changelog | 6 +++-- debian/patches/0013-fix-btime-zero.patch | 33 ++++++++++++++++++++++++++ debian/patches/0014-fix-zfs-coloring.patch | 37 ++++++++++++++++++++++++++++++ debian/patches/series | 2 ++ 4 files changed, 76 insertions(+), 2 deletions(-) create mode 100644 debian/patches/0013-fix-btime-zero.patch create mode 100644 debian/patches/0014-fix-zfs-coloring.patch diff --git a/debian/changelog b/debian/changelog index 3c6538a..d5c21ee 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,8 +1,10 @@ -htop (3.0.5-5) UNRELEASED; urgency=medium +htop (3.0.5-5) unstable; urgency=medium * Fix forced sort order when switching to tree mode + * Allow btime=0 on some embedded systems (i.e. no RTC) + * Fix ZFS coloring to match other meters - -- Daniel Lange Tue, 09 Feb 2021 09:10:36 +0100 + -- Daniel Lange Mon, 15 Feb 2021 11:11:11 +0100 htop (3.0.5-4) unstable; urgency=medium diff --git a/debian/patches/0013-fix-btime-zero.patch b/debian/patches/0013-fix-btime-zero.patch new file mode 100644 index 0000000..451a058 --- /dev/null +++ b/debian/patches/0013-fix-btime-zero.patch @@ -0,0 +1,33 @@ +From 7433bf4b18278080fb2ac22c5828490883066570 Mon Sep 17 00:00:00 2001 +From: Nathan Scott +Date: Mon, 15 Feb 2021 19:32:55 +1100 +Subject: [PATCH] Correctly detect failure to initialize boottime + +A zero value for btime (boottime) in /proc/stat is a +real situation that happens, so deal with this case. + +Resolves https://github.com/htop-dev/htop/issues/527 +--- + linux/LinuxProcessList.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/linux/LinuxProcessList.c ++++ b/linux/LinuxProcessList.c +@@ -64,7 +64,7 @@ + # define O_PATH 010000000 + #endif + +-static long long btime; ++static long long btime = -1; + + static long jiffy; + +@@ -240,7 +240,7 @@ + } + fclose(statfile); + +- if (!btime) ++ if (btime == -1) + CRT_fatalError("No btime in " PROCSTATFILE); + } + diff --git a/debian/patches/0014-fix-zfs-coloring.patch b/debian/patches/0014-fix-zfs-coloring.patch new file mode 100644 index 0000000..df913c9 --- /dev/null +++ b/debian/patches/0014-fix-zfs-coloring.patch @@ -0,0 +1,37 @@ +Author: Daniel Lange +Date: Tue Feb 9 20:25:57 2021 +0100 + + Make ZFS Meter "Unavailable" text match others -> FAILED_READ coloring + +Author: Ross Williams +Date: Tue Feb 9 16:59:03 2021 +0000 + + [..] correctly color ZFS ARC ratio + +--- a/zfs/ZfsArcMeter.c ++++ b/zfs/ZfsArcMeter.c +@@ -72,7 +72,7 @@ + RichString_appendAscii(out, CRT_colors[ZFS_OTHER], buffer); + } else { + RichString_writeAscii(out, CRT_colors[METER_TEXT], " "); +- RichString_appendAscii(out, CRT_colors[FAILED_SEARCH], "Unavailable"); ++ RichString_appendAscii(out, CRT_colors[FAILED_READ], "Unavailable"); + } + } + +--- a/zfs/ZfsCompressedArcMeter.c ++++ b/zfs/ZfsCompressedArcMeter.c +@@ -54,11 +54,11 @@ + RichString_appendAscii(out, CRT_colors[METER_VALUE], buffer); + RichString_appendAscii(out, CRT_colors[METER_TEXT], " Compressed, "); + ZfsCompressedArcMeter_printRatioString(this, buffer, sizeof(buffer)); +- RichString_appendAscii(out, CRT_colors[METER_VALUE], buffer); ++ RichString_appendAscii(out, CRT_colors[ZFS_RATIO], buffer); + RichString_appendAscii(out, CRT_colors[METER_TEXT], " Ratio"); + } else { + RichString_writeAscii(out, CRT_colors[METER_TEXT], " "); +- RichString_appendAscii(out, CRT_colors[FAILED_SEARCH], "Compression Unavailable"); ++ RichString_appendAscii(out, CRT_colors[FAILED_READ], "Compression Unavailable"); + } + } + diff --git a/debian/patches/series b/debian/patches/series index 5403fbc..b60958a 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -10,3 +10,5 @@ 0010-fix-sort-timeout.patch 0011-improve-setup-for-many-cpu-systems.patch 0012-fix-forced-sort-order.patch +0013-fix-btime-zero.patch +0014-fix-zfs-coloring.patch -- cgit v1.2.3