Skip to content

mediatek-filogic: add kmod-ramoops package#108

Open
s-2 wants to merge 1 commit intofreifunkh:master-wireguardfrom
s-2:filogic_ramoops
Open

mediatek-filogic: add kmod-ramoops package#108
s-2 wants to merge 1 commit intofreifunkh:master-wireguardfrom
s-2:filogic_ramoops

Conversation

@s-2
Copy link
Contributor

@s-2 s-2 commented Jun 13, 2025

For Mediatek MT798x devices, a 64KiB pstore kernel memory region is declared in the .dtsi
https://github.com/openwrt/openwrt/blob/d7f9e240c208891a7d26d7a1d308cabd70618cae/target/linux/mediatek/files-6.6/arch/arm64/boot/dts/mediatek/mt7981b.dtsi#L84-L89
to be used for retaining crash logs (ramoops) during reboot.

Add package kmod-ramoops (which adds kmod-pstore as a dependency) for the filogic subtarget.

Retrieval of logs currently involves manual investigation after unexpected reboots, maybe in the long term we could have a script check this on every boot (automatically send telemetry data, with user consent)?

Example

echo c > /proc/sysrq-trigger will force a crash;

after reboot, check contents of /sys/fs/pstore:

root@AquilaM30Test:/# tail /sys/fs/pstore/dmesg-ramoops-0
<6>[ 1070.415231] batman_adv: bat0: Adding interface: mesh0
<6>[ 1070.420349] batman_adv: bat0: Interface activated: mesh0
<6>[ 1070.435575] batman_adv: bat0: Adding interface: mesh1
<6>[ 1070.440673] batman_adv: bat0: Interface activated: mesh1
<6>[ 1148.114556] sysrq: Trigger a crash
<0>[ 1148.117976] Kernel panic - not syncing: sysrq triggered crash
<2>[ 1148.123710] SMP: stopping secondary CPUs
<0>[ 1148.127623] Kernel Offset: disabled
<0>[ 1148.131098] CPU features: 0x0,00000000,00000000,1000400b
<0>[ 1148.136398] Memory Limit: none
root@AquilaM30Test:/# 

Tested on 7Links WLR-1300 and D-Link M30.

write crash logs to pstore
(will be available in /sys/fs/pstore after reboot)

use
  echo c > /proc/sysrq-trigger
to force crash
@AiyionPrime
Copy link
Member

AiyionPrime commented Jun 14, 2025

@s-2 Are there other targets, which support ramoops?

@s-2
Copy link
Contributor Author

s-2 commented Jun 14, 2025

There used to be a PR for qualcommax (IPQ8074 etc.), no idea why that one was closed:
openwrt/openwrt#15688

OpenWrt forum thread: https://forum.openwrt.org/t/get-ramoops-mtdoops-or-mtdpstore-working-on-more-devices/212316

For ipq806x, only two devices in OpenWrt currently have this region set in their dts.
Maybe for older targets, individual testing is needed to determine which memory region should be used for that device, so we'd have to select devices individually in gluon (not sure what happens when the package is installed on devices without the pstore region, probably just an error in dmesg, but that would just be adding bloat)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants