2005-04-25 15:50:26 +02:00
|
|
|
# /usr/etc/rc - continued system initialization.
|
|
|
|
|
2005-08-02 17:46:24 +02:00
|
|
|
RANDOM_FILE=/usr/adm/random.dat
|
2005-08-05 12:37:02 +02:00
|
|
|
LOCAL_FILE=/usr/etc/rc.local
|
2005-08-02 17:46:24 +02:00
|
|
|
|
2013-03-06 19:27:47 +01:00
|
|
|
ARCH="`sysenv arch`"
|
|
|
|
|
|
|
|
if [ ! "$ARCH" ]
|
|
|
|
then # Older kernels do not provide an arch sysenv variable.
|
|
|
|
# We assume we are on x86 then, as existing systems with
|
|
|
|
# kernel and userland (i.e. this script) unsynchronized
|
|
|
|
# will be x86.
|
|
|
|
ARCH=i386
|
|
|
|
fi
|
|
|
|
|
2011-10-13 14:27:30 +02:00
|
|
|
# Get $SERVICES_DIRS
|
|
|
|
. /etc/rc.conf
|
|
|
|
|
|
|
|
# Directories to find services in
|
|
|
|
if [ ! "$SERVICES_DIRS" ]
|
2014-09-09 13:50:48 +02:00
|
|
|
then SERVICES_DIRS=/service
|
2011-10-13 14:27:30 +02:00
|
|
|
fi
|
|
|
|
|
2011-11-25 17:34:06 +01:00
|
|
|
# Booting from cd?
|
|
|
|
bootcd="`/bin/sysenv bootcd`"
|
|
|
|
|
2005-04-25 15:50:26 +02:00
|
|
|
case "$#:$1" in
|
2013-09-09 15:20:18 +02:00
|
|
|
1:autoboot)
|
|
|
|
action=start
|
|
|
|
;;
|
2005-04-25 15:50:26 +02:00
|
|
|
1:start|1:stop|1:down)
|
|
|
|
action=$1
|
|
|
|
;;
|
2013-09-09 15:20:18 +02:00
|
|
|
*) echo >&2 "Usage: $0 autoboot|start|stop|down"
|
2005-04-25 15:50:26 +02:00
|
|
|
exit 1
|
|
|
|
esac
|
|
|
|
|
2005-08-05 12:37:02 +02:00
|
|
|
if [ -f "$LOCAL_FILE" ]
|
|
|
|
then . "$LOCAL_FILE" $1
|
|
|
|
fi
|
|
|
|
|
2005-08-04 18:45:29 +02:00
|
|
|
disabled()
|
|
|
|
{
|
|
|
|
ifs="$IFS"; IFS=,
|
2005-08-04 19:00:18 +02:00
|
|
|
for skip in `sysenv disable`
|
2005-08-04 18:45:29 +02:00
|
|
|
do
|
2005-08-04 19:00:18 +02:00
|
|
|
if [ "$skip" = "$1" ]
|
2005-08-04 18:45:29 +02:00
|
|
|
then
|
|
|
|
IFS="$ifs"; unset ifs
|
|
|
|
return 0
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
IFS="$ifs"; unset ifs
|
|
|
|
return 1
|
|
|
|
}
|
|
|
|
|
2005-04-25 15:50:26 +02:00
|
|
|
daemonize()
|
|
|
|
{
|
|
|
|
# Function to start a daemon, if it exists.
|
|
|
|
local IFS=':'
|
|
|
|
local name="$1"
|
|
|
|
test "$1" = tcpd && name="$2"
|
|
|
|
|
|
|
|
for dir in $PATH
|
|
|
|
do
|
|
|
|
if [ -f "$dir/$1" ]
|
|
|
|
then
|
2005-08-04 18:45:29 +02:00
|
|
|
|
|
|
|
# check if this service is disabled at the boot monitor.
|
|
|
|
if disabled $name; then return; fi
|
|
|
|
|
2005-04-25 15:50:26 +02:00
|
|
|
echo -n " $name"
|
|
|
|
"$@" &
|
|
|
|
return
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
}
|
|
|
|
|
2005-08-02 17:46:24 +02:00
|
|
|
up()
|
|
|
|
{
|
2010-07-05 21:37:08 +02:00
|
|
|
# Function to dynamically start a system service
|
|
|
|
opt=""
|
|
|
|
prefix=$(expr "$1 " : '\(-\)')
|
|
|
|
if [ "$prefix" = "-" ];
|
|
|
|
then
|
|
|
|
opt=$1
|
|
|
|
shift
|
|
|
|
fi
|
2005-08-02 17:46:24 +02:00
|
|
|
service=$1
|
2005-11-28 16:39:01 +01:00
|
|
|
shift
|
2005-08-02 17:46:24 +02:00
|
|
|
|
|
|
|
# First check if this service is disabled at the boot monitor.
|
2005-08-04 18:45:29 +02:00
|
|
|
if disabled $service; then return; fi
|
2005-08-02 17:46:24 +02:00
|
|
|
|
|
|
|
# Service is not disabled. Try to bring it up.
|
2011-10-13 14:27:30 +02:00
|
|
|
found=""
|
|
|
|
for dir in $SERVICES_DIRS
|
|
|
|
do bin=$dir/$service
|
|
|
|
if [ -x $bin -a -z "$found" ]
|
|
|
|
then service $opt up $bin "$@"
|
|
|
|
echo -n " $service"
|
|
|
|
found=yes
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
if [ -z "$found" ]
|
|
|
|
then echo " ($service not found in $SERVICES_DIRS)"
|
|
|
|
fi
|
2005-08-02 17:46:24 +02:00
|
|
|
}
|
2005-07-19 14:16:55 +02:00
|
|
|
|
2010-05-18 00:22:53 +02:00
|
|
|
get_eth_labels() {
|
|
|
|
# Filter out the non-vlan ethernet entries from inet.conf.
|
|
|
|
# Produce as output a list of "drivername_instancenr"-formatted labels.
|
2012-06-19 18:03:11 +02:00
|
|
|
sed 's/\008/ /g' /etc/inet.conf | \
|
2010-05-18 00:22:53 +02:00
|
|
|
sed -n 's/^ *eth[0-9][0-9]* *\([^ ][^ ]*\) *\([0-9][0-9]*\).*$/\1_\2/p' | \
|
|
|
|
grep -v '^vlan_'
|
|
|
|
}
|
2006-04-11 13:55:45 +02:00
|
|
|
|
2013-08-22 17:22:01 +02:00
|
|
|
# Detect expansion boards on the BeagleBone and load the proper drivers.
|
|
|
|
capemgr() {
|
|
|
|
|
|
|
|
# Probe each possible cape EEPROM slave address for a BeagleBone cape.
|
|
|
|
for slave_addr in 54 55 56 57
|
|
|
|
do
|
|
|
|
|
|
|
|
# See if there is a readable EEPROM with address ${slave_addr}.
|
|
|
|
eepromread -f /dev/i2c-3 -a 0x${slave_addr} > /dev/null 2>&1
|
|
|
|
RESULT=$?
|
|
|
|
if [ $RESULT -eq 0 ]
|
|
|
|
then
|
|
|
|
|
|
|
|
# Found an alive EEPROM. Try reading the cape name.
|
|
|
|
CAPE=`eepromread -i -f /dev/i2c-3 -a 0x${slave_addr} | \
|
|
|
|
sed -n 's/^PART_NUMBER : \(.*\)$/\1/p' | \
|
|
|
|
sed -e 's/\.*$//g'` # Strip trailing periods.
|
|
|
|
|
|
|
|
# Look for a cape specific RC script.
|
|
|
|
if [ -x /etc/rc.capes/${CAPE} ]
|
|
|
|
then
|
|
|
|
|
|
|
|
# CAT24C256 EEPROM -- all capes have this chip.
|
|
|
|
test -e /dev/eepromb3s${slave_addr} || \
|
|
|
|
(cd /dev && MAKEDEV eepromb3s${slave_addr})
|
|
|
|
up cat24c256 -dev /dev/eepromb3s${slave_addr} \
|
|
|
|
-label cat24c256.3.${slave_addr} \
|
|
|
|
-args "bus=3 address=0x${slave_addr}"
|
|
|
|
|
|
|
|
# Load the drivers for the cape and do any other configuration.
|
|
|
|
. "/etc/rc.capes/${CAPE}"
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
echo ""
|
|
|
|
echo "** UNSUPPORTED CAPE: ${CAPE}"
|
|
|
|
echo ""
|
|
|
|
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
}
|
|
|
|
|
2006-04-11 13:55:45 +02:00
|
|
|
DAEMONS=/etc/rc.daemons
|
|
|
|
|
2005-04-25 15:50:26 +02:00
|
|
|
case $action in
|
2013-09-09 15:20:18 +02:00
|
|
|
start|autoboot)
|
2005-04-25 15:50:26 +02:00
|
|
|
# Select console font.
|
|
|
|
test -f /etc/font && loadfont /etc/font </dev/console
|
|
|
|
|
|
|
|
# Cleanup.
|
2012-01-16 11:46:14 +01:00
|
|
|
rm -rf /tmp/* /usr/run/* /usr/spool/lpd/* /usr/spool/locks/*
|
2005-04-25 15:50:26 +02:00
|
|
|
|
2005-08-04 11:26:36 +02:00
|
|
|
# Start servers and drivers set at the boot monitor.
|
2005-08-11 15:22:31 +02:00
|
|
|
echo -n "Starting services:"
|
2013-08-30 11:14:03 +02:00
|
|
|
up -n random -dev /dev/random -period 3HZ
|
2005-08-03 17:22:41 +02:00
|
|
|
|
2005-07-19 14:16:55 +02:00
|
|
|
# load random number generator
|
|
|
|
if [ -f $RANDOM_FILE ]
|
|
|
|
then
|
|
|
|
cat < $RANDOM_FILE >/dev/random
|
|
|
|
# overwrite $RANDOM_FILE. We don't want to use this data again
|
2005-08-02 17:56:24 +02:00
|
|
|
dd if=/dev/random of=$RANDOM_FILE bs=1024 count=1 2> /dev/null
|
2005-07-19 14:16:55 +02:00
|
|
|
fi
|
|
|
|
|
2010-05-18 00:22:53 +02:00
|
|
|
# start network driver instances for all configured ethernet devices
|
|
|
|
for label in $(get_eth_labels); do
|
|
|
|
driver=$(echo $label | sed 's/\(.*\)_.*/\1/')
|
|
|
|
instance=$(echo $label | sed 's/.*_//')
|
|
|
|
eval arg=\$${label}_arg
|
|
|
|
if [ ! -z "$arg" ]; then arg=" $arg"; fi
|
|
|
|
arg="-args \"instance=$instance$arg\""
|
|
|
|
eval up $driver -label $label $arg -period 5HZ
|
2005-08-04 11:26:36 +02:00
|
|
|
done
|
2011-04-07 09:44:23 +02:00
|
|
|
if [ X`/bin/sysenv lwip` = Xyes ]
|
|
|
|
then
|
2013-09-10 20:25:01 +02:00
|
|
|
up lwip -script /etc/rs.inet -dev /dev/ip
|
2011-04-07 09:44:23 +02:00
|
|
|
else
|
2013-09-10 20:25:01 +02:00
|
|
|
up inet -script /etc/rs.inet -dev /dev/ip
|
2011-04-07 09:44:23 +02:00
|
|
|
fi
|
2013-03-06 19:27:47 +01:00
|
|
|
|
2014-02-24 23:28:12 +01:00
|
|
|
up pty -dev /dev/ptyp0
|
|
|
|
|
2013-10-04 16:29:40 +02:00
|
|
|
up uds -dev /dev/uds
|
|
|
|
|
2010-07-05 21:37:08 +02:00
|
|
|
up -n ipc
|
2013-03-06 19:27:47 +01:00
|
|
|
|
2013-09-21 17:35:15 +02:00
|
|
|
up log -dev /dev/klog
|
|
|
|
|
2013-03-06 19:27:47 +01:00
|
|
|
if [ $ARCH = i386 ]
|
|
|
|
then
|
|
|
|
up -n printer -dev /dev/lp -period 10HZ
|
|
|
|
# start VirtualBox time sync driver if the device is there
|
|
|
|
if grep '^[^ ]* [^ ]* 80EE:CAFE ' /proc/pci >/dev/null; then
|
|
|
|
up -n vbox -period 10HZ
|
|
|
|
fi
|
2011-11-23 18:15:43 +01:00
|
|
|
fi
|
2013-03-06 19:27:47 +01:00
|
|
|
|
2005-08-02 17:46:24 +02:00
|
|
|
echo .
|
2005-04-25 15:50:26 +02:00
|
|
|
|
|
|
|
# Network initialization.
|
|
|
|
(: </dev/tcp) 2>/dev/null && net=t # Is there a TCP/IP server?
|
|
|
|
|
|
|
|
echo -n "Starting daemons:"
|
|
|
|
daemonize update
|
2005-05-03 17:41:02 +02:00
|
|
|
|
|
|
|
# Ugly error message when starting cron from CD.
|
|
|
|
# (and cron unnecessary then so..)
|
|
|
|
if [ ! -f /CD ]
|
2006-04-04 15:44:23 +02:00
|
|
|
then daemonize cron
|
2006-04-04 15:31:56 +02:00
|
|
|
else mkdir /tmp/log
|
2006-04-04 15:44:23 +02:00
|
|
|
rm -f /var/log || true
|
2006-04-04 15:31:56 +02:00
|
|
|
ln -s /tmp/log /var/log || true
|
|
|
|
. /etc/rc.cd
|
2005-05-03 17:41:02 +02:00
|
|
|
fi
|
2006-04-04 18:12:08 +02:00
|
|
|
# syslogd has not been started yet
|
2006-04-05 11:29:18 +02:00
|
|
|
rm -f /var/run/syslogd.pid
|
2006-04-04 13:52:57 +02:00
|
|
|
daemonize syslogd
|
2005-08-02 17:56:24 +02:00
|
|
|
echo .
|
2005-04-25 15:50:26 +02:00
|
|
|
|
2013-07-15 16:29:09 +02:00
|
|
|
# i2c only supported on ARM at the moment
|
|
|
|
if [ $ARCH = earm ]
|
|
|
|
then
|
|
|
|
echo -n "Starting i2c subsystem: "
|
|
|
|
for bus in 1 2 3
|
|
|
|
do
|
|
|
|
test -e /dev/i2c-${bus} || (cd /dev && MAKEDEV i2c-${bus})
|
|
|
|
up i2c -dev /dev/i2c-${bus} -label i2c.${bus} \
|
|
|
|
-args instance=${bus}
|
|
|
|
done
|
|
|
|
echo .
|
2013-07-15 16:29:37 +02:00
|
|
|
|
2014-01-10 12:20:59 +01:00
|
|
|
BOARD_NAME=`sysenv board`
|
2013-07-15 16:29:37 +02:00
|
|
|
case "${BOARD_NAME}" in
|
2013-07-29 19:01:38 +02:00
|
|
|
|
2014-01-10 12:20:59 +01:00
|
|
|
ARM-ARMV7-TI-BB-WHITE)
|
|
|
|
echo "Running on a BeagleBone"
|
2013-07-15 16:29:37 +02:00
|
|
|
echo -n "Starting i2c device drivers: "
|
2013-07-29 19:01:38 +02:00
|
|
|
|
|
|
|
# start EEPROM driver for reading board info
|
|
|
|
test -e /dev/eepromb1s50 || \
|
|
|
|
(cd /dev && MAKEDEV eepromb1s50)
|
2013-07-15 16:29:37 +02:00
|
|
|
up cat24c256 -dev /dev/eepromb1s50 \
|
2013-08-02 16:10:48 +02:00
|
|
|
-label cat24c256.1.50 \
|
|
|
|
-args 'bus=1 address=0x50'
|
|
|
|
|
|
|
|
# Start TPS65217 driver for power management.
|
|
|
|
up tps65217 -label tps65217.1.24 \
|
|
|
|
-args 'bus=1 address=0x24'
|
|
|
|
|
2013-07-29 19:01:38 +02:00
|
|
|
# check for the presence of a display
|
|
|
|
eepromread -f /dev/i2c-2 -n > /dev/null 2>&1
|
|
|
|
RESULT=$?
|
|
|
|
if [ $RESULT -eq 0 ]
|
|
|
|
then
|
|
|
|
# start eeprom driver for reading EDID.
|
|
|
|
test -e /dev/eepromb2s50 || \
|
|
|
|
(cd /dev && MAKEDEV eepromb2s50)
|
|
|
|
up cat24c256 -dev /dev/eepromb2s50 \
|
|
|
|
-label cat24c256.2.50 \
|
|
|
|
-args 'bus=2 address=0x50'
|
|
|
|
|
|
|
|
# start frame buffer
|
|
|
|
#up fb -dev /dev/fb0 -args edid.0=cat24c256.2.50
|
|
|
|
# fb hasn't been ported to AM335X yet.
|
|
|
|
fi
|
|
|
|
|
2014-08-08 17:50:03 +02:00
|
|
|
if [ -e /service/usbd ]
|
2014-05-26 16:47:53 +02:00
|
|
|
then
|
|
|
|
echo "Starting USBD"
|
|
|
|
up usbd
|
|
|
|
fi
|
2013-08-22 17:22:01 +02:00
|
|
|
# Detect expansion boards and start drivers.
|
|
|
|
capemgr
|
|
|
|
|
2013-07-15 16:29:37 +02:00
|
|
|
;;
|
2013-07-29 19:01:38 +02:00
|
|
|
|
2014-01-10 12:20:59 +01:00
|
|
|
ARM-ARMV7-TI-BB-BLACK)
|
|
|
|
echo "Running on a BeagleBone Black"
|
2013-07-15 16:29:37 +02:00
|
|
|
echo -n "Starting i2c device drivers: "
|
2013-07-29 19:01:38 +02:00
|
|
|
|
|
|
|
# start EEPROM driver for reading board info
|
|
|
|
test -e /dev/eepromb1s50 || \
|
|
|
|
(cd /dev && MAKEDEV eepromb1s50)
|
2013-07-15 16:29:37 +02:00
|
|
|
up cat24c256 -dev /dev/eepromb1s50 \
|
2013-07-29 19:01:38 +02:00
|
|
|
-label cat24c256.1.50 \
|
|
|
|
-args 'bus=1 address=0x50'
|
2013-07-29 18:21:33 +02:00
|
|
|
|
2013-08-02 16:10:48 +02:00
|
|
|
# Start TPS65217 driver for power management.
|
|
|
|
up tps65217 -label tps65217.1.24 \
|
|
|
|
-args 'bus=1 address=0x24'
|
|
|
|
|
|
|
|
# Start TDA19988 driver for reading EDID.
|
2013-07-29 18:21:33 +02:00
|
|
|
up tda19988 -label tda19988.1.3470 -args \
|
|
|
|
'cec_bus=1 cec_address=0x34 hdmi_bus=1 hdmi_address=0x70'
|
2013-07-29 19:01:38 +02:00
|
|
|
|
|
|
|
# start frame buffer
|
|
|
|
#up fb -dev /dev/fb0 -args edid.0=tda19988.1.3470
|
|
|
|
# fb hasn't been ported to AM335X yet.
|
|
|
|
|
2014-08-08 17:50:03 +02:00
|
|
|
if [ -e /service/usbd ]
|
2014-05-26 16:47:53 +02:00
|
|
|
then
|
|
|
|
echo "Starting USBD"
|
|
|
|
up usbd
|
|
|
|
fi
|
2013-08-22 17:22:01 +02:00
|
|
|
# Detect expansion boards and start drivers.
|
|
|
|
capemgr
|
|
|
|
|
2013-07-15 16:29:37 +02:00
|
|
|
;;
|
2013-07-29 19:01:38 +02:00
|
|
|
|
2014-01-10 12:20:59 +01:00
|
|
|
ARM-ARMV7-TI-BBXM-GENERIC)
|
|
|
|
echo "Running on a BeagleBoard-xM"
|
2013-07-15 16:29:37 +02:00
|
|
|
echo -n "Starting i2c device drivers: "
|
2013-08-06 15:52:46 +02:00
|
|
|
|
|
|
|
# Start TPS65950 driver for power management.
|
|
|
|
up tps65950 -label tps65950.1.48 \
|
|
|
|
-args 'bus=1 address=0x48'
|
|
|
|
|
2013-08-07 03:34:08 +02:00
|
|
|
# Set the system time to the time in the TPS65950's RTC
|
|
|
|
readclock
|
|
|
|
|
2013-07-29 19:01:38 +02:00
|
|
|
# check for the presence of a display
|
|
|
|
eepromread -f /dev/i2c-3 -n > /dev/null 2>&1
|
|
|
|
RESULT=$?
|
|
|
|
if [ $RESULT -eq 0 ]
|
|
|
|
then
|
|
|
|
# start eeprom driver for reading edid
|
|
|
|
test -e /dev/eepromb3s50 || \
|
|
|
|
(cd /dev && MAKEDEV eepromb3s50)
|
|
|
|
up cat24c256 -dev /dev/eepromb3s50 \
|
|
|
|
-label cat24c256.3.50 \
|
|
|
|
-args 'bus=3 address=0x50'
|
|
|
|
|
|
|
|
# start frame buffer
|
|
|
|
up fb -dev /dev/fb0 -args edid.0=cat24c256.3.50
|
|
|
|
fi
|
|
|
|
|
2013-07-15 16:29:37 +02:00
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
echo .
|
2013-07-15 16:29:09 +02:00
|
|
|
fi
|
|
|
|
|
2005-04-25 15:50:26 +02:00
|
|
|
if [ "$net" ]
|
|
|
|
then
|
|
|
|
if [ -f /etc/rc.net ]
|
|
|
|
then
|
|
|
|
# Let a customized TCP/IP initialization script figure it out.
|
|
|
|
. /etc/rc.net
|
|
|
|
else
|
|
|
|
# Standard network daemons.
|
2005-08-02 17:56:24 +02:00
|
|
|
echo -n "Starting networking:"
|
2010-07-02 13:22:42 +02:00
|
|
|
if grep -s 'psip0.*default' /etc/inet.conf >/dev/null
|
2006-03-28 14:35:33 +02:00
|
|
|
then ifconfig -h 10.0.0.1
|
2010-04-08 15:41:35 +02:00
|
|
|
else
|
2011-04-07 09:44:23 +02:00
|
|
|
if [ X`/bin/sysenv lwip` = Xyes ]
|
|
|
|
then
|
|
|
|
dhcpd --lwip &
|
|
|
|
echo -n " dhcpd"
|
|
|
|
else
|
|
|
|
daemonize dhcpd
|
|
|
|
fi
|
2006-03-28 14:35:33 +02:00
|
|
|
fi
|
2006-04-11 15:42:58 +02:00
|
|
|
daemonize nonamed -L
|
2006-04-11 13:55:45 +02:00
|
|
|
if [ -f "$DAEMONS" ]
|
|
|
|
then . "$DAEMONS"
|
|
|
|
fi
|
2005-08-10 17:19:50 +02:00
|
|
|
# The last daemon has been started, so close the list:
|
|
|
|
echo .
|
2005-04-25 15:50:26 +02:00
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ "$net" ]
|
|
|
|
then
|
|
|
|
# Get the nodename from the DNS and set it.
|
|
|
|
trap '' 2
|
2007-02-09 17:28:34 +01:00
|
|
|
intr -t 20 hostaddr -h
|
2005-04-25 15:50:26 +02:00
|
|
|
trap 2
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Recover files being edited when the system crashed.
|
|
|
|
test -f /usr/bin/elvprsv && elvprsv /usr/tmp/elv*
|
|
|
|
|
|
|
|
# Run the daily cleanup on systems that are not on at night.
|
|
|
|
test -f /usr/etc/daily && sh /usr/etc/daily boot &
|
2005-07-19 14:16:55 +02:00
|
|
|
;;
|
|
|
|
stop|down)
|
2006-01-18 10:33:09 +01:00
|
|
|
# Save random data, if /usr is mounted rw.
|
2012-11-22 23:00:00 +01:00
|
|
|
if grep ' \/usr .*rw.*' /etc/mtab >/dev/null
|
2006-01-18 10:33:09 +01:00
|
|
|
then
|
|
|
|
if dd if=/dev/random of=$RANDOM_FILE.new bs=1024 count=1 2>/dev/null
|
|
|
|
then
|
2005-07-19 14:16:55 +02:00
|
|
|
mv $RANDOM_FILE.new $RANDOM_FILE
|
2006-01-18 10:33:09 +01:00
|
|
|
else
|
|
|
|
echo 'Failed to save random data.'
|
|
|
|
fi
|
2005-07-19 14:16:55 +02:00
|
|
|
fi
|
2005-04-25 15:50:26 +02:00
|
|
|
esac
|
2006-02-17 17:46:08 +01:00
|
|
|
|
2010-08-03 13:18:18 +02:00
|
|
|
d=
|
2006-02-17 17:46:08 +01:00
|
|
|
# Let packages run their own scripts
|
2010-08-03 13:18:18 +02:00
|
|
|
for d in /usr/local/etc/rc.d /usr/pkg/etc/rc.d
|
|
|
|
do
|
2011-11-25 17:34:06 +01:00
|
|
|
if [ -d "$d" -a -z "$bootcd" ]
|
2010-08-03 13:18:18 +02:00
|
|
|
then ( if cd $d
|
2006-02-17 17:46:08 +01:00
|
|
|
then
|
2006-02-20 16:11:41 +01:00
|
|
|
echo -n "Local packages ($action): "
|
2006-02-17 17:46:08 +01:00
|
|
|
for f in *
|
|
|
|
do
|
|
|
|
if [ -x "$f" ]
|
|
|
|
then echo -n "$f "
|
|
|
|
sh "$f" "$action"
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
echo " done."
|
|
|
|
fi
|
2010-08-03 13:18:18 +02:00
|
|
|
)
|
2006-02-17 17:46:08 +01:00
|
|
|
fi
|
2010-08-03 13:18:18 +02:00
|
|
|
done
|