diff options
| author | Jackie Huang <jackie.huang@windriver.com> | 2013-07-04 18:06:21 +0800 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2013-07-10 09:42:00 +0100 |
| commit | 89a8dcc9e8666111a42664d9185d39b04361d56f (patch) | |
| tree | a3997df2b4d83d3d343d4255ebcf631cbe75f326 /meta | |
| parent | 5b4494950d125a24927382a4a20af1b9403f1eb6 (diff) | |
| download | poky-89a8dcc9e8666111a42664d9185d39b04361d56f.tar.gz | |
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>
Diffstat (limited to 'meta')
3 files changed, 33 insertions, 2 deletions
diff --git a/meta/recipes-core/initscripts/initscripts-1.0/dmesg.sh b/meta/recipes-core/initscripts/initscripts-1.0/dmesg.sh new file mode 100644 index 0000000000..a97b0681e1 --- /dev/null +++ b/meta/recipes-core/initscripts/initscripts-1.0/dmesg.sh | |||
| @@ -0,0 +1,17 @@ | |||
| 1 | #!/bin/sh | ||
| 2 | ### BEGIN INIT INFO | ||
| 3 | # Provides: dmesg | ||
| 4 | # Required-Start: | ||
| 5 | # Required-Stop: | ||
| 6 | # Default-Start: S | ||
| 7 | # Default-Stop: | ||
| 8 | ### END INIT INFO | ||
| 9 | |||
| 10 | if [ -f /var/log/dmesg ]; then | ||
| 11 | if [ -f /usr/sbin/logrotate ]; then | ||
| 12 | logrotate -f /etc/logrotate-dmesg.conf | ||
| 13 | else | ||
| 14 | mv -f /var/log/dmesg /var/log/dmesg.old | ||
| 15 | fi | ||
| 16 | fi | ||
| 17 | dmesg -s 131072 > /var/log/dmesg | ||
diff --git a/meta/recipes-core/initscripts/initscripts-1.0/logrotate-dmesg.conf b/meta/recipes-core/initscripts/initscripts-1.0/logrotate-dmesg.conf new file mode 100644 index 0000000000..6f46e4216f --- /dev/null +++ b/meta/recipes-core/initscripts/initscripts-1.0/logrotate-dmesg.conf | |||
| @@ -0,0 +1,9 @@ | |||
| 1 | # see "man logrotate" for details | ||
| 2 | # rotate dmesg, and keep 5 versions. | ||
| 3 | |||
| 4 | /var/log/dmesg { | ||
| 5 | create | ||
| 6 | rotate 5 | ||
| 7 | nodateext | ||
| 8 | } | ||
| 9 | |||
diff --git a/meta/recipes-core/initscripts/initscripts_1.0.bb b/meta/recipes-core/initscripts/initscripts_1.0.bb index 531b2b62df..52e1c9cc94 100644 --- a/meta/recipes-core/initscripts/initscripts_1.0.bb +++ b/meta/recipes-core/initscripts/initscripts_1.0.bb | |||
| @@ -3,7 +3,7 @@ DESCRIPTION = "Initscripts provide the basic system startup initialization scrip | |||
| 3 | SECTION = "base" | 3 | SECTION = "base" |
| 4 | LICENSE = "GPLv2" | 4 | LICENSE = "GPLv2" |
| 5 | LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe" | 5 | LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe" |
| 6 | PR = "r140" | 6 | PR = "r141" |
| 7 | 7 | ||
| 8 | INHIBIT_DEFAULT_DEPS = "1" | 8 | INHIBIT_DEFAULT_DEPS = "1" |
| 9 | 9 | ||
| @@ -31,7 +31,10 @@ SRC_URI = "file://functions \ | |||
| 31 | file://read-only-rootfs-hook.sh \ | 31 | file://read-only-rootfs-hook.sh \ |
| 32 | file://volatiles \ | 32 | file://volatiles \ |
| 33 | file://save-rtc.sh \ | 33 | file://save-rtc.sh \ |
| 34 | file://GPLv2.patch" | 34 | file://GPLv2.patch \ |
| 35 | file://dmesg.sh \ | ||
| 36 | file://logrotate-dmesg.conf \ | ||
| 37 | " | ||
| 35 | 38 | ||
| 36 | SRC_URI_append_arm = " file://alignment.sh" | 39 | SRC_URI_append_arm = " file://alignment.sh" |
| 37 | 40 | ||
| @@ -89,6 +92,8 @@ do_install () { | |||
| 89 | install -m 0755 ${WORKDIR}/read-only-rootfs-hook.sh ${D}${sysconfdir}/init.d | 92 | install -m 0755 ${WORKDIR}/read-only-rootfs-hook.sh ${D}${sysconfdir}/init.d |
| 90 | install -m 0755 ${WORKDIR}/save-rtc.sh ${D}${sysconfdir}/init.d | 93 | install -m 0755 ${WORKDIR}/save-rtc.sh ${D}${sysconfdir}/init.d |
| 91 | install -m 0644 ${WORKDIR}/volatiles ${D}${sysconfdir}/default/volatiles/00_core | 94 | install -m 0644 ${WORKDIR}/volatiles ${D}${sysconfdir}/default/volatiles/00_core |
| 95 | install -m 0755 ${WORKDIR}/dmesg.sh ${D}${sysconfdir}/init.d | ||
| 96 | install -m 0644 ${WORKDIR}/logrotate-dmesg.conf ${D}${sysconfdir}/ | ||
| 92 | 97 | ||
| 93 | if [ "${TARGET_ARCH}" = "arm" ]; then | 98 | if [ "${TARGET_ARCH}" = "arm" ]; then |
| 94 | install -m 0755 ${WORKDIR}/alignment.sh ${D}${sysconfdir}/init.d | 99 | install -m 0755 ${WORKDIR}/alignment.sh ${D}${sysconfdir}/init.d |
