mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-23 02:05:57 +01:00
init: disable all userland processes started from init
In order to make the system easier to understand. These include: * networking * klogd and syslogd. TODO what are those for? I could not see anything useful that they do. Also get rid of the useless S20random thing while we are at it.
This commit is contained in:
@@ -1,44 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Copied from: package/ifupdown-scripts/S40network at
|
||||
# 8ce27bb9fee80a406a4199657ef90e3c315e7457
|
||||
#
|
||||
# We then just added this line to turn it off at runtime.
|
||||
#
|
||||
# We also considered copying the file at build to / and then
|
||||
# sourcing it from S98 to be a bit DRYer, but it wouldn't work
|
||||
# very well if some S50 requires networking to work.
|
||||
#
|
||||
# This became necessary nitially when aarch64 qemu and gem5
|
||||
# started using the same Buildroot output directory.
|
||||
[ -n "$lkmc_nonet" ] && exit 0
|
||||
|
||||
#
|
||||
# Start the network....
|
||||
#
|
||||
|
||||
# Debian ifupdown needs the /run/network lock directory
|
||||
mkdir -p /run/network
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
printf "Starting network: "
|
||||
/sbin/ifup -a
|
||||
[ $? = 0 ] && echo "OK" || echo "FAIL"
|
||||
;;
|
||||
stop)
|
||||
printf "Stopping network: "
|
||||
/sbin/ifdown -a
|
||||
[ $? = 0 ] && echo "OK" || echo "FAIL"
|
||||
;;
|
||||
restart|reload)
|
||||
"$0" stop
|
||||
"$0" start
|
||||
;;
|
||||
*)
|
||||
echo "Usage: $0 {start|stop|restart}"
|
||||
exit 1
|
||||
esac
|
||||
|
||||
exit $?
|
||||
|
||||
@@ -3,16 +3,8 @@ set -ex
|
||||
/rand_check.out
|
||||
|
||||
# Check if network is being replayed.
|
||||
#
|
||||
# TODO; requires internet to be up, which is done by inittab.
|
||||
# We could do this with a /etc/init.d/SXX file,
|
||||
# but how to both check that into git, and make it optional?
|
||||
#
|
||||
# https://superuser.com/questions/635020/how-to-know-current-time-from-internet-from-command-line-in-linux
|
||||
# Raw IP because was failing with hostname:
|
||||
# https://unix.stackexchange.com/questions/124283/busybox-ping-ip-works-but-hostname-nslookup-fails-with-bad-address
|
||||
# https://tf.nist.gov/tf-cgi/servers.cgi
|
||||
#
|
||||
#echo | nc 129.6.15.28 13
|
||||
|
||||
# busybox's poweroff panics, TODO why. Likely tries to kill shell.
|
||||
|
||||
Reference in New Issue
Block a user