bug script: Prompt to include crash logs from pstore

svn path=/dists/sid/linux/; revision=20578
This commit is contained in:
Ben Hutchings 2013-09-08 19:46:30 +00:00
parent 2fc55f7dc0
commit 9681a7adac
3 changed files with 84 additions and 0 deletions

1
debian/changelog vendored
View File

@ -73,6 +73,7 @@ linux (3.10.11-1) UNRELEASED; urgency=low
* [x86] ACPI: Re-enable ACPI_HOTPLUG_MEMORY as built-in
* [x86] amd64_edac: Fix single-channel setups (Closes: #717473)
* [x86] efi: Ensure efi-pstore is loaded on EFI systems
* bug script: Prompt to include crash logs from pstore
[ Ian Campbell ]
* [armel]: Enable MVMDIO and USB_EHCI_HCD_ORION on Kirkwood and Orion

View File

@ -0,0 +1,77 @@
_add_pstore_log() {
if [ $# -le 3 ]; then
return
fi
local backend="$1"
local event="$2"
local date="$3"
yesno "Include log of $event at $(date -d @$date +%c) stored by $backend?" yep
if [ $REPLY != yep ]; then
return
fi
echo >&3
echo "*** Log of $event at $(date -d @$date -Iseconds) from $backend" >&3
shift 3
for file in "$@"; do
tail -n +2 "$file" | sed 's/^<.>//' >&3
done
}
add_pstore() {
local backend
local i
local j
local file
local date
local head
local event
local log_files
if ! mountpoint -q /sys/fs/pstore; then
return 0
fi
set -- /sys/fs/pstore/dmesg-*-1
backend=${1#*/dmesg-}
backend=${backend%-1}
if [ "$backend" = '*' ]; then
return 0
fi
i=1
while [ -f /sys/fs/pstore/dmesg-$backend-$i ]; do
file=/sys/fs/pstore/dmesg-$backend-$i
head="$(head -1 "$file")"
# Is this the first part of a log?
if [ "x${head% Part1}" != "x$head" ]; then
# Flush previous log, if any
_add_pstore_log "$backend" "$event" "$date" $log_files
event="${head% Part1}"
date=$(stat -c %Y $file)
log_files=
j=1
fi
if [ "x$head" = "x$event Part$j" ]; then
# Each part is prepended to the list, because they're numbered
# backward in log history
log_files="$file $log_files"
j=$((j + 1))
fi
i=$((i + 1))
done
# Flush last log, if any
_add_pstore_log "$backend" "$event" "$date" $log_files
}
ask_pstore() {
add_pstore
}

View File

@ -6,3 +6,9 @@ If you are reporting that the kernel fails to boot, please use a digital
camera, serial console or netconsole to record the boot messages and
attach these to your report. You can use the kernel parameter
'boot_delay=1000' to slow down the boot messages.
If you are reporting a crash on a system that boots using EFI, it may
be useful to mount the 'pstore' filesystem so that a crash log can be
retrieved from flash memory. You can do this by running (as root):
mount -t pstore pstore /sys/fs/pstore