Import buildroot 2016.02.01
This commit is contained in:
4
firmware/buildroot/package/initscripts/Config.in
Normal file
4
firmware/buildroot/package/initscripts/Config.in
Normal file
@@ -0,0 +1,4 @@
|
||||
config BR2_PACKAGE_INITSCRIPTS
|
||||
bool
|
||||
help
|
||||
The basics startup scripts for both SysV and Busybox
|
||||
51
firmware/buildroot/package/initscripts/init.d/S20urandom
Executable file
51
firmware/buildroot/package/initscripts/init.d/S20urandom
Executable file
@@ -0,0 +1,51 @@
|
||||
#! /bin/sh
|
||||
#
|
||||
# urandom This script saves the random seed between reboots.
|
||||
# It is called from the boot, halt and reboot scripts.
|
||||
#
|
||||
# Version: @(#)urandom 1.33 22-Jun-1998 miquels@cistron.nl
|
||||
#
|
||||
|
||||
[ -c /dev/urandom ] || exit 0
|
||||
#. /etc/default/rcS
|
||||
|
||||
case "$1" in
|
||||
start|"")
|
||||
# check for read only file system
|
||||
if ! touch /etc/random-seed 2>/dev/null
|
||||
then
|
||||
echo "read-only file system detected...done"
|
||||
exit
|
||||
fi
|
||||
if [ "$VERBOSE" != no ]
|
||||
then
|
||||
printf "Initializing random number generator... "
|
||||
fi
|
||||
# Load and then save 512 bytes,
|
||||
# which is the size of the entropy pool
|
||||
cat /etc/random-seed >/dev/urandom
|
||||
rm -f /etc/random-seed
|
||||
umask 077
|
||||
dd if=/dev/urandom of=/etc/random-seed count=1 \
|
||||
>/dev/null 2>&1 || echo "urandom start: failed."
|
||||
umask 022
|
||||
[ "$VERBOSE" != no ] && echo "done."
|
||||
;;
|
||||
stop)
|
||||
if ! touch /etc/random-seed 2>/dev/null
|
||||
then
|
||||
exit
|
||||
fi
|
||||
# Carry a random seed from shut-down to start-up;
|
||||
# see documentation in linux/drivers/char/random.c
|
||||
[ "$VERBOSE" != no ] && printf "Saving random seed... "
|
||||
umask 077
|
||||
dd if=/dev/urandom of=/etc/random-seed count=1 \
|
||||
>/dev/null 2>&1 || echo "urandom stop: failed."
|
||||
[ "$VERBOSE" != no ] && echo "done."
|
||||
;;
|
||||
*)
|
||||
echo "Usage: urandom {start|stop}" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
28
firmware/buildroot/package/initscripts/init.d/S40network
Executable file
28
firmware/buildroot/package/initscripts/init.d/S40network
Executable file
@@ -0,0 +1,28 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Start the network....
|
||||
#
|
||||
|
||||
# Debian ifupdown needs the /run/network lock directory
|
||||
mkdir -p /run/network
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
echo "Starting network..."
|
||||
/sbin/ifup -a
|
||||
;;
|
||||
stop)
|
||||
printf "Stopping network..."
|
||||
/sbin/ifdown -a
|
||||
;;
|
||||
restart|reload)
|
||||
"$0" stop
|
||||
"$0" start
|
||||
;;
|
||||
*)
|
||||
echo "Usage: $0 {start|stop|restart}"
|
||||
exit 1
|
||||
esac
|
||||
|
||||
exit $?
|
||||
|
||||
27
firmware/buildroot/package/initscripts/init.d/rcK
Executable file
27
firmware/buildroot/package/initscripts/init.d/rcK
Executable file
@@ -0,0 +1,27 @@
|
||||
#!/bin/sh
|
||||
|
||||
|
||||
# Stop all init scripts in /etc/init.d
|
||||
# executing them in reversed numerical order.
|
||||
#
|
||||
for i in $(ls -r /etc/init.d/S??*) ;do
|
||||
|
||||
# Ignore dangling symlinks (if any).
|
||||
[ ! -f "$i" ] && continue
|
||||
|
||||
case "$i" in
|
||||
*.sh)
|
||||
# Source shell script for speed.
|
||||
(
|
||||
trap - INT QUIT TSTP
|
||||
set stop
|
||||
. $i
|
||||
)
|
||||
;;
|
||||
*)
|
||||
# No sh extension, so fork subprocess.
|
||||
$i stop
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
27
firmware/buildroot/package/initscripts/init.d/rcS
Executable file
27
firmware/buildroot/package/initscripts/init.d/rcS
Executable file
@@ -0,0 +1,27 @@
|
||||
#!/bin/sh
|
||||
|
||||
|
||||
# Start all init scripts in /etc/init.d
|
||||
# executing them in numerical order.
|
||||
#
|
||||
for i in /etc/init.d/S??* ;do
|
||||
|
||||
# Ignore dangling symlinks (if any).
|
||||
[ ! -f "$i" ] && continue
|
||||
|
||||
case "$i" in
|
||||
*.sh)
|
||||
# Source shell script for speed.
|
||||
(
|
||||
trap - INT QUIT TSTP
|
||||
set start
|
||||
. $i
|
||||
)
|
||||
;;
|
||||
*)
|
||||
# No sh extension, so fork subprocess.
|
||||
$i start
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
15
firmware/buildroot/package/initscripts/initscripts.mk
Normal file
15
firmware/buildroot/package/initscripts/initscripts.mk
Normal file
@@ -0,0 +1,15 @@
|
||||
################################################################################
|
||||
#
|
||||
# initscripts
|
||||
#
|
||||
################################################################################
|
||||
|
||||
# source included in buildroot
|
||||
INITSCRIPTS_SOURCE =
|
||||
|
||||
define INITSCRIPTS_INSTALL_TARGET_CMDS
|
||||
mkdir -p $(TARGET_DIR)/etc/init.d
|
||||
$(INSTALL) -D -m 0755 package/initscripts/init.d/* $(TARGET_DIR)/etc/init.d/
|
||||
endef
|
||||
|
||||
$(eval $(generic-package))
|
||||
Reference in New Issue
Block a user