From 87f47c8586b4afd0e74c7c39b9154f010d9369e3 Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Sun, 17 Mar 2013 15:09:44 +0100 Subject: [PATCH] busybox-syslog: Log to the MMC card if present If the first partition of a MMC card is mounted and has a logs/ directory syslog will start to write log messages to the MMC card in the directory /media/mmcblk0p1. --- recipes-apps/busybox/busybox_sysmocom.inc | 2 +- recipes-apps/busybox/files/syslog.conf | 22 ++++++++++++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 recipes-apps/busybox/files/syslog.conf diff --git a/recipes-apps/busybox/busybox_sysmocom.inc b/recipes-apps/busybox/busybox_sysmocom.inc index cc2a489..97e9710 100644 --- a/recipes-apps/busybox/busybox_sysmocom.inc +++ b/recipes-apps/busybox/busybox_sysmocom.inc @@ -1,6 +1,6 @@ SYSMOCOM := "${@os.path.dirname(bb.data.getVar('FILE', d, True))}" FILESEXTRAPATHS_prepend := "${SYSMOCOM}/files:" -PRINC = "11" +PRINC = "12" SRC_URI += "file://busybox-ifplugd.sh \ file://ifplugd.sh" diff --git a/recipes-apps/busybox/files/syslog.conf b/recipes-apps/busybox/files/syslog.conf new file mode 100644 index 0000000..4f387a0 --- /dev/null +++ b/recipes-apps/busybox/files/syslog.conf @@ -0,0 +1,22 @@ +DESTINATION="buffer" # log destinations (buffer file remote) +MARKINT=20 # intervall between --mark-- entries +LOGFILE=/var/log/messages # where to log (file) +REMOTE=loghost:514 # where to log (syslog remote) +REDUCE=no # reduce-size logging +#ROTATESIZE=0 # rotate log if grown beyond X [kByte] (incompatible with busybox) +#ROTATEGENS=3 # keep X generations of rotated logs (incompatible with busybox) +BUFFERSIZE=64 # size of circular buffer [kByte] +FOREGROUND=no # run in foreground (don't use!) +LOGLEVEL=4 + +# magic when a MMC card is mounted +USING_MMC_CARD=`/bin/mount | grep /media/mmcblk0p1 | wc -l` +if [ 1 -eq $USING_MMC_CARD ] ; then + if [ -e /media/mmcblk0p1/logs ] ; then + echo "Using mmc card" + LOGFILE=/media/mmcblk0p1/logs/messages + DESTINATION="file" + ROTATESIZE=2048 + ROTATEGENS=20 + fi +fi