From e07a79aa5d3d75b6edd36917c4c9ab7de835b0e9 Mon Sep 17 00:00:00 2001 From: Daniele Debernardi Date: Fri, 21 Sep 2018 22:04:54 +0200 Subject: [PATCH] Add initfs hook which causes a kernel panic (useful for debugging) --- .../00-kernel-panic.sh | 8 ++++++++ .../APKBUILD | 17 +++++++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 main/postmarketos-mkinitfs-hook-kernel-panic/00-kernel-panic.sh create mode 100644 main/postmarketos-mkinitfs-hook-kernel-panic/APKBUILD diff --git a/main/postmarketos-mkinitfs-hook-kernel-panic/00-kernel-panic.sh b/main/postmarketos-mkinitfs-hook-kernel-panic/00-kernel-panic.sh new file mode 100644 index 000000000..34ec6e56f --- /dev/null +++ b/main/postmarketos-mkinitfs-hook-kernel-panic/00-kernel-panic.sh @@ -0,0 +1,8 @@ +#!/bin/sh + +echo "PMOS DEBUG: kernel panic in 30s" > /dev/kmsg +sleep 30s + +echo "PMOS DEBUG: kernel panic now" > /dev/kmsg +echo c > /proc/sysrq-trigger + diff --git a/main/postmarketos-mkinitfs-hook-kernel-panic/APKBUILD b/main/postmarketos-mkinitfs-hook-kernel-panic/APKBUILD new file mode 100644 index 000000000..d56e8cb0d --- /dev/null +++ b/main/postmarketos-mkinitfs-hook-kernel-panic/APKBUILD @@ -0,0 +1,17 @@ +pkgname="postmarketos-mkinitfs-hook-kernel-panic" +pkgver=0.1.0 +pkgrel=0 +pkgdesc="Script to cause a kernel panic after 30s from the initramfs (for debugging only)" +url="https://postmarketos.org" +depends="postmarketos-mkinitfs" +source="00-kernel-panic.sh" +arch="noarch" +license="GPL2" + +package() { + mkdir -p "$pkgdir"/etc/postmarketos-mkinitfs/hooks/ + install -Dm644 "$srcdir"/00-kernel-panic.sh \ + "$pkgdir"/etc/postmarketos-mkinitfs/hooks/ +} + +sha512sums="39be4de98daf4306c15dc8196bcd7649a149e5babccf9860c753d40f1e17ef550556444f65238d30d9dbc3d8610319b0d00f9ff99f128fd8a6bd4cdfb3b38dbe 00-kernel-panic.sh"