Initial Commit
- initial default booting image
This commit is contained in:
62
package/initscripts/init.d/S11modules
Normal file
62
package/initscripts/init.d/S11modules
Normal file
@@ -0,0 +1,62 @@
|
||||
#!/bin/sh
|
||||
|
||||
MODULES_DIR="/etc/modules-load.d/"
|
||||
|
||||
[ -z "$(ls -A ${MODULES_DIR} 2> /dev/null)" ] && exit 0
|
||||
|
||||
load_unload() {
|
||||
for module_file in "${MODULES_DIR}"/*.conf; do
|
||||
while read -r module args; do
|
||||
|
||||
case "$module" in
|
||||
""|"#"*) continue ;;
|
||||
esac
|
||||
|
||||
if [ "$1" = "load" ]; then
|
||||
# shellcheck disable=SC2086 # We need word splitting for args
|
||||
modprobe -q "${module}" ${args} >/dev/null && \
|
||||
printf '%s ' "$module" || RET='FAIL'
|
||||
else
|
||||
rmmod "${module}" >/dev/null
|
||||
fi
|
||||
|
||||
done < "${module_file}"
|
||||
done
|
||||
|
||||
RET='OK'
|
||||
}
|
||||
|
||||
start() {
|
||||
printf 'Starting modules: '
|
||||
|
||||
load_unload load
|
||||
|
||||
echo $RET
|
||||
}
|
||||
|
||||
stop() {
|
||||
printf 'Stopping modules: '
|
||||
|
||||
load_unload unload
|
||||
|
||||
echo $RET
|
||||
}
|
||||
|
||||
restart() {
|
||||
stop
|
||||
sleep 1
|
||||
start
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
start|stop|restart)
|
||||
"$1";;
|
||||
reload)
|
||||
# Restart, since there is no true "reload" feature.
|
||||
restart;;
|
||||
*)
|
||||
echo "Usage: $0 {start|stop|restart|reload}"
|
||||
exit 1
|
||||
esac
|
||||
|
||||
# check-package Ignore missing DAEMON Variables
|
||||
28
package/initscripts/init.d/rcK
Executable file
28
package/initscripts/init.d/rcK
Executable file
@@ -0,0 +1,28 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Stop all init scripts in /etc/init.d
|
||||
# executing them in reversed numerical order.
|
||||
#
|
||||
# we need to reverse the order here, sort -r would be no less fragile
|
||||
# shellcheck disable=SC2045
|
||||
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
|
||||
# shellcheck source=/dev/null
|
||||
. "$i"
|
||||
)
|
||||
;;
|
||||
*)
|
||||
# No sh extension, so fork subprocess.
|
||||
"$i" stop
|
||||
;;
|
||||
esac
|
||||
done
|
||||
26
package/initscripts/init.d/rcS
Executable file
26
package/initscripts/init.d/rcS
Executable file
@@ -0,0 +1,26 @@
|
||||
#!/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
|
||||
# shellcheck source=/dev/null
|
||||
. "$i"
|
||||
)
|
||||
;;
|
||||
*)
|
||||
# No sh extension, so fork subprocess.
|
||||
"$i" start
|
||||
;;
|
||||
esac
|
||||
done
|
||||
Reference in New Issue
Block a user