summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta/recipes-core/initscripts/initscripts-1.0/dmesg.sh17
-rw-r--r--meta/recipes-core/initscripts/initscripts-1.0/logrotate-dmesg.conf9
-rw-r--r--meta/recipes-core/initscripts/initscripts_1.0.bb9
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
10if [ -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
16fi
17dmesg -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
3SECTION = "base" 3SECTION = "base"
4LICENSE = "GPLv2" 4LICENSE = "GPLv2"
5LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe" 5LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe"
6PR = "r140" 6PR = "r141"
7 7
8INHIBIT_DEFAULT_DEPS = "1" 8INHIBIT_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
36SRC_URI_append_arm = " file://alignment.sh" 39SRC_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