#!/bin/sh
#
# /etc/rc.d/rc.local:  Local system initialization script.
#
# Put any local setup commands in here:

NOLOG=0
if [ `grep -i "verbosity=0" /proc/cmdline|wc -l` -gt 0 ]; then
  NOLOG=1
fi
if [ `grep -i "verbosity=0" /etc/ping.conf|wc -l` -gt 0 ]; then
  NOLOG=1
fi

# We may use a RO squashfs...
#
touch /test >/dev/null 2>&1
if [ ! -e /test ]; then
  mkdir /mnt/tmp
  mount -n tmpfs -t tmpfs /mnt/tmp
  mkdir /mnt/tmp/log
else
  rm -f /test
fi

# To avoid having kernel complain about no /lib/modules/etc.
# We don't compile any module anyway.
#
if [ ! -e /lib/modules ]; then
  mkdir /lib/modules
fi
if [ ! -e /lib/modules/`uname -r` ]; then
  mkdir /lib/modules/`uname -r`
fi
if [ ! -e /lib/modules/`uname -r`/modules.dep ]; then
  touch /lib/modules/`uname -r`/modules.dep
fi

# No power saving...
#
setterm -blank 0

# Apply ld.so.conf.d/*.conf
#
/sbin/ldconfig

# Launch PING
#
if [ $NOLOG -eq 1 ]; then
  /opt/PING/rc.ping 2>/dev/null
else
  /opt/PING/rc.ping
fi

