generic-poky/meta/recipes-core/initscripts/initscripts-1.0/dmesg.sh
Jackie Huang 89a8dcc9e8 initscripts: add dmesg file to /var/log
We should create the /var/log/dmesg.log file as a default.
If we don't then a later kernel error can flush the dmesg
ring buffer, losing valuable debug information.

(From OE-Core rev: faa8cc6c2a582a32c695f3f2b0d45b6892c769fd)

Signed-off-by: Xin Ouyang <Xin.Ouyang@windriver.com>
Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-07-10 09:42:00 +01:00

18 lines
353 B
Bash

#!/bin/sh
### BEGIN INIT INFO
# Provides: dmesg
# Required-Start:
# Required-Stop:
# Default-Start: S
# Default-Stop:
### END INIT INFO
if [ -f /var/log/dmesg ]; then
if [ -f /usr/sbin/logrotate ]; then
logrotate -f /etc/logrotate-dmesg.conf
else
mv -f /var/log/dmesg /var/log/dmesg.old
fi
fi
dmesg -s 131072 > /var/log/dmesg