This commit is contained in:
elwrcl committed 2026-09-04 00:36:40 +03:00
1 parent 2eb306c946
commit 6375ca90dd
4 files changed
+38 -41

No files matched your search

+26 -21
View File
@@ -64,28 +64,31 @@
echo "test it: echo 'netconsole test' | sudo tee /dev/kmsg"
'';
};
panicInflate = pkgs.writers.writePython3Bin "drm-panic-inflate" {
flakeIgnore = [ "E501" ];
} ''
import sys
import zlib
data = sys.stdin.buffer.read()
if not data:
sys.exit("Could not read QR: try a clearer, straighter photo")
panicInflate =
pkgs.writers.writePython3Bin "drm-panic-inflate"
{
flakeIgnore = [ "E501" ];
}
''
import sys
import zlib
# Try raw deflate, then zlib-wrapped, then gzip.
for wbits in (-15, 15, 47):
try:
sys.stdout.buffer.write(zlib.decompress(data, wbits))
break
except zlib.error:
continue
else:
sys.stderr.write("warning: could not decompress, printing raw bytes\n")
sys.stdout.buffer.write(data)
'';
data = sys.stdin.buffer.read()
if not data:
sys.exit("Could not read QR: try a clearer, straighter photo")
# Try raw deflate, then zlib-wrapped, then gzip.
for wbits in (-15, 15, 47):
try:
sys.stdout.buffer.write(zlib.decompress(data, wbits))
break
except zlib.error:
continue
else:
sys.stderr.write("warning: could not decompress, printing raw bytes\n")
sys.stdout.buffer.write(data)
'';
drmPanicDecode = pkgs.writeShellApplication {
name = "drm-panic-decode";
@@ -130,7 +133,9 @@
"kernel.softlockup_panic" = 1;
"kernel.hung_task_panic" = 1;
# Log blocked tasks, but do not reboot over them: a heavy build under
# zram pressure can block a task past the timeout without being a hang.
"kernel.hung_task_panic" = 0;
"kernel.hung_task_timeout_secs" = 300;