diff --git a/br-ext-chip-goke/board/gk7205v200/gk7205v200.generic.config b/br-ext-chip-goke/board/gk7205v200/gk7205v200.generic.config index 2ae0c1f11..8b92bddce 100644 --- a/br-ext-chip-goke/board/gk7205v200/gk7205v200.generic.config +++ b/br-ext-chip-goke/board/gk7205v200/gk7205v200.generic.config @@ -2391,7 +2391,16 @@ CONFIG_SQUASHFS_FRAGMENT_CACHE_SIZE=1 # CONFIG_QNX4FS_FS is not set # CONFIG_QNX6FS_FS is not set # CONFIG_ROMFS_FS is not set -# CONFIG_PSTORE is not set +CONFIG_PSTORE=y +# Compression is a mandatory choice on this 4.9 kernel (it has no "none"); ZLIB +# is its default and the only one whose workspace is preallocated at register +# time, so it stays safe to compress from inside a panic. The others stay off. +CONFIG_PSTORE_ZLIB_COMPRESS=y +# CONFIG_PSTORE_LZO_COMPRESS is not set +# CONFIG_PSTORE_LZ4_COMPRESS is not set +CONFIG_PSTORE_CONSOLE=y +CONFIG_PSTORE_PMSG=y +CONFIG_PSTORE_RAM=y # CONFIG_SYSV_FS is not set # CONFIG_UFS_FS is not set CONFIG_NETWORK_FILESYSTEMS=y diff --git a/general/overlay/etc/init.d/S29pstore b/general/overlay/etc/init.d/S29pstore new file mode 100755 index 000000000..3e53fb9af --- /dev/null +++ b/general/overlay/etc/init.d/S29pstore @@ -0,0 +1,21 @@ +#!/bin/sh +# Mount the pstore filesystem so a kernel crash log that ramoops captured across +# the reboot (a panic/oops, via kmsg_dump -- independent of the muted console) +# is readable at /sys/fs/pstore. Without this the records are held in the +# reserved RAM region but never exposed. Inert on a kernel built without pstore. +# The backing RAM region is set up in the goke set_allocator (ramoops.* bootargs). +case "$1" in + start) + if grep -q pstore /proc/filesystems; then + mkdir -p /sys/fs/pstore + mountpoint -q /sys/fs/pstore 2>/dev/null || + mount -t pstore pstore /sys/fs/pstore + fi + ;; + stop) + ;; + *) + echo "Usage: $0 {start|stop}" + exit 1 + ;; +esac diff --git a/general/overlay/init b/general/overlay/init index 615f62c90..a3b7823db 100755 --- a/general/overlay/init +++ b/general/overlay/init @@ -12,8 +12,12 @@ grep -q overlay /proc/filesystems || exit 1 is_flash_root=true is_nfs_root=false -grep -q 'root=.*nfs\|mmcblk\|ram' /proc/cmdline && is_flash_root=false -grep -q 'root=.*nfs' /proc/cmdline && is_nfs_root=true +# Anchor these to the root= value. A bare "ram"/"mmcblk"/"nfs" matched the whole +# command line, so any unrelated token carrying those letters -- e.g. the +# "ramoops" crash-log parameters -- was mistaken for a ramdisk/SD/NFS root, the +# flash overlay was never mounted, and the camera booted read-only and unclaimed. +grep -qE 'root=[^ ]*(nfs|mmcblk|ram)' /proc/cmdline && is_flash_root=false +grep -qE 'root=[^ ]*nfs' /proc/cmdline && is_nfs_root=true if $is_flash_root; then if grep -q ubifs /proc/cmdline; then