Commit 7187ce93 authored by Alessandro Rubini's avatar Alessandro Rubini

build: configure rsyslog at run-time, not build-time

Signed-off-by: Alessandro Rubini's avatarAlessandro Rubini <rubini@gnudd.com>
parent 6d4631ff
......@@ -47,14 +47,6 @@ rm -rf $TMPFS/dev
(cd $TMPFS && tar xzf $DEVTAR)
(cd $TMPFS && ln -fs sbin/init .)
if [ "$CONFIG_REMOTE_SYSLOG_UDP" = "y" ]; then
sed -i 's/@@remote-host/@remote-host/' $TMPFS/etc/rsyslog.conf
fi
if [ ! -z "$CONFIG_REMOTE_SYSLOG_SERVER" ]; then
sed -i '/remote-host/ s/^##//' $TMPFS/etc/rsyslog.conf
sed -i 's/remote-host/$CONFIG_REMOTE_SYSLOG_SERVER/' $TMPFS/etc/rsyslog.conf
fi
# Fix SNMP values: for all not-empty configs remove commend and replace value
cfgfile="$TMPFS/wr/etc/snmpd.conf"
set | grep CONFIG_SNMP | sed 's/=/ /' | while read varname value; do
......
......@@ -47,5 +47,15 @@ if [ ! -z "$CONFIG_DNS_SERVER" ]; then
fi
copy_conf /etc/resolv.conf /usr/etc/resolv.conf
# rsyslog.conf is created from a template file, and busybox sed has -i
cp /usr/etc/rsyslog.conf.in $T
if [ "$CONFIG_REMOTE_SYSLOG_UDP" = "y" ]; then
sed -i 's/@@remote-host/@remote-host/' $T
fi
if [ ! -z "$CONFIG_REMOTE_SYSLOG_SERVER" ]; then
sed -i '/remote-host/ s/^##//' $T
sed -i "s/remote-host/$CONFIG_REMOTE_SYSLOG_SERVER/" $T
fi
copy_conf /etc/rsyslog.conf /usr/etc/rsyslog.conf
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment